From f20d9a359cab83a76a3fc3ab66ccaaaf96ea96ee Mon Sep 17 00:00:00 2001 From: rockerBOO Date: Thu, 7 Nov 2024 14:28:16 -0500 Subject: [PATCH] Update tests, vite handling packaging, e2e, unit --- Makefile | 50 +- crates/inspector/src/weight.rs | 41 +- crates/lora-inspector-wasm/.gitignore | 8 + crates/lora-inspector-wasm/.yarnrc.yml | 1 + crates/lora-inspector-wasm/LICENSE | 21 + crates/lora-inspector-wasm/README.md | 27 + .../js/chartist-plugin-pointlabels.min.js | 75 - .../assets/js/chartist.min.js | 2391 ----- crates/lora-inspector-wasm/assets/js/main.js | 94 +- .../assets/js/moduleBlocks.js | 220 + .../assets/js/react-dom.production.min.js | 8615 ----------------- .../assets/js/react.production.min.js | 681 -- .../lora-inspector-wasm/assets/js/worker.js | 373 +- crates/lora-inspector-wasm/biome.json | 30 + .../{tests => e2e-tests}/index.spec.js | 3 +- crates/lora-inspector-wasm/index.html | 24 +- crates/lora-inspector-wasm/package.json | 29 +- crates/lora-inspector-wasm/postcss.config.js | 13 + crates/lora-inspector-wasm/src/worker.rs | 1 - crates/lora-inspector-wasm/tests/worker.js | 175 + crates/lora-inspector-wasm/vite.config.js | 36 + index.html | 78 - 22 files changed, 800 insertions(+), 12186 deletions(-) create mode 100644 crates/lora-inspector-wasm/.yarnrc.yml create mode 100644 crates/lora-inspector-wasm/LICENSE create mode 100644 crates/lora-inspector-wasm/README.md delete mode 100644 crates/lora-inspector-wasm/assets/js/chartist-plugin-pointlabels.min.js delete mode 100644 crates/lora-inspector-wasm/assets/js/chartist.min.js create mode 100644 crates/lora-inspector-wasm/assets/js/moduleBlocks.js delete mode 100644 crates/lora-inspector-wasm/assets/js/react-dom.production.min.js delete mode 100644 crates/lora-inspector-wasm/assets/js/react.production.min.js create mode 100644 crates/lora-inspector-wasm/biome.json rename crates/lora-inspector-wasm/{tests => e2e-tests}/index.spec.js (95%) create mode 100644 crates/lora-inspector-wasm/postcss.config.js create mode 100644 crates/lora-inspector-wasm/tests/worker.js create mode 100644 crates/lora-inspector-wasm/vite.config.js delete mode 100644 index.html diff --git a/Makefile b/Makefile index 7a95904..b7aa49d 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,50 @@ +# Makefile for building and running WASM projects +# General settings +WASM_DIR := crates/lora-inspector-wasm +OUT_DIR := pkg +# TARGET := --target bundler +TARGET := --target web +# RELEASE := --release +RELEASE := +# WEAK_REFS := --weak-refs +WEAK_REFS := +# Default target +.PHONY: all +all: test build-wasm + +# Run tests for the whole workspace +.PHONY: test test: - cargo test --workspace + cargo test --workspace && \ + make wasm-bindgen-test && \ + yarn --cwd crates/lora-inspector-wasm test && \ + yarn --cwd crates/lora-inspector-wasm e2e-test +# Build WASM for production (optimized) +.PHONY: build-wasm build-wasm: - wasm-pack build --target no-modules --out-dir pkg crates/lora-inspector-wasm --release --weak-refs - -build-dev-wasm: - wasm-pack build --target no-modules --out-dir pkg crates/lora-inspector-wasm --release --weak-refs + wasm-pack build $(TARGET) --out-dir $(OUT_DIR) $(WASM_DIR) $(RELEASE) $(WEAK_REFS) && \ + yarn --cwd $(WASM_DIR) build +# Start a local HTTP server for serving the WASM package (simple) +.PHONY: dev-wasm dev-wasm: - python -m http.server -d crates/lora-inspector-wasm + make build-wasm && \ + cd $(WASM_DIR) && \ + yarn vite + +# Start a custom server (e.g., with CORS enabled) for development +.PHONY: dev-wasm-cors +dev-wasm-cors: + cd $(WASM_DIR) && python simple-cors-server.py + +.PHONY: +wasm-bindgen-test: + wasm-pack test --headless --firefox crates/lora-inspector-wasm -dev-wasm-2: - cd crates/lora-inspector-wasm/ && python simple-cors-server.py +# Clean build artifacts (optional) +.PHONY: clean +clean: + rm -rf $(OUT_DIR)/* diff --git a/crates/inspector/src/weight.rs b/crates/inspector/src/weight.rs index 9647026..d195448 100644 --- a/crates/inspector/src/weight.rs +++ b/crates/inspector/src/weight.rs @@ -252,17 +252,23 @@ impl Weight for BufferedLoRAWeight { / dims[0] as f64; if dims.len() == 2 { - up.matmul(&down)?.detach()?.mul(scale)?.detach() + to_compatible_dtype(&up)? + .matmul(&to_compatible_dtype(&down)?)? + .detach()? + .mul(scale)? + .detach() } else if dims[2] == 1 && dims[3] == 1 { - up.squeeze(3)? + to_compatible_dtype(&up)? + .squeeze(3)? .squeeze(2)? - .matmul(&down.squeeze(3)?.squeeze(2)?)? + .matmul(&to_compatible_dtype(&down)?.squeeze(3)?.squeeze(2)?)? .unsqueeze(2)? .unsqueeze(3)? .mul(scale) } else { - down.permute((1, 0, 2, 3))? - .conv2d(&up, 0, 1, 1, 1)? + to_compatible_dtype(&down)? + .permute((1, 0, 2, 3))? + .conv2d(&to_compatible_dtype(&up)?, 0, 1, 1, 1)? .permute((1, 0, 2, 3))? .mul(scale) } @@ -558,6 +564,15 @@ pub struct LoRAWeight { pub device: Device, } +/// Converts tensor into DType thats compatible with candle +/// We convert BF16 to F32 +fn to_compatible_dtype(tensor: &candle_core::Tensor) -> Result { + match tensor.dtype() { + candle_core::DType::BF16 => tensor.to_dtype(candle_core::DType::F32), + _ => Ok(tensor.clone()), + } +} + impl LoRAWeight { pub fn new(buffer: Vec, device: &Device) -> Result { Ok(Self { @@ -660,17 +675,21 @@ impl Weight for LoRAWeight { let scale = alpha.to_scalar::()? / dims[0] as f64; if dims.len() == 2 { - up.matmul(down)?.mul(scale) + to_compatible_dtype(up)? + .matmul(&to_compatible_dtype(down)?)? + .mul(scale) } else if dims[2] == 1 && dims[3] == 1 { - up.squeeze(3)? + to_compatible_dtype(up)? + .squeeze(3)? .squeeze(2)? - .matmul(&down.squeeze(3)?.squeeze(2)?)? + .matmul(&to_compatible_dtype(down)?.squeeze(3)?.squeeze(2)?)? .unsqueeze(2)? .unsqueeze(3)? .mul(scale) } else { - down.permute((1, 0, 2, 3))? - .conv2d(up, 0, 1, 1, 1)? + to_compatible_dtype(down)? + .permute((1, 0, 2, 3))? + .conv2d(&to_compatible_dtype(up)?, 0, 1, 1, 1)? .permute((1, 0, 2, 3))? .mul(scale) } @@ -732,7 +751,7 @@ impl Weight for LoRAWeight { let t1_w1 = t1.mul(&one)?; let t2_w2 = t2.mul(&two)?; - t1_w1.matmul(&t2_w2)?.mul(scale) + t1_w1.matmul(&t2_w2)? * scale } else { let one = w1_a.matmul(w1_b)?; let two = w2_a.matmul(w2_b)?; diff --git a/crates/lora-inspector-wasm/.gitignore b/crates/lora-inspector-wasm/.gitignore index 68c5d18..e1ad9bb 100644 --- a/crates/lora-inspector-wasm/.gitignore +++ b/crates/lora-inspector-wasm/.gitignore @@ -1,3 +1,11 @@ +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + node_modules/ /test-results/ /playwright-report/ diff --git a/crates/lora-inspector-wasm/.yarnrc.yml b/crates/lora-inspector-wasm/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/crates/lora-inspector-wasm/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/crates/lora-inspector-wasm/LICENSE b/crates/lora-inspector-wasm/LICENSE new file mode 100644 index 0000000..44fccf1 --- /dev/null +++ b/crates/lora-inspector-wasm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Dave Lage (rockerBOO) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/crates/lora-inspector-wasm/README.md b/crates/lora-inspector-wasm/README.md new file mode 100644 index 0000000..3c7191c --- /dev/null +++ b/crates/lora-inspector-wasm/README.md @@ -0,0 +1,27 @@ +# Web application for LoRA inspector + +## Install + +``` +yarn install --immutable +``` + +## Usage + +### Dev + +``` +yarn dev +``` + +### Build + +``` +yarn build +``` + +### Test + +``` +yarn test +``` diff --git a/crates/lora-inspector-wasm/assets/js/chartist-plugin-pointlabels.min.js b/crates/lora-inspector-wasm/assets/js/chartist-plugin-pointlabels.min.js deleted file mode 100644 index 2d50bd4..0000000 --- a/crates/lora-inspector-wasm/assets/js/chartist-plugin-pointlabels.min.js +++ /dev/null @@ -1,75 +0,0 @@ -/* chartist-plugin-pointlabels 0.0.6 - * Copyright © 2018 Gion Kunz - * Free to use under the WTFPL license. - * http://www.wtfpl.net/ - */ - -!(function (a, b) { - "function" == typeof define && define.amd - ? define(["chartist"], function (c) { - return (a.returnExportsGlobal = b(c)); - }) - : "object" == typeof exports - ? (module.exports = b(require("chartist"))) - : (a["Chartist.plugins.ctPointLabels"] = b(Chartist)); -})(this, function (a) { - return ( - (function (a, b, c) { - "use strict"; - var d = { - labelClass: "ct-label", - labelOffset: { x: 0, y: -10 }, - textAnchor: "middle", - align: "center", - labelInterpolationFnc: c.noop, - }, - e = { - point: function (a) { - return { x: a.x, y: a.y }; - }, - bar: { - left: function (a) { - return { x: a.x1, y: a.y1 }; - }, - center: function (a) { - return { x: a.x1 + (a.x2 - a.x1) / 2, y: a.y1 }; - }, - right: function (a) { - return { x: a.x2, y: a.y1 }; - }, - }, - }; - (c.plugins = c.plugins || {}), - (c.plugins.ctPointLabels = function (a) { - function b(b, c) { - var d = - void 0 !== c.value.x && c.value.y - ? c.value.x + ", " + c.value.y - : c.value.y || c.value.x; - c.group - .elem( - "text", - { - x: b.x + a.labelOffset.x, - y: b.y + a.labelOffset.y, - style: "text-anchor: " + a.textAnchor, - }, - a.labelClass, - ) - .text(a.labelInterpolationFnc(d)); - } - return ( - (a = c.extend({}, d, a)), - function (d) { - (d instanceof c.Line || d instanceof c.Bar) && - d.on("draw", function (c) { - var d = (e[c.type] && e[c.type][a.align]) || e[c.type]; - d && b(d(c), c); - }); - } - ); - }); - })(window, document, a), - a.plugins.ctPointLabels - ); -}); diff --git a/crates/lora-inspector-wasm/assets/js/chartist.min.js b/crates/lora-inspector-wasm/assets/js/chartist.min.js deleted file mode 100644 index 1c929a0..0000000 --- a/crates/lora-inspector-wasm/assets/js/chartist.min.js +++ /dev/null @@ -1,2391 +0,0 @@ -/* Chartist.js 0.11.0 - * Copyright © 2017 Gion Kunz - * Free to use under either the WTFPL license or the MIT license. - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL - * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT - */ - -!(function (a, b) { - "function" == typeof define && define.amd - ? define("Chartist", [], function () { - return (a.Chartist = b()); - }) - : "object" == typeof module && module.exports - ? (module.exports = b()) - : (a.Chartist = b()); -})(this, function () { - var a = { version: "0.11.0" }; - return ( - (function (a, b, c) { - "use strict"; - (c.namespaces = { - svg: "http://www.w3.org/2000/svg", - xmlns: "http://www.w3.org/2000/xmlns/", - xhtml: "http://www.w3.org/1999/xhtml", - xlink: "http://www.w3.org/1999/xlink", - ct: "http://gionkunz.github.com/chartist-js/ct", - }), - (c.noop = function (a) { - return a; - }), - (c.alphaNumerate = function (a) { - return String.fromCharCode(97 + (a % 26)); - }), - (c.extend = function (a) { - var b, d, e; - for (a = a || {}, b = 1; b < arguments.length; b++) { - d = arguments[b]; - for (var f in d) - (e = d[f]), - "object" != typeof e || null === e || e instanceof Array - ? (a[f] = e) - : (a[f] = c.extend(a[f], e)); - } - return a; - }), - (c.replaceAll = function (a, b, c) { - return a.replace(new RegExp(b, "g"), c); - }), - (c.ensureUnit = function (a, b) { - return "number" == typeof a && (a += b), a; - }), - (c.quantity = function (a) { - if ("string" == typeof a) { - var b = /^(\d+)\s*(.*)$/g.exec(a); - return { value: +b[1], unit: b[2] || void 0 }; - } - return { value: a }; - }), - (c.querySelector = function (a) { - return a instanceof Node ? a : b.querySelector(a); - }), - (c.times = function (a) { - return Array.apply(null, new Array(a)); - }), - (c.sum = function (a, b) { - return a + (b ? b : 0); - }), - (c.mapMultiply = function (a) { - return function (b) { - return b * a; - }; - }), - (c.mapAdd = function (a) { - return function (b) { - return b + a; - }; - }), - (c.serialMap = function (a, b) { - var d = [], - e = Math.max.apply( - null, - a.map(function (a) { - return a.length; - }), - ); - return ( - c.times(e).forEach(function (c, e) { - var f = a.map(function (a) { - return a[e]; - }); - d[e] = b.apply(null, f); - }), - d - ); - }), - (c.roundWithPrecision = function (a, b) { - var d = Math.pow(10, b || c.precision); - return Math.round(a * d) / d; - }), - (c.precision = 8), - (c.escapingMap = { - "&": "&", - "<": "<", - ">": ">", - '"': """, - "'": "'", - }), - (c.serialize = function (a) { - return null === a || void 0 === a - ? a - : ("number" == typeof a - ? (a = "" + a) - : "object" == typeof a && (a = JSON.stringify({ data: a })), - Object.keys(c.escapingMap).reduce(function (a, b) { - return c.replaceAll(a, b, c.escapingMap[b]); - }, a)); - }), - (c.deserialize = function (a) { - if ("string" != typeof a) return a; - a = Object.keys(c.escapingMap).reduce(function (a, b) { - return c.replaceAll(a, c.escapingMap[b], b); - }, a); - try { - (a = JSON.parse(a)), (a = void 0 !== a.data ? a.data : a); - } catch (b) {} - return a; - }), - (c.createSvg = function (a, b, d, e) { - var f; - return ( - (b = b || "100%"), - (d = d || "100%"), - Array.prototype.slice - .call(a.querySelectorAll("svg")) - .filter(function (a) { - return a.getAttributeNS(c.namespaces.xmlns, "ct"); - }) - .forEach(function (b) { - a.removeChild(b); - }), - (f = new c.Svg("svg").attr({ width: b, height: d }).addClass(e)), - (f._node.style.width = b), - (f._node.style.height = d), - a.appendChild(f._node), - f - ); - }), - (c.normalizeData = function (a, b, d) { - var e, - f = { raw: a, normalized: {} }; - return ( - (f.normalized.series = c.getDataArray( - { series: a.series || [] }, - b, - d, - )), - (e = f.normalized.series.every(function (a) { - return a instanceof Array; - }) - ? Math.max.apply( - null, - f.normalized.series.map(function (a) { - return a.length; - }), - ) - : f.normalized.series.length), - (f.normalized.labels = (a.labels || []).slice()), - Array.prototype.push.apply( - f.normalized.labels, - c - .times(Math.max(0, e - f.normalized.labels.length)) - .map(function () { - return ""; - }), - ), - b && c.reverseData(f.normalized), - f - ); - }), - (c.safeHasProperty = function (a, b) { - return null !== a && "object" == typeof a && a.hasOwnProperty(b); - }), - (c.isDataHoleValue = function (a) { - return ( - null === a || void 0 === a || ("number" == typeof a && isNaN(a)) - ); - }), - (c.reverseData = function (a) { - a.labels.reverse(), a.series.reverse(); - for (var b = 0; b < a.series.length; b++) - "object" == typeof a.series[b] && void 0 !== a.series[b].data - ? a.series[b].data.reverse() - : a.series[b] instanceof Array && a.series[b].reverse(); - }), - (c.getDataArray = function (a, b, d) { - function e(a) { - if (c.safeHasProperty(a, "value")) return e(a.value); - if (c.safeHasProperty(a, "data")) return e(a.data); - if (a instanceof Array) return a.map(e); - if (!c.isDataHoleValue(a)) { - if (d) { - var b = {}; - return ( - "string" == typeof d - ? (b[d] = c.getNumberOrUndefined(a)) - : (b.y = c.getNumberOrUndefined(a)), - (b.x = a.hasOwnProperty("x") - ? c.getNumberOrUndefined(a.x) - : b.x), - (b.y = a.hasOwnProperty("y") - ? c.getNumberOrUndefined(a.y) - : b.y), - b - ); - } - return c.getNumberOrUndefined(a); - } - } - return a.series.map(e); - }), - (c.normalizePadding = function (a, b) { - return ( - (b = b || 0), - "number" == typeof a - ? { top: a, right: a, bottom: a, left: a } - : { - top: "number" == typeof a.top ? a.top : b, - right: "number" == typeof a.right ? a.right : b, - bottom: "number" == typeof a.bottom ? a.bottom : b, - left: "number" == typeof a.left ? a.left : b, - } - ); - }), - (c.getMetaData = function (a, b) { - var c = a.data ? a.data[b] : a[b]; - return c ? c.meta : void 0; - }), - (c.orderOfMagnitude = function (a) { - return Math.floor(Math.log(Math.abs(a)) / Math.LN10); - }), - (c.projectLength = function (a, b, c) { - return (b / c.range) * a; - }), - (c.getAvailableHeight = function (a, b) { - return Math.max( - (c.quantity(b.height).value || a.height()) - - (b.chartPadding.top + b.chartPadding.bottom) - - b.axisX.offset, - 0, - ); - }), - (c.getHighLow = function (a, b, d) { - function e(a) { - if (void 0 !== a) - if (a instanceof Array) - for (var b = 0; b < a.length; b++) e(a[b]); - else { - var c = d ? +a[d] : +a; - g && c > f.high && (f.high = c), h && c < f.low && (f.low = c); - } - } - b = c.extend({}, b, d ? b["axis" + d.toUpperCase()] : {}); - var f = { - high: void 0 === b.high ? -Number.MAX_VALUE : +b.high, - low: void 0 === b.low ? Number.MAX_VALUE : +b.low, - }, - g = void 0 === b.high, - h = void 0 === b.low; - return ( - (g || h) && e(a), - (b.referenceValue || 0 === b.referenceValue) && - ((f.high = Math.max(b.referenceValue, f.high)), - (f.low = Math.min(b.referenceValue, f.low))), - f.high <= f.low && - (0 === f.low - ? (f.high = 1) - : f.low < 0 - ? (f.high = 0) - : f.high > 0 - ? (f.low = 0) - : ((f.high = 1), (f.low = 0))), - f - ); - }), - (c.isNumeric = function (a) { - return null !== a && isFinite(a); - }), - (c.isFalseyButZero = function (a) { - return !a && 0 !== a; - }), - (c.getNumberOrUndefined = function (a) { - return c.isNumeric(a) ? +a : void 0; - }), - (c.isMultiValue = function (a) { - return "object" == typeof a && ("x" in a || "y" in a); - }), - (c.getMultiValue = function (a, b) { - return c.isMultiValue(a) - ? c.getNumberOrUndefined(a[b || "y"]) - : c.getNumberOrUndefined(a); - }), - (c.rho = function (a) { - function b(a, c) { - return a % c === 0 ? c : b(c, a % c); - } - function c(a) { - return a * a + 1; - } - if (1 === a) return a; - var d, - e = 2, - f = 2; - if (a % 2 === 0) return 2; - do (e = c(e) % a), (f = c(c(f)) % a), (d = b(Math.abs(e - f), a)); - while (1 === d); - return d; - }), - (c.getBounds = function (a, b, d, e) { - function f(a, b) { - return a === (a += b) && (a *= 1 + (b > 0 ? o : -o)), a; - } - var g, - h, - i, - j = 0, - k = { high: b.high, low: b.low }; - (k.valueRange = k.high - k.low), - (k.oom = c.orderOfMagnitude(k.valueRange)), - (k.step = Math.pow(10, k.oom)), - (k.min = Math.floor(k.low / k.step) * k.step), - (k.max = Math.ceil(k.high / k.step) * k.step), - (k.range = k.max - k.min), - (k.numberOfSteps = Math.round(k.range / k.step)); - var l = c.projectLength(a, k.step, k), - m = l < d, - n = e ? c.rho(k.range) : 0; - if (e && c.projectLength(a, 1, k) >= d) k.step = 1; - else if (e && n < k.step && c.projectLength(a, n, k) >= d) k.step = n; - else - for (;;) { - if (m && c.projectLength(a, k.step, k) <= d) k.step *= 2; - else { - if (m || !(c.projectLength(a, k.step / 2, k) >= d)) break; - if (((k.step /= 2), e && k.step % 1 !== 0)) { - k.step *= 2; - break; - } - } - if (j++ > 1e3) - throw new Error( - "Exceeded maximum number of iterations while optimizing scale step!", - ); - } - var o = 2.221e-16; - for ( - k.step = Math.max(k.step, o), h = k.min, i = k.max; - h + k.step <= k.low; - - ) - h = f(h, k.step); - for (; i - k.step >= k.high; ) i = f(i, -k.step); - (k.min = h), (k.max = i), (k.range = k.max - k.min); - var p = []; - for (g = k.min; g <= k.max; g = f(g, k.step)) { - var q = c.roundWithPrecision(g); - q !== p[p.length - 1] && p.push(q); - } - return (k.values = p), k; - }), - (c.polarToCartesian = function (a, b, c, d) { - var e = ((d - 90) * Math.PI) / 180; - return { x: a + c * Math.cos(e), y: b + c * Math.sin(e) }; - }), - (c.createChartRect = function (a, b, d) { - var e = !(!b.axisX && !b.axisY), - f = e ? b.axisY.offset : 0, - g = e ? b.axisX.offset : 0, - h = a.width() || c.quantity(b.width).value || 0, - i = a.height() || c.quantity(b.height).value || 0, - j = c.normalizePadding(b.chartPadding, d); - (h = Math.max(h, f + j.left + j.right)), - (i = Math.max(i, g + j.top + j.bottom)); - var k = { - padding: j, - width: function () { - return this.x2 - this.x1; - }, - height: function () { - return this.y1 - this.y2; - }, - }; - return ( - e - ? ("start" === b.axisX.position - ? ((k.y2 = j.top + g), - (k.y1 = Math.max(i - j.bottom, k.y2 + 1))) - : ((k.y2 = j.top), - (k.y1 = Math.max(i - j.bottom - g, k.y2 + 1))), - "start" === b.axisY.position - ? ((k.x1 = j.left + f), - (k.x2 = Math.max(h - j.right, k.x1 + 1))) - : ((k.x1 = j.left), - (k.x2 = Math.max(h - j.right - f, k.x1 + 1)))) - : ((k.x1 = j.left), - (k.x2 = Math.max(h - j.right, k.x1 + 1)), - (k.y2 = j.top), - (k.y1 = Math.max(i - j.bottom, k.y2 + 1))), - k - ); - }), - (c.createGrid = function (a, b, d, e, f, g, h, i) { - var j = {}; - (j[d.units.pos + "1"] = a), - (j[d.units.pos + "2"] = a), - (j[d.counterUnits.pos + "1"] = e), - (j[d.counterUnits.pos + "2"] = e + f); - var k = g.elem("line", j, h.join(" ")); - i.emit( - "draw", - c.extend( - { type: "grid", axis: d, index: b, group: g, element: k }, - j, - ), - ); - }), - (c.createGridBackground = function (a, b, c, d) { - var e = a.elem( - "rect", - { x: b.x1, y: b.y2, width: b.width(), height: b.height() }, - c, - !0, - ); - d.emit("draw", { type: "gridBackground", group: a, element: e }); - }), - (c.createLabel = function (a, d, e, f, g, h, i, j, k, l, m) { - var n, - o = {}; - if ( - ((o[g.units.pos] = a + i[g.units.pos]), - (o[g.counterUnits.pos] = i[g.counterUnits.pos]), - (o[g.units.len] = d), - (o[g.counterUnits.len] = Math.max(0, h - 10)), - l) - ) { - var p = b.createElement("span"); - (p.className = k.join(" ")), - p.setAttribute("xmlns", c.namespaces.xhtml), - (p.innerText = f[e]), - (p.style[g.units.len] = Math.round(o[g.units.len]) + "px"), - (p.style[g.counterUnits.len] = - Math.round(o[g.counterUnits.len]) + "px"), - (n = j.foreignObject( - p, - c.extend({ style: "overflow: visible;" }, o), - )); - } else n = j.elem("text", o, k.join(" ")).text(f[e]); - m.emit( - "draw", - c.extend( - { - type: "label", - axis: g, - index: e, - group: j, - element: n, - text: f[e], - }, - o, - ), - ); - }), - (c.getSeriesOption = function (a, b, c) { - if (a.name && b.series && b.series[a.name]) { - var d = b.series[a.name]; - return d.hasOwnProperty(c) ? d[c] : b[c]; - } - return b[c]; - }), - (c.optionsProvider = function (b, d, e) { - function f(b) { - var f = h; - if (((h = c.extend({}, j)), d)) - for (i = 0; i < d.length; i++) { - var g = a.matchMedia(d[i][0]); - g.matches && (h = c.extend(h, d[i][1])); - } - e && - b && - e.emit("optionsChanged", { - previousOptions: f, - currentOptions: h, - }); - } - function g() { - k.forEach(function (a) { - a.removeListener(f); - }); - } - var h, - i, - j = c.extend({}, b), - k = []; - if (!a.matchMedia) - throw "window.matchMedia not found! Make sure you're using a polyfill."; - if (d) - for (i = 0; i < d.length; i++) { - var l = a.matchMedia(d[i][0]); - l.addListener(f), k.push(l); - } - return ( - f(), - { - removeMediaQueryListeners: g, - getCurrentOptions: function () { - return c.extend({}, h); - }, - } - ); - }), - (c.splitIntoSegments = function (a, b, d) { - var e = { increasingX: !1, fillHoles: !1 }; - d = c.extend({}, e, d); - for (var f = [], g = !0, h = 0; h < a.length; h += 2) - void 0 === c.getMultiValue(b[h / 2].value) - ? d.fillHoles || (g = !0) - : (d.increasingX && h >= 2 && a[h] <= a[h - 2] && (g = !0), - g && (f.push({ pathCoordinates: [], valueData: [] }), (g = !1)), - f[f.length - 1].pathCoordinates.push(a[h], a[h + 1]), - f[f.length - 1].valueData.push(b[h / 2])); - return f; - }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - (c.Interpolation = {}), - (c.Interpolation.none = function (a) { - var b = { fillHoles: !1 }; - return ( - (a = c.extend({}, b, a)), - function (b, d) { - for ( - var e = new c.Svg.Path(), f = !0, g = 0; - g < b.length; - g += 2 - ) { - var h = b[g], - i = b[g + 1], - j = d[g / 2]; - void 0 !== c.getMultiValue(j.value) - ? (f ? e.move(h, i, !1, j) : e.line(h, i, !1, j), (f = !1)) - : a.fillHoles || (f = !0); - } - return e; - } - ); - }), - (c.Interpolation.simple = function (a) { - var b = { divisor: 2, fillHoles: !1 }; - a = c.extend({}, b, a); - var d = 1 / Math.max(1, a.divisor); - return function (b, e) { - for ( - var f, g, h, i = new c.Svg.Path(), j = 0; - j < b.length; - j += 2 - ) { - var k = b[j], - l = b[j + 1], - m = (k - f) * d, - n = e[j / 2]; - void 0 !== n.value - ? (void 0 === h - ? i.move(k, l, !1, n) - : i.curve(f + m, g, k - m, l, k, l, !1, n), - (f = k), - (g = l), - (h = n)) - : a.fillHoles || (f = k = h = void 0); - } - return i; - }; - }), - (c.Interpolation.cardinal = function (a) { - var b = { tension: 1, fillHoles: !1 }; - a = c.extend({}, b, a); - var d = Math.min(1, Math.max(0, a.tension)), - e = 1 - d; - return function f(b, g) { - var h = c.splitIntoSegments(b, g, { fillHoles: a.fillHoles }); - if (h.length) { - if (h.length > 1) { - var i = []; - return ( - h.forEach(function (a) { - i.push(f(a.pathCoordinates, a.valueData)); - }), - c.Svg.Path.join(i) - ); - } - if ( - ((b = h[0].pathCoordinates), - (g = h[0].valueData), - b.length <= 4) - ) - return c.Interpolation.none()(b, g); - for ( - var j, - k = new c.Svg.Path().move(b[0], b[1], !1, g[0]), - l = 0, - m = b.length; - m - 2 * !j > l; - l += 2 - ) { - var n = [ - { x: +b[l - 2], y: +b[l - 1] }, - { x: +b[l], y: +b[l + 1] }, - { x: +b[l + 2], y: +b[l + 3] }, - { x: +b[l + 4], y: +b[l + 5] }, - ]; - j - ? l - ? m - 4 === l - ? (n[3] = { x: +b[0], y: +b[1] }) - : m - 2 === l && - ((n[2] = { x: +b[0], y: +b[1] }), - (n[3] = { x: +b[2], y: +b[3] })) - : (n[0] = { x: +b[m - 2], y: +b[m - 1] }) - : m - 4 === l - ? (n[3] = n[2]) - : l || (n[0] = { x: +b[l], y: +b[l + 1] }), - k.curve( - (d * (-n[0].x + 6 * n[1].x + n[2].x)) / 6 + e * n[2].x, - (d * (-n[0].y + 6 * n[1].y + n[2].y)) / 6 + e * n[2].y, - (d * (n[1].x + 6 * n[2].x - n[3].x)) / 6 + e * n[2].x, - (d * (n[1].y + 6 * n[2].y - n[3].y)) / 6 + e * n[2].y, - n[2].x, - n[2].y, - !1, - g[(l + 2) / 2], - ); - } - return k; - } - return c.Interpolation.none()([]); - }; - }), - (c.Interpolation.monotoneCubic = function (a) { - var b = { fillHoles: !1 }; - return ( - (a = c.extend({}, b, a)), - function d(b, e) { - var f = c.splitIntoSegments(b, e, { - fillHoles: a.fillHoles, - increasingX: !0, - }); - if (f.length) { - if (f.length > 1) { - var g = []; - return ( - f.forEach(function (a) { - g.push(d(a.pathCoordinates, a.valueData)); - }), - c.Svg.Path.join(g) - ); - } - if ( - ((b = f[0].pathCoordinates), - (e = f[0].valueData), - b.length <= 4) - ) - return c.Interpolation.none()(b, e); - var h, - i, - j = [], - k = [], - l = b.length / 2, - m = [], - n = [], - o = [], - p = []; - for (h = 0; h < l; h++) - (j[h] = b[2 * h]), (k[h] = b[2 * h + 1]); - for (h = 0; h < l - 1; h++) - (o[h] = k[h + 1] - k[h]), - (p[h] = j[h + 1] - j[h]), - (n[h] = o[h] / p[h]); - for (m[0] = n[0], m[l - 1] = n[l - 2], h = 1; h < l - 1; h++) - 0 === n[h] || 0 === n[h - 1] || n[h - 1] > 0 != n[h] > 0 - ? (m[h] = 0) - : ((m[h] = - (3 * (p[h - 1] + p[h])) / - ((2 * p[h] + p[h - 1]) / n[h - 1] + - (p[h] + 2 * p[h - 1]) / n[h])), - isFinite(m[h]) || (m[h] = 0)); - for ( - i = new c.Svg.Path().move(j[0], k[0], !1, e[0]), h = 0; - h < l - 1; - h++ - ) - i.curve( - j[h] + p[h] / 3, - k[h] + (m[h] * p[h]) / 3, - j[h + 1] - p[h] / 3, - k[h + 1] - (m[h + 1] * p[h]) / 3, - j[h + 1], - k[h + 1], - !1, - e[h + 1], - ); - return i; - } - return c.Interpolation.none()([]); - } - ); - }), - (c.Interpolation.step = function (a) { - var b = { postpone: !0, fillHoles: !1 }; - return ( - (a = c.extend({}, b, a)), - function (b, d) { - for ( - var e, f, g, h = new c.Svg.Path(), i = 0; - i < b.length; - i += 2 - ) { - var j = b[i], - k = b[i + 1], - l = d[i / 2]; - void 0 !== l.value - ? (void 0 === g - ? h.move(j, k, !1, l) - : (a.postpone ? h.line(j, f, !1, g) : h.line(e, k, !1, l), - h.line(j, k, !1, l)), - (e = j), - (f = k), - (g = l)) - : a.fillHoles || (e = f = g = void 0); - } - return h; - } - ); - }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - c.EventEmitter = function () { - function a(a, b) { - (d[a] = d[a] || []), d[a].push(b); - } - function b(a, b) { - d[a] && - (b - ? (d[a].splice(d[a].indexOf(b), 1), - 0 === d[a].length && delete d[a]) - : delete d[a]); - } - function c(a, b) { - d[a] && - d[a].forEach(function (a) { - a(b); - }), - d["*"] && - d["*"].forEach(function (c) { - c(a, b); - }); - } - var d = []; - return { addEventHandler: a, removeEventHandler: b, emit: c }; - }; - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a) { - var b = []; - if (a.length) for (var c = 0; c < a.length; c++) b.push(a[c]); - return b; - } - function e(a, b) { - var d = b || this.prototype || c.Class, - e = Object.create(d); - c.Class.cloneDefinitions(e, a); - var f = function () { - var a, - b = e.constructor || function () {}; - return ( - (a = this === c ? Object.create(e) : this), - b.apply(a, Array.prototype.slice.call(arguments, 0)), - a - ); - }; - return (f.prototype = e), (f["super"] = d), (f.extend = this.extend), f; - } - function f() { - var a = d(arguments), - b = a[0]; - return ( - a.splice(1, a.length - 1).forEach(function (a) { - Object.getOwnPropertyNames(a).forEach(function (c) { - delete b[c], - Object.defineProperty( - b, - c, - Object.getOwnPropertyDescriptor(a, c), - ); - }); - }), - b - ); - } - c.Class = { extend: e, cloneDefinitions: f }; - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, d) { - return ( - a && - ((this.data = a || {}), - (this.data.labels = this.data.labels || []), - (this.data.series = this.data.series || []), - this.eventEmitter.emit("data", { - type: "update", - data: this.data, - })), - b && - ((this.options = c.extend( - {}, - d ? this.options : this.defaultOptions, - b, - )), - this.initializeTimeoutId || - (this.optionsProvider.removeMediaQueryListeners(), - (this.optionsProvider = c.optionsProvider( - this.options, - this.responsiveOptions, - this.eventEmitter, - )))), - this.initializeTimeoutId || - this.createChart(this.optionsProvider.getCurrentOptions()), - this - ); - } - function e() { - return ( - this.initializeTimeoutId - ? a.clearTimeout(this.initializeTimeoutId) - : (a.removeEventListener("resize", this.resizeListener), - this.optionsProvider.removeMediaQueryListeners()), - this - ); - } - function f(a, b) { - return this.eventEmitter.addEventHandler(a, b), this; - } - function g(a, b) { - return this.eventEmitter.removeEventHandler(a, b), this; - } - function h() { - a.addEventListener("resize", this.resizeListener), - (this.optionsProvider = c.optionsProvider( - this.options, - this.responsiveOptions, - this.eventEmitter, - )), - this.eventEmitter.addEventHandler( - "optionsChanged", - function () { - this.update(); - }.bind(this), - ), - this.options.plugins && - this.options.plugins.forEach( - function (a) { - a instanceof Array ? a[0](this, a[1]) : a(this); - }.bind(this), - ), - this.eventEmitter.emit("data", { type: "initial", data: this.data }), - this.createChart(this.optionsProvider.getCurrentOptions()), - (this.initializeTimeoutId = void 0); - } - function i(a, b, d, e, f) { - (this.container = c.querySelector(a)), - (this.data = b || {}), - (this.data.labels = this.data.labels || []), - (this.data.series = this.data.series || []), - (this.defaultOptions = d), - (this.options = e), - (this.responsiveOptions = f), - (this.eventEmitter = c.EventEmitter()), - (this.supportsForeignObject = c.Svg.isSupported("Extensibility")), - (this.supportsAnimations = c.Svg.isSupported( - "AnimationEventsAttribute", - )), - (this.resizeListener = function () { - this.update(); - }.bind(this)), - this.container && - (this.container.__chartist__ && - this.container.__chartist__.detach(), - (this.container.__chartist__ = this)), - (this.initializeTimeoutId = setTimeout(h.bind(this), 0)); - } - c.Base = c.Class.extend({ - constructor: i, - optionsProvider: void 0, - container: void 0, - svg: void 0, - eventEmitter: void 0, - createChart: function () { - throw new Error("Base chart type can't be instantiated!"); - }, - update: d, - detach: e, - on: f, - off: g, - version: c.version, - supportsForeignObject: !1, - }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, d, e, f, g) { - a instanceof Element - ? (this._node = a) - : ((this._node = b.createElementNS(c.namespaces.svg, a)), - "svg" === a && this.attr({ "xmlns:ct": c.namespaces.ct })), - d && this.attr(d), - e && this.addClass(e), - f && - (g && f._node.firstChild - ? f._node.insertBefore(this._node, f._node.firstChild) - : f._node.appendChild(this._node)); - } - function e(a, b) { - return "string" == typeof a - ? b - ? this._node.getAttributeNS(b, a) - : this._node.getAttribute(a) - : (Object.keys(a).forEach( - function (b) { - if (void 0 !== a[b]) - if (b.indexOf(":") !== -1) { - var d = b.split(":"); - this._node.setAttributeNS(c.namespaces[d[0]], b, a[b]); - } else this._node.setAttribute(b, a[b]); - }.bind(this), - ), - this); - } - function f(a, b, d, e) { - return new c.Svg(a, b, d, this, e); - } - function g() { - return this._node.parentNode instanceof SVGElement - ? new c.Svg(this._node.parentNode) - : null; - } - function h() { - for (var a = this._node; "svg" !== a.nodeName; ) a = a.parentNode; - return new c.Svg(a); - } - function i(a) { - var b = this._node.querySelector(a); - return b ? new c.Svg(b) : null; - } - function j(a) { - var b = this._node.querySelectorAll(a); - return b.length ? new c.Svg.List(b) : null; - } - function k() { - return this._node; - } - function l(a, d, e, f) { - if ("string" == typeof a) { - var g = b.createElement("div"); - (g.innerHTML = a), (a = g.firstChild); - } - a.setAttribute("xmlns", c.namespaces.xmlns); - var h = this.elem("foreignObject", d, e, f); - return h._node.appendChild(a), h; - } - function m(a) { - return this._node.appendChild(b.createTextNode(a)), this; - } - function n() { - for (; this._node.firstChild; ) - this._node.removeChild(this._node.firstChild); - return this; - } - function o() { - return this._node.parentNode.removeChild(this._node), this.parent(); - } - function p(a) { - return this._node.parentNode.replaceChild(a._node, this._node), a; - } - function q(a, b) { - return ( - b && this._node.firstChild - ? this._node.insertBefore(a._node, this._node.firstChild) - : this._node.appendChild(a._node), - this - ); - } - function r() { - return this._node.getAttribute("class") - ? this._node.getAttribute("class").trim().split(/\s+/) - : []; - } - function s(a) { - return ( - this._node.setAttribute( - "class", - this.classes(this._node) - .concat(a.trim().split(/\s+/)) - .filter(function (a, b, c) { - return c.indexOf(a) === b; - }) - .join(" "), - ), - this - ); - } - function t(a) { - var b = a.trim().split(/\s+/); - return ( - this._node.setAttribute( - "class", - this.classes(this._node) - .filter(function (a) { - return b.indexOf(a) === -1; - }) - .join(" "), - ), - this - ); - } - function u() { - return this._node.setAttribute("class", ""), this; - } - function v() { - return this._node.getBoundingClientRect().height; - } - function w() { - return this._node.getBoundingClientRect().width; - } - function x(a, b, d) { - return ( - void 0 === b && (b = !0), - Object.keys(a).forEach( - function (e) { - function f(a, b) { - var f, - g, - h, - i = {}; - a.easing && - ((h = - a.easing instanceof Array - ? a.easing - : c.Svg.Easing[a.easing]), - delete a.easing), - (a.begin = c.ensureUnit(a.begin, "ms")), - (a.dur = c.ensureUnit(a.dur, "ms")), - h && - ((a.calcMode = "spline"), - (a.keySplines = h.join(" ")), - (a.keyTimes = "0;1")), - b && - ((a.fill = "freeze"), - (i[e] = a.from), - this.attr(i), - (g = c.quantity(a.begin || 0).value), - (a.begin = "indefinite")), - (f = this.elem("animate", c.extend({ attributeName: e }, a))), - b && - setTimeout( - function () { - try { - f._node.beginElement(); - } catch (b) { - (i[e] = a.to), this.attr(i), f.remove(); - } - }.bind(this), - g, - ), - d && - f._node.addEventListener( - "beginEvent", - function () { - d.emit("animationBegin", { - element: this, - animate: f._node, - params: a, - }); - }.bind(this), - ), - f._node.addEventListener( - "endEvent", - function () { - d && - d.emit("animationEnd", { - element: this, - animate: f._node, - params: a, - }), - b && ((i[e] = a.to), this.attr(i), f.remove()); - }.bind(this), - ); - } - a[e] instanceof Array - ? a[e].forEach( - function (a) { - f.bind(this)(a, !1); - }.bind(this), - ) - : f.bind(this)(a[e], b); - }.bind(this), - ), - this - ); - } - function y(a) { - var b = this; - this.svgElements = []; - for (var d = 0; d < a.length; d++) - this.svgElements.push(new c.Svg(a[d])); - Object.keys(c.Svg.prototype) - .filter(function (a) { - return ( - [ - "constructor", - "parent", - "querySelector", - "querySelectorAll", - "replace", - "append", - "classes", - "height", - "width", - ].indexOf(a) === -1 - ); - }) - .forEach(function (a) { - b[a] = function () { - var d = Array.prototype.slice.call(arguments, 0); - return ( - b.svgElements.forEach(function (b) { - c.Svg.prototype[a].apply(b, d); - }), - b - ); - }; - }); - } - (c.Svg = c.Class.extend({ - constructor: d, - attr: e, - elem: f, - parent: g, - root: h, - querySelector: i, - querySelectorAll: j, - getNode: k, - foreignObject: l, - text: m, - empty: n, - remove: o, - replace: p, - append: q, - classes: r, - addClass: s, - removeClass: t, - removeAllClasses: u, - height: v, - width: w, - animate: x, - })), - (c.Svg.isSupported = function (a) { - return b.implementation.hasFeature( - "http://www.w3.org/TR/SVG11/feature#" + a, - "1.1", - ); - }); - var z = { - easeInSine: [0.47, 0, 0.745, 0.715], - easeOutSine: [0.39, 0.575, 0.565, 1], - easeInOutSine: [0.445, 0.05, 0.55, 0.95], - easeInQuad: [0.55, 0.085, 0.68, 0.53], - easeOutQuad: [0.25, 0.46, 0.45, 0.94], - easeInOutQuad: [0.455, 0.03, 0.515, 0.955], - easeInCubic: [0.55, 0.055, 0.675, 0.19], - easeOutCubic: [0.215, 0.61, 0.355, 1], - easeInOutCubic: [0.645, 0.045, 0.355, 1], - easeInQuart: [0.895, 0.03, 0.685, 0.22], - easeOutQuart: [0.165, 0.84, 0.44, 1], - easeInOutQuart: [0.77, 0, 0.175, 1], - easeInQuint: [0.755, 0.05, 0.855, 0.06], - easeOutQuint: [0.23, 1, 0.32, 1], - easeInOutQuint: [0.86, 0, 0.07, 1], - easeInExpo: [0.95, 0.05, 0.795, 0.035], - easeOutExpo: [0.19, 1, 0.22, 1], - easeInOutExpo: [1, 0, 0, 1], - easeInCirc: [0.6, 0.04, 0.98, 0.335], - easeOutCirc: [0.075, 0.82, 0.165, 1], - easeInOutCirc: [0.785, 0.135, 0.15, 0.86], - easeInBack: [0.6, -0.28, 0.735, 0.045], - easeOutBack: [0.175, 0.885, 0.32, 1.275], - easeInOutBack: [0.68, -0.55, 0.265, 1.55], - }; - (c.Svg.Easing = z), (c.Svg.List = c.Class.extend({ constructor: y })); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, d, e, f, g) { - var h = c.extend( - { command: f ? a.toLowerCase() : a.toUpperCase() }, - b, - g ? { data: g } : {}, - ); - d.splice(e, 0, h); - } - function e(a, b) { - a.forEach(function (c, d) { - u[c.command.toLowerCase()].forEach(function (e, f) { - b(c, e, d, f, a); - }); - }); - } - function f(a, b) { - (this.pathElements = []), - (this.pos = 0), - (this.close = a), - (this.options = c.extend({}, v, b)); - } - function g(a) { - return void 0 !== a - ? ((this.pos = Math.max(0, Math.min(this.pathElements.length, a))), - this) - : this.pos; - } - function h(a) { - return this.pathElements.splice(this.pos, a), this; - } - function i(a, b, c, e) { - return ( - d("M", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this - ); - } - function j(a, b, c, e) { - return ( - d("L", { x: +a, y: +b }, this.pathElements, this.pos++, c, e), this - ); - } - function k(a, b, c, e, f, g, h, i) { - return ( - d( - "C", - { x1: +a, y1: +b, x2: +c, y2: +e, x: +f, y: +g }, - this.pathElements, - this.pos++, - h, - i, - ), - this - ); - } - function l(a, b, c, e, f, g, h, i, j) { - return ( - d( - "A", - { rx: +a, ry: +b, xAr: +c, lAf: +e, sf: +f, x: +g, y: +h }, - this.pathElements, - this.pos++, - i, - j, - ), - this - ); - } - function m(a) { - var b = a - .replace(/([A-Za-z])([0-9])/g, "$1 $2") - .replace(/([0-9])([A-Za-z])/g, "$1 $2") - .split(/[\s,]+/) - .reduce(function (a, b) { - return ( - b.match(/[A-Za-z]/) && a.push([]), a[a.length - 1].push(b), a - ); - }, []); - "Z" === b[b.length - 1][0].toUpperCase() && b.pop(); - var d = b.map(function (a) { - var b = a.shift(), - d = u[b.toLowerCase()]; - return c.extend( - { command: b }, - d.reduce(function (b, c, d) { - return (b[c] = +a[d]), b; - }, {}), - ); - }), - e = [this.pos, 0]; - return ( - Array.prototype.push.apply(e, d), - Array.prototype.splice.apply(this.pathElements, e), - (this.pos += d.length), - this - ); - } - function n() { - var a = Math.pow(10, this.options.accuracy); - return ( - this.pathElements.reduce( - function (b, c) { - var d = u[c.command.toLowerCase()].map( - function (b) { - return this.options.accuracy - ? Math.round(c[b] * a) / a - : c[b]; - }.bind(this), - ); - return b + c.command + d.join(","); - }.bind(this), - "", - ) + (this.close ? "Z" : "") - ); - } - function o(a, b) { - return ( - e(this.pathElements, function (c, d) { - c[d] *= "x" === d[0] ? a : b; - }), - this - ); - } - function p(a, b) { - return ( - e(this.pathElements, function (c, d) { - c[d] += "x" === d[0] ? a : b; - }), - this - ); - } - function q(a) { - return ( - e(this.pathElements, function (b, c, d, e, f) { - var g = a(b, c, d, e, f); - (g || 0 === g) && (b[c] = g); - }), - this - ); - } - function r(a) { - var b = new c.Svg.Path(a || this.close); - return ( - (b.pos = this.pos), - (b.pathElements = this.pathElements.slice().map(function (a) { - return c.extend({}, a); - })), - (b.options = c.extend({}, this.options)), - b - ); - } - function s(a) { - var b = [new c.Svg.Path()]; - return ( - this.pathElements.forEach(function (d) { - d.command === a.toUpperCase() && - 0 !== b[b.length - 1].pathElements.length && - b.push(new c.Svg.Path()), - b[b.length - 1].pathElements.push(d); - }), - b - ); - } - function t(a, b, d) { - for (var e = new c.Svg.Path(b, d), f = 0; f < a.length; f++) - for (var g = a[f], h = 0; h < g.pathElements.length; h++) - e.pathElements.push(g.pathElements[h]); - return e; - } - var u = { - m: ["x", "y"], - l: ["x", "y"], - c: ["x1", "y1", "x2", "y2", "x", "y"], - a: ["rx", "ry", "xAr", "lAf", "sf", "x", "y"], - }, - v = { accuracy: 3 }; - (c.Svg.Path = c.Class.extend({ - constructor: f, - position: g, - remove: h, - move: i, - line: j, - curve: k, - arc: l, - scale: o, - translate: p, - transform: q, - parse: m, - stringify: n, - clone: r, - splitByCommand: s, - })), - (c.Svg.Path.elementDescriptions = u), - (c.Svg.Path.join = t); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, c, d) { - (this.units = a), - (this.counterUnits = a === f.x ? f.y : f.x), - (this.chartRect = b), - (this.axisLength = b[a.rectEnd] - b[a.rectStart]), - (this.gridOffset = b[a.rectOffset]), - (this.ticks = c), - (this.options = d); - } - function e(a, b, d, e, f) { - var g = e["axis" + this.units.pos.toUpperCase()], - h = this.ticks.map(this.projectValue.bind(this)), - i = this.ticks.map(g.labelInterpolationFnc); - h.forEach( - function (j, k) { - var l, - m = { x: 0, y: 0 }; - (l = h[k + 1] ? h[k + 1] - j : Math.max(this.axisLength - j, 30)), - (c.isFalseyButZero(i[k]) && "" !== i[k]) || - ("x" === this.units.pos - ? ((j = this.chartRect.x1 + j), - (m.x = e.axisX.labelOffset.x), - "start" === e.axisX.position - ? (m.y = - this.chartRect.padding.top + - e.axisX.labelOffset.y + - (d ? 5 : 20)) - : (m.y = - this.chartRect.y1 + - e.axisX.labelOffset.y + - (d ? 5 : 20))) - : ((j = this.chartRect.y1 - j), - (m.y = e.axisY.labelOffset.y - (d ? l : 0)), - "start" === e.axisY.position - ? (m.x = d - ? this.chartRect.padding.left + e.axisY.labelOffset.x - : this.chartRect.x1 - 10) - : (m.x = this.chartRect.x2 + e.axisY.labelOffset.x + 10)), - g.showGrid && - c.createGrid( - j, - k, - this, - this.gridOffset, - this.chartRect[this.counterUnits.len](), - a, - [e.classNames.grid, e.classNames[this.units.dir]], - f, - ), - g.showLabel && - c.createLabel( - j, - l, - k, - i, - this, - g.offset, - m, - b, - [ - e.classNames.label, - e.classNames[this.units.dir], - "start" === g.position - ? e.classNames[g.position] - : e.classNames.end, - ], - d, - f, - )); - }.bind(this), - ); - } - var f = { - x: { - pos: "x", - len: "width", - dir: "horizontal", - rectStart: "x1", - rectEnd: "x2", - rectOffset: "y2", - }, - y: { - pos: "y", - len: "height", - dir: "vertical", - rectStart: "y2", - rectEnd: "y1", - rectOffset: "x1", - }, - }; - (c.Axis = c.Class.extend({ - constructor: d, - createGridAndLabels: e, - projectValue: function (a, b, c) { - throw new Error("Base axis can't be instantiated!"); - }, - })), - (c.Axis.units = f); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, d, e) { - var f = e.highLow || c.getHighLow(b, e, a.pos); - (this.bounds = c.getBounds( - d[a.rectEnd] - d[a.rectStart], - f, - e.scaleMinSpace || 20, - e.onlyInteger, - )), - (this.range = { min: this.bounds.min, max: this.bounds.max }), - c.AutoScaleAxis["super"].constructor.call( - this, - a, - d, - this.bounds.values, - e, - ); - } - function e(a) { - return ( - (this.axisLength * - (+c.getMultiValue(a, this.units.pos) - this.bounds.min)) / - this.bounds.range - ); - } - c.AutoScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, d, e) { - var f = e.highLow || c.getHighLow(b, e, a.pos); - (this.divisor = e.divisor || 1), - (this.ticks = - e.ticks || - c.times(this.divisor).map( - function (a, b) { - return f.low + ((f.high - f.low) / this.divisor) * b; - }.bind(this), - )), - this.ticks.sort(function (a, b) { - return a - b; - }), - (this.range = { min: f.low, max: f.high }), - c.FixedScaleAxis["super"].constructor.call(this, a, d, this.ticks, e), - (this.stepLength = this.axisLength / this.divisor); - } - function e(a) { - return ( - (this.axisLength * - (+c.getMultiValue(a, this.units.pos) - this.range.min)) / - (this.range.max - this.range.min) - ); - } - c.FixedScaleAxis = c.Axis.extend({ constructor: d, projectValue: e }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, d, e) { - c.StepAxis["super"].constructor.call(this, a, d, e.ticks, e); - var f = Math.max(1, e.ticks.length - (e.stretch ? 1 : 0)); - this.stepLength = this.axisLength / f; - } - function e(a, b) { - return this.stepLength * b; - } - c.StepAxis = c.Axis.extend({ constructor: d, projectValue: e }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a) { - var b = c.normalizeData(this.data, a.reverseData, !0); - this.svg = c.createSvg( - this.container, - a.width, - a.height, - a.classNames.chart, - ); - var d, - e, - g = this.svg.elem("g").addClass(a.classNames.gridGroup), - h = this.svg.elem("g"), - i = this.svg.elem("g").addClass(a.classNames.labelGroup), - j = c.createChartRect(this.svg, a, f.padding); - (d = - void 0 === a.axisX.type - ? new c.StepAxis( - c.Axis.units.x, - b.normalized.series, - j, - c.extend({}, a.axisX, { - ticks: b.normalized.labels, - stretch: a.fullWidth, - }), - ) - : a.axisX.type.call( - c, - c.Axis.units.x, - b.normalized.series, - j, - a.axisX, - )), - (e = - void 0 === a.axisY.type - ? new c.AutoScaleAxis( - c.Axis.units.y, - b.normalized.series, - j, - c.extend({}, a.axisY, { - high: c.isNumeric(a.high) ? a.high : a.axisY.high, - low: c.isNumeric(a.low) ? a.low : a.axisY.low, - }), - ) - : a.axisY.type.call( - c, - c.Axis.units.y, - b.normalized.series, - j, - a.axisY, - )), - d.createGridAndLabels( - g, - i, - this.supportsForeignObject, - a, - this.eventEmitter, - ), - e.createGridAndLabels( - g, - i, - this.supportsForeignObject, - a, - this.eventEmitter, - ), - a.showGridBackground && - c.createGridBackground( - g, - j, - a.classNames.gridBackground, - this.eventEmitter, - ), - b.raw.series.forEach( - function (f, g) { - var i = h.elem("g"); - i.attr({ - "ct:series-name": f.name, - "ct:meta": c.serialize(f.meta), - }), - i.addClass( - [ - a.classNames.series, - f.className || - a.classNames.series + "-" + c.alphaNumerate(g), - ].join(" "), - ); - var k = [], - l = []; - b.normalized.series[g].forEach( - function (a, h) { - var i = { - x: j.x1 + d.projectValue(a, h, b.normalized.series[g]), - y: j.y1 - e.projectValue(a, h, b.normalized.series[g]), - }; - k.push(i.x, i.y), - l.push({ - value: a, - valueIndex: h, - meta: c.getMetaData(f, h), - }); - }.bind(this), - ); - var m = { - lineSmooth: c.getSeriesOption(f, a, "lineSmooth"), - showPoint: c.getSeriesOption(f, a, "showPoint"), - showLine: c.getSeriesOption(f, a, "showLine"), - showArea: c.getSeriesOption(f, a, "showArea"), - areaBase: c.getSeriesOption(f, a, "areaBase"), - }, - n = - "function" == typeof m.lineSmooth - ? m.lineSmooth - : m.lineSmooth - ? c.Interpolation.monotoneCubic() - : c.Interpolation.none(), - o = n(k, l); - if ( - (m.showPoint && - o.pathElements.forEach( - function (b) { - var h = i - .elem( - "line", - { x1: b.x, y1: b.y, x2: b.x + 0.01, y2: b.y }, - a.classNames.point, - ) - .attr({ - "ct:value": [b.data.value.x, b.data.value.y] - .filter(c.isNumeric) - .join(","), - "ct:meta": c.serialize(b.data.meta), - }); - this.eventEmitter.emit("draw", { - type: "point", - value: b.data.value, - index: b.data.valueIndex, - meta: b.data.meta, - series: f, - seriesIndex: g, - axisX: d, - axisY: e, - group: i, - element: h, - x: b.x, - y: b.y, - }); - }.bind(this), - ), - m.showLine) - ) { - var p = i.elem( - "path", - { d: o.stringify() }, - a.classNames.line, - !0, - ); - this.eventEmitter.emit("draw", { - type: "line", - values: b.normalized.series[g], - path: o.clone(), - chartRect: j, - index: g, - series: f, - seriesIndex: g, - seriesMeta: f.meta, - axisX: d, - axisY: e, - group: i, - element: p, - }); - } - if (m.showArea && e.range) { - var q = Math.max( - Math.min(m.areaBase, e.range.max), - e.range.min, - ), - r = j.y1 - e.projectValue(q); - o.splitByCommand("M") - .filter(function (a) { - return a.pathElements.length > 1; - }) - .map(function (a) { - var b = a.pathElements[0], - c = a.pathElements[a.pathElements.length - 1]; - return a - .clone(!0) - .position(0) - .remove(1) - .move(b.x, r) - .line(b.x, b.y) - .position(a.pathElements.length + 1) - .line(c.x, r); - }) - .forEach( - function (c) { - var h = i.elem( - "path", - { d: c.stringify() }, - a.classNames.area, - !0, - ); - this.eventEmitter.emit("draw", { - type: "area", - values: b.normalized.series[g], - path: c.clone(), - series: f, - seriesIndex: g, - axisX: d, - axisY: e, - chartRect: j, - index: g, - group: i, - element: h, - }); - }.bind(this), - ); - } - }.bind(this), - ), - this.eventEmitter.emit("created", { - bounds: e.bounds, - chartRect: j, - axisX: d, - axisY: e, - svg: this.svg, - options: a, - }); - } - function e(a, b, d, e) { - c.Line["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e); - } - var f = { - axisX: { - offset: 30, - position: "end", - labelOffset: { x: 0, y: 0 }, - showLabel: !0, - showGrid: !0, - labelInterpolationFnc: c.noop, - type: void 0, - }, - axisY: { - offset: 40, - position: "start", - labelOffset: { x: 0, y: 0 }, - showLabel: !0, - showGrid: !0, - labelInterpolationFnc: c.noop, - type: void 0, - scaleMinSpace: 20, - onlyInteger: !1, - }, - width: void 0, - height: void 0, - showLine: !0, - showPoint: !0, - showArea: !1, - areaBase: 0, - lineSmooth: !0, - showGridBackground: !1, - low: void 0, - high: void 0, - chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, - fullWidth: !1, - reverseData: !1, - classNames: { - chart: "ct-chart-line", - label: "ct-label", - labelGroup: "ct-labels", - series: "ct-series", - line: "ct-line", - point: "ct-point", - area: "ct-area", - grid: "ct-grid", - gridGroup: "ct-grids", - gridBackground: "ct-grid-background", - vertical: "ct-vertical", - horizontal: "ct-horizontal", - start: "ct-start", - end: "ct-end", - }, - }; - c.Line = c.Base.extend({ constructor: e, createChart: d }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a) { - var b, d; - a.distributeSeries - ? ((b = c.normalizeData( - this.data, - a.reverseData, - a.horizontalBars ? "x" : "y", - )), - (b.normalized.series = b.normalized.series.map(function (a) { - return [a]; - }))) - : (b = c.normalizeData( - this.data, - a.reverseData, - a.horizontalBars ? "x" : "y", - )), - (this.svg = c.createSvg( - this.container, - a.width, - a.height, - a.classNames.chart + - (a.horizontalBars ? " " + a.classNames.horizontalBars : ""), - )); - var e = this.svg.elem("g").addClass(a.classNames.gridGroup), - g = this.svg.elem("g"), - h = this.svg.elem("g").addClass(a.classNames.labelGroup); - if (a.stackBars && 0 !== b.normalized.series.length) { - var i = c.serialMap(b.normalized.series, function () { - return Array.prototype.slice - .call(arguments) - .map(function (a) { - return a; - }) - .reduce( - function (a, b) { - return { x: a.x + (b && b.x) || 0, y: a.y + (b && b.y) || 0 }; - }, - { x: 0, y: 0 }, - ); - }); - d = c.getHighLow([i], a, a.horizontalBars ? "x" : "y"); - } else - d = c.getHighLow( - b.normalized.series, - a, - a.horizontalBars ? "x" : "y", - ); - (d.high = +a.high || (0 === a.high ? 0 : d.high)), - (d.low = +a.low || (0 === a.low ? 0 : d.low)); - var j, - k, - l, - m, - n, - o = c.createChartRect(this.svg, a, f.padding); - (k = - a.distributeSeries && a.stackBars - ? b.normalized.labels.slice(0, 1) - : b.normalized.labels), - a.horizontalBars - ? ((j = m = - void 0 === a.axisX.type - ? new c.AutoScaleAxis( - c.Axis.units.x, - b.normalized.series, - o, - c.extend({}, a.axisX, { highLow: d, referenceValue: 0 }), - ) - : a.axisX.type.call( - c, - c.Axis.units.x, - b.normalized.series, - o, - c.extend({}, a.axisX, { highLow: d, referenceValue: 0 }), - )), - (l = n = - void 0 === a.axisY.type - ? new c.StepAxis(c.Axis.units.y, b.normalized.series, o, { - ticks: k, - }) - : a.axisY.type.call( - c, - c.Axis.units.y, - b.normalized.series, - o, - a.axisY, - ))) - : ((l = m = - void 0 === a.axisX.type - ? new c.StepAxis(c.Axis.units.x, b.normalized.series, o, { - ticks: k, - }) - : a.axisX.type.call( - c, - c.Axis.units.x, - b.normalized.series, - o, - a.axisX, - )), - (j = n = - void 0 === a.axisY.type - ? new c.AutoScaleAxis( - c.Axis.units.y, - b.normalized.series, - o, - c.extend({}, a.axisY, { highLow: d, referenceValue: 0 }), - ) - : a.axisY.type.call( - c, - c.Axis.units.y, - b.normalized.series, - o, - c.extend({}, a.axisY, { highLow: d, referenceValue: 0 }), - ))); - var p = a.horizontalBars - ? o.x1 + j.projectValue(0) - : o.y1 - j.projectValue(0), - q = []; - l.createGridAndLabels( - e, - h, - this.supportsForeignObject, - a, - this.eventEmitter, - ), - j.createGridAndLabels( - e, - h, - this.supportsForeignObject, - a, - this.eventEmitter, - ), - a.showGridBackground && - c.createGridBackground( - e, - o, - a.classNames.gridBackground, - this.eventEmitter, - ), - b.raw.series.forEach( - function (d, e) { - var f, - h, - i = e - (b.raw.series.length - 1) / 2; - (f = - a.distributeSeries && !a.stackBars - ? l.axisLength / b.normalized.series.length / 2 - : a.distributeSeries && a.stackBars - ? l.axisLength / 2 - : l.axisLength / b.normalized.series[e].length / 2), - (h = g.elem("g")), - h.attr({ - "ct:series-name": d.name, - "ct:meta": c.serialize(d.meta), - }), - h.addClass( - [ - a.classNames.series, - d.className || - a.classNames.series + "-" + c.alphaNumerate(e), - ].join(" "), - ), - b.normalized.series[e].forEach( - function (g, k) { - var r, s, t, u; - if ( - ((u = - a.distributeSeries && !a.stackBars - ? e - : a.distributeSeries && a.stackBars - ? 0 - : k), - (r = a.horizontalBars - ? { - x: - o.x1 + - j.projectValue( - g && g.x ? g.x : 0, - k, - b.normalized.series[e], - ), - y: - o.y1 - - l.projectValue( - g && g.y ? g.y : 0, - u, - b.normalized.series[e], - ), - } - : { - x: - o.x1 + - l.projectValue( - g && g.x ? g.x : 0, - u, - b.normalized.series[e], - ), - y: - o.y1 - - j.projectValue( - g && g.y ? g.y : 0, - k, - b.normalized.series[e], - ), - }), - l instanceof c.StepAxis && - (l.options.stretch || - (r[l.units.pos] += f * (a.horizontalBars ? -1 : 1)), - (r[l.units.pos] += - a.stackBars || a.distributeSeries - ? 0 - : i * - a.seriesBarDistance * - (a.horizontalBars ? -1 : 1))), - (t = q[k] || p), - (q[k] = t - (p - r[l.counterUnits.pos])), - void 0 !== g) - ) { - var v = {}; - (v[l.units.pos + "1"] = r[l.units.pos]), - (v[l.units.pos + "2"] = r[l.units.pos]), - !a.stackBars || - ("accumulate" !== a.stackMode && a.stackMode) - ? ((v[l.counterUnits.pos + "1"] = p), - (v[l.counterUnits.pos + "2"] = - r[l.counterUnits.pos])) - : ((v[l.counterUnits.pos + "1"] = t), - (v[l.counterUnits.pos + "2"] = q[k])), - (v.x1 = Math.min(Math.max(v.x1, o.x1), o.x2)), - (v.x2 = Math.min(Math.max(v.x2, o.x1), o.x2)), - (v.y1 = Math.min(Math.max(v.y1, o.y2), o.y1)), - (v.y2 = Math.min(Math.max(v.y2, o.y2), o.y1)); - var w = c.getMetaData(d, k); - (s = h.elem("line", v, a.classNames.bar).attr({ - "ct:value": [g.x, g.y].filter(c.isNumeric).join(","), - "ct:meta": c.serialize(w), - })), - this.eventEmitter.emit( - "draw", - c.extend( - { - type: "bar", - value: g, - index: k, - meta: w, - series: d, - seriesIndex: e, - axisX: m, - axisY: n, - chartRect: o, - group: h, - element: s, - }, - v, - ), - ); - } - }.bind(this), - ); - }.bind(this), - ), - this.eventEmitter.emit("created", { - bounds: j.bounds, - chartRect: o, - axisX: m, - axisY: n, - svg: this.svg, - options: a, - }); - } - function e(a, b, d, e) { - c.Bar["super"].constructor.call(this, a, b, f, c.extend({}, f, d), e); - } - var f = { - axisX: { - offset: 30, - position: "end", - labelOffset: { x: 0, y: 0 }, - showLabel: !0, - showGrid: !0, - labelInterpolationFnc: c.noop, - scaleMinSpace: 30, - onlyInteger: !1, - }, - axisY: { - offset: 40, - position: "start", - labelOffset: { x: 0, y: 0 }, - showLabel: !0, - showGrid: !0, - labelInterpolationFnc: c.noop, - scaleMinSpace: 20, - onlyInteger: !1, - }, - width: void 0, - height: void 0, - high: void 0, - low: void 0, - referenceValue: 0, - chartPadding: { top: 15, right: 15, bottom: 5, left: 10 }, - seriesBarDistance: 15, - stackBars: !1, - stackMode: "accumulate", - horizontalBars: !1, - distributeSeries: !1, - reverseData: !1, - showGridBackground: !1, - classNames: { - chart: "ct-chart-bar", - horizontalBars: "ct-horizontal-bars", - label: "ct-label", - labelGroup: "ct-labels", - series: "ct-series", - bar: "ct-bar", - grid: "ct-grid", - gridGroup: "ct-grids", - gridBackground: "ct-grid-background", - vertical: "ct-vertical", - horizontal: "ct-horizontal", - start: "ct-start", - end: "ct-end", - }, - }; - c.Bar = c.Base.extend({ constructor: e, createChart: d }); - })(window, document, a), - (function (a, b, c) { - "use strict"; - function d(a, b, c) { - var d = b.x > a.x; - return (d && "explode" === c) || (!d && "implode" === c) - ? "start" - : (d && "implode" === c) || (!d && "explode" === c) - ? "end" - : "middle"; - } - function e(a) { - var b, - e, - f, - h, - i, - j = c.normalizeData(this.data), - k = [], - l = a.startAngle; - (this.svg = c.createSvg( - this.container, - a.width, - a.height, - a.donut ? a.classNames.chartDonut : a.classNames.chartPie, - )), - (e = c.createChartRect(this.svg, a, g.padding)), - (f = Math.min(e.width() / 2, e.height() / 2)), - (i = - a.total || - j.normalized.series.reduce(function (a, b) { - return a + b; - }, 0)); - var m = c.quantity(a.donutWidth); - "%" === m.unit && (m.value *= f / 100), - (f -= a.donut && !a.donutSolid ? m.value / 2 : 0), - (h = - "outside" === a.labelPosition || (a.donut && !a.donutSolid) - ? f - : "center" === a.labelPosition - ? 0 - : a.donutSolid - ? f - m.value / 2 - : f / 2), - (h += a.labelOffset); - var n = { x: e.x1 + e.width() / 2, y: e.y2 + e.height() / 2 }, - o = - 1 === - j.raw.series.filter(function (a) { - return a.hasOwnProperty("value") ? 0 !== a.value : 0 !== a; - }).length; - j.raw.series.forEach( - function (a, b) { - k[b] = this.svg.elem("g", null, null); - }.bind(this), - ), - a.showLabel && (b = this.svg.elem("g", null, null)), - j.raw.series.forEach( - function (e, g) { - if (0 !== j.normalized.series[g] || !a.ignoreEmptyValues) { - k[g].attr({ "ct:series-name": e.name }), - k[g].addClass( - [ - a.classNames.series, - e.className || - a.classNames.series + "-" + c.alphaNumerate(g), - ].join(" "), - ); - var p = i > 0 ? l + (j.normalized.series[g] / i) * 360 : 0, - q = Math.max(0, l - (0 === g || o ? 0 : 0.2)); - p - q >= 359.99 && (p = q + 359.99); - var r, - s, - t, - u = c.polarToCartesian(n.x, n.y, f, q), - v = c.polarToCartesian(n.x, n.y, f, p), - w = new c.Svg.Path(!a.donut || a.donutSolid) - .move(v.x, v.y) - .arc(f, f, 0, p - l > 180, 0, u.x, u.y); - a.donut - ? a.donutSolid && - ((t = f - m.value), - (r = c.polarToCartesian( - n.x, - n.y, - t, - l - (0 === g || o ? 0 : 0.2), - )), - (s = c.polarToCartesian(n.x, n.y, t, p)), - w.line(r.x, r.y), - w.arc(t, t, 0, p - l > 180, 1, s.x, s.y)) - : w.line(n.x, n.y); - var x = a.classNames.slicePie; - a.donut && - ((x = a.classNames.sliceDonut), - a.donutSolid && (x = a.classNames.sliceDonutSolid)); - var y = k[g].elem("path", { d: w.stringify() }, x); - if ( - (y.attr({ - "ct:value": j.normalized.series[g], - "ct:meta": c.serialize(e.meta), - }), - a.donut && - !a.donutSolid && - (y._node.style.strokeWidth = m.value + "px"), - this.eventEmitter.emit("draw", { - type: "slice", - value: j.normalized.series[g], - totalDataSum: i, - index: g, - meta: e.meta, - series: e, - group: k[g], - element: y, - path: w.clone(), - center: n, - radius: f, - startAngle: l, - endAngle: p, - }), - a.showLabel) - ) { - var z; - z = - 1 === j.raw.series.length - ? { x: n.x, y: n.y } - : c.polarToCartesian(n.x, n.y, h, l + (p - l) / 2); - var A; - A = - j.normalized.labels && - !c.isFalseyButZero(j.normalized.labels[g]) - ? j.normalized.labels[g] - : j.normalized.series[g]; - var B = a.labelInterpolationFnc(A, g); - if (B || 0 === B) { - var C = b - .elem( - "text", - { - dx: z.x, - dy: z.y, - "text-anchor": d(n, z, a.labelDirection), - }, - a.classNames.label, - ) - .text("" + B); - this.eventEmitter.emit("draw", { - type: "label", - index: g, - group: b, - element: C, - text: "" + B, - x: z.x, - y: z.y, - }); - } - } - l = p; - } - }.bind(this), - ), - this.eventEmitter.emit("created", { - chartRect: e, - svg: this.svg, - options: a, - }); - } - function f(a, b, d, e) { - c.Pie["super"].constructor.call(this, a, b, g, c.extend({}, g, d), e); - } - var g = { - width: void 0, - height: void 0, - chartPadding: 5, - classNames: { - chartPie: "ct-chart-pie", - chartDonut: "ct-chart-donut", - series: "ct-series", - slicePie: "ct-slice-pie", - sliceDonut: "ct-slice-donut", - sliceDonutSolid: "ct-slice-donut-solid", - label: "ct-label", - }, - startAngle: 0, - total: void 0, - donut: !1, - donutSolid: !1, - donutWidth: 60, - showLabel: !0, - labelOffset: 0, - labelPosition: "inside", - labelInterpolationFnc: c.noop, - labelDirection: "neutral", - reverseData: !1, - ignoreEmptyValues: !1, - }; - c.Pie = c.Base.extend({ - constructor: f, - createChart: e, - determineAnchorPosition: d, - }); - })(window, document, a), - a - ); -}); -//# sourceMappingURL=chartist.min.js.map diff --git a/crates/lora-inspector-wasm/assets/js/main.js b/crates/lora-inspector-wasm/assets/js/main.js index 9efcbf3..89b905e 100644 --- a/crates/lora-inspector-wasm/assets/js/main.js +++ b/crates/lora-inspector-wasm/assets/js/main.js @@ -1,4 +1,8 @@ -"use strict"; +import { LineChart, easings } from "chartist"; +import React from "react"; +import ReactDOM from "react-dom"; +import init from "/pkg"; + const h = React.createElement; function Header({ metadata }) { @@ -139,7 +143,6 @@ function MetaAttribute({ secondary, secondaryName, secondaryClassName, - metadata, containerProps, }) { return h( @@ -180,7 +183,7 @@ function supportsDoRA(networkType) { ); } -function Network({ metadata, filename }) { +function Network({ metadata }) { const [networkModule, setNetworkModule] = React.useState( metadata.get("ss_network_module"), ); @@ -363,10 +366,10 @@ function LoKrNetwork({ metadata }) { function LoRANetwork({ metadata }) { const [alphas, setAlphas] = React.useState([ - (metadata && metadata.get("ss_network_alpha")) ?? undefined, + metadata?.get("ss_network_alpha") ?? undefined, ]); const [dims, setDims] = React.useState([ - (metadata && metadata.get("ss_network_dim")) ?? undefined, + metadata?.get("ss_network_dim") ?? undefined, ]); React.useEffect(() => { trySyncMessage( @@ -400,11 +403,12 @@ function LoRANetwork({ metadata }) { .map((alpha) => { if (typeof alpha === "number") { return alpha.toPrecision(2); - } else if (alpha.includes(".")) { - return parseFloat(alpha).toPrecision(2); - } else { - return parseInt(alpha); } + + if (alpha.includes(".")) { + return Number.parseFloat(alpha).toPrecision(2); + } + return Number.parseInt(alpha); }) .join(", "), key: "network-alpha", @@ -539,7 +543,7 @@ function Weight({ metadata, filename }) { ]; } -function Precision({}) { +function Precision(props = {}) { const [precision, setPrecision] = React.useState(""); React.useEffect(() => { @@ -568,7 +572,7 @@ function scale_weight() { // get progress } -function Blocks({ metadata, filename }) { +function Blocks({ filename }) { const [hasBlockWeights, setHasBlockWeights] = React.useState(false); const [teMagBlocks, setTEMagBlocks] = React.useState(new Map()); const [unetMagBlocks, setUnetMagBlocks] = React.useState(new Map()); @@ -634,18 +638,18 @@ function Blocks({ metadata, filename }) { resp.networkType === undefined ) { setCanHaveBlockWeights(true); - trySyncMessage( - { - messageType: "precision", - name: filename, - reply: true, - }, - filename, - ).then((resp) => { - if (resp.precision == "bf16") { - setCanHaveBlockWeights(false); - } - }); + // trySyncMessage( + // { + // messageType: "precision", + // name: filename, + // reply: true, + // }, + // filename, + // ).then((resp) => { + // if (resp.precision == "bf16") { + // setCanHaveBlockWeights(false); + // } + // }); } }); }, []); @@ -666,7 +670,7 @@ function Blocks({ metadata, filename }) { ], }; // console.log("chartdata", data); - const chart = new Chartist.Line(chartRef.current, data, { + const chart = new LineChart(chartRef.current, data, { chartPadding: { right: 60, top: 30, @@ -685,18 +689,18 @@ function Blocks({ metadata, filename }) { // scaleMinSpace: 100, // position: "end", }, - plugins: [ - Chartist.plugins.ctPointLabels({ - labelOffset: { - x: 10, - y: -10, - }, - textAnchor: "middle", - labelInterpolationFnc: function (value) { - return value.toPrecision(4); - }, - }), - ], + // plugins: [ + // Chartist.plugins.ctPointLabels({ + // labelOffset: { + // x: 10, + // y: -10, + // }, + // textAnchor: "middle", + // labelInterpolationFnc: function (value) { + // return value.toPrecision(4); + // }, + // }), + // ], }); let seq = 0; @@ -725,7 +729,7 @@ function Blocks({ metadata, filename }) { from: data.x - 20, to: data.x, // You can specify an easing function name or use easing functions from Chartist.Svg.Easing directly - easing: Chartist.Svg.Easing.easeOutQuart, + easing: easings.easeOutQuart, }, }); } @@ -754,7 +758,9 @@ function Blocks({ metadata, filename }) { { className: "block-weights-container" }, "Block weights not supported for this network type or precision.", ); - } else if (!hasBlockWeights) { + } + + if (!hasBlockWeights) { return h( "div", { className: "block-weights-container" }, @@ -1593,7 +1599,8 @@ function Statistics({ baseNames, filename }) { if (calcStatistics && !hasStatistics) { const elapsedTime = performance.now() - startTime; const remaining = - (elapsedTime * totalCount) / statisticProgress - elapsedTime * totalCount; + (elapsedTime * totalCount) / statisticProgress - + elapsedTime * totalCount || 0; const perSecond = currentCount / (elapsedTime / 1_000); // if (currentCount === 0) { @@ -3314,7 +3321,7 @@ const dropbox = document.querySelector("#dropbox"); // }); // }); -let files = new Map(); +const files = new Map(); let mainFilename; // let worker = new Worker("./assets/js/worker.js", {}); @@ -3322,12 +3329,13 @@ let mainFilename; const workers = new Map(); async function addWorker(file) { - const worker = new Worker("./assets/js/worker.js", {}); + const worker = new Worker(new URL("./worker.js", import.meta.url), { type: "module" }); + // const worker = new InspectorWorker(); workers.set(file, worker); return new Promise((resolve, reject) => { - let timeouts = []; + const timeouts = []; const worker = workers.get(file); worker.onmessage = (event) => { @@ -3365,7 +3373,7 @@ function clearWorkers() { }); } -wasm_bindgen().then(() => { +init().then(() => { ["drop"].forEach((evtName) => { document.addEventListener(evtName, async (e) => { e.preventDefault(); diff --git a/crates/lora-inspector-wasm/assets/js/moduleBlocks.js b/crates/lora-inspector-wasm/assets/js/moduleBlocks.js new file mode 100644 index 0000000..da1cab0 --- /dev/null +++ b/crates/lora-inspector-wasm/assets/js/moduleBlocks.js @@ -0,0 +1,220 @@ +// Handle parsing of the keys + +const SDRE = + /.*(?up|down|mid)_blocks?_.*(?\d+).*(?resnets|attentions|upsamplers|downsamplers)_(?\d+).*/; + +const MID_SDRE = + /.*(?up|down|mid)_block_.*(?resnets|attentions|upsamplers|downsamplers)_(?\d+)_.*(?\d+)?.*/; +const TE_SDRE = /(?\d+).*(?self_attn|mlp)/; +const SDXL_TE_SDRE = + /lora_te\d+_text_model_encoder_layers_(?\d+)_(?self_attn|mlp)_(?\w+_proj)/; +const SDXL_UNET_SDRE = + /lora_unet_(?up|down|mid|output|input)_blocks_(?\d+)_(?\d+)_transformer_blocks_(?\d+)_(?\w+)_(?\d+)/; +const NUM_OF_BLOCKS = 12; + +function parseSDKey(key) { + let blockIdx = -1; + let idx; + + let isConv = false; + let isAttention = false; + let isSampler = false; + // const isProjection = false; + // const isFeedForward = false; + + let type; + let blockType; + let blockId; + let subBlockId; + let name; + + // Handle the text encoder + if (key.includes("te_text_model")) { + const matches = key.match(TE_SDRE); + if (matches) { + const groups = matches.groups; + type = "encoder"; + blockId = Number.parseInt(groups.block_id); + blockType = groups.block_type; + + name = `TE${padTwo(blockId)}`; + + if (blockType === "self_attn") { + isAttention = true; + } + } + } else if (key.includes("te1") || key.includes("te2")) { + const matches = key.match(SDXL_TE_SDRE); + + if (matches) { + const groups = matches.groups; + type = "encoder"; + blockId = Number.parseInt(groups.block_id); + blockType = groups.block_type; + + name = `TE${padTwo(blockId)}`; + + if (blockType === "self_attn") { + isAttention = true; + } + } + // Handling the UNet values + } else if (key.includes("output_blocks")) { + const matches = key.match(SDRE); + if (matches) { + const groups = matches.groups; + + type = groups.type; + blockType = groups.block_type; + blockId = Number.parseInt(groups.block_id); + subBlockId = Number.parseInt(groups.subblock_id); + + if (groups.type === "attentions") { + idx = 3 * blockId + subBlockId; + isAttention = true; + } else if (groups.type === "resnets") { + idx = 3 * blockId + subBlockId; + isConv = true; + } else if ( + groups.type === "upsamplers" || + groups.type === "downsamplers" + ) { + idx = 3 * blockId + 2; + isSampler = true; + } + + if (groups.block_type === "down") { + blockIdx = 1 + idx; + name = `IN${padTwo(idx)}`; + } else if (groups.block_type === "up") { + blockIdx = NUM_OF_BLOCKS + 1 + idx; + name = `OUT${padTwo(idx)}`; + } else if (groups.block_type === "mid") { + blockIdx = NUM_OF_BLOCKS; + } + // Handle the mid block + } else if (key.includes("mid_block_")) { + const midMatch = key.match(MID_SDRE); + name = "MID"; + + if (midMatch) { + const groups = midMatch.groups; + + type = groups.type; + blockType = groups.block_type; + blockId = Number.parseInt(groups.block_id); + subBlockId = Number.parseInt(groups.subblock_id); + + name = `MID${padTwo(blockId)}`; + + if (groups.type === "attentions") { + isAttention = true; + } else if (groups.type === "resnets") { + isConv = true; + } + } + + blockIdx = NUM_OF_BLOCKS; + } + } else { + const matches = key.match(SDRE); + if (matches) { + const groups = matches.groups; + + type = groups.type; + blockType = groups.block_type; + blockId = Number.parseInt(groups.block_id); + subBlockId = Number.parseInt(groups.subblock_id); + + if (groups.type === "attentions") { + idx = 3 * blockId + subBlockId; + isAttention = true; + } else if (groups.type === "resnets") { + idx = 3 * blockId + subBlockId; + isConv = true; + } else if ( + groups.type === "upsamplers" || + groups.type === "downsamplers" + ) { + idx = 3 * blockId + 2; + isSampler = true; + } + + if (groups.block_type === "down") { + blockIdx = 1 + idx; + name = `IN${padTwo(idx)}`; + } else if (groups.block_type === "up") { + blockIdx = NUM_OF_BLOCKS + 1 + idx; + name = `OUT${padTwo(idx)}`; + } else if (groups.block_type === "mid") { + blockIdx = NUM_OF_BLOCKS; + } + // Handle the mid block + } else if (key.includes("mid_block_")) { + const midMatch = key.match(MID_SDRE); + name = "MID"; + + if (midMatch) { + const groups = midMatch.groups; + + type = groups.type; + blockType = groups.block_type; + blockId = Number.parseInt(groups.block_id); + subBlockId = Number.parseInt(groups.subblock_id); + + name = `MID${padTwo(blockId)}`; + + if (groups.type === "attentions") { + isAttention = true; + } else if (groups.type === "resnets") { + isConv = true; + } + } + + blockIdx = NUM_OF_BLOCKS; + } + } + + return { + // Used in commmon format IN01 + idx, + // Block index between 1 and 24 + blockIdx, + // Common name IN01 + name, + // name of the block up, down, mid + // id of the block (up_0, down_1) + blockId, + // id of the subblock (resnet, attentions) + subBlockId, + // resnets, attentions, upscalers, downscalers + type, + // + blockType, + // is a convolution key + isConv, + // is an attention key + isAttention, + // is a upscaler/downscaler + isSampler, + key, + }; +} + +function padTwo(number, padWith = "0") { + if (number < 10) { + return `${padWith}${number}`; + } + + return `${number}`; +} + +export { + parseSDKey, + SDRE, + MID_SDRE, + TE_SDRE, + SDXL_TE_SDRE, + SDXL_UNET_SDRE, + NUM_OF_BLOCKS, +}; diff --git a/crates/lora-inspector-wasm/assets/js/react-dom.production.min.js b/crates/lora-inspector-wasm/assets/js/react-dom.production.min.js deleted file mode 100644 index 8f57de4..0000000 --- a/crates/lora-inspector-wasm/assets/js/react-dom.production.min.js +++ /dev/null @@ -1,8615 +0,0 @@ -/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -(function () { - /* - Modernizr 3.0.0pre (Custom Build) | MIT -*/ - "use strict"; - (function (Q, mb) { - "object" === typeof exports && "undefined" !== typeof module - ? mb(exports, require("react")) - : "function" === typeof define && define.amd - ? define(["exports", "react"], mb) - : ((Q = Q || self), mb((Q.ReactDOM = {}), Q.React)); - })(this, function (Q, mb) { - function n(a) { - for ( - var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, - c = 1; - c < arguments.length; - c++ - ) - b += "&args[]=" + encodeURIComponent(arguments[c]); - return ( - "Minified React error #" + - a + - "; visit " + - b + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); - } - function nb(a, b) { - Ab(a, b); - Ab(a + "Capture", b); - } - function Ab(a, b) { - $b[a] = b; - for (a = 0; a < b.length; a++) cg.add(b[a]); - } - function cj(a) { - if (Zd.call(dg, a)) return !0; - if (Zd.call(eg, a)) return !1; - if (dj.test(a)) return (dg[a] = !0); - eg[a] = !0; - return !1; - } - function ej(a, b, c, d) { - if (null !== c && 0 === c.type) return !1; - switch (typeof b) { - case "function": - case "symbol": - return !0; - case "boolean": - if (d) return !1; - if (null !== c) return !c.acceptsBooleans; - a = a.toLowerCase().slice(0, 5); - return "data-" !== a && "aria-" !== a; - default: - return !1; - } - } - function fj(a, b, c, d) { - if (null === b || "undefined" === typeof b || ej(a, b, c, d)) return !0; - if (d) return !1; - if (null !== c) - switch (c.type) { - case 3: - return !b; - case 4: - return !1 === b; - case 5: - return isNaN(b); - case 6: - return isNaN(b) || 1 > b; - } - return !1; - } - function Y(a, b, c, d, e, f, g) { - this.acceptsBooleans = 2 === b || 3 === b || 4 === b; - this.attributeName = d; - this.attributeNamespace = e; - this.mustUseProperty = c; - this.propertyName = a; - this.type = b; - this.sanitizeURL = f; - this.removeEmptyString = g; - } - function $d(a, b, c, d) { - var e = R.hasOwnProperty(b) ? R[b] : null; - if ( - null !== e - ? 0 !== e.type - : d || - !(2 < b.length) || - ("o" !== b[0] && "O" !== b[0]) || - ("n" !== b[1] && "N" !== b[1]) - ) - fj(b, c, e, d) && (c = null), - d || null === e - ? cj(b) && - (null === c ? a.removeAttribute(b) : a.setAttribute(b, "" + c)) - : e.mustUseProperty - ? (a[e.propertyName] = null === c ? (3 === e.type ? !1 : "") : c) - : ((b = e.attributeName), - (d = e.attributeNamespace), - null === c - ? a.removeAttribute(b) - : ((e = e.type), - (c = 3 === e || (4 === e && !0 === c) ? "" : "" + c), - d ? a.setAttributeNS(d, b, c) : a.setAttribute(b, c))); - } - function ac(a) { - if (null === a || "object" !== typeof a) return null; - a = (fg && a[fg]) || a["@@iterator"]; - return "function" === typeof a ? a : null; - } - function bc(a, b, c) { - if (void 0 === ae) - try { - throw Error(); - } catch (d) { - ae = ((b = d.stack.trim().match(/\n( *(at )?)/)) && b[1]) || ""; - } - return "\n" + ae + a; - } - function be(a, b) { - if (!a || ce) return ""; - ce = !0; - var c = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - try { - if (b) - if ( - ((b = function () { - throw Error(); - }), - Object.defineProperty(b.prototype, "props", { - set: function () { - throw Error(); - }, - }), - "object" === typeof Reflect && Reflect.construct) - ) { - try { - Reflect.construct(b, []); - } catch (m) { - var d = m; - } - Reflect.construct(a, [], b); - } else { - try { - b.call(); - } catch (m) { - d = m; - } - a.call(b.prototype); - } - else { - try { - throw Error(); - } catch (m) { - d = m; - } - a(); - } - } catch (m) { - if (m && d && "string" === typeof m.stack) { - for ( - var e = m.stack.split("\n"), - f = d.stack.split("\n"), - g = e.length - 1, - h = f.length - 1; - 1 <= g && 0 <= h && e[g] !== f[h]; - - ) - h--; - for (; 1 <= g && 0 <= h; g--, h--) - if (e[g] !== f[h]) { - if (1 !== g || 1 !== h) { - do - if ((g--, h--, 0 > h || e[g] !== f[h])) { - var k = "\n" + e[g].replace(" at new ", " at "); - a.displayName && - k.includes("") && - (k = k.replace("", a.displayName)); - return k; - } - while (1 <= g && 0 <= h); - } - break; - } - } - } finally { - (ce = !1), (Error.prepareStackTrace = c); - } - return (a = a ? a.displayName || a.name : "") ? bc(a) : ""; - } - function gj(a) { - switch (a.tag) { - case 5: - return bc(a.type); - case 16: - return bc("Lazy"); - case 13: - return bc("Suspense"); - case 19: - return bc("SuspenseList"); - case 0: - case 2: - case 15: - return (a = be(a.type, !1)), a; - case 11: - return (a = be(a.type.render, !1)), a; - case 1: - return (a = be(a.type, !0)), a; - default: - return ""; - } - } - function de(a) { - if (null == a) return null; - if ("function" === typeof a) return a.displayName || a.name || null; - if ("string" === typeof a) return a; - switch (a) { - case Bb: - return "Fragment"; - case Cb: - return "Portal"; - case ee: - return "Profiler"; - case fe: - return "StrictMode"; - case ge: - return "Suspense"; - case he: - return "SuspenseList"; - } - if ("object" === typeof a) - switch (a.$$typeof) { - case gg: - return (a.displayName || "Context") + ".Consumer"; - case hg: - return (a._context.displayName || "Context") + ".Provider"; - case ie: - var b = a.render; - a = a.displayName; - a || - ((a = b.displayName || b.name || ""), - (a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef")); - return a; - case je: - return ( - (b = a.displayName || null), null !== b ? b : de(a.type) || "Memo" - ); - case Ta: - b = a._payload; - a = a._init; - try { - return de(a(b)); - } catch (c) {} - } - return null; - } - function hj(a) { - var b = a.type; - switch (a.tag) { - case 24: - return "Cache"; - case 9: - return (b.displayName || "Context") + ".Consumer"; - case 10: - return (b._context.displayName || "Context") + ".Provider"; - case 18: - return "DehydratedFragment"; - case 11: - return ( - (a = b.render), - (a = a.displayName || a.name || ""), - b.displayName || ("" !== a ? "ForwardRef(" + a + ")" : "ForwardRef") - ); - case 7: - return "Fragment"; - case 5: - return b; - case 4: - return "Portal"; - case 3: - return "Root"; - case 6: - return "Text"; - case 16: - return de(b); - case 8: - return b === fe ? "StrictMode" : "Mode"; - case 22: - return "Offscreen"; - case 12: - return "Profiler"; - case 21: - return "Scope"; - case 13: - return "Suspense"; - case 19: - return "SuspenseList"; - case 25: - return "TracingMarker"; - case 1: - case 0: - case 17: - case 2: - case 14: - case 15: - if ("function" === typeof b) return b.displayName || b.name || null; - if ("string" === typeof b) return b; - } - return null; - } - function Ua(a) { - switch (typeof a) { - case "boolean": - case "number": - case "string": - case "undefined": - return a; - case "object": - return a; - default: - return ""; - } - } - function ig(a) { - var b = a.type; - return ( - (a = a.nodeName) && - "input" === a.toLowerCase() && - ("checkbox" === b || "radio" === b) - ); - } - function ij(a) { - var b = ig(a) ? "checked" : "value", - c = Object.getOwnPropertyDescriptor(a.constructor.prototype, b), - d = "" + a[b]; - if ( - !a.hasOwnProperty(b) && - "undefined" !== typeof c && - "function" === typeof c.get && - "function" === typeof c.set - ) { - var e = c.get, - f = c.set; - Object.defineProperty(a, b, { - configurable: !0, - get: function () { - return e.call(this); - }, - set: function (a) { - d = "" + a; - f.call(this, a); - }, - }); - Object.defineProperty(a, b, { enumerable: c.enumerable }); - return { - getValue: function () { - return d; - }, - setValue: function (a) { - d = "" + a; - }, - stopTracking: function () { - a._valueTracker = null; - delete a[b]; - }, - }; - } - } - function Pc(a) { - a._valueTracker || (a._valueTracker = ij(a)); - } - function jg(a) { - if (!a) return !1; - var b = a._valueTracker; - if (!b) return !0; - var c = b.getValue(); - var d = ""; - a && (d = ig(a) ? (a.checked ? "true" : "false") : a.value); - a = d; - return a !== c ? (b.setValue(a), !0) : !1; - } - function Qc(a) { - a = a || ("undefined" !== typeof document ? document : void 0); - if ("undefined" === typeof a) return null; - try { - return a.activeElement || a.body; - } catch (b) { - return a.body; - } - } - function ke(a, b) { - var c = b.checked; - return E({}, b, { - defaultChecked: void 0, - defaultValue: void 0, - value: void 0, - checked: null != c ? c : a._wrapperState.initialChecked, - }); - } - function kg(a, b) { - var c = null == b.defaultValue ? "" : b.defaultValue, - d = null != b.checked ? b.checked : b.defaultChecked; - c = Ua(null != b.value ? b.value : c); - a._wrapperState = { - initialChecked: d, - initialValue: c, - controlled: - "checkbox" === b.type || "radio" === b.type - ? null != b.checked - : null != b.value, - }; - } - function lg(a, b) { - b = b.checked; - null != b && $d(a, "checked", b, !1); - } - function le(a, b) { - lg(a, b); - var c = Ua(b.value), - d = b.type; - if (null != c) - if ("number" === d) { - if ((0 === c && "" === a.value) || a.value != c) a.value = "" + c; - } else a.value !== "" + c && (a.value = "" + c); - else if ("submit" === d || "reset" === d) { - a.removeAttribute("value"); - return; - } - b.hasOwnProperty("value") - ? me(a, b.type, c) - : b.hasOwnProperty("defaultValue") && me(a, b.type, Ua(b.defaultValue)); - null == b.checked && - null != b.defaultChecked && - (a.defaultChecked = !!b.defaultChecked); - } - function mg(a, b, c) { - if (b.hasOwnProperty("value") || b.hasOwnProperty("defaultValue")) { - var d = b.type; - if ( - !( - ("submit" !== d && "reset" !== d) || - (void 0 !== b.value && null !== b.value) - ) - ) - return; - b = "" + a._wrapperState.initialValue; - c || b === a.value || (a.value = b); - a.defaultValue = b; - } - c = a.name; - "" !== c && (a.name = ""); - a.defaultChecked = !!a._wrapperState.initialChecked; - "" !== c && (a.name = c); - } - function me(a, b, c) { - if ("number" !== b || Qc(a.ownerDocument) !== a) - null == c - ? (a.defaultValue = "" + a._wrapperState.initialValue) - : a.defaultValue !== "" + c && (a.defaultValue = "" + c); - } - function Db(a, b, c, d) { - a = a.options; - if (b) { - b = {}; - for (var e = 0; e < c.length; e++) b["$" + c[e]] = !0; - for (c = 0; c < a.length; c++) - (e = b.hasOwnProperty("$" + a[c].value)), - a[c].selected !== e && (a[c].selected = e), - e && d && (a[c].defaultSelected = !0); - } else { - c = "" + Ua(c); - b = null; - for (e = 0; e < a.length; e++) { - if (a[e].value === c) { - a[e].selected = !0; - d && (a[e].defaultSelected = !0); - return; - } - null !== b || a[e].disabled || (b = a[e]); - } - null !== b && (b.selected = !0); - } - } - function ne(a, b) { - if (null != b.dangerouslySetInnerHTML) throw Error(n(91)); - return E({}, b, { - value: void 0, - defaultValue: void 0, - children: "" + a._wrapperState.initialValue, - }); - } - function ng(a, b) { - var c = b.value; - if (null == c) { - c = b.children; - b = b.defaultValue; - if (null != c) { - if (null != b) throw Error(n(92)); - if (cc(c)) { - if (1 < c.length) throw Error(n(93)); - c = c[0]; - } - b = c; - } - null == b && (b = ""); - c = b; - } - a._wrapperState = { initialValue: Ua(c) }; - } - function og(a, b) { - var c = Ua(b.value), - d = Ua(b.defaultValue); - null != c && - ((c = "" + c), - c !== a.value && (a.value = c), - null == b.defaultValue && a.defaultValue !== c && (a.defaultValue = c)); - null != d && (a.defaultValue = "" + d); - } - function pg(a, b) { - b = a.textContent; - b === a._wrapperState.initialValue && - "" !== b && - null !== b && - (a.value = b); - } - function qg(a) { - switch (a) { - case "svg": - return "http://www.w3.org/2000/svg"; - case "math": - return "http://www.w3.org/1998/Math/MathML"; - default: - return "http://www.w3.org/1999/xhtml"; - } - } - function oe(a, b) { - return null == a || "http://www.w3.org/1999/xhtml" === a - ? qg(b) - : "http://www.w3.org/2000/svg" === a && "foreignObject" === b - ? "http://www.w3.org/1999/xhtml" - : a; - } - function rg(a, b, c) { - return null == b || "boolean" === typeof b || "" === b - ? "" - : c || - "number" !== typeof b || - 0 === b || - (dc.hasOwnProperty(a) && dc[a]) - ? ("" + b).trim() - : b + "px"; - } - function sg(a, b) { - a = a.style; - for (var c in b) - if (b.hasOwnProperty(c)) { - var d = 0 === c.indexOf("--"), - e = rg(c, b[c], d); - "float" === c && (c = "cssFloat"); - d ? a.setProperty(c, e) : (a[c] = e); - } - } - function pe(a, b) { - if (b) { - if (jj[a] && (null != b.children || null != b.dangerouslySetInnerHTML)) - throw Error(n(137, a)); - if (null != b.dangerouslySetInnerHTML) { - if (null != b.children) throw Error(n(60)); - if ( - "object" !== typeof b.dangerouslySetInnerHTML || - !("__html" in b.dangerouslySetInnerHTML) - ) - throw Error(n(61)); - } - if (null != b.style && "object" !== typeof b.style) throw Error(n(62)); - } - } - function qe(a, b) { - if (-1 === a.indexOf("-")) return "string" === typeof b.is; - switch (a) { - case "annotation-xml": - case "color-profile": - case "font-face": - case "font-face-src": - case "font-face-uri": - case "font-face-format": - case "font-face-name": - case "missing-glyph": - return !1; - default: - return !0; - } - } - function re(a) { - a = a.target || a.srcElement || window; - a.correspondingUseElement && (a = a.correspondingUseElement); - return 3 === a.nodeType ? a.parentNode : a; - } - function tg(a) { - if ((a = ec(a))) { - if ("function" !== typeof se) throw Error(n(280)); - var b = a.stateNode; - b && ((b = Rc(b)), se(a.stateNode, a.type, b)); - } - } - function ug(a) { - Eb ? (Fb ? Fb.push(a) : (Fb = [a])) : (Eb = a); - } - function vg() { - if (Eb) { - var a = Eb, - b = Fb; - Fb = Eb = null; - tg(a); - if (b) for (a = 0; a < b.length; a++) tg(b[a]); - } - } - function wg(a, b, c) { - if (te) return a(b, c); - te = !0; - try { - return xg(a, b, c); - } finally { - if (((te = !1), null !== Eb || null !== Fb)) yg(), vg(); - } - } - function fc(a, b) { - var c = a.stateNode; - if (null === c) return null; - var d = Rc(c); - if (null === d) return null; - c = d[b]; - a: switch (b) { - case "onClick": - case "onClickCapture": - case "onDoubleClick": - case "onDoubleClickCapture": - case "onMouseDown": - case "onMouseDownCapture": - case "onMouseMove": - case "onMouseMoveCapture": - case "onMouseUp": - case "onMouseUpCapture": - case "onMouseEnter": - (d = !d.disabled) || - ((a = a.type), - (d = !( - "button" === a || - "input" === a || - "select" === a || - "textarea" === a - ))); - a = !d; - break a; - default: - a = !1; - } - if (a) return null; - if (c && "function" !== typeof c) throw Error(n(231, b, typeof c)); - return c; - } - function kj(a, b, c, d, e, f, g, h, k) { - gc = !1; - Sc = null; - lj.apply(mj, arguments); - } - function nj(a, b, c, d, e, f, g, h, k) { - kj.apply(this, arguments); - if (gc) { - if (gc) { - var m = Sc; - gc = !1; - Sc = null; - } else throw Error(n(198)); - Tc || ((Tc = !0), (ue = m)); - } - } - function ob(a) { - var b = a, - c = a; - if (a.alternate) for (; b.return; ) b = b.return; - else { - a = b; - do (b = a), 0 !== (b.flags & 4098) && (c = b.return), (a = b.return); - while (a); - } - return 3 === b.tag ? c : null; - } - function zg(a) { - if (13 === a.tag) { - var b = a.memoizedState; - null === b && ((a = a.alternate), null !== a && (b = a.memoizedState)); - if (null !== b) return b.dehydrated; - } - return null; - } - function Ag(a) { - if (ob(a) !== a) throw Error(n(188)); - } - function oj(a) { - var b = a.alternate; - if (!b) { - b = ob(a); - if (null === b) throw Error(n(188)); - return b !== a ? null : a; - } - for (var c = a, d = b; ; ) { - var e = c.return; - if (null === e) break; - var f = e.alternate; - if (null === f) { - d = e.return; - if (null !== d) { - c = d; - continue; - } - break; - } - if (e.child === f.child) { - for (f = e.child; f; ) { - if (f === c) return Ag(e), a; - if (f === d) return Ag(e), b; - f = f.sibling; - } - throw Error(n(188)); - } - if (c.return !== d.return) (c = e), (d = f); - else { - for (var g = !1, h = e.child; h; ) { - if (h === c) { - g = !0; - c = e; - d = f; - break; - } - if (h === d) { - g = !0; - d = e; - c = f; - break; - } - h = h.sibling; - } - if (!g) { - for (h = f.child; h; ) { - if (h === c) { - g = !0; - c = f; - d = e; - break; - } - if (h === d) { - g = !0; - d = f; - c = e; - break; - } - h = h.sibling; - } - if (!g) throw Error(n(189)); - } - } - if (c.alternate !== d) throw Error(n(190)); - } - if (3 !== c.tag) throw Error(n(188)); - return c.stateNode.current === c ? a : b; - } - function Bg(a) { - a = oj(a); - return null !== a ? Cg(a) : null; - } - function Cg(a) { - if (5 === a.tag || 6 === a.tag) return a; - for (a = a.child; null !== a; ) { - var b = Cg(a); - if (null !== b) return b; - a = a.sibling; - } - return null; - } - function pj(a, b) { - if (Ca && "function" === typeof Ca.onCommitFiberRoot) - try { - Ca.onCommitFiberRoot(Uc, a, void 0, 128 === (a.current.flags & 128)); - } catch (c) {} - } - function qj(a) { - a >>>= 0; - return 0 === a ? 32 : (31 - ((rj(a) / sj) | 0)) | 0; - } - function hc(a) { - switch (a & -a) { - case 1: - return 1; - case 2: - return 2; - case 4: - return 4; - case 8: - return 8; - case 16: - return 16; - case 32: - return 32; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return a & 4194240; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return a & 130023424; - case 134217728: - return 134217728; - case 268435456: - return 268435456; - case 536870912: - return 536870912; - case 1073741824: - return 1073741824; - default: - return a; - } - } - function Vc(a, b) { - var c = a.pendingLanes; - if (0 === c) return 0; - var d = 0, - e = a.suspendedLanes, - f = a.pingedLanes, - g = c & 268435455; - if (0 !== g) { - var h = g & ~e; - 0 !== h ? (d = hc(h)) : ((f &= g), 0 !== f && (d = hc(f))); - } else (g = c & ~e), 0 !== g ? (d = hc(g)) : 0 !== f && (d = hc(f)); - if (0 === d) return 0; - if ( - 0 !== b && - b !== d && - 0 === (b & e) && - ((e = d & -d), - (f = b & -b), - e >= f || (16 === e && 0 !== (f & 4194240))) - ) - return b; - 0 !== (d & 4) && (d |= c & 16); - b = a.entangledLanes; - if (0 !== b) - for (a = a.entanglements, b &= d; 0 < b; ) - (c = 31 - ta(b)), (e = 1 << c), (d |= a[c]), (b &= ~e); - return d; - } - function tj(a, b) { - switch (a) { - case 1: - case 2: - case 4: - return b + 250; - case 8: - case 16: - case 32: - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - return b + 5e3; - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - return -1; - case 134217728: - case 268435456: - case 536870912: - case 1073741824: - return -1; - default: - return -1; - } - } - function uj(a, b) { - for ( - var c = a.suspendedLanes, - d = a.pingedLanes, - e = a.expirationTimes, - f = a.pendingLanes; - 0 < f; - - ) { - var g = 31 - ta(f), - h = 1 << g, - k = e[g]; - if (-1 === k) { - if (0 === (h & c) || 0 !== (h & d)) e[g] = tj(h, b); - } else k <= b && (a.expiredLanes |= h); - f &= ~h; - } - } - function ve(a) { - a = a.pendingLanes & -1073741825; - return 0 !== a ? a : a & 1073741824 ? 1073741824 : 0; - } - function Dg() { - var a = Wc; - Wc <<= 1; - 0 === (Wc & 4194240) && (Wc = 64); - return a; - } - function we(a) { - for (var b = [], c = 0; 31 > c; c++) b.push(a); - return b; - } - function ic(a, b, c) { - a.pendingLanes |= b; - 536870912 !== b && ((a.suspendedLanes = 0), (a.pingedLanes = 0)); - a = a.eventTimes; - b = 31 - ta(b); - a[b] = c; - } - function vj(a, b) { - var c = a.pendingLanes & ~b; - a.pendingLanes = b; - a.suspendedLanes = 0; - a.pingedLanes = 0; - a.expiredLanes &= b; - a.mutableReadLanes &= b; - a.entangledLanes &= b; - b = a.entanglements; - var d = a.eventTimes; - for (a = a.expirationTimes; 0 < c; ) { - var e = 31 - ta(c), - f = 1 << e; - b[e] = 0; - d[e] = -1; - a[e] = -1; - c &= ~f; - } - } - function xe(a, b) { - var c = (a.entangledLanes |= b); - for (a = a.entanglements; c; ) { - var d = 31 - ta(c), - e = 1 << d; - (e & b) | (a[d] & b) && (a[d] |= b); - c &= ~e; - } - } - function Eg(a) { - a &= -a; - return 1 < a ? (4 < a ? (0 !== (a & 268435455) ? 16 : 536870912) : 4) : 1; - } - function Fg(a, b) { - switch (a) { - case "focusin": - case "focusout": - Va = null; - break; - case "dragenter": - case "dragleave": - Wa = null; - break; - case "mouseover": - case "mouseout": - Xa = null; - break; - case "pointerover": - case "pointerout": - jc.delete(b.pointerId); - break; - case "gotpointercapture": - case "lostpointercapture": - kc.delete(b.pointerId); - } - } - function lc(a, b, c, d, e, f) { - if (null === a || a.nativeEvent !== f) - return ( - (a = { - blockedOn: b, - domEventName: c, - eventSystemFlags: d, - nativeEvent: f, - targetContainers: [e], - }), - null !== b && ((b = ec(b)), null !== b && Gg(b)), - a - ); - a.eventSystemFlags |= d; - b = a.targetContainers; - null !== e && -1 === b.indexOf(e) && b.push(e); - return a; - } - function wj(a, b, c, d, e) { - switch (b) { - case "focusin": - return (Va = lc(Va, a, b, c, d, e)), !0; - case "dragenter": - return (Wa = lc(Wa, a, b, c, d, e)), !0; - case "mouseover": - return (Xa = lc(Xa, a, b, c, d, e)), !0; - case "pointerover": - var f = e.pointerId; - jc.set(f, lc(jc.get(f) || null, a, b, c, d, e)); - return !0; - case "gotpointercapture": - return ( - (f = e.pointerId), - kc.set(f, lc(kc.get(f) || null, a, b, c, d, e)), - !0 - ); - } - return !1; - } - function Hg(a) { - var b = pb(a.target); - if (null !== b) { - var c = ob(b); - if (null !== c) - if (((b = c.tag), 13 === b)) { - if (((b = zg(c)), null !== b)) { - a.blockedOn = b; - xj(a.priority, function () { - yj(c); - }); - return; - } - } else if ( - 3 === b && - c.stateNode.current.memoizedState.isDehydrated - ) { - a.blockedOn = 3 === c.tag ? c.stateNode.containerInfo : null; - return; - } - } - a.blockedOn = null; - } - function Xc(a) { - if (null !== a.blockedOn) return !1; - for (var b = a.targetContainers; 0 < b.length; ) { - var c = ye(a.domEventName, a.eventSystemFlags, b[0], a.nativeEvent); - if (null === c) { - c = a.nativeEvent; - var d = new c.constructor(c.type, c); - ze = d; - c.target.dispatchEvent(d); - ze = null; - } else return (b = ec(c)), null !== b && Gg(b), (a.blockedOn = c), !1; - b.shift(); - } - return !0; - } - function Ig(a, b, c) { - Xc(a) && c.delete(b); - } - function zj() { - Ae = !1; - null !== Va && Xc(Va) && (Va = null); - null !== Wa && Xc(Wa) && (Wa = null); - null !== Xa && Xc(Xa) && (Xa = null); - jc.forEach(Ig); - kc.forEach(Ig); - } - function mc(a, b) { - a.blockedOn === b && - ((a.blockedOn = null), Ae || ((Ae = !0), Jg(Kg, zj))); - } - function nc(a) { - if (0 < Yc.length) { - mc(Yc[0], a); - for (var b = 1; b < Yc.length; b++) { - var c = Yc[b]; - c.blockedOn === a && (c.blockedOn = null); - } - } - null !== Va && mc(Va, a); - null !== Wa && mc(Wa, a); - null !== Xa && mc(Xa, a); - b = function (b) { - return mc(b, a); - }; - jc.forEach(b); - kc.forEach(b); - for (b = 0; b < Ya.length; b++) - (c = Ya[b]), c.blockedOn === a && (c.blockedOn = null); - for (; 0 < Ya.length && ((b = Ya[0]), null === b.blockedOn); ) - Hg(b), null === b.blockedOn && Ya.shift(); - } - function Aj(a, b, c, d) { - var e = z, - f = Gb.transition; - Gb.transition = null; - try { - (z = 1), Be(a, b, c, d); - } finally { - (z = e), (Gb.transition = f); - } - } - function Bj(a, b, c, d) { - var e = z, - f = Gb.transition; - Gb.transition = null; - try { - (z = 4), Be(a, b, c, d); - } finally { - (z = e), (Gb.transition = f); - } - } - function Be(a, b, c, d) { - if (Zc) { - var e = ye(a, b, c, d); - if (null === e) Ce(a, b, d, $c, c), Fg(a, d); - else if (wj(e, a, b, c, d)) d.stopPropagation(); - else if ((Fg(a, d), b & 4 && -1 < Cj.indexOf(a))) { - for (; null !== e; ) { - var f = ec(e); - null !== f && Dj(f); - f = ye(a, b, c, d); - null === f && Ce(a, b, d, $c, c); - if (f === e) break; - e = f; - } - null !== e && d.stopPropagation(); - } else Ce(a, b, d, null, c); - } - } - function ye(a, b, c, d) { - $c = null; - a = re(d); - a = pb(a); - if (null !== a) - if (((b = ob(a)), null === b)) a = null; - else if (((c = b.tag), 13 === c)) { - a = zg(b); - if (null !== a) return a; - a = null; - } else if (3 === c) { - if (b.stateNode.current.memoizedState.isDehydrated) - return 3 === b.tag ? b.stateNode.containerInfo : null; - a = null; - } else b !== a && (a = null); - $c = a; - return null; - } - function Lg(a) { - switch (a) { - case "cancel": - case "click": - case "close": - case "contextmenu": - case "copy": - case "cut": - case "auxclick": - case "dblclick": - case "dragend": - case "dragstart": - case "drop": - case "focusin": - case "focusout": - case "input": - case "invalid": - case "keydown": - case "keypress": - case "keyup": - case "mousedown": - case "mouseup": - case "paste": - case "pause": - case "play": - case "pointercancel": - case "pointerdown": - case "pointerup": - case "ratechange": - case "reset": - case "resize": - case "seeked": - case "submit": - case "touchcancel": - case "touchend": - case "touchstart": - case "volumechange": - case "change": - case "selectionchange": - case "textInput": - case "compositionstart": - case "compositionend": - case "compositionupdate": - case "beforeblur": - case "afterblur": - case "beforeinput": - case "blur": - case "fullscreenchange": - case "focus": - case "hashchange": - case "popstate": - case "select": - case "selectstart": - return 1; - case "drag": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "mousemove": - case "mouseout": - case "mouseover": - case "pointermove": - case "pointerout": - case "pointerover": - case "scroll": - case "toggle": - case "touchmove": - case "wheel": - case "mouseenter": - case "mouseleave": - case "pointerenter": - case "pointerleave": - return 4; - case "message": - switch (Ej()) { - case De: - return 1; - case Mg: - return 4; - case ad: - case Fj: - return 16; - case Ng: - return 536870912; - default: - return 16; - } - default: - return 16; - } - } - function Og() { - if (bd) return bd; - var a, - b = Ee, - c = b.length, - d, - e = "value" in Za ? Za.value : Za.textContent, - f = e.length; - for (a = 0; a < c && b[a] === e[a]; a++); - var g = c - a; - for (d = 1; d <= g && b[c - d] === e[f - d]; d++); - return (bd = e.slice(a, 1 < d ? 1 - d : void 0)); - } - function cd(a) { - var b = a.keyCode; - "charCode" in a - ? ((a = a.charCode), 0 === a && 13 === b && (a = 13)) - : (a = b); - 10 === a && (a = 13); - return 32 <= a || 13 === a ? a : 0; - } - function dd() { - return !0; - } - function Pg() { - return !1; - } - function ka(a) { - function b(b, d, e, f, g) { - this._reactName = b; - this._targetInst = e; - this.type = d; - this.nativeEvent = f; - this.target = g; - this.currentTarget = null; - for (var c in a) - a.hasOwnProperty(c) && ((b = a[c]), (this[c] = b ? b(f) : f[c])); - this.isDefaultPrevented = ( - null != f.defaultPrevented ? f.defaultPrevented : !1 === f.returnValue - ) - ? dd - : Pg; - this.isPropagationStopped = Pg; - return this; - } - E(b.prototype, { - preventDefault: function () { - this.defaultPrevented = !0; - var a = this.nativeEvent; - a && - (a.preventDefault - ? a.preventDefault() - : "unknown" !== typeof a.returnValue && (a.returnValue = !1), - (this.isDefaultPrevented = dd)); - }, - stopPropagation: function () { - var a = this.nativeEvent; - a && - (a.stopPropagation - ? a.stopPropagation() - : "unknown" !== typeof a.cancelBubble && (a.cancelBubble = !0), - (this.isPropagationStopped = dd)); - }, - persist: function () {}, - isPersistent: dd, - }); - return b; - } - function Gj(a) { - var b = this.nativeEvent; - return b.getModifierState - ? b.getModifierState(a) - : (a = Hj[a]) - ? !!b[a] - : !1; - } - function Fe(a) { - return Gj; - } - function Qg(a, b) { - switch (a) { - case "keyup": - return -1 !== Ij.indexOf(b.keyCode); - case "keydown": - return 229 !== b.keyCode; - case "keypress": - case "mousedown": - case "focusout": - return !0; - default: - return !1; - } - } - function Rg(a) { - a = a.detail; - return "object" === typeof a && "data" in a ? a.data : null; - } - function Jj(a, b) { - switch (a) { - case "compositionend": - return Rg(b); - case "keypress": - if (32 !== b.which) return null; - Sg = !0; - return Tg; - case "textInput": - return (a = b.data), a === Tg && Sg ? null : a; - default: - return null; - } - } - function Kj(a, b) { - if (Hb) - return "compositionend" === a || (!Ge && Qg(a, b)) - ? ((a = Og()), (bd = Ee = Za = null), (Hb = !1), a) - : null; - switch (a) { - case "paste": - return null; - case "keypress": - if ( - !(b.ctrlKey || b.altKey || b.metaKey) || - (b.ctrlKey && b.altKey) - ) { - if (b.char && 1 < b.char.length) return b.char; - if (b.which) return String.fromCharCode(b.which); - } - return null; - case "compositionend": - return Ug && "ko" !== b.locale ? null : b.data; - default: - return null; - } - } - function Vg(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return "input" === b ? !!Lj[a.type] : "textarea" === b ? !0 : !1; - } - function Mj(a) { - if (!Ia) return !1; - a = "on" + a; - var b = a in document; - b || - ((b = document.createElement("div")), - b.setAttribute(a, "return;"), - (b = "function" === typeof b[a])); - return b; - } - function Wg(a, b, c, d) { - ug(d); - b = ed(b, "onChange"); - 0 < b.length && - ((c = new He("onChange", "change", null, c, d)), - a.push({ event: c, listeners: b })); - } - function Nj(a) { - Xg(a, 0); - } - function fd(a) { - var b = Ib(a); - if (jg(b)) return a; - } - function Oj(a, b) { - if ("change" === a) return b; - } - function Yg() { - oc && (oc.detachEvent("onpropertychange", Zg), (pc = oc = null)); - } - function Zg(a) { - if ("value" === a.propertyName && fd(pc)) { - var b = []; - Wg(b, pc, a, re(a)); - wg(Nj, b); - } - } - function Pj(a, b, c) { - "focusin" === a - ? (Yg(), (oc = b), (pc = c), oc.attachEvent("onpropertychange", Zg)) - : "focusout" === a && Yg(); - } - function Qj(a, b) { - if ("selectionchange" === a || "keyup" === a || "keydown" === a) - return fd(pc); - } - function Rj(a, b) { - if ("click" === a) return fd(b); - } - function Sj(a, b) { - if ("input" === a || "change" === a) return fd(b); - } - function Tj(a, b) { - return (a === b && (0 !== a || 1 / a === 1 / b)) || (a !== a && b !== b); - } - function qc(a, b) { - if (ua(a, b)) return !0; - if ( - "object" !== typeof a || - null === a || - "object" !== typeof b || - null === b - ) - return !1; - var c = Object.keys(a), - d = Object.keys(b); - if (c.length !== d.length) return !1; - for (d = 0; d < c.length; d++) { - var e = c[d]; - if (!Zd.call(b, e) || !ua(a[e], b[e])) return !1; - } - return !0; - } - function $g(a) { - for (; a && a.firstChild; ) a = a.firstChild; - return a; - } - function ah(a, b) { - var c = $g(a); - a = 0; - for (var d; c; ) { - if (3 === c.nodeType) { - d = a + c.textContent.length; - if (a <= b && d >= b) return { node: c, offset: b - a }; - a = d; - } - a: { - for (; c; ) { - if (c.nextSibling) { - c = c.nextSibling; - break a; - } - c = c.parentNode; - } - c = void 0; - } - c = $g(c); - } - } - function bh(a, b) { - return a && b - ? a === b - ? !0 - : a && 3 === a.nodeType - ? !1 - : b && 3 === b.nodeType - ? bh(a, b.parentNode) - : "contains" in a - ? a.contains(b) - : a.compareDocumentPosition - ? !!(a.compareDocumentPosition(b) & 16) - : !1 - : !1; - } - function ch() { - for (var a = window, b = Qc(); b instanceof a.HTMLIFrameElement; ) { - try { - var c = "string" === typeof b.contentWindow.location.href; - } catch (d) { - c = !1; - } - if (c) a = b.contentWindow; - else break; - b = Qc(a.document); - } - return b; - } - function Ie(a) { - var b = a && a.nodeName && a.nodeName.toLowerCase(); - return ( - b && - (("input" === b && - ("text" === a.type || - "search" === a.type || - "tel" === a.type || - "url" === a.type || - "password" === a.type)) || - "textarea" === b || - "true" === a.contentEditable) - ); - } - function Uj(a) { - var b = ch(), - c = a.focusedElem, - d = a.selectionRange; - if ( - b !== c && - c && - c.ownerDocument && - bh(c.ownerDocument.documentElement, c) - ) { - if (null !== d && Ie(c)) - if ( - ((b = d.start), - (a = d.end), - void 0 === a && (a = b), - "selectionStart" in c) - ) - (c.selectionStart = b), - (c.selectionEnd = Math.min(a, c.value.length)); - else if ( - ((a = - ((b = c.ownerDocument || document) && b.defaultView) || window), - a.getSelection) - ) { - a = a.getSelection(); - var e = c.textContent.length, - f = Math.min(d.start, e); - d = void 0 === d.end ? f : Math.min(d.end, e); - !a.extend && f > d && ((e = d), (d = f), (f = e)); - e = ah(c, f); - var g = ah(c, d); - e && - g && - (1 !== a.rangeCount || - a.anchorNode !== e.node || - a.anchorOffset !== e.offset || - a.focusNode !== g.node || - a.focusOffset !== g.offset) && - ((b = b.createRange()), - b.setStart(e.node, e.offset), - a.removeAllRanges(), - f > d - ? (a.addRange(b), a.extend(g.node, g.offset)) - : (b.setEnd(g.node, g.offset), a.addRange(b))); - } - b = []; - for (a = c; (a = a.parentNode); ) - 1 === a.nodeType && - b.push({ element: a, left: a.scrollLeft, top: a.scrollTop }); - "function" === typeof c.focus && c.focus(); - for (c = 0; c < b.length; c++) - (a = b[c]), - (a.element.scrollLeft = a.left), - (a.element.scrollTop = a.top); - } - } - function dh(a, b, c) { - var d = - c.window === c ? c.document : 9 === c.nodeType ? c : c.ownerDocument; - Je || - null == Jb || - Jb !== Qc(d) || - ((d = Jb), - "selectionStart" in d && Ie(d) - ? (d = { start: d.selectionStart, end: d.selectionEnd }) - : ((d = ( - (d.ownerDocument && d.ownerDocument.defaultView) || - window - ).getSelection()), - (d = { - anchorNode: d.anchorNode, - anchorOffset: d.anchorOffset, - focusNode: d.focusNode, - focusOffset: d.focusOffset, - })), - (rc && qc(rc, d)) || - ((rc = d), - (d = ed(Ke, "onSelect")), - 0 < d.length && - ((b = new He("onSelect", "select", null, b, c)), - a.push({ event: b, listeners: d }), - (b.target = Jb)))); - } - function gd(a, b) { - var c = {}; - c[a.toLowerCase()] = b.toLowerCase(); - c["Webkit" + a] = "webkit" + b; - c["Moz" + a] = "moz" + b; - return c; - } - function hd(a) { - if (Le[a]) return Le[a]; - if (!Kb[a]) return a; - var b = Kb[a], - c; - for (c in b) if (b.hasOwnProperty(c) && c in eh) return (Le[a] = b[c]); - return a; - } - function $a(a, b) { - fh.set(a, b); - nb(b, [a]); - } - function gh(a, b, c) { - var d = a.type || "unknown-event"; - a.currentTarget = c; - nj(d, b, void 0, a); - a.currentTarget = null; - } - function Xg(a, b) { - b = 0 !== (b & 4); - for (var c = 0; c < a.length; c++) { - var d = a[c], - e = d.event; - d = d.listeners; - a: { - var f = void 0; - if (b) - for (var g = d.length - 1; 0 <= g; g--) { - var h = d[g], - k = h.instance, - m = h.currentTarget; - h = h.listener; - if (k !== f && e.isPropagationStopped()) break a; - gh(e, h, m); - f = k; - } - else - for (g = 0; g < d.length; g++) { - h = d[g]; - k = h.instance; - m = h.currentTarget; - h = h.listener; - if (k !== f && e.isPropagationStopped()) break a; - gh(e, h, m); - f = k; - } - } - } - if (Tc) throw ((a = ue), (Tc = !1), (ue = null), a); - } - function B(a, b) { - var c = b[Me]; - void 0 === c && (c = b[Me] = new Set()); - var d = a + "__bubble"; - c.has(d) || (hh(b, a, 2, !1), c.add(d)); - } - function Ne(a, b, c) { - var d = 0; - b && (d |= 4); - hh(c, a, d, b); - } - function sc(a) { - if (!a[id]) { - a[id] = !0; - cg.forEach(function (b) { - "selectionchange" !== b && (Vj.has(b) || Ne(b, !1, a), Ne(b, !0, a)); - }); - var b = 9 === a.nodeType ? a : a.ownerDocument; - null === b || b[id] || ((b[id] = !0), Ne("selectionchange", !1, b)); - } - } - function hh(a, b, c, d, e) { - switch (Lg(b)) { - case 1: - e = Aj; - break; - case 4: - e = Bj; - break; - default: - e = Be; - } - c = e.bind(null, b, c, a); - e = void 0; - !Oe || - ("touchstart" !== b && "touchmove" !== b && "wheel" !== b) || - (e = !0); - d - ? void 0 !== e - ? a.addEventListener(b, c, { capture: !0, passive: e }) - : a.addEventListener(b, c, !0) - : void 0 !== e - ? a.addEventListener(b, c, { passive: e }) - : a.addEventListener(b, c, !1); - } - function Ce(a, b, c, d, e) { - var f = d; - if (0 === (b & 1) && 0 === (b & 2) && null !== d) - a: for (;;) { - if (null === d) return; - var g = d.tag; - if (3 === g || 4 === g) { - var h = d.stateNode.containerInfo; - if (h === e || (8 === h.nodeType && h.parentNode === e)) break; - if (4 === g) - for (g = d.return; null !== g; ) { - var k = g.tag; - if (3 === k || 4 === k) - if ( - ((k = g.stateNode.containerInfo), - k === e || (8 === k.nodeType && k.parentNode === e)) - ) - return; - g = g.return; - } - for (; null !== h; ) { - g = pb(h); - if (null === g) return; - k = g.tag; - if (5 === k || 6 === k) { - d = f = g; - continue a; - } - h = h.parentNode; - } - } - d = d.return; - } - wg(function () { - var d = f, - e = re(c), - g = []; - a: { - var h = fh.get(a); - if (void 0 !== h) { - var k = He, - n = a; - switch (a) { - case "keypress": - if (0 === cd(c)) break a; - case "keydown": - case "keyup": - k = Wj; - break; - case "focusin": - n = "focus"; - k = Pe; - break; - case "focusout": - n = "blur"; - k = Pe; - break; - case "beforeblur": - case "afterblur": - k = Pe; - break; - case "click": - if (2 === c.button) break a; - case "auxclick": - case "dblclick": - case "mousedown": - case "mousemove": - case "mouseup": - case "mouseout": - case "mouseover": - case "contextmenu": - k = ih; - break; - case "drag": - case "dragend": - case "dragenter": - case "dragexit": - case "dragleave": - case "dragover": - case "dragstart": - case "drop": - k = Xj; - break; - case "touchcancel": - case "touchend": - case "touchmove": - case "touchstart": - k = Yj; - break; - case jh: - case kh: - case lh: - k = Zj; - break; - case mh: - k = ak; - break; - case "scroll": - k = bk; - break; - case "wheel": - k = ck; - break; - case "copy": - case "cut": - case "paste": - k = dk; - break; - case "gotpointercapture": - case "lostpointercapture": - case "pointercancel": - case "pointerdown": - case "pointermove": - case "pointerout": - case "pointerover": - case "pointerup": - k = nh; - } - var l = 0 !== (b & 4), - p = !l && "scroll" === a, - A = l ? (null !== h ? h + "Capture" : null) : h; - l = []; - for (var v = d, q; null !== v; ) { - q = v; - var M = q.stateNode; - 5 === q.tag && - null !== M && - ((q = M), - null !== A && - ((M = fc(v, A)), null != M && l.push(tc(v, M, q)))); - if (p) break; - v = v.return; - } - 0 < l.length && - ((h = new k(h, n, null, c, e)), - g.push({ event: h, listeners: l })); - } - } - if (0 === (b & 7)) { - a: { - h = "mouseover" === a || "pointerover" === a; - k = "mouseout" === a || "pointerout" === a; - if ( - h && - c !== ze && - (n = c.relatedTarget || c.fromElement) && - (pb(n) || n[Ja]) - ) - break a; - if (k || h) { - h = - e.window === e - ? e - : (h = e.ownerDocument) - ? h.defaultView || h.parentWindow - : window; - if (k) { - if ( - ((n = c.relatedTarget || c.toElement), - (k = d), - (n = n ? pb(n) : null), - null !== n && - ((p = ob(n)), n !== p || (5 !== n.tag && 6 !== n.tag))) - ) - n = null; - } else (k = null), (n = d); - if (k !== n) { - l = ih; - M = "onMouseLeave"; - A = "onMouseEnter"; - v = "mouse"; - if ("pointerout" === a || "pointerover" === a) - (l = nh), - (M = "onPointerLeave"), - (A = "onPointerEnter"), - (v = "pointer"); - p = null == k ? h : Ib(k); - q = null == n ? h : Ib(n); - h = new l(M, v + "leave", k, c, e); - h.target = p; - h.relatedTarget = q; - M = null; - pb(e) === d && - ((l = new l(A, v + "enter", n, c, e)), - (l.target = q), - (l.relatedTarget = p), - (M = l)); - p = M; - if (k && n) - b: { - l = k; - A = n; - v = 0; - for (q = l; q; q = Lb(q)) v++; - q = 0; - for (M = A; M; M = Lb(M)) q++; - for (; 0 < v - q; ) (l = Lb(l)), v--; - for (; 0 < q - v; ) (A = Lb(A)), q--; - for (; v--; ) { - if (l === A || (null !== A && l === A.alternate)) break b; - l = Lb(l); - A = Lb(A); - } - l = null; - } - else l = null; - null !== k && oh(g, h, k, l, !1); - null !== n && null !== p && oh(g, p, n, l, !0); - } - } - } - a: { - h = d ? Ib(d) : window; - k = h.nodeName && h.nodeName.toLowerCase(); - if ("select" === k || ("input" === k && "file" === h.type)) - var ma = Oj; - else if (Vg(h)) - if (ph) ma = Sj; - else { - ma = Qj; - var va = Pj; - } - else - (k = h.nodeName) && - "input" === k.toLowerCase() && - ("checkbox" === h.type || "radio" === h.type) && - (ma = Rj); - if (ma && (ma = ma(a, d))) { - Wg(g, ma, c, e); - break a; - } - va && va(a, h, d); - "focusout" === a && - (va = h._wrapperState) && - va.controlled && - "number" === h.type && - me(h, "number", h.value); - } - va = d ? Ib(d) : window; - switch (a) { - case "focusin": - if (Vg(va) || "true" === va.contentEditable) - (Jb = va), (Ke = d), (rc = null); - break; - case "focusout": - rc = Ke = Jb = null; - break; - case "mousedown": - Je = !0; - break; - case "contextmenu": - case "mouseup": - case "dragend": - Je = !1; - dh(g, c, e); - break; - case "selectionchange": - if (ek) break; - case "keydown": - case "keyup": - dh(g, c, e); - } - var ab; - if (Ge) - b: { - switch (a) { - case "compositionstart": - var da = "onCompositionStart"; - break b; - case "compositionend": - da = "onCompositionEnd"; - break b; - case "compositionupdate": - da = "onCompositionUpdate"; - break b; - } - da = void 0; - } - else - Hb - ? Qg(a, c) && (da = "onCompositionEnd") - : "keydown" === a && - 229 === c.keyCode && - (da = "onCompositionStart"); - da && - (Ug && - "ko" !== c.locale && - (Hb || "onCompositionStart" !== da - ? "onCompositionEnd" === da && Hb && (ab = Og()) - : ((Za = e), - (Ee = "value" in Za ? Za.value : Za.textContent), - (Hb = !0))), - (va = ed(d, da)), - 0 < va.length && - ((da = new qh(da, a, null, c, e)), - g.push({ event: da, listeners: va }), - ab - ? (da.data = ab) - : ((ab = Rg(c)), null !== ab && (da.data = ab)))); - if ((ab = fk ? Jj(a, c) : Kj(a, c))) - (d = ed(d, "onBeforeInput")), - 0 < d.length && - ((e = new gk("onBeforeInput", "beforeinput", null, c, e)), - g.push({ event: e, listeners: d }), - (e.data = ab)); - } - Xg(g, b); - }); - } - function tc(a, b, c) { - return { instance: a, listener: b, currentTarget: c }; - } - function ed(a, b) { - for (var c = b + "Capture", d = []; null !== a; ) { - var e = a, - f = e.stateNode; - 5 === e.tag && - null !== f && - ((e = f), - (f = fc(a, c)), - null != f && d.unshift(tc(a, f, e)), - (f = fc(a, b)), - null != f && d.push(tc(a, f, e))); - a = a.return; - } - return d; - } - function Lb(a) { - if (null === a) return null; - do a = a.return; - while (a && 5 !== a.tag); - return a ? a : null; - } - function oh(a, b, c, d, e) { - for (var f = b._reactName, g = []; null !== c && c !== d; ) { - var h = c, - k = h.alternate, - m = h.stateNode; - if (null !== k && k === d) break; - 5 === h.tag && - null !== m && - ((h = m), - e - ? ((k = fc(c, f)), null != k && g.unshift(tc(c, k, h))) - : e || ((k = fc(c, f)), null != k && g.push(tc(c, k, h)))); - c = c.return; - } - 0 !== g.length && a.push({ event: b, listeners: g }); - } - function rh(a) { - return ("string" === typeof a ? a : "" + a) - .replace(hk, "\n") - .replace(ik, ""); - } - function jd(a, b, c, d) { - b = rh(b); - if (rh(a) !== b && c) throw Error(n(425)); - } - function kd() {} - function Qe(a, b) { - return ( - "textarea" === a || - "noscript" === a || - "string" === typeof b.children || - "number" === typeof b.children || - ("object" === typeof b.dangerouslySetInnerHTML && - null !== b.dangerouslySetInnerHTML && - null != b.dangerouslySetInnerHTML.__html) - ); - } - function jk(a) { - setTimeout(function () { - throw a; - }); - } - function Re(a, b) { - var c = b, - d = 0; - do { - var e = c.nextSibling; - a.removeChild(c); - if (e && 8 === e.nodeType) - if (((c = e.data), "/$" === c)) { - if (0 === d) { - a.removeChild(e); - nc(b); - return; - } - d--; - } else ("$" !== c && "$?" !== c && "$!" !== c) || d++; - c = e; - } while (c); - nc(b); - } - function Ka(a) { - for (; null != a; a = a.nextSibling) { - var b = a.nodeType; - if (1 === b || 3 === b) break; - if (8 === b) { - b = a.data; - if ("$" === b || "$!" === b || "$?" === b) break; - if ("/$" === b) return null; - } - } - return a; - } - function sh(a) { - a = a.previousSibling; - for (var b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("$" === c || "$!" === c || "$?" === c) { - if (0 === b) return a; - b--; - } else "/$" === c && b++; - } - a = a.previousSibling; - } - return null; - } - function pb(a) { - var b = a[Da]; - if (b) return b; - for (var c = a.parentNode; c; ) { - if ((b = c[Ja] || c[Da])) { - c = b.alternate; - if (null !== b.child || (null !== c && null !== c.child)) - for (a = sh(a); null !== a; ) { - if ((c = a[Da])) return c; - a = sh(a); - } - return b; - } - a = c; - c = a.parentNode; - } - return null; - } - function ec(a) { - a = a[Da] || a[Ja]; - return !a || (5 !== a.tag && 6 !== a.tag && 13 !== a.tag && 3 !== a.tag) - ? null - : a; - } - function Ib(a) { - if (5 === a.tag || 6 === a.tag) return a.stateNode; - throw Error(n(33)); - } - function Rc(a) { - return a[uc] || null; - } - function bb(a) { - return { current: a }; - } - function w(a, b) { - 0 > Mb || ((a.current = Se[Mb]), (Se[Mb] = null), Mb--); - } - function y(a, b, c) { - Mb++; - Se[Mb] = a.current; - a.current = b; - } - function Nb(a, b) { - var c = a.type.contextTypes; - if (!c) return cb; - var d = a.stateNode; - if (d && d.__reactInternalMemoizedUnmaskedChildContext === b) - return d.__reactInternalMemoizedMaskedChildContext; - var e = {}, - f; - for (f in c) e[f] = b[f]; - d && - ((a = a.stateNode), - (a.__reactInternalMemoizedUnmaskedChildContext = b), - (a.__reactInternalMemoizedMaskedChildContext = e)); - return e; - } - function ea(a) { - a = a.childContextTypes; - return null !== a && void 0 !== a; - } - function th(a, b, c) { - if (J.current !== cb) throw Error(n(168)); - y(J, b); - y(S, c); - } - function uh(a, b, c) { - var d = a.stateNode; - b = b.childContextTypes; - if ("function" !== typeof d.getChildContext) return c; - d = d.getChildContext(); - for (var e in d) - if (!(e in b)) throw Error(n(108, hj(a) || "Unknown", e)); - return E({}, c, d); - } - function ld(a) { - a = - ((a = a.stateNode) && a.__reactInternalMemoizedMergedChildContext) || - cb; - qb = J.current; - y(J, a); - y(S, S.current); - return !0; - } - function vh(a, b, c) { - var d = a.stateNode; - if (!d) throw Error(n(169)); - c - ? ((a = uh(a, b, qb)), - (d.__reactInternalMemoizedMergedChildContext = a), - w(S), - w(J), - y(J, a)) - : w(S); - y(S, c); - } - function wh(a) { - null === La ? (La = [a]) : La.push(a); - } - function kk(a) { - md = !0; - wh(a); - } - function db() { - if (!Te && null !== La) { - Te = !0; - var a = 0, - b = z; - try { - var c = La; - for (z = 1; a < c.length; a++) { - var d = c[a]; - do d = d(!0); - while (null !== d); - } - La = null; - md = !1; - } catch (e) { - throw (null !== La && (La = La.slice(a + 1)), xh(De, db), e); - } finally { - (z = b), (Te = !1); - } - } - return null; - } - function rb(a, b) { - Ob[Pb++] = nd; - Ob[Pb++] = od; - od = a; - nd = b; - } - function yh(a, b, c) { - na[oa++] = Ma; - na[oa++] = Na; - na[oa++] = sb; - sb = a; - var d = Ma; - a = Na; - var e = 32 - ta(d) - 1; - d &= ~(1 << e); - c += 1; - var f = 32 - ta(b) + e; - if (30 < f) { - var g = e - (e % 5); - f = (d & ((1 << g) - 1)).toString(32); - d >>= g; - e -= g; - Ma = (1 << (32 - ta(b) + e)) | (c << e) | d; - Na = f + a; - } else (Ma = (1 << f) | (c << e) | d), (Na = a); - } - function Ue(a) { - null !== a.return && (rb(a, 1), yh(a, 1, 0)); - } - function Ve(a) { - for (; a === od; ) - (od = Ob[--Pb]), (Ob[Pb] = null), (nd = Ob[--Pb]), (Ob[Pb] = null); - for (; a === sb; ) - (sb = na[--oa]), - (na[oa] = null), - (Na = na[--oa]), - (na[oa] = null), - (Ma = na[--oa]), - (na[oa] = null); - } - function zh(a, b) { - var c = pa(5, null, null, 0); - c.elementType = "DELETED"; - c.stateNode = b; - c.return = a; - b = a.deletions; - null === b ? ((a.deletions = [c]), (a.flags |= 16)) : b.push(c); - } - function Ah(a, b) { - switch (a.tag) { - case 5: - var c = a.type; - b = - 1 !== b.nodeType || c.toLowerCase() !== b.nodeName.toLowerCase() - ? null - : b; - return null !== b - ? ((a.stateNode = b), (la = a), (fa = Ka(b.firstChild)), !0) - : !1; - case 6: - return ( - (b = "" === a.pendingProps || 3 !== b.nodeType ? null : b), - null !== b ? ((a.stateNode = b), (la = a), (fa = null), !0) : !1 - ); - case 13: - return ( - (b = 8 !== b.nodeType ? null : b), - null !== b - ? ((c = null !== sb ? { id: Ma, overflow: Na } : null), - (a.memoizedState = { - dehydrated: b, - treeContext: c, - retryLane: 1073741824, - }), - (c = pa(18, null, null, 0)), - (c.stateNode = b), - (c.return = a), - (a.child = c), - (la = a), - (fa = null), - !0) - : !1 - ); - default: - return !1; - } - } - function We(a) { - return 0 !== (a.mode & 1) && 0 === (a.flags & 128); - } - function Xe(a) { - if (D) { - var b = fa; - if (b) { - var c = b; - if (!Ah(a, b)) { - if (We(a)) throw Error(n(418)); - b = Ka(c.nextSibling); - var d = la; - b && Ah(a, b) - ? zh(d, c) - : ((a.flags = (a.flags & -4097) | 2), (D = !1), (la = a)); - } - } else { - if (We(a)) throw Error(n(418)); - a.flags = (a.flags & -4097) | 2; - D = !1; - la = a; - } - } - } - function Bh(a) { - for ( - a = a.return; - null !== a && 5 !== a.tag && 3 !== a.tag && 13 !== a.tag; - - ) - a = a.return; - la = a; - } - function pd(a) { - if (a !== la) return !1; - if (!D) return Bh(a), (D = !0), !1; - var b; - (b = 3 !== a.tag) && - !(b = 5 !== a.tag) && - ((b = a.type), - (b = "head" !== b && "body" !== b && !Qe(a.type, a.memoizedProps))); - if (b && (b = fa)) { - if (We(a)) { - for (a = fa; a; ) a = Ka(a.nextSibling); - throw Error(n(418)); - } - for (; b; ) zh(a, b), (b = Ka(b.nextSibling)); - } - Bh(a); - if (13 === a.tag) { - a = a.memoizedState; - a = null !== a ? a.dehydrated : null; - if (!a) throw Error(n(317)); - a: { - a = a.nextSibling; - for (b = 0; a; ) { - if (8 === a.nodeType) { - var c = a.data; - if ("/$" === c) { - if (0 === b) { - fa = Ka(a.nextSibling); - break a; - } - b--; - } else ("$" !== c && "$!" !== c && "$?" !== c) || b++; - } - a = a.nextSibling; - } - fa = null; - } - } else fa = la ? Ka(a.stateNode.nextSibling) : null; - return !0; - } - function Qb() { - fa = la = null; - D = !1; - } - function Ye(a) { - null === wa ? (wa = [a]) : wa.push(a); - } - function xa(a, b) { - if (a && a.defaultProps) { - b = E({}, b); - a = a.defaultProps; - for (var c in a) void 0 === b[c] && (b[c] = a[c]); - return b; - } - return b; - } - function Ze() { - $e = Rb = qd = null; - } - function af(a, b) { - b = rd.current; - w(rd); - a._currentValue = b; - } - function bf(a, b, c) { - for (; null !== a; ) { - var d = a.alternate; - (a.childLanes & b) !== b - ? ((a.childLanes |= b), null !== d && (d.childLanes |= b)) - : null !== d && (d.childLanes & b) !== b && (d.childLanes |= b); - if (a === c) break; - a = a.return; - } - } - function Sb(a, b) { - qd = a; - $e = Rb = null; - a = a.dependencies; - null !== a && - null !== a.firstContext && - (0 !== (a.lanes & b) && (ha = !0), (a.firstContext = null)); - } - function qa(a) { - var b = a._currentValue; - if ($e !== a) - if (((a = { context: a, memoizedValue: b, next: null }), null === Rb)) { - if (null === qd) throw Error(n(308)); - Rb = a; - qd.dependencies = { lanes: 0, firstContext: a }; - } else Rb = Rb.next = a; - return b; - } - function cf(a) { - null === tb ? (tb = [a]) : tb.push(a); - } - function Ch(a, b, c, d) { - var e = b.interleaved; - null === e ? ((c.next = c), cf(b)) : ((c.next = e.next), (e.next = c)); - b.interleaved = c; - return Oa(a, d); - } - function Oa(a, b) { - a.lanes |= b; - var c = a.alternate; - null !== c && (c.lanes |= b); - c = a; - for (a = a.return; null !== a; ) - (a.childLanes |= b), - (c = a.alternate), - null !== c && (c.childLanes |= b), - (c = a), - (a = a.return); - return 3 === c.tag ? c.stateNode : null; - } - function df(a) { - a.updateQueue = { - baseState: a.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, interleaved: null, lanes: 0 }, - effects: null, - }; - } - function Dh(a, b) { - a = a.updateQueue; - b.updateQueue === a && - (b.updateQueue = { - baseState: a.baseState, - firstBaseUpdate: a.firstBaseUpdate, - lastBaseUpdate: a.lastBaseUpdate, - shared: a.shared, - effects: a.effects, - }); - } - function Pa(a, b) { - return { - eventTime: a, - lane: b, - tag: 0, - payload: null, - callback: null, - next: null, - }; - } - function eb(a, b, c) { - var d = a.updateQueue; - if (null === d) return null; - d = d.shared; - if (0 !== (p & 2)) { - var e = d.pending; - null === e ? (b.next = b) : ((b.next = e.next), (e.next = b)); - d.pending = b; - return lk(a, c); - } - e = d.interleaved; - null === e ? ((b.next = b), cf(d)) : ((b.next = e.next), (e.next = b)); - d.interleaved = b; - return Oa(a, c); - } - function sd(a, b, c) { - b = b.updateQueue; - if (null !== b && ((b = b.shared), 0 !== (c & 4194240))) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - xe(a, c); - } - } - function Eh(a, b) { - var c = a.updateQueue, - d = a.alternate; - if (null !== d && ((d = d.updateQueue), c === d)) { - var e = null, - f = null; - c = c.firstBaseUpdate; - if (null !== c) { - do { - var g = { - eventTime: c.eventTime, - lane: c.lane, - tag: c.tag, - payload: c.payload, - callback: c.callback, - next: null, - }; - null === f ? (e = f = g) : (f = f.next = g); - c = c.next; - } while (null !== c); - null === f ? (e = f = b) : (f = f.next = b); - } else e = f = b; - c = { - baseState: d.baseState, - firstBaseUpdate: e, - lastBaseUpdate: f, - shared: d.shared, - effects: d.effects, - }; - a.updateQueue = c; - return; - } - a = c.lastBaseUpdate; - null === a ? (c.firstBaseUpdate = b) : (a.next = b); - c.lastBaseUpdate = b; - } - function td(a, b, c, d) { - var e = a.updateQueue; - fb = !1; - var f = e.firstBaseUpdate, - g = e.lastBaseUpdate, - h = e.shared.pending; - if (null !== h) { - e.shared.pending = null; - var k = h, - m = k.next; - k.next = null; - null === g ? (f = m) : (g.next = m); - g = k; - var n = a.alternate; - null !== n && - ((n = n.updateQueue), - (h = n.lastBaseUpdate), - h !== g && - (null === h ? (n.firstBaseUpdate = m) : (h.next = m), - (n.lastBaseUpdate = k))); - } - if (null !== f) { - var l = e.baseState; - g = 0; - n = m = k = null; - h = f; - do { - var r = h.lane, - p = h.eventTime; - if ((d & r) === r) { - null !== n && - (n = n.next = - { - eventTime: p, - lane: 0, - tag: h.tag, - payload: h.payload, - callback: h.callback, - next: null, - }); - a: { - var x = a, - F = h; - r = b; - p = c; - switch (F.tag) { - case 1: - x = F.payload; - if ("function" === typeof x) { - l = x.call(p, l, r); - break a; - } - l = x; - break a; - case 3: - x.flags = (x.flags & -65537) | 128; - case 0: - x = F.payload; - r = "function" === typeof x ? x.call(p, l, r) : x; - if (null === r || void 0 === r) break a; - l = E({}, l, r); - break a; - case 2: - fb = !0; - } - } - null !== h.callback && - 0 !== h.lane && - ((a.flags |= 64), - (r = e.effects), - null === r ? (e.effects = [h]) : r.push(h)); - } else - (p = { - eventTime: p, - lane: r, - tag: h.tag, - payload: h.payload, - callback: h.callback, - next: null, - }), - null === n ? ((m = n = p), (k = l)) : (n = n.next = p), - (g |= r); - h = h.next; - if (null === h) - if (((h = e.shared.pending), null === h)) break; - else - (r = h), - (h = r.next), - (r.next = null), - (e.lastBaseUpdate = r), - (e.shared.pending = null); - } while (1); - null === n && (k = l); - e.baseState = k; - e.firstBaseUpdate = m; - e.lastBaseUpdate = n; - b = e.shared.interleaved; - if (null !== b) { - e = b; - do (g |= e.lane), (e = e.next); - while (e !== b); - } else null === f && (e.shared.lanes = 0); - ra |= g; - a.lanes = g; - a.memoizedState = l; - } - } - function Fh(a, b, c) { - a = b.effects; - b.effects = null; - if (null !== a) - for (b = 0; b < a.length; b++) { - var d = a[b], - e = d.callback; - if (null !== e) { - d.callback = null; - d = c; - if ("function" !== typeof e) throw Error(n(191, e)); - e.call(d); - } - } - } - function ef(a, b, c, d) { - b = a.memoizedState; - c = c(d, b); - c = null === c || void 0 === c ? b : E({}, b, c); - a.memoizedState = c; - 0 === a.lanes && (a.updateQueue.baseState = c); - } - function Gh(a, b, c, d, e, f, g) { - a = a.stateNode; - return "function" === typeof a.shouldComponentUpdate - ? a.shouldComponentUpdate(d, f, g) - : b.prototype && b.prototype.isPureReactComponent - ? !qc(c, d) || !qc(e, f) - : !0; - } - function Hh(a, b, c) { - var d = !1, - e = cb; - var f = b.contextType; - "object" === typeof f && null !== f - ? (f = qa(f)) - : ((e = ea(b) ? qb : J.current), - (d = b.contextTypes), - (f = (d = null !== d && void 0 !== d) ? Nb(a, e) : cb)); - b = new b(c, f); - a.memoizedState = null !== b.state && void 0 !== b.state ? b.state : null; - b.updater = ud; - a.stateNode = b; - b._reactInternals = a; - d && - ((a = a.stateNode), - (a.__reactInternalMemoizedUnmaskedChildContext = e), - (a.__reactInternalMemoizedMaskedChildContext = f)); - return b; - } - function Ih(a, b, c, d) { - a = b.state; - "function" === typeof b.componentWillReceiveProps && - b.componentWillReceiveProps(c, d); - "function" === typeof b.UNSAFE_componentWillReceiveProps && - b.UNSAFE_componentWillReceiveProps(c, d); - b.state !== a && ud.enqueueReplaceState(b, b.state, null); - } - function ff(a, b, c, d) { - var e = a.stateNode; - e.props = c; - e.state = a.memoizedState; - e.refs = Jh; - df(a); - var f = b.contextType; - "object" === typeof f && null !== f - ? (e.context = qa(f)) - : ((f = ea(b) ? qb : J.current), (e.context = Nb(a, f))); - e.state = a.memoizedState; - f = b.getDerivedStateFromProps; - "function" === typeof f && (ef(a, b, f, c), (e.state = a.memoizedState)); - "function" === typeof b.getDerivedStateFromProps || - "function" === typeof e.getSnapshotBeforeUpdate || - ("function" !== typeof e.UNSAFE_componentWillMount && - "function" !== typeof e.componentWillMount) || - ((b = e.state), - "function" === typeof e.componentWillMount && e.componentWillMount(), - "function" === typeof e.UNSAFE_componentWillMount && - e.UNSAFE_componentWillMount(), - b !== e.state && ud.enqueueReplaceState(e, e.state, null), - td(a, c, e, d), - (e.state = a.memoizedState)); - "function" === typeof e.componentDidMount && (a.flags |= 4194308); - } - function vc(a, b, c) { - a = c.ref; - if (null !== a && "function" !== typeof a && "object" !== typeof a) { - if (c._owner) { - c = c._owner; - if (c) { - if (1 !== c.tag) throw Error(n(309)); - var d = c.stateNode; - } - if (!d) throw Error(n(147, a)); - var e = d, - f = "" + a; - if ( - null !== b && - null !== b.ref && - "function" === typeof b.ref && - b.ref._stringRef === f - ) - return b.ref; - b = function (a) { - var b = e.refs; - b === Jh && (b = e.refs = {}); - null === a ? delete b[f] : (b[f] = a); - }; - b._stringRef = f; - return b; - } - if ("string" !== typeof a) throw Error(n(284)); - if (!c._owner) throw Error(n(290, a)); - } - return a; - } - function vd(a, b) { - a = Object.prototype.toString.call(b); - throw Error( - n( - 31, - "[object Object]" === a - ? "object with keys {" + Object.keys(b).join(", ") + "}" - : a, - ), - ); - } - function Kh(a) { - var b = a._init; - return b(a._payload); - } - function Lh(a) { - function b(b, c) { - if (a) { - var d = b.deletions; - null === d ? ((b.deletions = [c]), (b.flags |= 16)) : d.push(c); - } - } - function c(c, d) { - if (!a) return null; - for (; null !== d; ) b(c, d), (d = d.sibling); - return null; - } - function d(a, b) { - for (a = new Map(); null !== b; ) - null !== b.key ? a.set(b.key, b) : a.set(b.index, b), (b = b.sibling); - return a; - } - function e(a, b) { - a = gb(a, b); - a.index = 0; - a.sibling = null; - return a; - } - function f(b, c, d) { - b.index = d; - if (!a) return (b.flags |= 1048576), c; - d = b.alternate; - if (null !== d) return (d = d.index), d < c ? ((b.flags |= 2), c) : d; - b.flags |= 2; - return c; - } - function g(b) { - a && null === b.alternate && (b.flags |= 2); - return b; - } - function h(a, b, c, d) { - if (null === b || 6 !== b.tag) - return (b = gf(c, a.mode, d)), (b.return = a), b; - b = e(b, c); - b.return = a; - return b; - } - function k(a, b, c, d) { - var f = c.type; - if (f === Bb) return l(a, b, c.props.children, d, c.key); - if ( - null !== b && - (b.elementType === f || - ("object" === typeof f && - null !== f && - f.$$typeof === Ta && - Kh(f) === b.type)) - ) - return (d = e(b, c.props)), (d.ref = vc(a, b, c)), (d.return = a), d; - d = wd(c.type, c.key, c.props, null, a.mode, d); - d.ref = vc(a, b, c); - d.return = a; - return d; - } - function m(a, b, c, d) { - if ( - null === b || - 4 !== b.tag || - b.stateNode.containerInfo !== c.containerInfo || - b.stateNode.implementation !== c.implementation - ) - return (b = hf(c, a.mode, d)), (b.return = a), b; - b = e(b, c.children || []); - b.return = a; - return b; - } - function l(a, b, c, d, f) { - if (null === b || 7 !== b.tag) - return (b = ub(c, a.mode, d, f)), (b.return = a), b; - b = e(b, c); - b.return = a; - return b; - } - function u(a, b, c) { - if (("string" === typeof b && "" !== b) || "number" === typeof b) - return (b = gf("" + b, a.mode, c)), (b.return = a), b; - if ("object" === typeof b && null !== b) { - switch (b.$$typeof) { - case xd: - return ( - (c = wd(b.type, b.key, b.props, null, a.mode, c)), - (c.ref = vc(a, null, b)), - (c.return = a), - c - ); - case Cb: - return (b = hf(b, a.mode, c)), (b.return = a), b; - case Ta: - var d = b._init; - return u(a, d(b._payload), c); - } - if (cc(b) || ac(b)) - return (b = ub(b, a.mode, c, null)), (b.return = a), b; - vd(a, b); - } - return null; - } - function r(a, b, c, d) { - var e = null !== b ? b.key : null; - if (("string" === typeof c && "" !== c) || "number" === typeof c) - return null !== e ? null : h(a, b, "" + c, d); - if ("object" === typeof c && null !== c) { - switch (c.$$typeof) { - case xd: - return c.key === e ? k(a, b, c, d) : null; - case Cb: - return c.key === e ? m(a, b, c, d) : null; - case Ta: - return (e = c._init), r(a, b, e(c._payload), d); - } - if (cc(c) || ac(c)) return null !== e ? null : l(a, b, c, d, null); - vd(a, c); - } - return null; - } - function p(a, b, c, d, e) { - if (("string" === typeof d && "" !== d) || "number" === typeof d) - return (a = a.get(c) || null), h(b, a, "" + d, e); - if ("object" === typeof d && null !== d) { - switch (d.$$typeof) { - case xd: - return ( - (a = a.get(null === d.key ? c : d.key) || null), k(b, a, d, e) - ); - case Cb: - return ( - (a = a.get(null === d.key ? c : d.key) || null), m(b, a, d, e) - ); - case Ta: - var f = d._init; - return p(a, b, c, f(d._payload), e); - } - if (cc(d) || ac(d)) - return (a = a.get(c) || null), l(b, a, d, e, null); - vd(b, d); - } - return null; - } - function x(e, g, h, k) { - for ( - var n = null, m = null, l = g, q = (g = 0), v = null; - null !== l && q < h.length; - q++ - ) { - l.index > q ? ((v = l), (l = null)) : (v = l.sibling); - var A = r(e, l, h[q], k); - if (null === A) { - null === l && (l = v); - break; - } - a && l && null === A.alternate && b(e, l); - g = f(A, g, q); - null === m ? (n = A) : (m.sibling = A); - m = A; - l = v; - } - if (q === h.length) return c(e, l), D && rb(e, q), n; - if (null === l) { - for (; q < h.length; q++) - (l = u(e, h[q], k)), - null !== l && - ((g = f(l, g, q)), - null === m ? (n = l) : (m.sibling = l), - (m = l)); - D && rb(e, q); - return n; - } - for (l = d(e, l); q < h.length; q++) - (v = p(l, e, q, h[q], k)), - null !== v && - (a && - null !== v.alternate && - l.delete(null === v.key ? q : v.key), - (g = f(v, g, q)), - null === m ? (n = v) : (m.sibling = v), - (m = v)); - a && - l.forEach(function (a) { - return b(e, a); - }); - D && rb(e, q); - return n; - } - function F(e, g, h, k) { - var m = ac(h); - if ("function" !== typeof m) throw Error(n(150)); - h = m.call(h); - if (null == h) throw Error(n(151)); - for ( - var l = (m = null), q = g, v = (g = 0), A = null, t = h.next(); - null !== q && !t.done; - v++, t = h.next() - ) { - q.index > v ? ((A = q), (q = null)) : (A = q.sibling); - var x = r(e, q, t.value, k); - if (null === x) { - null === q && (q = A); - break; - } - a && q && null === x.alternate && b(e, q); - g = f(x, g, v); - null === l ? (m = x) : (l.sibling = x); - l = x; - q = A; - } - if (t.done) return c(e, q), D && rb(e, v), m; - if (null === q) { - for (; !t.done; v++, t = h.next()) - (t = u(e, t.value, k)), - null !== t && - ((g = f(t, g, v)), - null === l ? (m = t) : (l.sibling = t), - (l = t)); - D && rb(e, v); - return m; - } - for (q = d(e, q); !t.done; v++, t = h.next()) - (t = p(q, e, v, t.value, k)), - null !== t && - (a && - null !== t.alternate && - q.delete(null === t.key ? v : t.key), - (g = f(t, g, v)), - null === l ? (m = t) : (l.sibling = t), - (l = t)); - a && - q.forEach(function (a) { - return b(e, a); - }); - D && rb(e, v); - return m; - } - function w(a, d, f, h) { - "object" === typeof f && - null !== f && - f.type === Bb && - null === f.key && - (f = f.props.children); - if ("object" === typeof f && null !== f) { - switch (f.$$typeof) { - case xd: - a: { - for (var k = f.key, m = d; null !== m; ) { - if (m.key === k) { - k = f.type; - if (k === Bb) { - if (7 === m.tag) { - c(a, m.sibling); - d = e(m, f.props.children); - d.return = a; - a = d; - break a; - } - } else if ( - m.elementType === k || - ("object" === typeof k && - null !== k && - k.$$typeof === Ta && - Kh(k) === m.type) - ) { - c(a, m.sibling); - d = e(m, f.props); - d.ref = vc(a, m, f); - d.return = a; - a = d; - break a; - } - c(a, m); - break; - } else b(a, m); - m = m.sibling; - } - f.type === Bb - ? ((d = ub(f.props.children, a.mode, h, f.key)), - (d.return = a), - (a = d)) - : ((h = wd(f.type, f.key, f.props, null, a.mode, h)), - (h.ref = vc(a, d, f)), - (h.return = a), - (a = h)); - } - return g(a); - case Cb: - a: { - for (m = f.key; null !== d; ) { - if (d.key === m) - if ( - 4 === d.tag && - d.stateNode.containerInfo === f.containerInfo && - d.stateNode.implementation === f.implementation - ) { - c(a, d.sibling); - d = e(d, f.children || []); - d.return = a; - a = d; - break a; - } else { - c(a, d); - break; - } - else b(a, d); - d = d.sibling; - } - d = hf(f, a.mode, h); - d.return = a; - a = d; - } - return g(a); - case Ta: - return (m = f._init), w(a, d, m(f._payload), h); - } - if (cc(f)) return x(a, d, f, h); - if (ac(f)) return F(a, d, f, h); - vd(a, f); - } - return ("string" === typeof f && "" !== f) || "number" === typeof f - ? ((f = "" + f), - null !== d && 6 === d.tag - ? (c(a, d.sibling), (d = e(d, f)), (d.return = a), (a = d)) - : (c(a, d), (d = gf(f, a.mode, h)), (d.return = a), (a = d)), - g(a)) - : c(a, d); - } - return w; - } - function vb(a) { - if (a === wc) throw Error(n(174)); - return a; - } - function jf(a, b) { - y(xc, b); - y(yc, a); - y(Ea, wc); - a = b.nodeType; - switch (a) { - case 9: - case 11: - b = (b = b.documentElement) ? b.namespaceURI : oe(null, ""); - break; - default: - (a = 8 === a ? b.parentNode : b), - (b = a.namespaceURI || null), - (a = a.tagName), - (b = oe(b, a)); - } - w(Ea); - y(Ea, b); - } - function Tb(a) { - w(Ea); - w(yc); - w(xc); - } - function Mh(a) { - vb(xc.current); - var b = vb(Ea.current); - var c = oe(b, a.type); - b !== c && (y(yc, a), y(Ea, c)); - } - function kf(a) { - yc.current === a && (w(Ea), w(yc)); - } - function yd(a) { - for (var b = a; null !== b; ) { - if (13 === b.tag) { - var c = b.memoizedState; - if ( - null !== c && - ((c = c.dehydrated), - null === c || "$?" === c.data || "$!" === c.data) - ) - return b; - } else if (19 === b.tag && void 0 !== b.memoizedProps.revealOrder) { - if (0 !== (b.flags & 128)) return b; - } else if (null !== b.child) { - b.child.return = b; - b = b.child; - continue; - } - if (b === a) break; - for (; null === b.sibling; ) { - if (null === b.return || b.return === a) return null; - b = b.return; - } - b.sibling.return = b.return; - b = b.sibling; - } - return null; - } - function lf() { - for (var a = 0; a < mf.length; a++) - mf[a]._workInProgressVersionPrimary = null; - mf.length = 0; - } - function V() { - throw Error(n(321)); - } - function nf(a, b) { - if (null === b) return !1; - for (var c = 0; c < b.length && c < a.length; c++) - if (!ua(a[c], b[c])) return !1; - return !0; - } - function of(a, b, c, d, e, f) { - wb = f; - C = b; - b.memoizedState = null; - b.updateQueue = null; - b.lanes = 0; - zd.current = null === a || null === a.memoizedState ? mk : nk; - a = c(d, e); - if (zc) { - f = 0; - do { - zc = !1; - Ac = 0; - if (25 <= f) throw Error(n(301)); - f += 1; - N = K = null; - b.updateQueue = null; - zd.current = ok; - a = c(d, e); - } while (zc); - } - zd.current = Ad; - b = null !== K && null !== K.next; - wb = 0; - N = K = C = null; - Bd = !1; - if (b) throw Error(n(300)); - return a; - } - function pf() { - var a = 0 !== Ac; - Ac = 0; - return a; - } - function Fa() { - var a = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null, - }; - null === N ? (C.memoizedState = N = a) : (N = N.next = a); - return N; - } - function sa() { - if (null === K) { - var a = C.alternate; - a = null !== a ? a.memoizedState : null; - } else a = K.next; - var b = null === N ? C.memoizedState : N.next; - if (null !== b) (N = b), (K = a); - else { - if (null === a) throw Error(n(310)); - K = a; - a = { - memoizedState: K.memoizedState, - baseState: K.baseState, - baseQueue: K.baseQueue, - queue: K.queue, - next: null, - }; - null === N ? (C.memoizedState = N = a) : (N = N.next = a); - } - return N; - } - function Bc(a, b) { - return "function" === typeof b ? b(a) : b; - } - function qf(a, b, c) { - b = sa(); - c = b.queue; - if (null === c) throw Error(n(311)); - c.lastRenderedReducer = a; - var d = K, - e = d.baseQueue, - f = c.pending; - if (null !== f) { - if (null !== e) { - var g = e.next; - e.next = f.next; - f.next = g; - } - d.baseQueue = e = f; - c.pending = null; - } - if (null !== e) { - f = e.next; - d = d.baseState; - var h = (g = null), - k = null, - m = f; - do { - var l = m.lane; - if ((wb & l) === l) - null !== k && - (k = k.next = - { - lane: 0, - action: m.action, - hasEagerState: m.hasEagerState, - eagerState: m.eagerState, - next: null, - }), - (d = m.hasEagerState ? m.eagerState : a(d, m.action)); - else { - var u = { - lane: l, - action: m.action, - hasEagerState: m.hasEagerState, - eagerState: m.eagerState, - next: null, - }; - null === k ? ((h = k = u), (g = d)) : (k = k.next = u); - C.lanes |= l; - ra |= l; - } - m = m.next; - } while (null !== m && m !== f); - null === k ? (g = d) : (k.next = h); - ua(d, b.memoizedState) || (ha = !0); - b.memoizedState = d; - b.baseState = g; - b.baseQueue = k; - c.lastRenderedState = d; - } - a = c.interleaved; - if (null !== a) { - e = a; - do (f = e.lane), (C.lanes |= f), (ra |= f), (e = e.next); - while (e !== a); - } else null === e && (c.lanes = 0); - return [b.memoizedState, c.dispatch]; - } - function rf(a, b, c) { - b = sa(); - c = b.queue; - if (null === c) throw Error(n(311)); - c.lastRenderedReducer = a; - var d = c.dispatch, - e = c.pending, - f = b.memoizedState; - if (null !== e) { - c.pending = null; - var g = (e = e.next); - do (f = a(f, g.action)), (g = g.next); - while (g !== e); - ua(f, b.memoizedState) || (ha = !0); - b.memoizedState = f; - null === b.baseQueue && (b.baseState = f); - c.lastRenderedState = f; - } - return [f, d]; - } - function Nh(a, b, c) {} - function Oh(a, b, c) { - c = C; - var d = sa(), - e = b(), - f = !ua(d.memoizedState, e); - f && ((d.memoizedState = e), (ha = !0)); - d = d.queue; - sf(Ph.bind(null, c, d, a), [a]); - if (d.getSnapshot !== b || f || (null !== N && N.memoizedState.tag & 1)) { - c.flags |= 2048; - Cc(9, Qh.bind(null, c, d, e, b), void 0, null); - if (null === O) throw Error(n(349)); - 0 !== (wb & 30) || Rh(c, b, e); - } - return e; - } - function Rh(a, b, c) { - a.flags |= 16384; - a = { getSnapshot: b, value: c }; - b = C.updateQueue; - null === b - ? ((b = { lastEffect: null, stores: null }), - (C.updateQueue = b), - (b.stores = [a])) - : ((c = b.stores), null === c ? (b.stores = [a]) : c.push(a)); - } - function Qh(a, b, c, d) { - b.value = c; - b.getSnapshot = d; - Sh(b) && Th(a); - } - function Ph(a, b, c) { - return c(function () { - Sh(b) && Th(a); - }); - } - function Sh(a) { - var b = a.getSnapshot; - a = a.value; - try { - var c = b(); - return !ua(a, c); - } catch (d) { - return !0; - } - } - function Th(a) { - var b = Oa(a, 1); - null !== b && ya(b, a, 1, -1); - } - function Uh(a) { - var b = Fa(); - "function" === typeof a && (a = a()); - b.memoizedState = b.baseState = a; - a = { - pending: null, - interleaved: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: Bc, - lastRenderedState: a, - }; - b.queue = a; - a = a.dispatch = pk.bind(null, C, a); - return [b.memoizedState, a]; - } - function Cc(a, b, c, d) { - a = { tag: a, create: b, destroy: c, deps: d, next: null }; - b = C.updateQueue; - null === b - ? ((b = { lastEffect: null, stores: null }), - (C.updateQueue = b), - (b.lastEffect = a.next = a)) - : ((c = b.lastEffect), - null === c - ? (b.lastEffect = a.next = a) - : ((d = c.next), (c.next = a), (a.next = d), (b.lastEffect = a))); - return a; - } - function Vh(a) { - return sa().memoizedState; - } - function Cd(a, b, c, d) { - var e = Fa(); - C.flags |= a; - e.memoizedState = Cc(1 | b, c, void 0, void 0 === d ? null : d); - } - function Dd(a, b, c, d) { - var e = sa(); - d = void 0 === d ? null : d; - var f = void 0; - if (null !== K) { - var g = K.memoizedState; - f = g.destroy; - if (null !== d && nf(d, g.deps)) { - e.memoizedState = Cc(b, c, f, d); - return; - } - } - C.flags |= a; - e.memoizedState = Cc(1 | b, c, f, d); - } - function Wh(a, b) { - return Cd(8390656, 8, a, b); - } - function sf(a, b) { - return Dd(2048, 8, a, b); - } - function Xh(a, b) { - return Dd(4, 2, a, b); - } - function Yh(a, b) { - return Dd(4, 4, a, b); - } - function Zh(a, b) { - if ("function" === typeof b) - return ( - (a = a()), - b(a), - function () { - b(null); - } - ); - if (null !== b && void 0 !== b) - return ( - (a = a()), - (b.current = a), - function () { - b.current = null; - } - ); - } - function $h(a, b, c) { - c = null !== c && void 0 !== c ? c.concat([a]) : null; - return Dd(4, 4, Zh.bind(null, b, a), c); - } - function tf(a, b) {} - function ai(a, b) { - var c = sa(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && nf(b, d[1])) return d[0]; - c.memoizedState = [a, b]; - return a; - } - function bi(a, b) { - var c = sa(); - b = void 0 === b ? null : b; - var d = c.memoizedState; - if (null !== d && null !== b && nf(b, d[1])) return d[0]; - a = a(); - c.memoizedState = [a, b]; - return a; - } - function ci(a, b, c) { - if (0 === (wb & 21)) - return ( - a.baseState && ((a.baseState = !1), (ha = !0)), (a.memoizedState = c) - ); - ua(c, b) || ((c = Dg()), (C.lanes |= c), (ra |= c), (a.baseState = !0)); - return b; - } - function qk(a, b, c) { - c = z; - z = 0 !== c && 4 > c ? c : 4; - a(!0); - var d = uf.transition; - uf.transition = {}; - try { - a(!1), b(); - } finally { - (z = c), (uf.transition = d); - } - } - function di() { - return sa().memoizedState; - } - function rk(a, b, c) { - var d = hb(a); - c = { - lane: d, - action: c, - hasEagerState: !1, - eagerState: null, - next: null, - }; - if (ei(a)) fi(b, c); - else if (((c = Ch(a, b, c, d)), null !== c)) { - var e = Z(); - ya(c, a, d, e); - gi(c, b, d); - } - } - function pk(a, b, c) { - var d = hb(a), - e = { - lane: d, - action: c, - hasEagerState: !1, - eagerState: null, - next: null, - }; - if (ei(a)) fi(b, e); - else { - var f = a.alternate; - if ( - 0 === a.lanes && - (null === f || 0 === f.lanes) && - ((f = b.lastRenderedReducer), null !== f) - ) - try { - var g = b.lastRenderedState, - h = f(g, c); - e.hasEagerState = !0; - e.eagerState = h; - if (ua(h, g)) { - var k = b.interleaved; - null === k - ? ((e.next = e), cf(b)) - : ((e.next = k.next), (k.next = e)); - b.interleaved = e; - return; - } - } catch (m) { - } finally { - } - c = Ch(a, b, e, d); - null !== c && ((e = Z()), ya(c, a, d, e), gi(c, b, d)); - } - } - function ei(a) { - var b = a.alternate; - return a === C || (null !== b && b === C); - } - function fi(a, b) { - zc = Bd = !0; - var c = a.pending; - null === c ? (b.next = b) : ((b.next = c.next), (c.next = b)); - a.pending = b; - } - function gi(a, b, c) { - if (0 !== (c & 4194240)) { - var d = b.lanes; - d &= a.pendingLanes; - c |= d; - b.lanes = c; - xe(a, c); - } - } - function Ub(a, b) { - try { - var c = "", - d = b; - do (c += gj(d)), (d = d.return); - while (d); - var e = c; - } catch (f) { - e = "\nError generating stack: " + f.message + "\n" + f.stack; - } - return { value: a, source: b, stack: e, digest: null }; - } - function vf(a, b, c) { - return { - value: a, - source: null, - stack: null != c ? c : null, - digest: null != b ? b : null, - }; - } - function wf(a, b) { - try { - console.error(b.value); - } catch (c) { - setTimeout(function () { - throw c; - }); - } - } - function hi(a, b, c) { - c = Pa(-1, c); - c.tag = 3; - c.payload = { element: null }; - var d = b.value; - c.callback = function () { - Ed || ((Ed = !0), (xf = d)); - wf(a, b); - }; - return c; - } - function ii(a, b, c) { - c = Pa(-1, c); - c.tag = 3; - var d = a.type.getDerivedStateFromError; - if ("function" === typeof d) { - var e = b.value; - c.payload = function () { - return d(e); - }; - c.callback = function () { - wf(a, b); - }; - } - var f = a.stateNode; - null !== f && - "function" === typeof f.componentDidCatch && - (c.callback = function () { - wf(a, b); - "function" !== typeof d && - (null === ib ? (ib = new Set([this])) : ib.add(this)); - var c = b.stack; - this.componentDidCatch(b.value, { - componentStack: null !== c ? c : "", - }); - }); - return c; - } - function ji(a, b, c) { - var d = a.pingCache; - if (null === d) { - d = a.pingCache = new sk(); - var e = new Set(); - d.set(b, e); - } else (e = d.get(b)), void 0 === e && ((e = new Set()), d.set(b, e)); - e.has(c) || (e.add(c), (a = tk.bind(null, a, b, c)), b.then(a, a)); - } - function ki(a) { - do { - var b; - if ((b = 13 === a.tag)) - (b = a.memoizedState), - (b = null !== b ? (null !== b.dehydrated ? !0 : !1) : !0); - if (b) return a; - a = a.return; - } while (null !== a); - return null; - } - function li(a, b, c, d, e) { - if (0 === (a.mode & 1)) - return ( - a === b - ? (a.flags |= 65536) - : ((a.flags |= 128), - (c.flags |= 131072), - (c.flags &= -52805), - 1 === c.tag && - (null === c.alternate - ? (c.tag = 17) - : ((b = Pa(-1, 1)), (b.tag = 2), eb(c, b, 1))), - (c.lanes |= 1)), - a - ); - a.flags |= 65536; - a.lanes = e; - return a; - } - function aa(a, b, c, d) { - b.child = null === a ? mi(b, null, c, d) : Vb(b, a.child, c, d); - } - function ni(a, b, c, d, e) { - c = c.render; - var f = b.ref; - Sb(b, e); - d = of(a, b, c, d, f, e); - c = pf(); - if (null !== a && !ha) - return ( - (b.updateQueue = a.updateQueue), - (b.flags &= -2053), - (a.lanes &= ~e), - Qa(a, b, e) - ); - D && c && Ue(b); - b.flags |= 1; - aa(a, b, d, e); - return b.child; - } - function oi(a, b, c, d, e) { - if (null === a) { - var f = c.type; - if ( - "function" === typeof f && - !yf(f) && - void 0 === f.defaultProps && - null === c.compare && - void 0 === c.defaultProps - ) - return (b.tag = 15), (b.type = f), pi(a, b, f, d, e); - a = wd(c.type, null, d, b, b.mode, e); - a.ref = b.ref; - a.return = b; - return (b.child = a); - } - f = a.child; - if (0 === (a.lanes & e)) { - var g = f.memoizedProps; - c = c.compare; - c = null !== c ? c : qc; - if (c(g, d) && a.ref === b.ref) return Qa(a, b, e); - } - b.flags |= 1; - a = gb(f, d); - a.ref = b.ref; - a.return = b; - return (b.child = a); - } - function pi(a, b, c, d, e) { - if (null !== a) { - var f = a.memoizedProps; - if (qc(f, d) && a.ref === b.ref) - if (((ha = !1), (b.pendingProps = d = f), 0 !== (a.lanes & e))) - 0 !== (a.flags & 131072) && (ha = !0); - else return (b.lanes = a.lanes), Qa(a, b, e); - } - return zf(a, b, c, d, e); - } - function qi(a, b, c) { - var d = b.pendingProps, - e = d.children, - f = null !== a ? a.memoizedState : null; - if ("hidden" === d.mode) - if (0 === (b.mode & 1)) - (b.memoizedState = { - baseLanes: 0, - cachePool: null, - transitions: null, - }), - y(Ga, ba), - (ba |= c); - else { - if (0 === (c & 1073741824)) - return ( - (a = null !== f ? f.baseLanes | c : c), - (b.lanes = b.childLanes = 1073741824), - (b.memoizedState = { - baseLanes: a, - cachePool: null, - transitions: null, - }), - (b.updateQueue = null), - y(Ga, ba), - (ba |= a), - null - ); - b.memoizedState = { - baseLanes: 0, - cachePool: null, - transitions: null, - }; - d = null !== f ? f.baseLanes : c; - y(Ga, ba); - ba |= d; - } - else - null !== f - ? ((d = f.baseLanes | c), (b.memoizedState = null)) - : (d = c), - y(Ga, ba), - (ba |= d); - aa(a, b, e, c); - return b.child; - } - function ri(a, b) { - var c = b.ref; - if ((null === a && null !== c) || (null !== a && a.ref !== c)) - (b.flags |= 512), (b.flags |= 2097152); - } - function zf(a, b, c, d, e) { - var f = ea(c) ? qb : J.current; - f = Nb(b, f); - Sb(b, e); - c = of(a, b, c, d, f, e); - d = pf(); - if (null !== a && !ha) - return ( - (b.updateQueue = a.updateQueue), - (b.flags &= -2053), - (a.lanes &= ~e), - Qa(a, b, e) - ); - D && d && Ue(b); - b.flags |= 1; - aa(a, b, c, e); - return b.child; - } - function si(a, b, c, d, e) { - if (ea(c)) { - var f = !0; - ld(b); - } else f = !1; - Sb(b, e); - if (null === b.stateNode) Fd(a, b), Hh(b, c, d), ff(b, c, d, e), (d = !0); - else if (null === a) { - var g = b.stateNode, - h = b.memoizedProps; - g.props = h; - var k = g.context, - m = c.contextType; - "object" === typeof m && null !== m - ? (m = qa(m)) - : ((m = ea(c) ? qb : J.current), (m = Nb(b, m))); - var l = c.getDerivedStateFromProps, - n = - "function" === typeof l || - "function" === typeof g.getSnapshotBeforeUpdate; - n || - ("function" !== typeof g.UNSAFE_componentWillReceiveProps && - "function" !== typeof g.componentWillReceiveProps) || - ((h !== d || k !== m) && Ih(b, g, d, m)); - fb = !1; - var r = b.memoizedState; - g.state = r; - td(b, d, g, e); - k = b.memoizedState; - h !== d || r !== k || S.current || fb - ? ("function" === typeof l && (ef(b, c, l, d), (k = b.memoizedState)), - (h = fb || Gh(b, c, h, d, r, k, m)) - ? (n || - ("function" !== typeof g.UNSAFE_componentWillMount && - "function" !== typeof g.componentWillMount) || - ("function" === typeof g.componentWillMount && - g.componentWillMount(), - "function" === typeof g.UNSAFE_componentWillMount && - g.UNSAFE_componentWillMount()), - "function" === typeof g.componentDidMount && - (b.flags |= 4194308)) - : ("function" === typeof g.componentDidMount && - (b.flags |= 4194308), - (b.memoizedProps = d), - (b.memoizedState = k)), - (g.props = d), - (g.state = k), - (g.context = m), - (d = h)) - : ("function" === typeof g.componentDidMount && (b.flags |= 4194308), - (d = !1)); - } else { - g = b.stateNode; - Dh(a, b); - h = b.memoizedProps; - m = b.type === b.elementType ? h : xa(b.type, h); - g.props = m; - n = b.pendingProps; - r = g.context; - k = c.contextType; - "object" === typeof k && null !== k - ? (k = qa(k)) - : ((k = ea(c) ? qb : J.current), (k = Nb(b, k))); - var p = c.getDerivedStateFromProps; - (l = - "function" === typeof p || - "function" === typeof g.getSnapshotBeforeUpdate) || - ("function" !== typeof g.UNSAFE_componentWillReceiveProps && - "function" !== typeof g.componentWillReceiveProps) || - ((h !== n || r !== k) && Ih(b, g, d, k)); - fb = !1; - r = b.memoizedState; - g.state = r; - td(b, d, g, e); - var x = b.memoizedState; - h !== n || r !== x || S.current || fb - ? ("function" === typeof p && (ef(b, c, p, d), (x = b.memoizedState)), - (m = fb || Gh(b, c, m, d, r, x, k) || !1) - ? (l || - ("function" !== typeof g.UNSAFE_componentWillUpdate && - "function" !== typeof g.componentWillUpdate) || - ("function" === typeof g.componentWillUpdate && - g.componentWillUpdate(d, x, k), - "function" === typeof g.UNSAFE_componentWillUpdate && - g.UNSAFE_componentWillUpdate(d, x, k)), - "function" === typeof g.componentDidUpdate && (b.flags |= 4), - "function" === typeof g.getSnapshotBeforeUpdate && - (b.flags |= 1024)) - : ("function" !== typeof g.componentDidUpdate || - (h === a.memoizedProps && r === a.memoizedState) || - (b.flags |= 4), - "function" !== typeof g.getSnapshotBeforeUpdate || - (h === a.memoizedProps && r === a.memoizedState) || - (b.flags |= 1024), - (b.memoizedProps = d), - (b.memoizedState = x)), - (g.props = d), - (g.state = x), - (g.context = k), - (d = m)) - : ("function" !== typeof g.componentDidUpdate || - (h === a.memoizedProps && r === a.memoizedState) || - (b.flags |= 4), - "function" !== typeof g.getSnapshotBeforeUpdate || - (h === a.memoizedProps && r === a.memoizedState) || - (b.flags |= 1024), - (d = !1)); - } - return Af(a, b, c, d, f, e); - } - function Af(a, b, c, d, e, f) { - ri(a, b); - var g = 0 !== (b.flags & 128); - if (!d && !g) return e && vh(b, c, !1), Qa(a, b, f); - d = b.stateNode; - uk.current = b; - var h = - g && "function" !== typeof c.getDerivedStateFromError - ? null - : d.render(); - b.flags |= 1; - null !== a && g - ? ((b.child = Vb(b, a.child, null, f)), (b.child = Vb(b, null, h, f))) - : aa(a, b, h, f); - b.memoizedState = d.state; - e && vh(b, c, !0); - return b.child; - } - function ti(a) { - var b = a.stateNode; - b.pendingContext - ? th(a, b.pendingContext, b.pendingContext !== b.context) - : b.context && th(a, b.context, !1); - jf(a, b.containerInfo); - } - function ui(a, b, c, d, e) { - Qb(); - Ye(e); - b.flags |= 256; - aa(a, b, c, d); - return b.child; - } - function Bf(a) { - return { baseLanes: a, cachePool: null, transitions: null }; - } - function vi(a, b, c) { - var d = b.pendingProps, - e = G.current, - f = !1, - g = 0 !== (b.flags & 128), - h; - (h = g) || - (h = null !== a && null === a.memoizedState ? !1 : 0 !== (e & 2)); - if (h) (f = !0), (b.flags &= -129); - else if (null === a || null !== a.memoizedState) e |= 1; - y(G, e & 1); - if (null === a) { - Xe(b); - a = b.memoizedState; - if (null !== a && ((a = a.dehydrated), null !== a)) - return ( - 0 === (b.mode & 1) - ? (b.lanes = 1) - : "$!" === a.data - ? (b.lanes = 8) - : (b.lanes = 1073741824), - null - ); - g = d.children; - a = d.fallback; - return f - ? ((d = b.mode), - (f = b.child), - (g = { mode: "hidden", children: g }), - 0 === (d & 1) && null !== f - ? ((f.childLanes = 0), (f.pendingProps = g)) - : (f = Gd(g, d, 0, null)), - (a = ub(a, d, c, null)), - (f.return = b), - (a.return = b), - (f.sibling = a), - (b.child = f), - (b.child.memoizedState = Bf(c)), - (b.memoizedState = Cf), - a) - : Df(b, g); - } - e = a.memoizedState; - if (null !== e && ((h = e.dehydrated), null !== h)) - return vk(a, b, g, d, h, e, c); - if (f) { - f = d.fallback; - g = b.mode; - e = a.child; - h = e.sibling; - var k = { mode: "hidden", children: d.children }; - 0 === (g & 1) && b.child !== e - ? ((d = b.child), - (d.childLanes = 0), - (d.pendingProps = k), - (b.deletions = null)) - : ((d = gb(e, k)), (d.subtreeFlags = e.subtreeFlags & 14680064)); - null !== h ? (f = gb(h, f)) : ((f = ub(f, g, c, null)), (f.flags |= 2)); - f.return = b; - d.return = b; - d.sibling = f; - b.child = d; - d = f; - f = b.child; - g = a.child.memoizedState; - g = - null === g - ? Bf(c) - : { - baseLanes: g.baseLanes | c, - cachePool: null, - transitions: g.transitions, - }; - f.memoizedState = g; - f.childLanes = a.childLanes & ~c; - b.memoizedState = Cf; - return d; - } - f = a.child; - a = f.sibling; - d = gb(f, { mode: "visible", children: d.children }); - 0 === (b.mode & 1) && (d.lanes = c); - d.return = b; - d.sibling = null; - null !== a && - ((c = b.deletions), - null === c ? ((b.deletions = [a]), (b.flags |= 16)) : c.push(a)); - b.child = d; - b.memoizedState = null; - return d; - } - function Df(a, b, c) { - b = Gd({ mode: "visible", children: b }, a.mode, 0, null); - b.return = a; - return (a.child = b); - } - function Hd(a, b, c, d) { - null !== d && Ye(d); - Vb(b, a.child, null, c); - a = Df(b, b.pendingProps.children); - a.flags |= 2; - b.memoizedState = null; - return a; - } - function vk(a, b, c, d, e, f, g) { - if (c) { - if (b.flags & 256) - return (b.flags &= -257), (d = vf(Error(n(422)))), Hd(a, b, g, d); - if (null !== b.memoizedState) - return (b.child = a.child), (b.flags |= 128), null; - f = d.fallback; - e = b.mode; - d = Gd({ mode: "visible", children: d.children }, e, 0, null); - f = ub(f, e, g, null); - f.flags |= 2; - d.return = b; - f.return = b; - d.sibling = f; - b.child = d; - 0 !== (b.mode & 1) && Vb(b, a.child, null, g); - b.child.memoizedState = Bf(g); - b.memoizedState = Cf; - return f; - } - if (0 === (b.mode & 1)) return Hd(a, b, g, null); - if ("$!" === e.data) { - d = e.nextSibling && e.nextSibling.dataset; - if (d) var h = d.dgst; - d = h; - f = Error(n(419)); - d = vf(f, d, void 0); - return Hd(a, b, g, d); - } - h = 0 !== (g & a.childLanes); - if (ha || h) { - d = O; - if (null !== d) { - switch (g & -g) { - case 4: - e = 2; - break; - case 16: - e = 8; - break; - case 64: - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - case 67108864: - e = 32; - break; - case 536870912: - e = 268435456; - break; - default: - e = 0; - } - e = 0 !== (e & (d.suspendedLanes | g)) ? 0 : e; - 0 !== e && - e !== f.retryLane && - ((f.retryLane = e), Oa(a, e), ya(d, a, e, -1)); - } - Ef(); - d = vf(Error(n(421))); - return Hd(a, b, g, d); - } - if ("$?" === e.data) - return ( - (b.flags |= 128), - (b.child = a.child), - (b = wk.bind(null, a)), - (e._reactRetry = b), - null - ); - a = f.treeContext; - fa = Ka(e.nextSibling); - la = b; - D = !0; - wa = null; - null !== a && - ((na[oa++] = Ma), - (na[oa++] = Na), - (na[oa++] = sb), - (Ma = a.id), - (Na = a.overflow), - (sb = b)); - b = Df(b, d.children); - b.flags |= 4096; - return b; - } - function wi(a, b, c) { - a.lanes |= b; - var d = a.alternate; - null !== d && (d.lanes |= b); - bf(a.return, b, c); - } - function Ff(a, b, c, d, e) { - var f = a.memoizedState; - null === f - ? (a.memoizedState = { - isBackwards: b, - rendering: null, - renderingStartTime: 0, - last: d, - tail: c, - tailMode: e, - }) - : ((f.isBackwards = b), - (f.rendering = null), - (f.renderingStartTime = 0), - (f.last = d), - (f.tail = c), - (f.tailMode = e)); - } - function xi(a, b, c) { - var d = b.pendingProps, - e = d.revealOrder, - f = d.tail; - aa(a, b, d.children, c); - d = G.current; - if (0 !== (d & 2)) (d = (d & 1) | 2), (b.flags |= 128); - else { - if (null !== a && 0 !== (a.flags & 128)) - a: for (a = b.child; null !== a; ) { - if (13 === a.tag) null !== a.memoizedState && wi(a, c, b); - else if (19 === a.tag) wi(a, c, b); - else if (null !== a.child) { - a.child.return = a; - a = a.child; - continue; - } - if (a === b) break a; - for (; null === a.sibling; ) { - if (null === a.return || a.return === b) break a; - a = a.return; - } - a.sibling.return = a.return; - a = a.sibling; - } - d &= 1; - } - y(G, d); - if (0 === (b.mode & 1)) b.memoizedState = null; - else - switch (e) { - case "forwards": - c = b.child; - for (e = null; null !== c; ) - (a = c.alternate), - null !== a && null === yd(a) && (e = c), - (c = c.sibling); - c = e; - null === c - ? ((e = b.child), (b.child = null)) - : ((e = c.sibling), (c.sibling = null)); - Ff(b, !1, e, c, f); - break; - case "backwards": - c = null; - e = b.child; - for (b.child = null; null !== e; ) { - a = e.alternate; - if (null !== a && null === yd(a)) { - b.child = e; - break; - } - a = e.sibling; - e.sibling = c; - c = e; - e = a; - } - Ff(b, !0, c, null, f); - break; - case "together": - Ff(b, !1, null, null, void 0); - break; - default: - b.memoizedState = null; - } - return b.child; - } - function Fd(a, b) { - 0 === (b.mode & 1) && - null !== a && - ((a.alternate = null), (b.alternate = null), (b.flags |= 2)); - } - function Qa(a, b, c) { - null !== a && (b.dependencies = a.dependencies); - ra |= b.lanes; - if (0 === (c & b.childLanes)) return null; - if (null !== a && b.child !== a.child) throw Error(n(153)); - if (null !== b.child) { - a = b.child; - c = gb(a, a.pendingProps); - b.child = c; - for (c.return = b; null !== a.sibling; ) - (a = a.sibling), - (c = c.sibling = gb(a, a.pendingProps)), - (c.return = b); - c.sibling = null; - } - return b.child; - } - function xk(a, b, c) { - switch (b.tag) { - case 3: - ti(b); - Qb(); - break; - case 5: - Mh(b); - break; - case 1: - ea(b.type) && ld(b); - break; - case 4: - jf(b, b.stateNode.containerInfo); - break; - case 10: - var d = b.type._context, - e = b.memoizedProps.value; - y(rd, d._currentValue); - d._currentValue = e; - break; - case 13: - d = b.memoizedState; - if (null !== d) { - if (null !== d.dehydrated) - return y(G, G.current & 1), (b.flags |= 128), null; - if (0 !== (c & b.child.childLanes)) return vi(a, b, c); - y(G, G.current & 1); - a = Qa(a, b, c); - return null !== a ? a.sibling : null; - } - y(G, G.current & 1); - break; - case 19: - d = 0 !== (c & b.childLanes); - if (0 !== (a.flags & 128)) { - if (d) return xi(a, b, c); - b.flags |= 128; - } - e = b.memoizedState; - null !== e && - ((e.rendering = null), (e.tail = null), (e.lastEffect = null)); - y(G, G.current); - if (d) break; - else return null; - case 22: - case 23: - return (b.lanes = 0), qi(a, b, c); - } - return Qa(a, b, c); - } - function Dc(a, b) { - if (!D) - switch (a.tailMode) { - case "hidden": - b = a.tail; - for (var c = null; null !== b; ) - null !== b.alternate && (c = b), (b = b.sibling); - null === c ? (a.tail = null) : (c.sibling = null); - break; - case "collapsed": - c = a.tail; - for (var d = null; null !== c; ) - null !== c.alternate && (d = c), (c = c.sibling); - null === d - ? b || null === a.tail - ? (a.tail = null) - : (a.tail.sibling = null) - : (d.sibling = null); - } - } - function W(a) { - var b = null !== a.alternate && a.alternate.child === a.child, - c = 0, - d = 0; - if (b) - for (var e = a.child; null !== e; ) - (c |= e.lanes | e.childLanes), - (d |= e.subtreeFlags & 14680064), - (d |= e.flags & 14680064), - (e.return = a), - (e = e.sibling); - else - for (e = a.child; null !== e; ) - (c |= e.lanes | e.childLanes), - (d |= e.subtreeFlags), - (d |= e.flags), - (e.return = a), - (e = e.sibling); - a.subtreeFlags |= d; - a.childLanes = c; - return b; - } - function yk(a, b, c) { - var d = b.pendingProps; - Ve(b); - switch (b.tag) { - case 2: - case 16: - case 15: - case 0: - case 11: - case 7: - case 8: - case 12: - case 9: - case 14: - return W(b), null; - case 1: - return ea(b.type) && (w(S), w(J)), W(b), null; - case 3: - d = b.stateNode; - Tb(); - w(S); - w(J); - lf(); - d.pendingContext && - ((d.context = d.pendingContext), (d.pendingContext = null)); - if (null === a || null === a.child) - pd(b) - ? (b.flags |= 4) - : null === a || - (a.memoizedState.isDehydrated && 0 === (b.flags & 256)) || - ((b.flags |= 1024), null !== wa && (Gf(wa), (wa = null))); - yi(a, b); - W(b); - return null; - case 5: - kf(b); - var e = vb(xc.current); - c = b.type; - if (null !== a && null != b.stateNode) - zk(a, b, c, d, e), - a.ref !== b.ref && ((b.flags |= 512), (b.flags |= 2097152)); - else { - if (!d) { - if (null === b.stateNode) throw Error(n(166)); - W(b); - return null; - } - a = vb(Ea.current); - if (pd(b)) { - d = b.stateNode; - c = b.type; - var f = b.memoizedProps; - d[Da] = b; - d[uc] = f; - a = 0 !== (b.mode & 1); - switch (c) { - case "dialog": - B("cancel", d); - B("close", d); - break; - case "iframe": - case "object": - case "embed": - B("load", d); - break; - case "video": - case "audio": - for (e = 0; e < Ec.length; e++) B(Ec[e], d); - break; - case "source": - B("error", d); - break; - case "img": - case "image": - case "link": - B("error", d); - B("load", d); - break; - case "details": - B("toggle", d); - break; - case "input": - kg(d, f); - B("invalid", d); - break; - case "select": - d._wrapperState = { wasMultiple: !!f.multiple }; - B("invalid", d); - break; - case "textarea": - ng(d, f), B("invalid", d); - } - pe(c, f); - e = null; - for (var g in f) - if (f.hasOwnProperty(g)) { - var h = f[g]; - "children" === g - ? "string" === typeof h - ? d.textContent !== h && - (!0 !== f.suppressHydrationWarning && - jd(d.textContent, h, a), - (e = ["children", h])) - : "number" === typeof h && - d.textContent !== "" + h && - (!0 !== f.suppressHydrationWarning && - jd(d.textContent, h, a), - (e = ["children", "" + h])) - : $b.hasOwnProperty(g) && - null != h && - "onScroll" === g && - B("scroll", d); - } - switch (c) { - case "input": - Pc(d); - mg(d, f, !0); - break; - case "textarea": - Pc(d); - pg(d); - break; - case "select": - case "option": - break; - default: - "function" === typeof f.onClick && (d.onclick = kd); - } - d = e; - b.updateQueue = d; - null !== d && (b.flags |= 4); - } else { - g = 9 === e.nodeType ? e : e.ownerDocument; - "http://www.w3.org/1999/xhtml" === a && (a = qg(c)); - "http://www.w3.org/1999/xhtml" === a - ? "script" === c - ? ((a = g.createElement("div")), - (a.innerHTML = " +
@@ -60,21 +67,8 @@

