@synnaxlabs/pluto 0.53.2 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aether-BBeeeA1z.cjs +10 -0
- package/dist/aether-Bl3vMZO3.js +716 -0
- package/dist/aether-DmSenWd4.js +704 -0
- package/dist/aether-VeYJQDcf.cjs +11 -0
- package/dist/button-DBdzH6Ky.cjs +1 -0
- package/dist/button-KtgabnXL.js +251 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +2 -4
- package/dist/chunk-DeC0fbbY.js +23 -0
- package/dist/chunk-FeXHwk1_.cjs +1 -0
- package/dist/color-Cspp5cKp.js +7904 -0
- package/dist/color-DCCr0Z1b.cjs +29 -0
- package/dist/color.cjs +1 -1
- package/dist/color.js +2 -4
- package/dist/css-Ce-x3HcK.cjs +1 -0
- package/dist/css-UEo6g0SR.js +69 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -8
- package/dist/dialog-BTCrp5Yv.cjs +1 -0
- package/dist/dialog-ClQI4sHo.js +331 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +2 -4
- package/dist/divider-BYRH8-5K.js +13 -0
- package/dist/divider-CEyntx31.cjs +1 -0
- package/dist/ether-CZlE80D0.cjs +53 -0
- package/dist/ether-KMGPzrZR.js +6222 -0
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +4 -104
- package/dist/event-Btz3eWg1.cjs +1 -0
- package/dist/event-Z4V8c501.js +4 -0
- package/dist/flex-Bgtu0DK6.js +62 -0
- package/dist/flex-D_GoD3ed.cjs +1 -0
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +2 -4
- package/dist/haul-BdMc4rLJ.js +171 -0
- package/dist/haul-ZdSHqhp6.cjs +1 -0
- package/dist/header-CNx3pAkx.js +64 -0
- package/dist/header-lD0sRjCR.cjs +1 -0
- package/dist/header.cjs +1 -1
- package/dist/header.js +2 -4
- package/dist/input-CdL1OPDU.cjs +74 -0
- package/dist/input-h-4axMs7.js +47772 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +2 -4
- package/dist/list-DacuSBB3.cjs +4 -0
- package/dist/list-dZDsxTzd.js +1756 -0
- package/dist/list.cjs +1 -1
- package/dist/list.js +2 -4
- package/dist/menu-eeXfR_zT.js +170 -0
- package/dist/menu-yADx33I8.cjs +1 -0
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +2 -4
- package/dist/pluto.cjs +52 -0
- package/dist/pluto.css +2 -1
- package/dist/pluto.js +36474 -0
- package/dist/select-B93mFqvf.js +1328 -0
- package/dist/select-gt7wGGO4.cjs +1 -0
- package/dist/src/access/policy/queries.d.ts +34 -34
- package/dist/src/access/policy/queries.d.ts.map +1 -1
- package/dist/src/access/queries.d.ts +1 -1
- package/dist/src/access/queries.d.ts.map +1 -1
- package/dist/src/access/role/queries.d.ts +2 -12
- package/dist/src/access/role/queries.d.ts.map +1 -1
- package/dist/src/arc/queries.d.ts +1167 -29
- package/dist/src/arc/queries.d.ts.map +1 -1
- package/dist/src/channel/LinePlot.d.ts +2 -2
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/channel/queries.d.ts +108 -60
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/color/Provider.d.ts +8 -8
- package/dist/src/device/queries.d.ts +148 -363
- package/dist/src/device/queries.d.ts.map +1 -1
- package/dist/src/flux/result.d.ts +5 -5
- package/dist/src/flux/result.d.ts.map +1 -1
- package/dist/src/flux/update.d.ts +1 -1
- package/dist/src/flux/update.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts +1 -0
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/label/queries.d.ts +21 -21
- package/dist/src/label/queries.d.ts.map +1 -1
- package/dist/src/lineplot/aether/XAxis.d.ts +28 -28
- package/dist/src/lineplot/aether/YAxis.d.ts +28 -28
- package/dist/src/lineplot/aether/axis.d.ts +14 -14
- package/dist/src/lineplot/queries.d.ts +2 -2
- package/dist/src/lineplot/queries.d.ts.map +1 -1
- package/dist/src/lineplot/range/aether/provider.d.ts +126 -102
- package/dist/src/lineplot/range/aether/provider.d.ts.map +1 -1
- package/dist/src/lineplot/tooltip/aether/tooltip.d.ts +56 -56
- package/dist/src/log/aether/Log.d.ts +21 -21
- package/dist/src/log/queries.d.ts +2 -2
- package/dist/src/log/queries.d.ts.map +1 -1
- package/dist/src/memo/index.d.ts +0 -1
- package/dist/src/memo/index.d.ts.map +1 -1
- package/dist/src/memo/useMemoCompare.d.ts +0 -1
- package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
- package/dist/src/rack/queries.d.ts.map +1 -1
- package/dist/src/ranger/aether/queries.d.ts.map +1 -1
- package/dist/src/ranger/queries.d.ts +19 -19
- package/dist/src/ranger/queries.d.ts.map +1 -1
- package/dist/src/schematic/queries.d.ts +2 -2
- package/dist/src/schematic/queries.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Forms.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Primitives.d.ts +2 -1
- package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
- package/dist/src/schematic/symbol/SelectOrientation.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Symbols.d.ts +35 -34
- package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
- package/dist/src/schematic/symbol/queries.d.ts +96 -50
- package/dist/src/schematic/symbol/queries.d.ts.map +1 -1
- package/dist/src/schematic/symbol/registry.d.ts.map +1 -1
- package/dist/src/select/Dialog.d.ts +2 -1
- package/dist/src/select/Dialog.d.ts.map +1 -1
- package/dist/src/status/Select.d.ts.map +1 -1
- package/dist/src/status/SelectMulipleVariants.spec.d.ts +2 -0
- package/dist/src/status/SelectMulipleVariants.spec.d.ts.map +1 -0
- package/dist/src/status/SelectMultipleVariants.d.ts +9 -0
- package/dist/src/status/SelectMultipleVariants.d.ts.map +1 -0
- package/dist/src/status/SelectVariant.d.ts +2 -2
- package/dist/src/status/SelectVariant.d.ts.map +1 -1
- package/dist/src/status/SelectVariant.spec.d.ts +2 -0
- package/dist/src/status/SelectVariant.spec.d.ts.map +1 -0
- package/dist/src/status/aether/aggregator.d.ts +16 -2
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/errorHandler.d.ts +2 -1
- package/dist/src/status/aether/errorHandler.d.ts.map +1 -1
- package/dist/src/status/base/Aggregator.d.ts +3 -2
- package/dist/src/status/base/Aggregator.d.ts.map +1 -1
- package/dist/src/status/external.d.ts +1 -0
- package/dist/src/status/external.d.ts.map +1 -1
- package/dist/src/status/queries.d.ts +25 -9
- package/dist/src/status/queries.d.ts.map +1 -1
- package/dist/src/status/variantData.d.ts +4 -0
- package/dist/src/status/variantData.d.ts.map +1 -0
- package/dist/src/table/cells/Cells.d.ts +17 -17
- package/dist/src/table/queries.d.ts +2 -2
- package/dist/src/table/queries.d.ts.map +1 -1
- package/dist/src/task/queries.d.ts +3 -3
- package/dist/src/task/queries.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +10 -10
- package/dist/src/telem/aether/telem.d.ts +1 -1
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +15 -15
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/client/cache/cache.d.ts +1 -1
- package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
- package/dist/src/telem/client/client.d.ts +4 -4
- package/dist/src/telem/client/client.d.ts.map +1 -1
- package/dist/src/telem/client/reader.d.ts +1 -1
- package/dist/src/telem/client/reader.d.ts.map +1 -1
- package/dist/src/telem/client/streamer.d.ts +1 -1
- package/dist/src/telem/client/streamer.d.ts.map +1 -1
- package/dist/src/telem/control/Controller.d.ts +1 -1
- package/dist/src/telem/control/Controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts +16 -2
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +16 -16
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/indicator.d.ts +51 -37
- package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
- package/dist/src/telem/control/aether/legend.d.ts +18 -16
- package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
- package/dist/src/telem/control/aether/state.d.ts +9 -8
- package/dist/src/telem/control/aether/state.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts +990 -990
- package/dist/src/theming/base/theme.d.ts +330 -330
- package/dist/src/user/queries.d.ts +2 -2
- package/dist/src/view/queries.d.ts +2 -2
- package/dist/src/vis/axis/axis.d.ts +14 -14
- package/dist/src/vis/gauge/aether/gauge.d.ts +21 -21
- package/dist/src/vis/gauge/use.d.ts +7 -7
- package/dist/src/vis/line/aether/line.d.ts +7 -7
- package/dist/src/vis/measure/aether/measure.d.ts +56 -56
- package/dist/src/vis/rule/aether/aether.d.ts +14 -14
- package/dist/src/vis/value/aether/value.d.ts +42 -42
- package/dist/src/vis/value/redline.d.ts +5 -5
- package/dist/src/vis/value/redline.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +14 -14
- package/dist/src/workspace/queries.d.ts +6 -4
- package/dist/src/workspace/queries.d.ts.map +1 -1
- package/dist/tabs-CB7d2_0h.cjs +1 -0
- package/dist/tabs-DEXXNOZA.js +253 -0
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +2 -4
- package/dist/text-Dd6wYgQM.js +142 -0
- package/dist/text-n3Fetdk6.cjs +1 -0
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -5
- package/dist/theming-Blgv4Cvi.js +591 -0
- package/dist/theming-KFfFjsRJ.cjs +1 -0
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -5
- package/dist/tree-B4jJAzS1.js +294 -0
- package/dist/tree-CsgSEpgy.cjs +1 -0
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +2 -4
- package/dist/triggers-AqBSAR_T.cjs +1 -0
- package/dist/triggers-DDlalLoO.js +4748 -0
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +2 -4
- package/dist/types-BGbd8pRh.js +73 -0
- package/dist/types-ByXvRm2h.cjs +1 -0
- package/dist/video-Bnr-2W9p.cjs +1 -0
- package/dist/video-ByMlaeKI.js +15 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +2 -4
- package/package.json +28 -29
- package/dist/Animated-B_N04fe6.cjs +0 -1
- package/dist/Animated-BsbNkFLg.cjs +0 -1
- package/dist/Animated-CLo1CLgn.js +0 -29
- package/dist/Animated-CO--9HPM.js +0 -354
- package/dist/Box-Bi280MYh.js +0 -96
- package/dist/Box-CNUz5BsV.cjs +0 -1
- package/dist/Copy-BgRUUzWz.cjs +0 -1
- package/dist/Copy-COWBkO_v.js +0 -337
- package/dist/Dialog-Bj7FiHJD.js +0 -59
- package/dist/Dialog-DBm6Fap1.cjs +0 -1
- package/dist/Editable-C17ILP50.js +0 -202
- package/dist/Editable-HUPqTaui.cjs +0 -1
- package/dist/Haul-CnZK3e-n.js +0 -132
- package/dist/Haul-DlwI4b25.cjs +0 -1
- package/dist/Items-CXBBG9Ip.cjs +0 -4
- package/dist/Items-DQba1BFQ.js +0 -842
- package/dist/Menu-BZ6ZGIv3.cjs +0 -1
- package/dist/Menu-CniMpPmC.js +0 -139
- package/dist/Provider-cSwm-2e_.cjs +0 -1
- package/dist/Provider-jFWpR0CX.js +0 -520
- package/dist/Tags-CxzMdPpm.cjs +0 -1
- package/dist/Tags-DvfGhiWv.js +0 -925
- package/dist/Text-2MISZsc5.js +0 -1712
- package/dist/Text-XHBXXDRS.cjs +0 -1
- package/dist/Video-Bew5_j16.js +0 -10
- package/dist/Video-BryrVNlH.cjs +0 -1
- package/dist/css-CloSmhZB.cjs +0 -1
- package/dist/css-D90kZTM8.js +0 -63
- package/dist/dimensions-CdFEW3oU.cjs +0 -1
- package/dist/dimensions-DbMN4145.js +0 -19
- package/dist/eraser-BShvqlBE.js +0 -958
- package/dist/eraser-rFMFKqsg.cjs +0 -11
- package/dist/event-BxvV3arE.cjs +0 -1
- package/dist/event-nNH_pXSr.js +0 -36
- package/dist/external-4jf1Bv96.cjs +0 -1
- package/dist/external-B2YeNEwd.cjs +0 -1
- package/dist/external-B9PnwQOL.js +0 -29
- package/dist/external-BBbkXXN0.js +0 -47
- package/dist/external-BByOkVID.cjs +0 -1
- package/dist/external-BrEnYrZV.js +0 -32
- package/dist/external-BwbypKCk.cjs +0 -1
- package/dist/external-C65vBow6.cjs +0 -1
- package/dist/external-CCcIJ20u.cjs +0 -1
- package/dist/external-CF4uh-dm.js +0 -51423
- package/dist/external-Cn6EfkLd.cjs +0 -1
- package/dist/external-CovFw1fv.cjs +0 -1
- package/dist/external-D2Zb9O5J.js +0 -93
- package/dist/external-D6aLGjMg.js +0 -8969
- package/dist/external-DDvmnE2k.js +0 -341
- package/dist/external-DTi9a-iK.cjs +0 -1
- package/dist/external-DYP1_xpd.js +0 -80
- package/dist/external-DxsuBuKe.js +0 -392
- package/dist/external-DysGdnTb.js +0 -130
- package/dist/external-N2L8ffzi.js +0 -71
- package/dist/external-UzXlHlr9.js +0 -24
- package/dist/external-_Ht_yCRf.cjs +0 -1
- package/dist/external-igNfmRSB.cjs +0 -28
- package/dist/external-uUEGzmui.cjs +0 -84
- package/dist/fontString-76R2eWDd.js +0 -29
- package/dist/fontString-BNnhiwug.cjs +0 -1
- package/dist/hooks-Co6IVYNw.cjs +0 -1
- package/dist/hooks-QNj6PdUo.js +0 -73
- package/dist/index.cjs +0 -60
- package/dist/index.js +0 -36886
- package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
- package/dist/jsx-runtime-tc70JA_2.js +0 -264
- package/dist/provider-Bt-E2O6g.js +0 -810
- package/dist/provider-DQkVj3tA.cjs +0 -10
- package/dist/src/memo/proxyMemo.d.ts +0 -3
- package/dist/src/memo/proxyMemo.d.ts.map +0 -1
- package/dist/types-CGRCBVD4.js +0 -82
- package/dist/types-DI2vtOGs.cjs +0 -1
- package/dist/units-Bu36uC6z.cjs +0 -1
- package/dist/units-DMip-eZH.js +0 -14
- package/dist/useStaticData-BTwIe0Il.cjs +0 -1
- package/dist/useStaticData-p8sk2VCJ.js +0 -1051
- package/dist/value-BkUH03tl.cjs +0 -53
- package/dist/value-D0vfKEY3.js +0 -6821
|
@@ -0,0 +1,1756 @@
|
|
|
1
|
+
import { n as e } from "./chunk-DeC0fbbY.js";
|
|
2
|
+
import { It as t } from "./triggers-DDlalLoO.js";
|
|
3
|
+
import "./theming-Blgv4Cvi.js";
|
|
4
|
+
import { f as n, l as r, s as i, u as a } from "./text-Dd6wYgQM.js";
|
|
5
|
+
import { n as o } from "./css-UEo6g0SR.js";
|
|
6
|
+
import { i as s, n as c } from "./flex-Bgtu0DK6.js";
|
|
7
|
+
import { i as l } from "./button-KtgabnXL.js";
|
|
8
|
+
import { l as u, s as d, u as f } from "./dialog-ClQI4sHo.js";
|
|
9
|
+
import { array as p, bounds as m } from "@synnaxlabs/x";
|
|
10
|
+
import * as h from "react";
|
|
11
|
+
import { memo as g, useCallback as _, useMemo as v, useRef as y, useState as b, useSyncExternalStore as x } from "react";
|
|
12
|
+
import { jsx as S, jsxs as ee } from "react/jsx-runtime";
|
|
13
|
+
import { flushSync as C } from "react-dom";
|
|
14
|
+
//#region ../node_modules/.pnpm/@tanstack+virtual-core@3.13.23/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
15
|
+
function w(e, t, n) {
|
|
16
|
+
let r = n.initialDeps ?? [], i, a = !0;
|
|
17
|
+
function o() {
|
|
18
|
+
let o;
|
|
19
|
+
n.key && n.debug?.call(n) && (o = Date.now());
|
|
20
|
+
let s = e();
|
|
21
|
+
if (!(s.length !== r.length || s.some((e, t) => r[t] !== e))) return i;
|
|
22
|
+
r = s;
|
|
23
|
+
let c;
|
|
24
|
+
if (n.key && n.debug?.call(n) && (c = Date.now()), i = t(...s), n.key && n.debug?.call(n)) {
|
|
25
|
+
let e = Math.round((Date.now() - o) * 100) / 100, t = Math.round((Date.now() - c) * 100) / 100, r = t / 16, i = (e, t) => {
|
|
26
|
+
for (e = String(e); e.length < t;) e = " " + e;
|
|
27
|
+
return e;
|
|
28
|
+
};
|
|
29
|
+
console.info(`%c⏱ ${i(t, 5)} /${i(e, 5)} ms`, `
|
|
30
|
+
font-size: .6rem;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * r, 120))}deg 100% 31%);`, n?.key);
|
|
33
|
+
}
|
|
34
|
+
return n?.onChange && !(a && n.skipInitialOnChange) && n.onChange(i), a = !1, i;
|
|
35
|
+
}
|
|
36
|
+
return o.updateDeps = (e) => {
|
|
37
|
+
r = e;
|
|
38
|
+
}, o;
|
|
39
|
+
}
|
|
40
|
+
function te(e, t) {
|
|
41
|
+
if (e === void 0) throw Error(`Unexpected undefined${t ? `: ${t}` : ""}`);
|
|
42
|
+
return e;
|
|
43
|
+
}
|
|
44
|
+
var ne = (e, t) => Math.abs(e - t) < 1.01, re = (e, t, n) => {
|
|
45
|
+
let r;
|
|
46
|
+
return function(...i) {
|
|
47
|
+
e.clearTimeout(r), r = e.setTimeout(() => t.apply(this, i), n);
|
|
48
|
+
};
|
|
49
|
+
}, ie = (e) => {
|
|
50
|
+
let { offsetWidth: t, offsetHeight: n } = e;
|
|
51
|
+
return {
|
|
52
|
+
width: t,
|
|
53
|
+
height: n
|
|
54
|
+
};
|
|
55
|
+
}, ae = (e) => e, oe = (e) => {
|
|
56
|
+
let t = Math.max(e.startIndex - e.overscan, 0), n = Math.min(e.endIndex + e.overscan, e.count - 1), r = [];
|
|
57
|
+
for (let e = t; e <= n; e++) r.push(e);
|
|
58
|
+
return r;
|
|
59
|
+
}, se = (e, t) => {
|
|
60
|
+
let n = e.scrollElement;
|
|
61
|
+
if (!n) return;
|
|
62
|
+
let r = e.targetWindow;
|
|
63
|
+
if (!r) return;
|
|
64
|
+
let i = (e) => {
|
|
65
|
+
let { width: n, height: r } = e;
|
|
66
|
+
t({
|
|
67
|
+
width: Math.round(n),
|
|
68
|
+
height: Math.round(r)
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
if (i(ie(n)), !r.ResizeObserver) return () => {};
|
|
72
|
+
let a = new r.ResizeObserver((t) => {
|
|
73
|
+
let r = () => {
|
|
74
|
+
let e = t[0];
|
|
75
|
+
if (e?.borderBoxSize) {
|
|
76
|
+
let t = e.borderBoxSize[0];
|
|
77
|
+
if (t) {
|
|
78
|
+
i({
|
|
79
|
+
width: t.inlineSize,
|
|
80
|
+
height: t.blockSize
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
i(ie(n));
|
|
86
|
+
};
|
|
87
|
+
e.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(r) : r();
|
|
88
|
+
});
|
|
89
|
+
return a.observe(n, { box: "border-box" }), () => {
|
|
90
|
+
a.unobserve(n);
|
|
91
|
+
};
|
|
92
|
+
}, T = { passive: !0 }, ce = typeof window > "u" ? !0 : "onscrollend" in window, le = (e, t) => {
|
|
93
|
+
let n = e.scrollElement;
|
|
94
|
+
if (!n) return;
|
|
95
|
+
let r = e.targetWindow;
|
|
96
|
+
if (!r) return;
|
|
97
|
+
let i = 0, a = e.options.useScrollendEvent && ce ? () => void 0 : re(r, () => {
|
|
98
|
+
t(i, !1);
|
|
99
|
+
}, e.options.isScrollingResetDelay), o = (r) => () => {
|
|
100
|
+
let { horizontal: o, isRtl: s } = e.options;
|
|
101
|
+
i = o ? n.scrollLeft * (s && -1 || 1) : n.scrollTop, a(), t(i, r);
|
|
102
|
+
}, s = o(!0), c = o(!1);
|
|
103
|
+
n.addEventListener("scroll", s, T);
|
|
104
|
+
let l = e.options.useScrollendEvent && ce;
|
|
105
|
+
return l && n.addEventListener("scrollend", c, T), () => {
|
|
106
|
+
n.removeEventListener("scroll", s), l && n.removeEventListener("scrollend", c);
|
|
107
|
+
};
|
|
108
|
+
}, ue = (e, t, n) => {
|
|
109
|
+
if (t?.borderBoxSize) {
|
|
110
|
+
let e = t.borderBoxSize[0];
|
|
111
|
+
if (e) return Math.round(e[n.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
112
|
+
}
|
|
113
|
+
return e[n.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
114
|
+
}, de = (e, { adjustments: t = 0, behavior: n }, r) => {
|
|
115
|
+
var i, a;
|
|
116
|
+
let o = e + t;
|
|
117
|
+
(a = (i = r.scrollElement)?.scrollTo) == null || a.call(i, {
|
|
118
|
+
[r.options.horizontal ? "left" : "top"]: o,
|
|
119
|
+
behavior: n
|
|
120
|
+
});
|
|
121
|
+
}, fe = class {
|
|
122
|
+
constructor(e) {
|
|
123
|
+
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.scrollState = null, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.prevLanes = void 0, this.lanesChangedFlag = !1, this.lanesSettling = !1, this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.now = () => {
|
|
124
|
+
var e;
|
|
125
|
+
return ((e = this.targetWindow?.performance)?.now)?.call(e) ?? Date.now();
|
|
126
|
+
}, this.observer = /* @__PURE__ */ (() => {
|
|
127
|
+
let e = null, t = () => e || (!this.targetWindow || !this.targetWindow.ResizeObserver ? null : e = new this.targetWindow.ResizeObserver((e) => {
|
|
128
|
+
e.forEach((e) => {
|
|
129
|
+
let t = () => {
|
|
130
|
+
let t = e.target, n = this.indexFromElement(t);
|
|
131
|
+
if (!t.isConnected) {
|
|
132
|
+
this.observer.unobserve(t);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.shouldMeasureDuringScroll(n) && this.resizeItem(n, this.options.measureElement(t, e, this));
|
|
136
|
+
};
|
|
137
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(t) : t();
|
|
138
|
+
});
|
|
139
|
+
}));
|
|
140
|
+
return {
|
|
141
|
+
disconnect: () => {
|
|
142
|
+
var n;
|
|
143
|
+
(n = t()) == null || n.disconnect(), e = null;
|
|
144
|
+
},
|
|
145
|
+
observe: (e) => t()?.observe(e, { box: "border-box" }),
|
|
146
|
+
unobserve: (e) => t()?.unobserve(e)
|
|
147
|
+
};
|
|
148
|
+
})(), this.range = null, this.setOptions = (e) => {
|
|
149
|
+
Object.entries(e).forEach(([t, n]) => {
|
|
150
|
+
n === void 0 && delete e[t];
|
|
151
|
+
}), this.options = {
|
|
152
|
+
debug: !1,
|
|
153
|
+
initialOffset: 0,
|
|
154
|
+
overscan: 1,
|
|
155
|
+
paddingStart: 0,
|
|
156
|
+
paddingEnd: 0,
|
|
157
|
+
scrollPaddingStart: 0,
|
|
158
|
+
scrollPaddingEnd: 0,
|
|
159
|
+
horizontal: !1,
|
|
160
|
+
getItemKey: ae,
|
|
161
|
+
rangeExtractor: oe,
|
|
162
|
+
onChange: () => {},
|
|
163
|
+
measureElement: ue,
|
|
164
|
+
initialRect: {
|
|
165
|
+
width: 0,
|
|
166
|
+
height: 0
|
|
167
|
+
},
|
|
168
|
+
scrollMargin: 0,
|
|
169
|
+
gap: 0,
|
|
170
|
+
indexAttribute: "data-index",
|
|
171
|
+
initialMeasurementsCache: [],
|
|
172
|
+
lanes: 1,
|
|
173
|
+
isScrollingResetDelay: 150,
|
|
174
|
+
enabled: !0,
|
|
175
|
+
isRtl: !1,
|
|
176
|
+
useScrollendEvent: !1,
|
|
177
|
+
useAnimationFrameWithResizeObserver: !1,
|
|
178
|
+
...e
|
|
179
|
+
};
|
|
180
|
+
}, this.notify = (e) => {
|
|
181
|
+
var t, n;
|
|
182
|
+
(n = (t = this.options).onChange) == null || n.call(t, this, e);
|
|
183
|
+
}, this.maybeNotify = w(() => (this.calculateRange(), [
|
|
184
|
+
this.isScrolling,
|
|
185
|
+
this.range ? this.range.startIndex : null,
|
|
186
|
+
this.range ? this.range.endIndex : null
|
|
187
|
+
]), (e) => {
|
|
188
|
+
this.notify(e);
|
|
189
|
+
}, {
|
|
190
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
191
|
+
debug: () => this.options.debug,
|
|
192
|
+
initialDeps: [
|
|
193
|
+
this.isScrolling,
|
|
194
|
+
this.range ? this.range.startIndex : null,
|
|
195
|
+
this.range ? this.range.endIndex : null
|
|
196
|
+
]
|
|
197
|
+
}), this.cleanup = () => {
|
|
198
|
+
this.unsubs.filter(Boolean).forEach((e) => e()), this.unsubs = [], this.observer.disconnect(), this.rafId != null && this.targetWindow && (this.targetWindow.cancelAnimationFrame(this.rafId), this.rafId = null), this.scrollState = null, this.scrollElement = null, this.targetWindow = null;
|
|
199
|
+
}, this._didMount = () => () => {
|
|
200
|
+
this.cleanup();
|
|
201
|
+
}, this._willUpdate = () => {
|
|
202
|
+
let e = this.options.enabled ? this.options.getScrollElement() : null;
|
|
203
|
+
if (this.scrollElement !== e) {
|
|
204
|
+
if (this.cleanup(), !e) {
|
|
205
|
+
this.maybeNotify();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this.scrollElement = e, this.scrollElement && "ownerDocument" in this.scrollElement ? this.targetWindow = this.scrollElement.ownerDocument.defaultView : this.targetWindow = this.scrollElement?.window ?? null, this.elementsCache.forEach((e) => {
|
|
209
|
+
this.observer.observe(e);
|
|
210
|
+
}), this.unsubs.push(this.options.observeElementRect(this, (e) => {
|
|
211
|
+
this.scrollRect = e, this.maybeNotify();
|
|
212
|
+
})), this.unsubs.push(this.options.observeElementOffset(this, (e, t) => {
|
|
213
|
+
this.scrollAdjustments = 0, this.scrollDirection = t ? this.getScrollOffset() < e ? "forward" : "backward" : null, this.scrollOffset = e, this.isScrolling = t, this.scrollState && this.scheduleScrollReconcile(), this.maybeNotify();
|
|
214
|
+
})), this._scrollToOffset(this.getScrollOffset(), {
|
|
215
|
+
adjustments: void 0,
|
|
216
|
+
behavior: void 0
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}, this.rafId = null, this.getSize = () => this.options.enabled ? (this.scrollRect = this.scrollRect ?? this.options.initialRect, this.scrollRect[this.options.horizontal ? "width" : "height"]) : (this.scrollRect = null, 0), this.getScrollOffset = () => this.options.enabled ? (this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset == "function" ? this.options.initialOffset() : this.options.initialOffset), this.scrollOffset) : (this.scrollOffset = null, 0), this.getFurthestMeasurement = (e, t) => {
|
|
220
|
+
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
221
|
+
for (let i = t - 1; i >= 0; i--) {
|
|
222
|
+
let t = e[i];
|
|
223
|
+
if (n.has(t.lane)) continue;
|
|
224
|
+
let a = r.get(t.lane);
|
|
225
|
+
if (a == null || t.end > a.end ? r.set(t.lane, t) : t.end < a.end && n.set(t.lane, !0), n.size === this.options.lanes) break;
|
|
226
|
+
}
|
|
227
|
+
return r.size === this.options.lanes ? Array.from(r.values()).sort((e, t) => e.end === t.end ? e.index - t.index : e.end - t.end)[0] : void 0;
|
|
228
|
+
}, this.getMeasurementOptions = w(() => [
|
|
229
|
+
this.options.count,
|
|
230
|
+
this.options.paddingStart,
|
|
231
|
+
this.options.scrollMargin,
|
|
232
|
+
this.options.getItemKey,
|
|
233
|
+
this.options.enabled,
|
|
234
|
+
this.options.lanes
|
|
235
|
+
], (e, t, n, r, i, a) => (this.prevLanes !== void 0 && this.prevLanes !== a && (this.lanesChangedFlag = !0), this.prevLanes = a, this.pendingMeasuredCacheIndexes = [], {
|
|
236
|
+
count: e,
|
|
237
|
+
paddingStart: t,
|
|
238
|
+
scrollMargin: n,
|
|
239
|
+
getItemKey: r,
|
|
240
|
+
enabled: i,
|
|
241
|
+
lanes: a
|
|
242
|
+
}), { key: !1 }), this.getMeasurements = w(() => [this.getMeasurementOptions(), this.itemSizeCache], ({ count: e, paddingStart: t, scrollMargin: n, getItemKey: r, enabled: i, lanes: a }, o) => {
|
|
243
|
+
if (!i) return this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), [];
|
|
244
|
+
if (this.laneAssignments.size > e) for (let t of this.laneAssignments.keys()) t >= e && this.laneAssignments.delete(t);
|
|
245
|
+
this.lanesChangedFlag && (this.lanesChangedFlag = !1, this.lanesSettling = !0, this.measurementsCache = [], this.itemSizeCache.clear(), this.laneAssignments.clear(), this.pendingMeasuredCacheIndexes = []), this.measurementsCache.length === 0 && !this.lanesSettling && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((e) => {
|
|
246
|
+
this.itemSizeCache.set(e.key, e.size);
|
|
247
|
+
}));
|
|
248
|
+
let s = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
249
|
+
this.pendingMeasuredCacheIndexes = [], this.lanesSettling && this.measurementsCache.length === e && (this.lanesSettling = !1);
|
|
250
|
+
let c = this.measurementsCache.slice(0, s), l = Array(a).fill(void 0);
|
|
251
|
+
for (let e = 0; e < s; e++) {
|
|
252
|
+
let t = c[e];
|
|
253
|
+
t && (l[t.lane] = e);
|
|
254
|
+
}
|
|
255
|
+
for (let i = s; i < e; i++) {
|
|
256
|
+
let e = r(i), a = this.laneAssignments.get(i), s, u;
|
|
257
|
+
if (a !== void 0 && this.options.lanes > 1) {
|
|
258
|
+
s = a;
|
|
259
|
+
let e = l[s], r = e === void 0 ? void 0 : c[e];
|
|
260
|
+
u = r ? r.end + this.options.gap : t + n;
|
|
261
|
+
} else {
|
|
262
|
+
let e = this.options.lanes === 1 ? c[i - 1] : this.getFurthestMeasurement(c, i);
|
|
263
|
+
u = e ? e.end + this.options.gap : t + n, s = e ? e.lane : i % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(i, s);
|
|
264
|
+
}
|
|
265
|
+
let d = o.get(e), f = typeof d == "number" ? d : this.options.estimateSize(i), p = u + f;
|
|
266
|
+
c[i] = {
|
|
267
|
+
index: i,
|
|
268
|
+
start: u,
|
|
269
|
+
size: f,
|
|
270
|
+
end: p,
|
|
271
|
+
key: e,
|
|
272
|
+
lane: s
|
|
273
|
+
}, l[s] = i;
|
|
274
|
+
}
|
|
275
|
+
return this.measurementsCache = c, c;
|
|
276
|
+
}, {
|
|
277
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
278
|
+
debug: () => this.options.debug
|
|
279
|
+
}), this.calculateRange = w(() => [
|
|
280
|
+
this.getMeasurements(),
|
|
281
|
+
this.getSize(),
|
|
282
|
+
this.getScrollOffset(),
|
|
283
|
+
this.options.lanes
|
|
284
|
+
], (e, t, n, r) => this.range = e.length > 0 && t > 0 ? me({
|
|
285
|
+
measurements: e,
|
|
286
|
+
outerSize: t,
|
|
287
|
+
scrollOffset: n,
|
|
288
|
+
lanes: r
|
|
289
|
+
}) : null, {
|
|
290
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
291
|
+
debug: () => this.options.debug
|
|
292
|
+
}), this.getVirtualIndexes = w(() => {
|
|
293
|
+
let e = null, t = null, n = this.calculateRange();
|
|
294
|
+
return n && (e = n.startIndex, t = n.endIndex), this.maybeNotify.updateDeps([
|
|
295
|
+
this.isScrolling,
|
|
296
|
+
e,
|
|
297
|
+
t
|
|
298
|
+
]), [
|
|
299
|
+
this.options.rangeExtractor,
|
|
300
|
+
this.options.overscan,
|
|
301
|
+
this.options.count,
|
|
302
|
+
e,
|
|
303
|
+
t
|
|
304
|
+
];
|
|
305
|
+
}, (e, t, n, r, i) => r === null || i === null ? [] : e({
|
|
306
|
+
startIndex: r,
|
|
307
|
+
endIndex: i,
|
|
308
|
+
overscan: t,
|
|
309
|
+
count: n
|
|
310
|
+
}), {
|
|
311
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
312
|
+
debug: () => this.options.debug
|
|
313
|
+
}), this.indexFromElement = (e) => {
|
|
314
|
+
let t = this.options.indexAttribute, n = e.getAttribute(t);
|
|
315
|
+
return n ? parseInt(n, 10) : (console.warn(`Missing attribute name '${t}={index}' on measured element.`), -1);
|
|
316
|
+
}, this.shouldMeasureDuringScroll = (e) => {
|
|
317
|
+
if (!this.scrollState || this.scrollState.behavior !== "smooth") return !0;
|
|
318
|
+
let t = this.scrollState.index ?? this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;
|
|
319
|
+
if (t !== void 0 && this.range) {
|
|
320
|
+
let n = Math.max(this.options.overscan, Math.ceil((this.range.endIndex - this.range.startIndex) / 2)), r = Math.max(0, t - n), i = Math.min(this.options.count - 1, t + n);
|
|
321
|
+
return e >= r && e <= i;
|
|
322
|
+
}
|
|
323
|
+
return !0;
|
|
324
|
+
}, this.measureElement = (e) => {
|
|
325
|
+
if (!e) {
|
|
326
|
+
this.elementsCache.forEach((e, t) => {
|
|
327
|
+
e.isConnected || (this.observer.unobserve(e), this.elementsCache.delete(t));
|
|
328
|
+
});
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
let t = this.indexFromElement(e), n = this.options.getItemKey(t), r = this.elementsCache.get(n);
|
|
332
|
+
r !== e && (r && this.observer.unobserve(r), this.observer.observe(e), this.elementsCache.set(n, e)), (!this.isScrolling || this.scrollState) && this.shouldMeasureDuringScroll(t) && this.resizeItem(t, this.options.measureElement(e, void 0, this));
|
|
333
|
+
}, this.resizeItem = (e, t) => {
|
|
334
|
+
let n = this.measurementsCache[e];
|
|
335
|
+
if (!n) return;
|
|
336
|
+
let r = t - (this.itemSizeCache.get(n.key) ?? n.size);
|
|
337
|
+
r !== 0 && (this.scrollState?.behavior !== "smooth" && (this.shouldAdjustScrollPositionOnItemSizeChange === void 0 ? n.start < this.getScrollOffset() + this.scrollAdjustments : this.shouldAdjustScrollPositionOnItemSizeChange(n, r, this)) && (process.env.NODE_ENV !== "production" && this.options.debug && console.info("correction", r), this._scrollToOffset(this.getScrollOffset(), {
|
|
338
|
+
adjustments: this.scrollAdjustments += r,
|
|
339
|
+
behavior: void 0
|
|
340
|
+
})), this.pendingMeasuredCacheIndexes.push(n.index), this.itemSizeCache = new Map(this.itemSizeCache.set(n.key, t)), this.notify(!1));
|
|
341
|
+
}, this.getVirtualItems = w(() => [this.getVirtualIndexes(), this.getMeasurements()], (e, t) => {
|
|
342
|
+
let n = [];
|
|
343
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
344
|
+
let i = t[e[r]];
|
|
345
|
+
n.push(i);
|
|
346
|
+
}
|
|
347
|
+
return n;
|
|
348
|
+
}, {
|
|
349
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
350
|
+
debug: () => this.options.debug
|
|
351
|
+
}), this.getVirtualItemForOffset = (e) => {
|
|
352
|
+
let t = this.getMeasurements();
|
|
353
|
+
if (t.length !== 0) return te(t[pe(0, t.length - 1, (e) => te(t[e]).start, e)]);
|
|
354
|
+
}, this.getMaxScrollOffset = () => {
|
|
355
|
+
if (!this.scrollElement) return 0;
|
|
356
|
+
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
357
|
+
{
|
|
358
|
+
let e = this.scrollElement.document.documentElement;
|
|
359
|
+
return this.options.horizontal ? e.scrollWidth - this.scrollElement.innerWidth : e.scrollHeight - this.scrollElement.innerHeight;
|
|
360
|
+
}
|
|
361
|
+
}, this.getOffsetForAlignment = (e, t, n = 0) => {
|
|
362
|
+
if (!this.scrollElement) return 0;
|
|
363
|
+
let r = this.getSize(), i = this.getScrollOffset();
|
|
364
|
+
t === "auto" && (t = e >= i + r ? "end" : "start"), t === "center" ? e += (n - r) / 2 : t === "end" && (e -= r);
|
|
365
|
+
let a = this.getMaxScrollOffset();
|
|
366
|
+
return Math.max(Math.min(a, e), 0);
|
|
367
|
+
}, this.getOffsetForIndex = (e, t = "auto") => {
|
|
368
|
+
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
369
|
+
let n = this.getSize(), r = this.getScrollOffset(), i = this.measurementsCache[e];
|
|
370
|
+
if (!i) return;
|
|
371
|
+
if (t === "auto") if (i.end >= r + n - this.options.scrollPaddingEnd) t = "end";
|
|
372
|
+
else if (i.start <= r + this.options.scrollPaddingStart) t = "start";
|
|
373
|
+
else return [r, t];
|
|
374
|
+
if (t === "end" && e === this.options.count - 1) return [this.getMaxScrollOffset(), t];
|
|
375
|
+
let a = t === "end" ? i.end + this.options.scrollPaddingEnd : i.start - this.options.scrollPaddingStart;
|
|
376
|
+
return [this.getOffsetForAlignment(a, t, i.size), t];
|
|
377
|
+
}, this.scrollToOffset = (e, { align: t = "start", behavior: n = "auto" } = {}) => {
|
|
378
|
+
let r = this.getOffsetForAlignment(e, t);
|
|
379
|
+
this.scrollState = {
|
|
380
|
+
index: null,
|
|
381
|
+
align: t,
|
|
382
|
+
behavior: n,
|
|
383
|
+
startedAt: this.now(),
|
|
384
|
+
lastTargetOffset: r,
|
|
385
|
+
stableFrames: 0
|
|
386
|
+
}, this._scrollToOffset(r, {
|
|
387
|
+
adjustments: void 0,
|
|
388
|
+
behavior: n
|
|
389
|
+
}), this.scheduleScrollReconcile();
|
|
390
|
+
}, this.scrollToIndex = (e, { align: t = "auto", behavior: n = "auto" } = {}) => {
|
|
391
|
+
e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
392
|
+
let r = this.getOffsetForIndex(e, t);
|
|
393
|
+
if (!r) return;
|
|
394
|
+
let [i, a] = r, o = this.now();
|
|
395
|
+
this.scrollState = {
|
|
396
|
+
index: e,
|
|
397
|
+
align: a,
|
|
398
|
+
behavior: n,
|
|
399
|
+
startedAt: o,
|
|
400
|
+
lastTargetOffset: i,
|
|
401
|
+
stableFrames: 0
|
|
402
|
+
}, this._scrollToOffset(i, {
|
|
403
|
+
adjustments: void 0,
|
|
404
|
+
behavior: n
|
|
405
|
+
}), this.scheduleScrollReconcile();
|
|
406
|
+
}, this.scrollBy = (e, { behavior: t = "auto" } = {}) => {
|
|
407
|
+
let n = this.getScrollOffset() + e;
|
|
408
|
+
this.scrollState = {
|
|
409
|
+
index: null,
|
|
410
|
+
align: "start",
|
|
411
|
+
behavior: t,
|
|
412
|
+
startedAt: this.now(),
|
|
413
|
+
lastTargetOffset: n,
|
|
414
|
+
stableFrames: 0
|
|
415
|
+
}, this._scrollToOffset(n, {
|
|
416
|
+
adjustments: void 0,
|
|
417
|
+
behavior: t
|
|
418
|
+
}), this.scheduleScrollReconcile();
|
|
419
|
+
}, this.getTotalSize = () => {
|
|
420
|
+
let e = this.getMeasurements(), t;
|
|
421
|
+
if (e.length === 0) t = this.options.paddingStart;
|
|
422
|
+
else if (this.options.lanes === 1) t = e[e.length - 1]?.end ?? 0;
|
|
423
|
+
else {
|
|
424
|
+
let n = Array(this.options.lanes).fill(null), r = e.length - 1;
|
|
425
|
+
for (; r >= 0 && n.some((e) => e === null);) {
|
|
426
|
+
let t = e[r];
|
|
427
|
+
n[t.lane] === null && (n[t.lane] = t.end), r--;
|
|
428
|
+
}
|
|
429
|
+
t = Math.max(...n.filter((e) => e !== null));
|
|
430
|
+
}
|
|
431
|
+
return Math.max(t - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
432
|
+
}, this._scrollToOffset = (e, { adjustments: t, behavior: n }) => {
|
|
433
|
+
this.options.scrollToFn(e, {
|
|
434
|
+
behavior: n,
|
|
435
|
+
adjustments: t
|
|
436
|
+
}, this);
|
|
437
|
+
}, this.measure = () => {
|
|
438
|
+
this.itemSizeCache = /* @__PURE__ */ new Map(), this.laneAssignments = /* @__PURE__ */ new Map(), this.notify(!1);
|
|
439
|
+
}, this.setOptions(e);
|
|
440
|
+
}
|
|
441
|
+
scheduleScrollReconcile() {
|
|
442
|
+
if (!this.targetWindow) {
|
|
443
|
+
this.scrollState = null;
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
this.rafId ??= this.targetWindow.requestAnimationFrame(() => {
|
|
447
|
+
this.rafId = null, this.reconcileScroll();
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
reconcileScroll() {
|
|
451
|
+
if (!this.scrollState || !this.scrollElement) return;
|
|
452
|
+
if (this.now() - this.scrollState.startedAt > 5e3) {
|
|
453
|
+
this.scrollState = null;
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
let e = this.scrollState.index == null ? void 0 : this.getOffsetForIndex(this.scrollState.index, this.scrollState.align), t = e ? e[0] : this.scrollState.lastTargetOffset, n = t !== this.scrollState.lastTargetOffset;
|
|
457
|
+
if (!n && ne(t, this.getScrollOffset())) {
|
|
458
|
+
if (this.scrollState.stableFrames++, this.scrollState.stableFrames >= 1) {
|
|
459
|
+
this.scrollState = null;
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
} else this.scrollState.stableFrames = 0, n && (this.scrollState.lastTargetOffset = t, this.scrollState.behavior = "auto", this._scrollToOffset(t, {
|
|
463
|
+
adjustments: void 0,
|
|
464
|
+
behavior: "auto"
|
|
465
|
+
}));
|
|
466
|
+
this.scheduleScrollReconcile();
|
|
467
|
+
}
|
|
468
|
+
}, pe = (e, t, n, r) => {
|
|
469
|
+
for (; e <= t;) {
|
|
470
|
+
let i = (e + t) / 2 | 0, a = n(i);
|
|
471
|
+
if (a < r) e = i + 1;
|
|
472
|
+
else if (a > r) t = i - 1;
|
|
473
|
+
else return i;
|
|
474
|
+
}
|
|
475
|
+
return e > 0 ? e - 1 : 0;
|
|
476
|
+
};
|
|
477
|
+
function me({ measurements: e, outerSize: t, scrollOffset: n, lanes: r }) {
|
|
478
|
+
let i = e.length - 1, a = (t) => e[t].start;
|
|
479
|
+
if (e.length <= r) return {
|
|
480
|
+
startIndex: 0,
|
|
481
|
+
endIndex: i
|
|
482
|
+
};
|
|
483
|
+
let o = pe(0, i, a, n), s = o;
|
|
484
|
+
if (r === 1) for (; s < i && e[s].end < n + t;) s++;
|
|
485
|
+
else if (r > 1) {
|
|
486
|
+
let a = Array(r).fill(0);
|
|
487
|
+
for (; s < i && a.some((e) => e < n + t);) {
|
|
488
|
+
let t = e[s];
|
|
489
|
+
a[t.lane] = t.end, s++;
|
|
490
|
+
}
|
|
491
|
+
let c = Array(r).fill(n + t);
|
|
492
|
+
for (; o >= 0 && c.some((e) => e >= n);) {
|
|
493
|
+
let t = e[o];
|
|
494
|
+
c[t.lane] = t.start, o--;
|
|
495
|
+
}
|
|
496
|
+
o = Math.max(0, o - o % r), s = Math.min(i, s + (r - 1 - s % r));
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
startIndex: o,
|
|
500
|
+
endIndex: s
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region ../node_modules/.pnpm/@tanstack+react-virtual@3.13.23_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
505
|
+
var he = typeof document < "u" ? h.useLayoutEffect : h.useEffect;
|
|
506
|
+
function ge({ useFlushSync: e = !0, ...t }) {
|
|
507
|
+
let n = h.useReducer(() => ({}), {})[1], r = {
|
|
508
|
+
...t,
|
|
509
|
+
onChange: (r, i) => {
|
|
510
|
+
var a;
|
|
511
|
+
e && i ? C(n) : n(), (a = t.onChange) == null || a.call(t, r, i);
|
|
512
|
+
}
|
|
513
|
+
}, [i] = h.useState(() => new fe(r));
|
|
514
|
+
return i.setOptions(r), he(() => i._didMount(), []), he(() => i._willUpdate()), i;
|
|
515
|
+
}
|
|
516
|
+
function _e(e) {
|
|
517
|
+
return ge({
|
|
518
|
+
observeElementRect: se,
|
|
519
|
+
observeElementOffset: le,
|
|
520
|
+
scrollToFn: de,
|
|
521
|
+
...e
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region src/list/Frame.tsx
|
|
526
|
+
var ve = (e, t) => ((n) => Array.isArray(n) ? t(n) : e(n)), [E, ye] = t({
|
|
527
|
+
displayName: "List.DataContext",
|
|
528
|
+
providerName: "List.Frame"
|
|
529
|
+
}), [be, D] = t({
|
|
530
|
+
displayName: "List.UtilContext",
|
|
531
|
+
providerName: "List.Frame"
|
|
532
|
+
}), xe = () => D("List.useUtilContext"), Se = () => {
|
|
533
|
+
let { scrollToIndex: e } = D("List.useScroller");
|
|
534
|
+
return v(() => ({ scrollToIndex: e }), [e]);
|
|
535
|
+
}, Ce = (e) => {
|
|
536
|
+
let { getItem: t, subscribe: n } = D("List.useItem");
|
|
537
|
+
return x(_((t) => n == null ? () => {} : n(t, e), [e, n]), _(() => t?.(e), [t, e]), () => void 0);
|
|
538
|
+
}, O = () => {
|
|
539
|
+
let { data: e, getItems: t, getTotalSize: n, itemHeight: r, sentinelRef: i } = ye("List.useData"), { ref: a, getItem: o, scrollToIndex: s, subscribe: c } = D("List.useData");
|
|
540
|
+
return v(() => ({
|
|
541
|
+
data: e,
|
|
542
|
+
getItems: t,
|
|
543
|
+
getTotalSize: n,
|
|
544
|
+
ref: a,
|
|
545
|
+
getItem: o,
|
|
546
|
+
scrollToIndex: s,
|
|
547
|
+
subscribe: c,
|
|
548
|
+
itemHeight: r,
|
|
549
|
+
sentinelRef: i
|
|
550
|
+
}), [
|
|
551
|
+
e,
|
|
552
|
+
t,
|
|
553
|
+
n,
|
|
554
|
+
a,
|
|
555
|
+
o,
|
|
556
|
+
s,
|
|
557
|
+
c,
|
|
558
|
+
r,
|
|
559
|
+
i
|
|
560
|
+
]);
|
|
561
|
+
}, we = (e, t, r) => {
|
|
562
|
+
let i = n(r), { visible: a } = d(), o = y(!1);
|
|
563
|
+
return _((t) => {
|
|
564
|
+
e.current = t, !(e.current == null || o.current) && (o.current = !0, i.current?.());
|
|
565
|
+
}, [
|
|
566
|
+
i,
|
|
567
|
+
a,
|
|
568
|
+
t
|
|
569
|
+
]);
|
|
570
|
+
}, Te = 100, Ee = (e, t) => {
|
|
571
|
+
let r = n(e), i = y(!1), o = y(null), s = y(null), c = y(null), l = a(t);
|
|
572
|
+
l !== void 0 && t !== l && (i.current = !1);
|
|
573
|
+
let u = _(() => {
|
|
574
|
+
o.current?.disconnect(), o.current = null;
|
|
575
|
+
let e = s.current, t = c.current;
|
|
576
|
+
e == null || t == null || (o.current = new IntersectionObserver((e) => {
|
|
577
|
+
e[0].isIntersecting && !i.current && (i.current = !0, r.current?.());
|
|
578
|
+
}, {
|
|
579
|
+
root: e,
|
|
580
|
+
rootMargin: `0px 0px ${Te}px 0px`,
|
|
581
|
+
threshold: 0
|
|
582
|
+
}), o.current.observe(t));
|
|
583
|
+
}, [r]);
|
|
584
|
+
return {
|
|
585
|
+
containerRef: _((e) => {
|
|
586
|
+
s.current = e, u();
|
|
587
|
+
}, [u]),
|
|
588
|
+
sentinelRef: _((e) => {
|
|
589
|
+
c.current = e, u();
|
|
590
|
+
}, [u])
|
|
591
|
+
};
|
|
592
|
+
}, De = ({ data: e, getItem: t, subscribe: n, children: r, onFetchMore: i, overscan: a = 10, itemHeight: o = 36 }) => {
|
|
593
|
+
let s = y(null), c = we(s, e.length > 0, i), l = _e({
|
|
594
|
+
count: e.length,
|
|
595
|
+
getScrollElement: () => s.current,
|
|
596
|
+
estimateSize: () => o,
|
|
597
|
+
overscan: a,
|
|
598
|
+
onChange: _((t) => {
|
|
599
|
+
let n = t.getVirtualItems();
|
|
600
|
+
n.length > 0 && n[n.length - 1].index === e.length - 1 && i?.();
|
|
601
|
+
}, [e.length, i])
|
|
602
|
+
}), u = l.getVirtualItems();
|
|
603
|
+
return /* @__PURE__ */ S(E, {
|
|
604
|
+
value: v(() => ({
|
|
605
|
+
ref: c,
|
|
606
|
+
getItem: t,
|
|
607
|
+
data: e,
|
|
608
|
+
subscribe: n,
|
|
609
|
+
getTotalSize: () => l.getTotalSize(),
|
|
610
|
+
getItems: () => u.map(({ index: t, start: n }) => ({
|
|
611
|
+
key: e[t],
|
|
612
|
+
index: t,
|
|
613
|
+
translate: n
|
|
614
|
+
})),
|
|
615
|
+
itemHeight: o
|
|
616
|
+
}), [
|
|
617
|
+
c,
|
|
618
|
+
l,
|
|
619
|
+
e,
|
|
620
|
+
t,
|
|
621
|
+
o,
|
|
622
|
+
u
|
|
623
|
+
]),
|
|
624
|
+
children: /* @__PURE__ */ S(be, {
|
|
625
|
+
value: v(() => ({
|
|
626
|
+
ref: c,
|
|
627
|
+
getItem: t,
|
|
628
|
+
scrollToIndex: (e) => l.scrollToIndex(e),
|
|
629
|
+
subscribe: n
|
|
630
|
+
}), [
|
|
631
|
+
c,
|
|
632
|
+
l,
|
|
633
|
+
t,
|
|
634
|
+
n
|
|
635
|
+
]),
|
|
636
|
+
children: r
|
|
637
|
+
})
|
|
638
|
+
});
|
|
639
|
+
}, Oe = ({ data: e, getItem: t, subscribe: n, children: r, onFetchMore: a, itemHeight: o }) => {
|
|
640
|
+
let s = y(null), c = e.length > 0, l = _((e, t) => {
|
|
641
|
+
let n = s.current?.children[0];
|
|
642
|
+
if (n == null) return;
|
|
643
|
+
let r = t === "top" ? 1 : -1, i, a = e + r;
|
|
644
|
+
i = m.contains({
|
|
645
|
+
lower: 0,
|
|
646
|
+
upper: n.children.length
|
|
647
|
+
}, a) ? e + r : e, n.children[i]?.scrollIntoView({
|
|
648
|
+
block: "nearest",
|
|
649
|
+
inline: "nearest",
|
|
650
|
+
behavior: "smooth"
|
|
651
|
+
});
|
|
652
|
+
}, []), u = we(s, c, a), { containerRef: d, sentinelRef: f } = Ee(a, e.length), p = i(u, d), h = v(() => e.map((e, t) => ({
|
|
653
|
+
key: e,
|
|
654
|
+
index: t
|
|
655
|
+
})), [e]);
|
|
656
|
+
return /* @__PURE__ */ S(E, {
|
|
657
|
+
value: v(() => ({
|
|
658
|
+
ref: p,
|
|
659
|
+
getItem: t,
|
|
660
|
+
data: e,
|
|
661
|
+
subscribe: n,
|
|
662
|
+
getTotalSize: () => void 0,
|
|
663
|
+
getItems: () => h,
|
|
664
|
+
itemHeight: o,
|
|
665
|
+
sentinelRef: f
|
|
666
|
+
}), [
|
|
667
|
+
p,
|
|
668
|
+
e,
|
|
669
|
+
t,
|
|
670
|
+
n,
|
|
671
|
+
o,
|
|
672
|
+
f,
|
|
673
|
+
h
|
|
674
|
+
]),
|
|
675
|
+
children: /* @__PURE__ */ S(be, {
|
|
676
|
+
value: v(() => ({
|
|
677
|
+
ref: p,
|
|
678
|
+
getItem: t,
|
|
679
|
+
scrollToIndex: l,
|
|
680
|
+
subscribe: n
|
|
681
|
+
}), [
|
|
682
|
+
p,
|
|
683
|
+
t,
|
|
684
|
+
n,
|
|
685
|
+
l
|
|
686
|
+
]),
|
|
687
|
+
children: r
|
|
688
|
+
})
|
|
689
|
+
});
|
|
690
|
+
}, ke = ({ virtual: e = !1, ...t }) => S(e ? De : Oe, { ...t }), Ae = g(ke), k = ({ itemKey: e, className: t, index: n, el: r, draggingOver: i = !1, rightAligned: a = !1, highlightHovered: s = !1, selected: c = !1, translate: d, onSelect: p, onClick: m, hovered: h, style: g, ..._ }) => /* @__PURE__ */ S(l, {
|
|
691
|
+
el: r,
|
|
692
|
+
defaultEl: "div",
|
|
693
|
+
id: e.toString(),
|
|
694
|
+
variant: "text",
|
|
695
|
+
onClick: (t) => {
|
|
696
|
+
p?.(e), m?.(t);
|
|
697
|
+
},
|
|
698
|
+
className: o(t, f, c && u, h && o.M("hovered"), a && o.M("right-aligned"), s && o.M("highlight-hover"), i && o.M("dragging-over"), o.BE("list", "item"), o.selected(c)),
|
|
699
|
+
style: {
|
|
700
|
+
position: d == null ? "relative" : "absolute",
|
|
701
|
+
transform: `translateY(${d}px)`,
|
|
702
|
+
...g
|
|
703
|
+
},
|
|
704
|
+
square: !1,
|
|
705
|
+
..._
|
|
706
|
+
}), je = g(({ className: e, children: t, emptyContent: n, displayItems: r, style: i, direction: a, x: l, y: u, ...d }) => {
|
|
707
|
+
let { ref: f, getItems: p, getTotalSize: m, data: h, itemHeight: g, sentinelRef: _ } = O(), v = p(), y = n, b = h.length > 0;
|
|
708
|
+
b && (y = /* @__PURE__ */ ee("div", {
|
|
709
|
+
className: o.BE("list", "virtualizer"),
|
|
710
|
+
style: { minHeight: m() },
|
|
711
|
+
children: [v.map(({ key: e, index: n, translate: r }) => t({
|
|
712
|
+
key: e,
|
|
713
|
+
index: n,
|
|
714
|
+
itemKey: e,
|
|
715
|
+
translate: r
|
|
716
|
+
})), _ != null && /* @__PURE__ */ S("div", {
|
|
717
|
+
ref: _,
|
|
718
|
+
className: o.BE("list", "sentinel"),
|
|
719
|
+
"aria-hidden": "true"
|
|
720
|
+
})]
|
|
721
|
+
}));
|
|
722
|
+
let x;
|
|
723
|
+
g != null && r != null && isFinite(r) && b && (x = Math.min(r, v.length) * g + 1);
|
|
724
|
+
let C = s(a, l, u);
|
|
725
|
+
return /* @__PURE__ */ S(c, {
|
|
726
|
+
gap: 0,
|
|
727
|
+
ref: f,
|
|
728
|
+
className: o(e, o.BE("list", "items"), !b && o.BEM("list", "items", "empty")),
|
|
729
|
+
style: {
|
|
730
|
+
height: x,
|
|
731
|
+
...i
|
|
732
|
+
},
|
|
733
|
+
full: C,
|
|
734
|
+
direction: C,
|
|
735
|
+
...d,
|
|
736
|
+
children: y
|
|
737
|
+
});
|
|
738
|
+
}), A = 10, Me = ({ offset: e, searchTerm: t = "", ...n }, r = A) => ({
|
|
739
|
+
...n,
|
|
740
|
+
offset: (e ?? -r) + r,
|
|
741
|
+
limit: r,
|
|
742
|
+
searchTerm: t
|
|
743
|
+
}), Ne = (e, t, n = A) => ({
|
|
744
|
+
...e,
|
|
745
|
+
searchTerm: t,
|
|
746
|
+
offset: 0,
|
|
747
|
+
limit: n
|
|
748
|
+
}), Pe = ({ retrieve: e, pageSize: t = A }) => {
|
|
749
|
+
let n = _(() => {
|
|
750
|
+
e((e) => Me(e, t), { mode: "append" });
|
|
751
|
+
}, [e, t]), r = _((n) => e((e) => Ne(e, n, t)), [e, t]);
|
|
752
|
+
return v(() => ({
|
|
753
|
+
fetchMore: n,
|
|
754
|
+
search: r
|
|
755
|
+
}), [n, r]);
|
|
756
|
+
}, Fe = ({ first: e, second: t }) => {
|
|
757
|
+
let n = v(() => [...e.data, ...t.data], [e.data, t.data]), r = _((n) => {
|
|
758
|
+
if (Array.isArray(n)) {
|
|
759
|
+
let r = e.getItem?.(n) ?? [], i = t.getItem?.(n) ?? [];
|
|
760
|
+
return [...r, ...i];
|
|
761
|
+
}
|
|
762
|
+
return e.getItem?.(n) ?? t.getItem?.(n);
|
|
763
|
+
}, [e.getItem, t.getItem]), i = _((n, r) => {
|
|
764
|
+
let i = e.subscribe?.(n, r), a = t.subscribe?.(n, r);
|
|
765
|
+
return () => {
|
|
766
|
+
i?.(), a?.();
|
|
767
|
+
};
|
|
768
|
+
}, [e.subscribe, t.subscribe]);
|
|
769
|
+
return v(() => ({
|
|
770
|
+
data: n,
|
|
771
|
+
getItem: r,
|
|
772
|
+
subscribe: i
|
|
773
|
+
}), [
|
|
774
|
+
n,
|
|
775
|
+
r,
|
|
776
|
+
i
|
|
777
|
+
]);
|
|
778
|
+
}, Ie = (e) => {
|
|
779
|
+
let t = _(((t) => {
|
|
780
|
+
if (Array.isArray(t)) {
|
|
781
|
+
let n = new Set(t);
|
|
782
|
+
return e.filter((e) => n.has(e)).map((e) => ({ key: e }));
|
|
783
|
+
}
|
|
784
|
+
let n = e.find((e) => e === t);
|
|
785
|
+
return n ? { key: n } : void 0;
|
|
786
|
+
}), [e]);
|
|
787
|
+
return v(() => ({
|
|
788
|
+
data: e,
|
|
789
|
+
getItem: t
|
|
790
|
+
}), [e, t]);
|
|
791
|
+
}, Le = ({ initialData: e } = {}) => {
|
|
792
|
+
let t = r(() => {
|
|
793
|
+
let t = /* @__PURE__ */ new Map();
|
|
794
|
+
return e?.forEach((e) => t.set(e.key, e)), t;
|
|
795
|
+
}), n = r(() => /* @__PURE__ */ new Map()), i = _((e) => {
|
|
796
|
+
let t = new Set(e);
|
|
797
|
+
n.current.forEach((e, n) => {
|
|
798
|
+
t.has(e) && n();
|
|
799
|
+
});
|
|
800
|
+
}, []), a = _((e) => {
|
|
801
|
+
let n = p.toArray(e), r = n.map((e) => e.key);
|
|
802
|
+
n.forEach((e) => t.current.set(e.key, e)), i(r);
|
|
803
|
+
}, []), o = _((e) => {
|
|
804
|
+
let n = p.toArray(e);
|
|
805
|
+
n.forEach((e) => t.current.delete(e)), i(n);
|
|
806
|
+
}, []), s = _((e, t) => t == null ? () => {} : (n.current.set(e, t), () => {
|
|
807
|
+
n.current.delete(e);
|
|
808
|
+
}), [n]), c = _(((e) => {
|
|
809
|
+
if (e != null) return Array.isArray(e) ? e.map((e) => t.current.get(e)).filter((e) => e != null) : t.current.get(e);
|
|
810
|
+
}), []), l = _((e) => t.current.has(e), []);
|
|
811
|
+
return v(() => ({
|
|
812
|
+
setItem: a,
|
|
813
|
+
deleteItem: o,
|
|
814
|
+
subscribe: s,
|
|
815
|
+
getItem: c,
|
|
816
|
+
hasItem: l
|
|
817
|
+
}), [
|
|
818
|
+
a,
|
|
819
|
+
o,
|
|
820
|
+
s,
|
|
821
|
+
c,
|
|
822
|
+
l
|
|
823
|
+
]);
|
|
824
|
+
};
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region ../node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.mjs
|
|
827
|
+
function j(e) {
|
|
828
|
+
return Array.isArray ? Array.isArray(e) : L(e) === "[object Array]";
|
|
829
|
+
}
|
|
830
|
+
var Re = Infinity;
|
|
831
|
+
function ze(e) {
|
|
832
|
+
if (typeof e == "string") return e;
|
|
833
|
+
let t = e + "";
|
|
834
|
+
return t == "0" && 1 / e == -Re ? "-0" : t;
|
|
835
|
+
}
|
|
836
|
+
function Be(e) {
|
|
837
|
+
return e == null ? "" : ze(e);
|
|
838
|
+
}
|
|
839
|
+
function M(e) {
|
|
840
|
+
return typeof e == "string";
|
|
841
|
+
}
|
|
842
|
+
function N(e) {
|
|
843
|
+
return typeof e == "number";
|
|
844
|
+
}
|
|
845
|
+
function Ve(e) {
|
|
846
|
+
return e === !0 || e === !1 || He(e) && L(e) == "[object Boolean]";
|
|
847
|
+
}
|
|
848
|
+
function P(e) {
|
|
849
|
+
return typeof e == "object";
|
|
850
|
+
}
|
|
851
|
+
function He(e) {
|
|
852
|
+
return P(e) && e !== null;
|
|
853
|
+
}
|
|
854
|
+
function F(e) {
|
|
855
|
+
return e != null;
|
|
856
|
+
}
|
|
857
|
+
function I(e) {
|
|
858
|
+
return !e.trim().length;
|
|
859
|
+
}
|
|
860
|
+
function L(e) {
|
|
861
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
862
|
+
}
|
|
863
|
+
var Ue = "Incorrect 'index' type", We = (e) => `Invalid value for key ${e}`, Ge = (e) => `Pattern length exceeds max of ${e}.`, Ke = (e) => `Missing ${e} property in key`, qe = (e) => `Property 'weight' in key '${e}' must be a positive integer`, R = Object.prototype.hasOwnProperty, Je = class {
|
|
864
|
+
constructor(e) {
|
|
865
|
+
this._keys = [], this._keyMap = {};
|
|
866
|
+
let t = 0;
|
|
867
|
+
e.forEach((e) => {
|
|
868
|
+
let n = z(e);
|
|
869
|
+
this._keys.push(n), this._keyMap[n.id] = n, t += n.weight;
|
|
870
|
+
}), this._keys.forEach((e) => {
|
|
871
|
+
e.weight /= t;
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
get(e) {
|
|
875
|
+
return this._keyMap[e];
|
|
876
|
+
}
|
|
877
|
+
keys() {
|
|
878
|
+
return this._keys;
|
|
879
|
+
}
|
|
880
|
+
toJSON() {
|
|
881
|
+
return JSON.stringify(this._keys);
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
function z(e) {
|
|
885
|
+
let t = null, n = null, r = null, i = 1, a = null;
|
|
886
|
+
if (M(e) || j(e)) r = e, t = Ye(e), n = B(e);
|
|
887
|
+
else {
|
|
888
|
+
if (!R.call(e, "name")) throw Error(Ke("name"));
|
|
889
|
+
let o = e.name;
|
|
890
|
+
if (r = o, R.call(e, "weight") && (i = e.weight, i <= 0)) throw Error(qe(o));
|
|
891
|
+
t = Ye(o), n = B(o), a = e.getFn;
|
|
892
|
+
}
|
|
893
|
+
return {
|
|
894
|
+
path: t,
|
|
895
|
+
id: n,
|
|
896
|
+
weight: i,
|
|
897
|
+
src: r,
|
|
898
|
+
getFn: a
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
function Ye(e) {
|
|
902
|
+
return j(e) ? e : e.split(".");
|
|
903
|
+
}
|
|
904
|
+
function B(e) {
|
|
905
|
+
return j(e) ? e.join(".") : e;
|
|
906
|
+
}
|
|
907
|
+
function Xe(e, t) {
|
|
908
|
+
let n = [], r = !1, i = (e, t, a) => {
|
|
909
|
+
if (F(e)) if (!t[a]) n.push(e);
|
|
910
|
+
else {
|
|
911
|
+
let o = e[t[a]];
|
|
912
|
+
if (!F(o)) return;
|
|
913
|
+
if (a === t.length - 1 && (M(o) || N(o) || Ve(o))) n.push(Be(o));
|
|
914
|
+
else if (j(o)) {
|
|
915
|
+
r = !0;
|
|
916
|
+
for (let e = 0, n = o.length; e < n; e += 1) i(o[e], t, a + 1);
|
|
917
|
+
} else t.length && i(o, t, a + 1);
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
return i(e, M(t) ? t.split(".") : t, 0), r ? n : n[0];
|
|
921
|
+
}
|
|
922
|
+
var Ze = {
|
|
923
|
+
includeMatches: !1,
|
|
924
|
+
findAllMatches: !1,
|
|
925
|
+
minMatchCharLength: 1
|
|
926
|
+
}, Qe = {
|
|
927
|
+
isCaseSensitive: !1,
|
|
928
|
+
ignoreDiacritics: !1,
|
|
929
|
+
includeScore: !1,
|
|
930
|
+
keys: [],
|
|
931
|
+
shouldSort: !0,
|
|
932
|
+
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1
|
|
933
|
+
}, $e = {
|
|
934
|
+
location: 0,
|
|
935
|
+
threshold: .6,
|
|
936
|
+
distance: 100
|
|
937
|
+
}, et = {
|
|
938
|
+
useExtendedSearch: !1,
|
|
939
|
+
getFn: Xe,
|
|
940
|
+
ignoreLocation: !1,
|
|
941
|
+
ignoreFieldNorm: !1,
|
|
942
|
+
fieldNormWeight: 1
|
|
943
|
+
}, V = {
|
|
944
|
+
...Qe,
|
|
945
|
+
...Ze,
|
|
946
|
+
...$e,
|
|
947
|
+
...et
|
|
948
|
+
}, tt = /[^ ]+/g;
|
|
949
|
+
function nt(e = 1, t = 3) {
|
|
950
|
+
let n = /* @__PURE__ */ new Map(), r = 10 ** t;
|
|
951
|
+
return {
|
|
952
|
+
get(t) {
|
|
953
|
+
let i = t.match(tt).length;
|
|
954
|
+
if (n.has(i)) return n.get(i);
|
|
955
|
+
let a = 1 / i ** (.5 * e), o = parseFloat(Math.round(a * r) / r);
|
|
956
|
+
return n.set(i, o), o;
|
|
957
|
+
},
|
|
958
|
+
clear() {
|
|
959
|
+
n.clear();
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
var H = class {
|
|
964
|
+
constructor({ getFn: e = V.getFn, fieldNormWeight: t = V.fieldNormWeight } = {}) {
|
|
965
|
+
this.norm = nt(t, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
|
|
966
|
+
}
|
|
967
|
+
setSources(e = []) {
|
|
968
|
+
this.docs = e;
|
|
969
|
+
}
|
|
970
|
+
setIndexRecords(e = []) {
|
|
971
|
+
this.records = e;
|
|
972
|
+
}
|
|
973
|
+
setKeys(e = []) {
|
|
974
|
+
this.keys = e, this._keysMap = {}, e.forEach((e, t) => {
|
|
975
|
+
this._keysMap[e.id] = t;
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
create() {
|
|
979
|
+
this.isCreated || !this.docs.length || (this.isCreated = !0, M(this.docs[0]) ? this.docs.forEach((e, t) => {
|
|
980
|
+
this._addString(e, t);
|
|
981
|
+
}) : this.docs.forEach((e, t) => {
|
|
982
|
+
this._addObject(e, t);
|
|
983
|
+
}), this.norm.clear());
|
|
984
|
+
}
|
|
985
|
+
add(e) {
|
|
986
|
+
let t = this.size();
|
|
987
|
+
M(e) ? this._addString(e, t) : this._addObject(e, t);
|
|
988
|
+
}
|
|
989
|
+
removeAt(e) {
|
|
990
|
+
this.records.splice(e, 1);
|
|
991
|
+
for (let t = e, n = this.size(); t < n; t += 1) --this.records[t].i;
|
|
992
|
+
}
|
|
993
|
+
getValueForItemAtKeyId(e, t) {
|
|
994
|
+
return e[this._keysMap[t]];
|
|
995
|
+
}
|
|
996
|
+
size() {
|
|
997
|
+
return this.records.length;
|
|
998
|
+
}
|
|
999
|
+
_addString(e, t) {
|
|
1000
|
+
if (!F(e) || I(e)) return;
|
|
1001
|
+
let n = {
|
|
1002
|
+
v: e,
|
|
1003
|
+
i: t,
|
|
1004
|
+
n: this.norm.get(e)
|
|
1005
|
+
};
|
|
1006
|
+
this.records.push(n);
|
|
1007
|
+
}
|
|
1008
|
+
_addObject(e, t) {
|
|
1009
|
+
let n = {
|
|
1010
|
+
i: t,
|
|
1011
|
+
$: {}
|
|
1012
|
+
};
|
|
1013
|
+
this.keys.forEach((t, r) => {
|
|
1014
|
+
let i = t.getFn ? t.getFn(e) : this.getFn(e, t.path);
|
|
1015
|
+
if (F(i)) {
|
|
1016
|
+
if (j(i)) {
|
|
1017
|
+
let e = [], t = [{
|
|
1018
|
+
nestedArrIndex: -1,
|
|
1019
|
+
value: i
|
|
1020
|
+
}];
|
|
1021
|
+
for (; t.length;) {
|
|
1022
|
+
let { nestedArrIndex: n, value: r } = t.pop();
|
|
1023
|
+
if (F(r)) if (M(r) && !I(r)) {
|
|
1024
|
+
let t = {
|
|
1025
|
+
v: r,
|
|
1026
|
+
i: n,
|
|
1027
|
+
n: this.norm.get(r)
|
|
1028
|
+
};
|
|
1029
|
+
e.push(t);
|
|
1030
|
+
} else j(r) && r.forEach((e, n) => {
|
|
1031
|
+
t.push({
|
|
1032
|
+
nestedArrIndex: n,
|
|
1033
|
+
value: e
|
|
1034
|
+
});
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
n.$[r] = e;
|
|
1038
|
+
} else if (M(i) && !I(i)) {
|
|
1039
|
+
let e = {
|
|
1040
|
+
v: i,
|
|
1041
|
+
n: this.norm.get(i)
|
|
1042
|
+
};
|
|
1043
|
+
n.$[r] = e;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
}), this.records.push(n);
|
|
1047
|
+
}
|
|
1048
|
+
toJSON() {
|
|
1049
|
+
return {
|
|
1050
|
+
keys: this.keys,
|
|
1051
|
+
records: this.records
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
function rt(e, t, { getFn: n = V.getFn, fieldNormWeight: r = V.fieldNormWeight } = {}) {
|
|
1056
|
+
let i = new H({
|
|
1057
|
+
getFn: n,
|
|
1058
|
+
fieldNormWeight: r
|
|
1059
|
+
});
|
|
1060
|
+
return i.setKeys(e.map(z)), i.setSources(t), i.create(), i;
|
|
1061
|
+
}
|
|
1062
|
+
function it(e, { getFn: t = V.getFn, fieldNormWeight: n = V.fieldNormWeight } = {}) {
|
|
1063
|
+
let { keys: r, records: i } = e, a = new H({
|
|
1064
|
+
getFn: t,
|
|
1065
|
+
fieldNormWeight: n
|
|
1066
|
+
});
|
|
1067
|
+
return a.setKeys(r), a.setIndexRecords(i), a;
|
|
1068
|
+
}
|
|
1069
|
+
function U(e, { errors: t = 0, currentLocation: n = 0, expectedLocation: r = 0, distance: i = V.distance, ignoreLocation: a = V.ignoreLocation } = {}) {
|
|
1070
|
+
let o = t / e.length;
|
|
1071
|
+
if (a) return o;
|
|
1072
|
+
let s = Math.abs(r - n);
|
|
1073
|
+
return i ? o + s / i : s ? 1 : o;
|
|
1074
|
+
}
|
|
1075
|
+
function at(e = [], t = V.minMatchCharLength) {
|
|
1076
|
+
let n = [], r = -1, i = -1, a = 0;
|
|
1077
|
+
for (let o = e.length; a < o; a += 1) {
|
|
1078
|
+
let o = e[a];
|
|
1079
|
+
o && r === -1 ? r = a : !o && r !== -1 && (i = a - 1, i - r + 1 >= t && n.push([r, i]), r = -1);
|
|
1080
|
+
}
|
|
1081
|
+
return e[a - 1] && a - r >= t && n.push([r, a - 1]), n;
|
|
1082
|
+
}
|
|
1083
|
+
var W = 32;
|
|
1084
|
+
function ot(e, t, n, { location: r = V.location, distance: i = V.distance, threshold: a = V.threshold, findAllMatches: o = V.findAllMatches, minMatchCharLength: s = V.minMatchCharLength, includeMatches: c = V.includeMatches, ignoreLocation: l = V.ignoreLocation } = {}) {
|
|
1085
|
+
if (t.length > W) throw Error(Ge(W));
|
|
1086
|
+
let u = t.length, d = e.length, f = Math.max(0, Math.min(r, d)), p = a, m = f, h = s > 1 || c, g = h ? Array(d) : [], _;
|
|
1087
|
+
for (; (_ = e.indexOf(t, m)) > -1;) {
|
|
1088
|
+
let e = U(t, {
|
|
1089
|
+
currentLocation: _,
|
|
1090
|
+
expectedLocation: f,
|
|
1091
|
+
distance: i,
|
|
1092
|
+
ignoreLocation: l
|
|
1093
|
+
});
|
|
1094
|
+
if (p = Math.min(e, p), m = _ + u, h) {
|
|
1095
|
+
let e = 0;
|
|
1096
|
+
for (; e < u;) g[_ + e] = 1, e += 1;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
m = -1;
|
|
1100
|
+
let v = [], y = 1, b = u + d, x = 1 << u - 1;
|
|
1101
|
+
for (let r = 0; r < u; r += 1) {
|
|
1102
|
+
let a = 0, s = b;
|
|
1103
|
+
for (; a < s;) U(t, {
|
|
1104
|
+
errors: r,
|
|
1105
|
+
currentLocation: f + s,
|
|
1106
|
+
expectedLocation: f,
|
|
1107
|
+
distance: i,
|
|
1108
|
+
ignoreLocation: l
|
|
1109
|
+
}) <= p ? a = s : b = s, s = Math.floor((b - a) / 2 + a);
|
|
1110
|
+
b = s;
|
|
1111
|
+
let c = Math.max(1, f - s + 1), _ = o ? d : Math.min(f + s, d) + u, S = Array(_ + 2);
|
|
1112
|
+
S[_ + 1] = (1 << r) - 1;
|
|
1113
|
+
for (let a = _; a >= c; --a) {
|
|
1114
|
+
let o = a - 1, s = n[e.charAt(o)];
|
|
1115
|
+
if (h && (g[o] = +!!s), S[a] = (S[a + 1] << 1 | 1) & s, r && (S[a] |= (v[a + 1] | v[a]) << 1 | 1 | v[a + 1]), S[a] & x && (y = U(t, {
|
|
1116
|
+
errors: r,
|
|
1117
|
+
currentLocation: o,
|
|
1118
|
+
expectedLocation: f,
|
|
1119
|
+
distance: i,
|
|
1120
|
+
ignoreLocation: l
|
|
1121
|
+
}), y <= p)) {
|
|
1122
|
+
if (p = y, m = o, m <= f) break;
|
|
1123
|
+
c = Math.max(1, 2 * f - m);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
if (U(t, {
|
|
1127
|
+
errors: r + 1,
|
|
1128
|
+
currentLocation: f,
|
|
1129
|
+
expectedLocation: f,
|
|
1130
|
+
distance: i,
|
|
1131
|
+
ignoreLocation: l
|
|
1132
|
+
}) > p) break;
|
|
1133
|
+
v = S;
|
|
1134
|
+
}
|
|
1135
|
+
let S = {
|
|
1136
|
+
isMatch: m >= 0,
|
|
1137
|
+
score: Math.max(.001, y)
|
|
1138
|
+
};
|
|
1139
|
+
if (h) {
|
|
1140
|
+
let e = at(g, s);
|
|
1141
|
+
e.length ? c && (S.indices = e) : S.isMatch = !1;
|
|
1142
|
+
}
|
|
1143
|
+
return S;
|
|
1144
|
+
}
|
|
1145
|
+
function st(e) {
|
|
1146
|
+
let t = {};
|
|
1147
|
+
for (let n = 0, r = e.length; n < r; n += 1) {
|
|
1148
|
+
let i = e.charAt(n);
|
|
1149
|
+
t[i] = (t[i] || 0) | 1 << r - n - 1;
|
|
1150
|
+
}
|
|
1151
|
+
return t;
|
|
1152
|
+
}
|
|
1153
|
+
var G = String.prototype.normalize ? ((e) => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "")) : ((e) => e), ct = class {
|
|
1154
|
+
constructor(e, { location: t = V.location, threshold: n = V.threshold, distance: r = V.distance, includeMatches: i = V.includeMatches, findAllMatches: a = V.findAllMatches, minMatchCharLength: o = V.minMatchCharLength, isCaseSensitive: s = V.isCaseSensitive, ignoreDiacritics: c = V.ignoreDiacritics, ignoreLocation: l = V.ignoreLocation } = {}) {
|
|
1155
|
+
if (this.options = {
|
|
1156
|
+
location: t,
|
|
1157
|
+
threshold: n,
|
|
1158
|
+
distance: r,
|
|
1159
|
+
includeMatches: i,
|
|
1160
|
+
findAllMatches: a,
|
|
1161
|
+
minMatchCharLength: o,
|
|
1162
|
+
isCaseSensitive: s,
|
|
1163
|
+
ignoreDiacritics: c,
|
|
1164
|
+
ignoreLocation: l
|
|
1165
|
+
}, e = s ? e : e.toLowerCase(), e = c ? G(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
|
|
1166
|
+
let u = (e, t) => {
|
|
1167
|
+
this.chunks.push({
|
|
1168
|
+
pattern: e,
|
|
1169
|
+
alphabet: st(e),
|
|
1170
|
+
startIndex: t
|
|
1171
|
+
});
|
|
1172
|
+
}, d = this.pattern.length;
|
|
1173
|
+
if (d > W) {
|
|
1174
|
+
let e = 0, t = d % W, n = d - t;
|
|
1175
|
+
for (; e < n;) u(this.pattern.substr(e, W), e), e += W;
|
|
1176
|
+
if (t) {
|
|
1177
|
+
let e = d - W;
|
|
1178
|
+
u(this.pattern.substr(e), e);
|
|
1179
|
+
}
|
|
1180
|
+
} else u(this.pattern, 0);
|
|
1181
|
+
}
|
|
1182
|
+
searchIn(e) {
|
|
1183
|
+
let { isCaseSensitive: t, ignoreDiacritics: n, includeMatches: r } = this.options;
|
|
1184
|
+
if (e = t ? e : e.toLowerCase(), e = n ? G(e) : e, this.pattern === e) {
|
|
1185
|
+
let t = {
|
|
1186
|
+
isMatch: !0,
|
|
1187
|
+
score: 0
|
|
1188
|
+
};
|
|
1189
|
+
return r && (t.indices = [[0, e.length - 1]]), t;
|
|
1190
|
+
}
|
|
1191
|
+
let { location: i, distance: a, threshold: o, findAllMatches: s, minMatchCharLength: c, ignoreLocation: l } = this.options, u = [], d = 0, f = !1;
|
|
1192
|
+
this.chunks.forEach(({ pattern: t, alphabet: n, startIndex: p }) => {
|
|
1193
|
+
let { isMatch: m, score: h, indices: g } = ot(e, t, n, {
|
|
1194
|
+
location: i + p,
|
|
1195
|
+
distance: a,
|
|
1196
|
+
threshold: o,
|
|
1197
|
+
findAllMatches: s,
|
|
1198
|
+
minMatchCharLength: c,
|
|
1199
|
+
includeMatches: r,
|
|
1200
|
+
ignoreLocation: l
|
|
1201
|
+
});
|
|
1202
|
+
m && (f = !0), d += h, m && g && (u = [...u, ...g]);
|
|
1203
|
+
});
|
|
1204
|
+
let p = {
|
|
1205
|
+
isMatch: f,
|
|
1206
|
+
score: f ? d / this.chunks.length : 1
|
|
1207
|
+
};
|
|
1208
|
+
return f && r && (p.indices = u), p;
|
|
1209
|
+
}
|
|
1210
|
+
}, K = class {
|
|
1211
|
+
constructor(e) {
|
|
1212
|
+
this.pattern = e;
|
|
1213
|
+
}
|
|
1214
|
+
static isMultiMatch(e) {
|
|
1215
|
+
return lt(e, this.multiRegex);
|
|
1216
|
+
}
|
|
1217
|
+
static isSingleMatch(e) {
|
|
1218
|
+
return lt(e, this.singleRegex);
|
|
1219
|
+
}
|
|
1220
|
+
search() {}
|
|
1221
|
+
};
|
|
1222
|
+
function lt(e, t) {
|
|
1223
|
+
let n = e.match(t);
|
|
1224
|
+
return n ? n[1] : null;
|
|
1225
|
+
}
|
|
1226
|
+
var ut = class extends K {
|
|
1227
|
+
constructor(e) {
|
|
1228
|
+
super(e);
|
|
1229
|
+
}
|
|
1230
|
+
static get type() {
|
|
1231
|
+
return "exact";
|
|
1232
|
+
}
|
|
1233
|
+
static get multiRegex() {
|
|
1234
|
+
return /^="(.*)"$/;
|
|
1235
|
+
}
|
|
1236
|
+
static get singleRegex() {
|
|
1237
|
+
return /^=(.*)$/;
|
|
1238
|
+
}
|
|
1239
|
+
search(e) {
|
|
1240
|
+
let t = e === this.pattern;
|
|
1241
|
+
return {
|
|
1242
|
+
isMatch: t,
|
|
1243
|
+
score: t ? 0 : 1,
|
|
1244
|
+
indices: [0, this.pattern.length - 1]
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
}, dt = class extends K {
|
|
1248
|
+
constructor(e) {
|
|
1249
|
+
super(e);
|
|
1250
|
+
}
|
|
1251
|
+
static get type() {
|
|
1252
|
+
return "inverse-exact";
|
|
1253
|
+
}
|
|
1254
|
+
static get multiRegex() {
|
|
1255
|
+
return /^!"(.*)"$/;
|
|
1256
|
+
}
|
|
1257
|
+
static get singleRegex() {
|
|
1258
|
+
return /^!(.*)$/;
|
|
1259
|
+
}
|
|
1260
|
+
search(e) {
|
|
1261
|
+
let t = e.indexOf(this.pattern) === -1;
|
|
1262
|
+
return {
|
|
1263
|
+
isMatch: t,
|
|
1264
|
+
score: t ? 0 : 1,
|
|
1265
|
+
indices: [0, e.length - 1]
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
}, ft = class extends K {
|
|
1269
|
+
constructor(e) {
|
|
1270
|
+
super(e);
|
|
1271
|
+
}
|
|
1272
|
+
static get type() {
|
|
1273
|
+
return "prefix-exact";
|
|
1274
|
+
}
|
|
1275
|
+
static get multiRegex() {
|
|
1276
|
+
return /^\^"(.*)"$/;
|
|
1277
|
+
}
|
|
1278
|
+
static get singleRegex() {
|
|
1279
|
+
return /^\^(.*)$/;
|
|
1280
|
+
}
|
|
1281
|
+
search(e) {
|
|
1282
|
+
let t = e.startsWith(this.pattern);
|
|
1283
|
+
return {
|
|
1284
|
+
isMatch: t,
|
|
1285
|
+
score: t ? 0 : 1,
|
|
1286
|
+
indices: [0, this.pattern.length - 1]
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
}, pt = class extends K {
|
|
1290
|
+
constructor(e) {
|
|
1291
|
+
super(e);
|
|
1292
|
+
}
|
|
1293
|
+
static get type() {
|
|
1294
|
+
return "inverse-prefix-exact";
|
|
1295
|
+
}
|
|
1296
|
+
static get multiRegex() {
|
|
1297
|
+
return /^!\^"(.*)"$/;
|
|
1298
|
+
}
|
|
1299
|
+
static get singleRegex() {
|
|
1300
|
+
return /^!\^(.*)$/;
|
|
1301
|
+
}
|
|
1302
|
+
search(e) {
|
|
1303
|
+
let t = !e.startsWith(this.pattern);
|
|
1304
|
+
return {
|
|
1305
|
+
isMatch: t,
|
|
1306
|
+
score: t ? 0 : 1,
|
|
1307
|
+
indices: [0, e.length - 1]
|
|
1308
|
+
};
|
|
1309
|
+
}
|
|
1310
|
+
}, mt = class extends K {
|
|
1311
|
+
constructor(e) {
|
|
1312
|
+
super(e);
|
|
1313
|
+
}
|
|
1314
|
+
static get type() {
|
|
1315
|
+
return "suffix-exact";
|
|
1316
|
+
}
|
|
1317
|
+
static get multiRegex() {
|
|
1318
|
+
return /^"(.*)"\$$/;
|
|
1319
|
+
}
|
|
1320
|
+
static get singleRegex() {
|
|
1321
|
+
return /^(.*)\$$/;
|
|
1322
|
+
}
|
|
1323
|
+
search(e) {
|
|
1324
|
+
let t = e.endsWith(this.pattern);
|
|
1325
|
+
return {
|
|
1326
|
+
isMatch: t,
|
|
1327
|
+
score: t ? 0 : 1,
|
|
1328
|
+
indices: [e.length - this.pattern.length, e.length - 1]
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
}, ht = class extends K {
|
|
1332
|
+
constructor(e) {
|
|
1333
|
+
super(e);
|
|
1334
|
+
}
|
|
1335
|
+
static get type() {
|
|
1336
|
+
return "inverse-suffix-exact";
|
|
1337
|
+
}
|
|
1338
|
+
static get multiRegex() {
|
|
1339
|
+
return /^!"(.*)"\$$/;
|
|
1340
|
+
}
|
|
1341
|
+
static get singleRegex() {
|
|
1342
|
+
return /^!(.*)\$$/;
|
|
1343
|
+
}
|
|
1344
|
+
search(e) {
|
|
1345
|
+
let t = !e.endsWith(this.pattern);
|
|
1346
|
+
return {
|
|
1347
|
+
isMatch: t,
|
|
1348
|
+
score: t ? 0 : 1,
|
|
1349
|
+
indices: [0, e.length - 1]
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
}, gt = class extends K {
|
|
1353
|
+
constructor(e, { location: t = V.location, threshold: n = V.threshold, distance: r = V.distance, includeMatches: i = V.includeMatches, findAllMatches: a = V.findAllMatches, minMatchCharLength: o = V.minMatchCharLength, isCaseSensitive: s = V.isCaseSensitive, ignoreDiacritics: c = V.ignoreDiacritics, ignoreLocation: l = V.ignoreLocation } = {}) {
|
|
1354
|
+
super(e), this._bitapSearch = new ct(e, {
|
|
1355
|
+
location: t,
|
|
1356
|
+
threshold: n,
|
|
1357
|
+
distance: r,
|
|
1358
|
+
includeMatches: i,
|
|
1359
|
+
findAllMatches: a,
|
|
1360
|
+
minMatchCharLength: o,
|
|
1361
|
+
isCaseSensitive: s,
|
|
1362
|
+
ignoreDiacritics: c,
|
|
1363
|
+
ignoreLocation: l
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
static get type() {
|
|
1367
|
+
return "fuzzy";
|
|
1368
|
+
}
|
|
1369
|
+
static get multiRegex() {
|
|
1370
|
+
return /^"(.*)"$/;
|
|
1371
|
+
}
|
|
1372
|
+
static get singleRegex() {
|
|
1373
|
+
return /^(.*)$/;
|
|
1374
|
+
}
|
|
1375
|
+
search(e) {
|
|
1376
|
+
return this._bitapSearch.searchIn(e);
|
|
1377
|
+
}
|
|
1378
|
+
}, _t = class extends K {
|
|
1379
|
+
constructor(e) {
|
|
1380
|
+
super(e);
|
|
1381
|
+
}
|
|
1382
|
+
static get type() {
|
|
1383
|
+
return "include";
|
|
1384
|
+
}
|
|
1385
|
+
static get multiRegex() {
|
|
1386
|
+
return /^'"(.*)"$/;
|
|
1387
|
+
}
|
|
1388
|
+
static get singleRegex() {
|
|
1389
|
+
return /^'(.*)$/;
|
|
1390
|
+
}
|
|
1391
|
+
search(e) {
|
|
1392
|
+
let t = 0, n, r = [], i = this.pattern.length;
|
|
1393
|
+
for (; (n = e.indexOf(this.pattern, t)) > -1;) t = n + i, r.push([n, t - 1]);
|
|
1394
|
+
let a = !!r.length;
|
|
1395
|
+
return {
|
|
1396
|
+
isMatch: a,
|
|
1397
|
+
score: a ? 0 : 1,
|
|
1398
|
+
indices: r
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
}, q = [
|
|
1402
|
+
ut,
|
|
1403
|
+
_t,
|
|
1404
|
+
ft,
|
|
1405
|
+
pt,
|
|
1406
|
+
ht,
|
|
1407
|
+
mt,
|
|
1408
|
+
dt,
|
|
1409
|
+
gt
|
|
1410
|
+
], vt = q.length, yt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, bt = "|";
|
|
1411
|
+
function xt(e, t = {}) {
|
|
1412
|
+
return e.split(bt).map((e) => {
|
|
1413
|
+
let n = e.trim().split(yt).filter((e) => e && !!e.trim()), r = [];
|
|
1414
|
+
for (let e = 0, i = n.length; e < i; e += 1) {
|
|
1415
|
+
let i = n[e], a = !1, o = -1;
|
|
1416
|
+
for (; !a && ++o < vt;) {
|
|
1417
|
+
let e = q[o], n = e.isMultiMatch(i);
|
|
1418
|
+
n && (r.push(new e(n, t)), a = !0);
|
|
1419
|
+
}
|
|
1420
|
+
if (!a) for (o = -1; ++o < vt;) {
|
|
1421
|
+
let e = q[o], n = e.isSingleMatch(i);
|
|
1422
|
+
if (n) {
|
|
1423
|
+
r.push(new e(n, t));
|
|
1424
|
+
break;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
return r;
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
var St = new Set([gt.type, _t.type]), Ct = class {
|
|
1432
|
+
constructor(e, { isCaseSensitive: t = V.isCaseSensitive, ignoreDiacritics: n = V.ignoreDiacritics, includeMatches: r = V.includeMatches, minMatchCharLength: i = V.minMatchCharLength, ignoreLocation: a = V.ignoreLocation, findAllMatches: o = V.findAllMatches, location: s = V.location, threshold: c = V.threshold, distance: l = V.distance } = {}) {
|
|
1433
|
+
this.query = null, this.options = {
|
|
1434
|
+
isCaseSensitive: t,
|
|
1435
|
+
ignoreDiacritics: n,
|
|
1436
|
+
includeMatches: r,
|
|
1437
|
+
minMatchCharLength: i,
|
|
1438
|
+
findAllMatches: o,
|
|
1439
|
+
ignoreLocation: a,
|
|
1440
|
+
location: s,
|
|
1441
|
+
threshold: c,
|
|
1442
|
+
distance: l
|
|
1443
|
+
}, e = t ? e : e.toLowerCase(), e = n ? G(e) : e, this.pattern = e, this.query = xt(this.pattern, this.options);
|
|
1444
|
+
}
|
|
1445
|
+
static condition(e, t) {
|
|
1446
|
+
return t.useExtendedSearch;
|
|
1447
|
+
}
|
|
1448
|
+
searchIn(e) {
|
|
1449
|
+
let t = this.query;
|
|
1450
|
+
if (!t) return {
|
|
1451
|
+
isMatch: !1,
|
|
1452
|
+
score: 1
|
|
1453
|
+
};
|
|
1454
|
+
let { includeMatches: n, isCaseSensitive: r, ignoreDiacritics: i } = this.options;
|
|
1455
|
+
e = r ? e : e.toLowerCase(), e = i ? G(e) : e;
|
|
1456
|
+
let a = 0, o = [], s = 0;
|
|
1457
|
+
for (let r = 0, i = t.length; r < i; r += 1) {
|
|
1458
|
+
let i = t[r];
|
|
1459
|
+
o.length = 0, a = 0;
|
|
1460
|
+
for (let t = 0, r = i.length; t < r; t += 1) {
|
|
1461
|
+
let r = i[t], { isMatch: c, indices: l, score: u } = r.search(e);
|
|
1462
|
+
if (c) {
|
|
1463
|
+
if (a += 1, s += u, n) {
|
|
1464
|
+
let e = r.constructor.type;
|
|
1465
|
+
St.has(e) ? o = [...o, ...l] : o.push(l);
|
|
1466
|
+
}
|
|
1467
|
+
} else {
|
|
1468
|
+
s = 0, a = 0, o.length = 0;
|
|
1469
|
+
break;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
if (a) {
|
|
1473
|
+
let e = {
|
|
1474
|
+
isMatch: !0,
|
|
1475
|
+
score: s / a
|
|
1476
|
+
};
|
|
1477
|
+
return n && (e.indices = o), e;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
return {
|
|
1481
|
+
isMatch: !1,
|
|
1482
|
+
score: 1
|
|
1483
|
+
};
|
|
1484
|
+
}
|
|
1485
|
+
}, J = [];
|
|
1486
|
+
function wt(...e) {
|
|
1487
|
+
J.push(...e);
|
|
1488
|
+
}
|
|
1489
|
+
function Y(e, t) {
|
|
1490
|
+
for (let n = 0, r = J.length; n < r; n += 1) {
|
|
1491
|
+
let r = J[n];
|
|
1492
|
+
if (r.condition(e, t)) return new r(e, t);
|
|
1493
|
+
}
|
|
1494
|
+
return new ct(e, t);
|
|
1495
|
+
}
|
|
1496
|
+
var X = {
|
|
1497
|
+
AND: "$and",
|
|
1498
|
+
OR: "$or"
|
|
1499
|
+
}, Z = {
|
|
1500
|
+
PATH: "$path",
|
|
1501
|
+
PATTERN: "$val"
|
|
1502
|
+
}, Q = (e) => !!(e[X.AND] || e[X.OR]), Tt = (e) => !!e[Z.PATH], Et = (e) => !j(e) && P(e) && !Q(e), Dt = (e) => ({ [X.AND]: Object.keys(e).map((t) => ({ [t]: e[t] })) });
|
|
1503
|
+
function Ot(e, t, { auto: n = !0 } = {}) {
|
|
1504
|
+
let r = (e) => {
|
|
1505
|
+
let i = Object.keys(e), a = Tt(e);
|
|
1506
|
+
if (!a && i.length > 1 && !Q(e)) return r(Dt(e));
|
|
1507
|
+
if (Et(e)) {
|
|
1508
|
+
let r = a ? e[Z.PATH] : i[0], o = a ? e[Z.PATTERN] : e[r];
|
|
1509
|
+
if (!M(o)) throw Error(We(r));
|
|
1510
|
+
let s = {
|
|
1511
|
+
keyId: B(r),
|
|
1512
|
+
pattern: o
|
|
1513
|
+
};
|
|
1514
|
+
return n && (s.searcher = Y(o, t)), s;
|
|
1515
|
+
}
|
|
1516
|
+
let o = {
|
|
1517
|
+
children: [],
|
|
1518
|
+
operator: i[0]
|
|
1519
|
+
};
|
|
1520
|
+
return i.forEach((t) => {
|
|
1521
|
+
let n = e[t];
|
|
1522
|
+
j(n) && n.forEach((e) => {
|
|
1523
|
+
o.children.push(r(e));
|
|
1524
|
+
});
|
|
1525
|
+
}), o;
|
|
1526
|
+
};
|
|
1527
|
+
return Q(e) || (e = Dt(e)), r(e);
|
|
1528
|
+
}
|
|
1529
|
+
function kt(e, { ignoreFieldNorm: t = V.ignoreFieldNorm }) {
|
|
1530
|
+
e.forEach((e) => {
|
|
1531
|
+
let n = 1;
|
|
1532
|
+
e.matches.forEach(({ key: e, norm: r, score: i }) => {
|
|
1533
|
+
let a = e ? e.weight : null;
|
|
1534
|
+
n *= (i === 0 && a ? 2 ** -52 : i) ** +((a || 1) * (t ? 1 : r));
|
|
1535
|
+
}), e.score = n;
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
function At(e, t) {
|
|
1539
|
+
let n = e.matches;
|
|
1540
|
+
t.matches = [], F(n) && n.forEach((e) => {
|
|
1541
|
+
if (!F(e.indices) || !e.indices.length) return;
|
|
1542
|
+
let { indices: n, value: r } = e, i = {
|
|
1543
|
+
indices: n,
|
|
1544
|
+
value: r
|
|
1545
|
+
};
|
|
1546
|
+
e.key && (i.key = e.key.src), e.idx > -1 && (i.refIndex = e.idx), t.matches.push(i);
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
function jt(e, t) {
|
|
1550
|
+
t.score = e.score;
|
|
1551
|
+
}
|
|
1552
|
+
function Mt(e, t, { includeMatches: n = V.includeMatches, includeScore: r = V.includeScore } = {}) {
|
|
1553
|
+
let i = [];
|
|
1554
|
+
return n && i.push(At), r && i.push(jt), e.map((e) => {
|
|
1555
|
+
let { idx: n } = e, r = {
|
|
1556
|
+
item: t[n],
|
|
1557
|
+
refIndex: n
|
|
1558
|
+
};
|
|
1559
|
+
return i.length && i.forEach((t) => {
|
|
1560
|
+
t(e, r);
|
|
1561
|
+
}), r;
|
|
1562
|
+
});
|
|
1563
|
+
}
|
|
1564
|
+
var $ = class {
|
|
1565
|
+
constructor(e, t = {}, n) {
|
|
1566
|
+
this.options = {
|
|
1567
|
+
...V,
|
|
1568
|
+
...t
|
|
1569
|
+
}, this.options.useExtendedSearch, this._keyStore = new Je(this.options.keys), this.setCollection(e, n);
|
|
1570
|
+
}
|
|
1571
|
+
setCollection(e, t) {
|
|
1572
|
+
if (this._docs = e, t && !(t instanceof H)) throw Error(Ue);
|
|
1573
|
+
this._myIndex = t || rt(this.options.keys, this._docs, {
|
|
1574
|
+
getFn: this.options.getFn,
|
|
1575
|
+
fieldNormWeight: this.options.fieldNormWeight
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
add(e) {
|
|
1579
|
+
F(e) && (this._docs.push(e), this._myIndex.add(e));
|
|
1580
|
+
}
|
|
1581
|
+
remove(e = () => !1) {
|
|
1582
|
+
let t = [];
|
|
1583
|
+
for (let n = 0, r = this._docs.length; n < r; n += 1) {
|
|
1584
|
+
let i = this._docs[n];
|
|
1585
|
+
e(i, n) && (this.removeAt(n), --n, --r, t.push(i));
|
|
1586
|
+
}
|
|
1587
|
+
return t;
|
|
1588
|
+
}
|
|
1589
|
+
removeAt(e) {
|
|
1590
|
+
this._docs.splice(e, 1), this._myIndex.removeAt(e);
|
|
1591
|
+
}
|
|
1592
|
+
getIndex() {
|
|
1593
|
+
return this._myIndex;
|
|
1594
|
+
}
|
|
1595
|
+
search(e, { limit: t = -1 } = {}) {
|
|
1596
|
+
let { includeMatches: n, includeScore: r, shouldSort: i, sortFn: a, ignoreFieldNorm: o } = this.options, s = M(e) ? M(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
|
|
1597
|
+
return kt(s, { ignoreFieldNorm: o }), i && s.sort(a), N(t) && t > -1 && (s = s.slice(0, t)), Mt(s, this._docs, {
|
|
1598
|
+
includeMatches: n,
|
|
1599
|
+
includeScore: r
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
_searchStringList(e) {
|
|
1603
|
+
let t = Y(e, this.options), { records: n } = this._myIndex, r = [];
|
|
1604
|
+
return n.forEach(({ v: e, i: n, n: i }) => {
|
|
1605
|
+
if (!F(e)) return;
|
|
1606
|
+
let { isMatch: a, score: o, indices: s } = t.searchIn(e);
|
|
1607
|
+
a && r.push({
|
|
1608
|
+
item: e,
|
|
1609
|
+
idx: n,
|
|
1610
|
+
matches: [{
|
|
1611
|
+
score: o,
|
|
1612
|
+
value: e,
|
|
1613
|
+
norm: i,
|
|
1614
|
+
indices: s
|
|
1615
|
+
}]
|
|
1616
|
+
});
|
|
1617
|
+
}), r;
|
|
1618
|
+
}
|
|
1619
|
+
_searchLogical(e) {
|
|
1620
|
+
let t = Ot(e, this.options), n = (e, t, r) => {
|
|
1621
|
+
if (!e.children) {
|
|
1622
|
+
let { keyId: n, searcher: i } = e, a = this._findMatches({
|
|
1623
|
+
key: this._keyStore.get(n),
|
|
1624
|
+
value: this._myIndex.getValueForItemAtKeyId(t, n),
|
|
1625
|
+
searcher: i
|
|
1626
|
+
});
|
|
1627
|
+
return a && a.length ? [{
|
|
1628
|
+
idx: r,
|
|
1629
|
+
item: t,
|
|
1630
|
+
matches: a
|
|
1631
|
+
}] : [];
|
|
1632
|
+
}
|
|
1633
|
+
let i = [];
|
|
1634
|
+
for (let a = 0, o = e.children.length; a < o; a += 1) {
|
|
1635
|
+
let o = e.children[a], s = n(o, t, r);
|
|
1636
|
+
if (s.length) i.push(...s);
|
|
1637
|
+
else if (e.operator === X.AND) return [];
|
|
1638
|
+
}
|
|
1639
|
+
return i;
|
|
1640
|
+
}, r = this._myIndex.records, i = {}, a = [];
|
|
1641
|
+
return r.forEach(({ $: e, i: r }) => {
|
|
1642
|
+
if (F(e)) {
|
|
1643
|
+
let o = n(t, e, r);
|
|
1644
|
+
o.length && (i[r] || (i[r] = {
|
|
1645
|
+
idx: r,
|
|
1646
|
+
item: e,
|
|
1647
|
+
matches: []
|
|
1648
|
+
}, a.push(i[r])), o.forEach(({ matches: e }) => {
|
|
1649
|
+
i[r].matches.push(...e);
|
|
1650
|
+
}));
|
|
1651
|
+
}
|
|
1652
|
+
}), a;
|
|
1653
|
+
}
|
|
1654
|
+
_searchObjectList(e) {
|
|
1655
|
+
let t = Y(e, this.options), { keys: n, records: r } = this._myIndex, i = [];
|
|
1656
|
+
return r.forEach(({ $: e, i: r }) => {
|
|
1657
|
+
if (!F(e)) return;
|
|
1658
|
+
let a = [];
|
|
1659
|
+
n.forEach((n, r) => {
|
|
1660
|
+
a.push(...this._findMatches({
|
|
1661
|
+
key: n,
|
|
1662
|
+
value: e[r],
|
|
1663
|
+
searcher: t
|
|
1664
|
+
}));
|
|
1665
|
+
}), a.length && i.push({
|
|
1666
|
+
idx: r,
|
|
1667
|
+
item: e,
|
|
1668
|
+
matches: a
|
|
1669
|
+
});
|
|
1670
|
+
}), i;
|
|
1671
|
+
}
|
|
1672
|
+
_findMatches({ key: e, value: t, searcher: n }) {
|
|
1673
|
+
if (!F(t)) return [];
|
|
1674
|
+
let r = [];
|
|
1675
|
+
if (j(t)) t.forEach(({ v: t, i, n: a }) => {
|
|
1676
|
+
if (!F(t)) return;
|
|
1677
|
+
let { isMatch: o, score: s, indices: c } = n.searchIn(t);
|
|
1678
|
+
o && r.push({
|
|
1679
|
+
score: s,
|
|
1680
|
+
key: e,
|
|
1681
|
+
value: t,
|
|
1682
|
+
idx: i,
|
|
1683
|
+
norm: a,
|
|
1684
|
+
indices: c
|
|
1685
|
+
});
|
|
1686
|
+
});
|
|
1687
|
+
else {
|
|
1688
|
+
let { v: i, n: a } = t, { isMatch: o, score: s, indices: c } = n.searchIn(i);
|
|
1689
|
+
o && r.push({
|
|
1690
|
+
score: s,
|
|
1691
|
+
key: e,
|
|
1692
|
+
value: i,
|
|
1693
|
+
norm: a,
|
|
1694
|
+
indices: c
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
return r;
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
$.version = "7.1.0", $.createIndex = rt, $.parseIndex = it, $.config = V, $.parseQuery = Ot, wt(Ct);
|
|
1701
|
+
//#endregion
|
|
1702
|
+
//#region src/list/useStaticData.ts
|
|
1703
|
+
var Nt = ({ data: e, filter: t, sort: n }) => {
|
|
1704
|
+
let r = v(() => {
|
|
1705
|
+
let r = e;
|
|
1706
|
+
return t != null && (r = r.filter((e) => t(e, {}))), n != null && (r = [...r].sort(n)), r;
|
|
1707
|
+
}, [
|
|
1708
|
+
e,
|
|
1709
|
+
t,
|
|
1710
|
+
n
|
|
1711
|
+
]), i = v(() => r.length === 0 ? null : new $(r, {
|
|
1712
|
+
keys: Object.keys(r[0]),
|
|
1713
|
+
threshold: .3
|
|
1714
|
+
}), [r]), [a, o] = b({}), s = _(((e) => {
|
|
1715
|
+
if (Array.isArray(e)) {
|
|
1716
|
+
let t = new Set(e);
|
|
1717
|
+
return r.filter((e) => t.has(e.key));
|
|
1718
|
+
}
|
|
1719
|
+
return r.find((t) => t.key === e);
|
|
1720
|
+
}), [r]), c = v(() => {
|
|
1721
|
+
let e = r;
|
|
1722
|
+
return a.searchTerm != null && a.searchTerm.length > 0 && i != null && (e = i.search(a.searchTerm).map((e) => e.item), n != null && (e = [...e].sort(n))), {
|
|
1723
|
+
getItem: s,
|
|
1724
|
+
data: e.map((e) => e.key)
|
|
1725
|
+
};
|
|
1726
|
+
}, [
|
|
1727
|
+
r,
|
|
1728
|
+
a,
|
|
1729
|
+
s,
|
|
1730
|
+
i,
|
|
1731
|
+
n
|
|
1732
|
+
]);
|
|
1733
|
+
return v(() => ({
|
|
1734
|
+
...c,
|
|
1735
|
+
retrieve: o
|
|
1736
|
+
}), [c, o]);
|
|
1737
|
+
}, Pt = /* @__PURE__ */ e({
|
|
1738
|
+
BaseFrame: () => ke,
|
|
1739
|
+
Frame: () => Ae,
|
|
1740
|
+
Item: () => k,
|
|
1741
|
+
Items: () => je,
|
|
1742
|
+
createGetItem: () => ve,
|
|
1743
|
+
page: () => Me,
|
|
1744
|
+
search: () => Ne,
|
|
1745
|
+
useCombinedData: () => Fe,
|
|
1746
|
+
useData: () => O,
|
|
1747
|
+
useItem: () => Ce,
|
|
1748
|
+
useKeysData: () => Ie,
|
|
1749
|
+
useMapData: () => Le,
|
|
1750
|
+
usePager: () => Pe,
|
|
1751
|
+
useScroller: () => Se,
|
|
1752
|
+
useStaticData: () => Nt,
|
|
1753
|
+
useUtilContext: () => xe
|
|
1754
|
+
});
|
|
1755
|
+
//#endregion
|
|
1756
|
+
export { je as a, O as c, Pe as i, Ce as l, Nt as n, k as o, Ie as r, Ae as s, Pt as t, Se as u };
|