diff --git a/frontend-components/plotly/package-lock.json b/frontend-components/plotly/package-lock.json
index e929f1cdcda9..1d0b054991a3 100644
--- a/frontend-components/plotly/package-lock.json
+++ b/frontend-components/plotly/package-lock.json
@@ -10,6 +10,7 @@
"dependencies": {
"@radix-ui/react-dialog": "^1.0.3",
"dom-to-image": "^2.6.0",
+ "lodash": "^4.17.21",
"plotly.js-dist-min": "^2.21.0",
"posthog-js": "^1.55.0",
"react": "^18.0.0",
@@ -18,6 +19,7 @@
},
"devDependencies": {
"@types/dom-to-image": "^2.6.4",
+ "@types/lodash": "^4.14.195",
"@types/node": "^18.16.3",
"@types/plotly.js-dist-min": "^2.3.1",
"@types/react": "^18.0.27",
@@ -1021,12 +1023,28 @@
"url": "https://opencollective.com/turf"
}
},
+ "node_modules/@types/d3-dsv": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.1.tgz",
+ "integrity": "sha512-76pBHCMTvPLt44wFOieouXcGXWOF0AJCceUvaFkxSZEu4VDUdv93JfpMa6VGNFs01FHfuP4a5Ou68eRG1KBfTw=="
+ },
"node_modules/@types/dom-to-image": {
"version": "2.6.4",
"resolved": "https://registry.npmjs.org/@types/dom-to-image/-/dom-to-image-2.6.4.tgz",
"integrity": "sha512-UddUdGF1qulrSDulkz3K2Ypq527MR6ixlgAzqLbxSiQ0icx0XDlIV+h4+edmjq/1dqn0KgN0xGSe1kI9t+vGuw==",
"dev": true
},
+ "node_modules/@types/estree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz",
+ "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
+ },
+ "node_modules/@types/lodash": {
+ "version": "4.14.195",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz",
+ "integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==",
+ "dev": true
+ },
"node_modules/@types/node": {
"version": "18.16.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.17.tgz",
@@ -1543,8 +1561,7 @@
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
- "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
- "peer": true
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"node_modules/concat-map": {
"version": "0.0.1",
@@ -2085,6 +2102,11 @@
"node": ">=4.0"
}
},
+ "node_modules/estree-walker": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
+ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
+ },
"node_modules/esutils": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
@@ -2658,7 +2680,6 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
- "peer": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3"
},
@@ -2912,6 +2933,11 @@
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
+ "node_modules/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+ },
"node_modules/lodash.merge": {
"version": "4.6.2",
"resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
@@ -3334,7 +3360,6 @@
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
- "dev": true,
"engines": {
"node": ">=8.6"
},
@@ -3962,7 +3987,7 @@
"version": "3.24.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-3.24.1.tgz",
"integrity": "sha512-REHe5dx30ERBRFS0iENPHy+t6wtSEYkjrhwNsLyh3qpRaZ1+aylvMUdMBUHWUD/RjjLmLzEvY8Z9XRlpcdIkHA==",
- "dev": true,
+ "devOptional": true,
"bin": {
"rollup": "dist/bin/rollup"
},
@@ -4000,8 +4025,7 @@
"node_modules/rw": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
- "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
- "peer": true
+ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="
},
"node_modules/safe-buffer": {
"version": "5.2.1",
@@ -4026,8 +4050,7 @@
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
- "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
- "peer": true
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"node_modules/sax": {
"version": "1.2.4",
@@ -4401,6 +4424,14 @@
"topoquantize": "bin/topoquantize"
}
},
+ "node_modules/tosource": {
+ "version": "2.0.0-alpha.3",
+ "resolved": "https://registry.npmjs.org/tosource/-/tosource-2.0.0-alpha.3.tgz",
+ "integrity": "sha512-KAB2lrSS48y91MzFPFuDg4hLbvDiyTjOVgaK7Erw+5AmZXNq4sFRVn8r6yxSLuNs15PaokrDRpS61ERY9uZOug==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/ts-interface-checker": {
"version": "0.1.13",
"resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
diff --git a/frontend-components/plotly/package.json b/frontend-components/plotly/package.json
index 201f02cbc402..1d6ee039e15e 100644
--- a/frontend-components/plotly/package.json
+++ b/frontend-components/plotly/package.json
@@ -12,6 +12,7 @@
"dependencies": {
"@radix-ui/react-dialog": "^1.0.3",
"dom-to-image": "^2.6.0",
+ "lodash": "^4.17.21",
"plotly.js-dist-min": "^2.21.0",
"posthog-js": "^1.55.0",
"react": "^18.0.0",
@@ -20,6 +21,7 @@
},
"devDependencies": {
"@types/dom-to-image": "^2.6.4",
+ "@types/lodash": "^4.14.195",
"@types/node": "^18.16.3",
"@types/plotly.js-dist-min": "^2.3.1",
"@types/react": "^18.0.27",
diff --git a/frontend-components/plotly/src/components/AutoScaling.tsx b/frontend-components/plotly/src/components/AutoScaling.tsx
index 378689963b56..d450cc060895 100644
--- a/frontend-components/plotly/src/components/AutoScaling.tsx
+++ b/frontend-components/plotly/src/components/AutoScaling.tsx
@@ -14,28 +14,41 @@ export default async function autoScaling(
let y_min;
let y_max;
- const YaxisData = graphs.data.filter(
- (trace) => trace.yaxis !== undefined,
- );
+ const get_all_yaxis_traces = {};
+ const get_all_yaxis_annotations = {};
+ let volumeTraceYaxis = null;
+
const yaxis_unique = [
...new Set(
- YaxisData.map(
- (trace) =>
+ graphs.data.map((trace) => {
+ if (
trace.yaxis ||
trace.y !== undefined ||
- trace.type === "candlestick",
- ),
+ trace.type === "candlestick"
+ ) {
+ if (trace.type === "bar" && trace?.name?.trim() === "Volume") {
+ volumeTraceYaxis = `yaxis${trace.yaxis.replace("y", "")}`;
+ }
+ get_all_yaxis_traces[trace.yaxis] =
+ get_all_yaxis_traces[trace.yaxis] || [];
+ get_all_yaxis_traces[trace.yaxis].push(trace);
+ return trace.yaxis;
+ }
+ }),
),
];
- const get_all_yaxis_traces = (yaxis) => {
- return graphs.data.filter(
- (trace) =>
- trace.yaxis === yaxis && (trace.y || trace.type === "candlestick"),
- );
- };
+ graphs.layout.annotations.map((annotation, i) => {
+ if (annotation.yref !== undefined && annotation.yref !== "paper") {
+ annotation.index = i;
+ const yaxis = `yaxis${annotation.yref.replace("y", "")}`;
+ get_all_yaxis_annotations[yaxis] =
+ get_all_yaxis_annotations[yaxis] || [];
+ get_all_yaxis_annotations[yaxis].push(annotation);
+ }
+ });
- yaxis_unique.forEach((unique) => {
+ yaxis_unique.map((unique) => {
if (typeof unique !== "string") {
return;
}
@@ -44,7 +57,7 @@ export default async function autoScaling(
let y_values = [];
let log_scale = graphs.layout[yaxis].type === "log";
- get_all_yaxis_traces(unique).forEach((trace2) => {
+ get_all_yaxis_traces[unique].map((trace2) => {
const x = trace2.x;
log_scale = graphs.layout[yaxis].type === "log";
@@ -62,7 +75,23 @@ export default async function autoScaling(
const yx_values = x.map((x, i) => {
let out = null;
- if (x >= x_min && x <= x_max) {
+ const isoDateRegex = new RegExp(
+ "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",
+ );
+ if (isoDateRegex.test(x)) {
+ const x_time = new Date(x).getTime();
+ const x0_min = new Date(x_min.replace(" ", "T")).getTime();
+ const x1_max = new Date(x_max.replace(" ", "T")).getTime();
+ if (x_time >= x0_min && x_time <= x1_max) {
+ if (trace2.y !== undefined) {
+ out = y[i];
+ }
+ if (trace2.type === "candlestick") {
+ y_candle.push(y_low[i]);
+ y_candle.push(y_high[i]);
+ }
+ }
+ } else if (x >= x_min && x <= x_max) {
if (trace2.y !== undefined) {
out = y[i];
}
@@ -88,10 +117,6 @@ export default async function autoScaling(
}
const org_y_max = y_max;
- const is_volume =
- graphs.layout[yaxis].fixedrange !== undefined &&
- yaxis !== "yaxis" &&
- graphs.layout[yaxis].fixedrange === true;
if (y_min !== undefined && y_max !== undefined) {
const y_range = y_max - y_min;
@@ -103,7 +128,7 @@ export default async function autoScaling(
y_min -= y_range * y_mult;
y_max += y_range * y_mult;
- if (is_volume) {
+ if (yaxis === volumeTraceYaxis) {
if (graphs.layout[yaxis].tickvals !== undefined) {
const range_x = 7;
const volume_ticks = org_y_max;
@@ -137,6 +162,20 @@ export default async function autoScaling(
to_update[`${yaxis}.range`] = [y_min, y_max];
to_update[`${yaxis}.fixedrange`] = true;
yaxis_fixedrange.push(yaxis);
+
+ if (get_all_yaxis_annotations[yaxis] !== undefined) {
+ get_all_yaxis_annotations[yaxis].map((annotation) => {
+ if (annotation.ay !== undefined) {
+ const yshift = annotation.ay;
+ const yshift_new = Math.min(
+ Math.max(yshift, y_min + y_range * 0.2),
+ y_max - y_range * 0.2,
+ );
+
+ to_update[`annotations[${annotation.index}].ay`] = yshift_new;
+ }
+ });
+ }
}
});
diff --git a/frontend-components/plotly/src/components/Chart.tsx b/frontend-components/plotly/src/components/Chart.tsx
index 42f40a2199d4..f418110ef931 100644
--- a/frontend-components/plotly/src/components/Chart.tsx
+++ b/frontend-components/plotly/src/components/Chart.tsx
@@ -1,9 +1,11 @@
// @ts-nocheck
import clsx from "clsx";
+import { debounce } from "lodash";
import * as Plotly from "plotly.js-dist-min";
import { Icons as PlotlyIcons } from "plotly.js-dist-min";
import { usePostHog } from "posthog-js/react";
-import { useEffect, useState } from "react";
+import React, { useCallback, useEffect, useMemo, useState } from "react";
+import { useHotkeys } from "react-hotkeys-hook";
import createPlotlyComponent from "react-plotly.js/factory";
import { init_annotation } from "../utils/addAnnotation";
import { non_blocking, saveImage } from "../utils/utils";
@@ -19,11 +21,52 @@ import { PlotConfig, hideModebar } from "./PlotlyConfig";
import ResizeHandler from "./ResizeHandler";
const Plot = createPlotlyComponent(Plotly);
+class PlotComponent extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ data: props.data,
+ layout: props.layout,
+ frames: props.frames,
+ config: props.config,
+ useResizeHandler: props.useResizeHandler,
+ style: props.style,
+ className: props.className,
+ divId: props.divId,
+ revision: props.revision,
+ graphDiv: props.graphDiv,
+ debug: props.debug,
+ onInitialized: props.onInitialized,
+ };
+ }
+
+ render() {
+ return (
+ this.setState(figure)}
+ onRelayout={(figure) => this.setState(figure)}
+ onPurge={(figure) => this.setState(figure)}
+ />
+ );
+ }
+}
function CreateDataXrange(data: Plotly.PlotData[], xrange?: any) {
if (!xrange) {
xrange = [
- data[0]?.x[data[0].x.length - 1000],
+ data[0]?.x[data[0].x.length - 2000],
data[0]?.x[data[0].x.length - 1],
];
}
@@ -43,7 +86,17 @@ function CreateDataXrange(data: Plotly.PlotData[], xrange?: any) {
const xaxis = trace.x ? trace.x : [];
const chunks = [];
for (let i = 0; i < xaxis.length; i++) {
- if (xaxis[i] >= xrange[0] && xaxis[i] <= xrange[1]) {
+ const isoDateRegex = new RegExp(
+ "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",
+ );
+ if (isoDateRegex.test(xaxis[i])) {
+ const x_time = new Date(xaxis[i]).getTime();
+ const x0_min = new Date(xrange[0].replace(" ", "T")).getTime();
+ const x1_max = new Date(xrange[1].replace(" ", "T")).getTime();
+ if (x_time >= x0_min && x_time <= x1_max) {
+ chunks.push(i);
+ }
+ } else if (xaxis[i] >= xrange[0] && xaxis[i] <= xrange[1]) {
chunks.push(i);
}
}
@@ -83,16 +136,15 @@ async function DynamicLoad({
);
if (XDATA.length === 0) return figure;
- // We get the xaxis range, if no event is passed, we get the last 1000 points
+ // We get the xaxis range, if no event is passed, we get the last 2000 points
const xaxis_range = event
? [event["xaxis.range[0]"], event["xaxis.range[1]"]]
: [
- XDATA[0]?.x[XDATA[0].x.length - 1000],
+ XDATA[0]?.x[XDATA[0].x.length - 2000],
XDATA[0]?.x[XDATA[0].x.length - 1],
];
- const new_data = CreateDataXrange(figure.data, xaxis_range);
- figure.data = new_data;
+ figure.data = CreateDataXrange(figure.data, xaxis_range);
figure.layout.xaxis.range = xaxis_range;
return figure;
} catch (e) {
@@ -100,7 +152,7 @@ async function DynamicLoad({
}
}
-export default function Chart({
+function Chart({
json,
date,
cmd,
@@ -156,37 +208,104 @@ export default function Chart({
const [yaxisFixedRange, setYaxisFixedRange] = useState([]);
const onClose = () => setModal({ name: "" });
+ useHotkeys(
+ "ctrl+shift+t",
+ () => {
+ setModal({ name: "titleDialog" });
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+t",
+ () => {
+ setModal({ name: "textDialog" });
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+o",
+ () => {
+ setModal({ name: "overlayChart" });
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ ["ctrl+shift+h", "ctrl+h"],
+ () => {
+ hideModebar();
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+e",
+ () => {
+ changeColor(true);
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+shift+s",
+ async () => {
+ setModal({ name: "downloadCsv" });
+ await downloadCSV(
+ document.getElementById("plotlyChart") as any,
+ downloadFinished,
+ );
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+s",
+ async () => {
+ hideModebar();
+ downloadImage("MainChart", hideModebar, Loading, downloadFinished);
+ },
+ { preventDefault: true },
+ );
+ useHotkeys(
+ "ctrl+w",
+ () => {
+ window.close();
+ },
+ { preventDefault: true },
+ );
// @ts-ignore
- function onDeleteAnnotation(annotation) {
- console.log("onDeleteAnnotation", annotation);
- const index = plotData?.layout?.annotations?.findIndex(
- (a: any) => a.text === annotation.text,
- );
- console.log("index", index);
- if (index > -1) {
- plotData?.layout?.annotations?.splice(index, 1);
- setPlotData({ ...plotData });
- setAnnotations(plotData?.layout?.annotations);
- }
- }
+ const onDeleteAnnotation = useCallback(
+ (annotation) => {
+ console.log("onDeleteAnnotation", annotation);
+ const index = plotData?.layout?.annotations?.findIndex(
+ (a: any) => a.text === annotation.text,
+ );
+ console.log("index", index);
+ if (index > -1) {
+ plotData?.layout?.annotations?.splice(index, 1);
+ setPlotData({ ...plotData });
+ setAnnotations(plotData?.layout?.annotations);
+ }
+ },
+ [plotData],
+ );
// @ts-ignore
- function onAddAnnotation(data) {
- init_annotation({
- plotData,
- popupData: data,
- setPlotData,
- setModal,
- setOnAnnotationClick,
- setAnnotations,
- onAnnotationClick,
- ohlcAnnotation,
- setOhlcAnnotation,
- annotations,
- plotDiv,
- });
- }
+ const onAddAnnotation = useCallback(
+ (data) => {
+ init_annotation({
+ plotData,
+ popupData: data,
+ setPlotData,
+ setModal,
+ setOnAnnotationClick,
+ setAnnotations,
+ onAnnotationClick,
+ ohlcAnnotation,
+ setOhlcAnnotation,
+ annotations,
+ plotDiv,
+ });
+ },
+ [plotData, onAnnotationClick, ohlcAnnotation, annotations, plotDiv],
+ );
useEffect(() => {
if (downloadFinished) {
@@ -195,6 +314,12 @@ export default function Chart({
}
}, [downloadFinished]);
+ useEffect(() => {
+ if (plotDiv) {
+ Plotly.update(plotDiv, plotData.data, plotData.layout, plotData.config);
+ }
+ }, [plotData]);
+
useEffect(() => {
if (axesTitles && Object.keys(axesTitles).length > 0) {
Object.keys(axesTitles).forEach((k) => {
@@ -240,8 +365,30 @@ export default function Chart({
}
setModeBarButtons({ ...barButtons, [title]: button });
}
+ const debouncedDynamicLoad = useCallback(
+ debounce(async (eventData, figure) => {
+ if (dateSliced) {
+ const data = { ...figure };
+ await DynamicLoad({
+ event: eventData,
+ figure: data,
+ }).then(async (toUpdate) => {
+ setPlotData(toUpdate);
+ Plotly.react(plotDiv, toUpdate.data, toUpdate.layout);
+ const scaled = await autoScaling(eventData, plotDiv);
+ setYaxisFixedRange(scaled.yaxis_fixedrange);
+ Plotly.update(plotDiv, {}, scaled.to_update);
+ });
+ } else {
+ const scaled = await autoScaling(eventData, plotDiv);
+ setYaxisFixedRange(scaled.yaxis_fixedrange);
+ Plotly.update(plotDiv, {}, scaled.to_update);
+ }
+ }, 150),
+ [setPlotData, plotDiv, setYaxisFixedRange, dateSliced],
+ );
- function autoscaleButton() {
+ const autoscaleButton = useCallback(() => {
// We need to check if the button is active or not
const title = "Auto Scale (Ctrl+Shift+A)";
const button =
@@ -253,26 +400,10 @@ export default function Chart({
active = false;
plotDiv.on(
"plotly_relayout",
- non_blocking(async function (eventdata) {
+ debounce(async (eventdata) => {
if (eventdata["xaxis.range[0]"] === undefined) return;
- if (dateSliced) {
- const data = { ...originalData };
- await DynamicLoad({
- event: eventdata,
- figure: data,
- }).then(async (to_update) => {
- setPlotData(to_update);
- Plotly.react(plotDiv, to_update.data, to_update.layout);
- const scaled = await autoScaling(eventdata, plotDiv);
- setYaxisFixedRange(scaled.yaxis_fixedrange);
- Plotly.update(plotDiv, {}, scaled.to_update);
- });
- } else {
- const scaled = await autoScaling(eventdata, plotDiv);
- setYaxisFixedRange(scaled.yaxis_fixedrange);
- Plotly.update(plotDiv, {}, scaled.to_update);
- }
- }, 100),
+ debouncedDynamicLoad(eventdata, originalData);
+ }, 500),
);
}
// If the button isn't active, we remove the listener so
@@ -286,23 +417,23 @@ export default function Chart({
if (dateSliced) {
plotDiv.on(
"plotly_relayout",
- non_blocking(async function (eventdata) {
+ debounce(async (eventdata) => {
if (eventdata["xaxis.range[0]"] === undefined) return;
- const data = { ...originalData };
- await DynamicLoad({
- event: eventdata,
- figure: data,
- }).then(async (to_update) => {
- setPlotData(to_update);
- Plotly.react(plotDiv, to_update.data, to_update.layout);
- });
- }, 100),
+ debouncedDynamicLoad(eventdata, originalData);
+ }, 500),
);
}
}
button_pressed(title, active);
- }
+ }, [
+ barButtons,
+ dateSliced,
+ debouncedDynamicLoad,
+ originalData,
+ plotDiv,
+ yaxisFixedRange,
+ ]);
function changecolorButton() {
// We need to check if the button is active or not
@@ -339,15 +470,15 @@ export default function Chart({
if (changeTheme) {
try {
console.log("changeTheme", changeTheme);
- const TRACES = plotData?.data.filter(
+ const TRACES = originalData?.data.filter(
(trace) => trace?.name?.trim() === "Volume",
);
const darkmode = !darkMode;
window.document.body.style.backgroundColor = darkmode ? "#000" : "#fff";
- plotData.layout.font = {
- ...(plotData.layout.font || {}),
+ originalData.layout.font = {
+ ...(originalData.layout.font || {}),
color: darkmode ? "#fff" : "#000",
};
@@ -380,11 +511,11 @@ export default function Chart({
return volumeColors[color] || color;
});
});
- plotData.layout.template = darkmode
+ originalData.layout.template = darkmode
? DARK_CHARTS_TEMPLATE
: LIGHT_CHARTS_TEMPLATE;
- setPlotData({ ...plotData });
- Plotly.react(plotDiv, plotData.data, plotData.layout);
+ setPlotData({ ...originalData });
+ Plotly.react(plotDiv, originalData.data, originalData.layout);
setDarkMode(darkmode);
setChangeTheme(false);
} catch (e) {
@@ -487,7 +618,7 @@ export default function Chart({
if (Object.keys(layout_update).length > 0) {
setPlotData(newPlotData);
setVolumeBars(volume_update);
- Plotly.relayout(plotDiv, layout_update);
+ Plotly.update(plotDiv, {}, layout_update);
}
});
@@ -500,7 +631,7 @@ export default function Chart({
);
if (
(originalData.data[0]?.x !== undefined &&
- originalData.data[0]?.x.length <= 1000) ||
+ originalData.data[0]?.x.length <= 2000) ||
!traceTypes.includes(true)
)
return;
@@ -508,7 +639,7 @@ export default function Chart({
name: "alertDialog",
data: {
title: "Warning",
- content: `Data has been truncated to 1000 points for performance reasons.
+ content: `Data has been truncated to 2000 points for performance reasons.
Please use the zoom tool to see more data.`,
},
});
@@ -519,6 +650,123 @@ export default function Chart({
}
}, [plotLoaded]);
+ const plotComponent = useMemo(
+ () => (
+ {
+ if (!plotDiv) {
+ const plot = document.getElementById("plotlyChart");
+ console.log("plot", plot);
+ if (plot) setPlotDiv(plot);
+ plot.globals = globals;
+ }
+ if (!plotLoaded) setPlotLoaded(true);
+ }}
+ className="w-full h-full"
+ divId="plotlyChart"
+ data={plotData.data}
+ layout={plotData.layout}
+ config={PlotConfig({
+ setModal: setModal,
+ changeTheme: setChangeTheme,
+ autoScaling: setAutoScaling,
+ Loading: setLoading,
+ changeColor: setChangeColor,
+ downloadFinished: setDownloadFinished,
+ })}
+ />
+ ),
+ [
+ plotDiv,
+ originalData,
+ plotLoaded,
+ plotData,
+ globals,
+ setPlotDiv,
+ setPlotLoaded,
+ setModal,
+ setChangeTheme,
+ setAutoScaling,
+ setLoading,
+ onChangeColor,
+ setDownloadFinished,
+ ],
+ );
+
+ const memoizedAlertDialog = useMemo(() => {
+ return (
+
+ );
+ }, [modal, onClose]);
+
+ const memoizedOverlayChartDialog = useMemo(() => {
+ return (
+ {
+ console.log(overlay);
+ overlay.layout.showlegend = true;
+ setOriginalData(overlay);
+ setPlotData(overlay);
+ Plotly.react(plotDiv, overlay.data, overlay.layout);
+ }}
+ plotlyData={originalData}
+ setLoading={setLoading}
+ open={modal?.name === "overlayChart"}
+ close={onClose}
+ />
+ );
+ }, [modal, plotData, onClose, setPlotData, setLoading]);
+
+ const memoizedTitleChartDialog = useMemo(() => {
+ return (
+ setChartTitle(title)}
+ updateAxesTitles={(axesTitles) => setAxesTitles(axesTitles)}
+ defaultTitle={chartTitle}
+ plotlyData={plotData}
+ open={modal?.name === "titleDialog"}
+ close={onClose}
+ />
+ );
+ }, [modal, plotData, chartTitle, onClose]);
+
+ const memoizedTextChartDialog = useMemo(() => {
+ return (
+ onAddAnnotation(data)}
+ deleteAnnotation={(data) => onDeleteAnnotation(data)}
+ />
+ );
+ }, [
+ modal,
+ onAddAnnotation,
+ onDeleteAnnotation,
+ onClose,
+ plotData,
+ setPlotData,
+ ]);
+
+ const memoizedChangeColor = useMemo(() => {
+ return ;
+ }, [colorActive, onChangeColor]);
+
+ const memoizedDownloadFinishedDialog = useMemo(() => {
+ return (
+
+ );
+ }, [modal, onClose]);
+
return (
{loading && (
@@ -549,44 +797,12 @@ export default function Chart({
-
- {
- console.log(overlay);
- plotData.layout.showlegend = true;
- setPlotData(overlay);
- setPlotLoaded(false);
- }}
- plotlyData={plotData}
- setLoading={setLoading}
- open={modal.name === "overlayChart"}
- close={onClose}
- />
- setChartTitle(title)}
- updateAxesTitles={(axesTitles) => setAxesTitles(axesTitles)}
- defaultTitle={chartTitle}
- plotlyData={plotData}
- open={modal.name === "titleDialog"}
- close={onClose}
- />
- onAddAnnotation(data)}
- deleteAnnotation={(data) => onDeleteAnnotation(data)}
- />
-
-
+ {memoizedAlertDialog}
+ {memoizedOverlayChartDialog}
+ {memoizedTitleChartDialog}
+ {memoizedTextChartDialog}
+ {memoizedChangeColor}
+ {memoizedDownloadFinishedDialog}
@@ -632,31 +848,11 @@ export default function Chart({
"h-[calc(100%-50px)]": !maximizePlot,
})}
>
-
{
- if (!plotDiv) {
- const plot = document.getElementById("plotlyChart");
- console.log("plot", plot);
- if (plot) setPlotDiv(plot);
- plot.globals = globals;
- }
- if (!plotLoaded) setPlotLoaded(true);
- }}
- className="w-full h-full"
- divId="plotlyChart"
- data={plotData.data}
- layout={plotData.layout}
- config={PlotConfig({
- setModal: setModal,
- changeTheme: setChangeTheme,
- autoScaling: setAutoScaling,
- Loading: setLoading,
- changeColor: setChangeColor,
- downloadFinished: setDownloadFinished,
- })}
- />
+ {plotComponent}
);
}
+
+export default React.memo(Chart);
diff --git a/frontend-components/plotly/src/components/Dialogs/OverlayChartDialog.tsx b/frontend-components/plotly/src/components/Dialogs/OverlayChartDialog.tsx
index 11a9f903c373..ca3da283aa5b 100644
--- a/frontend-components/plotly/src/components/Dialogs/OverlayChartDialog.tsx
+++ b/frontend-components/plotly/src/components/Dialogs/OverlayChartDialog.tsx
@@ -59,7 +59,7 @@ export default function OverlayChartDialog({
}
function onSubmit() {
- if (csvData.length == 0) {
+ if (csvData.length === 0) {
document.getElementById("csv_file")?.focus();
document
.getElementById("csv_file")
diff --git a/frontend-components/plotly/src/components/PlotlyConfig.tsx b/frontend-components/plotly/src/components/PlotlyConfig.tsx
index e5649cad90c2..6ede8a00652a 100644
--- a/frontend-components/plotly/src/components/PlotlyConfig.tsx
+++ b/frontend-components/plotly/src/components/PlotlyConfig.tsx
@@ -1,20 +1,20 @@
import { Icons as PlotlyIcons } from "plotly.js-dist-min";
-import { ICONS } from "./Config";
-import { useHotkeys } from "react-hotkeys-hook";
import { downloadCSV, downloadImage } from "../utils/utils";
+import { ICONS } from "./Config";
-export function hideModebar(hide = true) {
+export function hideModebar(hide?: boolean) {
return new Promise((resolve) => {
if (!window.MODEBAR) {
window.MODEBAR = window.document.getElementsByClassName(
- "modebar-container"
+ "modebar-container",
)[0] as HTMLElement;
window.MODEBAR.style.cssText = `${window.MODEBAR.style.cssText}; display:flex;`;
}
- let includes_text = "display: none";
+
if (window.MODEBAR) {
- if (window.MODEBAR.style.cssText.includes("display: none") || !hide) {
- includes_text = "display: flex";
+ if (hide) {
+ window.MODEBAR.style.cssText = `${window.MODEBAR.style.cssText}; display:none;`;
+ } else if (window.MODEBAR.style.cssText.includes("none")) {
window.MODEBAR.style.cssText = `${window.MODEBAR.style.cssText}; display:flex;`;
} else {
window.MODEBAR.style.cssText = `${window.MODEBAR.style.cssText}; display:none;`;
@@ -39,65 +39,6 @@ export function PlotConfig({
changeColor: (change: boolean) => void;
downloadFinished: (change: boolean) => void;
}) {
- useHotkeys(
- "ctrl+shift+t",
- () => {
- setModal({ name: "titleDialog" });
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+t",
- () => {
- setModal({ name: "textDialog" });
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+o",
- () => {
- setModal({ name: "overlayChart" });
- },
- { preventDefault: true }
- );
- useHotkeys(
- ["ctrl+shift+h", "ctrl+h"],
- () => {
- hideModebar();
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+e",
- () => {
- changeColor(true);
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+shift+s",
- async () => {
- setModal({ name: "downloadCsv" });
- await downloadCSV(document.getElementById("plotlyChart") as any, downloadFinished);
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+s",
- async () => {
- hideModebar();
- downloadImage("MainChart", hideModebar, Loading, downloadFinished);
- },
- { preventDefault: true }
- );
- useHotkeys(
- "ctrl+w",
- () => {
- window.close();
- },
- { preventDefault: true }
- );
-
const CONFIG = {
plotGlPixelRatio: 1,
scrollZoom: true,
@@ -118,8 +59,13 @@ export function PlotConfig({
name: "Download Chart as Image (Ctrl+S)",
icon: ICONS.downloadImage,
click: async function () {
- hideModebar();
- await downloadImage("MainChart", hideModebar, Loading, downloadFinished);
+ hideModebar(true);
+ await downloadImage(
+ "MainChart",
+ hideModebar,
+ Loading,
+ downloadFinished,
+ );
},
},
// {
diff --git a/frontend-components/plotly/src/components/ResizeHandler.tsx b/frontend-components/plotly/src/components/ResizeHandler.tsx
index c916d1bbacdc..0db916ff3dfa 100644
--- a/frontend-components/plotly/src/components/ResizeHandler.tsx
+++ b/frontend-components/plotly/src/components/ResizeHandler.tsx
@@ -32,7 +32,7 @@ export default async function ResizeHandler({
const tick_size =
height > 420 && width < 920 ? 8 : height > 420 && width < 500 ? 9 : 7;
- if (width < 750) {
+ if (width < 850) {
// We hide the modebar and set the number of ticks to 6
TRACES.forEach((trace) => {
@@ -57,8 +57,11 @@ export default async function ResizeHandler({
});
setMaximizePlot(true);
- await hideModebar();
- } else if (window.MODEBAR.style.cssText.includes("display: none")) {
+ await hideModebar(true);
+ } else if (
+ width > 850 &&
+ window.MODEBAR.style.cssText.includes("display: none")
+ ) {
// We show the modebar
await hideModebar(false);
setMaximizePlot(false);
diff --git a/frontend-components/plotly/src/main.tsx b/frontend-components/plotly/src/main.tsx
index 5f039b2d09d7..2e3b7c31099c 100644
--- a/frontend-components/plotly/src/main.tsx
+++ b/frontend-components/plotly/src/main.tsx
@@ -1,11 +1,6 @@
-import React from "react";
import * as ReactDOM from "react-dom/client";
import App from "./App";
import "./index.css";
const rootElement = document.getElementById("root") as HTMLElement;
-ReactDOM.createRoot(rootElement).render(
-
-
- ,
-);
+ReactDOM.createRoot(rootElement).render();
diff --git a/frontend-components/plotly/src/utils/addAnnotation.tsx b/frontend-components/plotly/src/utils/addAnnotation.tsx
index 261fa2e9b8e4..eb5ee192506b 100644
--- a/frontend-components/plotly/src/utils/addAnnotation.tsx
+++ b/frontend-components/plotly/src/utils/addAnnotation.tsx
@@ -28,28 +28,28 @@ export function add_annotation({
popup_data: PopupData;
current_text?: string;
}) {
- let x = popup_data.x;
+ const x = popup_data.x;
let y = popup_data.y;
- let yref = popup_data.yref;
- let annotations = plotData?.layout?.annotations || [];
+ const yref = popup_data.yref;
+ const annotations = plotData?.layout?.annotations || [];
let index = -1;
for (let i = 0; i < annotations.length; i++) {
if (
- annotations[i].x == x &&
- annotations[i].y == y &&
- annotations[i].text == current_text
+ annotations[i].x === x &&
+ annotations[i].y === y &&
+ annotations[i].text === current_text
) {
index = i;
break;
}
}
- if (popup_data.high != undefined) {
- y = popup_data.yanchor == "above" ? popup_data.high : popup_data.low;
+ if (popup_data.high !== undefined) {
+ y = popup_data.yanchor === "above" ? popup_data.high : popup_data.low;
}
- if (index == -1) {
- let annotation: Annotations = {
+ if (index === -1) {
+ const annotation: Annotations = {
x: x,
y: y,
xref: "x",
@@ -109,19 +109,19 @@ export function plot_text({
console.log("plot_text: current_text", current_text);
let output = undefined;
- let yaxis = popup_data.yref.replace("y", "yaxis");
- let yrange = plotData.layout[yaxis].range;
+ const yaxis = popup_data.yref.replace("y", "yaxis");
+ const yrange = plotData.layout[yaxis].range;
let yshift = (yrange[1] - yrange[0]) * 0.2;
- if (popup_data.yanchor == "below") {
+ if (popup_data.yanchor === "below") {
yshift = -yshift;
}
popup_data.yshift = yshift;
output = add_annotation({ plotData, popup_data, current_text });
- let to_update = { annotations: output.annotations, dragmode: "pan" };
- to_update[yaxis + ".type"] = "linear";
+ const to_update = { annotations: output.annotations, dragmode: "pan" };
+ to_update[`${yaxis}.type`] = "linear";
return { update: to_update, annotation: output.annotation };
}
@@ -150,7 +150,7 @@ export function init_annotation({
annotations: Annotations[];
plotDiv: PlotlyHTMLElement;
}) {
- if (popupData.text != undefined && popupData.text != "") {
+ if (popupData.text !== undefined && popupData.text !== "") {
popupData.text = popupData.text.replace(/\n/g, "
");
let popup_data: Partial;
let inOhlc = false;
@@ -165,11 +165,11 @@ export function init_annotation({
popupData.annotation.y < popupData.annotation.ay ? "above" : "below",
...popupData,
};
- if (popupData.annotation.high != undefined) {
+ if (popupData.annotation.high !== undefined) {
inOhlc = true;
}
console.log("popup_data", popup_data);
- let to_update = plot_text({
+ const to_update = plot_text({
plotData,
popup_data: popup_data as PopupData,
current_text: popupData.annotation.text,
@@ -177,14 +177,14 @@ export function init_annotation({
if (inOhlc) {
// we update the ohlcAnnotation
- let ohlcAnnotationIndex = ohlcAnnotation.findIndex(
+ const ohlcAnnotationIndex = ohlcAnnotation.findIndex(
(a) =>
- a.x == popupData.annotation.x &&
- a.y == popupData.annotation.y &&
- a.yref == popupData.annotation.yref
+ a.x === popupData.annotation.x &&
+ a.y === popupData.annotation.y &&
+ a.yref === popupData.annotation.yref,
);
console.log("ohlcAnnotationIndex", ohlcAnnotationIndex);
- if (ohlcAnnotationIndex == -1) {
+ if (ohlcAnnotationIndex === -1) {
// we add the annotation to the ohlcAnnotation array
setOhlcAnnotation([...ohlcAnnotation, to_update.annotation]);
} else {
@@ -195,7 +195,7 @@ export function init_annotation({
}
setAnnotations(
- [...annotations, to_update.annotation].filter((a) => a != undefined)
+ [...annotations, to_update.annotation].filter((a) => a !== undefined),
);
plotData.layout.dragmode = "pan";
setPlotData({ ...plotData, ...to_update.update });
@@ -206,9 +206,9 @@ export function init_annotation({
plotDiv.on("plotly_clickannotation", (eventData) => {
console.log("plotly_clickannotation", eventData);
- let annotation = eventData.annotation;
+ const annotation = eventData.annotation;
- if (annotation.text == undefined) {
+ if (annotation.text === undefined) {
console.log("annotation.text is undefined");
return;
}
@@ -216,7 +216,7 @@ export function init_annotation({
// we replace
with \n so that the textarea can display the text properly
annotation.text = annotation.text.replace(/
/g, "\n");
- let popup_data = {
+ const popup_data = {
x: annotation.x,
y: annotation.y,
high: annotation?.high ?? undefined,
@@ -237,19 +237,20 @@ export function init_annotation({
function clickHandler(eventData: PlotMouseEvent) {
console.log("plotly_click", eventData);
- let x = eventData.points[0].x;
- let yaxis = eventData.points[0].fullData.yaxis;
+ const x = eventData.points[0].x;
+ const yaxis = eventData.points[0].fullData.yaxis;
let y = 0;
- let high, low;
+ let high;
+ let low;
// We need to check if the trace is a candlestick or not
// this is because the y value is stored in the high or low
- if (eventData.points[0].y != undefined) {
+ if (eventData.points[0].y !== undefined) {
y = eventData.points[0].y;
- } else if (eventData.points[0].low != undefined) {
+ } else if (eventData.points[0].low !== undefined) {
high = eventData.points[0].high;
low = eventData.points[0].low;
- if (popup_data?.yanchor == "below") {
+ if (popup_data?.yanchor === "below") {
y = eventData.points[0].low;
} else {
y = eventData.points[0].high;
@@ -265,21 +266,21 @@ export function init_annotation({
...popupData,
};
- if (high != undefined) {
+ if (high !== undefined) {
// save the annotation to use later
ohlcAnnotation.push(popup_data);
setOhlcAnnotation(ohlcAnnotation);
console.log("ohlcAnnotation", ohlcAnnotation);
}
- let to_update = plot_text({
+ const to_update = plot_text({
plotData,
popup_data: popup_data as PopupData,
current_text: onAnnotationClick?.annotation?.text,
});
setAnnotations(
- [...annotations, to_update.annotation].filter((a) => a != undefined)
+ [...annotations, to_update.annotation].filter((a) => a !== undefined),
);
plotData.layout.dragmode = "pan";
setPlotData({ ...plotData, ...to_update.update });
diff --git a/frontend-components/plotly/src/utils/utils.ts b/frontend-components/plotly/src/utils/utils.ts
index c1710524977d..e292c09980e3 100644
--- a/frontend-components/plotly/src/utils/utils.ts
+++ b/frontend-components/plotly/src/utils/utils.ts
@@ -4,379 +4,381 @@ import * as Plotly from "plotly.js-dist-min";
import { Figure } from "react-plotly.js";
const exportNativeFileSystem = async ({
- fileHandle,
- blob,
+ fileHandle,
+ blob,
}: {
- fileHandle?: FileSystemFileHandle | null;
- blob: Blob;
+ fileHandle?: FileSystemFileHandle | null;
+ blob: Blob;
}) => {
- if (!fileHandle) {
- return;
- }
+ if (!fileHandle) {
+ return;
+ }
- return writeFileHandler({ fileHandle, blob });
+ return writeFileHandler({ fileHandle, blob });
};
const writeFileHandler = async ({
- fileHandle,
- blob,
+ fileHandle,
+ blob,
}: {
- fileHandle: FileSystemFileHandle;
- blob: Blob;
+ fileHandle: FileSystemFileHandle;
+ blob: Blob;
}) => {
- const writer = await fileHandle.createWritable();
- await writer.write(blob);
- await writer.close();
+ const writer = await fileHandle.createWritable();
+ await writer.write(blob);
+ await writer.close();
};
const IMAGE_TYPE: FilePickerAcceptType[] = [
- {
- description: "PNG Image",
- accept: {
- "image/png": [".png"],
- },
- },
- {
- description: "JPEG Image",
- accept: {
- "image/jpeg": [".jpeg"],
- },
- },
- {
- description: "SVG Image",
- accept: {
- "image/svg+xml": [".svg"],
- },
- },
+ {
+ description: "PNG Image",
+ accept: {
+ "image/png": [".png"],
+ },
+ },
+ {
+ description: "JPEG Image",
+ accept: {
+ "image/jpeg": [".jpeg"],
+ },
+ },
+ {
+ description: "SVG Image",
+ accept: {
+ "image/svg+xml": [".svg"],
+ },
+ },
];
const getNewFileHandle = ({
- filename,
- is_image,
+ filename,
+ is_image,
}: {
- filename: string;
- is_image?: boolean;
+ filename: string;
+ is_image?: boolean;
}): Promise => {
- try {
- if ("showSaveFilePicker" in window) {
- const opts: SaveFilePickerOptions = {
- suggestedName: filename,
- types: is_image
- ? IMAGE_TYPE
- : [
- {
- description: "CSV File",
- accept: {
- "image/csv": [".csv"],
- },
- },
- ],
- excludeAcceptAllOption: true,
- };
-
- return showSaveFilePicker(opts);
- }
- } catch (error) {
- console.error(error);
- }
-
- return new Promise((resolve) => {
- resolve(null);
- });
+ try {
+ if ("showSaveFilePicker" in window) {
+ const opts: SaveFilePickerOptions = {
+ suggestedName: filename,
+ types: is_image
+ ? IMAGE_TYPE
+ : [
+ {
+ description: "CSV File",
+ accept: {
+ "image/csv": [".csv"],
+ },
+ },
+ ],
+ excludeAcceptAllOption: true,
+ };
+
+ return showSaveFilePicker(opts);
+ }
+ } catch (error) {
+ console.error(error);
+ }
+
+ return new Promise((resolve) => {
+ resolve(null);
+ });
};
export const saveToFile = (
- blob: Blob,
- fileName: string,
- fileHandle?: FileSystemFileHandle | null,
+ blob: Blob,
+ fileName: string,
+ fileHandle?: FileSystemFileHandle | null,
) => {
- try {
- if (fileHandle === null) {
- throw new Error("Cannot access filesystem");
- }
- return exportNativeFileSystem({ fileHandle, blob });
- } catch (error) {
- console.error("oops, something went wrong!", error);
- const url = URL.createObjectURL(blob);
- const link = document.createElement("a");
- link.setAttribute("href", url);
- link.setAttribute("download", fileName);
- link.style.visibility = "hidden";
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- }
- return new Promise((resolve) => {
- resolve(true);
- });
+ try {
+ if (fileHandle === null) {
+ throw new Error("Cannot access filesystem");
+ }
+ return exportNativeFileSystem({ fileHandle, blob });
+ } catch (error) {
+ console.error("oops, something went wrong!", error);
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.setAttribute("href", url);
+ link.setAttribute("download", fileName);
+ link.style.visibility = "hidden";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ }
+ return new Promise((resolve) => {
+ resolve(true);
+ });
};
export async function downloadCSV(
- gd: Figure,
- downloadFinished: (change: boolean) => void,
+ gd: Figure,
+ downloadFinished: (change: boolean) => void,
) {
- const data = gd.data;
- let columns: string[] = [];
- const rows: any[] = [];
-
- const xaxis =
- "title" in gd.layout["xaxis"] &&
- gd.layout["xaxis"]["title"]["text"] !== undefined
- ? gd.layout["xaxis"]["title"]["text"]
- : "x";
-
- const yaxis =
- "title" in gd.layout["yaxis"] &&
- gd.layout["yaxis"]["title"]["text"] !== undefined
- ? gd.layout["yaxis"]["title"]["text"]
- : "y";
-
- data.forEach(function (trace) {
- if (trace.type === "candlestick") {
- if (columns.length === 0) {
- columns = ["Date", "Open", "High", "Low", "Close"];
- }
- trace.x.forEach(function (x, i) {
- rows.push([
- x,
- trace.open[i],
- trace.high[i],
- trace.low[i],
- trace.close[i],
- ]);
- });
- }
-
- if (["scatter", "bar"].includes(trace.type)) {
- if (columns.length === 0) {
- columns.push(xaxis);
- }
- columns.push(trace.name !== undefined ? trace.name : yaxis);
- trace.x.forEach(function (x, i) {
- if (rows[i] === undefined) {
- rows[i] = [x];
- }
- rows[i].push(trace.y[i]);
- });
- }
- });
-
- return await downloadData(columns, rows, downloadFinished);
+ const data = gd.data;
+ let columns: string[] = [];
+ const rows: any[] = [];
+
+ const xaxis =
+ "title" in gd.layout["xaxis"] &&
+ gd.layout["xaxis"]["title"]["text"] !== undefined
+ ? gd.layout["xaxis"]["title"]["text"]
+ : "x";
+
+ const yaxis =
+ "title" in gd.layout["yaxis"] &&
+ gd.layout["yaxis"]["title"]["text"] !== undefined
+ ? gd.layout["yaxis"]["title"]["text"]
+ : "y";
+
+ data.forEach(function (trace) {
+ if (trace.type === "candlestick") {
+ if (columns.length === 0) {
+ columns = ["Date", "Open", "High", "Low", "Close"];
+ }
+ trace.x.forEach(function (x, i) {
+ rows.push([
+ x,
+ trace.open[i],
+ trace.high[i],
+ trace.low[i],
+ trace.close[i],
+ ]);
+ });
+ }
+
+ if (["scatter", "bar"].includes(trace.type)) {
+ if (columns.length === 0) {
+ columns.push(xaxis);
+ }
+ columns.push(trace.name !== undefined ? trace.name : yaxis);
+ trace.x.forEach(function (x, i) {
+ if (rows[i] === undefined) {
+ rows[i] = [x];
+ }
+ rows[i].push(trace.y[i]);
+ });
+ }
+ });
+
+ return await downloadData(columns, rows, downloadFinished);
}
export async function downloadData(
- columns: any,
- data: any,
- downloadFinished: (change: boolean) => void,
+ columns: any,
+ data: any,
+ downloadFinished: (change: boolean) => void,
) {
- const headers = columns;
- const rows = data.map((row: any) =>
- row.map((cell: any) => {
- if (cell == null) {
- return "";
- } else if (typeof cell === "object") {
- return JSON.stringify(cell);
- } else {
- return cell.toString().replace(/"/g, '""');
- }
- }),
- );
- const csvData = [headers, ...rows];
-
- const csvContent = csvData.map((e) => e.join(",")).join("\n");
- const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
- const filename = `${window.title}.csv`;
- try {
- const fileHandle = await getNewFileHandle({
- filename: filename,
- });
-
- await loadingOverlay("Saving CSV");
-
- non_blocking(async function () {
- // @ts-ignore
- saveToFile(blob, filename, fileHandle).then(async function () {
- await new Promise((resolve) => setTimeout(resolve, 1500));
- if (!fileHandle) {
- downloadFinished(true);
- }
- await loadingOverlay("", true);
- });
- }, 2)();
- } catch (error) {
- console.error(error);
- }
+ const headers = columns;
+ const rows = data.map((row: any) =>
+ row.map((cell: any) => {
+ if (cell == null) {
+ return "";
+ } else if (typeof cell === "object") {
+ return JSON.stringify(cell);
+ } else {
+ return cell.toString().replace(/"/g, '""');
+ }
+ }),
+ );
+ const csvData = [headers, ...rows];
+
+ const csvContent = csvData.map((e) => e.join(",")).join("\n");
+ const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
+ const filename = `${window.title}.csv`;
+ try {
+ const fileHandle = await getNewFileHandle({
+ filename: filename,
+ });
+
+ await loadingOverlay("Saving CSV");
+
+ non_blocking(async function () {
+ // @ts-ignore
+ saveToFile(blob, filename, fileHandle).then(async function () {
+ await new Promise((resolve) => setTimeout(resolve, 1500));
+ if (!fileHandle) {
+ downloadFinished(true);
+ }
+ await loadingOverlay("", true);
+ });
+ }, 2)();
+ } catch (error) {
+ console.error(error);
+ }
}
function loadingOverlay(message?: string, is_close?: boolean) {
- const loading = window.document.getElementById("loading") as HTMLElement;
- const loading_text = window.document.getElementById(
- "loading_text",
- ) as HTMLElement;
- return new Promise((resolve) => {
- if (is_close) {
- loading.classList.remove("show");
- } else {
- // @ts-ignore
- loading_text.innerHTML = message;
- loading.classList.add("show");
- }
-
- const is_loaded = setInterval(function () {
- if (
- is_close
- ? !loading.classList.contains("show")
- : loading.classList.contains("show")
- ) {
- clearInterval(is_loaded);
- resolve(true);
- }
- }, 0.01);
- });
+ const loading = window.document.getElementById("loading") as HTMLElement;
+ const loading_text = window.document.getElementById(
+ "loading_text",
+ ) as HTMLElement;
+ return new Promise((resolve) => {
+ if (is_close) {
+ loading.classList.remove("show");
+ } else {
+ // @ts-ignore
+ loading_text.innerHTML = message;
+ loading.classList.add("show");
+ }
+
+ const is_loaded = setInterval(function () {
+ if (
+ is_close
+ ? !loading.classList.contains("show")
+ : loading.classList.contains("show")
+ ) {
+ clearInterval(is_loaded);
+ resolve(true);
+ }
+ }, 0.01);
+ });
}
export const non_blocking = (func: Function, delay: number) => {
- let timeout: number;
- return function () {
- // @ts-ignore
- const context = this;
- const args = arguments;
- clearTimeout(timeout);
- timeout = setTimeout(() => func.apply(context, args), delay);
- };
+ let timeout: number;
+ return function () {
+ // @ts-ignore
+ const context = this;
+ const args = arguments;
+ clearTimeout(timeout);
+ timeout = setTimeout(() => func.apply(context, args), delay);
+ };
};
const openbb_watermark = {
- yref: "paper",
- xref: "paper",
- x: 1,
- y: 0,
- text: "OpenBB Terminal",
- font_size: 17,
- font_color: "gray",
- opacity: 0.5,
- xanchor: "right",
- yanchor: "bottom",
- yshift: -80,
- xshift: 40,
+ yref: "paper",
+ xref: "paper",
+ x: 1,
+ y: 0,
+ text: "OpenBB Terminal",
+ font_size: 17,
+ font_color: "gray",
+ opacity: 0.5,
+ xanchor: "right",
+ yanchor: "bottom",
+ yshift: -80,
+ xshift: 40,
};
async function setWatermarks(margin, old_index, init = false) {
- const chart = document.getElementById("plotlyChart") as HTMLElement;
-
- if (init) {
- chart.layout.annotations.push(openbb_watermark);
- if (
- chart.globals.cmd_idx !== undefined &&
- chart.globals.cmd_src !== undefined
- ) {
- chart.layout.annotations[chart.globals.cmd_idx].text =
- chart.globals.cmd_src;
- }
-
- Plotly.relayout(chart, {
- "title.text": chart.globals.title,
- margin: chart.globals.old_margin,
- });
- }
-
- if (!init) {
- if (
- chart.globals.cmd_idx !== undefined &&
- chart.globals.cmd_src !== undefined
- ) {
- chart.layout.annotations[chart.globals.cmd_idx].text = "";
- }
- chart.layout.annotations.splice(old_index, 1);
-
- Plotly.relayout(chart, {
- "title.text": "",
- margin: margin,
- });
- }
+ const chart = document.getElementById("plotlyChart") as HTMLElement;
+
+ if (init) {
+ chart.layout.annotations.push(openbb_watermark);
+ if (
+ chart.globals.cmd_idx !== undefined &&
+ chart.globals.cmd_src !== undefined
+ ) {
+ chart.layout.annotations[chart.globals.cmd_idx].text =
+ chart.globals.cmd_src;
+ }
+
+ Plotly.relayout(chart, {
+ "title.text": chart.globals.title,
+ margin: chart.globals.old_margin,
+ });
+ }
+
+ if (!init) {
+ if (
+ chart.globals.cmd_idx !== undefined &&
+ chart.globals.cmd_src !== undefined
+ ) {
+ chart.layout.annotations[chart.globals.cmd_idx].text = "";
+ }
+ chart.layout.annotations.splice(old_index, 1);
+
+ Plotly.relayout(chart, {
+ "title.text": "",
+ margin: margin,
+ });
+ }
}
export async function saveImage(
- id: string,
- filename: string,
- extension: string,
+ id: string,
+ filename: string,
+ extension: string,
) {
- const chart = document.getElementById(id) as HTMLElement;
-
- if (["svg", "pdf"].includes(extension)) {
- const chart = document.getElementById("plotlyChart") as HTMLElement;
- const margin = chart.layout.margin;
- const old_index = chart.layout.annotations.length;
-
- await setWatermarks(margin, old_index, true);
-
- Plotly.downloadImage(chart, {
- format: "svg",
- height: chart.clientHeight,
- width: chart.clientWidth,
- filename: window.title,
- });
-
- await setWatermarks(margin, old_index, false);
- await loadingOverlay("", true);
- return;
- }
-
- non_blocking(async function () {
- domtoimage.toBlob(chart).then(function (blob: Blob) {
- saveToFile(blob, filename, null);
- });
- }, 2)();
+ const chart = document.getElementById(id) as HTMLElement;
+
+ if (["svg", "pdf"].includes(extension)) {
+ const chart = document.getElementById("plotlyChart") as HTMLElement;
+ const margin = chart.layout.margin;
+ const old_index = chart.layout.annotations.length;
+
+ await setWatermarks(margin, old_index, true);
+
+ Plotly.downloadImage(chart, {
+ format: "svg",
+ height: chart.clientHeight,
+ width: chart.clientWidth,
+ filename: window.title,
+ });
+
+ await setWatermarks(margin, old_index, false);
+ await loadingOverlay("", true);
+ return;
+ }
+
+ non_blocking(async function () {
+ domtoimage.toBlob(chart).then(function (blob: Blob) {
+ saveToFile(blob, filename, null);
+ });
+ }, 2)();
}
export async function downloadImage(
- id: string,
- hidemodebar: () => void,
- loading: (bool: boolean) => void,
- downloadFinished: (bool: boolean) => void,
+ id: string,
+ hidemodebar: () => void,
+ loading: (bool: boolean) => void,
+ downloadFinished: (bool: boolean) => void,
) {
- const chart = document.getElementById(id) as HTMLElement;
- const filename = `${window.title}.png`;
-
- try {
- loading(true);
- const fileHandle = await getNewFileHandle({
- filename: filename,
- is_image: true,
- });
- let extension = "png";
- if (fileHandle !== null) {
- // @ts-ignore
- extension = fileHandle.name.split(".").pop();
- }
- await loadingOverlay(`Saving ${extension.toUpperCase()}`);
-
- if (["svg", "pdf"].includes(extension)) {
- await saveImage(id, filename, extension);
- hidemodebar(false);
- loading(false);
- if (!fileHandle) {
- downloadFinished(true);
- }
- return;
- }
-
- non_blocking(async function () {
- domtoimage.toBlob(chart).then(function (blob: Blob) {
- saveToFile(blob, filename, fileHandle).then(async function () {
- await loadingOverlay("", true);
- hidemodebar(false);
- loading(false);
- if (!fileHandle) {
- downloadFinished(true);
- }
- });
- });
- }, 2)();
- } catch (error) {
- console.error(error);
- hidemodebar(false);
- loading(false);
- }
- loading(false);
+ const chart = document.getElementById(id) as HTMLElement;
+ const filename = `${window.title}.png`;
+
+ try {
+ loading(true);
+ const fileHandle = await getNewFileHandle({
+ filename: filename,
+ is_image: true,
+ });
+ let extension = "png";
+ if (fileHandle !== null) {
+ // @ts-ignore
+ extension = fileHandle.name.split(".").pop();
+ }
+ await loadingOverlay(`Saving ${extension.toUpperCase()}`).then(
+ setTimeout(async function () {
+ if (["svg", "pdf"].includes(extension)) {
+ await saveImage(id, filename, extension);
+ hidemodebar(false);
+ loading(false);
+ if (!fileHandle) {
+ downloadFinished(true);
+ }
+ return;
+ }
+
+ non_blocking(async function () {
+ domtoimage.toBlob(chart).then(function (blob: Blob) {
+ saveToFile(blob, filename, fileHandle).then(async function () {
+ await loadingOverlay("", true);
+ hidemodebar(false);
+ loading(false);
+ if (!fileHandle) {
+ downloadFinished(true);
+ }
+ });
+ });
+ }, 2)();
+ }, 100),
+ );
+ } catch (error) {
+ console.error(error);
+ hidemodebar(false);
+ loading(false);
+ }
+ loading(false);
}
diff --git a/frontend-components/tables/src/components/Table/ColumnHeader.tsx b/frontend-components/tables/src/components/Table/ColumnHeader.tsx
index fc1695b7504d..eaec84875102 100644
--- a/frontend-components/tables/src/components/Table/ColumnHeader.tsx
+++ b/frontend-components/tables/src/components/Table/ColumnHeader.tsx
@@ -1,314 +1,375 @@
-import { flexRender } from "@tanstack/react-table";
+import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
+import { Table, flexRender } from "@tanstack/react-table";
import clsx from "clsx";
import { FC } from "react";
-import { formatNumberMagnitude, includesDateNames } from "../../utils/utils";
import { useDrag, useDrop } from "react-dnd";
-import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
+import { includesDateNames } from "../../utils/utils";
export const magnitudeRegex = new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$");
+export const isoYearRegex = new RegExp("^\\d{4}$");
+export const isoDateRegex = new RegExp(
+ "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$",
+);
function Filter({
- column,
- table,
- numberOfColumns,
+ column,
+ table,
+ numberOfColumns,
}: {
- column: any;
- table: any;
- numberOfColumns: number;
+ column: any;
+ table: Table;
+ numberOfColumns: number;
}) {
- function getTime(value: string | number | Date) {
- if (!value) return null;
- const date = new Date(value);
- const year = date.getFullYear();
- const month =
- date.getMonth() + 1 > 9 ? date.getMonth() + 1 : `0${date.getMonth() + 1}`;
- const day = date.getDate() > 9 ? date.getDate() : `0${date.getDate()}`;
- return `${year}-${month}-${day}`;
- }
+ function getTime(value: string | number | Date) {
+ if (!value) return null;
+ const datetime = new Date(value);
+ const date = datetime.toISOString().split("T")[0];
+ const time = datetime.toTimeString().split(" ")[0];
+ return `${date} ${time}`;
+ }
+
+ const values = table.getPreFilteredRowModel().flatRows.map(
+ (row: { getValue: (arg0: any) => any }) =>
+ // @ts-ignore
+ row.original[column.id],
+ );
+
+ const areAllValuesString = values.every(
+ (value: null) => typeof value === "string" || value === null,
+ );
- const values = table
- .getPreFilteredRowModel()
- .flatRows.map((row: { getValue: (arg0: any) => any }) =>
- row.getValue(column.id),
- );
+ const areAllValuesNumber = values.every(
+ (value: null | number | string) =>
+ typeof value === "number" ||
+ magnitudeRegex.test(value as string) ||
+ value === null ||
+ value === "",
+ );
- const areAllValuesString = values.every(
- (value: null) => typeof value === "string" || value === null,
- );
+ const valuesContainStringWithSpaces = values.some(
+ (value: string | string[]) =>
+ typeof value === "string" && value.includes(" "),
+ );
- const areAllValuesNumber = values.every(
- (value: null | number | string) =>
- typeof value === "number" ||
- magnitudeRegex.test(value as string) ||
- value === null ||
- value === "",
- );
+ const columnFilterValue = column.getFilterValue();
- const valuesContainStringWithSpaces = values.some(
- (value: string | string[]) =>
- typeof value === "string" && value.includes(" "),
- );
+ let dateType = "date";
- const columnFilterValue = column.getFilterValue();
+ const isProbablyDate = values.every((value: string) => {
+ const only_numbers = value?.toString().replace(/[^0-9]/g, "").trim();
+ if (isoDateRegex.test(value?.toString())) {
+ dateType = "datetime-local";
+ }
+ if (isoYearRegex.test(value?.toString())) {
+ dateType = "number";
+ }
+ return (
+ only_numbers?.length >= 4 &&
+ (includesDateNames(column.id) ||
+ (column.id.toLowerCase() === "index" && !valuesContainStringWithSpaces))
+ );
+ });
- const isProbablyDate = values.every((value: string) => {
- const only_numbers = value?.toString().replace(/[^0-9]/g, "").trim();
- return (
- only_numbers?.length >= 4 &&
- (includesDateNames(column.id) ||
- (column.id.toLowerCase() === "index" && !valuesContainStringWithSpaces))
- );
- });
+ if (isProbablyDate && dateType === "number") {
+ return (
+
+ {
+ column.setFilterValue((old: [string, string]) => [
+ `${e.target.value}`,
+ `${old?.[1]}`,
+ ]);
+ }}
+ min={values.reduce(
+ (acc: number, value: string) =>
+ Math.min(acc, parseInt(value, 10)),
+ Infinity,
+ )}
+ max={values.reduce(
+ (acc: number, value: string) =>
+ Math.max(acc, parseInt(value, 10)),
+ -Infinity,
+ )}
+ placeholder={"Start year"}
+ className="_input"
+ />
+ {
+ column.setFilterValue((old: [string, string]) => [
+ `${old?.[0]}`,
+ `${e.target.value}`,
+ ]);
+ }}
+ min={values.reduce(
+ (acc: number, value: string) =>
+ Math.min(acc, parseInt(value, 10)),
+ Infinity,
+ )}
+ max={values.reduce(
+ (acc: number, value: string) =>
+ Math.max(acc, parseInt(value, 10)),
+ -Infinity,
+ )}
+ placeholder={"End year"}
+ className="_input"
+ />
+
+ );
+ }
- if (isProbablyDate) {
- return (
-
- {
- const value = new Date(e.target.value).getTime();
- column.setFilterValue((old: [string, string]) => [value, old?.[1]]);
- }}
- placeholder={"Start date"}
- className="_input"
- />
- {
- const value = new Date(e.target.value).getTime();
- column.setFilterValue((old: [string, string]) => [old?.[0], value]);
- }}
- placeholder={"End date"}
- className="_input"
- />
-
- );
- }
+ if (isProbablyDate && dateType !== "number") {
+ return (
+
+ {
+ const value = new Date(e.target.value).getTime();
+ column.setFilterValue((old: [string, string]) => [value, old?.[1]]);
+ }}
+ placeholder={"Start date"}
+ className="_input"
+ />
+ {
+ const value = new Date(e.target.value).getTime();
+ column.setFilterValue((old: [string, string]) => [old?.[0], value]);
+ }}
+ placeholder={"End date"}
+ className="_input"
+ />
+
+ );
+ }
- if (areAllValuesNumber) {
- return (
-
-
- column.setFilterValue((old: [number, number]) => [
- e.target.value,
- old?.[1],
- ])
- }
- placeholder={"Min"}
- className="_input p-0.5"
- />
-
- column.setFilterValue((old: [number, number]) => [
- old?.[0],
- e.target.value,
- ])
- }
- placeholder={"Max"}
- className="_input p-0.5"
- />
-
- );
- }
- if (areAllValuesString) {
- return (
-
- column.setFilterValue(e.target.value)}
- placeholder={"Search..."}
- className="_input"
- />
-
- );
- }
- return ;
+ if (areAllValuesNumber) {
+ return (
+
+
+ column.setFilterValue((old: [number, number]) => [
+ e.target.value,
+ old?.[1],
+ ])
+ }
+ placeholder={"Min"}
+ className="_input p-0.5"
+ />
+
+ column.setFilterValue((old: [number, number]) => [
+ old?.[0],
+ e.target.value,
+ ])
+ }
+ placeholder={"Max"}
+ className="_input p-0.5"
+ />
+
+ );
+ }
+ if (areAllValuesString) {
+ return (
+
+ column.setFilterValue(e.target.value)}
+ placeholder={"Search..."}
+ className="_input"
+ />
+
+ );
+ }
+ return ;
}
const reorderColumn = (
- draggedColumnId: string,
- targetColumnId: string,
- columnOrder: string[],
+ draggedColumnId: string,
+ targetColumnId: string,
+ columnOrder: string[],
) => {
- columnOrder.splice(
- columnOrder.indexOf(targetColumnId),
- 0,
- columnOrder.splice(columnOrder.indexOf(draggedColumnId), 1)[0] as string,
- );
- return [...columnOrder];
+ columnOrder.splice(
+ columnOrder.indexOf(targetColumnId),
+ 0,
+ columnOrder.splice(columnOrder.indexOf(draggedColumnId), 1)[0] as string,
+ );
+ return [...columnOrder];
};
const DraggableColumnHeader: FC<{
- header: any;
- table: any;
- advanced: boolean;
- idx: number;
- lockFirstColumn: boolean;
- setLockFirstColumn: (value: boolean) => void;
+ header: any;
+ table: any;
+ advanced: boolean;
+ idx: number;
+ lockFirstColumn: boolean;
+ setLockFirstColumn: (value: boolean) => void;
}> = ({
- header,
- table,
- advanced,
- idx,
- lockFirstColumn,
- setLockFirstColumn,
+ header,
+ table,
+ advanced,
+ idx,
+ lockFirstColumn,
+ setLockFirstColumn,
}) => {
- const { getState, setColumnOrder } = table;
- const { columnOrder } = getState();
- const { column } = header;
+ const { getState, setColumnOrder } = table;
+ const { columnOrder } = getState();
+ const { column } = header;
- const [, dropRef] = useDrop({
- accept: "column",
- drop: (draggedColumn: any) => {
- const newColumnOrder = reorderColumn(
- draggedColumn.id,
- column.id,
- columnOrder,
- );
- setColumnOrder(newColumnOrder);
- },
- });
+ const [, dropRef] = useDrop({
+ accept: "column",
+ drop: (draggedColumn: any) => {
+ const newColumnOrder = reorderColumn(
+ draggedColumn.id,
+ column.id,
+ columnOrder,
+ );
+ setColumnOrder(newColumnOrder);
+ },
+ });
- const [{ isDragging }, dragRef, previewRef] = useDrag({
- collect: (monitor) => ({
- isDragging: monitor.isDragging(),
- }),
- item: () => column,
- type: "column",
- });
+ const [{ isDragging }, dragRef, previewRef] = useDrag({
+ collect: (monitor) => ({
+ isDragging: monitor.isDragging(),
+ }),
+ item: () => column,
+ type: "column",
+ });
- const renderField = () => (
-
- {header.isPlaceholder ? null : (
- <>
-
-
- {flexRender(column.columnDef.header, header.getContext())}
- {column.getCanSort() && (
-
- )}
-
- {advanced && column.id !== "select" && (
-
- )}
-
- {advanced && column.getCanFilter() ? (
-
-
-
- ) : null}
- >
- )}
-
- );
+ const renderField = () => (
+
+ {header.isPlaceholder ? null : (
+ <>
+
+
+ {flexRender(column.columnDef.header, header.getContext())}
+ {column.getCanSort() && (
+
+ )}
+
+ {advanced && column.id !== "select" && (
+
+ )}
+
+ {advanced && column.getCanFilter() ? (
+
+
+
+ ) : null}
+ >
+ )}
+
+ );
- return (
-
- {idx === 0 ? (
-
-
- {renderField()}
-
-
-
-
-
-
-
-
-
- ) : (
- renderField()
- )}
-
- |
- );
+ return (
+
+ {idx === 0 ? (
+
+
+ {renderField()}
+
+
+
+
+
+
+
+
+
+ ) : (
+ renderField()
+ )}
+
+ |
+ );
};
export default DraggableColumnHeader;
diff --git a/frontend-components/tables/src/components/Table/index.tsx b/frontend-components/tables/src/components/Table/index.tsx
index 26f094d724d2..2a53a8ccfd3f 100644
--- a/frontend-components/tables/src/components/Table/index.tsx
+++ b/frontend-components/tables/src/components/Table/index.tsx
@@ -1,3 +1,4 @@
+import * as DialogPrimitive from "@radix-ui/react-dialog";
import {
flexRender,
getCoreRowModel,
@@ -9,28 +10,29 @@ import {
} from "@tanstack/react-table";
import clsx from "clsx";
import { useEffect, useMemo, useRef, useState } from "react";
-import { useVirtual } from "react-virtual";
-import Select from "../Select";
+import xss from "xss";
+import useDarkMode from "../../utils/useDarkMode";
+import useLocalStorage from "../../utils/useLocalStorage";
import {
+ formatNumber,
formatNumberMagnitude,
+ formatNumberNoMagnitude,
fuzzyFilter,
- isEqual,
includesDateNames,
- formatNumberNoMagnitude,
includesPriceNames,
+ isEqual,
} from "../../utils/utils";
-import DraggableColumnHeader, { magnitudeRegex } from "./ColumnHeader";
-import Pagination, { validatePageSize } from "./Pagination";
-import Export from "./Export";
-import Timestamp from "./Timestamp";
-import FilterColumns from "./FilterColumns";
-import xss from "xss";
-import useLocalStorage from "../../utils/useLocalStorage";
-import Toast from "../Toast";
-import useDarkMode from "../../utils/useDarkMode";
-import * as DialogPrimitive from "@radix-ui/react-dialog";
import CloseIcon from "../Icons/Close";
+import Select from "../Select";
+import Toast from "../Toast";
+import DraggableColumnHeader, {
+ isoYearRegex,
+ magnitudeRegex,
+} from "./ColumnHeader";
import DownloadFinishedDialog from "./DownloadFinishedDialog";
+import Export from "./Export";
+import FilterColumns from "./FilterColumns";
+import Pagination, { validatePageSize } from "./Pagination";
const date = new Date();
@@ -68,10 +70,14 @@ function getCellWidth(row, column) {
const probablyLink = valueType === "string" && value.startsWith("http");
- if (probablyLink) {
+ if (probablyLink || !probablyDate) {
return value?.toString().length ?? 0;
}
- if (probablyDate) {
+ if (
+ probablyDate &&
+ !isNaN(new Date(value).getTime()) &&
+ !isoYearRegex.test(value?.toString())
+ ) {
if (typeof value === "string") {
return value?.toString().length ?? 0;
}
@@ -87,8 +93,9 @@ function getCellWidth(row, column) {
dateFormatted = date.toISOString().split("T")[0];
} else {
dateFormatted = date.toISOString();
- dateFormatted =
- `${dateFormatted.split("T")[0]} ${dateFormatted.split("T")[1].split(".")[0]}`;
+ dateFormatted = `${dateFormatted.split("T")[0]} ${
+ dateFormatted.split("T")[1].split(".")[0]
+ }`;
}
return dateFormatted?.toString().length ?? 0;
@@ -96,11 +103,8 @@ function getCellWidth(row, column) {
return value?.toString().length ?? 0;
}
}
- if (valueType === "number") {
- return value?.toString().length ?? 0;
- } else {
- return value?.toString().length ?? 0;
- }
+
+ return value?.toString().length ?? 0;
} catch (e) {
return 0;
}
@@ -124,7 +128,7 @@ export default function Table({
const [downloadFinished, setDownloadFinished] = useState(false);
const [colorTheme, setTheme] = useDarkMode(initialTheme);
const [darkMode, setDarkMode] = useState(
- colorTheme === "dark" ? true : false
+ colorTheme === "dark" ? true : false,
);
const toggleDarkMode = (checked: boolean) => {
//@ts-ignore
@@ -135,7 +139,7 @@ export default function Table({
const [currentPage, setCurrentPage] = useLocalStorage(
"rowsPerPage",
DEFAULT_ROWS_PER_PAGE,
- validatePageSize
+ validatePageSize,
);
const [advanced, setAdvanced] = useLocalStorage("advanced", false);
const [colors, setColors] = useLocalStorage("colors", false);
@@ -148,7 +152,7 @@ export default function Table({
return acc;
}, {});
const [columnVisibility, setColumnVisibility] = useState(
- defaultVisibleColumns
+ defaultVisibleColumns,
);
//@ts-ignore
@@ -158,8 +162,8 @@ export default function Table({
const cellLength = Math.max(
//@ts-ignore
...rows.map((row) => getCellWidth(row, accessor)),
- headerText?.length ? headerText?.length + 8 : 0
- );
+ headerText?.length ? headerText?.length + 8 : 0,
+ );
return Math.min(maxWidth, cellLength * magicSpacing);
};
@@ -167,6 +171,39 @@ export default function Table({
() => [
...columns.map((column: any, index: number) => ({
accessorKey: column,
+ accessorFn: (row: any) => {
+ const indexLabel = row.hasOwnProperty("index")
+ ? "index"
+ : row.hasOwnProperty("Index")
+ ? "Index"
+ : columns[0];
+ const indexValue = indexLabel ? row[indexLabel] : null;
+ const value = row[column];
+ const only_numbers = value?.toString().replace(/[^0-9]/g, "") ?? "";
+ const probablyDate =
+ only_numbers?.length >= 4 &&
+ (includesDateNames(column) ||
+ column.toLowerCase() === "index" ||
+ (indexValue &&
+ typeof indexValue === "string" &&
+ (indexValue.toLowerCase().includes("date") ||
+ indexValue.toLowerCase().includes("time") ||
+ indexValue.toLowerCase().includes("timestamp") ||
+ indexValue.toLowerCase().includes("year") ||
+ indexValue.toLowerCase().includes("month") ||
+ indexValue.toLowerCase().includes("week") ||
+ indexValue.toLowerCase().includes("hour") ||
+ indexValue.toLowerCase().includes("minute"))));
+
+ if (probablyDate && isoYearRegex.test(value?.toString()))
+ return value;
+
+ if (probablyDate) {
+ if (typeof value === "number") return value;
+ return new Date(value).getTime();
+ }
+ return value;
+ },
id: column,
header: column,
size: getColumnWidth(data, column, column),
@@ -203,14 +240,18 @@ export default function Table({
target="_blank"
rel="noreferrer"
>
- {value?.length > 25 ? value.substring(0, 25) + "..." : value}
+ {value?.length > 25 ? `${value.substring(0, 25)}...` : value}
);
}
- if (probablyDate) {
- if (typeof value === "number") {
- return {value}
;
- }
+ if (probablyDate && isoYearRegex.test(value?.toString())) {
+ return {value}
;
+ }
+ if (
+ probablyDate &&
+ !isNaN(new Date(value).getTime()) &&
+ !isoYearRegex.test(value?.toString())
+ ) {
if (typeof value === "string") {
const date = value.split("T")[0];
const time = value.split("T")[1]?.split(".")[0];
@@ -223,7 +264,6 @@ export default function Table({
);
}
-
try {
const date = new Date(value);
let dateFormatted = "";
@@ -236,8 +276,9 @@ export default function Table({
dateFormatted = date.toISOString().split("T")[0];
} else {
dateFormatted = date.toISOString();
- dateFormatted =
- `${dateFormatted.split("T")[0]} ${dateFormatted.split("T")[1].split(".")[0]}`;
+ dateFormatted = `${dateFormatted.split("T")[0]} ${
+ dateFormatted.split("T")[1].split(".")[0]
+ }`;
}
return
-
+
+ />
@@ -469,7 +511,7 @@ export default function Table({
idx % 2 === 1,
"sticky left-0 z-10":
idx2 === 0 && lockFirstColumn,
- }
+ },
)}
style={{
width: cell.column.getSize(),
@@ -477,7 +519,7 @@ export default function Table({
>
{flexRender(
cell.column.columnDef.cell,
- cell.getContext()
+ cell.getContext(),
)}
);
@@ -503,7 +545,7 @@ export default function Table({
? null
: flexRender(
header.column.columnDef.footer,
- header.getContext()
+ header.getContext(),
)}
))}
diff --git a/frontend-components/tables/src/utils/utils.ts b/frontend-components/tables/src/utils/utils.ts
index 114dc497b4ae..286e9a9fc424 100644
--- a/frontend-components/tables/src/utils/utils.ts
+++ b/frontend-components/tables/src/utils/utils.ts
@@ -38,12 +38,21 @@ export function formatNumberMagnitude(value: number | string, column?: string) {
) {
const magnitude = Math.min(4, Math.floor(Math.log10(Math.abs(value)) / 3));
const suffix = ["", "K", "M", "B", "T"][magnitude];
- const formatted = (value / 10 ** (magnitude * 3)).toFixed(2);
- return `${formatted} ${suffix}`;
+ const formatted = (value / 10 ** (magnitude * 3)).toFixed(3);
+ return `${formatted.replace(/\.?0+$/, "")} ${suffix}`;
}
+ if (value > 1000 || value < -1000) return formatNumber(value);
+
+ return value;
+}
+
+export function formatNumber(value: number) {
if (value > 1000 || value < -1000) {
- return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ const parts = value.toString().split(".");
+ const integerPart = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ const decimalPart = parts[1] ? `.${parts[1]}` : "";
+ return `${integerPart}${decimalPart}`;
}
return value;
@@ -56,7 +65,7 @@ export function includesDateNames(column: string) {
}
export function includesPriceNames(column: string) {
- return ["price", "open", "close", "high", "low"].some((priceName) =>
+ return ["price", "open", "close"].some((priceName) =>
column?.toLowerCase().includes(priceName),
);
}
diff --git a/openbb_terminal/common/behavioural_analysis/google_view.py b/openbb_terminal/common/behavioural_analysis/google_view.py
index 3f9005cf5c36..ba248e4d7988 100644
--- a/openbb_terminal/common/behavioural_analysis/google_view.py
+++ b/openbb_terminal/common/behavioural_analysis/google_view.py
@@ -134,8 +134,6 @@ def display_correlation_interest(
col=1,
)
- fig.hide_holidays()
-
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
diff --git a/openbb_terminal/common/quantitative_analysis/qa_view.py b/openbb_terminal/common/quantitative_analysis/qa_view.py
index 6cf1bcb14536..c273a12ba58c 100644
--- a/openbb_terminal/common/quantitative_analysis/qa_view.py
+++ b/openbb_terminal/common/quantitative_analysis/qa_view.py
@@ -860,7 +860,6 @@ def display_raw(
df1 = df1.sort_values(by=data.columns[sort_col], ascending=ascend)
else:
df1 = df1.sort_index(ascending=ascend)
- df1.index = [x.strftime("%Y-%m-%d") for x in df1.index]
print_rich_table(
df1,
diff --git a/openbb_terminal/core/plots/plotly.html b/openbb_terminal/core/plots/plotly.html
index 9feab717efa9..09296d713a06 100644
--- a/openbb_terminal/core/plots/plotly.html
+++ b/openbb_terminal/core/plots/plotly.html
@@ -33,7 +33,7 @@
}
'];return t.cellXfs.forEach(function(n,i){var o=[];o.push(ue("NumberFormat",null,{"ss:Format":Be(rt[n.numFmtId])}));var a={"ss:ID":"s"+(21+i)};r.push(ue("Style",o.join(""),a))}),ue("Styles",r.join(""))}function kw(e){return ue("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+Vd(e.Ref,{r:0,c:0})})}function q6(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],n=0;n"),e["!margins"].header&&i.push(ue("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&i.push(ue("Footer",null,{"x:Margin":e["!margins"].footer})),i.push(ue("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),i.push("")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[r])if(n.Workbook.Sheets[r].Hidden)i.push(ue("Visible",n.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var o=0;o")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&i.push(""),e["!protect"]&&(i.push(yt("ProtectContents","True")),e["!protect"].objects&&i.push(yt("ProtectObjects","True")),e["!protect"].scenarios&&i.push(yt("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?i.push(yt("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&i.push(yt("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(a){e["!protect"][a[0]]&&i.push("<"+a[1]+"/>")})),i.length==0?"":ue("WorksheetOptions",i.join(""),{xmlns:qt.x})}function J6(e){return e.map(function(t){var r=n3(t.t||""),n=ue("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return ue("Comment",n,{"ss:Author":t.a})}).join("")}function eD(e,t,r,n,i,o,a){if(!e||e.v==null&&e.f==null)return"";var s={};if(e.f&&(s["ss:Formula"]="="+Be(Vd(e.f,a))),e.F&&e.F.slice(0,t.length)==t){var l=dt(e.F.slice(t.length+1));s["ss:ArrayRange"]="RC:R"+(l.r==a.r?"":"["+(l.r-a.r)+"]")+"C"+(l.c==a.c?"":"["+(l.c-a.c)+"]")}if(e.l&&e.l.Target&&(s["ss:HRef"]=Be(e.l.Target),e.l.Tooltip&&(s["x:HRefScreenTip"]=Be(e.l.Tooltip))),r["!merges"])for(var u=r["!merges"],c=0;c!=u.length;++c)u[c].s.c!=a.c||u[c].s.r!=a.r||(u[c].e.c>u[c].s.c&&(s["ss:MergeAcross"]=u[c].e.c-u[c].s.c),u[c].e.r>u[c].s.r&&(s["ss:MergeDown"]=u[c].e.r-u[c].s.r));var f="",d="";switch(e.t){case"z":if(!n.sheetStubs)return"";break;case"n":f="Number",d=String(e.v);break;case"b":f="Boolean",d=e.v?"1":"0";break;case"e":f="Error",d=es[e.v];break;case"d":f="DateTime",d=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||rt[14]);break;case"s":f="String",d=r3(e.v||"");break}var h=Bn(n.cellXfs,e,n);s["ss:StyleID"]="s"+(21+h),s["ss:Index"]=a.c+1;var m=e.v!=null?d:"",p=e.t=="z"?"":''+m+"";return(e.c||[]).length>0&&(p+=J6(e.c)),ue("Cell",p,s)}function tD(e,t){var r='"}function rD(e,t,r,n){if(!e["!ref"])return"";var i=Ke(e["!ref"]),o=e["!merges"]||[],a=0,s=[];e["!cols"]&&e["!cols"].forEach(function(g,x){Ud(g);var w=!!g.width,y=Tu(x,g),_={"ss:Index":x+1};w&&(_["ss:Width"]=Ul(y.width)),g.hidden&&(_["ss:Hidden"]="1"),s.push(ue("Column",null,_))});for(var l=Array.isArray(e),u=i.s.r;u<=i.e.r;++u){for(var c=[tD(u,(e["!rows"]||[])[u])],f=i.s.c;f<=i.e.c;++f){var d=!1;for(a=0;a!=o.length;++a)if(!(o[a].s.c>f)&&!(o[a].s.r>u)&&!(o[a].e.c"),c.length>2&&s.push(c.join(""))}return s.join("")}function nD(e,t,r){var n=[],i=r.SheetNames[e],o=r.Sheets[i],a=o?Q6(o,t,e,r):"";return a.length>0&&n.push(""+a+""),a=o?rD(o,t,e,r):"",a.length>0&&n.push(""),n.push(Z6(o,t,e,r)),n.join("")}function iD(e,t){t||(t={}),e.SSF||(e.SSF=Xt(rt)),e.SSF&&(wu(),xu(e.SSF),t.revssf=yu(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],Bn(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(X6(e,t)),r.push(K6()),r.push(""),r.push("");for(var n=0;n-1||tw.indexOf(i[o][0])>-1||i[o][1]!=null&&u.push(i[o]);n.length&&He.utils.cfb_add(t,"/SummaryInformation",Wg(n,Oc.SI,l,Lg)),(r.length||u.length)&&He.utils.cfb_add(t,"/DocumentSummaryInformation",Wg(r,Oc.DSI,s,Mg,u.length?u:null,Oc.UDI))}function aD(e,t){var r=t||{},n=He.utils.cfb_new({root:"R"}),i="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":i="/Workbook",r.biff=8;break;case"biff5":i="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return He.utils.cfb_add(n,i,$w(e,r)),r.biff==8&&(e.Props||e.Custprops)&&oD(e,n),r.biff==8&&e.vbaraw&&TR(n,He.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),n}var sD={0:{f:cF},1:{f:xF},2:{f:LF},3:{f:AF},4:{f:_F},5:{f:kF},6:{f:WF},7:{f:DF},8:{f:qF},9:{f:YF},10:{f:XF},11:{f:KF},12:{f:yF},13:{f:UF},14:{f:OF},15:{f:TF},16:{f:NF},17:{f:GF},18:{f:IF},19:{f:Nd},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:$6},40:{},42:{},43:{f:WA},44:{f:HA},45:{f:jA},46:{f:KA},47:{f:XA},48:{},49:{f:y3},50:{},51:{f:cR},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:EA},62:{f:VF},63:{f:mR},64:{f:d6},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:$r,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:l6},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:mF},148:{f:hF,p:16},151:{f:r6},152:{},153:{f:b6},154:{},155:{},156:{f:P6},157:{},158:{},159:{T:1,f:PA},160:{T:-1},161:{T:1,f:yi},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:QF},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:lR},336:{T:-1},337:{f:hR,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:zf},357:{},358:{},359:{},360:{T:1},361:{},362:{f:gA},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:n6},427:{f:i6},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:a6},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:gF},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:e6},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:zf},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:ER},633:{T:1},634:{T:-1},635:{T:1,f:wR},636:{T:-1},637:{f:T3},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:C6},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:h6},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function ce(e,t,r,n){var i=t;if(!isNaN(i)){var o=n||(r||[]).length||0,a=e.next(4);a.write_shift(2,i),a.write_shift(2,o),o>0&&bd(r)&&e.push(r)}}function lD(e,t,r,n){var i=n||(r||[]).length||0;if(i<=8224)return ce(e,t,r,i);var o=t;if(!isNaN(o)){for(var a=r.parts||[],s=0,l=0,u=0;u+(a[s]||8224)<=8224;)u+=a[s]||8224,s++;var c=e.next(4);for(c.write_shift(2,o),c.write_shift(2,u),e.push(r.slice(l,l+u)),l+=u;l=0&&i<65536?ce(e,2,CA(r,n,i)):ce(e,3,TA(r,n,i));return;case"b":case"e":ce(e,5,uD(r,n,t.v,t.t));return;case"s":case"str":ce(e,4,cD(r,n,(t.v||"").slice(0,255)));return}ce(e,1,rs(null,r,n))}function dD(e,t,r,n){var i=Array.isArray(t),o=Ke(t["!ref"]||"A1"),a,s="",l=[];if(o.e.c>255||o.e.r>16383){if(n.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");o.e.c=Math.min(o.e.c,255),o.e.r=Math.min(o.e.c,16383),a=ot(o)}for(var u=o.s.r;u<=o.e.r;++u){s=_t(u);for(var c=o.s.c;c<=o.e.c;++c){u===o.s.r&&(l[c]=Ft(c)),a=l[c]+s;var f=i?(t[u]||[])[c]:t[a];f&&fD(e,f,u,c)}}}function hD(e,t){for(var r=t||{},n=Gt(),i=0,o=0;o255||h.e.r>=m){if(t.WTF)throw new Error("Range "+(o["!ref"]||"A1")+" exceeds format limit A1:IV16384");h.e.c=Math.min(h.e.c,255),h.e.r=Math.min(h.e.c,m-1)}ce(n,2057,Bd(r,16,t)),ce(n,13,or(1)),ce(n,12,or(100)),ce(n,15,$t(!0)),ce(n,17,$t(!1)),ce(n,16,oi(.001)),ce(n,95,$t(!0)),ce(n,42,$t(!1)),ce(n,43,$t(!1)),ce(n,130,or(1)),ce(n,128,dA([0,0])),ce(n,131,$t(!1)),ce(n,132,$t(!1)),u&&wD(n,o["!cols"]),ce(n,512,fA(h,t)),u&&(o["!links"]=[]);for(var p=h.s.r;p<=h.e.r;++p){f=_t(p);for(var g=h.s.c;g<=h.e.c;++g){p===h.s.r&&(d[g]=Ft(g)),c=d[g]+f;var x=l?(o[p]||[])[g]:o[c];x&&(yD(n,x,p,g,t),u&&x.l&&o["!links"].push([c,x.l]))}}var w=s.CodeName||s.name||i;return u&&ce(n,574,aA((a.Views||[])[0])),u&&(o["!merges"]||[]).length&&ce(n,229,vA(o["!merges"])),u&&xD(n,o),ce(n,442,lw(w)),u&&mD(n,o),ce(n,10),n.end()}function _D(e,t,r){var n=Gt(),i=(e||{}).Workbook||{},o=i.Sheets||[],a=i.WBProps||{},s=r.biff==8,l=r.biff==5;if(ce(n,2057,Bd(e,5,r)),r.bookType=="xla"&&ce(n,135),ce(n,225,s?or(1200):null),ce(n,193,X3(2)),l&&ce(n,191),l&&ce(n,192),ce(n,226),ce(n,92,rA("SheetJS",r)),ce(n,66,or(s?1200:1252)),s&&ce(n,353,or(0)),s&&ce(n,448),ce(n,317,SA(e.SheetNames.length)),s&&e.vbaraw&&ce(n,211),s&&e.vbaraw){var u=a.CodeName||"ThisWorkbook";ce(n,442,lw(u))}ce(n,156,or(17)),ce(n,25,$t(!1)),ce(n,18,$t(!1)),ce(n,19,or(0)),s&&ce(n,431,$t(!1)),s&&ce(n,444,or(0)),ce(n,61,oA()),ce(n,64,$t(!1)),ce(n,141,or(0)),ce(n,34,$t(R6(e)=="true")),ce(n,14,$t(!0)),s&&ce(n,439,$t(!1)),ce(n,218,or(0)),pD(n,e,r),gD(n,e.SSF,r),vD(n,r),s&&ce(n,352,$t(!1));var c=n.end(),f=Gt();s&&ce(f,140,yA()),s&&r.Strings&&lD(f,252,iA(r.Strings)),ce(f,10);var d=f.end(),h=Gt(),m=0,p=0;for(p=0;p255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255). Data may be lost.")}}var o=t||{};switch(o.biff||2){case 8:case 5:return SD(e,t);case 4:case 3:case 2:return hD(e,t)}throw new Error("invalid type "+o.bookType+" for BIFF")}function TD(e,t,r,n){for(var i=e["!merges"]||[],o=[],a=t.s.c;a<=t.e.c;++a){for(var s=0,l=0,u=0;ur||i[u].s.c>a)&&!(i[u].e.r1&&(h.rowspan=s),l>1&&(h.colspan=l),n.editable?d=''+d+"":f&&(h["data-t"]=f&&f.t||"z",f.v!=null&&(h["data-v"]=f.v),f.z!=null&&(h["data-z"]=f.z),f.l&&(f.l.Target||"#").charAt(0)!="#"&&(d=''+d+"")),h.id=(n.id||"sjs")+"-"+c,o.push(ue("td",d,h))}}var m="";return m+o.join("")+"
"}var CD='SheetJS Table Export',AD="";function RD(e,t,r){var n=[];return n.join("")+""}function Nw(e,t){var r=t||{},n=r.header!=null?r.header:CD,i=r.footer!=null?r.footer:AD,o=[n],a=Jt(e["!ref"]);r.dense=Array.isArray(e),o.push(RD(e,a,r));for(var s=a.s.r;s<=a.e.r;++s)o.push(TD(e,a,s,r));return o.push("
"+i),o.join("")}function Mw(e,t,r){var n=r||{},i=0,o=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var a=typeof n.origin=="string"?dt(n.origin):n.origin;i=a.r,o=a.c}var s=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,s.length),u={s:{r:0,c:0},e:{r:i,c:o}};if(e["!ref"]){var c=Jt(e["!ref"]);u.s.r=Math.min(u.s.r,c.s.r),u.s.c=Math.min(u.s.c,c.s.c),u.e.r=Math.max(u.e.r,c.e.r),u.e.c=Math.max(u.e.c,c.e.c),i==-1&&(u.e.r=i=c.e.r+1)}var f=[],d=0,h=e["!rows"]||(e["!rows"]=[]),m=0,p=0,g=0,x=0,w=0,y=0;for(e["!cols"]||(e["!cols"]=[]);m1||y>1)&&f.push({s:{r:p+i,c:x+o},e:{r:p+i+(w||1)-1,c:x+o+(y||1)-1}});var L={t:"s",v:S},H=M.getAttribute("data-t")||M.getAttribute("t")||"";S!=null&&(S.length==0?L.t=H||"z":n.raw||S.trim().length==0||H=="s"||(S==="TRUE"?L={t:"b",v:!0}:S==="FALSE"?L={t:"b",v:!1}:isNaN(Qr(S))?isNaN(Na(S).getDate())||(L={t:"d",v:Lt(S)},n.cellDates||(L={t:"n",v:jt(L.v)}),L.z=n.dateNF||rt[14]):L={t:"n",v:Qr(S)})),L.z===void 0&&C!=null&&(L.z=C);var B="",V=M.getElementsByTagName("A");if(V&&V.length)for(var Q=0;Q=l&&(e["!fullref"]=ot((u.e.r=s.length-m+p-1+i,u))),e}function Lw(e,t){var r=t||{},n=r.dense?[]:{};return Mw(n,e,t)}function OD(e,t){return mi(Lw(e,t),t)}function Zg(e){var t="",r=FD(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function FD(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var DD=function(){var e=["",'',"",'',"",'',"",""].join(""),t=""+e+"";return function(){return at+t}}(),Jg=function(){var e=function(o){return Be(o).replace(/ +/g,function(a){return''}).replace(/\t/g,"").replace(/\n/g,"").replace(/^ /,"").replace(/ $/,"")},t=`
+`;t.push(wt("t",Ue(a)))}t.push("")}),t.push(""),t.length>2&&(t[t.length]="",t[1]=t[1].replace("/>",">")),t.join("")}function hR(e,t,r){var n=[at,fe("ThreadedComments",null,{xmlns:ct.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(i){var o="";(i[1]||[]).forEach(function(a,s){if(!a.T){delete a.ID;return}a.a&&t.indexOf(a.a)==-1&&t.push(a.a);var l={ref:i[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};s==0?o=l.id:l.parentId=o,a.ID=l.id,a.a&&(l.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(a.a)).slice(-12)+"}"),n.push(fe("threadedComment",wt("text",a.t||""),l))})}),n.push(""),n.join("")}function pR(e){var t=[at,fe("personList",null,{xmlns:ct.TCMNT,"xmlns:x":Ao[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,n){t.push(fe("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+n).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push(""),t.join("")}function gR(e){var t={};t.iauthor=e.read_shift(4);var r=_i(e);return t.rfx=r.s,t.ref=He(r.s),e.l+=16,t}function mR(e,t){return t==null&&(t=Z(36)),t.write_shift(4,e[1].iauthor),Oo(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var vR=Ot;function xR(e){return dt(e.slice(0,54))}function wR(e){var t=Gt(),r=[];return ne(t,628),ne(t,630),e.forEach(function(n){n[1].forEach(function(i){r.indexOf(i.a)>-1||(r.push(i.a.slice(0,54)),ne(t,632,xR(i.a)))})}),ne(t,631),ne(t,633),e.forEach(function(n){n[1].forEach(function(i){i.iauthor=r.indexOf(i.a);var o={s:ft(n[0]),e:ft(n[0])};ne(t,635,mR([o,i])),i.t&&i.t.length>0&&ne(t,637,E3(i)),ne(t,636),delete i.iauthor})}),ne(t,634),ne(t,629),t.end()}function yR(e,t){t.FullPaths.forEach(function(r,n){if(n!=0){var i=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");i.slice(-1)!=="/"&&Ve.utils.cfb_add(e,i,t.FileIndex[n].content)}})}var bw=["xlsb","xlsm","xlam","biff8","xla"],ER=function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(n,i,o,a){var s=!1,l=!1;o.length==0?l=!0:o.charAt(0)=="["&&(l=!0,o=o.slice(1,-1)),a.length==0?s=!0:a.charAt(0)=="["&&(s=!0,a=a.slice(1,-1));var u=o.length>0?parseInt(o,10)|0:0,c=a.length>0?parseInt(a,10)|0:0;return s?c+=t.c:--c,l?u+=t.r:--u,i+(s?"":"$")+Rt(c)+(l?"":"$")+yt(u)}return function(i,o){return t=o,i.replace(e,r)}}(),jd=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,Xd=function(){return function(t,r){return t.replace(jd,function(n,i,o,a,s,l){var u=Ud(a)-(o?0:r.c),c=Bd(l)-(s?0:r.r),f=c==0?"":s?c+1:"["+c+"]",d=u==0?"":o?u+1:"["+u+"]";return i+"R"+f+"C"+d})}}();function _R(e,t){return e.replace(jd,function(r,n,i,o,a,s){return n+(i=="$"?i+o:Rt(Ud(o)+t.c))+(a=="$"?a+s:yt(Bd(s)+t.r))})}function SR(e){return e.length!=1}function it(e){e.l+=1}function Nn(e,t){var r=e.read_shift(t==1?1:2);return[r&16383,r>>14&1,r>>15&1]}function kw(e,t,r){var n=2;if(r){if(r.biff>=2&&r.biff<=5)return $w(e);r.biff==12&&(n=4)}var i=e.read_shift(n),o=e.read_shift(n),a=Nn(e,2),s=Nn(e,2);return{s:{r:i,c:a[0],cRel:a[1],rRel:a[2]},e:{r:o,c:s[0],cRel:s[1],rRel:s[2]}}}function $w(e){var t=Nn(e,2),r=Nn(e,2),n=e.read_shift(1),i=e.read_shift(1);return{s:{r:t[0],c:n,cRel:t[1],rRel:t[2]},e:{r:r[0],c:i,cRel:r[1],rRel:r[2]}}}function TR(e,t,r){if(r.biff<8)return $w(e);var n=e.read_shift(r.biff==12?4:2),i=e.read_shift(r.biff==12?4:2),o=Nn(e,2),a=Nn(e,2);return{s:{r:n,c:o[0],cRel:o[1],rRel:o[2]},e:{r:i,c:a[0],cRel:a[1],rRel:a[2]}}}function Nw(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return CR(e);var n=e.read_shift(r&&r.biff==12?4:2),i=Nn(e,2);return{r:n,c:i[0],cRel:i[1],rRel:i[2]}}function CR(e){var t=Nn(e,2),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function AR(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function RR(e,t,r){var n=r&&r.biff?r.biff:8;if(n>=2&&n<=5)return OR(e);var i=e.read_shift(n>=12?4:2),o=e.read_shift(2),a=(o&16384)>>14,s=(o&32768)>>15;if(o&=16383,s==1)for(;i>524287;)i-=1048576;if(a==1)for(;o>8191;)o=o-16384;return{r:i,c:o,cRel:a,rRel:s}}function OR(e){var t=e.read_shift(2),r=e.read_shift(1),n=(t&32768)>>15,i=(t&16384)>>14;return t&=16383,n==1&&t>=8192&&(t=t-16384),i==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:i,rRel:n}}function FR(e,t,r){var n=(e[e.l++]&96)>>5,i=kw(e,r.biff>=2&&r.biff<=5?6:8,r);return[n,i]}function DR(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2,"i"),o=8;if(r)switch(r.biff){case 5:e.l+=12,o=6;break;case 12:o=12;break}var a=kw(e,o,r);return[n,i,a]}function PR(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[n]}function IR(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),o=8;if(r)switch(r.biff){case 5:e.l+=12,o=6;break;case 12:o=12;break}return e.l+=o,[n,i]}function bR(e,t,r){var n=(e[e.l++]&96)>>5,i=TR(e,t-1,r);return[n,i]}function kR(e,t,r){var n=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[n]}function Gg(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function $R(e,t,r){e.l+=2;for(var n=e.read_shift(r&&r.biff==2?1:2),i=[],o=0;o<=n;++o)i.push(e.read_shift(r&&r.biff==2?1:2));return i}function NR(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function MR(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=2,[n,e.read_shift(r&&r.biff==2?1:2)]}function LR(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function BR(e,t,r){var n=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[n]}function Mw(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function UR(e){return e.read_shift(2),Mw(e)}function HR(e){return e.read_shift(2),Mw(e)}function VR(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=Nw(e,0,r);return[n,i]}function WR(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=RR(e,0,r);return[n,i]}function zR(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var o=Nw(e,0,r);return[n,i,o]}function GR(e,t,r){var n=(e[e.l]&96)>>5;e.l+=1;var i=e.read_shift(r&&r.biff<=3?1:2);return[GO[i],Uw[i],n]}function jR(e,t,r){var n=e[e.l++],i=e.read_shift(1),o=r&&r.biff<=3?[n==88?-1:0,e.read_shift(1)]:XR(e);return[i,(o[0]===0?Uw:zO)[o[1]]]}function XR(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function KR(e,t,r){e.l+=r&&r.biff==2?3:4}function YR(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var n=e.read_shift(2),i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function qR(e){return e.l++,os[e.read_shift(1)]}function QR(e){return e.l++,e.read_shift(2)}function ZR(e){return e.l++,e.read_shift(1)!==0}function JR(e){return e.l++,Fo(e)}function eO(e,t,r){return e.l++,ww(e,t-1,r)}function tO(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=z3(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=os[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=Fo(e);break;case 2:r[1]=K3(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function rO(e,t,r){for(var n=e.read_shift(r.biff==12?4:2),i=[],o=0;o!=n;++o)i.push((r.biff==12?_i:Q3)(e));return i}function nO(e,t,r){var n=0,i=0;r.biff==12?(n=e.read_shift(4),i=e.read_shift(4)):(i=1+e.read_shift(1),n=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--n,--i==0&&(i=256));for(var o=0,a=[];o!=n&&(a[o]=[]);++o)for(var s=0;s!=i;++s)a[o][s]=tO(e,r.biff);return a}function iO(e,t,r){var n=e.read_shift(1)>>>5&3,i=!r||r.biff>=8?4:2,o=e.read_shift(i);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[n,0,o]}function oO(e,t,r){if(r.biff==5)return aO(e);var n=e.read_shift(1)>>>5&3,i=e.read_shift(2),o=e.read_shift(4);return[n,i,o]}function aO(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var n=e.read_shift(2);return e.l+=12,[t,r,n]}function sO(e,t,r){var n=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function lO(e,t,r){var n=e.read_shift(1)>>>5&3,i=e.read_shift(r&&r.biff==2?1:2);return[n,i]}function uO(e,t,r){var n=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[n]}function cO(e,t,r){var n=(e[e.l++]&96)>>5,i=e.read_shift(2),o=4;if(r)switch(r.biff){case 5:o=15;break;case 12:o=6;break}return e.l+=o,[n,i]}var fO=Nr,dO=Nr,hO=Nr;function as(e,t,r){return e.l+=2,[AR(e)]}function Kd(e){return e.l+=6,[]}var pO=as,gO=Kd,mO=Kd,vO=as;function Lw(e){return e.l+=2,[vw(e),e.read_shift(2)&1]}var xO=as,wO=Lw,yO=Kd,EO=as,_O=as,SO=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function TO(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),n=e.read_shift(4),i=e.read_shift(2),o=e.read_shift(2),a=SO[r>>2&31];return{ixti:t,coltype:r&3,rt:a,idx:n,c:i,C:o}}function CO(e){return e.l+=2,[e.read_shift(4)]}function AO(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function RO(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function OO(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function FO(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function DO(e){return e.l+=4,[0,0]}var jg={1:{n:"PtgExp",f:YR},2:{n:"PtgTbl",f:hO},3:{n:"PtgAdd",f:it},4:{n:"PtgSub",f:it},5:{n:"PtgMul",f:it},6:{n:"PtgDiv",f:it},7:{n:"PtgPower",f:it},8:{n:"PtgConcat",f:it},9:{n:"PtgLt",f:it},10:{n:"PtgLe",f:it},11:{n:"PtgEq",f:it},12:{n:"PtgGe",f:it},13:{n:"PtgGt",f:it},14:{n:"PtgNe",f:it},15:{n:"PtgIsect",f:it},16:{n:"PtgUnion",f:it},17:{n:"PtgRange",f:it},18:{n:"PtgUplus",f:it},19:{n:"PtgUminus",f:it},20:{n:"PtgPercent",f:it},21:{n:"PtgParen",f:it},22:{n:"PtgMissArg",f:it},23:{n:"PtgStr",f:eO},26:{n:"PtgSheet",f:AO},27:{n:"PtgEndSheet",f:RO},28:{n:"PtgErr",f:qR},29:{n:"PtgBool",f:ZR},30:{n:"PtgInt",f:QR},31:{n:"PtgNum",f:JR},32:{n:"PtgArray",f:kR},33:{n:"PtgFunc",f:GR},34:{n:"PtgFuncVar",f:jR},35:{n:"PtgName",f:iO},36:{n:"PtgRef",f:VR},37:{n:"PtgArea",f:FR},38:{n:"PtgMemArea",f:sO},39:{n:"PtgMemErr",f:fO},40:{n:"PtgMemNoMem",f:dO},41:{n:"PtgMemFunc",f:lO},42:{n:"PtgRefErr",f:uO},43:{n:"PtgAreaErr",f:PR},44:{n:"PtgRefN",f:WR},45:{n:"PtgAreaN",f:bR},46:{n:"PtgMemAreaN",f:OO},47:{n:"PtgMemNoMemN",f:FO},57:{n:"PtgNameX",f:oO},58:{n:"PtgRef3d",f:zR},59:{n:"PtgArea3d",f:DR},60:{n:"PtgRefErr3d",f:cO},61:{n:"PtgAreaErr3d",f:IR},255:{}},PO={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},IO={1:{n:"PtgElfLel",f:Lw},2:{n:"PtgElfRw",f:EO},3:{n:"PtgElfCol",f:pO},6:{n:"PtgElfRwV",f:_O},7:{n:"PtgElfColV",f:vO},10:{n:"PtgElfRadical",f:xO},11:{n:"PtgElfRadicalS",f:yO},13:{n:"PtgElfColS",f:gO},15:{n:"PtgElfColSV",f:mO},16:{n:"PtgElfRadicalLel",f:wO},25:{n:"PtgList",f:TO},29:{n:"PtgSxName",f:CO},255:{}},bO={0:{n:"PtgAttrNoop",f:DO},1:{n:"PtgAttrSemi",f:BR},2:{n:"PtgAttrIf",f:MR},4:{n:"PtgAttrChoose",f:$R},8:{n:"PtgAttrGoto",f:NR},16:{n:"PtgAttrSum",f:KR},32:{n:"PtgAttrBaxcel",f:Gg},33:{n:"PtgAttrBaxcel",f:Gg},64:{n:"PtgAttrSpace",f:UR},65:{n:"PtgAttrSpaceSemi",f:HR},128:{n:"PtgAttrIfError",f:LR},255:{}};function kO(e,t,r,n){if(n.biff<8)return Nr(e,t);for(var i=e.l+t,o=[],a=0;a!==r.length;++a)switch(r[a][0]){case"PtgArray":r[a][1]=nO(e,0,n),o.push(r[a][1]);break;case"PtgMemArea":r[a][2]=rO(e,r[a][1],n),o.push(r[a][2]);break;case"PtgExp":n&&n.biff==12&&(r[a][1][1]=e.read_shift(4),o.push(r[a][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[a][0]}return t=i-e.l,t!==0&&o.push(Nr(e,t)),o}function $O(e,t,r){for(var n=e.l+t,i,o,a=[];n!=e.l;)t=n-e.l,o=e[e.l],i=jg[o]||jg[PO[o]],(o===24||o===25)&&(i=(o===24?IO:bO)[e[e.l+1]]),!i||!i.f?Nr(e,t):a.push([i.n,i.f(e,t,r)]);return a}function NO(e){for(var t=[],r=0;r=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function LO(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function Bw(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var n=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!n)return"SH33TJSERR1";var i="";if(r.biff>8)switch(e[n[0]][0]){case 357:return i=n[1]==-1?"#REF":e.SheetNames[n[1]],n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[n[0]][0];case 355:default:return"SH33TJSSRC"+e[n[0]][0]}switch(e[n[0]][0][0]){case 1025:return i=n[1]==-1?"#REF":e.SheetNames[n[1]]||"SH33TJSERR3",n[1]==n[2]?i:i+":"+e.SheetNames[n[2]];case 14849:return e[n[0]].slice(1).map(function(o){return o.Name}).join(";;");default:return e[n[0]][0][3]?(i=n[1]==-1?"#REF":e[n[0]][0][3][n[1]]||"SH33TJSERR4",n[1]==n[2]?i:i+":"+e[n[0]][0][3][n[2]]):"SH33TJSERR2"}}function Xg(e,t,r){var n=Bw(e,t,r);return n=="#REF"?n:LO(n,r)}function mo(e,t,r,n,i){var o=i&&i.biff||8,a={s:{c:0,r:0},e:{c:0,r:0}},s=[],l,u,c,f=0,d=0,h,m="";if(!e[0]||!e[0][0])return"";for(var p=-1,g="",x=0,w=e[0].length;x=0){switch(e[0][p][1][0]){case 0:g=Je(" ",e[0][p][1][1]);break;case 1:g=Je("\r",e[0][p][1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}u=u+g,p=-1}s.push(u+MO[y[0]]+l);break;case"PtgIsect":l=s.pop(),u=s.pop(),s.push(u+" "+l);break;case"PtgUnion":l=s.pop(),u=s.pop(),s.push(u+","+l);break;case"PtgRange":l=s.pop(),u=s.pop(),s.push(u+":"+l);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":c=wa(y[1][1],a,i),s.push(ya(c,o));break;case"PtgRefN":c=r?wa(y[1][1],r,i):y[1][1],s.push(ya(c,o));break;case"PtgRef3d":f=y[1][1],c=wa(y[1][2],a,i),m=Xg(n,f,i),s.push(m+"!"+ya(c,o));break;case"PtgFunc":case"PtgFuncVar":var E=y[1][0],b=y[1][1];E||(E=0),E&=127;var k=E==0?[]:s.slice(-E);s.length-=E,b==="User"&&(b=k.shift()),s.push(b+"("+k.join(",")+")");break;case"PtgBool":s.push(y[1]?"TRUE":"FALSE");break;case"PtgInt":s.push(y[1]);break;case"PtgNum":s.push(String(y[1]));break;case"PtgStr":s.push('"'+y[1].replace(/"/g,'""')+'"');break;case"PtgErr":s.push(y[1]);break;case"PtgAreaN":h=Pg(y[1][1],r?{s:r}:a,i),s.push(kc(h,i));break;case"PtgArea":h=Pg(y[1][1],a,i),s.push(kc(h,i));break;case"PtgArea3d":f=y[1][1],h=y[1][2],m=Xg(n,f,i),s.push(m+"!"+kc(h,i));break;case"PtgAttrSum":s.push("SUM("+s.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":d=y[1][2];var S=(n.names||[])[d-1]||(n[0]||[])[d],A=S?S.Name:"SH33TJSNAME"+String(d);A&&A.slice(0,6)=="_xlfn."&&!i.xlfn&&(A=A.slice(6)),s.push(A);break;case"PtgNameX":var C=y[1][1];d=y[1][2];var L;if(i.biff<=5)C<0&&(C=-C),n[C]&&(L=n[C][d]);else{var B="";if(((n[C]||[])[0]||[])[0]==14849||(((n[C]||[])[0]||[])[0]==1025?n[C][d]&&n[C][d].itab>0&&(B=n.SheetNames[n[C][d].itab-1]+"!"):B=n.SheetNames[d-1]+"!"),n[C]&&n[C][d])B+=n[C][d].Name;else if(n[0]&&n[0][d])B+=n[0][d].Name;else{var U=(Bw(n,C,i)||"").split(";;");U[d-1]?B=U[d-1]:B+="SH33TJSERRX"}s.push(B);break}L||(L={Name:"SH33TJSERRY"}),s.push(L.Name);break;case"PtgParen":var H="(",X=")";if(p>=0){switch(g="",e[0][p][1][0]){case 2:H=Je(" ",e[0][p][1][1])+H;break;case 3:H=Je("\r",e[0][p][1][1])+H;break;case 4:X=Je(" ",e[0][p][1][1])+X;break;case 5:X=Je("\r",e[0][p][1][1])+X;break;default:if(i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][p][1][0])}p=-1}s.push(H+s.pop()+X);break;case"PtgRefErr":s.push("#REF!");break;case"PtgRefErr3d":s.push("#REF!");break;case"PtgExp":c={c:y[1][1],r:y[1][0]};var ee={c:r.c,r:r.r};if(n.sharedf[He(c)]){var ae=n.sharedf[He(c)];s.push(mo(ae,a,ee,n,i))}else{var he=!1;for(l=0;l!=n.arrayf.length;++l)if(u=n.arrayf[l],!(c.cu[0].e.c)&&!(c.ru[0].e.r)){s.push(mo(u[1],a,ee,n,i)),he=!0;break}he||s.push(y[1])}break;case"PtgArray":s.push("{"+NO(y[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":p=x;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":s.push("");break;case"PtgAreaErr":s.push("#REF!");break;case"PtgAreaErr3d":s.push("#REF!");break;case"PtgList":s.push("Table"+y[1].idx+"[#"+y[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(y));default:throw new Error("Unrecognized Formula Token: "+String(y))}var _e=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(i.biff!=3&&p>=0&&_e.indexOf(e[0][x][0])==-1){y=e[0][p];var oe=!0;switch(y[1][0]){case 4:oe=!1;case 0:g=Je(" ",y[1][1]);break;case 5:oe=!1;case 1:g=Je("\r",y[1][1]);break;default:if(g="",i.WTF)throw new Error("Unexpected PtgAttrSpaceType "+y[1][0])}s.push((oe?g:"")+s.pop()+(oe?"":g)),p=-1}}if(s.length>1&&i.WTF)throw new Error("bad formula stack");return s[0]}function BO(e){if(e==null){var t=Z(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return ai(e);return ai(0)}function UO(e,t,r,n,i){var o=si(t,r,i),a=BO(e.v),s=Z(6),l=33;s.write_shift(2,l),s.write_shift(4,0);for(var u=Z(e.bf.length),c=0;c0?kO(e,o,i,r):null;return[i,a]}var HO=Cu,Au=Cu,VO=Cu,WO=Cu,zO={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},Uw={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},GO={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function jO(e){var t="of:="+e.replace(jd,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function XO(e){return e.replace(/\./,"!")}var Ea=typeof Map<"u";function Yd(e,t,r){var n=0,i=e.length;if(r){if(Ea?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var o=Ea?r.get(t):r[t];n-1?(r.width=e0(n),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function Hw(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];t=="xlml"&&(r=[1,1,1,1,.5,.5]),e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function Hn(e,t,r){var n=r.revssf[t.z!=null?t.z:"General"],i=60,o=e.length;if(n==null&&r.ssf){for(;i<392;++i)if(r.ssf[i]==null){Nx(t.z,i),r.ssf[i]=t.z,r.revssf[t.z]=n=i;break}}for(i=0;i!=o;++i)if(e[i].numFmtId===n)return i;return e[o]={numFmtId:n,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},o}function KO(e,t,r){if(e&&e["!ref"]){var n=Xe(e["!ref"]);if(n.e.c',r=0;r!=e.length;++r)t+='';return t+""}function qO(e,t,r,n,i){var o=!1,a={},s=null;if(n.bookType!=="xlsx"&&t.vbaraw){var l=t.SheetNames[r];try{t.Workbook&&(l=t.Workbook.Sheets[r].CodeName||l)}catch{}o=!0,a.codeName=jr(Ue(l))}if(e&&e["!outline"]){var u={summaryBelow:1,summaryRight:1};e["!outline"].above&&(u.summaryBelow=0),e["!outline"].left&&(u.summaryRight=0),s=(s||"")+fe("outlinePr",null,u)}!o&&!s||(i[i.length]=fe("sheetPr",s,a))}var QO=["objects","scenarios","selectLockedCells","selectUnlockedCells"],ZO=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function JO(e){var t={sheet:1};return QO.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),ZO.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=Tw(e.password).toString(16).toUpperCase()),fe("sheetProtection",null,t)}function eF(e){return Hw(e),fe("pageMargins",null,e)}function tF(e,t){for(var r=[""],n,i=0;i!=t.length;++i)(n=t[i])&&(r[r.length]=fe("col",null,Ru(i,n)));return r[r.length]="",r.join("")}function rF(e,t,r,n){var i=typeof e.ref=="string"?e.ref:ot(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var o=r.Workbook.Names,a=Jt(i);a.s.r==a.e.r&&(a.e.r=Jt(t["!ref"]).e.r,i=ot(a));for(var s=0;s"u"&&(e.z=rt[14]);break;default:i=e.v;break}var s=wt("v",Ue(i)),l={r:t},u=Hn(n.cellXfs,e,n);switch(u!==0&&(l.s=u),e.t){case"n":break;case"d":l.t="d";break;case"b":l.t="b";break;case"e":l.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(n&&n.bookSST){s=wt("v",""+Yd(n.Strings,e.v,n.revStrings)),l.t="s";break}l.t="str";break}if(e.t!=o&&(e.t=o,e.v=a),typeof e.f=="string"&&e.f){var c=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;s=fe("f",Ue(e.f),c)+(e.v!=null?s:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(l.cm=1),fe("c",s,l)}function oF(e,t,r,n){var i=[],o=[],a=Xe(e["!ref"]),s="",l,u="",c=[],f=0,d=0,h=e["!rows"],m=Array.isArray(e),p={r:u},g,x=-1;for(d=a.s.c;d<=a.e.c;++d)c[d]=Rt(d);for(f=a.s.r;f<=a.e.r;++f){for(o=[],u=yt(f),d=a.s.c;d<=a.e.c;++d){l=c[d]+u;var w=m?(e[f]||[])[d]:e[l];w!==void 0&&(s=iF(w,l,e,t))!=null&&o.push(s)}(o.length>0||h&&h[f])&&(p={r:u},h&&h[f]&&(g=h[f],g.hidden&&(p.hidden=1),x=-1,g.hpx?x=jl(g.hpx):g.hpt&&(x=g.hpt),x>-1&&(p.ht=x,p.customHeight=1),g.level&&(p.outlineLevel=g.level)),i[i.length]=fe("row",o.join(""),p))}if(h)for(;f-1&&(p.ht=x,p.customHeight=1),g.level&&(p.outlineLevel=g.level),i[i.length]=fe("row","",p));return i.join("")}function Vw(e,t,r,n){var i=[at,fe("worksheet",null,{xmlns:Ao[0],"xmlns:r":ct.r})],o=r.SheetNames[e],a=0,s="",l=r.Sheets[o];l==null&&(l={});var u=l["!ref"]||"A1",c=Xe(u);if(c.e.c>16383||c.e.r>1048575){if(t.WTF)throw new Error("Range "+u+" exceeds format limit A1:XFD1048576");c.e.c=Math.min(c.e.c,16383),c.e.r=Math.min(c.e.c,1048575),u=ot(c)}n||(n={}),l["!comments"]=[];var f=[];qO(l,r,e,t,i),i[i.length]=fe("dimension",null,{ref:u}),i[i.length]=nF(l,t,e,r),t.sheetFormat&&(i[i.length]=fe("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),l["!cols"]!=null&&l["!cols"].length>0&&(i[i.length]=tF(l,l["!cols"])),i[a=i.length]="",l["!links"]=[],l["!ref"]!=null&&(s=oF(l,t),s.length>0&&(i[i.length]=s)),i.length>a+1&&(i[i.length]="",i[a]=i[a].replace("/>",">")),l["!protect"]&&(i[i.length]=JO(l["!protect"])),l["!autofilter"]!=null&&(i[i.length]=rF(l["!autofilter"],l,r,e)),l["!merges"]!=null&&l["!merges"].length>0&&(i[i.length]=YO(l["!merges"]));var d=-1,h,m=-1;return l["!links"].length>0&&(i[i.length]="",l["!links"].forEach(function(p){p[1].Target&&(h={ref:p[0]},p[1].Target.charAt(0)!="#"&&(m=Be(n,-1,Ue(p[1].Target).replace(/#.*$/,""),ke.HLINK),h["r:id"]="rId"+m),(d=p[1].Target.indexOf("#"))>-1&&(h.location=Ue(p[1].Target.slice(d+1))),p[1].Tooltip&&(h.tooltip=Ue(p[1].Tooltip)),i[i.length]=fe("hyperlink",null,h))}),i[i.length]=""),delete l["!links"],l["!margins"]!=null&&(i[i.length]=eF(l["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(i[i.length]=wt("ignoredErrors",fe("ignoredError",null,{numberStoredAsText:1,sqref:u}))),f.length>0&&(m=Be(n,-1,"../drawings/drawing"+(e+1)+".xml",ke.DRAW),i[i.length]=fe("drawing",null,{"r:id":"rId"+m}),l["!drawing"]=f),l["!comments"].length>0&&(m=Be(n,-1,"../drawings/vmlDrawing"+(e+1)+".vml",ke.VML),i[i.length]=fe("legacyDrawing",null,{"r:id":"rId"+m}),l["!legacy"]=m),i.length>1&&(i[i.length]="",i[1]=i[1].replace("/>",">")),i.join("")}function aF(e,t){var r={},n=e.l+t;r.r=e.read_shift(4),e.l+=4;var i=e.read_shift(2);e.l+=1;var o=e.read_shift(1);return e.l=n,o&7&&(r.level=o&7),o&16&&(r.hidden=!0),o&32&&(r.hpt=i/20),r}function sF(e,t,r){var n=Z(145),i=(r["!rows"]||[])[e]||{};n.write_shift(4,e),n.write_shift(4,0);var o=320;i.hpx?o=jl(i.hpx)*20:i.hpt&&(o=i.hpt*20),n.write_shift(2,o),n.write_shift(1,0);var a=0;i.level&&(a|=i.level),i.hidden&&(a|=16),(i.hpx||i.hpt)&&(a|=32),n.write_shift(1,a),n.write_shift(1,0);var s=0,l=n.l;n.l+=4;for(var u={r:e,c:0},c=0;c<16;++c)if(!(t.s.c>c+1<<10||t.e.cn.l?n.slice(0,n.l):n}function lF(e,t,r,n){var i=sF(n,r,t);(i.length>17||(t["!rows"]||[])[n])&&ne(e,0,i)}var uF=_i,cF=Oo;function fF(){}function dF(e,t){var r={},n=e[e.l];return++e.l,r.above=!(n&64),r.left=!(n&128),e.l+=18,r.name=_3(e),r}function hF(e,t,r){r==null&&(r=Z(84+4*e.length));var n=192;t&&(t.above&&(n&=-65),t.left&&(n&=-129)),r.write_shift(1,n);for(var i=1;i<3;++i)r.write_shift(1,0);return Vl({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),nw(e,r),r.slice(0,r.l)}function pF(e){var t=pr(e);return[t]}function gF(e,t,r){return r==null&&(r=Z(8)),wi(t,r)}function mF(e){var t=yi(e);return[t]}function vF(e,t,r){return r==null&&(r=Z(4)),Ei(t,r)}function xF(e){var t=pr(e),r=e.read_shift(1);return[t,r,"b"]}function wF(e,t,r){return r==null&&(r=Z(9)),wi(t,r),r.write_shift(1,e.v?1:0),r}function yF(e){var t=yi(e),r=e.read_shift(1);return[t,r,"b"]}function EF(e,t,r){return r==null&&(r=Z(5)),Ei(t,r),r.write_shift(1,e.v?1:0),r}function _F(e){var t=pr(e),r=e.read_shift(1);return[t,r,"e"]}function SF(e,t,r){return r==null&&(r=Z(9)),wi(t,r),r.write_shift(1,e.v),r}function TF(e){var t=yi(e),r=e.read_shift(1);return[t,r,"e"]}function CF(e,t,r){return r==null&&(r=Z(8)),Ei(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function AF(e){var t=pr(e),r=e.read_shift(4);return[t,r,"s"]}function RF(e,t,r){return r==null&&(r=Z(12)),wi(t,r),r.write_shift(4,t.v),r}function OF(e){var t=yi(e),r=e.read_shift(4);return[t,r,"s"]}function FF(e,t,r){return r==null&&(r=Z(8)),Ei(t,r),r.write_shift(4,t.v),r}function DF(e){var t=pr(e),r=Fo(e);return[t,r,"n"]}function PF(e,t,r){return r==null&&(r=Z(16)),wi(t,r),ai(e.v,r),r}function IF(e){var t=yi(e),r=Fo(e);return[t,r,"n"]}function bF(e,t,r){return r==null&&(r=Z(12)),Ei(t,r),ai(e.v,r),r}function kF(e){var t=pr(e),r=iw(e);return[t,r,"n"]}function $F(e,t,r){return r==null&&(r=Z(12)),wi(t,r),ow(e.v,r),r}function NF(e){var t=yi(e),r=iw(e);return[t,r,"n"]}function MF(e,t,r){return r==null&&(r=Z(8)),Ei(t,r),ow(e.v,r),r}function LF(e){var t=pr(e),r=Hd(e);return[t,r,"is"]}function BF(e){var t=pr(e),r=Ot(e);return[t,r,"str"]}function UF(e,t,r){return r==null&&(r=Z(12+4*e.v.length)),wi(t,r),dt(e.v,r),r.length>r.l?r.slice(0,r.l):r}function HF(e){var t=yi(e),r=Ot(e);return[t,r,"str"]}function VF(e,t,r){return r==null&&(r=Z(8+4*e.v.length)),Ei(t,r),dt(e.v,r),r.length>r.l?r.slice(0,r.l):r}function WF(e,t,r){var n=e.l+t,i=pr(e);i.r=r["!row"];var o=e.read_shift(1),a=[i,o,"b"];if(r.cellFormula){e.l+=2;var s=Au(e,n-e.l,r);a[3]=mo(s,null,i,r.supbooks,r)}else e.l=n;return a}function zF(e,t,r){var n=e.l+t,i=pr(e);i.r=r["!row"];var o=e.read_shift(1),a=[i,o,"e"];if(r.cellFormula){e.l+=2;var s=Au(e,n-e.l,r);a[3]=mo(s,null,i,r.supbooks,r)}else e.l=n;return a}function GF(e,t,r){var n=e.l+t,i=pr(e);i.r=r["!row"];var o=Fo(e),a=[i,o,"n"];if(r.cellFormula){e.l+=2;var s=Au(e,n-e.l,r);a[3]=mo(s,null,i,r.supbooks,r)}else e.l=n;return a}function jF(e,t,r){var n=e.l+t,i=pr(e);i.r=r["!row"];var o=Ot(e),a=[i,o,"str"];if(r.cellFormula){e.l+=2;var s=Au(e,n-e.l,r);a[3]=mo(s,null,i,r.supbooks,r)}else e.l=n;return a}var XF=_i,KF=Oo;function YF(e,t){return t==null&&(t=Z(4)),t.write_shift(4,e),t}function qF(e,t){var r=e.l+t,n=_i(e),i=Vd(e),o=Ot(e),a=Ot(e),s=Ot(e);e.l=r;var l={rfx:n,relId:i,loc:o,display:s};return a&&(l.Tooltip=a),l}function QF(e,t){var r=Z(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));Oo({s:ft(e[0]),e:ft(e[0])},r),Wd("rId"+t,r);var n=e[1].Target.indexOf("#"),i=n==-1?"":e[1].Target.slice(n+1);return dt(i||"",r),dt(e[1].Tooltip||"",r),dt("",r),r.slice(0,r.l)}function ZF(){}function JF(e,t,r){var n=e.l+t,i=aw(e),o=e.read_shift(1),a=[i];if(a[2]=o,r.cellFormula){var s=HO(e,n-e.l,r);a[1]=s}else e.l=n;return a}function eD(e,t,r){var n=e.l+t,i=_i(e),o=[i];if(r.cellFormula){var a=WO(e,n-e.l,r);o[1]=a,e.l=n}else e.l=n;return o}function tD(e,t,r){r==null&&(r=Z(18));var n=Ru(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(n.width||10)*256),r.write_shift(4,0);var i=0;return t.hidden&&(i|=1),typeof n.width=="number"&&(i|=2),t.level&&(i|=t.level<<8),r.write_shift(2,i),r}var Ww=["left","right","top","bottom","header","footer"];function rD(e){var t={};return Ww.forEach(function(r){t[r]=Fo(e)}),t}function nD(e,t){return t==null&&(t=Z(6*8)),Hw(e),Ww.forEach(function(r){ai(e[r],t)}),t}function iD(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function oD(e,t,r){r==null&&(r=Z(30));var n=924;return(((t||{}).Views||[])[0]||{}).RTL&&(n|=32),r.write_shift(2,n),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function aD(e){var t=Z(24);return t.write_shift(4,4),t.write_shift(4,1),Oo(e,t),t}function sD(e,t){return t==null&&(t=Z(16*4+2)),t.write_shift(2,e.password?Tw(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function lD(){}function uD(){}function cD(e,t,r,n,i,o,a){if(t.v===void 0)return!1;var s="";switch(t.t){case"b":s=t.v?"1":"0";break;case"d":t=Xt(t),t.z=t.z||rt[14],t.v=jt(Nt(t.v)),t.t="n";break;case"n":case"e":s=""+t.v;break;default:s=t.v;break}var l={r,c:n};switch(l.s=Hn(i.cellXfs,t,i),t.l&&o["!links"].push([He(l),t.l]),t.c&&o["!comments"].push([He(l),t.c]),t.t){case"s":case"str":return i.bookSST?(s=Yd(i.Strings,t.v,i.revStrings),l.t="s",l.v=s,a?ne(e,18,FF(t,l)):ne(e,7,RF(t,l))):(l.t="str",a?ne(e,17,VF(t,l)):ne(e,6,UF(t,l))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?a?ne(e,13,MF(t,l)):ne(e,2,$F(t,l)):a?ne(e,16,bF(t,l)):ne(e,5,PF(t,l)),!0;case"b":return l.t="b",a?ne(e,15,EF(t,l)):ne(e,4,wF(t,l)),!0;case"e":return l.t="e",a?ne(e,14,CF(t,l)):ne(e,3,SF(t,l)),!0}return a?ne(e,12,vF(t,l)):ne(e,1,gF(t,l)),!0}function fD(e,t,r,n){var i=Xe(t["!ref"]||"A1"),o,a="",s=[];ne(e,145);var l=Array.isArray(t),u=i.e.r;t["!rows"]&&(u=Math.max(i.e.r,t["!rows"].length-1));for(var c=i.s.r;c<=u;++c){a=yt(c),lF(e,t,i,c);var f=!1;if(c<=i.e.r)for(var d=i.s.c;d<=i.e.c;++d){c===i.s.r&&(s[d]=Rt(d)),o=s[d]+a;var h=l?(t[c]||[])[d]:t[o];if(!h){f=!1;continue}f=cD(e,h,c,d,n,t,f)}}ne(e,146)}function dD(e,t){!t||!t["!merges"]||(ne(e,177,YF(t["!merges"].length)),t["!merges"].forEach(function(r){ne(e,176,KF(r))}),ne(e,178))}function hD(e,t){!t||!t["!cols"]||(ne(e,390),t["!cols"].forEach(function(r,n){r&&ne(e,60,tD(n,r))}),ne(e,391))}function pD(e,t){!t||!t["!ref"]||(ne(e,648),ne(e,649,aD(Xe(t["!ref"]))),ne(e,650))}function gD(e,t,r){t["!links"].forEach(function(n){if(n[1].Target){var i=Be(r,-1,n[1].Target.replace(/#.*$/,""),ke.HLINK);ne(e,494,QF(n,i))}}),delete t["!links"]}function mD(e,t,r,n){if(t["!comments"].length>0){var i=Be(n,-1,"../drawings/vmlDrawing"+(r+1)+".vml",ke.VML);ne(e,551,Wd("rId"+i)),t["!legacy"]=i}}function vD(e,t,r,n){if(t["!autofilter"]){var i=t["!autofilter"],o=typeof i.ref=="string"?i.ref:ot(i.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var a=r.Workbook.Names,s=Jt(o);s.s.r==s.e.r&&(s.e.r=Jt(t["!ref"]).e.r,o=ot(s));for(var l=0;l16383||l.e.r>1048575){if(t.WTF)throw new Error("Range "+(a["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");l.e.c=Math.min(l.e.c,16383),l.e.r=Math.min(l.e.c,1048575)}return a["!links"]=[],a["!comments"]=[],ne(i,129),(r.vbaraw||a["!outline"])&&ne(i,147,hF(s,a["!outline"])),ne(i,148,cF(l)),xD(i,a,r.Workbook),hD(i,a),fD(i,a,e,t),wD(i,a),vD(i,a,r,e),dD(i,a),gD(i,a,n),a["!margins"]&&ne(i,476,nD(a["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&pD(i,a),mD(i,a,e,n),ne(i,130),i.end()}function ED(e,t){e.l+=10;var r=Ot(e);return{name:r}}var _D=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]];function SD(e){return!e.Workbook||!e.Workbook.WBProps?"false":e3(e.Workbook.WBProps.date1904)?"true":"false"}var TD="][*?/\\".split("");function zw(e,t){if(e.length>31){if(t)return!1;throw new Error("Sheet names cannot exceed 31 chars")}var r=!0;return TD.forEach(function(n){if(e.indexOf(n)!=-1){if(!t)throw new Error("Sheet name cannot contain : \\ / ? * [ ]");r=!1}}),r}function CD(e,t,r){e.forEach(function(n,i){zw(n);for(var o=0;o22)throw new Error("Bad Code Name: Worksheet"+a)}})}function AD(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];CD(e.SheetNames,t,!!e.vbaraw);for(var r=0;r0,n={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(_D.forEach(function(s){e.Workbook.WBProps[s[0]]!=null&&e.Workbook.WBProps[s[0]]!=s[1]&&(n[s[0]]=e.Workbook.WBProps[s[0]])}),e.Workbook.WBProps.CodeName&&(n.codeName=e.Workbook.WBProps.CodeName,delete n.CodeName)),t[t.length]=fe("workbookPr",null,n);var i=e.Workbook&&e.Workbook.Sheets||[],o=0;if(i&&i[0]&&i[0].Hidden){for(t[t.length]="",o=0;o!=e.SheetNames.length&&!(!i[o]||!i[o].Hidden);++o);o==e.SheetNames.length&&(o=0),t[t.length]='',t[t.length]=""}for(t[t.length]="",o=0;o!=e.SheetNames.length;++o){var a={name:Ue(e.SheetNames[o].slice(0,31))};if(a.sheetId=""+(o+1),a["r:id"]="rId"+(o+1),i[o])switch(i[o].Hidden){case 1:a.state="hidden";break;case 2:a.state="veryHidden";break}t[t.length]=fe("sheet",null,a)}return t[t.length]="",r&&(t[t.length]="",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(s){var l={name:s.Name};s.Comment&&(l.comment=s.Comment),s.Sheet!=null&&(l.localSheetId=""+s.Sheet),s.Hidden&&(l.hidden="1"),s.Ref&&(t[t.length]=fe("definedName",Ue(s.Ref),l))}),t[t.length]=""),t.length>2&&(t[t.length]="",t[1]=t[1].replace("/>",">")),t.join("")}function RD(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=Jf(e),r.name=Ot(e),r}function OD(e,t){return t||(t=Z(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),Wd(e.strRelID,t),dt(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function FD(e,t){var r={},n=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var i=t>8?Ot(e):"";return i.length>0&&(r.CodeName=i),r.autoCompressPictures=!!(n&65536),r.backupFile=!!(n&64),r.checkCompatibility=!!(n&4096),r.date1904=!!(n&1),r.filterPrivacy=!!(n&8),r.hidePivotFieldList=!!(n&1024),r.promptedSolutions=!!(n&16),r.publishItems=!!(n&2048),r.refreshAllConnections=!!(n&262144),r.saveExternalLinkValues=!!(n&128),r.showBorderUnselectedTables=!!(n&4),r.showInkAnnotation=!!(n&32),r.showObjects=["all","placeholders","none"][n>>13&3],r.showPivotChartFilter=!!(n&32768),r.updateLinks=["userSet","never","always"][n>>8&3],r}function DD(e,t){t||(t=Z(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),nw(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function PD(e,t,r){var n=e.l+t;e.l+=4,e.l+=1;var i=e.read_shift(4),o=S3(e),a=VO(e,0,r),s=Vd(e);e.l=n;var l={Name:o,Ptg:a};return i<268435455&&(l.Sheet=i),s&&(l.Comment=s),l}function ID(e,t){ne(e,143);for(var r=0;r!=t.SheetNames.length;++r){var n=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,i={Hidden:n,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};ne(e,156,OD(i))}ne(e,144)}function bD(e,t){t||(t=Z(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return dt("SheetJS",t),dt($l.version,t),dt($l.version,t),dt("7262",t),t.length>t.l?t.slice(0,t.l):t}function kD(e,t){t||(t=Z(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function $D(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,n=0,i=-1,o=-1;ni||(ne(e,135),ne(e,158,kD(i)),ne(e,136))}}function ND(e,t){var r=Gt();return ne(r,131),ne(r,128,bD()),ne(r,153,DD(e.Workbook&&e.Workbook.WBProps||null)),$D(r,e),ID(r,e),ne(r,132),r.end()}function MD(e,t,r){return(t.slice(-4)===".bin"?ND:Gw)(e)}function LD(e,t,r,n,i){return(t.slice(-4)===".bin"?yD:Vw)(e,r,n,i)}function BD(e,t,r){return(t.slice(-4)===".bin"?nR:Rw)(e,r)}function UD(e,t,r){return(t.slice(-4)===".bin"?DA:Sw)(e,r)}function HD(e,t,r){return(t.slice(-4)===".bin"?wR:Iw)(e)}function VD(e){return(e.slice(-4)===".bin"?fR:Dw)()}function WD(e,t){var r=[];return e.Props&&r.push(B3(e.Props,t)),e.Custprops&&r.push(U3(e.Props,e.Custprops)),r.join("")}function zD(){return""}function GD(e,t){var r=[''];return t.cellXfs.forEach(function(n,i){var o=[];o.push(fe("NumberFormat",null,{"ss:Format":Ue(rt[n.numFmtId])}));var a={"ss:ID":"s"+(21+i)};r.push(fe("Style",o.join(""),a))}),fe("Styles",r.join(""))}function jw(e){return fe("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+Xd(e.Ref,{r:0,c:0})})}function jD(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],n=0;n"),e["!margins"].header&&i.push(fe("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&i.push(fe("Footer",null,{"x:Margin":e["!margins"].footer})),i.push(fe("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),i.push("")),n&&n.Workbook&&n.Workbook.Sheets&&n.Workbook.Sheets[r])if(n.Workbook.Sheets[r].Hidden)i.push(fe("Visible",n.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var o=0;o")}return((((n||{}).Workbook||{}).Views||[])[0]||{}).RTL&&i.push(""),e["!protect"]&&(i.push(wt("ProtectContents","True")),e["!protect"].objects&&i.push(wt("ProtectObjects","True")),e["!protect"].scenarios&&i.push(wt("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?i.push(wt("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&i.push(wt("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(a){e["!protect"][a[0]]&&i.push("<"+a[1]+"/>")})),i.length==0?"":fe("WorksheetOptions",i.join(""),{xmlns:qt.x})}function YD(e){return e.map(function(t){var r=J4(t.t||""),n=fe("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return fe("Comment",n,{"ss:Author":t.a})}).join("")}function qD(e,t,r,n,i,o,a){if(!e||e.v==null&&e.f==null)return"";var s={};if(e.f&&(s["ss:Formula"]="="+Ue(Xd(e.f,a))),e.F&&e.F.slice(0,t.length)==t){var l=ft(e.F.slice(t.length+1));s["ss:ArrayRange"]="RC:R"+(l.r==a.r?"":"["+(l.r-a.r)+"]")+"C"+(l.c==a.c?"":"["+(l.c-a.c)+"]")}if(e.l&&e.l.Target&&(s["ss:HRef"]=Ue(e.l.Target),e.l.Tooltip&&(s["x:HRefScreenTip"]=Ue(e.l.Tooltip))),r["!merges"])for(var u=r["!merges"],c=0;c!=u.length;++c)u[c].s.c!=a.c||u[c].s.r!=a.r||(u[c].e.c>u[c].s.c&&(s["ss:MergeAcross"]=u[c].e.c-u[c].s.c),u[c].e.r>u[c].s.r&&(s["ss:MergeDown"]=u[c].e.r-u[c].s.r));var f="",d="";switch(e.t){case"z":if(!n.sheetStubs)return"";break;case"n":f="Number",d=String(e.v);break;case"b":f="Boolean",d=e.v?"1":"0";break;case"e":f="Error",d=os[e.v];break;case"d":f="DateTime",d=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||rt[14]);break;case"s":f="String",d=Z4(e.v||"");break}var h=Hn(n.cellXfs,e,n);s["ss:StyleID"]="s"+(21+h),s["ss:Index"]=a.c+1;var m=e.v!=null?d:"",p=e.t=="z"?"":''+m+"";return(e.c||[]).length>0&&(p+=YD(e.c)),fe("Cell",p,s)}function QD(e,t){var r='"}function ZD(e,t,r,n){if(!e["!ref"])return"";var i=Xe(e["!ref"]),o=e["!merges"]||[],a=0,s=[];e["!cols"]&&e["!cols"].forEach(function(g,x){Gd(g);var w=!!g.width,y=Ru(x,g),E={"ss:Index":x+1};w&&(E["ss:Width"]=zl(y.width)),g.hidden&&(E["ss:Hidden"]="1"),s.push(fe("Column",null,E))});for(var l=Array.isArray(e),u=i.s.r;u<=i.e.r;++u){for(var c=[QD(u,(e["!rows"]||[])[u])],f=i.s.c;f<=i.e.c;++f){var d=!1;for(a=0;a!=o.length;++a)if(!(o[a].s.c>f)&&!(o[a].s.r>u)&&!(o[a].e.c"),c.length>2&&s.push(c.join(""))}return s.join("")}function JD(e,t,r){var n=[],i=r.SheetNames[e],o=r.Sheets[i],a=o?XD(o,t,e,r):"";return a.length>0&&n.push(""+a+""),a=o?ZD(o,t,e,r):"",a.length>0&&n.push(""),n.push(KD(o,t,e,r)),n.join("")}function e6(e,t){t||(t={}),e.SSF||(e.SSF=Xt(rt)),e.SSF&&(_u(),Eu(e.SSF),t.revssf=Su(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],Hn(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(WD(e,t)),r.push(zD()),r.push(""),r.push("");for(var n=0;n-1||hw.indexOf(i[o][0])>-1||i[o][1]!=null&&u.push(i[o]);n.length&&Ve.utils.cfb_add(t,"/SummaryInformation",Bg(n,Mc.SI,l,kg)),(r.length||u.length)&&Ve.utils.cfb_add(t,"/DocumentSummaryInformation",Bg(r,Mc.DSI,s,bg,u.length?u:null,Mc.UDI))}function r6(e,t){var r=t||{},n=Ve.utils.cfb_new({root:"R"}),i="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":i="/Workbook",r.biff=8;break;case"biff5":i="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return Ve.utils.cfb_add(n,i,Xw(e,r)),r.biff==8&&(e.Props||e.Custprops)&&t6(e,n),r.biff==8&&e.vbaraw&&yR(n,Ve.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),n}var n6={0:{f:aF},1:{f:pF},2:{f:kF},3:{f:_F},4:{f:xF},5:{f:DF},6:{f:BF},7:{f:AF},8:{f:jF},9:{f:GF},10:{f:WF},11:{f:zF},12:{f:mF},13:{f:NF},14:{f:TF},15:{f:yF},16:{f:IF},17:{f:HF},18:{f:OF},19:{f:Hd},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:PD},40:{},42:{},43:{f:BA},44:{f:MA},45:{f:VA},46:{f:zA},47:{f:WA},48:{},49:{f:m3},50:{},51:{f:aR},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:vA},62:{f:LF},63:{f:dR},64:{f:lD},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Nr,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:iD},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:dF},148:{f:uF,p:16},151:{f:ZF},152:{},153:{f:FD},154:{},155:{},156:{f:RD},157:{},158:{},159:{T:1,f:RA},160:{T:-1},161:{T:1,f:_i},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:XF},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:iR},336:{T:-1},337:{f:uR,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:Jf},357:{},358:{},359:{},360:{T:1},361:{},362:{f:fA},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:JF},427:{f:eD},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:rD},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:fF},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:qF},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:Jf},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:vR},633:{T:1},634:{T:-1},635:{T:1,f:gR},636:{T:-1},637:{f:y3},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:ED},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:uD},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}};function de(e,t,r,n){var i=t;if(!isNaN(i)){var o=n||(r||[]).length||0,a=e.next(4);a.write_shift(2,i),a.write_shift(2,o),o>0&&Ld(r)&&e.push(r)}}function i6(e,t,r,n){var i=n||(r||[]).length||0;if(i<=8224)return de(e,t,r,i);var o=t;if(!isNaN(o)){for(var a=r.parts||[],s=0,l=0,u=0;u+(a[s]||8224)<=8224;)u+=a[s]||8224,s++;var c=e.next(4);for(c.write_shift(2,o),c.write_shift(2,u),e.push(r.slice(l,l+u)),l+=u;l=0&&i<65536?de(e,2,EA(r,n,i)):de(e,3,yA(r,n,i));return;case"b":case"e":de(e,5,o6(r,n,t.v,t.t));return;case"s":case"str":de(e,4,a6(r,n,(t.v||"").slice(0,255)));return}de(e,1,ss(null,r,n))}function l6(e,t,r,n){var i=Array.isArray(t),o=Xe(t["!ref"]||"A1"),a,s="",l=[];if(o.e.c>255||o.e.r>16383){if(n.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");o.e.c=Math.min(o.e.c,255),o.e.r=Math.min(o.e.c,16383),a=ot(o)}for(var u=o.s.r;u<=o.e.r;++u){s=yt(u);for(var c=o.s.c;c<=o.e.c;++c){u===o.s.r&&(l[c]=Rt(c)),a=l[c]+s;var f=i?(t[u]||[])[c]:t[a];f&&s6(e,f,u,c)}}}function u6(e,t){for(var r=t||{},n=Gt(),i=0,o=0;o255||h.e.r>=m){if(t.WTF)throw new Error("Range "+(o["!ref"]||"A1")+" exceeds format limit A1:IV16384");h.e.c=Math.min(h.e.c,255),h.e.r=Math.min(h.e.c,m-1)}de(n,2057,zd(r,16,t)),de(n,13,ir(1)),de(n,12,ir(100)),de(n,15,bt(!0)),de(n,17,bt(!1)),de(n,16,ai(.001)),de(n,95,bt(!0)),de(n,42,bt(!1)),de(n,43,bt(!1)),de(n,130,ir(1)),de(n,128,lA([0,0])),de(n,131,bt(!1)),de(n,132,bt(!1)),u&&g6(n,o["!cols"]),de(n,512,sA(h,t)),u&&(o["!links"]=[]);for(var p=h.s.r;p<=h.e.r;++p){f=yt(p);for(var g=h.s.c;g<=h.e.c;++g){p===h.s.r&&(d[g]=Rt(g)),c=d[g]+f;var x=l?(o[p]||[])[g]:o[c];x&&(m6(n,x,p,g,t),u&&x.l&&o["!links"].push([c,x.l]))}}var w=s.CodeName||s.name||i;return u&&de(n,574,rA((a.Views||[])[0])),u&&(o["!merges"]||[]).length&&de(n,229,hA(o["!merges"])),u&&p6(n,o),de(n,442,yw(w)),u&&d6(n,o),de(n,10),n.end()}function x6(e,t,r){var n=Gt(),i=(e||{}).Workbook||{},o=i.Sheets||[],a=i.WBProps||{},s=r.biff==8,l=r.biff==5;if(de(n,2057,zd(e,5,r)),r.bookType=="xla"&&de(n,135),de(n,225,s?ir(1200):null),de(n,193,W3(2)),l&&de(n,191),l&&de(n,192),de(n,226),de(n,92,Z3("SheetJS",r)),de(n,66,ir(s?1200:1252)),s&&de(n,353,ir(0)),s&&de(n,448),de(n,317,wA(e.SheetNames.length)),s&&e.vbaraw&&de(n,211),s&&e.vbaraw){var u=a.CodeName||"ThisWorkbook";de(n,442,yw(u))}de(n,156,ir(17)),de(n,25,bt(!1)),de(n,18,bt(!1)),de(n,19,ir(0)),s&&de(n,431,bt(!1)),s&&de(n,444,ir(0)),de(n,61,tA()),de(n,64,bt(!1)),de(n,141,ir(0)),de(n,34,bt(SD(e)=="true")),de(n,14,bt(!0)),s&&de(n,439,bt(!1)),de(n,218,ir(0)),c6(n,e,r),f6(n,e.SSF,r),h6(n,r),s&&de(n,352,bt(!1));var c=n.end(),f=Gt();s&&de(f,140,mA()),s&&r.Strings&&i6(f,252,eA(r.Strings)),de(f,10);var d=f.end(),h=Gt(),m=0,p=0;for(p=0;p255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255). Data may be lost.")}}var o=t||{};switch(o.biff||2){case 8:case 5:return w6(e,t);case 4:case 3:case 2:return u6(e,t)}throw new Error("invalid type "+o.bookType+" for BIFF")}function y6(e,t,r,n){for(var i=e["!merges"]||[],o=[],a=t.s.c;a<=t.e.c;++a){for(var s=0,l=0,u=0;ur||i[u].s.c>a)&&!(i[u].e.r1&&(h.rowspan=s),l>1&&(h.colspan=l),n.editable?d=''+d+"":f&&(h["data-t"]=f&&f.t||"z",f.v!=null&&(h["data-v"]=f.v),f.z!=null&&(h["data-z"]=f.z),f.l&&(f.l.Target||"#").charAt(0)!="#"&&(d=''+d+"")),h.id=(n.id||"sjs")+"-"+c,o.push(fe("td",d,h))}}var m="";return m+o.join("")+"
"}var E6='SheetJS Table Export',_6="";function S6(e,t,r){var n=[];return n.join("")+""}function Kw(e,t){var r=t||{},n=r.header!=null?r.header:E6,i=r.footer!=null?r.footer:_6,o=[n],a=Jt(e["!ref"]);r.dense=Array.isArray(e),o.push(S6(e,a,r));for(var s=a.s.r;s<=a.e.r;++s)o.push(y6(e,a,s,r));return o.push("
"+i),o.join("")}function Yw(e,t,r){var n=r||{},i=0,o=0;if(n.origin!=null)if(typeof n.origin=="number")i=n.origin;else{var a=typeof n.origin=="string"?ft(n.origin):n.origin;i=a.r,o=a.c}var s=t.getElementsByTagName("tr"),l=Math.min(n.sheetRows||1e7,s.length),u={s:{r:0,c:0},e:{r:i,c:o}};if(e["!ref"]){var c=Jt(e["!ref"]);u.s.r=Math.min(u.s.r,c.s.r),u.s.c=Math.min(u.s.c,c.s.c),u.e.r=Math.max(u.e.r,c.e.r),u.e.c=Math.max(u.e.c,c.e.c),i==-1&&(u.e.r=i=c.e.r+1)}var f=[],d=0,h=e["!rows"]||(e["!rows"]=[]),m=0,p=0,g=0,x=0,w=0,y=0;for(e["!cols"]||(e["!cols"]=[]);m1||y>1)&&f.push({s:{r:p+i,c:x+o},e:{r:p+i+(w||1)-1,c:x+o+(y||1)-1}});var L={t:"s",v:S},B=k.getAttribute("data-t")||k.getAttribute("t")||"";S!=null&&(S.length==0?L.t=B||"z":n.raw||S.trim().length==0||B=="s"||(S==="TRUE"?L={t:"b",v:!0}:S==="FALSE"?L={t:"b",v:!1}:isNaN(qr(S))?isNaN(Ha(S).getDate())||(L={t:"d",v:Nt(S)},n.cellDates||(L={t:"n",v:jt(L.v)}),L.z=n.dateNF||rt[14]):L={t:"n",v:qr(S)})),L.z===void 0&&A!=null&&(L.z=A);var U="",H=k.getElementsByTagName("A");if(H&&H.length)for(var X=0;X=l&&(e["!fullref"]=ot((u.e.r=s.length-m+p-1+i,u))),e}function qw(e,t){var r=t||{},n=r.dense?[]:{};return Yw(n,e,t)}function T6(e,t){return xi(qw(e,t),t)}function Kg(e){var t="",r=C6(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function C6(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}var A6=function(){var e=["",'',"",'',"",'',"",""].join(""),t=""+e+"";return function(){return at+t}}(),Yg=function(){var e=function(o){return Ue(o).replace(/ +/g,function(a){return''}).replace(/\t/g,"").replace(/\n/g,"
").replace(/^ /,"").replace(/ $/,"")},t=`
`,r=`
-`,n=function(o,a,s){var l=[];l.push('
+`,n=function(o,a,s){var l=[];l.push('
`);var u=0,c=0,f=Jt(o["!ref"]||"A1"),d=o["!merges"]||[],h=0,m=Array.isArray(o);if(o["!cols"])for(c=0;c<=f.e.c;++c)l.push("
`);var p="",g=o["!rows"]||[];for(u=0;u
`);for(;u<=f.e.r;++u){for(p=g[u]?' table:style-name="ro'+g[u].ods+'"':"",l.push("
-`),c=0;cc)&&!(d[h].s.r>u)&&!(d[h].e.cc)&&!(d[h].s.r>u)&&!(d[h].e.c
`)}return l.push(`
`),l.join("")},i=function(o,a){o.push(`
@@ -270,7 +271,7 @@
`),o.push(` /
`),o.push(`
`),o.push(`
-`);var s=0;a.SheetNames.map(function(u){return a.Sheets[u]}).forEach(function(u){if(u&&u["!cols"]){for(var c=0;c
+`);var s=0;a.SheetNames.map(function(u){return a.Sheets[u]}).forEach(function(u){if(u&&u["!cols"]){for(var c=0;c
`),o.push('
`),o.push(`
`),++s}}});var l=0;a.SheetNames.map(function(u){return a.Sheets[u]}).forEach(function(u){if(u&&u["!rows"]){for(var c=0;c
@@ -281,18 +282,17 @@
`),o.push(`
`),o.push(`
`),o.push(`
-`)};return function(a,s){var l=[at],u=Ma({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),c=Ma({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});s.bookType=="fods"?(l.push("
-`),l.push(Jx().replace(/office:document-meta/g,"office:meta"))):l.push("
+`)};return function(a,s){var l=[at],u=Va({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),c=Va({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});s.bookType=="fods"?(l.push("
+`),l.push(fw().replace(/office:document-meta/g,"office:meta"))):l.push("
`),i(l,a),l.push(`
`),l.push(`
`);for(var f=0;f!=a.SheetNames.length;++f)l.push(n(a.Sheets[a.SheetNames[f]],a,f));return l.push(`
`),l.push(`
-`),s.bookType=="fods"?l.push(""):l.push(""),l.join("")}}();function Bw(e,t){if(t.bookType=="fods")return Jg(e,t);var r=Fd(),n="",i=[],o=[];return n="mimetype",De(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",De(r,n,Jg(e,t)),i.push([n,"text/xml"]),o.push([n,"ContentFile"]),n="styles.xml",De(r,n,DD(e,t)),i.push([n,"text/xml"]),o.push([n,"StylesFile"]),n="meta.xml",De(r,n,at+Jx()),i.push([n,"text/xml"]),o.push([n,"MetadataFile"]),n="manifest.rdf",De(r,n,V3(o)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",De(r,n,U3(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Wl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function PD(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Er(Gr(e))}function ID(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n>7,e[t+14]|=(n&127)<<1;for(var o=0;i>=1;++o,i/=256)e[t+o]=i&255;e[t+15]|=r>=0?0:128}function La(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function Me(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function io(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function lt(e){for(var t=[],r=[0];r[0]=128;);s=e.slice(l,r[0])}break;case 5:a=4,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=La(e,r),s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(o," for Field ").concat(i," at offset ").concat(n))}var u={data:s,type:o};t[i]==null?t[i]=[u]:t[i].push(u)}return t}function gt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(Me(n*8+i.type)),i.type==2&&t.push(Me(i.data.length)),t.push(i.data))})}),Nn(t)}function vr(e){for(var t,r=[],n=[0];n[0]>>0>0),r.push(a)}return r}function Di(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:Me(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:Me(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:Me(a.data.length)}],n[2].push({data:gt(a.meta),type:2})});var o=gt(n);t.push(Me(o.length)),t.push(o),i.forEach(function(a){return t.push(a)})}),Nn(t)}function kD(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=La(t,r),i=[];r[0]>2;if(a<60)++a;else{var s=a-59;a=t[r[0]],s>1&&(a|=t[r[0]+1]<<8),s>2&&(a|=t[r[0]+2]<<16),s>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=s}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var l=0,u=0;if(o==1?(u=(t[r[0]]>>2&7)+4,l=(t[r[0]++]&224)<<3,l|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,o==2?(l=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(l=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[Nn(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(i.push(i[0].slice(-l)),u-=l;u>=i[i.length-1].length;)i.push(i[i.length-1]),u-=i[i.length-1].length;i.push(i[0].slice(-l,-l+u))}}var c=Nn(i);if(c.length!=n)throw new Error("Unexpected length: ".concat(c.length," != ").concat(n));return c}function xr(e){for(var t=[],r=0;r>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return Nn(t)}function Fc(e,t){var r=new Uint8Array(32),n=Wl(r),i=12,o=0;switch(r[0]=5,e.t){case"n":r[1]=2,bD(r,i,e.v),o|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),o|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,o,!0),r.slice(0,i)}function Dc(e,t){var r=new Uint8Array(32),n=Wl(r),i=12,o=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),o|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),o|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,o,!0),r.slice(0,i)}function sn(e){var t=lt(e);return La(t[1][0].data)}function $D(e,t,r){var n,i,o,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var s=((a=(o=e[8])==null?void 0:o[0])==null?void 0:a.data)&&io(e[8][0].data)>0||!1;if(s)throw"Math only works with normal offsets";for(var l=0,u=Wl(e[7][0].data),c=0,f=[],d=Wl(e[4][0].data),h=0,m=[],p=0;p1&&console.error("The Numbers writer currently writes only the first table");var n=Jt(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(ot(n)));var o=zl(r,{range:n,header:1}),a=["~Sh33tJ5~"];o.forEach(function(k){return k.forEach(function(b){typeof b=="string"&&a.push(b)})});var s={},l=[],u=He.read(t.numbers,{type:"base64"});u.FileIndex.map(function(k,b){return[k,u.FullPaths[b]]}).forEach(function(k){var b=k[0],D=k[1];if(b.type==2&&b.name.match(/\.iwa/)){var U=b.content,G=xr(U),J=vr(G);J.forEach(function(W){l.push(W.id),s[W.id]={deps:[],location:D,type:io(W.messages[0].meta[1][0].data)}})}}),l.sort(function(k,b){return k-b});var c=l.filter(function(k){return k>1}).map(function(k){return[k,Me(k)]});u.FileIndex.map(function(k,b){return[k,u.FullPaths[b]]}).forEach(function(k){var b=k[0];if(k[1],!!b.name.match(/\.iwa/)){var D=vr(xr(b.content));D.forEach(function(U){U.messages.forEach(function(G){c.forEach(function(J){U.messages.some(function(W){return io(W.meta[1][0].data)!=11006&&ID(W.data,J[1])})&&s[J[0]].deps.push(U.id)})})})}});for(var f=He.find(u,s[1].location),d=vr(xr(f.content)),h,m=0;m-1,i=qx();Gd(t=t||{});var o=Fd(),a="",s=0;if(t.cellXfs=[],Bn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,ew(e.Props,t)),i.coreprops.push(a),Le(t.rels,2,a,$e.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,nw(e.Custprops)),i.custprops.push(a),Le(t.rels,4,a,$e.CUST_PROPS)),s=1;s<=e.SheetNames.length;++s){var c={"!id":{}},f=e.Sheets[e.SheetNames[s-1]],d=(f||{})["!type"]||"sheet";switch(d){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,V6(s-1,a,t,e,c)),i.sheets.push(a),Le(t.wbrels,-1,"worksheets/sheet"+s+"."+r,$e.WS[0])}if(f){var h=f["!comments"],m=!1,p="";h&&h.length>0&&(p="xl/comments"+s+"."+r,De(o,p,G6(h,p)),i.comments.push(p),Le(c,-1,"../comments"+s+"."+r,$e.CMNT),m=!0),f["!legacy"]&&m&&De(o,"xl/drawings/vmlDrawing"+s+".vml",ww(s,f["!comments"])),delete f["!comments"],delete f["!legacy"]}c["!id"].rId1&&De(o,Zx(a),ro(c))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,z6(t.Strings,a,t)),i.strs.push(a),Le(t.wbrels,-1,"sharedStrings."+r,$e.SST)),a="xl/workbook."+r,De(o,a,H6(e,a)),i.workbooks.push(a),Le(t.rels,1,a,$e.WB),a="xl/theme/theme1.xml",De(o,a,vw(e.Themes,t)),i.themes.push(a),Le(t.wbrels,-1,"theme/theme1.xml",$e.THEME),a="xl/styles."+r,De(o,a,W6(e,a,t)),i.styles.push(a),Le(t.wbrels,-1,"styles."+r,$e.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Le(t.wbrels,-1,"vbaProject.bin",$e.VBA)),a="xl/metadata."+r,De(o,a,j6(a)),i.metadata.push(a),Le(t.wbrels,-1,"metadata."+r,$e.XLMETA),De(o,"[Content_Types].xml",Qx(i,t)),De(o,"_rels/.rels",ro(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",ro(t.wbrels)),delete t.revssf,delete t.ssf,o}function UD(e,t){Wi=1024,e&&!e.SSF&&(e.SSF=Xt(rt)),e&&e.SSF&&(wu(),xu(e.SSF),t.revssf=yu(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,va?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=Ew.indexOf(t.bookType)>-1,i=qx();Gd(t=t||{});var o=Fd(),a="",s=0;if(t.cellXfs=[],Bn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,ew(e.Props,t)),i.coreprops.push(a),Le(t.rels,2,a,$e.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,nw(e.Custprops)),i.custprops.push(a),Le(t.rels,4,a,$e.CUST_PROPS));var c=["SheetJ5"];for(t.tcid=0,s=1;s<=e.SheetNames.length;++s){var f={"!id":{}},d=e.Sheets[e.SheetNames[s-1]],h=(d||{})["!type"]||"sheet";switch(h){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,Dw(s-1,t,e,f)),i.sheets.push(a),Le(t.wbrels,-1,"worksheets/sheet"+s+"."+r,$e.WS[0])}if(d){var m=d["!comments"],p=!1,g="";if(m&&m.length>0){var x=!1;m.forEach(function(w){w[1].forEach(function(y){y.T==!0&&(x=!0)})}),x&&(g="xl/threadedComments/threadedComment"+s+"."+r,De(o,g,vR(m,c,t)),i.threadedcomments.push(g),Le(f,-1,"../threadedComments/threadedComment"+s+"."+r,$e.TCMNT)),g="xl/comments"+s+"."+r,De(o,g,yw(m)),i.comments.push(g),Le(f,-1,"../comments"+s+"."+r,$e.CMNT),p=!0}d["!legacy"]&&p&&De(o,"xl/drawings/vmlDrawing"+s+".vml",ww(s,d["!comments"])),delete d["!comments"],delete d["!legacy"]}f["!id"].rId1&&De(o,Zx(a),ro(f))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,fw(t.Strings,t)),i.strs.push(a),Le(t.wbrels,-1,"sharedStrings."+r,$e.SST)),a="xl/workbook."+r,De(o,a,bw(e)),i.workbooks.push(a),Le(t.rels,1,a,$e.WB),a="xl/theme/theme1.xml",De(o,a,vw(e.Themes,t)),i.themes.push(a),Le(t.wbrels,-1,"theme/theme1.xml",$e.THEME),a="xl/styles."+r,De(o,a,gw(e,t)),i.styles.push(a),Le(t.wbrels,-1,"styles."+r,$e.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Le(t.wbrels,-1,"vbaProject.bin",$e.VBA)),a="xl/metadata."+r,De(o,a,xw()),i.metadata.push(a),Le(t.wbrels,-1,"metadata."+r,$e.XLMETA),c.length>1&&(a="xl/persons/person.xml",De(o,a,xR(c)),i.people.push(a),Le(t.wbrels,-1,"persons/person.xml",$e.PEOPLE)),De(o,"[Content_Types].xml",Qx(i,t)),De(o,"_rels/.rels",ro(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",ro(t.wbrels)),delete t.revssf,delete t.ssf,o}function HD(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=en(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Uw(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Za(t.file,He.write(e,{type:Ne?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return He.write(e,t)}function VD(e,t){var r=Xt(t||{}),n=LD(e,r);return WD(n,r)}function WD(e,t){var r={},n=Ne?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?He.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(vu(i))}return t.password&&typeof encrypt_agile<"u"?Uw(encrypt_agile(i,t.password),t):t.type==="file"?Za(t.file,i):t.type=="string"?ha(i):i}function zD(e,t){var r=t||{},n=aD(e,r);return Uw(n,r)}function Rr(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return $a(Gr(n));case"binary":return Gr(n);case"string":return e;case"file":return Za(t.file,n,"utf8");case"buffer":return Ne?an(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):Rr(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function GD(e,t){switch(t.type){case"base64":return $a(e);case"binary":return e;case"string":return e;case"file":return Za(t.file,e,"binary");case"buffer":return Ne?an(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function bs(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n0&&(i=0);var f=_t(l.s.r),d=[],h=[],m=0,p=0,g=Array.isArray(e),x=l.s.r,w=0,y={};g&&!e[x]&&(e[x]=[]);var _=u.skipHidden&&e["!cols"]||[],N=u.skipHidden&&e["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(_[w]||{}).hidden)switch(d[w]=Ft(w),r=g?e[x][w]:e[d[w]+f],n){case 1:o[w]=w-l.s.c;break;case 2:o[w]=d[w];break;case 3:o[w]=u.header[w-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),s=a=tn(r,null,u),p=y[a]||0,!p)y[a]=1;else{do s=a+"_"+p++;while(y[s]);y[a]=p,y[s]=1}o[w]=s}for(x=l.s.r+i;x<=l.e.r;++x)if(!(N[x]||{}).hidden){var M=KD(e,l,x,d,n,o,g,u);(M.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(h[m++]=M.row)}return h.length=m,h}var e1=/"/g;function YD(e,t,r,n,i,o,a,s){for(var l=!0,u=[],c="",f=_t(r),d=t.s.c;d<=t.e.c;++d)if(n[d]){var h=s.dense?(e[r]||[])[d]:e[n[d]+f];if(h==null)c="";else if(h.v!=null){l=!1,c=""+(s.rawNumbers&&h.t=="n"?h.v:tn(h,null,s));for(var m=0,p=0;m!==c.length;++m)if((p=c.charCodeAt(m))===i||p===o||p===34||s.forceQuotes){c='"'+c.replace(e1,'""')+'"';break}c=="ID"&&(c='"ID"')}else h.f!=null&&!h.F?(l=!1,c="="+h.f,c.indexOf(",")>=0&&(c='"'+c.replace(e1,'""')+'"')):c="";u.push(c)}return s.blankrows===!1&&l?null:u.join(a)}function jd(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=Ke(e["!ref"]),o=n.FS!==void 0?n.FS:",",a=o.charCodeAt(0),s=n.RS!==void 0?n.RS:`
-`,l=s.charCodeAt(0),u=new RegExp((o=="|"?"\\|":o)+"+$"),c="",f=[];n.dense=Array.isArray(e);for(var d=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],m=i.s.c;m<=i.e.c;++m)(d[m]||{}).hidden||(f[m]=Ft(m));for(var p=0,g=i.s.r;g<=i.e.r;++g)(h[g]||{}).hidden||(c=YD(e,i,g,f,a,l,o,n),c!=null&&(n.strip&&(c=c.replace(u,"")),(c||n.blankrows!==!1)&&r.push((p++?s:"")+c)));return delete n.dense,r.join("")}function Vw(e,t){t||(t={}),t.FS=" ",t.RS=`
-`;var r=jd(e,t);return r}function qD(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var i=Ke(e["!ref"]),o="",a=[],s,l=[],u=Array.isArray(e);for(s=i.s.c;s<=i.e.c;++s)a[s]=Ft(s);for(var c=i.s.r;c<=i.e.r;++c)for(o=_t(c),s=i.s.c;s<=i.e.c;++s)if(t=a[s]+o,r=u?(e[c]||[])[s]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=t+"="+n}return l}function Ww(e,t,r){var n=r||{},i=+!n.skipHeader,o=e||{},a=0,s=0;if(o&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?dt(n.origin):n.origin;a=l.r,s=l.c}var u,c={s:{c:0,r:0},e:{c:s,r:a+t.length-1+i}};if(o["!ref"]){var f=Ke(o["!ref"]);c.e.c=Math.max(c.e.c,f.e.c),c.e.r=Math.max(c.e.r,f.e.r),a==-1&&(a=f.e.r+1,c.e.r=a+t.length-1+i)}else a==-1&&(a=0,c.e.r=t.length-1+i);var d=n.header||[],h=0;t.forEach(function(p,g){Tt(p).forEach(function(x){(h=d.indexOf(x))==-1&&(d[h=d.length]=x);var w=p[x],y="z",_="",N=Ue({c:s+h,r:a+g+i});u=Ba(o,N),w&&typeof w=="object"&&!(w instanceof Date)?o[N]=w:(typeof w=="number"?y="n":typeof w=="boolean"?y="b":typeof w=="string"?y="s":w instanceof Date?(y="d",n.cellDates||(y="n",w=jt(w)),_=n.dateNF||rt[14]):w===null&&n.nullError&&(y="e",w=0),u?(u.t=y,u.v=w,delete u.w,delete u.R,_&&(u.z=_)):o[N]=u={t:y,v:w},_&&(u.z=_))})}),c.e.c=Math.max(c.e.c,s+d.length-1);var m=_t(a);if(i)for(h=0;h=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function JD(){return{SheetNames:[],Sheets:{}}}function eP(e,t,r,n){var i=1;if(!r)for(;i<=65535&&e.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var o=r.match(/(^.*?)(\d+)$/);i=o&&+o[2]||0;var a=o&&o[1]||r;for(++i;i<=65535&&e.SheetNames.indexOf(r=a+i)!=-1;++i);}if(Iw(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function tP(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=ZD(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function rP(e,t){return e.z=t,e}function zw(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function nP(e,t,r){return zw(e,"#"+t,r)}function iP(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function oP(e,t,r,n){for(var i=typeof t!="string"?t:Ke(t),o=typeof t=="string"?t:ot(t),a=i.s.r;a<=i.e.r;++a)for(var s=i.s.c;s<=i.e.c;++s){var l=Ba(e,a,s);l.t="n",l.F=o,delete l.v,a==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var Pc={encode_col:Ft,encode_row:_t,encode_cell:Ue,encode_range:ot,decode_col:$d,decode_row:kd,split_cell:w3,decode_cell:dt,decode_range:Jt,format_cell:tn,sheet_add_aoa:zx,sheet_add_json:Ww,sheet_add_dom:Mw,aoa_to_sheet:So,json_to_sheet:QD,table_to_sheet:Lw,table_to_book:OD,sheet_to_csv:jd,sheet_to_txt:Vw,sheet_to_json:zl,sheet_to_html:Nw,sheet_to_formulae:qD,sheet_to_row_object_array:zl,sheet_get_cell:Ba,book_new:JD,book_append_sheet:eP,book_set_sheet_visibility:tP,cell_set_number_format:rP,cell_set_hyperlink:zw,cell_set_internal_link:nP,cell_add_comment:iP,sheet_set_array_formula:oP,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function jf(e){if(typeof e=="string"){const t=e.replace(/[^a-zA-Z]/g,"").trim(),r=["","K","M","B","T"].indexOf(t.replace(/\s/g,""));e=Number(e.replace(/[^0-9.]/g,"").trim())*Math.pow(10,r*3)}return e}function aP(e,t){var r;if(typeof e=="string"&&(e=Number(jf(e))),e%1!==0){const n=Math.max(2,((r=e.toString().split(".")[1])==null?void 0:r.length)||0),i=Math.min(4,n);if(e<1e3)return e.toFixed(i)||0}if((e>1e5||e<-1e5)&&!Gw(t||"")){const n=Math.min(4,Math.floor(Math.log10(Math.abs(e))/3)),i=["","K","M","B","T"][n];return`${(e/10**(n*3)).toFixed(2)} ${i}`}return e>1e3||e<-1e3?e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):e}function Xd(e){return["date","day","time","timestamp","year"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function Gw(e){return["price","open","close","high","low"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function zi(e,t){const r=window.document.getElementById("loading"),n=window.document.getElementById("loading_text");return new Promise(i=>{t?r.classList.remove("show"):(n.innerHTML=e,r.classList.add("show"));const o=setInterval(function(){(t?!r.classList.contains("show"):r.classList.contains("show"))&&(clearInterval(o),i(!0))},.01)})}function sP(e,t){if(e===t)return!0;if(e==null||t==null||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let r=0;r<(e==null?void 0:e.length);++r)if(e[r]!==t[r])return!1;return!0}const lP=(e,t,r,n)=>{const i=l4(e.getValue(t),r);return n(i),i},uP=async({fileHandle:e,blob:t})=>{e&&await cP({fileHandle:e,blob:t})},cP=async({fileHandle:e,blob:t})=>{const r=await e.createWritable();await r.write(t),await r.close()},fP=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}}],jw=({filename:e,is_image:t})=>{try{if("showSaveFilePicker"in window){const r={suggestedName:e,types:t?fP:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(r)}}catch(r){console.error(r)}return new Promise(r=>{r(null)})},Xw=(e,t,r)=>{try{if(r===null)throw new Error("Cannot access filesystem");uP({fileHandle:r,blob:e})}catch(n){console.error("oops, something went wrong!",n);const i=URL.createObjectURL(e),o=document.createElement("a");o.setAttribute("href",i),o.setAttribute("download",t),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)}return new Promise(n=>{n(!0)})};async function t1(e,t,r,n){const i=t,o=r.map(u=>i.map(c=>u[c])),a=[i,...o];if(e==="csv"){const u=a.map(d=>d.join(",")).join(`
-`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await jw({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await zi(`Saving ${h.toUpperCase()}`),Xf(async function(){Xw(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await zi("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Pc.book_new(),l=Pc.aoa_to_sheet(a);Pc.book_append_sheet(s,l,"Sheet1"),await zi("Saving XLSX"),Xf(async function(){await new Promise(u=>setTimeout(u,1500)),XD(s,`${window.title}.xlsx`),await zi("",!0),n==null||n(!0)},2)()}async function dP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await jw({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await zi(`Saving ${o.toUpperCase()}`),Xf(async function(){g4.toBlob(r).then(function(a){Xw(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await zi("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const Xf=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},Kw=v.createContext({dragDropManager:void 0});function rr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var r1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Ic=function(){return Math.random().toString(36).substring(7).split("").join(".")},n1={INIT:"@@redux/INIT"+Ic(),REPLACE:"@@redux/REPLACE"+Ic(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ic()}};function hP(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Yw(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(rr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(rr(1));return r(Yw)(e,t)}if(typeof e!="function")throw new Error(rr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(rr(3));return o}function f(p){if(typeof p!="function")throw new Error(rr(4));if(l)throw new Error(rr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(rr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!hP(p))throw new Error(rr(7));if(typeof p.type>"u")throw new Error(rr(8));if(l)throw new Error(rr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,x=0;xn&&n[i]?n[i]:r||null,e)}function mP(e,t){return e.filter(r=>r!==t)}function qw(e){return typeof e=="object"}function vP(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function xP(e,t){return e.filter(r=>t.indexOf(r)>-1)}const Kd="dnd-core/INIT_COORDS",Cu="dnd-core/BEGIN_DRAG",Yd="dnd-core/PUBLISH_DRAG_SOURCE",Au="dnd-core/HOVER",Ru="dnd-core/DROP",Ou="dnd-core/END_DRAG";function i1(e,t){return{type:Kd,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const wP={type:Kd,payload:{clientOffset:null,sourceClientOffset:null}};function yP(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(i1(o)),EP(r,s,l);const u=TP(r,s);if(u==null){e.dispatch(wP);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");_P(a),c=a(u)}e.dispatch(i1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;SP(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Cu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function EP(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function _P(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function SP(e){Fe(qw(e),"Item must be an object.")}function TP(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function CP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AP(e){for(var t=1;t{const l=FP(a,s,i,n),u={type:Ru,payload:{dropResult:AP({},r,l)}};e.dispatch(u)})}}function OP(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function FP(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return DP(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function DP(e){Fe(typeof e>"u"||qw(e),"Drop result must either be an object or undefined.")}function PP(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function IP(e){return function(){const r=e.getMonitor(),n=e.getRegistry();bP(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Ou}}}function bP(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function Kf(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function kP(e){return function(r,{clientOffset:n}={}){$P(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return MP(i,a,s),NP(i,o,a),LP(i,o,a),{type:Au,payload:{targetIds:i,clientOffset:n||null}}}}function $P(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function NP(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);Kf(o,r)||e.splice(n,1)}}function LP(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function BP(e){return function(){if(e.getMonitor().isDragging())return{type:Yd}}}function UP(e){return{beginDrag:yP(e),publishDragSource:BP(e),hover:kP(e),drop:RP(e),endDrag:IP(e)}}class HP{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=UP(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function VP(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Qw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function WP(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:Qw(VP(t,n),r)}function zP(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:Qw(t,r)}const xa=[],qd=[];xa.__IS_NONE__=!0;qd.__IS_ALL__=!0;function GP(e,t){return e===xa?!1:e===qd||typeof t>"u"?!0:xP(t,e).length>0}class jP{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!GP(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return Kf(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!Kf(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return WP(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return zP(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const o1=typeof global<"u"?global:self,Zw=o1.MutationObserver||o1.WebKitMutationObserver;function Jw(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function XP(e){let t=1;const r=new Zw(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const KP=typeof Zw=="function"?XP:Jw;class YP{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=KP(this.flush),this.requestErrorThrow=Jw(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class qP{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class QP{create(t){const r=this.freeTasks,n=r.length?r.pop():new qP(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const e2=new YP,ZP=new QP(e2.registerPendingError);function JP(e){e2.enqueueTask(ZP.create(e))}const Qd="dnd-core/ADD_SOURCE",Zd="dnd-core/ADD_TARGET",Jd="dnd-core/REMOVE_SOURCE",Fu="dnd-core/REMOVE_TARGET";function eI(e){return{type:Qd,payload:{sourceId:e}}}function tI(e){return{type:Zd,payload:{targetId:e}}}function rI(e){return{type:Jd,payload:{sourceId:e}}}function nI(e){return{type:Fu,payload:{targetId:e}}}function iI(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function oI(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function Yf(e,t){if(t&&Array.isArray(e)){e.forEach(r=>Yf(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var ar;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(ar||(ar={}));let aI=0;function sI(){return aI++}function lI(e){const t=sI().toString();switch(e){case ar.SOURCE:return`S${t}`;case ar.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function a1(e){switch(e[0]){case"S":return ar.SOURCE;case"T":return ar.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function s1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class uI{addSource(t,r){Yf(t),iI(r);const n=this.addHandler(ar.SOURCE,t,r);return this.store.dispatch(eI(n)),n}addTarget(t,r){Yf(t,!0),oI(r);const n=this.addHandler(ar.TARGET,t,r);return this.store.dispatch(tI(n)),n}containsHandler(t){return s1(this.dragSources,t)||s1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return a1(t)===ar.SOURCE}isTargetId(t){return a1(t)===ar.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(rI(t)),JP(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(nI(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=lI(t);return this.types.set(i,r),t===ar.SOURCE?this.dragSources.set(i,n):t===ar.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const cI=(e,t)=>e===t;function fI(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function dI(e,t,r=cI){if(e.length!==t.length)return!1;for(let n=0;n0||!dI(r,n)))return xa;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function pI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gI(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function OI(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let u1=0;const el=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var FI=v.memo(function(t){var{children:r}=t,n=RI(t,["children"]);const[i,o]=DI(n);return v.useEffect(()=>{if(o){const a=t2();return++u1,()=>{--u1===0&&(a[el]=null)}}},[]),K(Kw.Provider,{value:i,children:r})});function DI(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=PI(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function PI(e,t=t2(),r,n){const i=t;return i[el]||(i[el]={dragDropManager:CI(e,t,r,n)}),i[el]}function t2(){return typeof global<"u"?global:window}var II=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const bI=Ha(II),si=typeof window<"u"?v.useLayoutEffect:v.useEffect;function kI(e,t,r){const[n,i]=v.useState(()=>t(e)),o=v.useCallback(()=>{const a=t(e);bI(n,a)||(i(a),r&&r())},[n,e,r]);return si(o),[n,o]}function $I(e,t,r){const[n,i]=kI(e,t,r);return si(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function r2(e,t,r){return $I(t,e||(()=>({})),()=>r.reconnect())}function n2(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),v.useMemo(()=>typeof e=="function"?e():e,r)}function NI(e){return v.useMemo(()=>e.hooks.dragSource(),[e])}function MI(e){return v.useMemo(()=>e.hooks.dragPreview(),[e])}let bc=!1,kc=!1;class LI{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!bc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return bc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{bc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!kc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{kc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let $c=!1;class BI{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!$c,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return $c=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{$c=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function UI(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function HI(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function qf(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function WI(e){return(t=null,r=null)=>{if(!v.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return VI(n),zI(n,r?o=>e(o,r):e)}}function i2(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=WI(n);t[r]=()=>i}}),t}function c1(e,t){typeof e=="function"?e(t):e.current=t}function zI(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or . Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?v.cloneElement(e,{ref:n=>{c1(r,n),c1(t,n)}}):v.cloneElement(e,{ref:t})}class GI{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!qf(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!qf(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=i2({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,Qf(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,Qf(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class jI{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!qf(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=i2({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,Qf(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Ao(){const{dragDropManager:e}=v.useContext(Kw);return Fe(e!=null,"Expected drag drop context"),e}function XI(e,t){const r=Ao(),n=v.useMemo(()=>new GI(r.getBackend()),[r]);return si(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),si(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function KI(){const e=Ao();return v.useMemo(()=>new LI(e),[e])}class YI{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function qI(e,t,r){const n=v.useMemo(()=>new YI(e,t,r),[t,r]);return v.useEffect(()=>{n.spec=e},[e]),n}function QI(e){return v.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function ZI(e,t,r){const n=Ao(),i=qI(e,t,r),o=QI(e);si(function(){if(o!=null){const[s,l]=HI(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function JI(e,t){const r=n2(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=KI(),i=XI(r.options,r.previewOptions);return ZI(r,n,i),[r2(r.collect,n,i),NI(i),MI(i)]}function e5(e){return v.useMemo(()=>e.hooks.dropTarget(),[e])}function t5(e){const t=Ao(),r=v.useMemo(()=>new jI(t.getBackend()),[t]);return si(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function r5(){const e=Ao();return v.useMemo(()=>new BI(e),[e])}function n5(e){const{accept:t}=e;return v.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class i5{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function o5(e,t){const r=v.useMemo(()=>new i5(e,t),[t]);return v.useEffect(()=>{r.spec=e},[e]),r}function a5(e,t,r){const n=Ao(),i=o5(e,t),o=n5(e);si(function(){const[s,l]=UI(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function s5(e,t){const r=n2(e,t),n=r5(),i=t5(r.options);return a5(r,n,i),[r2(r.collect,n,i),e5(i)]}function l5(e,t){return v.useReducer((r,n)=>{const i=t[r][n];return i??r},e)}const Ei=e=>{const{present:t,children:r}=e,n=u5(t),i=typeof r=="function"?r({present:n.isPresent}):v.Children.only(r),o=Ve(n.ref,i.ref);return typeof r=="function"||n.isPresent?v.cloneElement(i,{ref:o}):null};Ei.displayName="Presence";function u5(e){const[t,r]=v.useState(),n=v.useRef({}),i=v.useRef(e),o=v.useRef("none"),a=e?"mounted":"unmounted",[s,l]=l5(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const u=ks(n.current);o.current=s==="mounted"?u:"none"},[s]),Et(()=>{const u=n.current,c=i.current;if(c!==e){const d=o.current,h=ks(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Et(()=>{if(t){const u=f=>{const h=ks(n.current).includes(f.animationName);f.target===t&&h&&di.flushSync(()=>l("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=ks(n.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:v.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function ks(e){return(e==null?void 0:e.animationName)||"none"}const Nc="rovingFocusGroup.onEntryFocus",c5={bubbles:!1,cancelable:!0},eh="RovingFocusGroup",[Zf,o2,f5]=su(eh),[d5,a2]=nn(eh,[f5]),[h5,p5]=d5(eh),g5=v.forwardRef((e,t)=>v.createElement(Zf.Provider,{scope:e.__scopeRovingFocusGroup},v.createElement(Zf.Slot,{scope:e.__scopeRovingFocusGroup},v.createElement(m5,pe({},e,{ref:t}))))),m5=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=v.useRef(null),d=Ve(t,f),h=hd(o),[m=null,p]=uo({prop:a,defaultProp:s,onChange:l}),[g,x]=v.useState(!1),w=It(u),y=o2(r),_=v.useRef(!1),[N,M]=v.useState(0);return v.useEffect(()=>{const S=f.current;if(S)return S.addEventListener(Nc,w),()=>S.removeEventListener(Nc,w)},[w]),v.createElement(h5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:v.useCallback(S=>p(S),[p]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>M(S=>S+1),[]),onFocusableItemRemove:v.useCallback(()=>M(S=>S-1),[])},v.createElement(Pe.div,pe({tabIndex:g||N===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:_e(e.onMouseDown,()=>{_.current=!0}),onFocus:_e(e.onFocus,S=>{const C=!_.current;if(S.target===S.currentTarget&&C&&!g){const A=new CustomEvent(Nc,c5);if(S.currentTarget.dispatchEvent(A),!A.defaultPrevented){const L=y().filter(ne=>ne.focusable),H=L.find(ne=>ne.active),B=L.find(ne=>ne.id===m),Q=[H,B,...L].filter(Boolean).map(ne=>ne.ref.current);s2(Q)}}_.current=!1}),onBlur:_e(e.onBlur,()=>x(!1))})))}),v5="RovingFocusGroupItem",x5=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Xr(),l=o||s,u=p5(v5,r),c=u.currentTabStopId===l,f=o2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return v.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),v.createElement(Zf.ItemSlot,{scope:r,id:l,focusable:n,active:i},v.createElement(Pe.span,pe({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:_e(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:_e(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_e(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=E5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let x=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")x.reverse();else if(p==="prev"||p==="next"){p==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=u.loop?_5(x,w+1):x.slice(w+1)}setTimeout(()=>s2(x))}})})))}),w5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function E5(e,t,r){const n=y5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return w5[n]}function s2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function _5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const S5=g5,T5=x5,C5=["Enter"," "],A5=["ArrowDown","PageUp","Home"],l2=["ArrowUp","PageDown","End"],R5=[...A5,...l2],Du="Menu",[Jf,O5,F5]=su(Du),[_i,Pu]=nn(Du,[F5,fu,a2]),th=fu(),u2=a2(),[D5,ns]=_i(Du),[P5,rh]=_i(Du),I5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=th(t),[l,u]=v.useState(null),c=v.useRef(!1),f=It(o),d=hd(i);return v.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),v.createElement(Gv,s,v.createElement(D5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},v.createElement(P5,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},b5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=th(r);return v.createElement(jv,pe({},i,n,{ref:t}))}),c2="MenuPortal",[k5,$5]=_i(c2,{forceMount:void 0}),N5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ns(c2,t);return v.createElement(k5,{scope:t,forceMount:r},v.createElement(Ei,{present:r||o.open},v.createElement(du,{asChild:!0,container:i},n)))},An="MenuContent",[M5,f2]=_i(An),L5=v.forwardRef((e,t)=>{const r=$5(An,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ns(An,e.__scopeMenu),a=rh(An,e.__scopeMenu);return v.createElement(Jf.Provider,{scope:e.__scopeMenu},v.createElement(Ei,{present:n||o.open},v.createElement(Jf.Slot,{scope:e.__scopeMenu},a.modal?v.createElement(B5,pe({},i,{ref:t})):v.createElement(U5,pe({},i,{ref:t})))))}),B5=v.forwardRef((e,t)=>{const r=ns(An,e.__scopeMenu),n=v.useRef(null),i=Ve(t,n);return v.useEffect(()=>{const o=n.current;if(o)return Ed(o)},[]),v.createElement(d2,pe({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:_e(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),U5=v.forwardRef((e,t)=>{const r=ns(An,e.__scopeMenu);return v.createElement(d2,pe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),d2=v.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ns(An,r),x=rh(An,r),w=th(r),y=u2(r),_=O5(r),[N,M]=v.useState(null),S=v.useRef(null),C=Ve(t,S,g.onContentChange),A=v.useRef(0),L=v.useRef(""),H=v.useRef(0),B=v.useRef(null),V=v.useRef("right"),Q=v.useRef(0),ne=m?_d:v.Fragment,ye=m?{as:ni,allowPinchZoom:!0}:void 0,ve=ie=>{var Ee,ee;const O=L.current+ie,k=_().filter(W=>!W.disabled),b=document.activeElement,D=(Ee=k.find(W=>W.ref.current===b))===null||Ee===void 0?void 0:Ee.textValue,U=k.map(W=>W.textValue),G=Q5(U,O,D),J=(ee=k.find(W=>W.textValue===G))===null||ee===void 0?void 0:ee.ref.current;(function W(q){L.current=q,window.clearTimeout(A.current),q!==""&&(A.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};v.useEffect(()=>()=>window.clearTimeout(A.current),[]),gd();const Ce=v.useCallback(ie=>{var Ee,ee;return V.current===((Ee=B.current)===null||Ee===void 0?void 0:Ee.side)&&J5(ie,(ee=B.current)===null||ee===void 0?void 0:ee.area)},[]);return v.createElement(M5,{scope:r,searchRef:L,onItemEnter:v.useCallback(ie=>{Ce(ie)&&ie.preventDefault()},[Ce]),onItemLeave:v.useCallback(ie=>{var Ee;Ce(ie)||((Ee=S.current)===null||Ee===void 0||Ee.focus(),M(null))},[Ce]),onTriggerLeave:v.useCallback(ie=>{Ce(ie)&&ie.preventDefault()},[Ce]),pointerGraceTimerRef:H,onPointerGraceIntentChange:v.useCallback(ie=>{B.current=ie},[])},v.createElement(ne,ye,v.createElement(md,{asChild:!0,trapped:i,onMountAutoFocus:_e(o,ie=>{var Ee;ie.preventDefault(),(Ee=S.current)===null||Ee===void 0||Ee.focus()}),onUnmountAutoFocus:a},v.createElement(lu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},v.createElement(S5,pe({asChild:!0},y,{dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:N,onCurrentTabStopIdChange:M,onEntryFocus:_e(l,ie=>{x.isUsingKeyboardRef.current||ie.preventDefault()})}),v.createElement(Xv,pe({role:"menu","aria-orientation":"vertical","data-state":K5(g.open),"data-radix-menu-content":"",dir:x.dir},w,p,{ref:C,style:{outline:"none",...p.style},onKeyDown:_e(p.onKeyDown,ie=>{const ee=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,O=ie.ctrlKey||ie.altKey||ie.metaKey,k=ie.key.length===1;ee&&(ie.key==="Tab"&&ie.preventDefault(),!O&&k&&ve(ie.key));const b=S.current;if(ie.target!==b||!R5.includes(ie.key))return;ie.preventDefault();const U=_().filter(G=>!G.disabled).map(G=>G.ref.current);l2.includes(ie.key)&&U.reverse(),Y5(U)}),onBlur:_e(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(A.current),L.current="")}),onPointerMove:_e(e.onPointerMove,t0(ie=>{const Ee=ie.target,ee=Q.current!==ie.clientX;if(ie.currentTarget.contains(Ee)&&ee){const O=ie.clientX>Q.current?"right":"left";V.current=O,Q.current=ie.clientX}}))})))))))}),H5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.createElement(Pe.div,pe({role:"group"},n,{ref:t}))}),V5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.createElement(Pe.div,pe({},n,{ref:t}))}),e0="MenuItem",f1="menu.itemSelect",W5=v.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=v.useRef(null),a=rh(e0,e.__scopeMenu),s=f2(e0,e.__scopeMenu),l=Ve(t,o),u=v.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(f1,{bubbles:!0,cancelable:!0});f.addEventListener(f1,h=>n==null?void 0:n(h),{once:!0}),pd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return v.createElement(z5,pe({},i,{ref:l,disabled:r,onClick:_e(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:_e(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:_e(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||C5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),z5=v.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=f2(e0,r),s=u2(r),l=v.useRef(null),u=Ve(t,l),[c,f]=v.useState(!1),[d,h]=v.useState("");return v.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),v.createElement(Jf.ItemSlot,{scope:r,disabled:n,textValue:i??d},v.createElement(T5,pe({asChild:!0},s,{focusable:!n}),v.createElement(Pe.div,pe({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:_e(e.onPointerMove,t0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:_e(e.onPointerLeave,t0(m=>a.onItemLeave(m))),onFocus:_e(e.onFocus,()=>f(!0)),onBlur:_e(e.onBlur,()=>f(!1))}))))}),G5="MenuRadioGroup";_i(G5,{value:void 0,onValueChange:()=>{}});const j5="MenuItemIndicator";_i(j5,{checked:!1});const X5="MenuSub";_i(X5);function K5(e){return e?"open":"closed"}function Y5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function q5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function Q5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=q5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function Z5(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;o
n!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function J5(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Z5(r,t)}function t0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const h2=I5,p2=b5,g2=N5,m2=L5,e8=H5,t8=V5,r8=W5,v2="ContextMenu",[n8,Yk]=nn(v2,[Pu]),Iu=Pu(),[i8,x2]=n8(v2),o8=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=v.useState(!1),l=Iu(t),u=It(n),c=v.useCallback(f=>{s(f),u(f)},[u]);return v.createElement(i8,{scope:t,open:a,onOpenChange:c,modal:o},v.createElement(h2,pe({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},a8="ContextMenuTrigger",s8=v.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=x2(a8,r),a=Iu(r),s=v.useRef({x:0,y:0}),l=v.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=v.useRef(0),c=v.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return v.useEffect(()=>c,[c]),v.useEffect(()=>void(n&&c()),[n,c]),v.createElement(v.Fragment,null,v.createElement(p2,pe({},a,{virtualRef:l})),v.createElement(Pe.span,pe({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:_e(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:_e(e.onPointerDown,$s(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:_e(e.onPointerMove,$s(c)),onPointerCancel:n?e.onPointerCancel:_e(e.onPointerCancel,$s(c)),onPointerUp:n?e.onPointerUp:_e(e.onPointerUp,$s(c))})))}),l8=e=>{const{__scopeContextMenu:t,...r}=e,n=Iu(t);return v.createElement(g2,pe({},n,r))},u8="ContextMenuContent",c8=v.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=x2(u8,r),o=Iu(r),a=v.useRef(!1);return v.createElement(m2,pe({},o,n,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function $s(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const f8=o8,d8=s8,h8=l8,p8=c8,w2=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$");function g8({column:e,table:t,numberOfColumns:r}){function n(c){if(!c)return null;const f=new Date(c),d=f.getFullYear(),h=f.getMonth()+1>9?f.getMonth()+1:`0${f.getMonth()+1}`,m=f.getDate()>9?f.getDate():`0${f.getDate()}`;return`${d}-${h}-${m}`}const i=t.getPreFilteredRowModel().flatRows.map(c=>c.getValue(e.id)),o=i.every(c=>typeof c=="string"||c===null),a=i.every(c=>typeof c=="number"||w2.test(c)||c===null||c===""),s=i.some(c=>typeof c=="string"&&c.includes(" ")),l=e.getFilterValue();return i.every(c=>{const f=c==null?void 0:c.toString().replace(/[^0-9]/g,"").trim();return(f==null?void 0:f.length)>=4&&(Xd(e.id)||e.id.toLowerCase()==="index"&&!s)})?Se("div",{className:"flex gap-2 h-10",children:[K("input",{type:"datetime-local",value:n(l==null?void 0:l[0])??"",onChange:c=>{const f=new Date(c.target.value).getTime();e.setFilterValue(d=>[f,d==null?void 0:d[1]])},placeholder:"Start date",className:"_input"}),K("input",{type:"datetime-local",value:n(l==null?void 0:l[1])??"",onChange:c=>{const f=new Date(c.target.value).getTime();e.setFilterValue(d=>[d==null?void 0:d[0],f])},placeholder:"End date",className:"_input"})]}):a?Se("div",{className:"flex gap-0.5 h-10",children:[K("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:c=>e.setFilterValue(f=>[c.target.value,f==null?void 0:f[1]]),placeholder:"Min",className:"_input p-0.5"}),K("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:c=>e.setFilterValue(f=>[f==null?void 0:f[0],c.target.value]),placeholder:"Max",className:"_input p-0.5"})]}):o?K("div",{className:"h-10",children:K("input",{type:"text",value:l??"",onChange:c=>e.setFilterValue(c.target.value),placeholder:"Search...",className:"_input"})}):K("div",{className:"h-10"})}const m8=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),v8=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=s5({accept:"column",drop:p=>{const g=m8(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=JI({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>K("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Se(H1,{children:[Se("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Se("div",{onClick:u.getToggleSortingHandler(),className:Nt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[If(u.columnDef.header,e.getContext()),u.getCanSort()&&Se("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[K("button",{className:Nt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"4",fill:"none",viewBox:"0 0 11 5",children:K("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),K("button",{className:Nt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"4",fill:"none",viewBox:"0 0 11 5",children:K("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&K("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",fill:"none",viewBox:"0 0 17 16",children:K("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?K("div",{children:K(g8,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Se("th",{className:Nt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize(),opacity:f?.5:1},ref:c,children:[n===0?Se(f8,{children:[K(d8,{asChild:!0,children:m()}),K(h8,{children:K(p8,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:K("div",{className:"flex flex-col gap-2",children:Se("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),K("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function y2(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:l0:e<1?l0:e}function x8({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Se("div",{className:"hidden md:flex items-center gap-8",children:[K(Vi,{value:t,onChange:i=>{const o=y2(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Se("span",{className:"flex items-center gap-1",children:[K("strong",{children:e.getState().pagination.pageIndex+1}),"of",K("strong",{children:e.getPageCount()})]}),Se("div",{className:"hidden lg:block",children:[K("button",{className:Nt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),K("button",{className:Nt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),K("button",{className:Nt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),K("button",{className:Nt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}function w8({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":t1("csv",e,t,i);break;case"xlsx":t1("xlsx",e,t,i);break;case"png":dP("table",i);break}};return Se("div",{className:"flex gap-6 items-center",children:[K(Vi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:u0.map(a=>({label:a,value:a}))}]}),K("button",{onClick:o,className:"_btn",children:"Export"})]})}const E2="DropdownMenu",[y8,qk]=nn(E2,[Pu]),Si=Pu(),[E8,_2]=y8(E2),_8=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Si(t),u=v.useRef(null),[c=!1,f]=uo({prop:i,defaultProp:o,onChange:a});return v.createElement(E8,{scope:t,triggerId:Xr(),triggerRef:u,contentId:Xr(),open:c,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(d=>!d),[f]),modal:s},v.createElement(h2,pe({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},S8="DropdownMenuTrigger",T8=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=_2(S8,r),a=Si(r);return v.createElement(p2,pe({asChild:!0},a),v.createElement(Pe.button,pe({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:dd(t,o.triggerRef),onPointerDown:_e(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:_e(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),C8=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Si(t);return v.createElement(g2,pe({},n,r))},A8="DropdownMenuContent",R8=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=_2(A8,r),o=Si(r),a=v.useRef(!1);return v.createElement(m2,pe({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),O8=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Si(r);return v.createElement(e8,pe({},i,n,{ref:t}))}),F8=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Si(r);return v.createElement(t8,pe({},i,n,{ref:t}))}),D8=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Si(r);return v.createElement(r8,pe({},i,n,{ref:t}))}),P8=_8,d1=T8,I8=C8,b8=R8,k8=O8,$8=F8,Mc=D8;function N8(e,t){v.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function h1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=v.useState(!1),o=v.useRef(null);N8(o,()=>i(!1)),v.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Se(P8,{open:n,children:[r?K(d1,{title:"Filter columns",onClick:()=>i(!n),children:K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:K("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Se(k8,{className:"flex flex-row items-center gap-2",children:[K($8,{className:"whitespace-nowrap",children:e}),Se(d1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[K("span",{children:"Filter columns"}),K(Hf,{className:Nt({"transform rotate-180 duration-200 transition":n})})]})]}),K(I8,{children:Se(b8,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[K(Mc,{children:K("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),K(Mc,{children:Se("label",{className:"flex items-center gap-2",children:[K("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>K(Mc,{children:Se("label",{className:"flex items-center gap-2",children:[K("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}var r0={exports:{}},Ze={},n0={exports:{}},Ti={};function S2(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function M8(e,t,r){}function L8(e,t,r){}var B8=/javascript\s*\:/img;function U8(e,t){return B8.test(t)?"":t}Ti.whiteList=S2();Ti.getDefaultWhiteList=S2;Ti.onAttr=M8;Ti.onIgnoreAttr=L8;Ti.safeAttrValue=U8;var H8={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r/g,rb=/"/g,nb=/"/g,ib=/([a-zA-Z0-9]*);?/gim,ob=/:?/gim,ab=/&newline;?/gim,Ms=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,g1=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,m1=/u\s*r\s*l\s*\(.*/gi;function O2(e){return e.replace(rb,""")}function F2(e){return e.replace(nb,'"')}function D2(e){return e.replace(ib,function(r,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function P2(e){return e.replace(ob,":").replace(ab," ")}function I2(e){for(var t="",r=0,n=e.length;r",n);if(i===-1)break;r=i+3}return t}function cb(e){var t=e.split("");return t=t.filter(function(r){var n=r.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}Ze.whiteList=C2();Ze.getDefaultWhiteList=C2;Ze.onTag=Y8;Ze.onIgnoreTag=q8;Ze.onTagAttr=Q8;Ze.onIgnoreTagAttr=Z8;Ze.safeAttrValue=J8;Ze.escapeHtml=R2;Ze.escapeQuote=O2;Ze.unescapeQuote=F2;Ze.escapeHtmlEntities=D2;Ze.escapeDangerHtml5Entities=P2;Ze.clearNonPrintableCharacter=I2;Ze.friendlyAttrValue=b2;Ze.escapeAttrValue=k2;Ze.onIgnoreTagStripAll=sb;Ze.StripTagBody=lb;Ze.stripCommentTag=ub;Ze.stripBlankChar=cb;Ze.cssFilter=A2;Ze.getDefaultCSSWhiteList=K8;var bu={},un=ih;function fb(e){var t=un.spaceIndex(e),r;return t===-1?r=e.slice(1,-1):r=e.slice(1,t+1),r=un.trim(r).toLowerCase(),r.slice(0,1)==="/"&&(r=r.slice(1)),r.slice(-1)==="/"&&(r=r.slice(0,-1)),r}function db(e){return e.slice(0,2)===""}function hb(e,t,r){var n="",i=0,o=!1,a=!1,s=0,l=e.length,u="",c="";e:for(s=0;s"||s===l-1){n+=r(e.slice(i,o)),c=e.slice(o,s+1),u=fb(c),n+=t(o,n.length,u,c,db(c)),i=s+1,o=!1;continue}if(f==='"'||f==="'")for(var d=1,h=e.charAt(s-d);h.trim()===""||h==="=";){if(h==="="){a=f;continue e}h=e.charAt(s-++d)}}else if(f===a){a=!1;continue}}return i0;t--){var r=e[t];if(r!==" ")return r==="="?t:-1}}function wb(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function v1(e){return wb(e)?e.substr(1,e.length-2):e}bu.parseTag=hb;bu.parseAttr=gb;var yb=nh.FilterCSS,yr=Ze,$2=bu,Eb=$2.parseTag,_b=$2.parseAttr,tl=ih;function Ls(e){return e==null}function Sb(e){var t=tl.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=tl.trim(e.slice(t+1,-1));var r=e[e.length-1]==="/";return r&&(e=tl.trim(e.slice(0,-1))),{html:e,closing:r}}function Tb(e){var t={};for(var r in e)t[r]=e[r];return t}function Cb(e){var t={};for(var r in e)Array.isArray(e[r])?t[r.toLowerCase()]=e[r].map(function(n){return n.toLowerCase()}):t[r.toLowerCase()]=e[r];return t}function N2(e){e=Tb(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=yr.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=Cb(e.whiteList||e.allowList):e.whiteList=yr.whiteList,e.onTag=e.onTag||yr.onTag,e.onTagAttr=e.onTagAttr||yr.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||yr.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||yr.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||yr.safeAttrValue,e.escapeHtml=e.escapeHtml||yr.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new yb(e.css))}N2.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,r=t.options,n=r.whiteList,i=r.onTag,o=r.onIgnoreTag,a=r.onTagAttr,s=r.onIgnoreTagAttr,l=r.safeAttrValue,u=r.escapeHtml,c=t.cssFilter;r.stripBlankChar&&(e=yr.stripBlankChar(e)),r.allowCommentTag||(e=yr.stripCommentTag(e));var f=!1;r.stripIgnoreTagBody&&(f=yr.StripTagBody(r.stripIgnoreTagBody,o),o=f.onIgnoreTag);var d=Eb(e,function(h,m,p,g,x){var w={sourcePosition:h,position:m,isClosing:x,isWhite:Object.prototype.hasOwnProperty.call(n,p)},y=i(p,g,w);if(!Ls(y))return y;if(w.isWhite){if(w.isClosing)return""+p+">";var _=Sb(g),N=n[p],M=_b(_.html,function(S,C){var A=tl.indexOf(N,S)!==-1,L=a(p,S,C,A);return Ls(L)?A?(C=l(p,S,C,c),C?S+'="'+C+'"':S):(L=s(p,S,C,A),Ls(L)?void 0:L):L});return g="<"+p,M&&(g+=" "+M),_.closing&&(g+=" /"),g+=">",g}else return y=o(p,g,w),Ls(y)?u(g):y},u);return f&&(d=f.remove(d)),d};var Ab=N2;(function(e,t){var r=Ze,n=bu,i=Ab;function o(s,l){var u=new i(l);return u.process(s)}t=e.exports=o,t.filterXSS=o,t.FilterXSS=i,function(){for(var s in r)t[s]=r[s];for(var l in n)t[l]=n[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function a(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}a()&&(self.filterXSS=e.exports)})(r0,r0.exports);var Rb=r0.exports;const Ob=Ha(Rb);function jo(e,t,r){const[n,i]=v.useState(()=>{if(typeof window>"u")return t;try{const a=window.localStorage.getItem(e);return a?r?r(JSON.parse(a)):JSON.parse(a):t}catch(a){return console.log(a),t}});return[n,a=>{try{const s=a instanceof Function?a(n):a;i(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch(s){console.log(s)}}]}const M2="ToastProvider",[oh,Fb,Db]=su("Toast"),[L2,Qk]=nn("Toast",[Db]),[Pb,ku]=L2(M2),B2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=v.useState(null),[u,c]=v.useState(0),f=v.useRef(!1),d=v.useRef(!1);return v.createElement(oh.Provider,{scope:t},v.createElement(Pb,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:v.useCallback(()=>c(h=>h+1),[]),onToastRemove:v.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};B2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${M2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const Ib="ToastViewport",bb=["F8"],i0="toast.viewportPause",o0="toast.viewportResume",kb=v.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=bb,label:i="Notifications ({hotkey})",...o}=e,a=ku(Ib,r),s=Fb(r),l=v.useRef(null),u=v.useRef(null),c=v.useRef(null),f=v.useRef(null),d=Ve(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;v.useEffect(()=>{const g=x=>{var w;n.every(_=>x[_]||x.code===_)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),v.useEffect(()=>{const g=l.current,x=f.current;if(m&&g&&x){const w=()=>{if(!a.isClosePausedRef.current){const M=new CustomEvent(i0);x.dispatchEvent(M),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const M=new CustomEvent(o0);x.dispatchEvent(M),a.isClosePausedRef.current=!1}},_=M=>{!g.contains(M.relatedTarget)&&y()},N=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",_),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",N),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",_),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",N),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=v.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const _=y.ref.current,N=[_,...Qb(_)];return g==="forwards"?N:N.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return v.useEffect(()=>{const g=f.current;if(g){const x=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const C=document.activeElement,A=w.shiftKey;if(w.target===g&&A){var N;(N=u.current)===null||N===void 0||N.focus();return}const B=p({tabbingDirection:A?"backwards":"forwards"}),V=B.findIndex(Q=>Q===C);if(Lc(B.slice(V+1)))w.preventDefault();else{var M,S;A?(M=u.current)===null||M===void 0||M.focus():(S=c.current)===null||S===void 0||S.focus()}}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[s,p]),v.createElement(MS,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&v.createElement(x1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Lc(g)}}),v.createElement(oh.Slot,{scope:r},v.createElement(Pe.ol,pe({tabIndex:-1},o,{ref:d}))),m&&v.createElement(x1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Lc(g)}}))}),$b="ToastFocusProxy",x1=v.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=ku($b,r);return v.createElement(yd,pe({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),$u="Toast",Nb="toast.swipeStart",Mb="toast.swipeMove",Lb="toast.swipeCancel",Bb="toast.swipeEnd",Ub=v.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=uo({prop:n,defaultProp:i,onChange:o});return v.createElement(Ei,{present:r||s},v.createElement(U2,pe({open:s},a,{ref:t,onClose:()=>l(!1),onPause:It(e.onPause),onResume:It(e.onResume),onSwipeStart:_e(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:_e(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:_e(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:_e(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[Hb,Vb]=L2($u,{onClose(){}}),U2=v.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=ku($u,r),[g,x]=v.useState(null),w=Ve(t,Q=>x(Q)),y=v.useRef(null),_=v.useRef(null),N=i||p.duration,M=v.useRef(0),S=v.useRef(N),C=v.useRef(0),{onToastAdd:A,onToastRemove:L}=p,H=It(()=>{var Q;(g==null?void 0:g.contains(document.activeElement))&&((Q=p.viewport)===null||Q===void 0||Q.focus()),a()}),B=v.useCallback(Q=>{!Q||Q===1/0||(window.clearTimeout(C.current),M.current=new Date().getTime(),C.current=window.setTimeout(H,Q))},[H]);v.useEffect(()=>{const Q=p.viewport;if(Q){const ne=()=>{B(S.current),u==null||u()},ye=()=>{const ve=new Date().getTime()-M.current;S.current=S.current-ve,window.clearTimeout(C.current),l==null||l()};return Q.addEventListener(i0,ye),Q.addEventListener(o0,ne),()=>{Q.removeEventListener(i0,ye),Q.removeEventListener(o0,ne)}}},[p.viewport,N,l,u,B]),v.useEffect(()=>{o&&!p.isClosePausedRef.current&&B(N)},[o,N,p.isClosePausedRef,B]),v.useEffect(()=>(A(),()=>L()),[A,L]);const V=v.useMemo(()=>g?W2(g):null,[g]);return p.viewport?v.createElement(v.Fragment,null,V&&v.createElement(Wb,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},V),v.createElement(Hb,{scope:r,onClose:H},di.createPortal(v.createElement(oh.ItemSlot,{scope:r},v.createElement(NS,{asChild:!0,onEscapeKeyDown:_e(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||H(),p.isFocusedToastEscapeKeyDownRef.current=!1})},v.createElement(Pe.li,pe({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:_e(e.onKeyDown,Q=>{Q.key==="Escape"&&(s==null||s(Q.nativeEvent),Q.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:_e(e.onPointerDown,Q=>{Q.button===0&&(y.current={x:Q.clientX,y:Q.clientY})}),onPointerMove:_e(e.onPointerMove,Q=>{if(!y.current)return;const ne=Q.clientX-y.current.x,ye=Q.clientY-y.current.y,ve=!!_.current,Ce=["left","right"].includes(p.swipeDirection),ie=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Ee=Ce?ie(0,ne):0,ee=Ce?0:ie(0,ye),O=Q.pointerType==="touch"?10:2,k={x:Ee,y:ee},b={originalEvent:Q,delta:k};ve?(_.current=k,Bs(Mb,f,b,{discrete:!1})):w1(k,p.swipeDirection,O)?(_.current=k,Bs(Nb,c,b,{discrete:!1}),Q.target.setPointerCapture(Q.pointerId)):(Math.abs(ne)>O||Math.abs(ye)>O)&&(y.current=null)}),onPointerUp:_e(e.onPointerUp,Q=>{const ne=_.current,ye=Q.target;if(ye.hasPointerCapture(Q.pointerId)&&ye.releasePointerCapture(Q.pointerId),_.current=null,y.current=null,ne){const ve=Q.currentTarget,Ce={originalEvent:Q,delta:ne};w1(ne,p.swipeDirection,p.swipeThreshold)?Bs(Bb,h,Ce,{discrete:!0}):Bs(Lb,d,Ce,{discrete:!0}),ve.addEventListener("click",ie=>ie.preventDefault(),{once:!0})}})})))),p.viewport))):null});U2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${$u}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const Wb=e=>{const{__scopeToast:t,children:r,...n}=e,i=ku($u,t),[o,a]=v.useState(!1),[s,l]=v.useState(!1);return Yb(()=>a(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:v.createElement(du,{asChild:!0},v.createElement(yd,n,o&&v.createElement(v.Fragment,null,i.label," ",r)))},zb=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.createElement(Pe.div,pe({},n,{ref:t}))}),Gb=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.createElement(Pe.div,pe({},n,{ref:t}))}),jb="ToastAction",Xb=v.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?v.createElement(V2,{altText:r,asChild:!0},v.createElement(H2,pe({},n,{ref:t}))):null});Xb.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${jb}\``)}};const Kb="ToastClose",H2=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=Vb(Kb,r);return v.createElement(V2,{asChild:!0},v.createElement(Pe.button,pe({type:"button"},n,{ref:t,onClick:_e(e.onClick,i.onClose)})))}),V2=v.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return v.createElement(Pe.div,pe({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function W2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),qb(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...W2(n))}}),t}function Bs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?pd(i,o):i.dispatchEvent(o)}const w1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function Yb(e=()=>{}){const t=It(e);Et(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function qb(e){return e.nodeType===e.ELEMENT_NODE}function Qb(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Lc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const Zb=B2,Jb=kb,ek=Ub,tk=zb,rk=Gb,nk=H2,jl=({title:e,titleId:t,...r})=>K("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:K("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),ik=({title:e,titleId:t,...r})=>Se("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?K("title",{id:t,children:e}):null,K("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),ok=({title:e,titleId:t,...r})=>Se("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?K("title",{id:t,children:e}):null,K("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),ak=({title:e,titleId:t,...r})=>Se("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?K("title",{id:t,children:e}):null,K("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),K("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),sk=({title:e,titleId:t,...r})=>Se("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?K("title",{id:t,children:e}):null,K("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),lk=({toast:e,open:t,setOpen:r})=>Se(Zb,{children:[Se(ek,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:Nt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?K(ak,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?K(sk,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?K(ik,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):K(ok,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),K(tk,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&K(rk,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),K(nk,{className:"absolute top-7 right-5 md:right-7",children:K(jl,{className:"w-4 h-4 text-grey-900"})})]}),K(Jb,{})]});function uk(e){const[t,r]=v.useState(e),n=t==="dark"?"light":"dark";return v.useEffect(()=>{const i=window.document.documentElement;i.classList.remove(n),i.classList.add(t)},[t,n]),[n,r]}const z2="Dialog",[G2,Zk]=nn(z2),[ck,Mr]=G2(z2),fk=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=v.useRef(null),l=v.useRef(null),[u=!1,c]=uo({prop:n,defaultProp:i,onChange:o});return v.createElement(ck,{scope:t,triggerRef:s,contentRef:l,contentId:Xr(),titleId:Xr(),descriptionId:Xr(),open:u,onOpenChange:c,onOpenToggle:v.useCallback(()=>c(f=>!f),[c]),modal:a},r)},dk="DialogTrigger",hk=v.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mr(dk,r),o=Ve(t,i.triggerRef);return v.createElement(Pe.button,pe({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ah(i.open)},n,{ref:o,onClick:_e(e.onClick,i.onOpenToggle)}))}),j2="DialogPortal",[pk,X2]=G2(j2,{forceMount:void 0}),gk=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Mr(j2,t);return v.createElement(pk,{scope:t,forceMount:r},v.Children.map(n,a=>v.createElement(Ei,{present:r||o.open},v.createElement(du,{asChild:!0,container:i},a))))},a0="DialogOverlay",mk=v.forwardRef((e,t)=>{const r=X2(a0,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Mr(a0,e.__scopeDialog);return o.modal?v.createElement(Ei,{present:n||o.open},v.createElement(vk,pe({},i,{ref:t}))):null}),vk=v.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mr(a0,r);return v.createElement(_d,{as:ni,allowPinchZoom:!0,shards:[i.contentRef]},v.createElement(Pe.div,pe({"data-state":ah(i.open)},n,{ref:t,style:{pointerEvents:"auto",...n.style}})))}),Ua="DialogContent",xk=v.forwardRef((e,t)=>{const r=X2(Ua,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Mr(Ua,e.__scopeDialog);return v.createElement(Ei,{present:n||o.open},o.modal?v.createElement(wk,pe({},i,{ref:t})):v.createElement(yk,pe({},i,{ref:t})))}),wk=v.forwardRef((e,t)=>{const r=Mr(Ua,e.__scopeDialog),n=v.useRef(null),i=Ve(t,r.contentRef,n);return v.useEffect(()=>{const o=n.current;if(o)return Ed(o)},[]),v.createElement(K2,pe({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:_e(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:_e(e.onFocusOutside,o=>o.preventDefault())}))}),yk=v.forwardRef((e,t)=>{const r=Mr(Ua,e.__scopeDialog),n=v.useRef(!1);return v.createElement(K2,pe({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,i),!i.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}n.current=!1},onInteractOutside:i=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,i),i.defaultPrevented||(n.current=!0);const s=i.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(s))&&i.preventDefault()}}))}),K2=v.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=Mr(Ua,r),l=v.useRef(null),u=Ve(t,l);return gd(),v.createElement(v.Fragment,null,v.createElement(md,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o},v.createElement(lu,pe({role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ah(s.open)},a,{ref:u,onDismiss:()=>s.onOpenChange(!1)}))),!1)}),Ek="DialogTitle",_k=v.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mr(Ek,r);return v.createElement(Pe.h2,pe({id:i.titleId},n,{ref:t}))}),Sk="DialogClose",Tk=v.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mr(Sk,r);return v.createElement(Pe.button,pe({type:"button"},n,{ref:t,onClick:_e(e.onClick,()=>i.onOpenChange(!1))}))});function ah(e){return e?"open":"closed"}const Y2=fk,Ck=hk,Ak=gk,q2=mk,Q2=xk,Z2=_k,s0=Tk;function Rk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Se(Y2,{open:e,onOpenChange:t,children:[Se("div",{id:"loading",className:"saving",children:[K("div",{id:"loading_text",className:"loading_text"}),K("div",{id:"loader",className:"loader"})]}),K(q2,{onClick:t,className:"_modal-overlay"}),Se(Q2,{className:"_modal",children:[K(s0,{children:K(jl,{})}),K(s0,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:K(jl,{className:"w-6 h-6"})}),K(Z2,{className:"_modal-title",children:"Success"}),Se("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[K("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:K("div",{children:Se("label",{htmlFor:"title_text",children:[K("b",{children:window.title})," has been downloaded to",K("br",{}),K("br",{}),K("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),K("div",{style:{float:"right",marginTop:20},children:K("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}const Ok=new Date,Fk=50,l0=30;function Dk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Xd(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http"))return(i==null?void 0:i.toString().length)??0;if(s){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const u0=["csv","xlsx","png"];function Pk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=jo("exportType",u0[0]),[s,l]=v.useState(!1),[u,c]=uk(n),[f,d]=v.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=jo("rowsPerPage",l0,y2),[g,x]=jo("advanced",!1),[w,y]=jo("colors",!1),[_,N]=v.useState([]),[M,S]=v.useState(""),[C,A]=jo("fontSize","1"),[L,H]=v.useState(!1),B=t.reduce((W,q,le)=>(W[q]=le{const fe=Math.max(...W.map(We=>Dk(We,q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(200,fe*12)},ye=v.useMemo(()=>[...t.map((W,q)=>({accessorKey:W,id:W,header:W,size:ne(e,W,W),footer:W,cell:({row:le})=>{var st;const he=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],Te=he?le.original[he]:null,fe=le.original[W],We=typeof fe,be=(fe==null?void 0:fe.toString().replace(/[^0-9]/g,""))??"",ge=(be==null?void 0:be.length)>=4&&(Xd(W)||W.toLowerCase()==="index"||Te&&typeof Te=="string"&&(Te.toLowerCase().includes("date")||Te.toLowerCase().includes("time")||Te.toLowerCase().includes("timestamp")||Te.toLowerCase().includes("year")));if(We==="string"&&fe.startsWith("http"))return K("a",{className:"_hyper-link",href:fe,target:"_blank",rel:"noreferrer",children:(fe==null?void 0:fe.length)>25?fe.substring(0,25)+"...":fe});if(ge){if(typeof fe=="number")return K("p",{children:fe});if(typeof fe=="string"){const ke=fe.split("T")[0],Ge=(st=fe.split("T")[1])==null?void 0:st.split(".")[0];return Ge==="00:00:00"?K("p",{children:ke}):Se("p",{children:[ke," ",Ge]})}try{const ke=new Date(fe);let Ge="";return ke.getUTCHours()===0&&ke.getUTCMinutes()===0&&ke.getUTCSeconds()===0&&ke.getMilliseconds()===0?Ge=ke.toISOString().split("T")[0]:(Ge=ke.toISOString(),Ge=`${Ge.split("T")[0]} ${Ge.split("T")[1].split(".")[0]}`),K("p",{children:Ge})}catch{return K("p",{children:fe})}}if(We==="number"||w2.test(fe==null?void 0:fe.toString())){let ke=aP(fe,W);const Ge=Number(jf(fe));if(typeof Te=="string"&&Gw(Te)){ke=Number(jf(fe));const gr=ke<2?4:2;ke=ke.toLocaleString("en-US",{maximumFractionDigits:gr,minimumFractionDigits:2})}return K("p",{className:Nt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ge>0&&w,"text-[#F87171]":Ge<0&&w,"text-[#404040]":Ge===0&&w}),children:Ge!==0?Ge>0?`${ke}`:`${ke}`:ke})}else if(We==="string")return K("div",{dangerouslySetInnerHTML:{__html:Ob(fe)}});return K("p",{children:fe})}}))],[g,w]),[ve,Ce]=v.useState(!1),[ie,Ee]=v.useState(ye.map(W=>W.id)),ee=()=>Ee(t.map(W=>W.id)),O=v.useMemo(()=>{const W=ie.map(le=>le),q=ye.map(le=>le.id);return!sP(W,q)},[ie,ye]),k=_S({data:e,columns:ye,getCoreRowModel:fS(),getSortedRowModel:mS(),getFilteredRowModel:gS(),getPaginationRowModel:xS(),columnResizeMode:"onChange",onColumnVisibilityChange:Q,onColumnOrderChange:Ee,onSortingChange:N,onGlobalFilterChange:S,globalFilterFn:lP,state:{sorting:_,globalFilter:M,columnOrder:ie,columnVisibility:V},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),b=v.useRef(null),{rows:D}=k.getRowModel(),U=k.getVisibleFlatColumns(),[G,J]=v.useState(!1);return v.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Se(H1,{children:[K(lk,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:H}),K(Rk,{open:G,close:()=>J(!1)}),Se("div",{ref:b,className:Nt("overflow-x-hidden h-screen"),children:[Se("div",{className:"relative p-4",id:"table",children:[K("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Se("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Se("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(C)*100}%`},children:[K("div",{className:"w-1/3",children:K("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:K("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),K("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Se("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Ok).replace(/:\d\d /," "),K("br",{}),K("span",{className:"text-grey-400",children:i})]})]}),K("div",{className:"overflow-auto max-h-[calc(100vh-160px)] smh:max-h-[calc(100vh-95px)]",children:Se("table",{className:"text-sm relative",style:{fontSize:`${Number(C)*100}%`},children:[K("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",children:k.getHeaderGroups().map((W,q)=>K("tr",{children:W.headers.map((le,he)=>K(v8,{setLockFirstColumn:Ce,lockFirstColumn:ve,idx:he,advanced:g,header:le,table:k},le.id))},W.id))}),K("tbody",{children:k.getRowModel().rows.map((W,q)=>K("tr",{className:"!h-[64px] border-b border-grey-400",children:W.getVisibleCells().map((le,he)=>K("td",{className:Nt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":q%2===0,"bg-grey-100 dark:bg-[#202020]":q%2===1,"sticky left-0 z-10":he===0&&ve}),style:{width:le.column.getSize()},children:If(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(D==null?void 0:D.length)>30&&(U==null?void 0:U.length)>4&&K("tfoot",{children:k.getFooterGroups().map(W=>K("tr",{children:W.headers.map(q=>K("th",{colSpan:q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:q.getSize()},children:q.isPlaceholder?null:If(q.column.columnDef.footer,q.getContext())},q.id))},W.id))})]})})]})]}),Se("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Se("div",{className:"flex items-center gap-10",children:[Se(Y2,{children:[K(Ck,{className:"_btn",children:"Settings"}),Se(Ak,{children:[K(q2,{className:"_modal-overlay"}),Se(Q2,{className:"_modal",children:[K(s0,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:K(jl,{className:"w-6 h-6"})}),K(Z2,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Se("div",{className:"grid grid-cols-2 gap-4 mt-10 text-sm",children:[O&&K("button",{onClick:()=>ee(),className:"_btn h-9",children:"Reset Order"}),K(Vi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),K(Vi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:u0.map(W=>({label:W,value:W}))}]}),K(Vi,{labelType:"row",value:C,onChange:A,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),K(h1,{table:k,label:"Filter"}),K("div",{className:"flex gap-2 items-center",children:K(Vi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{x(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Se("div",{className:"flex gap-2 items-center",children:[K("label",{htmlFor:"colors",children:"Colors"}),K("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),K(h1,{onlyIconTrigger:!0,table:k,label:""})]}),K(x8,{currentPage:m,setCurrentPage:p,table:k}),K(w8,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function J2(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ik(e,t){return e.filter(r=>r!==t)}function bk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class kk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=bk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Ik(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class $k{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const ey="__NATIVE_FILE__",ty="__NATIVE_URL__",ry="__NATIVE_TEXT__",ny="__NATIVE_HTML__",y1=Object.freeze(Object.defineProperty({__proto__:null,FILE:ey,HTML:ny,TEXT:ry,URL:ty},Symbol.toStringTag,{value:"Module"}));function Bc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const c0={[ey]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[ny]:{exposeProperties:{html:(e,t)=>Bc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[ty]:{exposeProperties:{urls:(e,t)=>Bc(e,t,"").split(`
-`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[ry]:{exposeProperties:{text:(e,t)=>Bc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function Nk(e,t){const r=c0[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new $k(r);return n.loadDataTransfer(t),n}function Uc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(c0).filter(r=>{const n=c0[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Mk=J2(()=>/firefox/i.test(navigator.userAgent)),iy=J2(()=>!!window.safari);class E1{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:o,c3s:a}=this;let s=r.length-1;if(t===r[s])return n[s];let l=0,u=a.length-1,c;for(;l<=u;){c=Math.floor(.5*(l+u));const h=r[c];if(ht)u=c-1;else return n[c]}s=Math.max(0,u);const f=t-r[s],d=f*f;return n[s]+i[s]*f+o[s]*d+a[s]*f*d}constructor(t,r){const{length:n}=t,i=[];for(let h=0;ht[h]{let M=new E1([0,.5,1],[l.y,l.y/c*m,l.y+m-c]).interpolate(d);return iy()&&o&&(M+=(window.devicePixelRatio-1)*m),M},g=()=>new E1([0,.5,1],[l.x,l.x/u*h,l.x+h-u]).interpolate(f),{offsetX:x,offsetY:w}=i,y=x===0||x,_=w===0||w;return{x:y?x:g(),y:_?w:p()}}class Vk{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Wk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _1(e){for(var t=1;t{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),o=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),o=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return _1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return _1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(y1).some(r=>y1[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=Nk(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&oy(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const a=Us(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:s}=i,l=Uc(s);if(this.monitor.isDragging()){if(s&&typeof s.setDragImage=="function"){const c=this.monitor.getSourceId(),f=this.sourceNodes.get(c),d=this.sourcePreviewNodes.get(c)||f;if(d){const{anchorX:h,anchorY:m,offsetX:p,offsetY:g}=this.getCurrentSourcePreviewNodeOptions(),y=Hk(f,d,a,{anchorX:h,anchorY:m},{offsetX:p,offsetY:g});s.setDragImage(d,y.x,y.y)}}try{s==null||s.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(s&&!s.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:s}=i,l=Uc(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Us(i)}),o.some(s=>this.monitor.canDropOnTarget(s))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Us(i),this.scheduleHover(o),(o||[]).some(s=>this.monitor.canDropOnTarget(s))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;i.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else Uc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Us(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))},this.options=new Vk(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new kk(this.isNodeInDocument)}}const Gk=function(t,r,n){return new zk(t,r,n)};function jk(){const[e,t]=v.useState(null),[r,n]=v.useState("Interactive Table");v.useEffect(()=>{const a=setInterval(()=>{if(window.json_data){const s=JSON.parse(window.json_data);console.log(s),t(s),s.title&&typeof s.title=="string"&&n(s.title),clearInterval(a)}},100);return()=>clearInterval(a)},[]);const o=(a=>{var h;if(!a)return null;const s=(h=a.title)==null?void 0:h.replace(/|<\/b>/g,"").replace(/ /g,"_"),l=new Date().toISOString().slice(0,10).replace(/-/g,""),u=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${s}_${l}_${u}`;const c=a.columns;a.index;const d=a.data.map((m,p)=>{const g={};return m.forEach((x,w)=>{g[c[w]]=x||(x===0?0:"")}),g});return{columns:c,data:d}})(e);return K("div",{className:"relative h-full bg-white dark:bg-black text-black dark:text-white",children:K(FI,{backend:Gk,children:o&&K(Pk,{title:r,data:o.data,columns:o.columns,initialTheme:e.theme&&typeof e.theme=="string"&&e.theme==="dark"?"dark":"light",cmd:(e==null?void 0:e.command_location)??""})})})}wv.render(K(ir.StrictMode,{children:K(jk,{})}),document.getElementById("root"));
+`),s.bookType=="fods"?l.push(""):l.push(""),l.join("")}}();function Qw(e,t){if(t.bookType=="fods")return Yg(e,t);var r=kd(),n="",i=[],o=[];return n="mimetype",De(r,n,"application/vnd.oasis.opendocument.spreadsheet"),n="content.xml",De(r,n,Yg(e,t)),i.push([n,"text/xml"]),o.push([n,"ContentFile"]),n="styles.xml",De(r,n,A6(e,t)),i.push([n,"text/xml"]),o.push([n,"StylesFile"]),n="meta.xml",De(r,n,at+fw()),i.push([n,"text/xml"]),o.push([n,"MetadataFile"]),n="manifest.rdf",De(r,n,L3(o)),i.push([n,"application/rdf+xml"]),n="META-INF/manifest.xml",De(r,n,N3(i)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Xl(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function R6(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):yr(jr(e))}function O6(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var n=0;n>7,e[t+14]|=(n&127)<<1;for(var o=0;i>=1;++o,i/=256)e[t+o]=i&255;e[t+15]|=r>=0?0:128}function Wa(e,t){var r=t?t[0]:0,n=e[r]&127;e:if(e[r++]>=128&&(n|=(e[r]&127)<<7,e[r++]<128||(n|=(e[r]&127)<<14,e[r++]<128)||(n|=(e[r]&127)<<21,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(n+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),n}function Le(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function so(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function st(e){for(var t=[],r=[0];r[0]=128;);s=e.slice(l,r[0])}break;case 5:a=4,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 1:a=8,s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 2:a=Wa(e,r),s=e.slice(r[0],r[0]+a),r[0]+=a;break;case 3:case 4:default:throw new Error("PB Type ".concat(o," for Field ").concat(i," at offset ").concat(n))}var u={data:s,type:o};t[i]==null?t[i]=[u]:t[i].push(u)}return t}function pt(e){var t=[];return e.forEach(function(r,n){r.forEach(function(i){i.data&&(t.push(Le(n*8+i.type)),i.type==2&&t.push(Le(i.data.length)),t.push(i.data))})}),Mn(t)}function mr(e){for(var t,r=[],n=[0];n[0]>>0>0),r.push(a)}return r}function bi(e){var t=[];return e.forEach(function(r){var n=[];n[1]=[{data:Le(r.id),type:0}],n[2]=[],r.merge!=null&&(n[3]=[{data:Le(+!!r.merge),type:0}]);var i=[];r.messages.forEach(function(a){i.push(a.data),a.meta[3]=[{type:0,data:Le(a.data.length)}],n[2].push({data:pt(a.meta),type:2})});var o=pt(n);t.push(Le(o.length)),t.push(o),i.forEach(function(a){return t.push(a)})}),Mn(t)}function D6(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],n=Wa(t,r),i=[];r[0]>2;if(a<60)++a;else{var s=a-59;a=t[r[0]],s>1&&(a|=t[r[0]+1]<<8),s>2&&(a|=t[r[0]+2]<<16),s>3&&(a|=t[r[0]+3]<<24),a>>>=0,a++,r[0]+=s}i.push(t.slice(r[0],r[0]+a)),r[0]+=a;continue}else{var l=0,u=0;if(o==1?(u=(t[r[0]]>>2&7)+4,l=(t[r[0]++]&224)<<3,l|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,o==2?(l=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(l=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),i=[Mn(i)],l==0)throw new Error("Invalid offset 0");if(l>i[0].length)throw new Error("Invalid offset beyond length");if(u>=l)for(i.push(i[0].slice(-l)),u-=l;u>=i[i.length-1].length;)i.push(i[i.length-1]),u-=i[i.length-1].length;i.push(i[0].slice(-l,-l+u))}}var c=Mn(i);if(c.length!=n)throw new Error("Unexpected length: ".concat(c.length," != ").concat(n));return c}function vr(e){for(var t=[],r=0;r>8&255]))):n<=16777216?(a+=4,t.push(new Uint8Array([248,n-1&255,n-1>>8&255,n-1>>16&255]))):n<=4294967296&&(a+=5,t.push(new Uint8Array([252,n-1&255,n-1>>8&255,n-1>>16&255,n-1>>>24&255]))),t.push(e.slice(r,r+n)),a+=n,i[0]=0,i[1]=a&255,i[2]=a>>8&255,i[3]=a>>16&255,r+=n}return Mn(t)}function Lc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=5,e.t){case"n":r[1]=2,F6(r,i,e.v),o|=1,i+=16;break;case"b":r[1]=6,n.setFloat64(i,e.v?1:0,!0),o|=2,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=8,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(8,o,!0),r.slice(0,i)}function Bc(e,t){var r=new Uint8Array(32),n=Xl(r),i=12,o=0;switch(r[0]=3,e.t){case"n":r[2]=2,n.setFloat64(i,e.v,!0),o|=32,i+=8;break;case"b":r[2]=6,n.setFloat64(i,e.v?1:0,!0),o|=32,i+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,n.setUint32(i,t.indexOf(e.v),!0),o|=16,i+=4;break;default:throw"unsupported cell type "+e.t}return n.setUint32(4,o,!0),r.slice(0,i)}function un(e){var t=st(e);return Wa(t[1][0].data)}function P6(e,t,r){var n,i,o,a;if(!((n=e[6])!=null&&n[0])||!((i=e[7])!=null&&i[0]))throw"Mutation only works on post-BNC storages!";var s=((a=(o=e[8])==null?void 0:o[0])==null?void 0:a.data)&&so(e[8][0].data)>0||!1;if(s)throw"Math only works with normal offsets";for(var l=0,u=Xl(e[7][0].data),c=0,f=[],d=Xl(e[4][0].data),h=0,m=[],p=0;p1&&console.error("The Numbers writer currently writes only the first table");var n=Jt(r["!ref"]);n.s.r=n.s.c=0;var i=!1;n.e.c>9&&(i=!0,n.e.c=9),n.e.r>49&&(i=!0,n.e.r=49),i&&console.error("The Numbers writer is currently limited to ".concat(ot(n)));var o=Kl(r,{range:n,header:1}),a=["~Sh33tJ5~"];o.forEach(function(M){return M.forEach(function(N){typeof N=="string"&&a.push(N)})});var s={},l=[],u=Ve.read(t.numbers,{type:"base64"});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0],F=M[1];if(N.type==2&&N.name.match(/\.iwa/)){var V=N.content,Y=vr(V),J=mr(Y);J.forEach(function(W){l.push(W.id),s[W.id]={deps:[],location:F,type:so(W.messages[0].meta[1][0].data)}})}}),l.sort(function(M,N){return M-N});var c=l.filter(function(M){return M>1}).map(function(M){return[M,Le(M)]});u.FileIndex.map(function(M,N){return[M,u.FullPaths[N]]}).forEach(function(M){var N=M[0];if(M[1],!!N.name.match(/\.iwa/)){var F=mr(vr(N.content));F.forEach(function(V){V.messages.forEach(function(Y){c.forEach(function(J){V.messages.some(function(W){return so(W.meta[1][0].data)!=11006&&O6(W.data,J[1])})&&s[J[0]].deps.push(V.id)})})})}});for(var f=Ve.find(u,s[1].location),d=mr(vr(f.content)),h,m=0;m-1,i=lw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Hn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,dw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,gw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS)),s=1;s<=e.SheetNames.length;++s){var c={"!id":{}},f=e.Sheets[e.SheetNames[s-1]],d=(f||{})["!type"]||"sheet";switch(d){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,LD(s-1,a,t,e,c)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(f){var h=f["!comments"],m=!1,p="";h&&h.length>0&&(p="xl/comments"+s+"."+r,De(o,p,HD(h,p)),i.comments.push(p),Be(c,-1,"../comments"+s+"."+r,ke.CMNT),m=!0),f["!legacy"]&&m&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Pw(s,f["!comments"])),delete f["!comments"],delete f["!legacy"]}c["!id"].rId1&&De(o,cw(a),oo(c))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,UD(t.Strings,a,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,MD(e,a)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Fw(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,BD(e,a,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,VD(a)),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),De(o,"[Content_Types].xml",uw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function N6(e,t){Gi=1024,e&&!e.SSF&&(e.SSF=Xt(rt)),e&&e.SSF&&(_u(),Eu(e.SSF),t.revssf=Su(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Ea?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",n=bw.indexOf(t.bookType)>-1,i=lw();qd(t=t||{});var o=kd(),a="",s=0;if(t.cellXfs=[],Hn(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),a="docProps/core.xml",De(o,a,dw(e.Props,t)),i.coreprops.push(a),Be(t.rels,2,a,ke.CORE_PROPS),a="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var l=[],u=0;u0&&(a="docProps/custom.xml",De(o,a,gw(e.Custprops)),i.custprops.push(a),Be(t.rels,4,a,ke.CUST_PROPS));var c=["SheetJ5"];for(t.tcid=0,s=1;s<=e.SheetNames.length;++s){var f={"!id":{}},d=e.Sheets[e.SheetNames[s-1]],h=(d||{})["!type"]||"sheet";switch(h){case"chart":default:a="xl/worksheets/sheet"+s+"."+r,De(o,a,Vw(s-1,t,e,f)),i.sheets.push(a),Be(t.wbrels,-1,"worksheets/sheet"+s+"."+r,ke.WS[0])}if(d){var m=d["!comments"],p=!1,g="";if(m&&m.length>0){var x=!1;m.forEach(function(w){w[1].forEach(function(y){y.T==!0&&(x=!0)})}),x&&(g="xl/threadedComments/threadedComment"+s+"."+r,De(o,g,hR(m,c,t)),i.threadedcomments.push(g),Be(f,-1,"../threadedComments/threadedComment"+s+"."+r,ke.TCMNT)),g="xl/comments"+s+"."+r,De(o,g,Iw(m)),i.comments.push(g),Be(f,-1,"../comments"+s+"."+r,ke.CMNT),p=!0}d["!legacy"]&&p&&De(o,"xl/drawings/vmlDrawing"+s+".vml",Pw(s,d["!comments"])),delete d["!comments"],delete d["!legacy"]}f["!id"].rId1&&De(o,cw(a),oo(f))}return t.Strings!=null&&t.Strings.length>0&&(a="xl/sharedStrings."+r,De(o,a,Sw(t.Strings,t)),i.strs.push(a),Be(t.wbrels,-1,"sharedStrings."+r,ke.SST)),a="xl/workbook."+r,De(o,a,Gw(e)),i.workbooks.push(a),Be(t.rels,1,a,ke.WB),a="xl/theme/theme1.xml",De(o,a,Fw(e.Themes,t)),i.themes.push(a),Be(t.wbrels,-1,"theme/theme1.xml",ke.THEME),a="xl/styles."+r,De(o,a,Rw(e,t)),i.styles.push(a),Be(t.wbrels,-1,"styles."+r,ke.STY),e.vbaraw&&n&&(a="xl/vbaProject.bin",De(o,a,e.vbaraw),i.vba.push(a),Be(t.wbrels,-1,"vbaProject.bin",ke.VBA)),a="xl/metadata."+r,De(o,a,Dw()),i.metadata.push(a),Be(t.wbrels,-1,"metadata."+r,ke.XLMETA),c.length>1&&(a="xl/persons/person.xml",De(o,a,pR(c)),i.people.push(a),Be(t.wbrels,-1,"persons/person.xml",ke.PEOPLE)),De(o,"[Content_Types].xml",uw(i,t)),De(o,"_rels/.rels",oo(t.rels)),De(o,"xl/_rels/workbook."+r+".rels",oo(t.wbrels)),delete t.revssf,delete t.ssf,o}function M6(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=rn(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function Zw(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return ns(t.file,Ve.write(e,{type:Me?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return Ve.write(e,t)}function L6(e,t){var r=Xt(t||{}),n=k6(e,r);return B6(n,r)}function B6(e,t){var r={},n=Me?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=n;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=n;break;default:throw new Error("Unrecognized type "+t.type)}var i=e.FullPaths?Ve.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof i=="string"){if(t.type=="binary"||t.type=="base64")return i;i=new Uint8Array(yu(i))}return t.password&&typeof encrypt_agile<"u"?Zw(encrypt_agile(i,t.password),t):t.type==="file"?ns(t.file,i):t.type=="string"?va(i):i}function U6(e,t){var r=t||{},n=r6(e,r);return Zw(n,r)}function Fr(e,t,r){r||(r="");var n=r+e;switch(t.type){case"base64":return Ua(jr(n));case"binary":return jr(n);case"string":return e;case"file":return ns(t.file,n,"utf8");case"buffer":return Me?ln(n,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(n):Fr(n,{type:"binary"}).split("").map(function(i){return i.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function H6(e,t){switch(t.type){case"base64":return Ua(e);case"binary":return e;case"string":return e;case"file":return ns(t.file,e,"binary");case"buffer":return Me?ln(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Vs(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",n=0;n0&&(i=0);var f=yt(l.s.r),d=[],h=[],m=0,p=0,g=Array.isArray(e),x=l.s.r,w=0,y={};g&&!e[x]&&(e[x]=[]);var E=u.skipHidden&&e["!cols"]||[],b=u.skipHidden&&e["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(E[w]||{}).hidden)switch(d[w]=Rt(w),r=g?e[x][w]:e[d[w]+f],n){case 1:o[w]=w-l.s.c;break;case 2:o[w]=d[w];break;case 3:o[w]=u.header[w-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),s=a=nn(r,null,u),p=y[a]||0,!p)y[a]=1;else{do s=a+"_"+p++;while(y[s]);y[a]=p,y[s]=1}o[w]=s}for(x=l.s.r+i;x<=l.e.r;++x)if(!(b[x]||{}).hidden){var k=z6(e,l,x,d,n,o,g,u);(k.isempty===!1||(n===1?u.blankrows!==!1:u.blankrows))&&(h[m++]=k.row)}return h.length=m,h}var qg=/"/g;function G6(e,t,r,n,i,o,a,s){for(var l=!0,u=[],c="",f=yt(r),d=t.s.c;d<=t.e.c;++d)if(n[d]){var h=s.dense?(e[r]||[])[d]:e[n[d]+f];if(h==null)c="";else if(h.v!=null){l=!1,c=""+(s.rawNumbers&&h.t=="n"?h.v:nn(h,null,s));for(var m=0,p=0;m!==c.length;++m)if((p=c.charCodeAt(m))===i||p===o||p===34||s.forceQuotes){c='"'+c.replace(qg,'""')+'"';break}c=="ID"&&(c='"ID"')}else h.f!=null&&!h.F?(l=!1,c="="+h.f,c.indexOf(",")>=0&&(c='"'+c.replace(qg,'""')+'"')):c="";u.push(c)}return s.blankrows===!1&&l?null:u.join(a)}function Qd(e,t){var r=[],n=t??{};if(e==null||e["!ref"]==null)return"";var i=Xe(e["!ref"]),o=n.FS!==void 0?n.FS:",",a=o.charCodeAt(0),s=n.RS!==void 0?n.RS:`
+`,l=s.charCodeAt(0),u=new RegExp((o=="|"?"\\|":o)+"+$"),c="",f=[];n.dense=Array.isArray(e);for(var d=n.skipHidden&&e["!cols"]||[],h=n.skipHidden&&e["!rows"]||[],m=i.s.c;m<=i.e.c;++m)(d[m]||{}).hidden||(f[m]=Rt(m));for(var p=0,g=i.s.r;g<=i.e.r;++g)(h[g]||{}).hidden||(c=G6(e,i,g,f,a,l,o,n),c!=null&&(n.strip&&(c=c.replace(u,"")),(c||n.blankrows!==!1)&&r.push((p++?s:"")+c)));return delete n.dense,r.join("")}function e2(e,t){t||(t={}),t.FS=" ",t.RS=`
+`;var r=Qd(e,t);return r}function j6(e){var t="",r,n="";if(e==null||e["!ref"]==null)return[];var i=Xe(e["!ref"]),o="",a=[],s,l=[],u=Array.isArray(e);for(s=i.s.c;s<=i.e.c;++s)a[s]=Rt(s);for(var c=i.s.r;c<=i.e.r;++c)for(o=yt(c),s=i.s.c;s<=i.e.c;++s)if(t=a[s]+o,r=u?(e[c]||[])[s]:e[t],n="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;n=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)n=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)n=""+r.v;else if(r.t=="b")n=r.v?"TRUE":"FALSE";else if(r.w!==void 0)n="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?n="'"+r.v:n=""+r.v}}l[l.length]=t+"="+n}return l}function t2(e,t,r){var n=r||{},i=+!n.skipHeader,o=e||{},a=0,s=0;if(o&&n.origin!=null)if(typeof n.origin=="number")a=n.origin;else{var l=typeof n.origin=="string"?ft(n.origin):n.origin;a=l.r,s=l.c}var u,c={s:{c:0,r:0},e:{c:s,r:a+t.length-1+i}};if(o["!ref"]){var f=Xe(o["!ref"]);c.e.c=Math.max(c.e.c,f.e.c),c.e.r=Math.max(c.e.r,f.e.r),a==-1&&(a=f.e.r+1,c.e.r=a+t.length-1+i)}else a==-1&&(a=0,c.e.r=t.length-1+i);var d=n.header||[],h=0;t.forEach(function(p,g){_t(p).forEach(function(x){(h=d.indexOf(x))==-1&&(d[h=d.length]=x);var w=p[x],y="z",E="",b=He({c:s+h,r:a+g+i});u=za(o,b),w&&typeof w=="object"&&!(w instanceof Date)?o[b]=w:(typeof w=="number"?y="n":typeof w=="boolean"?y="b":typeof w=="string"?y="s":w instanceof Date?(y="d",n.cellDates||(y="n",w=jt(w)),E=n.dateNF||rt[14]):w===null&&n.nullError&&(y="e",w=0),u?(u.t=y,u.v=w,delete u.w,delete u.R,E&&(u.z=E)):o[b]=u={t:y,v:w},E&&(u.z=E))})}),c.e.c=Math.max(c.e.c,s+d.length-1);var m=yt(a);if(i)for(h=0;h=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function Y6(){return{SheetNames:[],Sheets:{}}}function q6(e,t,r,n){var i=1;if(!r)for(;i<=65535&&e.SheetNames.indexOf(r="Sheet"+i)!=-1;++i,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(n&&e.SheetNames.indexOf(r)>=0){var o=r.match(/(^.*?)(\d+)$/);i=o&&+o[2]||0;var a=o&&o[1]||r;for(++i;i<=65535&&e.SheetNames.indexOf(r=a+i)!=-1;++i);}if(zw(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function Q6(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var n=K6(e,t);switch(e.Workbook.Sheets[n]||(e.Workbook.Sheets[n]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[n].Hidden=r}function Z6(e,t){return e.z=t,e}function r2(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function J6(e,t,r){return r2(e,"#"+t,r)}function eP(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function tP(e,t,r,n){for(var i=typeof t!="string"?t:Xe(t),o=typeof t=="string"?t:ot(t),a=i.s.r;a<=i.e.r;++a)for(var s=i.s.c;s<=i.e.c;++s){var l=za(e,a,s);l.t="n",l.F=o,delete l.v,a==i.s.r&&s==i.s.c&&(l.f=r,n&&(l.D=!0))}return e}var Uc={encode_col:Rt,encode_row:yt,encode_cell:He,encode_range:ot,decode_col:Ud,decode_row:Bd,split_cell:g3,decode_cell:ft,decode_range:Jt,format_cell:nn,sheet_add_aoa:rw,sheet_add_json:t2,sheet_add_dom:Yw,aoa_to_sheet:Ro,json_to_sheet:X6,table_to_sheet:qw,table_to_book:T6,sheet_to_csv:Qd,sheet_to_txt:e2,sheet_to_json:Kl,sheet_to_html:Kw,sheet_to_formulae:j6,sheet_to_row_object_array:Kl,sheet_get_cell:za,book_new:Y6,book_append_sheet:q6,book_set_sheet_visibility:Q6,cell_set_number_format:Z6,cell_set_hyperlink:r2,cell_set_internal_link:J6,cell_add_comment:eP,sheet_set_array_formula:tP,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};function t0(e){if(typeof e=="string"){const t=e.replace(/[^a-zA-Z]/g,"").trim(),r=["","K","M","B","T"].indexOf(t.replace(/\s/g,""));e=Number(e.replace(/[^0-9.]/g,"").trim())*Math.pow(10,r*3)}return e}function rP(e,t){var r;if(typeof e=="string"&&(e=Number(t0(e))),e%1!==0){const n=Math.max(2,((r=e.toString().split(".")[1])==null?void 0:r.length)||0),i=Math.min(4,n);if(e<1e3)return e.toFixed(i)||0}if((e>1e5||e<-1e5)&&!i2(t||"")){const n=Math.min(4,Math.floor(Math.log10(Math.abs(e))/3)),i=["","K","M","B","T"][n];return`${(e/10**(n*3)).toFixed(3).replace(/\.?0+$/,"")} ${i}`}return e>1e3||e<-1e3?n2(e):e}function n2(e){if(e>1e3||e<-1e3){const t=e.toString().split("."),r=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n=t[1]?`.${t[1]}`:"";return`${r}${n}`}return e}function Yl(e){return["date","day","time","timestamp","year"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function i2(e){return["price","open","close"].some(t=>e==null?void 0:e.toLowerCase().includes(t))}function ji(e,t){const r=window.document.getElementById("loading"),n=window.document.getElementById("loading_text");return new Promise(i=>{t?r.classList.remove("show"):(n.innerHTML=e,r.classList.add("show"));const o=setInterval(function(){(t?!r.classList.contains("show"):r.classList.contains("show"))&&(clearInterval(o),i(!0))},.01)})}function nP(e,t){if(e===t)return!0;if(e==null||t==null||(e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let r=0;r<(e==null?void 0:e.length);++r)if(e[r]!==t[r])return!1;return!0}const iP=(e,t,r,n)=>{const i=i4(e.getValue(t),r);return n(i),i},oP=async({fileHandle:e,blob:t})=>{e&&await aP({fileHandle:e,blob:t})},aP=async({fileHandle:e,blob:t})=>{const r=await e.createWritable();await r.write(t),await r.close()},sP=[{description:"PNG Image",accept:{"image/png":[".png"]}},{description:"JPEG Image",accept:{"image/jpeg":[".jpeg"]}}],o2=({filename:e,is_image:t})=>{try{if("showSaveFilePicker"in window){const r={suggestedName:e,types:t?sP:[{description:"CSV File",accept:{"image/csv":[".csv"]}}],excludeAcceptAllOption:!0};return showSaveFilePicker(r)}}catch(r){console.error(r)}return new Promise(r=>{r(null)})},a2=(e,t,r)=>{try{if(r===null)throw new Error("Cannot access filesystem");oP({fileHandle:r,blob:e})}catch(n){console.error("oops, something went wrong!",n);const i=URL.createObjectURL(e),o=document.createElement("a");o.setAttribute("href",i),o.setAttribute("download",t),o.style.visibility="hidden",document.body.appendChild(o),o.click(),document.body.removeChild(o)}return new Promise(n=>{n(!0)})};async function Qg(e,t,r,n){const i=t,o=r.map(u=>i.map(c=>u[c])),a=[i,...o];if(e==="csv"){const u=a.map(d=>d.join(",")).join(`
+`),c=new Blob([u],{type:"text/csv;charset=utf-8;"}),f=`${window.title}.csv`;try{const d=await o2({filename:f});let h="csv";d!==null&&(h=d.name.split(".").pop()),await ji(`Saving ${h.toUpperCase()}`),r0(async function(){a2(c,f,d).then(async function(){await new Promise(m=>setTimeout(m,1500)),await ji("",!0),d||n(!0)})},2)()}catch(d){console.error(d)}return}const s=Uc.book_new(),l=Uc.aoa_to_sheet(a);Uc.book_append_sheet(s,l,"Sheet1"),await ji("Saving XLSX"),r0(async function(){await new Promise(u=>setTimeout(u,1500)),W6(s,`${window.title}.xlsx`),await ji("",!0),n==null||n(!0)},2)()}async function lP(e,t){const r=document.getElementById(e),n=`${window.title}.png`;try{const i=await o2({filename:n,is_image:!0});let o="png";i!==null&&(o=i.name.split(".").pop()),await ji(`Saving ${o.toUpperCase()}`),r0(async function(){f4.toBlob(r).then(function(a){a2(a,n,i).then(async function(){await new Promise(s=>setTimeout(s,1500)),await ji("",!0),i||t(!0)})})},2)()}catch(i){console.error(i)}}const r0=(e,t)=>{let r;return function(){const n=this,i=arguments;clearTimeout(r),r=setTimeout(()=>e.apply(n,i),t)}},ql=({title:e,titleId:t,...r})=>j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,...r,children:j("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})});function Zg(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ou(e){const t=e+"CollectionProvider",[r,n]=sn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=h=>{const{scope:m,children:p}=h,g=nr.useRef(null),x=nr.useRef(new Map).current;return nr.createElement(i,{scope:m,itemMap:x,collectionRef:g},p)},s=e+"CollectionSlot",l=nr.forwardRef((h,m)=>{const{scope:p,children:g}=h,x=o(s,p),w=We(m,x.collectionRef);return nr.createElement(ii,{ref:w},g)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=nr.forwardRef((h,m)=>{const{scope:p,children:g,...x}=h,w=nr.useRef(null),y=We(m,w),E=o(u,p);return nr.useEffect(()=>(E.itemMap.set(w,{ref:w,...x}),()=>void E.itemMap.delete(w))),nr.createElement(ii,{[c]:"",ref:y},g)});function d(h){const m=o(e+"CollectionConsumer",h);return nr.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const x=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((E,b)=>x.indexOf(E.ref.current)-x.indexOf(b.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},d,n]}const uP=v.createContext(void 0);function Zd(e){const t=v.useContext(uP);return e||t||"ltr"}function Do(e){return e.split("-")[1]}function Jd(e){return e==="y"?"height":"width"}function Zr(e){return e.split("-")[0]}function Si(e){return["top","bottom"].includes(Zr(e))?"x":"y"}function Jg(e,t,r){let{reference:n,floating:i}=e;const o=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,s=Si(t),l=Jd(s),u=n[l]/2-i[l]/2,c=s==="x";let f;switch(Zr(t)){case"top":f={x:o,y:n.y-i.height};break;case"bottom":f={x:o,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:a};break;case"left":f={x:n.x-i.width,y:a};break;default:f={x:n.x,y:n.y}}switch(Do(t)){case"start":f[s]-=u*(r&&c?-1:1);break;case"end":f[s]+=u*(r&&c?-1:1)}return f}const cP=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=Jg(u,n,l),d=n,h={},m=0;for(let p=0;p({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s}=t,{element:l,padding:u=0}=on(e,t)||{};if(l==null)return{};const c=s2(u),f={x:r,y:n},d=Si(i),h=Jd(d),m=await a.getDimensions(l),p=d==="y",g=p?"top":"left",x=p?"bottom":"right",w=p?"clientHeight":"clientWidth",y=o.reference[h]+o.reference[d]-f[d]-o.floating[h],E=f[d]-o.reference[d],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let k=b?b[w]:0;k&&await(a.isElement==null?void 0:a.isElement(b))||(k=s.floating[w]||o.floating[h]);const S=y/2-E/2,A=k/2-m[h]/2-1,C=ja(c[g],A),L=ja(c[x],A),B=C,U=k-m[h]-L,H=k/2-m[h]/2+S,X=n0(B,H,U),ee=Do(i)!=null&&H!=X&&o.reference[h]/2-(He.concat(t,t+"-start",t+"-end"),[]);const fP={left:"right",right:"left",bottom:"top",top:"bottom"};function Zl(e){return e.replace(/left|right|bottom|top/g,t=>fP[t])}function dP(e,t,r){r===void 0&&(r=!1);const n=Do(e),i=Si(e),o=Jd(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Zl(a)),{main:a,cross:Zl(a)}}const hP={start:"end",end:"start"};function Hc(e){return e.replace(/start|end/g,t=>hP[t])}const pP=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...p}=on(e,t),g=Zr(n),x=Zr(a)===a,w=await(s.isRTL==null?void 0:s.isRTL(l.floating)),y=f||(x||!m?[Zl(a)]:function(B){const U=Zl(B);return[Hc(B),U,Hc(U)]}(a));f||h==="none"||y.push(...function(B,U,H,X){const ee=Do(B);let ae=function(he,_e,oe){const ye=["left","right"],te=["right","left"],O=["top","bottom"],M=["bottom","top"];switch(he){case"top":case"bottom":return oe?_e?te:ye:_e?ye:te;case"left":case"right":return _e?O:M;default:return[]}}(Zr(B),H==="start",X);return ee&&(ae=ae.map(he=>he+"-"+ee),U&&(ae=ae.concat(ae.map(Hc)))),ae}(a,m,h,w));const E=[a,...y],b=await Ga(t,p),k=[];let S=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(b[g]),c){const{main:B,cross:U}=dP(n,o,w);k.push(b[B],b[U])}if(S=[...S,{placement:n,overflows:k}],!k.every(B=>B<=0)){var A,C;const B=(((A=i.flip)==null?void 0:A.index)||0)+1,U=E[B];if(U)return{data:{index:B,overflows:S},reset:{placement:U}};let H=(C=S.filter(X=>X.overflows[0]<=0).sort((X,ee)=>X.overflows[1]-ee.overflows[1])[0])==null?void 0:C.placement;if(!H)switch(d){case"bestFit":{var L;const X=(L=S.map(ee=>[ee.placement,ee.overflows.filter(ae=>ae>0).reduce((ae,he)=>ae+he,0)]).sort((ee,ae)=>ee[1]-ae[1])[0])==null?void 0:L[0];X&&(H=X);break}case"initialPlacement":H=a}if(n!==H)return{reset:{placement:H}}}return{}}}};function t1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function r1(e){return l2.some(t=>e[t]>=0)}const gP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=on(e,t);switch(n){case"referenceHidden":{const o=t1(await Ga(t,{...i,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:r1(o)}}}case"escaped":{const o=t1(await Ga(t,{...i,altBoundary:!0}),r.floating);return{data:{escapedOffsets:o,escaped:r1(o)}}}default:return{}}}}},mP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Zr(s),d=Do(s),h=Si(s)==="x",m=["left","top"].includes(f)?-1:1,p=c&&h?-1:1,g=on(a,o);let{mainAxis:x,crossAxis:w,alignmentAxis:y}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return d&&typeof y=="number"&&(w=d==="end"?-1*y:y),h?{x:w*p,y:x*m}:{x:x*m,y:w*p}}(t,e);return{x:r+i.x,y:n+i.y,data:i}}}};function u2(e){return e==="x"?"y":"x"}const vP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x,y:w}=g;return{x,y:w}}},...l}=on(e,t),u={x:r,y:n},c=await Ga(t,l),f=Si(Zr(i)),d=u2(f);let h=u[f],m=u[d];if(o){const g=f==="y"?"bottom":"right";h=n0(h+c[f==="y"?"top":"left"],h,h-c[g])}if(a){const g=d==="y"?"bottom":"right";m=n0(m+c[d==="y"?"top":"left"],m,m-c[g])}const p=s.fn({...t,[f]:h,[d]:m});return{...p,data:{x:p.x-r,y:p.y-n}}}}},xP=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=on(e,t),c={x:r,y:n},f=Si(i),d=u2(f);let h=c[f],m=c[d];const p=on(s,t),g=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const y=f==="y"?"height":"width",E=o.reference[f]-o.floating[y]+g.mainAxis,b=o.reference[f]+o.reference[y]-g.mainAxis;hb&&(h=b)}if(u){var x,w;const y=f==="y"?"width":"height",E=["top","left"].includes(Zr(i)),b=o.reference[d]-o.floating[y]+(E&&((x=a.offset)==null?void 0:x[d])||0)+(E?0:g.crossAxis),k=o.reference[d]+o.reference[y]+(E?0:((w=a.offset)==null?void 0:w[d])||0)-(E?g.crossAxis:0);mk&&(m=k)}return{[f]:h,[d]:m}}}},wP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:i,elements:o}=t,{apply:a=()=>{},...s}=on(e,t),l=await Ga(t,s),u=Zr(r),c=Do(r),f=Si(r)==="x",{width:d,height:h}=n.floating;let m,p;u==="top"||u==="bottom"?(m=u,p=c===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(p=u,m=c==="end"?"top":"bottom");const g=h-l[m],x=d-l[p],w=!t.middlewareData.shift;let y=g,E=x;if(f){const k=d-l.left-l.right;E=c||w?ja(x,k):k}else{const k=h-l.top-l.bottom;y=c||w?ja(g,k):k}if(w&&!c){const k=Gn(l.left,0),S=Gn(l.right,0),A=Gn(l.top,0),C=Gn(l.bottom,0);f?E=d-2*(k!==0||S!==0?k+S:Gn(l.left,l.right)):y=h-2*(A!==0||C!==0?A+C:Gn(l.top,l.bottom))}await a({...t,availableWidth:E,availableHeight:y});const b=await i.getDimensions(o.floating);return d!==b.width||h!==b.height?{reset:{rects:!0}}:{}}}};function ur(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cr(e){return ur(e).getComputedStyle(e)}function c2(e){return e instanceof ur(e).Node}function Ln(e){return c2(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){return e instanceof ur(e).HTMLElement}function Jr(e){return e instanceof ur(e).Element}function n1(e){return typeof ShadowRoot<"u"&&(e instanceof ur(e).ShadowRoot||e instanceof ShadowRoot)}function Xa(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Cr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function yP(e){return["table","td","th"].includes(Ln(e))}function i0(e){const t=eh(),r=Cr(e);return r.transform!=="none"||r.perspective!=="none"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Fu(e){return["html","body","#document"].includes(Ln(e))}const o0=Math.min,lo=Math.max,Jl=Math.round,Ws=Math.floor,li=e=>({x:e,y:e});function f2(e){const t=Cr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Ar(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Jl(r)!==o||Jl(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function th(e){return Jr(e)?e:e.contextElement}function uo(e){const t=th(e);if(!Ar(t))return li(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=f2(t);let a=(o?Jl(r.width):r.width)/n,s=(o?Jl(r.height):r.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const i1=li(0);function d2(e,t,r){var n,i;if(t===void 0&&(t=!0),!eh())return i1;const o=e?ur(e):window;return!r||t&&r!==o?i1:{x:((n=o.visualViewport)==null?void 0:n.offsetLeft)||0,y:((i=o.visualViewport)==null?void 0:i.offsetTop)||0}}function ui(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=th(e);let a=li(1);t&&(n?Jr(n)&&(a=uo(n)):a=uo(e));const s=d2(o,r,n);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=ur(o),h=n&&Jr(n)?ur(n):n;let m=d.frameElement;for(;m&&n&&h!==d;){const p=uo(m),g=m.getBoundingClientRect(),x=getComputedStyle(m),w=g.left+(m.clientLeft+parseFloat(x.paddingLeft))*p.x,y=g.top+(m.clientTop+parseFloat(x.paddingTop))*p.y;l*=p.x,u*=p.y,c*=p.x,f*=p.y,l+=w,u+=y,m=ur(m).frameElement}}return Ql({width:c,height:f,x:l,y:u})}function en(e){return((c2(e)?e.ownerDocument:e.document)||window.document).documentElement}function Du(e){return Jr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function h2(e){return ui(en(e)).left+Du(e).scrollLeft}function vo(e){if(Ln(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n1(e)&&e.host||en(e);return n1(t)?t.host:t}function p2(e){const t=vo(e);return Fu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ar(t)&&Xa(t)?t:p2(t)}function eu(e,t){var r;t===void 0&&(t=[]);const n=p2(e),i=n===((r=e.ownerDocument)==null?void 0:r.body),o=ur(n);return i?t.concat(o,o.visualViewport||[],Xa(n)?n:[]):t.concat(n,eu(n))}function o1(e,t,r){let n;if(t==="viewport")n=function(i,o){const a=ur(i),s=en(i),l=a.visualViewport;let u=s.clientWidth,c=s.clientHeight,f=0,d=0;if(l){u=l.width,c=l.height;const h=eh();(!h||h&&o==="fixed")&&(f=l.offsetLeft,d=l.offsetTop)}return{width:u,height:c,x:f,y:d}}(e,r);else if(t==="document")n=function(i){const o=en(i),a=Du(i),s=i.ownerDocument.body,l=lo(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),u=lo(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let c=-a.scrollLeft+h2(i);const f=-a.scrollTop;return Cr(s).direction==="rtl"&&(c+=lo(o.clientWidth,s.clientWidth)-l),{width:l,height:u,x:c,y:f}}(en(e));else if(Jr(t))n=function(i,o){const a=ui(i,!0,o==="fixed"),s=a.top+i.clientTop,l=a.left+i.clientLeft,u=Ar(i)?uo(i):li(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:s*u.y}}(t,r);else{const i=d2(e);n={...t,x:t.x-i.x,y:t.y-i.y}}return Ql(n)}function g2(e,t){const r=vo(e);return!(r===t||!Jr(r)||Fu(r))&&(Cr(r).position==="fixed"||g2(r,t))}function a1(e,t){return Ar(e)&&Cr(e).position!=="fixed"?t?t(e):e.offsetParent:null}function s1(e,t){const r=ur(e);if(!Ar(e))return r;let n=a1(e,t);for(;n&&yP(n)&&Cr(n).position==="static";)n=a1(n,t);return n&&(Ln(n)==="html"||Ln(n)==="body"&&Cr(n).position==="static"&&!i0(n))?r:n||function(i){let o=vo(i);for(;Ar(o)&&!Fu(o);){if(i0(o))return o;o=vo(o)}return null}(e)||r}function EP(e,t,r){const n=Ar(t),i=en(t),o=r==="fixed",a=ui(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=li(0);if(n||!n&&!o)if((Ln(t)!=="body"||Xa(i))&&(s=Du(t)),Ar(t)){const u=ui(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else i&&(l.x=h2(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}const _P={getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=r==="clippingAncestors"?function(u,c){const f=c.get(u);if(f)return f;let d=eu(u).filter(g=>Jr(g)&&Ln(g)!=="body"),h=null;const m=Cr(u).position==="fixed";let p=m?vo(u):u;for(;Jr(p)&&!Fu(p);){const g=Cr(p),x=i0(p);x||g.position!=="fixed"||(h=null),(m?!x&&!h:!x&&g.position==="static"&&h&&["absolute","fixed"].includes(h.position)||Xa(p)&&!x&&g2(u,p))?d=d.filter(w=>w!==p):h=g,p=vo(p)}return c.set(u,d),d}(t,this._c):[].concat(r),a=[...o,n],s=a[0],l=a.reduce((u,c)=>{const f=o1(t,c,i);return u.top=lo(f.top,u.top),u.right=o0(f.right,u.right),u.bottom=o0(f.bottom,u.bottom),u.left=lo(f.left,u.left),u},o1(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:n}=e;const i=Ar(r),o=en(r);if(r===o)return t;let a={scrollLeft:0,scrollTop:0},s=li(1);const l=li(0);if((i||!i&&n!=="fixed")&&((Ln(r)!=="body"||Xa(o))&&(a=Du(r)),Ar(r))){const u=ui(r);s=uo(r),l.x=u.x+r.clientLeft,l.y=u.y+r.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}},isElement:Jr,getDimensions:function(e){return f2(e)},getOffsetParent:s1,getDocumentElement:en,getScale:uo,async getElementRects(e){let{reference:t,floating:r,strategy:n}=e;const i=this.getOffsetParent||s1,o=this.getDimensions;return{reference:EP(t,await i(r),n),floating:{x:0,y:0,...await o(r)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Cr(e).direction==="rtl"};function SP(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=th(e),c=i||o?[...u?eu(u):[],...eu(t)]:[];c.forEach(p=>{i&&p.addEventListener("scroll",r,{passive:!0}),o&&p.addEventListener("resize",r)});const f=u&&s?function(p,g){let x,w=null;const y=en(p);function E(){clearTimeout(x),w&&w.disconnect(),w=null}return function b(k,S){k===void 0&&(k=!1),S===void 0&&(S=1),E();const{left:A,top:C,width:L,height:B}=p.getBoundingClientRect();if(k||g(),!L||!B)return;const U=Ws(C),H=Ws(y.clientWidth-(A+L)),X=Ws(y.clientHeight-(C+B)),ee=Ws(A);let ae=!0;w=new IntersectionObserver(he=>{const _e=he[0].intersectionRatio;if(_e!==S){if(!ae)return b();_e?b(!1,_e):x=setTimeout(()=>{b(!1,1e-7)},100)}ae=!1},{rootMargin:-U+"px "+-H+"px "+-X+"px "+-ee+"px",threshold:lo(0,o0(1,S))||1}),w.observe(p)}(!0),E}(u,r):null;let d,h=null;a&&(h=new ResizeObserver(r),u&&!l&&h.observe(u),h.observe(t));let m=l?ui(e):null;return l&&function p(){const g=ui(e);!m||g.x===m.x&&g.y===m.y&&g.width===m.width&&g.height===m.height||r(),m=g,d=requestAnimationFrame(p)}(),r(),()=>{c.forEach(p=>{i&&p.removeEventListener("scroll",r),o&&p.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,l&&cancelAnimationFrame(d)}}const TP=(e,t,r)=>{const n=new Map,i={platform:_P,...r},o={...i.platform,_c:n};return cP(e,t,{...i,platform:o})},CP=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?e1({element:n.current,padding:i}).fn(r):{}:n?e1({element:n,padding:i}).fn(r):{}}}};var ll=typeof document<"u"?v.useLayoutEffect:v.useEffect;function tu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!tu(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!tu(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function m2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function l1(e,t){const r=m2(e);return Math.round(t*r)/r}function u1(e){const t=v.useRef(e);return ll(()=>{t.current=e}),t}function AP(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,f]=v.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=v.useState(n);tu(d,n)||h(n);const[m,p]=v.useState(null),[g,x]=v.useState(null),w=v.useCallback(ae=>{ae!=k.current&&(k.current=ae,p(ae))},[p]),y=v.useCallback(ae=>{ae!==S.current&&(S.current=ae,x(ae))},[x]),E=o||m,b=a||g,k=v.useRef(null),S=v.useRef(null),A=v.useRef(c),C=u1(l),L=u1(i),B=v.useCallback(()=>{if(!k.current||!S.current)return;const ae={placement:t,strategy:r,middleware:d};L.current&&(ae.platform=L.current),TP(k.current,S.current,ae).then(he=>{const _e={...he,isPositioned:!0};U.current&&!tu(A.current,_e)&&(A.current=_e,gi.flushSync(()=>{f(_e)}))})},[d,t,r,L]);ll(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(ae=>({...ae,isPositioned:!1})))},[u]);const U=v.useRef(!1);ll(()=>(U.current=!0,()=>{U.current=!1}),[]),ll(()=>{if(E&&(k.current=E),b&&(S.current=b),E&&b){if(C.current)return C.current(E,b,B);B()}},[E,b,B,C]);const H=v.useMemo(()=>({reference:k,floating:S,setReference:w,setFloating:y}),[w,y]),X=v.useMemo(()=>({reference:E,floating:b}),[E,b]),ee=v.useMemo(()=>{const ae={position:r,left:0,top:0};if(!X.floating)return ae;const he=l1(X.floating,c.x),_e=l1(X.floating,c.y);return s?{...ae,transform:"translate("+he+"px, "+_e+"px)",...m2(X.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:he,top:_e}},[r,s,X.floating,c.x,c.y]);return v.useMemo(()=>({...c,update:B,refs:H,elements:X,floatingStyles:ee}),[c,B,H,X,ee])}function RP(e){const[t,r]=v.useState(void 0);return Mt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}const v2="Popper",[x2,Pu]=sn(v2),[OP,w2]=x2(v2),FP=e=>{const{__scopePopper:t,children:r}=e,[n,i]=v.useState(null);return v.createElement(OP,{scope:t,anchor:n,onAnchorChange:i},r)},DP="PopperAnchor",PP=v.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=w2(DP,r),a=v.useRef(null),s=We(t,a);return v.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:v.createElement(Ie.div,ge({},i,{ref:s}))}),y2="PopperContent",[IP,r$]=x2(y2),bP=v.forwardRef((e,t)=>{var r,n,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:m=0,arrowPadding:p=0,collisionBoundary:g=[],collisionPadding:x=0,sticky:w="partial",hideWhenDetached:y=!1,avoidCollisions:E=!0,onPlaced:b,...k}=e,S=w2(y2,c),[A,C]=v.useState(null),L=We(t,ie=>C(ie)),[B,U]=v.useState(null),H=RP(B),X=(r=H==null?void 0:H.width)!==null&&r!==void 0?r:0,ee=(n=H==null?void 0:H.height)!==null&&n!==void 0?n:0,ae=f+(h!=="center"?"-"+h:""),he=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},_e=Array.isArray(g)?g:[g],oe=_e.length>0,ye={padding:he,boundary:_e.filter(kP),altBoundary:oe},{refs:te,floatingStyles:O,placement:M,isPositioned:N,middlewareData:F}=AP({strategy:"fixed",placement:ae,whileElementsMounted:SP,elements:{reference:S.anchor},middleware:[mP({mainAxis:d+ee,alignmentAxis:m}),E&&vP({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?xP():void 0,...ye}),E&&pP({...ye}),wP({...ye,apply:({elements:ie,rects:$e,availableWidth:Pe,availableHeight:ve})=>{const{width:Pt,height:Bt}=$e.reference,Ne=ie.floating.style;Ne.setProperty("--radix-popper-available-width",`${Pe}px`),Ne.setProperty("--radix-popper-available-height",`${ve}px`),Ne.setProperty("--radix-popper-anchor-width",`${Pt}px`),Ne.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),B&&CP({element:B,padding:p}),$P({arrowWidth:X,arrowHeight:ee}),y&&gP({strategy:"referenceHidden"})]}),[V,Y]=E2(M),J=Dt(b);Mt(()=>{N&&(J==null||J())},[N,J]);const W=(i=F.arrow)===null||i===void 0?void 0:i.x,Q=(o=F.arrow)===null||o===void 0?void 0:o.y,le=((a=F.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[me,Te]=v.useState();return Mt(()=>{A&&Te(window.getComputedStyle(A).zIndex)},[A]),v.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:N?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,["--radix-popper-transform-origin"]:[(s=F.transformOrigin)===null||s===void 0?void 0:s.x,(l=F.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},v.createElement(IP,{scope:c,placedSide:V,onArrowChange:U,arrowX:W,arrowY:Q,shouldHideArrow:le},v.createElement(Ie.div,ge({"data-side":V,"data-align":Y},k,{ref:L,style:{...k.style,animation:N?void 0:"none",opacity:(u=F.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function kP(e){return e!==null}const $P=e=>({name:"transformOrigin",options:e,fn(t){var r,n,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((r=u.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:e.arrowWidth,h=f?0:e.arrowHeight,[m,p]=E2(s),g={start:"0%",center:"50%",end:"100%"}[p],x=((n=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+h/2;let y="",E="";return m==="bottom"?(y=f?g:`${x}px`,E=`${-h}px`):m==="top"?(y=f?g:`${x}px`,E=`${l.floating.height+h}px`):m==="right"?(y=`${-h}px`,E=f?g:`${w}px`):m==="left"&&(y=`${l.floating.width+h}px`,E=f?g:`${w}px`),{data:{x:y,y:E}}}});function E2(e){const[t,r="center"]=e.split("-");return[t,r]}const _2=FP,S2=PP,T2=bP;function NP(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const rh=v.forwardRef((e,t)=>v.createElement(Ie.span,ge({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),MP=[" ","Enter","ArrowUp","ArrowDown"],LP=[" ","Enter"],Iu="Select",[bu,ku,BP]=Ou(Iu),[Po,n$]=sn(Iu,[BP,Pu]),nh=Pu(),[UP,Ti]=Po(Iu),[HP,VP]=Po(Iu),WP=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:f,disabled:d,required:h}=e,m=nh(t),[p,g]=v.useState(null),[x,w]=v.useState(null),[y,E]=v.useState(!1),b=Zd(u),[k=!1,S]=go({prop:n,defaultProp:i,onChange:o}),[A,C]=go({prop:a,defaultProp:s,onChange:l}),L=v.useRef(null),B=p?!!p.closest("form"):!0,[U,H]=v.useState(new Set),X=Array.from(U).map(ee=>ee.props.value).join(";");return v.createElement(_2,m,v.createElement(UP,{required:h,scope:t,trigger:p,onTriggerChange:g,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:E,contentId:Kr(),value:A,onValueChange:C,open:k,onOpenChange:S,dir:b,triggerPointerDownPosRef:L,disabled:d},v.createElement(bu.Provider,{scope:t},v.createElement(HP,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(ee=>{H(ae=>new Set(ae).add(ee))},[]),onNativeOptionRemove:v.useCallback(ee=>{H(ae=>{const he=new Set(ae);return he.delete(ee),he})},[])},r)),B?v.createElement(O2,{key:X,"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:f,value:A,onChange:ee=>C(ee.target.value),disabled:d},A===void 0?v.createElement("option",{value:""}):null,Array.from(U)):null))},zP="SelectTrigger",GP=v.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=nh(r),a=Ti(zP,r),s=a.disabled||n,l=We(t,a.onTriggerChange),u=ku(r),[c,f,d]=F2(m=>{const p=u().filter(w=>!w.disabled),g=p.find(w=>w.value===a.value),x=D2(p,m,g);x!==void 0&&a.onValueChange(x.value)}),h=()=>{s||(a.onOpenChange(!0),d())};return v.createElement(S2,ge({asChild:!0},o),v.createElement(Ie.button,ge({type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":a.value===void 0?"":void 0},i,{ref:l,onClick:Se(i.onClick,m=>{m.currentTarget.focus()}),onPointerDown:Se(i.onPointerDown,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&p.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:Se(i.onKeyDown,m=>{const p=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&f(m.key),!(p&&m.key===" ")&&MP.includes(m.key)&&(h(),m.preventDefault())})})))}),jP="SelectValue",XP=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a,...s}=e,l=Ti(jP,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,f=We(t,l.onValueNodeChange);return Mt(()=>{u(c)},[u,c]),v.createElement(Ie.span,ge({},s,{ref:f,style:{pointerEvents:"none"}}),l.value===void 0&&a!==void 0?a:o)}),KP=v.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return v.createElement(Ie.span,ge({"aria-hidden":!0},i,{ref:t}),n||"▼")}),YP=e=>v.createElement(vu,ge({asChild:!0},e)),xo="SelectContent",qP=v.forwardRef((e,t)=>{const r=Ti(xo,e.__scopeSelect),[n,i]=v.useState();if(Mt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?gi.createPortal(v.createElement(C2,{scope:e.__scopeSelect},v.createElement(bu.Slot,{scope:e.__scopeSelect},v.createElement("div",null,e.children))),o):null}return v.createElement(QP,ge({},e,{ref:t}))}),Hr=10,[C2,Ci]=Po(xo),QP=v.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g,...x}=e,w=Ti(xo,r),[y,E]=v.useState(null),[b,k]=v.useState(null),S=We(t,Y=>E(Y)),[A,C]=v.useState(null),[L,B]=v.useState(null),U=ku(r),[H,X]=v.useState(!1),ee=v.useRef(!1);v.useEffect(()=>{if(y)return Sd(y)},[y]),Ed();const ae=v.useCallback(Y=>{const[J,...W]=U().map(me=>me.ref.current),[Q]=W.slice(-1),le=document.activeElement;for(const me of Y)if(me===le||(me==null||me.scrollIntoView({block:"nearest"}),me===J&&b&&(b.scrollTop=0),me===Q&&b&&(b.scrollTop=b.scrollHeight),me==null||me.focus(),document.activeElement!==le))return},[U,b]),he=v.useCallback(()=>ae([A,y]),[ae,A,y]);v.useEffect(()=>{H&&he()},[H,he]);const{onOpenChange:_e,triggerPointerDownPosRef:oe}=w;v.useEffect(()=>{if(y){let Y={x:0,y:0};const J=Q=>{var le,me,Te,ie;Y={x:Math.abs(Math.round(Q.pageX)-((le=(me=oe.current)===null||me===void 0?void 0:me.x)!==null&&le!==void 0?le:0)),y:Math.abs(Math.round(Q.pageY)-((Te=(ie=oe.current)===null||ie===void 0?void 0:ie.y)!==null&&Te!==void 0?Te:0))}},W=Q=>{Y.x<=10&&Y.y<=10?Q.preventDefault():y.contains(Q.target)||_e(!1),document.removeEventListener("pointermove",J),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",W,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",W,{capture:!0})}}},[y,_e,oe]),v.useEffect(()=>{const Y=()=>_e(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[_e]);const[ye,te]=F2(Y=>{const J=U().filter(le=>!le.disabled),W=J.find(le=>le.ref.current===document.activeElement),Q=D2(J,Y,W);Q&&setTimeout(()=>Q.ref.current.focus())}),O=v.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&(C(Y),Q&&(ee.current=!0))},[w.value]),M=v.useCallback(()=>y==null?void 0:y.focus(),[y]),N=v.useCallback((Y,J,W)=>{const Q=!ee.current&&!W;(w.value!==void 0&&w.value===J||Q)&&B(Y)},[w.value]),F=n==="popper"?c1:ZP,V=F===c1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:m,hideWhenDetached:p,avoidCollisions:g}:{};return v.createElement(C2,{scope:r,content:y,viewport:b,onViewportChange:k,itemRefCallback:O,selectedItem:A,onItemLeave:M,itemTextRefCallback:N,focusSelectedItem:he,selectedItemText:L,position:n,isPositioned:H,searchRef:ye},v.createElement(_d,{as:ii,allowPinchZoom:!0},v.createElement(yd,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Se(i,Y=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),Y.preventDefault()})},v.createElement(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},v.createElement(F,ge({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault()},x,V,{onPlaced:()=>X(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Se(x.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&te(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let Q=U().filter(le=>!le.disabled).map(le=>le.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(Q=Q.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const le=Y.target,me=Q.indexOf(le);Q=Q.slice(me+1)}setTimeout(()=>ae(Q)),Y.preventDefault()}})}))))))}),ZP=v.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=Ti(xo,r),a=Ci(xo,r),[s,l]=v.useState(null),[u,c]=v.useState(null),f=We(t,S=>c(S)),d=ku(r),h=v.useRef(!1),m=v.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:x,focusSelectedItem:w}=a,y=v.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&p&&g&&x){const S=o.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),C=o.valueNode.getBoundingClientRect(),L=x.getBoundingClientRect();if(o.dir!=="rtl"){const le=L.left-A.left,me=C.left-le,Te=S.left-me,ie=S.width+Te,$e=Math.max(ie,A.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.left=ve+"px"}else{const le=A.right-L.right,me=window.innerWidth-C.right-le,Te=window.innerWidth-S.right-me,ie=S.width+Te,$e=Math.max(ie,A.width),Pe=window.innerWidth-Hr,ve=Zg(me,[Hr,Pe-$e]);s.style.minWidth=ie+"px",s.style.right=ve+"px"}const B=d(),U=window.innerHeight-Hr*2,H=p.scrollHeight,X=window.getComputedStyle(u),ee=parseInt(X.borderTopWidth,10),ae=parseInt(X.paddingTop,10),he=parseInt(X.borderBottomWidth,10),_e=parseInt(X.paddingBottom,10),oe=ee+ae+H+_e+he,ye=Math.min(g.offsetHeight*5,oe),te=window.getComputedStyle(p),O=parseInt(te.paddingTop,10),M=parseInt(te.paddingBottom,10),N=S.top+S.height/2-Hr,F=U-N,V=g.offsetHeight/2,Y=g.offsetTop+V,J=ee+ae+Y,W=oe-J;if(J<=N){const le=g===B[B.length-1].ref.current;s.style.bottom="0px";const me=u.clientHeight-p.offsetTop-p.offsetHeight,Te=Math.max(F,V+(le?M:0)+me+he),ie=J+Te;s.style.height=ie+"px"}else{const le=g===B[0].ref.current;s.style.top="0px";const Te=Math.max(N,ee+p.offsetTop+(le?O:0)+V)+W;s.style.height=Te+"px",p.scrollTop=J-N+p.offsetTop}s.style.margin=`${Hr}px 0`,s.style.minHeight=ye+"px",s.style.maxHeight=U+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,o.trigger,o.valueNode,s,u,p,g,x,o.dir,n]);Mt(()=>y(),[y]);const[E,b]=v.useState();Mt(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=v.useCallback(S=>{S&&m.current===!0&&(y(),w==null||w(),m.current=!1)},[y,w]);return v.createElement(JP,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:k},v.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E}},v.createElement(Ie.div,ge({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),c1=v.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Hr,...o}=e,a=nh(r);return v.createElement(T2,ge({},a,o,{ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[JP,ih]=Po(xo,{}),f1="SelectViewport",eI=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Ci(f1,r),o=ih(f1,r),a=We(t,i.onViewportChange),s=v.useRef(0);return v.createElement(v.Fragment,null,v.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),v.createElement(bu.Slot,{scope:r},v.createElement(Ie.div,ge({"data-radix-select-viewport":"",role:"presentation"},n,{ref:a,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Se(n.onScroll,l=>{const u=l.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&c){const d=Math.abs(s.current-u.scrollTop);if(d>0){const h=window.innerHeight-Hr*2,m=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),g=Math.max(m,p);if(g0?y:0,c.style.justifyContent="flex-end")}}}s.current=u.scrollTop})}))))}),tI="SelectGroup",[rI,nI]=Po(tI),iI=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Kr();return v.createElement(rI,{scope:r,id:i},v.createElement(Ie.div,ge({role:"group","aria-labelledby":i},n,{ref:t})))}),oI="SelectLabel",aI=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=nI(oI,r);return v.createElement(Ie.div,ge({id:i.id},n,{ref:t}))}),a0="SelectItem",[sI,A2]=Po(a0),lI=v.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=Ti(a0,r),l=Ci(a0,r),u=s.value===n,[c,f]=v.useState(o??""),[d,h]=v.useState(!1),m=We(t,x=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,x,n,i)}),p=Kr(),g=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};return v.createElement(sI,{scope:r,value:n,disabled:i,textId:p,isSelected:u,onItemTextChange:v.useCallback(x=>{f(w=>{var y;return w||((y=x==null?void 0:x.textContent)!==null&&y!==void 0?y:"").trim()})},[])},v.createElement(bu.ItemSlot,{scope:r,value:n,disabled:i,textValue:c},v.createElement(Ie.div,ge({role:"option","aria-labelledby":p,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},a,{ref:m,onFocus:Se(a.onFocus,()=>h(!0)),onBlur:Se(a.onBlur,()=>h(!1)),onPointerUp:Se(a.onPointerUp,g),onPointerMove:Se(a.onPointerMove,x=>{if(i){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(a.onPointerLeave,x=>{if(x.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:Se(a.onKeyDown,x=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&x.key===" "||(LP.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})}))))}),zs="SelectItemText",uI=v.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=Ti(zs,r),s=Ci(zs,r),l=A2(zs,r),u=VP(zs,r),[c,f]=v.useState(null),d=We(t,x=>f(x),l.onItemTextChange,x=>{var w;return(w=s.itemTextRefCallback)===null||w===void 0?void 0:w.call(s,x,l.value,l.disabled)}),h=c==null?void 0:c.textContent,m=v.useMemo(()=>v.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return Mt(()=>(p(m),()=>g(m)),[p,g,m]),v.createElement(v.Fragment,null,v.createElement(Ie.span,ge({id:l.textId},o,{ref:d})),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?gi.createPortal(o.children,a.valueNode):null)}),cI="SelectItemIndicator",fI=v.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return A2(cI,r).isSelected?v.createElement(Ie.span,ge({"aria-hidden":!0},n,{ref:t})):null}),d1="SelectScrollUpButton",dI=v.forwardRef((e,t)=>{const r=Ci(d1,e.__scopeSelect),n=ih(d1,e.__scopeSelect),[i,o]=v.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollTop>0;o(c)};var s=u;const l=r.viewport;return u(),l.addEventListener("scroll",u),()=>l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?v.createElement(R2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}})):null}),h1="SelectScrollDownButton",hI=v.forwardRef((e,t)=>{const r=Ci(h1,e.__scopeSelect),n=ih(h1,e.__scopeSelect),[i,o]=v.useState(!1),a=We(t,n.onScrollButtonChange);return Mt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?v.createElement(R2,ge({},e,{ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}})):null}),R2=v.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=Ci("SelectScrollButton",r),a=v.useRef(null),s=ku(r),l=v.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return v.useEffect(()=>()=>l(),[l]),Mt(()=>{var u;const c=s().find(f=>f.ref.current===document.activeElement);c==null||(u=c.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[s]),v.createElement(Ie.div,ge({"aria-hidden":!0},i,{ref:t,style:{flexShrink:0,...i.style},onPointerDown:Se(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Se(i.onPointerMove,()=>{var u;(u=o.onItemLeave)===null||u===void 0||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Se(i.onPointerLeave,()=>{l()})}))}),O2=v.forwardRef((e,t)=>{const{value:r,...n}=e,i=v.useRef(null),o=We(t,i),a=NP(r);return v.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const f=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(f)}},[a,r]),v.createElement(rh,{asChild:!0},v.createElement("select",ge({},n,{ref:o,defaultValue:r})))});O2.displayName="BubbleSelect";function F2(e){const t=Dt(e),r=v.useRef(""),n=v.useRef(0),i=v.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=v.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function D2(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=pI(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function pI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const gI=WP,mI=GP,vI=XP,xI=KP,wI=YP,yI=qP,EI=eI,Vc=iI,p1=aI,_I=lI,SI=uI,TI=fI,CI=dI,AI=hI;function oh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}var RI=["color"],OI=v.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,RI);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),FI=["color"],s0=v.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,FI);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],PI=v.forwardRef(function(e,t){var r=e.color,n=r===void 0?"currentColor":r,i=oh(e,DI);return v.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),v.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))});const Xi=({value:e,onChange:t,label:r="Select",placeholder:n="Select a fruit…",groups:i,labelType:o="col"})=>{const a=(i==null?void 0:i.length)===1;return Ce(gI,{value:e,onValueChange:t,children:[Ce(Vc,{className:kt("flex gap-1",{"flex-row items-center gap-2":o==="row","flex-col":o==="col"}),children:[j(p1,{className:"whitespace-nowrap",children:r}),Ce(mI,{className:"justify-between bg-white text-black dark:text-white dark:bg-grey-900 whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":r,children:[j(vI,{placeholder:n}),j(xI,{children:j(s0,{})})]})]}),j(wI,{children:Ce(yI,{className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur overflow-hidden border-[1.5px] border-grey-700 rounded p-3 shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)]",children:[j(CI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:j(PI,{})}),j(EI,{className:"p-[5px]",children:a?j(Vc,{children:i[0].items.map(s=>j(g1,{value:s.value,disabled:s.disabled,children:s.label}))}):i.map((s,l)=>Ce(Vc,{children:[j(p1,{className:"text-xs leading-[25px]",children:s.label}),s.items.map(u=>j(g1,{value:u.value,disabled:u.disabled,children:u.label},u.value))]},s.label))}),j(AI,{className:"flex items-center justify-center h-[25px] cursor-default dark:text-white text-black",children:j(s0,{})})]})})]})},g1=v.forwardRef(({children:e,className:t,...r},n)=>Ce(_I,{className:kt("text-[13px] leading-none rounded-[3px] flex items-center h-[25px] pr-[35px] pl-[25px] relative select-none data-[disabled]:text-grey-400 data-[disabled]:pointer-events-none data-[highlighted]:outline-none data-[highlighted]:bg-grey-600 data-[highlighted]:text-white text-black dark:text-white",t),...r,ref:n,children:[j(SI,{children:e}),j(TI,{className:"absolute left-0 w-[25px] inline-flex items-center justify-center",children:j(OI,{})})]})),P2="ToastProvider",[ah,II,bI]=Ou("Toast"),[I2,i$]=sn("Toast",[bI]),[kI,$u]=I2(P2),b2=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=v.useState(null),[u,c]=v.useState(0),f=v.useRef(!1),d=v.useRef(!1);return v.createElement(ah.Provider,{scope:t},v.createElement(kI,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:v.useCallback(()=>c(h=>h+1),[]),onToastRemove:v.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:d},a))};b2.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${P2}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const $I="ToastViewport",NI=["F8"],l0="toast.viewportPause",u0="toast.viewportResume",MI=v.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=NI,label:i="Notifications ({hotkey})",...o}=e,a=$u($I,r),s=II(r),l=v.useRef(null),u=v.useRef(null),c=v.useRef(null),f=v.useRef(null),d=We(t,f,a.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;v.useEffect(()=>{const g=x=>{var w;n.every(E=>x[E]||x.code===E)&&((w=f.current)===null||w===void 0||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),v.useEffect(()=>{const g=l.current,x=f.current;if(m&&g&&x){const w=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(l0);x.dispatchEvent(k),a.isClosePausedRef.current=!0}},y=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(u0);x.dispatchEvent(k),a.isClosePausedRef.current=!1}},E=k=>{!g.contains(k.relatedTarget)&&y()},b=()=>{g.contains(document.activeElement)||y()};return g.addEventListener("focusin",w),g.addEventListener("focusout",E),g.addEventListener("pointermove",w),g.addEventListener("pointerleave",b),window.addEventListener("blur",w),window.addEventListener("focus",y),()=>{g.removeEventListener("focusin",w),g.removeEventListener("focusout",E),g.removeEventListener("pointermove",w),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",w),window.removeEventListener("focus",y)}}},[m,a.isClosePausedRef]);const p=v.useCallback(({tabbingDirection:g})=>{const w=s().map(y=>{const E=y.ref.current,b=[E,...e5(E)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?w.reverse():w).flat()},[s]);return v.useEffect(()=>{const g=f.current;if(g){const x=w=>{const y=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!y){const A=document.activeElement,C=w.shiftKey;if(w.target===g&&C){var b;(b=u.current)===null||b===void 0||b.focus();return}const U=p({tabbingDirection:C?"backwards":"forwards"}),H=U.findIndex(X=>X===A);if(Wc(U.slice(H+1)))w.preventDefault();else{var k,S;C?(k=u.current)===null||k===void 0||k.focus():(S=c.current)===null||S===void 0||S.focus()}}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[s,p]),v.createElement(lS,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:m?void 0:"none"}},m&&v.createElement(m1,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Wc(g)}}),v.createElement(ah.Slot,{scope:r},v.createElement(Ie.ol,ge({tabIndex:-1},o,{ref:d}))),m&&v.createElement(m1,{ref:c,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Wc(g)}}))}),LI="ToastFocusProxy",m1=v.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=$u(LI,r);return v.createElement(rh,ge({"aria-hidden":!0,tabIndex:0},i,{ref:t,style:{position:"fixed"},onFocus:a=>{var s;const l=a.relatedTarget;!((s=o.viewport)!==null&&s!==void 0&&s.contains(l))&&n()}}))}),Nu="Toast",BI="toast.swipeStart",UI="toast.swipeMove",HI="toast.swipeCancel",VI="toast.swipeEnd",WI=v.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=go({prop:n,defaultProp:i,onChange:o});return v.createElement(mi,{present:r||s},v.createElement(k2,ge({open:s},a,{ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:Se(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Se(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,u=>{const{x:c,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})))}),[zI,GI]=I2(Nu,{onClose(){}}),k2=v.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...m}=e,p=$u(Nu,r),[g,x]=v.useState(null),w=We(t,X=>x(X)),y=v.useRef(null),E=v.useRef(null),b=i||p.duration,k=v.useRef(0),S=v.useRef(b),A=v.useRef(0),{onToastAdd:C,onToastRemove:L}=p,B=Dt(()=>{var X;(g==null?void 0:g.contains(document.activeElement))&&((X=p.viewport)===null||X===void 0||X.focus()),a()}),U=v.useCallback(X=>{!X||X===1/0||(window.clearTimeout(A.current),k.current=new Date().getTime(),A.current=window.setTimeout(B,X))},[B]);v.useEffect(()=>{const X=p.viewport;if(X){const ee=()=>{U(S.current),u==null||u()},ae=()=>{const he=new Date().getTime()-k.current;S.current=S.current-he,window.clearTimeout(A.current),l==null||l()};return X.addEventListener(l0,ae),X.addEventListener(u0,ee),()=>{X.removeEventListener(l0,ae),X.removeEventListener(u0,ee)}}},[p.viewport,b,l,u,U]),v.useEffect(()=>{o&&!p.isClosePausedRef.current&&U(b)},[o,b,p.isClosePausedRef,U]),v.useEffect(()=>(C(),()=>L()),[C,L]);const H=v.useMemo(()=>g?M2(g):null,[g]);return p.viewport?v.createElement(v.Fragment,null,H&&v.createElement(jI,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},H),v.createElement(zI,{scope:r,onClose:B},gi.createPortal(v.createElement(ah.ItemSlot,{scope:r},v.createElement(sS,{asChild:!0,onEscapeKeyDown:Se(s,()=>{p.isFocusedToastEscapeKeyDownRef.current||B(),p.isFocusedToastEscapeKeyDownRef.current=!1})},v.createElement(Ie.li,ge({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":p.swipeDirection},m,{ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,X=>{X.key==="Escape"&&(s==null||s(X.nativeEvent),X.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Se(e.onPointerDown,X=>{X.button===0&&(y.current={x:X.clientX,y:X.clientY})}),onPointerMove:Se(e.onPointerMove,X=>{if(!y.current)return;const ee=X.clientX-y.current.x,ae=X.clientY-y.current.y,he=!!E.current,_e=["left","right"].includes(p.swipeDirection),oe=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,ye=_e?oe(0,ee):0,te=_e?0:oe(0,ae),O=X.pointerType==="touch"?10:2,M={x:ye,y:te},N={originalEvent:X,delta:M};he?(E.current=M,Gs(UI,f,N,{discrete:!1})):v1(M,p.swipeDirection,O)?(E.current=M,Gs(BI,c,N,{discrete:!1}),X.target.setPointerCapture(X.pointerId)):(Math.abs(ee)>O||Math.abs(ae)>O)&&(y.current=null)}),onPointerUp:Se(e.onPointerUp,X=>{const ee=E.current,ae=X.target;if(ae.hasPointerCapture(X.pointerId)&&ae.releasePointerCapture(X.pointerId),E.current=null,y.current=null,ee){const he=X.currentTarget,_e={originalEvent:X,delta:ee};v1(ee,p.swipeDirection,p.swipeThreshold)?Gs(VI,h,_e,{discrete:!0}):Gs(HI,d,_e,{discrete:!0}),he.addEventListener("click",oe=>oe.preventDefault(),{once:!0})}})})))),p.viewport))):null});k2.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Nu}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const jI=e=>{const{__scopeToast:t,children:r,...n}=e,i=$u(Nu,t),[o,a]=v.useState(!1),[s,l]=v.useState(!1);return ZI(()=>a(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:v.createElement(vu,{asChild:!0},v.createElement(rh,n,o&&v.createElement(v.Fragment,null,i.label," ",r)))},XI=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.createElement(Ie.div,ge({},n,{ref:t}))}),KI=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return v.createElement(Ie.div,ge({},n,{ref:t}))}),YI="ToastAction",qI=v.forwardRef((e,t)=>{const{altText:r,...n}=e;return r?v.createElement(N2,{altText:r,asChild:!0},v.createElement($2,ge({},n,{ref:t}))):null});qI.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${YI}\``)}};const QI="ToastClose",$2=v.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=GI(QI,r);return v.createElement(N2,{asChild:!0},v.createElement(Ie.button,ge({type:"button"},n,{ref:t,onClick:Se(e.onClick,i.onClose)})))}),N2=v.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return v.createElement(Ie.div,ge({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:t}))});function M2(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),JI(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...M2(n))}}),t}function Gs(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?wd(i,o):i.dispatchEvent(o)}const v1=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function ZI(e=()=>{}){const t=Dt(e);Mt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function JI(e){return e.nodeType===e.ELEMENT_NODE}function e5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wc(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}const t5=b2,r5=MI,n5=WI,i5=XI,o5=KI,a5=$2,s5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?j("title",{id:t,children:e}):null,j("path",{d:"M9 16.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15ZM11.25 6.75l-4.5 4.5M6.75 6.75l4.5 4.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),l5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?j("title",{id:t,children:e}):null,j("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM12 16v-4M12 8h.01",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),u5=({title:e,titleId:t,...r})=>Ce("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?j("title",{id:t,children:e}):null,j("path",{d:"M16.5 8.31V9a7.5 7.5 0 1 1-4.447-6.855",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),j("path",{d:"M16.5 3 9 10.508l-2.25-2.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),c5=({title:e,titleId:t,...r})=>Ce("svg",{viewBox:"0 0 18 18",width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":t,...r,children:[e?j("title",{id:t,children:e}):null,j("path",{d:"M7.718 2.895 1.366 13.5a1.5 1.5 0 0 0 1.282 2.25h12.705a1.5 1.5 0 0 0 1.283-2.25L10.283 2.895a1.5 1.5 0 0 0-2.565 0v0ZM9 6.75v3M9 12.75h.008",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})]}),f5=({toast:e,open:t,setOpen:r})=>Ce(t5,{children:[Ce(n5,{open:t,onOpenChange:n=>{e.preventClose||r(n)},className:kt("z-50 fixed bottom-4 md:left-1/2 md:-translate-x-[50%] inset-x-4 w-auto shadow-lg md:max-w-[658px] duration-300","radix-state-open:animate-fade-in","radix-state-closed:animate-toast-hide","radix-swipe-end:animate-toast-swipe-out","translate-x-radix-toast-swipe-move-x","radix-swipe-cancel:translate-x-0 radix-swipe-cancel:duration-200 radix-swipe-cancel:ease-[ease]","px-[40px] md:px-[58px] py-6 flex flex-col border rounded-[4px]",{"bg-green-100 text-green-600 border-green-600":e.status==="success","bg-red-200 text-red-600 border-red-600":e.status==="error","bg-blue-100 text-blue-700 border-blue-600":e.status==="info","bg-orange-200 text-orange-600 border-orange-600":e.status==="warning"},{"h-[72px]":!e.description}),children:[e.status==="success"?j(u5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="warning"?j(c5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):e.status==="error"?j(s5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}):j(l5,{className:"absolute left-[8px] md:left-[25px] top-[25px]"}),j(i5,{className:"text-grey-900 font-bold text-sm",children:e.title}),e.description&&j(o5,{className:"mt-2 text-[10px] md:text-xs text-grey-800",children:e.description}),j(a5,{className:"absolute top-7 right-5 md:right-7",children:j(ql,{className:"w-4 h-4 text-grey-900"})})]}),j(r5,{})]}),zc="rovingFocusGroup.onEntryFocus",d5={bubbles:!1,cancelable:!0},sh="RovingFocusGroup",[c0,L2,h5]=Ou(sh),[p5,B2]=sn(sh,[h5]),[g5,m5]=p5(sh),v5=v.forwardRef((e,t)=>v.createElement(c0.Provider,{scope:e.__scopeRovingFocusGroup},v.createElement(c0.Slot,{scope:e.__scopeRovingFocusGroup},v.createElement(x5,ge({},e,{ref:t}))))),x5=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=v.useRef(null),d=We(t,f),h=Zd(o),[m=null,p]=go({prop:a,defaultProp:s,onChange:l}),[g,x]=v.useState(!1),w=Dt(u),y=L2(r),E=v.useRef(!1),[b,k]=v.useState(0);return v.useEffect(()=>{const S=f.current;if(S)return S.addEventListener(zc,w),()=>S.removeEventListener(zc,w)},[w]),v.createElement(g5,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:m,onItemFocus:v.useCallback(S=>p(S),[p]),onItemShiftTab:v.useCallback(()=>x(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(S=>S+1),[]),onFocusableItemRemove:v.useCallback(()=>k(S=>S-1),[])},v.createElement(Ie.div,ge({tabIndex:g||b===0?-1:0,"data-orientation":n},c,{ref:d,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{E.current=!0}),onFocus:Se(e.onFocus,S=>{const A=!E.current;if(S.target===S.currentTarget&&A&&!g){const C=new CustomEvent(zc,d5);if(S.currentTarget.dispatchEvent(C),!C.defaultPrevented){const L=y().filter(ee=>ee.focusable),B=L.find(ee=>ee.active),U=L.find(ee=>ee.id===m),X=[B,U,...L].filter(Boolean).map(ee=>ee.ref.current);U2(X)}}E.current=!1}),onBlur:Se(e.onBlur,()=>x(!1))})))}),w5="RovingFocusGroupItem",y5=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Kr(),l=o||s,u=m5(w5,r),c=u.currentTabStopId===l,f=L2(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=u;return v.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),v.createElement(c0.ItemSlot,{scope:r,id:l,focusable:n,active:i},v.createElement(Ie.span,ge({tabIndex:c?0:-1,"data-orientation":u.orientation},a,{ref:t,onMouseDown:Se(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Se(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Se(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const p=S5(m,u.orientation,u.dir);if(p!==void 0){m.preventDefault();let x=f().filter(w=>w.focusable).map(w=>w.ref.current);if(p==="last")x.reverse();else if(p==="prev"||p==="next"){p==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=u.loop?T5(x,w+1):x.slice(w+1)}setTimeout(()=>U2(x))}})})))}),E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function _5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function S5(e,t,r){const n=_5(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function U2(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function T5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}const C5=v5,A5=y5,R5=["Enter"," "],O5=["ArrowDown","PageUp","Home"],H2=["ArrowUp","PageDown","End"],F5=[...O5,...H2],Mu="Menu",[f0,D5,P5]=Ou(Mu),[Ai,Lu]=sn(Mu,[P5,Pu,B2]),lh=Pu(),V2=B2(),[I5,ls]=Ai(Mu),[b5,uh]=Ai(Mu),k5=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=lh(t),[l,u]=v.useState(null),c=v.useRef(!1),f=Dt(o),d=Zd(i);return v.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),v.createElement(_2,s,v.createElement(I5,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:u},v.createElement(b5,{scope:t,onClose:v.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:a},n)))},$5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=lh(r);return v.createElement(S2,ge({},i,n,{ref:t}))}),W2="MenuPortal",[N5,M5]=Ai(W2,{forceMount:void 0}),L5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ls(W2,t);return v.createElement(N5,{scope:t,forceMount:r},v.createElement(mi,{present:r||o.open},v.createElement(vu,{asChild:!0,container:i},n)))},On="MenuContent",[B5,z2]=Ai(On),U5=v.forwardRef((e,t)=>{const r=M5(On,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ls(On,e.__scopeMenu),a=uh(On,e.__scopeMenu);return v.createElement(f0.Provider,{scope:e.__scopeMenu},v.createElement(mi,{present:n||o.open},v.createElement(f0.Slot,{scope:e.__scopeMenu},a.modal?v.createElement(H5,ge({},i,{ref:t})):v.createElement(V5,ge({},i,{ref:t})))))}),H5=v.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu),n=v.useRef(null),i=We(t,n);return v.useEffect(()=>{const o=n.current;if(o)return Sd(o)},[]),v.createElement(G2,ge({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Se(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)}))}),V5=v.forwardRef((e,t)=>{const r=ls(On,e.__scopeMenu);return v.createElement(G2,ge({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)}))}),G2=v.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h,disableOutsideScroll:m,...p}=e,g=ls(On,r),x=uh(On,r),w=lh(r),y=V2(r),E=D5(r),[b,k]=v.useState(null),S=v.useRef(null),A=We(t,S,g.onContentChange),C=v.useRef(0),L=v.useRef(""),B=v.useRef(0),U=v.useRef(null),H=v.useRef("right"),X=v.useRef(0),ee=m?_d:v.Fragment,ae=m?{as:ii,allowPinchZoom:!0}:void 0,he=oe=>{var ye,te;const O=L.current+oe,M=E().filter(W=>!W.disabled),N=document.activeElement,F=(ye=M.find(W=>W.ref.current===N))===null||ye===void 0?void 0:ye.textValue,V=M.map(W=>W.textValue),Y=J5(V,O,F),J=(te=M.find(W=>W.textValue===Y))===null||te===void 0?void 0:te.ref.current;(function W(Q){L.current=Q,window.clearTimeout(C.current),Q!==""&&(C.current=window.setTimeout(()=>W(""),1e3))})(O),J&&setTimeout(()=>J.focus())};v.useEffect(()=>()=>window.clearTimeout(C.current),[]),Ed();const _e=v.useCallback(oe=>{var ye,te;return H.current===((ye=U.current)===null||ye===void 0?void 0:ye.side)&&t8(oe,(te=U.current)===null||te===void 0?void 0:te.area)},[]);return v.createElement(B5,{scope:r,searchRef:L,onItemEnter:v.useCallback(oe=>{_e(oe)&&oe.preventDefault()},[_e]),onItemLeave:v.useCallback(oe=>{var ye;_e(oe)||((ye=S.current)===null||ye===void 0||ye.focus(),k(null))},[_e]),onTriggerLeave:v.useCallback(oe=>{_e(oe)&&oe.preventDefault()},[_e]),pointerGraceTimerRef:B,onPointerGraceIntentChange:v.useCallback(oe=>{U.current=oe},[])},v.createElement(ee,ae,v.createElement(yd,{asChild:!0,trapped:i,onMountAutoFocus:Se(o,oe=>{var ye;oe.preventDefault(),(ye=S.current)===null||ye===void 0||ye.focus()}),onUnmountAutoFocus:a},v.createElement(mu,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:f,onInteractOutside:d,onDismiss:h},v.createElement(C5,ge({asChild:!0},y,{dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:b,onCurrentTabStopIdChange:k,onEntryFocus:Se(l,oe=>{x.isUsingKeyboardRef.current||oe.preventDefault()})}),v.createElement(T2,ge({role:"menu","aria-orientation":"vertical","data-state":q5(g.open),"data-radix-menu-content":"",dir:x.dir},w,p,{ref:A,style:{outline:"none",...p.style},onKeyDown:Se(p.onKeyDown,oe=>{const te=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,O=oe.ctrlKey||oe.altKey||oe.metaKey,M=oe.key.length===1;te&&(oe.key==="Tab"&&oe.preventDefault(),!O&&M&&he(oe.key));const N=S.current;if(oe.target!==N||!F5.includes(oe.key))return;oe.preventDefault();const V=E().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);H2.includes(oe.key)&&V.reverse(),Q5(V)}),onBlur:Se(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(C.current),L.current="")}),onPointerMove:Se(e.onPointerMove,h0(oe=>{const ye=oe.target,te=X.current!==oe.clientX;if(oe.currentTarget.contains(ye)&&te){const O=oe.clientX>X.current?"right":"left";H.current=O,X.current=oe.clientX}}))})))))))}),W5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.createElement(Ie.div,ge({role:"group"},n,{ref:t}))}),z5=v.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.createElement(Ie.div,ge({},n,{ref:t}))}),d0="MenuItem",x1="menu.itemSelect",G5=v.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=v.useRef(null),a=uh(d0,e.__scopeMenu),s=z2(d0,e.__scopeMenu),l=We(t,o),u=v.useRef(!1),c=()=>{const f=o.current;if(!r&&f){const d=new CustomEvent(x1,{bubbles:!0,cancelable:!0});f.addEventListener(x1,h=>n==null?void 0:n(h),{once:!0}),wd(f,d),d.defaultPrevented?u.current=!1:a.onClose()}};return v.createElement(j5,ge({},i,{ref:l,disabled:r,onClick:Se(e.onClick,c),onPointerDown:f=>{var d;(d=e.onPointerDown)===null||d===void 0||d.call(e,f),u.current=!0},onPointerUp:Se(e.onPointerUp,f=>{var d;u.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Se(e.onKeyDown,f=>{const d=s.searchRef.current!=="";r||d&&f.key===" "||R5.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),j5=v.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=z2(d0,r),s=V2(r),l=v.useRef(null),u=We(t,l),[c,f]=v.useState(!1),[d,h]=v.useState("");return v.useEffect(()=>{const m=l.current;if(m){var p;h(((p=m.textContent)!==null&&p!==void 0?p:"").trim())}},[o.children]),v.createElement(f0.ItemSlot,{scope:r,disabled:n,textValue:i??d},v.createElement(A5,ge({asChild:!0},s,{focusable:!n}),v.createElement(Ie.div,ge({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},o,{ref:u,onPointerMove:Se(e.onPointerMove,h0(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:Se(e.onPointerLeave,h0(m=>a.onItemLeave(m))),onFocus:Se(e.onFocus,()=>f(!0)),onBlur:Se(e.onBlur,()=>f(!1))}))))}),X5="MenuRadioGroup";Ai(X5,{value:void 0,onValueChange:()=>{}});const K5="MenuItemIndicator";Ai(K5,{checked:!1});const Y5="MenuSub";Ai(Y5);function q5(e){return e?"open":"closed"}function Q5(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function Z5(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function J5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=Z5(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function e8(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function t8(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return e8(r,t)}function h0(e){return t=>t.pointerType==="mouse"?e(t):void 0}const j2=k5,X2=$5,K2=L5,Y2=U5,r8=W5,n8=z5,i8=G5,q2="ContextMenu",[o8,o$]=sn(q2,[Lu]),Bu=Lu(),[a8,Q2]=o8(q2),s8=e=>{const{__scopeContextMenu:t,children:r,onOpenChange:n,dir:i,modal:o=!0}=e,[a,s]=v.useState(!1),l=Bu(t),u=Dt(n),c=v.useCallback(f=>{s(f),u(f)},[u]);return v.createElement(a8,{scope:t,open:a,onOpenChange:c,modal:o},v.createElement(j2,ge({},l,{dir:i,open:a,onOpenChange:c,modal:o}),r))},l8="ContextMenuTrigger",u8=v.forwardRef((e,t)=>{const{__scopeContextMenu:r,disabled:n=!1,...i}=e,o=Q2(l8,r),a=Bu(r),s=v.useRef({x:0,y:0}),l=v.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),u=v.useRef(0),c=v.useCallback(()=>window.clearTimeout(u.current),[]),f=d=>{s.current={x:d.clientX,y:d.clientY},o.onOpenChange(!0)};return v.useEffect(()=>c,[c]),v.useEffect(()=>void(n&&c()),[n,c]),v.createElement(v.Fragment,null,v.createElement(X2,ge({},a,{virtualRef:l})),v.createElement(Ie.span,ge({"data-state":o.open?"open":"closed","data-disabled":n?"":void 0},i,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:Se(e.onContextMenu,d=>{c(),f(d),d.preventDefault()}),onPointerDown:n?e.onPointerDown:Se(e.onPointerDown,js(d=>{c(),u.current=window.setTimeout(()=>f(d),700)})),onPointerMove:n?e.onPointerMove:Se(e.onPointerMove,js(c)),onPointerCancel:n?e.onPointerCancel:Se(e.onPointerCancel,js(c)),onPointerUp:n?e.onPointerUp:Se(e.onPointerUp,js(c))})))}),c8=e=>{const{__scopeContextMenu:t,...r}=e,n=Bu(t);return v.createElement(K2,ge({},n,r))},f8="ContextMenuContent",d8=v.forwardRef((e,t)=>{const{__scopeContextMenu:r,...n}=e,i=Q2(f8,r),o=Bu(r),a=v.useRef(!1);return v.createElement(Y2,ge({},o,n,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))});function js(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const h8=s8,p8=u8,g8=c8,m8=d8,Z2=v.createContext({dragDropManager:void 0});function tr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var w1=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Gc=function(){return Math.random().toString(36).substring(7).split("").join(".")},y1={INIT:"@@redux/INIT"+Gc(),REPLACE:"@@redux/REPLACE"+Gc(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Gc()}};function v8(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function J2(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(tr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(tr(1));return r(J2)(e,t)}if(typeof e!="function")throw new Error(tr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(tr(3));return o}function f(p){if(typeof p!="function")throw new Error(tr(4));if(l)throw new Error(tr(5));var g=!0;return u(),s.push(p),function(){if(g){if(l)throw new Error(tr(6));g=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function d(p){if(!v8(p))throw new Error(tr(7));if(typeof p.type>"u")throw new Error(tr(8));if(l)throw new Error(tr(9));try{l=!0,o=i(o,p)}finally{l=!1}for(var g=a=s,x=0;xn&&n[i]?n[i]:r||null,e)}function y8(e,t){return e.filter(r=>r!==t)}function ey(e){return typeof e=="object"}function E8(e,t){const r=new Map,n=o=>{r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((o,a)=>{o===1&&i.push(a)}),i}function _8(e,t){return e.filter(r=>t.indexOf(r)>-1)}const ch="dnd-core/INIT_COORDS",Uu="dnd-core/BEGIN_DRAG",fh="dnd-core/PUBLISH_DRAG_SOURCE",Hu="dnd-core/HOVER",Vu="dnd-core/DROP",Wu="dnd-core/END_DRAG";function E1(e,t){return{type:ch,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const S8={type:ch,payload:{clientOffset:null,sourceClientOffset:null}};function T8(e){return function(r=[],n={publishSource:!0}){const{publishSource:i=!0,clientOffset:o,getSourceClientOffset:a}=n,s=e.getMonitor(),l=e.getRegistry();e.dispatch(E1(o)),C8(r,s,l);const u=O8(r,s);if(u==null){e.dispatch(S8);return}let c=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");A8(a),c=a(u)}e.dispatch(E1(o,c));const d=l.getSource(u).beginDrag(s,u);if(d==null)return;R8(d),l.pinSource(u);const h=l.getSourceType(u);return{type:Uu,payload:{itemType:h,item:d,sourceId:u,clientOffset:o||null,sourceClientOffset:c||null,isSourcePublic:!!i}}}}function C8(e,t,r){Fe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Fe(r.getSource(n),"Expected sourceIds to be registered.")})}function A8(e){Fe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function R8(e){Fe(ey(e),"Item must be an object.")}function O8(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function F8(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function D8(e){for(var t=1;t{const l=b8(a,s,i,n),u={type:Vu,payload:{dropResult:D8({},r,l)}};e.dispatch(u)})}}function I8(e){Fe(e.isDragging(),"Cannot call drop while not dragging."),Fe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function b8(e,t,r,n){const i=r.getTarget(e);let o=i?i.drop(n,e):void 0;return k8(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function k8(e){Fe(typeof e>"u"||ey(e),"Drop result must either be an object or undefined.")}function $8(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function N8(e){return function(){const r=e.getMonitor(),n=e.getRegistry();M8(r);const i=r.getSourceId();return i!=null&&(n.getSource(i,!0).endDrag(r,i),n.unpinSource()),{type:Wu}}}function M8(e){Fe(e.isDragging(),"Cannot call endDrag while not dragging.")}function p0(e,t){return t===null?e===null:Array.isArray(e)?e.some(r=>r===t):e===t}function L8(e){return function(r,{clientOffset:n}={}){B8(r);const i=r.slice(0),o=e.getMonitor(),a=e.getRegistry(),s=o.getItemType();return H8(i,a,s),U8(i,o,a),V8(i,o,a),{type:Hu,payload:{targetIds:i,clientOffset:n||null}}}}function B8(e){Fe(Array.isArray(e),"Expected targetIds to be an array.")}function U8(e,t,r){Fe(t.isDragging(),"Cannot call hover while not dragging."),Fe(!t.didDrop(),"Cannot call hover after drop.");for(let n=0;n=0;n--){const i=e[n],o=t.getTargetType(i);p0(o,r)||e.splice(n,1)}}function V8(e,t,r){e.forEach(function(n){r.getTarget(n).hover(t,n)})}function W8(e){return function(){if(e.getMonitor().isDragging())return{type:fh}}}function z8(e){return{beginDrag:T8(e),publishDragSource:W8(e),hover:L8(e),drop:P8(e),endDrag:N8(e)}}class G8{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:r}=this.store;function n(o){return(...a)=>{const s=o.apply(t,a);typeof s<"u"&&r(s)}}const i=z8(this);return Object.keys(i).reduce((o,a)=>{const s=i[a];return o[a]=n(s),o},{})}dispatch(t){this.store.dispatch(t)}constructor(t,r){this.isSetUp=!1,this.handleRefCountChange=()=>{const n=this.store.getState().refCount>0;this.backend&&(n&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!n&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}}function j8(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ty(e,t){return{x:e.x-t.x,y:e.y-t.y}}function X8(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return!t||!r||!n?null:ty(j8(t,n),r)}function K8(e){const{clientOffset:t,initialClientOffset:r}=e;return!t||!r?null:ty(t,r)}const _a=[],dh=[];_a.__IS_NONE__=!0;dh.__IS_ALL__=!0;function Y8(e,t){return e===_a?!1:e===dh||typeof t>"u"?!0:_8(t,e).length>0}class q8{subscribeToStateChange(t,r={}){const{handlerIds:n}=r;Fe(typeof t=="function","listener must be a function."),Fe(typeof n>"u"||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const o=()=>{const a=this.store.getState(),s=a.stateId;try{s===i||s===i+1&&!Y8(a.dirtyHandlerIds,n)||t()}finally{i=s}};return this.store.subscribe(o)}subscribeToOffsetChange(t){Fe(typeof t=="function","listener must be a function.");let r=this.store.getState().dragOffset;const n=()=>{const i=this.store.getState().dragOffset;i!==r&&(r=i,t())};return this.store.subscribe(n)}canDragSource(t){if(!t)return!1;const r=this.registry.getSource(t);return Fe(r,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:r.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const r=this.registry.getTarget(t);if(Fe(r,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const n=this.registry.getTargetType(t),i=this.getItemType();return p0(n,i)&&r.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const r=this.registry.getSource(t,!0);if(Fe(r,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const n=this.registry.getSourceType(t),i=this.getItemType();return n!==i?!1:r.isDragging(this,t)}isOverTarget(t,r={shallow:!1}){if(!t)return!1;const{shallow:n}=r;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),o=this.getItemType();if(o&&!p0(i,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(t);return n?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return X8(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return K8(this.store.getState().dragOffset)}constructor(t,r){this.store=t,this.registry=r}}const _1=typeof global<"u"?global:self,ry=_1.MutationObserver||_1.WebKitMutationObserver;function ny(e){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),e()}}}function Q8(e){let t=1;const r=new ry(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const Z8=typeof ry=="function"?Q8:ny;class J8{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.indexthis.capacity){for(let n=0,i=t.length-this.index;n{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Z8(this.flush),this.requestErrorThrow=ny(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class eb{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class tb{create(t){const r=this.freeTasks,n=r.length?r.pop():new eb(this.onError,i=>r[r.length]=i);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const iy=new J8,rb=new tb(iy.registerPendingError);function nb(e){iy.enqueueTask(rb.create(e))}const hh="dnd-core/ADD_SOURCE",ph="dnd-core/ADD_TARGET",gh="dnd-core/REMOVE_SOURCE",zu="dnd-core/REMOVE_TARGET";function ib(e){return{type:hh,payload:{sourceId:e}}}function ob(e){return{type:ph,payload:{targetId:e}}}function ab(e){return{type:gh,payload:{sourceId:e}}}function sb(e){return{type:zu,payload:{targetId:e}}}function lb(e){Fe(typeof e.canDrag=="function","Expected canDrag to be a function."),Fe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Fe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function ub(e){Fe(typeof e.canDrop=="function","Expected canDrop to be a function."),Fe(typeof e.hover=="function","Expected hover to be a function."),Fe(typeof e.drop=="function","Expected beginDrag to be a function.")}function g0(e,t){if(t&&Array.isArray(e)){e.forEach(r=>g0(r,!1));return}Fe(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var or;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(or||(or={}));let cb=0;function fb(){return cb++}function db(e){const t=fb().toString();switch(e){case or.SOURCE:return`S${t}`;case or.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function S1(e){switch(e[0]){case"S":return or.SOURCE;case"T":return or.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function T1(e,t){const r=e.entries();let n=!1;do{const{done:i,value:[,o]}=r.next();if(o===t)return!0;n=!!i}while(!n);return!1}class hb{addSource(t,r){g0(t),lb(r);const n=this.addHandler(or.SOURCE,t,r);return this.store.dispatch(ib(n)),n}addTarget(t,r){g0(t,!0),ub(r);const n=this.addHandler(or.TARGET,t,r);return this.store.dispatch(ob(n)),n}containsHandler(t){return T1(this.dragSources,t)||T1(this.dropTargets,t)}getSource(t,r=!1){return Fe(this.isSourceId(t),"Expected a valid source ID."),r&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return Fe(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return Fe(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return S1(t)===or.SOURCE}isTargetId(t){return S1(t)===or.TARGET}removeSource(t){Fe(this.getSource(t),"Expected an existing source."),this.store.dispatch(ab(t)),nb(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){Fe(this.getTarget(t),"Expected an existing target."),this.store.dispatch(sb(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const r=this.getSource(t);Fe(r,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=r}unpinSource(){Fe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,r,n){const i=db(t);return this.types.set(i,r),t===or.SOURCE?this.dragSources.set(i,n):t===or.TARGET&&this.dropTargets.set(i,n),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const pb=(e,t)=>e===t;function gb(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function mb(e,t,r=pb){if(e.length!==t.length)return!1;for(let n=0;n0||!mb(r,n)))return _a;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function xb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wb(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ib(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}let A1=0;const ul=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var bb=v.memo(function(t){var{children:r}=t,n=Pb(t,["children"]);const[i,o]=kb(n);return v.useEffect(()=>{if(o){const a=oy();return++A1,()=>{--A1===0&&(a[ul]=null)}}},[]),j(Z2.Provider,{value:i,children:r})});function kb(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=$b(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}function $b(e,t=oy(),r,n){const i=t;return i[ul]||(i[ul]={dragDropManager:Fb(e,t,r,n)}),i[ul]}function oy(){return typeof global<"u"?global:window}var Nb=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r};const Mb=Ka(Nb),ci=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Lb(e,t,r){const[n,i]=v.useState(()=>t(e)),o=v.useCallback(()=>{const a=t(e);Mb(n,a)||(i(a),r&&r())},[n,e,r]);return ci(o),[n,o]}function Bb(e,t,r){const[n,i]=Lb(e,t,r);return ci(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(i,{handlerIds:[a]})},[e,i]),n}function ay(e,t,r){return Bb(t,e||(()=>({})),()=>r.reconnect())}function sy(e,t){const r=[...t||[]];return t==null&&typeof e!="function"&&r.push(e),v.useMemo(()=>typeof e=="function"?e():e,r)}function Ub(e){return v.useMemo(()=>e.hooks.dragSource(),[e])}function Hb(e){return v.useMemo(()=>e.hooks.dragPreview(),[e])}let jc=!1,Xc=!1;class Vb{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){Fe(!jc,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return jc=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{jc=!1}}isDragging(){if(!this.sourceId)return!1;Fe(!Xc,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xc=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Xc=!1}}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,r){return this.internalMonitor.isOverTarget(t,r)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Kc=!1;class Wb{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,r){return this.internalMonitor.subscribeToStateChange(t,r)}canDrop(){if(!this.targetId)return!1;Fe(!Kc,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Kc=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Kc=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function zb(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function Gb(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}function m0(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function Xb(e){return(t=null,r=null)=>{if(!v.isValidElement(t)){const o=t;return e(o,r),o}const n=t;return jb(n),Kb(n,r?o=>e(o,r):e)}}function ly(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const i=Xb(n);t[r]=()=>i}}),t}function R1(e,t){typeof e=="function"?e(t):e.current=t}function Kb(e,t){const r=e.ref;return Fe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or . Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?v.cloneElement(e,{ref:n=>{R1(r,n),R1(t,n)}}):v.cloneElement(e,{ref:t})}class Yb{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return r&&this.disconnectDragSource(),this.handlerId?t?(r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),r):(this.lastConnectedDragSource=t,r):r}reconnectDragPreview(t=!1){const r=this.dragPreview,n=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!m0(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!m0(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=ly({dragSource:(r,n)=>{this.clearDragSource(),this.dragSourceOptions=n||null,v0(r)?this.dragSourceRef=r:this.dragSourceNode=r,this.reconnectDragSource()},dragPreview:(r,n)=>{this.clearDragPreview(),this.dragPreviewOptions=n||null,v0(r)?this.dragPreviewRef=r:this.dragPreviewNode=r,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class qb{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!m0(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=ly({dropTarget:(r,n)=>{this.clearDropTarget(),this.dropTargetOptions=n,v0(r)?this.dropTargetRef=r:this.dropTargetNode=r,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Io(){const{dragDropManager:e}=v.useContext(Z2);return Fe(e!=null,"Expected drag drop context"),e}function Qb(e,t){const r=Io(),n=v.useMemo(()=>new Yb(r.getBackend()),[r]);return ci(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),ci(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}function Zb(){const e=Io();return v.useMemo(()=>new Vb(e),[e])}class Jb{beginDrag(){const t=this.spec,r=this.monitor;let n=null;return typeof t.item=="object"?n=t.item:typeof t.item=="function"?n=t.item(r):n={},n??null}canDrag(){const t=this.spec,r=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(r):!0}isDragging(t,r){const n=this.spec,i=this.monitor,{isDragging:o}=n;return o?o(i):r===t.getSourceId()}endDrag(){const t=this.spec,r=this.monitor,n=this.connector,{end:i}=t;i&&i(r.getItem(),r),n.reconnect()}constructor(t,r,n){this.spec=t,this.monitor=r,this.connector=n}}function ek(e,t,r){const n=v.useMemo(()=>new Jb(e,t,r),[t,r]);return v.useEffect(()=>{n.spec=e},[e]),n}function tk(e){return v.useMemo(()=>{const t=e.type;return Fe(t!=null,"spec.type must be defined"),t},[e])}function rk(e,t,r){const n=Io(),i=ek(e,t,r),o=tk(e);ci(function(){if(o!=null){const[s,l]=Gb(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l}},[n,t,r,i,o])}function nk(e,t){const r=sy(e,t);Fe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const n=Zb(),i=Qb(r.options,r.previewOptions);return rk(r,n,i),[ay(r.collect,n,i),Ub(i),Hb(i)]}function ik(e){return v.useMemo(()=>e.hooks.dropTarget(),[e])}function ok(e){const t=Io(),r=v.useMemo(()=>new qb(t.getBackend()),[t]);return ci(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}function ak(){const e=Io();return v.useMemo(()=>new Wb(e),[e])}function sk(e){const{accept:t}=e;return v.useMemo(()=>(Fe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class lk{canDrop(){const t=this.spec,r=this.monitor;return t.canDrop?t.canDrop(r.getItem(),r):!0}hover(){const t=this.spec,r=this.monitor;t.hover&&t.hover(r.getItem(),r)}drop(){const t=this.spec,r=this.monitor;if(t.drop)return t.drop(r.getItem(),r)}constructor(t,r){this.spec=t,this.monitor=r}}function uk(e,t){const r=v.useMemo(()=>new lk(e,t),[t]);return v.useEffect(()=>{r.spec=e},[e]),r}function ck(e,t,r){const n=Io(),i=uk(e,t),o=sk(e);ci(function(){const[s,l]=zb(o,i,n);return t.receiveHandlerId(s),r.receiveHandlerId(s),l},[n,t,i,r,o.map(a=>a.toString()).join("|")])}function fk(e,t){const r=sy(e,t),n=ak(),i=ok(r.options);return ck(r,n,i),[ay(r.collect,n,i),ik(i)]}const uy=new RegExp("^([0-9]+)(\\s)([kKmMbBtT])$"),Sa=new RegExp("^\\d{4}$"),dk=new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}|\\d{4}-\\d{2}-\\d{2}$");function hk({column:e,table:t,numberOfColumns:r}){function n(f){if(!f)return null;const d=new Date(f),h=d.toISOString().split("T")[0],m=d.toTimeString().split(" ")[0];return`${h} ${m}`}const i=t.getPreFilteredRowModel().flatRows.map(f=>f.original[e.id]),o=i.every(f=>typeof f=="string"||f===null),a=i.every(f=>typeof f=="number"||uy.test(f)||f===null||f===""),s=i.some(f=>typeof f=="string"&&f.includes(" ")),l=e.getFilterValue();let u="date";const c=i.every(f=>{const d=f==null?void 0:f.toString().replace(/[^0-9]/g,"").trim();return dk.test(f==null?void 0:f.toString())&&(u="datetime-local"),Sa.test(f==null?void 0:f.toString())&&(u="number"),(d==null?void 0:d.length)>=4&&(Yl(e.id)||e.id.toLowerCase()==="index"&&!s)});return c&&u==="number"?Ce("div",{className:"flex gap-2 h-10",children:[j("input",{type:u,value:(l==null?void 0:l[0])??"",onChange:f=>{e.setFilterValue(d=>[`${f.target.value}`,`${d==null?void 0:d[1]}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"Start year",className:"_input"}),j("input",{type:u,value:(l==null?void 0:l[1])??"",onChange:f=>{e.setFilterValue(d=>[`${d==null?void 0:d[0]}`,`${f.target.value}`])},min:i.reduce((f,d)=>Math.min(f,parseInt(d,10)),1/0),max:i.reduce((f,d)=>Math.max(f,parseInt(d,10)),-1/0),placeholder:"End year",className:"_input"})]}):c&&u!=="number"?Ce("div",{className:"flex gap-2 h-10",children:[j("input",{type:u,value:n(l==null?void 0:l[0])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[d,h==null?void 0:h[1]])},placeholder:"Start date",className:"_input"}),j("input",{type:u,value:n(l==null?void 0:l[1])??"",onChange:f=>{const d=new Date(f.target.value).getTime();e.setFilterValue(h=>[h==null?void 0:h[0],d])},placeholder:"End date",className:"_input"})]}):a?Ce("div",{className:"flex gap-0.5 h-10",children:[j("input",{type:"number",value:(l==null?void 0:l[0])??"",onChange:f=>e.setFilterValue(d=>[f.target.value,d==null?void 0:d[1]]),placeholder:"Min",className:"_input p-0.5"}),j("input",{type:"number",value:(l==null?void 0:l[1])??"",onChange:f=>e.setFilterValue(d=>[d==null?void 0:d[0],f.target.value]),placeholder:"Max",className:"_input p-0.5"})]}):o?j("div",{className:"h-10",children:j("input",{type:"text",value:l??"",onChange:f=>e.setFilterValue(f.target.value),placeholder:"Search...",className:"_input"})}):j("div",{className:"h-10"})}const pk=(e,t,r)=>(r.splice(r.indexOf(t),0,r.splice(r.indexOf(e),1)[0]),[...r]),gk=({header:e,table:t,advanced:r,idx:n,lockFirstColumn:i,setLockFirstColumn:o})=>{const{getState:a,setColumnOrder:s}=t,{columnOrder:l}=a(),{column:u}=e,[,c]=fk({accept:"column",drop:p=>{const g=pk(p.id,u.id,l);s(g)}}),[{isDragging:f},d,h]=nk({collect:p=>({isDragging:p.isDragging()}),item:()=>u,type:"column"}),m=()=>j("div",{ref:h,className:"flex gap-1 flex-col",children:e.isPlaceholder?null:Ce(Q1,{children:[Ce("div",{className:"font-bold uppercase text-grey-700 dark:text-white tracking-widest flex gap-2 whitespace-nowrap justify-between",children:[Ce("div",{onClick:u.getToggleSortingHandler(),className:kt("flex gap-1",{"cursor-pointer select-none":u.getCanSort()}),children:[Kf(u.columnDef.header,e.getContext()),u.getCanSort()&&Ce("div",{className:"flex flex-col gap-0.5 items-center justify-center",children:[j("button",{className:kt({"text-[#669DCB]":u.getIsSorted()==="asc","text-grey-600":u.getIsSorted()!=="asc"}),children:j("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"4",fill:"none",viewBox:"0 0 11 5",children:j("path",{fill:"currentColor",d:"M10.333 5l-5-5-5 5"})})}),j("button",{className:kt({"text-[#669DCB]":e.column.getIsSorted()==="desc","text-grey-600":e.column.getIsSorted()!=="desc"}),children:j("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"4",fill:"none",viewBox:"0 0 11 5",children:j("path",{fill:"currentColor",d:"M.333 0l5 5 5-5"})})})]})]}),r&&u.id!=="select"&&j("button",{ref:d,className:"text-grey-600 hover:text-grey-800 dark:hover:text-white",children:j("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"16",fill:"none",viewBox:"0 0 17 16",children:j("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M3.667 6l-2 2 2 2M6.333 3.333l2-2 2 2M10.333 12.667l-2 2-2-2M13 6l2 2-2 2M1.667 8H15M8.333 1.333v13.334"})})})]}),r&&u.getCanFilter()?j("div",{children:j(hk,{column:u,table:t,numberOfColumns:(l==null?void 0:l.length)??0})}):null]})});return Ce("th",{className:kt("h-[70px] p-4 sticky",{"left-0 z-50 bg-white dark:bg-grey-900":n===0&&i}),colSpan:e.colSpan,style:{width:e.getSize(),opacity:f?.5:1},ref:c,children:[n===0?Ce(h8,{children:[j(p8,{asChild:!0,children:m()}),j(g8,{children:j(m8,{className:"bg-white text-black dark:text-white dark:bg-grey-900 border border-grey-200 dark:border-grey-800 rounded-md shadow-lg p-2 z-50 text-xs",children:j("div",{className:"flex flex-col gap-2",children:Ce("button",{onClick:()=>{o(!i)},className:"hover:bg-grey-300 dark:hover:bg-grey-800 rounded-md p-2",children:[i?"Unlock":"Lock"," first column"]})})})})]}):m(),j("button",{className:"resizer bg-grey-300/20 dark:hover:bg-white absolute top-0 right-0 w-0.5 h-full",onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})]})};function mk({open:e,close:t}){const r=window.download_path||"~/OpenBBUserData/exports";return Ce(Xv,{open:e,onOpenChange:t,children:[Ce("div",{id:"loading",className:"saving",children:[j("div",{id:"loading_text",className:"loading_text"}),j("div",{id:"loader",className:"loader"})]}),j(Kv,{onClick:t,className:"_modal-overlay"}),Ce(Yv,{className:"_modal",children:[j(Wf,{children:j(ql,{})}),j(Wf,{className:"_modal-close",onClick:t,style:{float:"right",marginTop:20},children:j(ql,{className:"w-6 h-6"})}),j(qv,{className:"_modal-title",children:"Success"}),Ce("div",{id:"popup_title",className:"popup_content",style:{padding:"0px 2px 2px 5px",marginTop:5},children:[j("div",{style:{display:"flex",flexDirection:"column",gap:0,fontSize:14},children:j("div",{children:Ce("label",{htmlFor:"title_text",children:[j("b",{children:window.title})," has been downloaded to",j("br",{}),j("br",{}),j("a",{style:{color:"#FFDD00",marginTop:15},href:`${r}`,onClick:n=>{n.preventDefault(),window.pywry.open_file(r)},children:r})]})})}),j("div",{style:{float:"right",marginTop:20},children:j("button",{className:"_btn",style:{padding:"8px 16px",width:"100%"},onClick:t,children:"Close"})})]})]})]})}function vk({columns:e,data:t,type:r,setType:n,downloadFinished:i}){const o=()=>{switch(r){case"csv":Qg("csv",e,t,i);break;case"xlsx":Qg("xlsx",e,t,i);break;case"png":lP("table",i);break}};return Ce("div",{className:"flex gap-6 items-center",children:[j(Xi,{labelType:"row",value:r,onChange:a=>{n(a)},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:w0.map(a=>({label:a,value:a}))}]}),j("button",{onClick:o,className:"_btn",children:"Export"})]})}const cy="DropdownMenu",[xk,a$]=sn(cy,[Lu]),Ri=Lu(),[wk,fy]=xk(cy),yk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Ri(t),u=v.useRef(null),[c=!1,f]=go({prop:i,defaultProp:o,onChange:a});return v.createElement(wk,{scope:t,triggerId:Kr(),triggerRef:u,contentId:Kr(),open:c,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(d=>!d),[f]),modal:s},v.createElement(j2,ge({},l,{open:c,onOpenChange:f,dir:n,modal:s}),r))},Ek="DropdownMenuTrigger",_k=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=fy(Ek,r),a=Ri(r);return v.createElement(X2,ge({asChild:!0},a),v.createElement(Ie.button,ge({type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n},i,{ref:xd(t,o.triggerRef),onPointerDown:Se(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Se(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),Sk=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ri(t);return v.createElement(K2,ge({},n,r))},Tk="DropdownMenuContent",Ck=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=fy(Tk,r),o=Ri(r),a=v.useRef(!1);return v.createElement(Y2,ge({id:i.contentId,"aria-labelledby":i.triggerId},o,n,{ref:t,onCloseAutoFocus:Se(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)===null||l===void 0||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Se(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Ak=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return v.createElement(r8,ge({},i,n,{ref:t}))}),Rk=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return v.createElement(n8,ge({},i,n,{ref:t}))}),Ok=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Ri(r);return v.createElement(i8,ge({},i,n,{ref:t}))}),Fk=yk,O1=_k,Dk=Sk,Pk=Ck,Ik=Ak,bk=Rk,Yc=Ok;function kk(e,t){v.useEffect(()=>{const r=n=>{!e.current||e.current.contains(n.target)||t(n)};return document.addEventListener("mousedown",r),document.addEventListener("touchstart",r),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("touchstart",r)}},[e,t])}function F1({label:e,table:t,onlyIconTrigger:r=!1}){const[n,i]=v.useState(!1),o=v.useRef(null);kk(o,()=>i(!1)),v.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[]);function a(){t.resetColumnFilters(),i(!1)}return Ce(Fk,{open:n,children:[r?j(O1,{title:"Filter columns",onClick:()=>i(!n),children:j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-7 h-7",children:j("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"})})}):Ce(Ik,{className:"flex flex-row items-center gap-2",children:[j(bk,{className:"whitespace-nowrap",children:e}),Ce(O1,{onClick:()=>i(!n),className:"bg-white text-black dark:bg-grey-900 dark:text-white whitespace-nowrap h-[36px] border-[1.5px] border-grey-700 rounded p-3 inline-flex items-center justify-center leading-none gap-[5px] shadow-[0_2px_10px] shadow-black/10 focus:shadow-[0_0_0_2px] focus:shadow-black data-[placeholder]:text-white outline-none","aria-label":e,children:[j("span",{children:"Filter columns"}),j(s0,{className:kt({"transform rotate-180 duration-200 transition":n})})]})]}),j(Dk,{children:Ce(Pk,{sideOffset:10,ref:o,className:"z-50 bg-white/80 dark:bg-grey-900/80 backdrop-filter backdrop-blur flex flex-col gap-4 overflow-auto border-[1.5px] border-grey-700 rounded p-3 max-h-[500px] text-black dark:text-white",children:[j(Yc,{children:j("button",{className:"_btn w-full",onClick:a,children:"Clear Filters"})}),j(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[j("input",{type:"checkbox",checked:t.getIsAllColumnsVisible(),onChange:t.getToggleAllColumnsVisibilityHandler()}),"Toggle All"]})}),t.getAllLeafColumns().filter(s=>s.id!=="select").map(s=>j(Yc,{children:Ce("label",{className:"flex items-center gap-2",children:[j("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler()}),s.id]})},s.id))]})})]})}function dy(e){return typeof e!="number"?typeof e=="string"&&e.includes("All")?e:x0:e<1?x0:e}function $k({table:e,currentPage:t,setCurrentPage:r}){const n=e.getFilteredRowModel().rows.length||0;return Ce("div",{className:"hidden md:flex items-center gap-8",children:[j(Xi,{value:t,onChange:i=>{const o=dy(i);r(o),o.toString().includes("All")?e.setPageSize(n):e.setPageSize(o)},labelType:"row",label:"Rows per page",placeholder:"Select rows per page",groups:[{label:"Rows per page",items:[10,20,30,40,50,`All (${n})`].map(i=>({label:`${i}`,value:i}))}]}),Ce("span",{className:"flex items-center gap-1",children:[j("strong",{children:e.getState().pagination.pageIndex+1}),"of",j("strong",{children:e.getPageCount()})]}),Ce("div",{className:"hidden lg:block",children:[j("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:"<<"}),j("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanPreviousPage(),"dark:text-white":e.getCanPreviousPage()}),onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:"<"}),j("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:">"}),j("button",{className:kt("px-2",{"text-grey-400 dark:text-grey-700":!e.getCanNextPage(),"dark:text-white":e.getCanNextPage()}),onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:">>"})]})]})}const Nk=new Date,Mk=50,x0=30;function Lk(e,t){try{const r=e.hasOwnProperty("index")?"index":e.hasOwnProperty("Index")?"Index":null,n=r?e[r]:null,i=e[t],o=typeof i,a=i==null?void 0:i.toString().replace(/[^0-9]/g,""),s=(a==null?void 0:a.length)>=4&&(Yl(t)||t.toLowerCase()==="index"||n&&typeof n=="string"&&(n.toLowerCase().includes("date")||n.toLowerCase().includes("day")||n.toLowerCase().includes("time")||n.toLowerCase().includes("timestamp")||n.toLowerCase().includes("year")||n.toLowerCase().includes("month")||n.toLowerCase().includes("week")||n.toLowerCase().includes("hour")||n.toLowerCase().includes("minute")));if(o==="string"&&i.startsWith("http")||!s)return(i==null?void 0:i.toString().length)??0;if(s&&!isNaN(new Date(i).getTime())&&!Sa.test(i==null?void 0:i.toString())){if(typeof i=="string")return(i==null?void 0:i.toString().length)??0;try{const u=new Date(i);let c="";return u.getUTCHours()===0&&u.getUTCMinutes()===0&&u.getUTCSeconds()===0&&u.getMilliseconds()===0?c=u.toISOString().split("T")[0]:(c=u.toISOString(),c=`${c.split("T")[0]} ${c.split("T")[1].split(".")[0]}`),(c==null?void 0:c.toString().length)??0}catch{return(i==null?void 0:i.toString().length)??0}}return(i==null?void 0:i.toString().length)??0}catch{return 0}}const w0=["csv","xlsx","png"];function Bk({data:e,columns:t,title:r,initialTheme:n,cmd:i=""}){const[o,a]=qo("exportType",w0[0]),[s,l]=v.useState(!1),[u,c]=e4(n),[f,d]=v.useState(u==="dark"),h=W=>{c(u),d(W)},[m,p]=qo("rowsPerPage",x0,dy),[g,x]=qo("advanced",!1),[w,y]=qo("colors",!1),[E,b]=v.useState([]),[k,S]=v.useState(""),[A,C]=qo("fontSize","1"),[L,B]=v.useState(!1),U=t.reduce((W,Q,le)=>(W[Q]=le
{const ie=Math.max(...W.map($e=>Lk($e,Q)),le!=null&&le.length?(le==null?void 0:le.length)+8:0);return Math.min(200,ie*12)},ae=v.useMemo(()=>[...t.map((W,Q)=>({accessorKey:W,accessorFn:le=>{const me=le.hasOwnProperty("index")?"index":le.hasOwnProperty("Index")?"Index":t[0],Te=me?le[me]:null,ie=le[W],$e=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",Pe=($e==null?void 0:$e.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||Te&&typeof Te=="string"&&(Te.toLowerCase().includes("date")||Te.toLowerCase().includes("time")||Te.toLowerCase().includes("timestamp")||Te.toLowerCase().includes("year")||Te.toLowerCase().includes("month")||Te.toLowerCase().includes("week")||Te.toLowerCase().includes("hour")||Te.toLowerCase().includes("minute")));return Pe&&Sa.test(ie==null?void 0:ie.toString())?ie:Pe?typeof ie=="number"?ie:new Date(ie).getTime():ie},id:W,header:W,size:ee(e,W,W),footer:W,cell:({row:le})=>{var Bt;const me=le.original.hasOwnProperty("index")?"index":le.original.hasOwnProperty("Index")?"Index":t[0],Te=me?le.original[me]:null,ie=le.original[W],$e=typeof ie,Pe=(ie==null?void 0:ie.toString().replace(/[^0-9]/g,""))??"",ve=(Pe==null?void 0:Pe.length)>=4&&(Yl(W)||W.toLowerCase()==="index"||Te&&typeof Te=="string"&&(Te.toLowerCase().includes("date")||Te.toLowerCase().includes("time")||Te.toLowerCase().includes("timestamp")||Te.toLowerCase().includes("year")));if($e==="string"&&ie.startsWith("http"))return j("a",{className:"_hyper-link",href:ie,target:"_blank",rel:"noreferrer",children:(ie==null?void 0:ie.length)>25?`${ie.substring(0,25)}...`:ie});if(ve&&Sa.test(ie==null?void 0:ie.toString()))return j("p",{children:ie});if(ve&&!isNaN(new Date(ie).getTime())&&!Sa.test(ie==null?void 0:ie.toString())){if(typeof ie=="string"){const Ne=ie.split("T")[0],Ze=(Bt=ie.split("T")[1])==null?void 0:Bt.split(".")[0];return Ze==="00:00:00"?j("p",{children:Ne}):Ce("p",{children:[Ne," ",Ze]})}try{const Ne=new Date(ie);let Ze="";return Ne.getUTCHours()===0&&Ne.getUTCMinutes()===0&&Ne.getUTCSeconds()===0&&Ne.getMilliseconds()===0?Ze=Ne.toISOString().split("T")[0]:(Ze=Ne.toISOString(),Ze=`${Ze.split("T")[0]} ${Ze.split("T")[1].split(".")[0]}`),j("p",{children:Ze})}catch{return j("p",{children:ie})}}if($e==="number"||uy.test(ie==null?void 0:ie.toString())){let Ne=rP(ie,W);const Ze=Number(t0(ie));if(typeof Te=="string"&&i2(Te)){Ne=Number(t0(ie));const us=Ne<2?4:2;Ne=Ne.toLocaleString("en-US",{maximumFractionDigits:us,minimumFractionDigits:2})}return j("p",{className:kt("whitespace-nowrap",{"text-black dark:text-white":!w,"text-[#16A34A]":Ze>0&&w,"text-[#F87171]":Ze<0&&w,"text-[#404040]":Ze===0&&w}),title:n2(ie).toString()??"",children:Ze!==0?Ze>0?`${Ne}`:`${Ne}`:Ne})}else if($e==="string")return j("div",{dangerouslySetInnerHTML:{__html:JC(ie)}});return j("p",{children:ie})}}))],[g,w]),[he,_e]=v.useState(!1),[oe,ye]=v.useState(ae.map(W=>W.id)),te=()=>ye(t.map(W=>W.id)),O=v.useMemo(()=>{const W=oe.map(le=>le),Q=ae.map(le=>le.id);return!nP(W,Q)},[oe,ae]),M=sC({data:e,columns:ae,getCoreRowModel:qT(),getSortedRowModel:tC(),getFilteredRowModel:eC(),getPaginationRowModel:nC(),columnResizeMode:"onChange",onColumnVisibilityChange:X,onColumnOrderChange:ye,onSortingChange:b,onGlobalFilterChange:S,globalFilterFn:iP,state:{sorting:E,globalFilter:k,columnOrder:oe,columnVisibility:H},initialState:{pagination:{pageIndex:0,pageSize:typeof m=="string"?m.includes("All")?e==null?void 0:e.length:parseInt(m):m}}}),N=v.useRef(null),{rows:F}=M.getRowModel(),V=M.getVisibleFlatColumns(),[Y,J]=v.useState(!1);return v.useEffect(()=>{s&&(l(!1),J(!0))},[s]),Ce(Q1,{children:[j(f5,{toast:{id:"max-columns",title:"Max 12 columns are visible by default",description:"You can change this by clicking on advanced and then top right 'Filter' button",status:"info"},open:L,setOpen:B}),j(mk,{open:Y,close:()=>J(!1)}),Ce("div",{ref:N,className:kt("overflow-x-hidden h-screen"),children:[Ce("div",{className:"relative p-4",id:"table",children:[j("div",{className:"absolute -inset-0.5 bg-gradient-to-r rounded-md blur-md from-[#072e49]/30 via-[#0d345f]/30 to-[#0d3362]/30"}),Ce("div",{className:"border border-grey-500/60 dark:border-grey-200/60 bg-white dark:bg-grey-900 rounded overflow-hidden relative z-20",children:[Ce("div",{className:"_header relative gap-4 py-2 text-center text-xs flex items-center justify-between px-4 text-white",style:{fontSize:`${Number(A)*100}%`},children:[j("div",{className:"w-1/3",children:j("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"40",fill:"none",viewBox:"0 0 64 40",children:j("path",{fill:"#fff",d:"M61.283 3.965H33.608v27.757h25.699V19.826H37.561v-3.965H63.26V3.965h-1.977zM39.538 23.792h15.815v3.965H37.561v-3.965h1.977zM59.306 9.913v1.983H37.561V7.931h21.745v1.982zM33.606 0h-3.954v3.965H33.606V0zM25.7 3.966H0V15.86h25.7v3.965H3.953v11.896h25.7V3.966h-3.955zm0 21.808v1.983H7.907v-3.965h17.791v1.982zm0-15.86v1.982H3.953V7.931h21.745v1.982zM37.039 35.693v2.952l-.246-.246-.245-.245-.245-.247-.245-.246-.246-.246-.245-.245-.245-.247-.247-.246-.245-.246-.245-.246-.245-.246-.246-.246h-.49v3.936h.49v-3.198l.246.246.245.246.245.246.245.246.246.246.246.246.245.247.246.245.245.246.245.247.245.246.246.245.245.246h.245v-3.936h-.49zM44.938 37.17h-.491v-1.477h-2.944v3.937h3.93v-2.46h-.495zm-2.944-.246v-.739h1.962v.984h-1.962v-.245zm2.944.984v1.23h-2.944V37.66h2.944v.247zM52.835 37.17h-.49v-1.477h-2.946v3.937h3.925v-2.46h-.489zm-2.944-.246v-.739h1.963v.984h-1.965l.002-.245zm2.944.984v1.23H49.89V37.66h2.946v.247zM29.174 35.693H25.739v3.936H29.663v-.491H26.229v-.984h2.943v-.493H26.229v-1.476h3.434v-.492h-.489zM13.37 35.693H9.934v3.937h3.925v-3.937h-.49zm0 .738v2.709h-2.945v-2.955h2.943l.001.246zM21.276 35.693h-3.435v3.937h.491v-1.476h3.434v-2.461h-.49zm0 .738v1.23h-2.944v-1.476h2.944v.246z"})})}),j("p",{className:"font-bold w-1/3 flex flex-col gap-0.5 items-center",children:r}),Ce("p",{className:"w-1/3 text-right text-xs",children:[new Intl.DateTimeFormat("en-GB",{dateStyle:"full",timeStyle:"long"}).format(Nk).replace(/:\d\d /," "),j("br",{}),j("span",{className:"text-grey-400",children:i})]})]}),j("div",{className:"overflow-auto max-h-[calc(100vh-160px)] smh:max-h-[calc(100vh-95px)]",children:Ce("table",{className:"text-sm relative",style:{fontSize:`${Number(A)*100}%`},children:[j("thead",{className:"sticky top-0 bg-white dark:bg-grey-900",children:M.getHeaderGroups().map((W,Q)=>j("tr",{children:W.headers.map((le,me)=>j(gk,{setLockFirstColumn:_e,lockFirstColumn:he,idx:me,advanced:g,header:le,table:M},le.id))},W.id))}),j("tbody",{children:M.getRowModel().rows.map((W,Q)=>j("tr",{className:"!h-[64px] border-b border-grey-400",children:W.getVisibleCells().map((le,me)=>j("td",{className:kt("whitespace-normal p-4 text-black dark:text-white",{"bg-white dark:bg-grey-850":Q%2===0,"bg-grey-100 dark:bg-[#202020]":Q%2===1,"sticky left-0 z-10":me===0&&he}),style:{width:le.column.getSize()},children:Kf(le.column.columnDef.cell,le.getContext())},le.id))},W.id))}),(F==null?void 0:F.length)>30&&(V==null?void 0:V.length)>4&&j("tfoot",{children:M.getFooterGroups().map(W=>j("tr",{children:W.headers.map(Q=>j("th",{colSpan:Q.colSpan,className:"text-grey-500 bg-grey-100 dark:bg-grey-850 font-normal text-left text-sm h-10 p-4",style:{width:Q.getSize()},children:Q.isPlaceholder?null:Kf(Q.column.columnDef.footer,Q.getContext())},Q.id))},W.id))})]})})]})]}),Ce("div",{className:"smh:hidden flex max-h-[68px] overflow-x-auto bg-white/70 dark:bg-grey-900/70 backdrop-filter backdrop-blur z-20 bottom-0 left-0 w-full gap-10 justify-between py-4 px-4 text-sm",children:[Ce("div",{className:"flex items-center gap-10",children:[Ce(Xv,{children:[j(gT,{className:"_btn",children:"Settings"}),Ce(mT,{children:[j(Kv,{className:"_modal-overlay"}),Ce(Yv,{className:"_modal",children:[j(Wf,{className:"absolute top-[40px] right-[46px] text-grey-200 hover:text-white rounded-[4px] focus:outline focus:outline-2 focus:outline-grey-500",children:j(ql,{className:"w-6 h-6"})}),j(qv,{className:"uppercase font-bold tracking-widest",children:"Settings"}),Ce("div",{className:"grid grid-cols-2 gap-4 mt-10 text-sm",children:[O&&j("button",{onClick:()=>te(),className:"_btn h-9",children:"Reset Order"}),j(Xi,{labelType:"row",value:f?"light":"dark",onChange:W=>{h(W!=="dark")},label:"Theme",placeholder:"Select theme",groups:[{label:"Theme",items:[{label:"Dark",value:"dark"},{label:"Light",value:"light"}]}]}),j(Xi,{labelType:"row",value:o,onChange:W=>{a(W)},label:"Export type",placeholder:"Select export type",groups:[{label:"Export type",items:w0.map(W=>({label:W,value:W}))}]}),j(Xi,{labelType:"row",value:A,onChange:C,label:"Font size",placeholder:"Select font size",groups:[{label:"Font size",items:[{label:"50%",value:"0.5"},{label:"75%",value:"0.75"},{label:"100%",value:"1"},{label:"125%",value:"1.25"},{label:"150%",value:"1.5"},{label:"175%",value:"1.75"},{label:"200%",value:"2"}]}]}),j(F1,{table:M,label:"Filter"}),j("div",{className:"flex gap-2 items-center",children:j(Xi,{labelType:"row",value:g?"advanced":"simple",onChange:W=>{x(W==="advanced")},label:"Type",placeholder:"Select type",groups:[{label:"Type",items:[{label:"Simple",value:"simple"},{label:"Advanced",value:"advanced"}]}]})}),Ce("div",{className:"flex gap-2 items-center",children:[j("label",{htmlFor:"colors",children:"Colors"}),j("input",{id:"colors",type:"checkbox",checked:w,onChange:()=>y(!w)})]})]})]})]})]}),j(F1,{onlyIconTrigger:!0,table:M,label:""})]}),j($k,{currentPage:m,setCurrentPage:p,table:M}),j(vk,{setType:a,type:o,columns:t,data:e,downloadFinished:l})]})]})]})}function hy(e){let t=null;return()=>(t==null&&(t=e()),t)}function Uk(e,t){return e.filter(r=>r!==t)}function Hk(e,t){const r=new Set,n=o=>r.add(o);e.forEach(n),t.forEach(n);const i=[];return r.forEach(o=>i.push(o)),i}class Vk{enter(t){const r=this.entered.length,n=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=Hk(this.entered.filter(n),[t]),r===0&&this.entered.length>0}leave(t){const r=this.entered.length;return this.entered=Uk(this.entered.filter(this.isNodeInDocument),t),r>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Wk{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const r={};Object.keys(this.config.exposeProperties).forEach(n=>{const i=this.config.exposeProperties[n];i!=null&&(r[n]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,r)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,r){return r===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const py="__NATIVE_FILE__",gy="__NATIVE_URL__",my="__NATIVE_TEXT__",vy="__NATIVE_HTML__",D1=Object.freeze(Object.defineProperty({__proto__:null,FILE:py,HTML:vy,TEXT:my,URL:gy},Symbol.toStringTag,{value:"Module"}));function qc(e,t,r){const n=t.reduce((i,o)=>i||e.getData(o),"");return n??r}const y0={[py]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[vy]:{exposeProperties:{html:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[gy]:{exposeProperties:{urls:(e,t)=>qc(e,t,"").split(`
+`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[my]:{exposeProperties:{text:(e,t)=>qc(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function zk(e,t){const r=y0[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new Wk(r);return n.loadDataTransfer(t),n}function Qc(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(y0).filter(r=>{const n=y0[r];return n!=null&&n.matchesTypes?n.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const Gk=hy(()=>/firefox/i.test(navigator.userAgent)),xy=hy(()=>!!window.safari);class P1{interpolate(t){const{xs:r,ys:n,c1s:i,c2s:o,c3s:a}=this;let s=r.length-1;if(t===r[s])return n[s];let l=0,u=a.length-1,c;for(;l<=u;){c=Math.floor(.5*(l+u));const h=r[c];if(ht)u=c-1;else return n[c]}s=Math.max(0,u);const f=t-r[s],d=f*f;return n[s]+i[s]*f+o[s]*d+a[s]*f*d}constructor(t,r){const{length:n}=t,i=[];for(let h=0;ht[h]{let k=new P1([0,.5,1],[l.y,l.y/c*m,l.y+m-c]).interpolate(d);return xy()&&o&&(k+=(window.devicePixelRatio-1)*m),k},g=()=>new P1([0,.5,1],[l.x,l.x/u*h,l.x+h-u]).interpolate(f),{offsetX:x,offsetY:w}=i,y=x===0||x,E=w===0||w;return{x:y?x:g(),y:E?w:p()}}class qk{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,r){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=r}}function Qk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I1(e){for(var t=1;t{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,r,n){this.sourceNodes.set(t,r),this.sourceNodeOptions.set(t,n);const i=a=>this.handleDragStart(a,t),o=a=>this.handleSelectStart(a);return r.setAttribute("draggable","true"),r.addEventListener("dragstart",i),r.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),r.removeEventListener("dragstart",i),r.removeEventListener("selectstart",o),r.setAttribute("draggable","false")}}connectDropTarget(t,r){const n=a=>this.handleDragEnter(a,t),i=a=>this.handleDragOver(a,t),o=a=>this.handleDrop(a,t);return r.addEventListener("dragenter",n),r.addEventListener("dragover",i),r.addEventListener("drop",o),()=>{r.removeEventListener("dragenter",n),r.removeEventListener("dragover",i),r.removeEventListener("drop",o)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(t);return I1({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(t);return I1({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(D1).some(r=>D1[r]===t)}beginDragNativeItem(t,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=zk(t,r),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const r=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var n;return(n=this.rootElement)===null||n===void 0?void 0:n.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},r)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,r){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}handleDragEnter(t,r){this.dragEnterTargetIds.unshift(r)}handleDragOver(t,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}handleDrop(t,r){this.dropTargetIds.unshift(r)}constructor(t,r,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const o=this.sourceNodes.get(i);return o&&wy(o)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:o}=this;this.dragStartSourceIds=null;const a=Xs(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:s}=i,l=Qc(s);if(this.monitor.isDragging()){if(s&&typeof s.setDragImage=="function"){const c=this.monitor.getSourceId(),f=this.sourceNodes.get(c),d=this.sourcePreviewNodes.get(c)||f;if(d){const{anchorX:h,anchorY:m,offsetX:p,offsetY:g}=this.getCurrentSourcePreviewNodeOptions(),y=Yk(f,d,a,{anchorX:h,anchorY:m},{offsetX:p,offsetY:g});s.setDragImage(d,y.x,y.y)}}try{s==null||s.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(s&&!s.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:s}=i,l=Qc(s);l&&this.beginDragNativeItem(l,s)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:o}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,o.length>0&&this.actions.hover(o,{clientOffset:Xs(i)}),o.some(s=>this.monitor.canDropOnTarget(s))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var o;(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:o}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Xs(i),this.scheduleHover(o),(o||[]).some(s=>this.monitor.canDropOnTarget(s))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var o;i.preventDefault(),(o=this.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else Qc(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:o}=this;this.dropTargetIds=[],this.actions.hover(o,{clientOffset:Xs(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))},this.options=new qk(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Vk(this.isNodeInDocument)}}const Jk=function(t,r,n){return new Zk(t,r,n)};function e$(){const[e,t]=v.useState(null),[r,n]=v.useState("Interactive Table");v.useEffect(()=>{const a=setInterval(()=>{if(window.json_data){const s=JSON.parse(window.json_data);console.log(s),t(s),s.title&&typeof s.title=="string"&&n(s.title),clearInterval(a)}},100);return()=>clearInterval(a)},[]);const o=(a=>{var h;if(!a)return null;const s=(h=a.title)==null?void 0:h.replace(/|<\/b>/g,"").replace(/ /g,"_"),l=new Date().toISOString().slice(0,10).replace(/-/g,""),u=new Date().toISOString().slice(11,19).replace(/:/g,"");window.title=`openbb_${s}_${l}_${u}`;const c=a.columns;a.index;const d=a.data.map((m,p)=>{const g={};return m.forEach((x,w)=>{g[c[w]]=x||(x===0?0:"")}),g});return{columns:c,data:d}})(e);return j("div",{className:"relative h-full bg-white dark:bg-black text-black dark:text-white",children:j(bb,{backend:Jk,children:o&&j(Bk,{title:r,data:o.data,columns:o.columns,initialTheme:e.theme&&typeof e.theme=="string"&&e.theme==="dark"?"dark":"light",cmd:(e==null?void 0:e.command_location)??""})})})}Fv.render(j(nr.StrictMode,{children:j(e$,{})}),document.getElementById("root"));