LoRA Inspector

- - - - - - - - + +
- - - diff --git a/crates/lora-inspector-wasm/package.json b/crates/lora-inspector-wasm/package.json index 7f5a56a..c678683 100644 --- a/crates/lora-inspector-wasm/package.json +++ b/crates/lora-inspector-wasm/package.json @@ -2,13 +2,36 @@ "name": "lora-inspector-wasm", "version": "1.0.0", "description": "", - "main": "playwright.config.js", - "scripts": {}, "keywords": [], "author": "", "license": "ISC", "devDependencies": { + "@biomejs/biome": "1.9.4", "@playwright/test": "^1.41.1", - "@types/node": "^20.11.5" + "@types/node": "^20.11.5", + "autoprefixer": "^10.4.20", + "ava": "^6.2.0", + "cssnano": "^7.0.6", + "postcss": "^8.4.47", + "postcss-cli": "^11.0.0", + "postcss-preset-env": "^10.0.9", + "vite": "^5.4.10", + "vite-plugin-top-level-await": "^1.4.4", + "vite-plugin-wasm": "^3.3.0", + "vite-plugin-wasm-pack": "^0.1.12" + }, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "test": "ava tests", + "preview": "vite preview", + "e2e-test": "ava e2e-tests" + }, + "packageManager": "yarn@4.5.1", + "dependencies": { + "chartist": "^1.3.0", + "react": "^18.3.1", + "react-dom": "^18.3.1" } } diff --git a/crates/lora-inspector-wasm/postcss.config.js b/crates/lora-inspector-wasm/postcss.config.js new file mode 100644 index 0000000..654e984 --- /dev/null +++ b/crates/lora-inspector-wasm/postcss.config.js @@ -0,0 +1,13 @@ +import postcssPresetEnv from "postcss-preset-env"; +import cssnano from "cssnano"; + +export default { + plugins: [ + postcssPresetEnv({ + features: {}, + }), + cssnano({ + preset: "default", + }), + ], +}; diff --git a/crates/lora-inspector-wasm/src/worker.rs b/crates/lora-inspector-wasm/src/worker.rs index 3053d1d..9dbe55c 100644 --- a/crates/lora-inspector-wasm/src/worker.rs +++ b/crates/lora-inspector-wasm/src/worker.rs @@ -10,7 +10,6 @@ use inspector::file::LoRAFile; use inspector::metadata::Metadata; use inspector::network::{NetworkModule, WeightDecomposition}; use inspector::{norms, statistic, InspectorError}; -use std::panic; #[wasm_bindgen] pub struct LoraWorker { diff --git a/crates/lora-inspector-wasm/tests/worker.js b/crates/lora-inspector-wasm/tests/worker.js new file mode 100644 index 0000000..9fce1dc --- /dev/null +++ b/crates/lora-inspector-wasm/tests/worker.js @@ -0,0 +1,175 @@ +import test from "ava"; + +import { + parseSDKey, + SDXL_UNET_SDRE, + SDXL_TE_SDRE, +} from "../assets/js/moduleBlocks.js"; + +// Text Encoder Tests +test("parses text encoder self attention block", (t) => { + const result = parseSDKey("lora_te_text_model_1_self_attn"); + t.is(result.type, "encoder"); + t.is(result.blockId, 1); + t.is(result.blockType, "self_attn"); + t.is(result.name, "TE01"); + t.true(result.isAttention); +}); + +test("parses second text encoder self attention block", (t) => { + const result = parseSDKey( + "lora_te2_text_model_encoder_layers_5_self_attn_q_proj", + ); + console.log(result); + t.is(result.type, "encoder"); + t.is(result.blockId, 5); + t.is(result.blockType, "self_attn"); + t.is(result.name, "TE05"); + t.true(result.isAttention); +}); + +test("parses text encoder mlp block", (t) => { + const result = parseSDKey("lora_te_text_model_2_mlp"); + t.is(result.type, "encoder"); + t.is(result.blockId, 2); + t.is(result.blockType, "mlp"); + t.is(result.name, "TE02"); + t.false(result.isAttention); +}); + +// UNet Down Block Tests +test("parses down block resnet", (t) => { + const result = parseSDKey("down_blocks_0_resnets_1"); + t.is(result.type, "resnets"); + t.is(result.blockType, "down"); + t.is(result.blockId, 0); + t.is(result.subBlockId, 1); + t.is(result.name, "IN01"); + t.true(result.isConv); + t.false(result.isAttention); + t.false(result.isSampler); +}); + +test("parses down block attention", (t) => { + const result = parseSDKey("lora_down_blocks_1_attentions_0"); + t.is(result.type, "attentions"); + t.is(result.blockType, "down"); + t.is(result.blockId, 1); + t.is(result.subBlockId, 0); + t.is(result.name, "IN03"); + t.false(result.isConv); + t.true(result.isAttention); + t.false(result.isSampler); +}); + +// UNet Up Block Tests +test("parses up block resnet", (t) => { + const result = parseSDKey("lora_up_blocks_1_resnets_0"); + t.is(result.type, "resnets"); + t.is(result.blockType, "up"); + t.is(result.blockId, 1); + t.is(result.subBlockId, 0); + t.is(result.name, "OUT03"); + t.true(result.isConv); + t.false(result.isAttention); + t.false(result.isSampler); +}); + +test("parses up block upsampler", (t) => { + const result = parseSDKey("up_blocks_0_upsamplers_0"); + t.is(result.type, "upsamplers"); + t.is(result.blockType, "up"); + t.is(result.blockId, 0); + t.is(result.subBlockId, 0); + t.is(result.name, "OUT02"); + t.false(result.isConv); + t.false(result.isAttention); + t.true(result.isSampler); +}); + +// Mid Block Tests +test("parses mid block resnet", (t) => { + const result = parseSDKey("lora_mid_block_resnets_0_0"); + t.is(result.type, "resnets"); + t.is(result.blockType, "mid"); + t.is(result.blockId, 0); + t.is(result.name, "MID00"); + t.true(result.isConv); + t.false(result.isAttention); +}); + +test("parses mid block attention", (t) => { + const result = parseSDKey("lora_mid_block_attentions_0_0"); + t.is(result.type, "attentions"); + t.is(result.blockType, "mid"); + t.is(result.blockId, 0); + t.is(result.name, "MID00"); + t.false(result.isConv); + t.true(result.isAttention); +}); + +test("parses SDXL unet transformer blocks", (t) => { + const result = parseSDKey( + "lora_unet_output_blocks_2_1_transformer_blocks_0_ff_net_2", + ); + t.is(result.type, "encoder"); + t.is(result.blockId, 1); + t.is(result.blockType, "self_attn"); + t.is(result.name, "TE01"); + t.true(result.isAttention); +}); + +test("should parse different component types", (t) => { + const key = "lora_unet_output_blocks_2_1_transformer_blocks_0_attn_1"; + const matches = key.match(SDXL_UNET_SDRE); + + t.truthy(matches); + t.is(matches.groups.component_type, "attn"); + t.is(matches.groups.component_id, "1"); +}); + +test("should handle various numeric values", (t) => { + const key = "lora_unet_output_blocks_10_2_transformer_blocks_3_ff_net_0"; + const matches = key.match(SDXL_UNET_SDRE); + + t.truthy(matches); + t.is(matches.groups.block_id, "10"); + t.is(matches.groups.subblock_id, "2"); + t.is(matches.groups.transformer_id, "3"); + t.is(matches.groups.component_id, "0"); +}); + +test("should not match invalid formats", (t) => { + const invalidKeys = [ + "lora_unet_invalid_blocks_2_1_transformer_blocks_0_ff_net_2", + "lora_unet_output_blocks_2_transformer_blocks_0_ff_net_2", // missing subblock_id + "lora_unet_output_blocks_2_1_transformer_0_ff_net_2", // incorrect transformer format + ]; + + for (const key in invalidKeys) { + const matches = key.match(SDXL_UNET_SDRE); + t.falsy(matches, `Should not match invalid key: ${key}`); + } +}); + +test("should match different block types", (t) => { + const keys = [ + "lora_unet_input_blocks_1_1_transformer_blocks_0_ff_net_2", + "lora_unet_output_blocks_2_1_transformer_blocks_0_ff_net_2", + "lora_unet_down_blocks_1_1_transformer_blocks_0_ff_net_2", + "lora_unet_up_blocks_1_1_transformer_blocks_0_ff_net_2", + "lora_unet_mid_blocks_1_1_transformer_blocks_0_ff_net_2", + ]; + + for (const key in keys) { + const matches = key.match(SDXL_UNET_SDRE); + t.truthy(matches, `Should match key: ${key}`); + } +}); + +// Invalid Input Test +test("handles invalid input", (t) => { + const result = parseSDKey("invalid_key"); + t.is(result.blockIdx, -1); + t.is(result.name, undefined); +}); diff --git a/crates/lora-inspector-wasm/vite.config.js b/crates/lora-inspector-wasm/vite.config.js new file mode 100644 index 0000000..c562c5e --- /dev/null +++ b/crates/lora-inspector-wasm/vite.config.js @@ -0,0 +1,36 @@ +import { defineConfig } from "vite"; +import wasm from "vite-plugin-wasm"; + +import topLevelAwait from "vite-plugin-top-level-await"; + +export default defineConfig({ + // worker: { + // // Enable classic web workers + // type: "classic", + // }, + plugins: [wasm(), topLevelAwait()], + build: { + // main: { + // entry: resolve(__dirname, "index.html"), + // }, + // lib: { + // // Could also be a dictionary or array of multiple entry points + // entry: resolve(__dirname, "assets/js/lib.js"), + // name: "Inspector", + // // the proper extensions will be added + // fileName: "lora-inspector-lib", + // }, + // rollupOptions: { + // // make sure to externalize deps that shouldn't be bundled + // // into your library + // external: ["vue"], + // output: { + // // Provide global variables to use in the UMD build + // // for externalized deps + // globals: { + // vue: "Vue", + // }, + // }, + // }, + }, +}); diff --git a/index.html b/index.html deleted file mode 100644 index a948285..0000000 --- a/index.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - LoRA Inspector - - - - - - - - - -
-
-
-
-

LoRA Inspector

-

View metadata of your LoRA files, supporting Kohya-ss LoRAs

-
-
- - -
-
-

Metadata is parsed directly in the browser, locally.

-
-
-
-
- - - - - - -
- - - - -