@synnaxlabs/pluto 0.32.1 → 0.33.1

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.
Files changed (182) hide show
  1. package/dist/{Animated-m1d-q2MY.js → Animated-BJ0Om9zo.js} +2 -2
  2. package/dist/{Animated-vgeFXXXh.cjs → Animated-CmYpn592.cjs} +1 -1
  3. package/dist/{Item-CzgByHQ2.cjs → Item-CPt4Umh0.cjs} +1 -1
  4. package/dist/{Item-AKMko1DZ.js → Item-JN1-gBEw.js} +5 -5
  5. package/dist/{Keyboard-Dy7Q9I4w.cjs → Keyboard-BwzZPKjx.cjs} +1 -1
  6. package/dist/{Keyboard-DWCElMA3.js → Keyboard-CBvQle7r.js} +2 -2
  7. package/dist/{LinePlot-CCzgiKg5.js → LinePlot-CgkhTRJT.js} +3531 -3360
  8. package/dist/LinePlot-oIHuM9Jz.cjs +66 -0
  9. package/dist/Link-mthAKDPf.cjs +1 -0
  10. package/dist/Link-my2OWRXu.js +14 -0
  11. package/dist/{List-CVxaH1Gv.js → List-B1BAwLaq.js} +2 -2
  12. package/dist/{List-C8Cd_qEK.cjs → List-C3bjnukf.cjs} +1 -1
  13. package/dist/{Pack-BrxYNh7B.js → Pack-CxtceW7N.js} +1 -1
  14. package/dist/{Pack-C_SrDA3a.cjs → Pack-uflj5a28.cjs} +1 -1
  15. package/dist/{Text-DwK7WZwz.cjs → Text-BvzGtwCB.cjs} +1 -1
  16. package/dist/{Text-ZWBNDAJX.js → Text-SLn1Qwzw.js} +5 -5
  17. package/dist/{Toggle-BQtgHKds.js → Toggle-CqrGlCW8.js} +14481 -14361
  18. package/dist/Toggle-GvJ5CkHq.cjs +143 -0
  19. package/dist/{Video-DR3tjTFZ.cjs → Video-DKosAU7v.cjs} +1 -1
  20. package/dist/{Video-DdIv_1Yq.js → Video-o34bcpwh.js} +1 -1
  21. package/dist/{aggregator-f5OfPmNc.js → aggregator-B36SA-20.js} +5061 -4512
  22. package/dist/aggregator-CU9VgdUJ.cjs +67 -0
  23. package/dist/align.cjs +1 -1
  24. package/dist/align.js +1 -1
  25. package/dist/button.cjs +1 -1
  26. package/dist/button.js +1 -1
  27. package/dist/color.cjs +1 -1
  28. package/dist/color.js +1 -1
  29. package/dist/css-4MXuPP5v.cjs +1 -0
  30. package/dist/css-C8qHWSpT.js +1085 -0
  31. package/dist/css.cjs +1 -1
  32. package/dist/css.js +2 -2
  33. package/dist/dropdown.cjs +1 -1
  34. package/dist/dropdown.js +1 -1
  35. package/dist/ether.cjs +1 -1
  36. package/dist/ether.js +53 -51
  37. package/dist/{external-BGO9o6o7.js → external-B0o5Z8wI.js} +17 -17
  38. package/dist/external-B5jyXhgU.cjs +1 -0
  39. package/dist/external-B7W7NBGN.cjs +1 -0
  40. package/dist/{external-CR7eRU7I.cjs → external-BBGGwc9H.cjs} +1 -1
  41. package/dist/{external-0qSQW-rW.js → external-BKx-fjB8.js} +2 -2
  42. package/dist/{external-CCY3TmGe.cjs → external-BLnPpmeS.cjs} +1 -1
  43. package/dist/{external-DNl6ut74.cjs → external-BQMz5fJB.cjs} +1 -1
  44. package/dist/{external-BswSNc0P.js → external-BTFW7AEo.js} +2 -2
  45. package/dist/{external-CyqJB_UP.js → external-BT_oycNI.js} +64 -64
  46. package/dist/{external-BVWCSwPk.cjs → external-BvoBhRW8.cjs} +1 -1
  47. package/dist/external-C-xh9EwI.cjs +1 -0
  48. package/dist/{external-2HiPz4gN.cjs → external-CLKqHc4s.cjs} +1 -1
  49. package/dist/{external-Cl_evqYY.cjs → external-CPTY4-IY.cjs} +1 -1
  50. package/dist/{external-Bcj4ayXg.cjs → external-Cb_NFNiX.cjs} +1 -1
  51. package/dist/{external-n_t7VfzS.js → external-Cc1Bqjmm.js} +1 -1
  52. package/dist/{external-BxSZ_pLZ.js → external-Cewuz6Gm.js} +20 -20
  53. package/dist/{external-Cqh9AY74.cjs → external-Crturtt-.cjs} +1 -1
  54. package/dist/{external-BAqZitjw.cjs → external-D6YTf7Kx.cjs} +1 -1
  55. package/dist/{external-CWLnWzN8.js → external-DVhxMa2A.js} +38 -38
  56. package/dist/{external-B22Cd5L_.js → external-DYwzKoQ6.js} +2 -2
  57. package/dist/external-DqwISR2q.js +1191 -0
  58. package/dist/{external-Co3i1qex.js → external-GxvuofB_.js} +12 -12
  59. package/dist/{external-BIcOl3QR.js → external-euVgbl49.js} +4 -4
  60. package/dist/{external-BiVAfJDo.js → external-f7xyI5mJ.js} +4 -4
  61. package/dist/header.cjs +1 -1
  62. package/dist/header.js +1 -1
  63. package/dist/index.cjs +1 -1
  64. package/dist/index.js +2309 -2214
  65. package/dist/input.cjs +1 -1
  66. package/dist/input.js +1 -1
  67. package/dist/list.cjs +1 -1
  68. package/dist/list.js +1 -1
  69. package/dist/menu.cjs +1 -1
  70. package/dist/menu.js +1 -1
  71. package/dist/src/aether/main.d.ts +1 -0
  72. package/dist/src/aether/main.d.ts.map +1 -1
  73. package/dist/src/button/Button.d.ts +8 -2
  74. package/dist/src/button/Button.d.ts.map +1 -1
  75. package/dist/src/button/Link.d.ts.map +1 -1
  76. package/dist/src/button/Toggle.d.ts +1 -1
  77. package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
  78. package/dist/src/form/Form.d.ts +2 -2
  79. package/dist/src/form/Form.d.ts.map +1 -1
  80. package/dist/src/index.d.ts +3 -1
  81. package/dist/src/index.d.ts.map +1 -1
  82. package/dist/src/input/Numeric.d.ts.map +1 -1
  83. package/dist/src/input/types.d.ts +1 -1
  84. package/dist/src/input/types.d.ts.map +1 -1
  85. package/dist/src/memo/proxyMemo.d.ts +1 -1
  86. package/dist/src/memo/proxyMemo.d.ts.map +1 -1
  87. package/dist/src/modal/Modal.d.ts.map +1 -1
  88. package/dist/src/override/factory.d.ts +3 -0
  89. package/dist/src/override/factory.d.ts.map +1 -0
  90. package/dist/src/override/index.d.ts +2 -0
  91. package/dist/src/override/index.d.ts.map +1 -0
  92. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  93. package/dist/src/select/Button.d.ts +1 -1
  94. package/dist/src/select/Button.d.ts.map +1 -1
  95. package/dist/src/select/Multiple.d.ts.map +1 -1
  96. package/dist/src/select/Single.d.ts.map +1 -1
  97. package/dist/src/status/Aggregator.d.ts +2 -6
  98. package/dist/src/status/Aggregator.d.ts.map +1 -1
  99. package/dist/src/status/Circle.d.ts.map +1 -1
  100. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  101. package/dist/src/status/aether/types.d.ts.map +1 -1
  102. package/dist/src/tabs/Tabs.d.ts +8 -8
  103. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  104. package/dist/src/telem/aether/convertSeries.d.ts +2 -2
  105. package/dist/src/telem/aether/convertSeries.d.ts.map +1 -1
  106. package/dist/src/telem/aether/noop.d.ts +2 -1
  107. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  108. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  109. package/dist/src/telem/aether/static.d.ts +2 -2
  110. package/dist/src/telem/client/cache/cache.d.ts +1 -1
  111. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  112. package/dist/src/telem/client/cache/dynamic.d.ts +3 -3
  113. package/dist/src/telem/client/cache/dynamic.d.ts.map +1 -1
  114. package/dist/src/telem/client/cache/static.d.ts +1 -1
  115. package/dist/src/telem/client/cache/static.d.ts.map +1 -1
  116. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  117. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  118. package/dist/src/theming/Provider.d.ts.map +1 -1
  119. package/dist/src/theming/aether/provider.d.ts +5846 -3
  120. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  121. package/dist/src/theming/core/fontString.d.ts +1 -1
  122. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  123. package/dist/src/theming/core/theme.d.ts +9 -0
  124. package/dist/src/theming/core/theme.d.ts.map +1 -1
  125. package/dist/src/theming/css.d.ts.map +1 -1
  126. package/dist/src/triggers/hooks.d.ts +2 -1
  127. package/dist/src/triggers/hooks.d.ts.map +1 -1
  128. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  129. package/dist/src/vis/diagram/aether/Diagram.d.ts +0 -1
  130. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  131. package/dist/src/vis/draw2d/index.d.ts +2 -1
  132. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  133. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  134. package/dist/src/vis/line/aether/line.d.ts +3 -1
  135. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  136. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  137. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  138. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  139. package/dist/src/vis/log/Log.d.ts +12 -0
  140. package/dist/src/vis/log/Log.d.ts.map +1 -0
  141. package/dist/src/vis/log/aether/Log.d.ts +556 -0
  142. package/dist/src/vis/log/aether/Log.d.ts.map +1 -0
  143. package/dist/src/vis/log/aether/index.d.ts +2 -0
  144. package/dist/src/vis/log/aether/index.d.ts.map +1 -0
  145. package/dist/src/vis/log/index.d.ts +2 -0
  146. package/dist/src/vis/log/index.d.ts.map +1 -0
  147. package/dist/src/vis/render/context.d.ts +3 -1
  148. package/dist/src/vis/render/context.d.ts.map +1 -1
  149. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  150. package/dist/src/vis/schematic/primitives/Primitives.d.ts +2 -2
  151. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  152. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  153. package/dist/src/vis/value/aether/value.d.ts +1 -0
  154. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  155. package/dist/src/vis/value/use.d.ts.map +1 -1
  156. package/dist/style.css +1 -1
  157. package/dist/tabs.cjs +1 -1
  158. package/dist/tabs.js +1 -1
  159. package/dist/text.cjs +1 -1
  160. package/dist/text.js +2 -2
  161. package/dist/theming.cjs +1 -1
  162. package/dist/theming.js +2 -2
  163. package/dist/tree.cjs +1 -1
  164. package/dist/tree.js +1 -1
  165. package/dist/triggers.cjs +1 -1
  166. package/dist/triggers.js +1 -1
  167. package/dist/{units-CnA_yWxx.js → units-CmWU_YzJ.js} +1 -1
  168. package/dist/{units-CMXTKjnN.cjs → units-DbfWaeE2.cjs} +1 -1
  169. package/dist/video.cjs +1 -1
  170. package/dist/video.js +1 -1
  171. package/package.json +23 -25
  172. package/dist/LinePlot-BcVyfdeK.cjs +0 -66
  173. package/dist/Link-BLs4o2WZ.js +0 -11
  174. package/dist/Link-DAjbmQEI.cjs +0 -1
  175. package/dist/Toggle-Cu_t9VPe.cjs +0 -143
  176. package/dist/aggregator-q0CY7-QS.cjs +0 -67
  177. package/dist/css-B8RwzK24.js +0 -1042
  178. package/dist/css-LxkguM_s.cjs +0 -1
  179. package/dist/external-1AgJfGUo.cjs +0 -1
  180. package/dist/external-BSbQ1fB2.js +0 -1169
  181. package/dist/external-COZBfuIe.cjs +0 -1
  182. package/dist/external-CV8q9dy8.cjs +0 -1
@@ -1,1169 +0,0 @@
1
- import { a1 as le, au as Ae, ak as Oe, ab as ke, av as Le, a5 as Re, l as Ce, aa as je, aw as $e, ax as ve, a6 as Ne, ay as Fe, az as Te, aA as Pe, aB as De, aC as Ke, ac as We, aD as ze, aE as He, a0 as Ve, aF as Be, aG as Ge, aH as Ue } from "./Toggle-BQtgHKds.js";
2
- import { j as Ye } from "./jsx-runtime-B6kdoens.js";
3
- import { useCallback as Qe } from "react";
4
- import { w as Xe, j as Je } from "./aggregator-f5OfPmNc.js";
5
- import "./css-B8RwzK24.js";
6
- import "./Pack-BrxYNh7B.js";
7
- import { L as Ze } from "./List-CVxaH1Gv.js";
8
- const K = Symbol(), he = Symbol(), Q = Symbol();
9
- let qe = (t, e) => new Proxy(t, e);
10
- const W = Object.getPrototypeOf, te = /* @__PURE__ */ new WeakMap(), X = (t) => t && (te.has(t) ? te.get(t) : W(t) === Object.prototype || W(t) === Array.prototype), se = (t) => typeof t == "object" && t !== null, re = /* @__PURE__ */ new WeakMap(), ue = (t) => t[Q] || t, fe = (t, e, s) => {
11
- if (!X(t)) return t;
12
- const r = ue(t), n = ((c) => Object.isFrozen(c) || Object.values(Object.getOwnPropertyDescriptors(c)).some((o) => !o.writable))(r);
13
- let i = s && s.get(r);
14
- return i && i[1].f === n || (i = ((c, o) => {
15
- const a = { f: o };
16
- let h = !1;
17
- const l = (d, g) => {
18
- if (!h) {
19
- let p = a.a.get(c);
20
- p || (p = /* @__PURE__ */ new Set(), a.a.set(c, p)), g && p.has(K) || p.add(d);
21
- }
22
- }, u = { get: (d, g) => g === Q ? c : (l(g), fe(d[g], a.a, a.c)), has: (d, g) => g === he ? (h = !0, a.a.delete(c), !0) : (l(g), g in d), getOwnPropertyDescriptor: (d, g) => (l(g, !0), Object.getOwnPropertyDescriptor(d, g)), ownKeys: (d) => (l(K), Reflect.ownKeys(d)) };
23
- return o && (u.set = u.deleteProperty = () => !1), [u, a];
24
- })(r, n), i[1].p = qe(n ? ((c) => {
25
- let o = re.get(c);
26
- if (!o) {
27
- if (Array.isArray(c)) o = Array.from(c);
28
- else {
29
- const a = Object.getOwnPropertyDescriptors(c);
30
- Object.values(a).forEach((h) => {
31
- h.configurable = !0;
32
- }), o = Object.create(W(c), a);
33
- }
34
- re.set(c, o);
35
- }
36
- return o;
37
- })(r) : r, i[0]), s && s.set(r, i)), i[1].a = e, i[1].c = s, i[1].p;
38
- }, et = (t, e) => {
39
- const s = Reflect.ownKeys(t), r = Reflect.ownKeys(e);
40
- return s.length !== r.length || s.some((n, i) => n !== r[i]);
41
- }, de = (t, e, s, r) => {
42
- if (Object.is(t, e)) return !1;
43
- if (!se(t) || !se(e)) return !0;
44
- const n = s.get(ue(t));
45
- if (!n) return !0;
46
- if (r) {
47
- const c = r.get(t);
48
- if (c && c.n === e) return c.g;
49
- r.set(t, { n: e, g: !1 });
50
- }
51
- let i = null;
52
- for (const c of n) {
53
- const o = c === K ? et(t, e) : de(t[c], e[c], s, r);
54
- if (o !== !0 && o !== !1 || (i = o), i) break;
55
- }
56
- return i === null && (i = !0), r && r.set(t, { n: e, g: i }), i;
57
- }, tt = (t) => !!X(t) && he in t, J = (t) => X(t) && t[Q] || null, z = (t) => typeof t == "object" && t !== null, ge = (t, e) => {
58
- if (!z(t)) return t;
59
- const s = J(t);
60
- return s !== null ? (tt(t), s) : (e.has(t) || (e.add(t), Object.entries(t).forEach(([r, n]) => {
61
- const i = ge(n, e);
62
- Object.is(i, n) || (t[r] = i);
63
- })), t);
64
- }, N = (t, e, s) => {
65
- if (!z(t) || !z(e)) return;
66
- const r = s.get(J(e) || e);
67
- r && r.forEach((n) => {
68
- N(t[n], e[n], s);
69
- });
70
- }, st = (t, e) => {
71
- var s;
72
- let r = 0;
73
- const n = (s = e == null ? void 0 : e.size) != null ? s : 1, i = [], c = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap();
74
- return (a) => {
75
- const h = J(a) || a, l = c.get(h);
76
- if (l) return N(a, l.o, l.a), l.r;
77
- for (let m = 0; m < n; m += 1) {
78
- const M = i[(r + m) % n];
79
- if (!M) break;
80
- if (!de(M.o, a, M.a, /* @__PURE__ */ new WeakMap())) return c.set(h, M), N(a, M.o, M.a), M.r;
81
- }
82
- const u = /* @__PURE__ */ new WeakMap(), d = fe(a, u, o), g = ge(t(d), /* @__PURE__ */ new Set());
83
- N(a, a, u);
84
- const p = { o: a, r: g, a: u };
85
- return r = (r - 1 + n) % n, i[r] = p, c.set(h, p), g;
86
- };
87
- }, rt = (t, e) => Xe.RUNTIME === "browser" ? st(t, e) : t;
88
- function b(t) {
89
- return Array.isArray ? Array.isArray(t) : Me(t) === "[object Array]";
90
- }
91
- const nt = 1 / 0;
92
- function it(t) {
93
- if (typeof t == "string")
94
- return t;
95
- let e = t + "";
96
- return e == "0" && 1 / t == -nt ? "-0" : e;
97
- }
98
- function ct(t) {
99
- return t == null ? "" : it(t);
100
- }
101
- function S(t) {
102
- return typeof t == "string";
103
- }
104
- function pe(t) {
105
- return typeof t == "number";
106
- }
107
- function ot(t) {
108
- return t === !0 || t === !1 || at(t) && Me(t) == "[object Boolean]";
109
- }
110
- function me(t) {
111
- return typeof t == "object";
112
- }
113
- function at(t) {
114
- return me(t) && t !== null;
115
- }
116
- function y(t) {
117
- return t != null;
118
- }
119
- function D(t) {
120
- return !t.trim().length;
121
- }
122
- function Me(t) {
123
- return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
124
- }
125
- const lt = "Incorrect 'index' type", ht = (t) => `Invalid value for key ${t}`, ut = (t) => `Pattern length exceeds max of ${t}.`, ft = (t) => `Missing ${t} property in key`, dt = (t) => `Property 'weight' in key '${t}' must be a positive integer`, ne = Object.prototype.hasOwnProperty;
126
- class gt {
127
- constructor(e) {
128
- this._keys = [], this._keyMap = {};
129
- let s = 0;
130
- e.forEach((r) => {
131
- let n = ye(r);
132
- this._keys.push(n), this._keyMap[n.id] = n, s += n.weight;
133
- }), this._keys.forEach((r) => {
134
- r.weight /= s;
135
- });
136
- }
137
- get(e) {
138
- return this._keyMap[e];
139
- }
140
- keys() {
141
- return this._keys;
142
- }
143
- toJSON() {
144
- return JSON.stringify(this._keys);
145
- }
146
- }
147
- function ye(t) {
148
- let e = null, s = null, r = null, n = 1, i = null;
149
- if (S(t) || b(t))
150
- r = t, e = ie(t), s = H(t);
151
- else {
152
- if (!ne.call(t, "name"))
153
- throw new Error(ft("name"));
154
- const c = t.name;
155
- if (r = c, ne.call(t, "weight") && (n = t.weight, n <= 0))
156
- throw new Error(dt(c));
157
- e = ie(c), s = H(c), i = t.getFn;
158
- }
159
- return { path: e, id: s, weight: n, src: r, getFn: i };
160
- }
161
- function ie(t) {
162
- return b(t) ? t : t.split(".");
163
- }
164
- function H(t) {
165
- return b(t) ? t.join(".") : t;
166
- }
167
- function pt(t, e) {
168
- let s = [], r = !1;
169
- const n = (i, c, o) => {
170
- if (y(i))
171
- if (!c[o])
172
- s.push(i);
173
- else {
174
- let a = c[o];
175
- const h = i[a];
176
- if (!y(h))
177
- return;
178
- if (o === c.length - 1 && (S(h) || pe(h) || ot(h)))
179
- s.push(ct(h));
180
- else if (b(h)) {
181
- r = !0;
182
- for (let l = 0, u = h.length; l < u; l += 1)
183
- n(h[l], c, o + 1);
184
- } else c.length && n(h, c, o + 1);
185
- }
186
- };
187
- return n(t, S(e) ? e.split(".") : e, 0), r ? s : s[0];
188
- }
189
- const mt = {
190
- // Whether the matches should be included in the result set. When `true`, each record in the result
191
- // set will include the indices of the matched characters.
192
- // These can consequently be used for highlighting purposes.
193
- includeMatches: !1,
194
- // When `true`, the matching function will continue to the end of a search pattern even if
195
- // a perfect match has already been located in the string.
196
- findAllMatches: !1,
197
- // Minimum number of characters that must be matched before a result is considered a match
198
- minMatchCharLength: 1
199
- }, Mt = {
200
- // When `true`, the algorithm continues searching to the end of the input even if a perfect
201
- // match is found before the end of the same input.
202
- isCaseSensitive: !1,
203
- // When true, the matching function will continue to the end of a search pattern even if
204
- includeScore: !1,
205
- // List of properties that will be searched. This also supports nested properties.
206
- keys: [],
207
- // Whether to sort the result list, by score
208
- shouldSort: !0,
209
- // Default sort function: sort by ascending score, ascending index
210
- sortFn: (t, e) => t.score === e.score ? t.idx < e.idx ? -1 : 1 : t.score < e.score ? -1 : 1
211
- }, yt = {
212
- // Approximately where in the text is the pattern expected to be found?
213
- location: 0,
214
- // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
215
- // (of both letters and location), a threshold of '1.0' would match anything.
216
- threshold: 0.6,
217
- // Determines how close the match must be to the fuzzy location (specified above).
218
- // An exact letter match which is 'distance' characters away from the fuzzy location
219
- // would score as a complete mismatch. A distance of '0' requires the match be at
220
- // the exact location specified, a threshold of '1000' would require a perfect match
221
- // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
222
- distance: 100
223
- }, xt = {
224
- // When `true`, it enables the use of unix-like search commands
225
- useExtendedSearch: !1,
226
- // The get function to use when fetching an object's properties.
227
- // The default will search nested paths *ie foo.bar.baz*
228
- getFn: pt,
229
- // When `true`, search will ignore `location` and `distance`, so it won't matter
230
- // where in the string the pattern appears.
231
- // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
232
- ignoreLocation: !1,
233
- // When `true`, the calculation for the relevance score (used for sorting) will
234
- // ignore the field-length norm.
235
- // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
236
- ignoreFieldNorm: !1,
237
- // The weight to determine how much field length norm effects scoring.
238
- fieldNormWeight: 1
239
- };
240
- var f = {
241
- ...Mt,
242
- ...mt,
243
- ...yt,
244
- ...xt
245
- };
246
- const Et = /[^ ]+/g;
247
- function St(t = 1, e = 3) {
248
- const s = /* @__PURE__ */ new Map(), r = Math.pow(10, e);
249
- return {
250
- get(n) {
251
- const i = n.match(Et).length;
252
- if (s.has(i))
253
- return s.get(i);
254
- const c = 1 / Math.pow(i, 0.5 * t), o = parseFloat(Math.round(c * r) / r);
255
- return s.set(i, o), o;
256
- },
257
- clear() {
258
- s.clear();
259
- }
260
- };
261
- }
262
- class Z {
263
- constructor({
264
- getFn: e = f.getFn,
265
- fieldNormWeight: s = f.fieldNormWeight
266
- } = {}) {
267
- this.norm = St(s, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
268
- }
269
- setSources(e = []) {
270
- this.docs = e;
271
- }
272
- setIndexRecords(e = []) {
273
- this.records = e;
274
- }
275
- setKeys(e = []) {
276
- this.keys = e, this._keysMap = {}, e.forEach((s, r) => {
277
- this._keysMap[s.id] = r;
278
- });
279
- }
280
- create() {
281
- this.isCreated || !this.docs.length || (this.isCreated = !0, S(this.docs[0]) ? this.docs.forEach((e, s) => {
282
- this._addString(e, s);
283
- }) : this.docs.forEach((e, s) => {
284
- this._addObject(e, s);
285
- }), this.norm.clear());
286
- }
287
- // Adds a doc to the end of the index
288
- add(e) {
289
- const s = this.size();
290
- S(e) ? this._addString(e, s) : this._addObject(e, s);
291
- }
292
- // Removes the doc at the specified index of the index
293
- removeAt(e) {
294
- this.records.splice(e, 1);
295
- for (let s = e, r = this.size(); s < r; s += 1)
296
- this.records[s].i -= 1;
297
- }
298
- getValueForItemAtKeyId(e, s) {
299
- return e[this._keysMap[s]];
300
- }
301
- size() {
302
- return this.records.length;
303
- }
304
- _addString(e, s) {
305
- if (!y(e) || D(e))
306
- return;
307
- let r = {
308
- v: e,
309
- i: s,
310
- n: this.norm.get(e)
311
- };
312
- this.records.push(r);
313
- }
314
- _addObject(e, s) {
315
- let r = { i: s, $: {} };
316
- this.keys.forEach((n, i) => {
317
- let c = n.getFn ? n.getFn(e) : this.getFn(e, n.path);
318
- if (y(c)) {
319
- if (b(c)) {
320
- let o = [];
321
- const a = [{ nestedArrIndex: -1, value: c }];
322
- for (; a.length; ) {
323
- const { nestedArrIndex: h, value: l } = a.pop();
324
- if (y(l))
325
- if (S(l) && !D(l)) {
326
- let u = {
327
- v: l,
328
- i: h,
329
- n: this.norm.get(l)
330
- };
331
- o.push(u);
332
- } else b(l) && l.forEach((u, d) => {
333
- a.push({
334
- nestedArrIndex: d,
335
- value: u
336
- });
337
- });
338
- }
339
- r.$[i] = o;
340
- } else if (S(c) && !D(c)) {
341
- let o = {
342
- v: c,
343
- n: this.norm.get(c)
344
- };
345
- r.$[i] = o;
346
- }
347
- }
348
- }), this.records.push(r);
349
- }
350
- toJSON() {
351
- return {
352
- keys: this.keys,
353
- records: this.records
354
- };
355
- }
356
- }
357
- function xe(t, e, { getFn: s = f.getFn, fieldNormWeight: r = f.fieldNormWeight } = {}) {
358
- const n = new Z({ getFn: s, fieldNormWeight: r });
359
- return n.setKeys(t.map(ye)), n.setSources(e), n.create(), n;
360
- }
361
- function _t(t, { getFn: e = f.getFn, fieldNormWeight: s = f.fieldNormWeight } = {}) {
362
- const { keys: r, records: n } = t, i = new Z({ getFn: e, fieldNormWeight: s });
363
- return i.setKeys(r), i.setIndexRecords(n), i;
364
- }
365
- function v(t, {
366
- errors: e = 0,
367
- currentLocation: s = 0,
368
- expectedLocation: r = 0,
369
- distance: n = f.distance,
370
- ignoreLocation: i = f.ignoreLocation
371
- } = {}) {
372
- const c = e / t.length;
373
- if (i)
374
- return c;
375
- const o = Math.abs(r - s);
376
- return n ? c + o / n : o ? 1 : c;
377
- }
378
- function bt(t = [], e = f.minMatchCharLength) {
379
- let s = [], r = -1, n = -1, i = 0;
380
- for (let c = t.length; i < c; i += 1) {
381
- let o = t[i];
382
- o && r === -1 ? r = i : !o && r !== -1 && (n = i - 1, n - r + 1 >= e && s.push([r, n]), r = -1);
383
- }
384
- return t[i - 1] && i - r >= e && s.push([r, i - 1]), s;
385
- }
386
- const k = 32;
387
- function wt(t, e, s, {
388
- location: r = f.location,
389
- distance: n = f.distance,
390
- threshold: i = f.threshold,
391
- findAllMatches: c = f.findAllMatches,
392
- minMatchCharLength: o = f.minMatchCharLength,
393
- includeMatches: a = f.includeMatches,
394
- ignoreLocation: h = f.ignoreLocation
395
- } = {}) {
396
- if (e.length > k)
397
- throw new Error(ut(k));
398
- const l = e.length, u = t.length, d = Math.max(0, Math.min(r, u));
399
- let g = i, p = d;
400
- const m = o > 1 || a, M = m ? Array(u) : [];
401
- let _;
402
- for (; (_ = t.indexOf(e, p)) > -1; ) {
403
- let x = v(e, {
404
- currentLocation: _,
405
- expectedLocation: d,
406
- distance: n,
407
- ignoreLocation: h
408
- });
409
- if (g = Math.min(x, g), p = _ + l, m) {
410
- let w = 0;
411
- for (; w < l; )
412
- M[_ + w] = 1, w += 1;
413
- }
414
- }
415
- p = -1;
416
- let L = [], O = 1, j = l + u;
417
- const Ie = 1 << l - 1;
418
- for (let x = 0; x < l; x += 1) {
419
- let w = 0, I = j;
420
- for (; w < I; )
421
- v(e, {
422
- errors: x,
423
- currentLocation: d + I,
424
- expectedLocation: d,
425
- distance: n,
426
- ignoreLocation: h
427
- }) <= g ? w = I : j = I, I = Math.floor((j - w) / 2 + w);
428
- j = I;
429
- let q = Math.max(1, d - I + 1), P = c ? u : Math.min(d + I, u) + l, R = Array(P + 2);
430
- R[P + 1] = (1 << x) - 1;
431
- for (let E = P; E >= q; E -= 1) {
432
- let $ = E - 1, ee = s[t.charAt($)];
433
- if (m && (M[$] = +!!ee), R[E] = (R[E + 1] << 1 | 1) & ee, x && (R[E] |= (L[E + 1] | L[E]) << 1 | 1 | L[E + 1]), R[E] & Ie && (O = v(e, {
434
- errors: x,
435
- currentLocation: $,
436
- expectedLocation: d,
437
- distance: n,
438
- ignoreLocation: h
439
- }), O <= g)) {
440
- if (g = O, p = $, p <= d)
441
- break;
442
- q = Math.max(1, 2 * d - p);
443
- }
444
- }
445
- if (v(e, {
446
- errors: x + 1,
447
- currentLocation: d,
448
- expectedLocation: d,
449
- distance: n,
450
- ignoreLocation: h
451
- }) > g)
452
- break;
453
- L = R;
454
- }
455
- const T = {
456
- isMatch: p >= 0,
457
- // Count exact matches (those with a score of 0) to be "almost" exact
458
- score: Math.max(1e-3, O)
459
- };
460
- if (m) {
461
- const x = bt(M, o);
462
- x.length ? a && (T.indices = x) : T.isMatch = !1;
463
- }
464
- return T;
465
- }
466
- function It(t) {
467
- let e = {};
468
- for (let s = 0, r = t.length; s < r; s += 1) {
469
- const n = t.charAt(s);
470
- e[n] = (e[n] || 0) | 1 << r - s - 1;
471
- }
472
- return e;
473
- }
474
- class Ee {
475
- constructor(e, {
476
- location: s = f.location,
477
- threshold: r = f.threshold,
478
- distance: n = f.distance,
479
- includeMatches: i = f.includeMatches,
480
- findAllMatches: c = f.findAllMatches,
481
- minMatchCharLength: o = f.minMatchCharLength,
482
- isCaseSensitive: a = f.isCaseSensitive,
483
- ignoreLocation: h = f.ignoreLocation
484
- } = {}) {
485
- if (this.options = {
486
- location: s,
487
- threshold: r,
488
- distance: n,
489
- includeMatches: i,
490
- findAllMatches: c,
491
- minMatchCharLength: o,
492
- isCaseSensitive: a,
493
- ignoreLocation: h
494
- }, this.pattern = a ? e : e.toLowerCase(), this.chunks = [], !this.pattern.length)
495
- return;
496
- const l = (d, g) => {
497
- this.chunks.push({
498
- pattern: d,
499
- alphabet: It(d),
500
- startIndex: g
501
- });
502
- }, u = this.pattern.length;
503
- if (u > k) {
504
- let d = 0;
505
- const g = u % k, p = u - g;
506
- for (; d < p; )
507
- l(this.pattern.substr(d, k), d), d += k;
508
- if (g) {
509
- const m = u - k;
510
- l(this.pattern.substr(m), m);
511
- }
512
- } else
513
- l(this.pattern, 0);
514
- }
515
- searchIn(e) {
516
- const { isCaseSensitive: s, includeMatches: r } = this.options;
517
- if (s || (e = e.toLowerCase()), this.pattern === e) {
518
- let p = {
519
- isMatch: !0,
520
- score: 0
521
- };
522
- return r && (p.indices = [[0, e.length - 1]]), p;
523
- }
524
- const {
525
- location: n,
526
- distance: i,
527
- threshold: c,
528
- findAllMatches: o,
529
- minMatchCharLength: a,
530
- ignoreLocation: h
531
- } = this.options;
532
- let l = [], u = 0, d = !1;
533
- this.chunks.forEach(({ pattern: p, alphabet: m, startIndex: M }) => {
534
- const { isMatch: _, score: L, indices: O } = wt(e, p, m, {
535
- location: n + M,
536
- distance: i,
537
- threshold: c,
538
- findAllMatches: o,
539
- minMatchCharLength: a,
540
- includeMatches: r,
541
- ignoreLocation: h
542
- });
543
- _ && (d = !0), u += L, _ && O && (l = [...l, ...O]);
544
- });
545
- let g = {
546
- isMatch: d,
547
- score: d ? u / this.chunks.length : 1
548
- };
549
- return d && r && (g.indices = l), g;
550
- }
551
- }
552
- class A {
553
- constructor(e) {
554
- this.pattern = e;
555
- }
556
- static isMultiMatch(e) {
557
- return ce(e, this.multiRegex);
558
- }
559
- static isSingleMatch(e) {
560
- return ce(e, this.singleRegex);
561
- }
562
- search() {
563
- }
564
- }
565
- function ce(t, e) {
566
- const s = t.match(e);
567
- return s ? s[1] : null;
568
- }
569
- class At extends A {
570
- constructor(e) {
571
- super(e);
572
- }
573
- static get type() {
574
- return "exact";
575
- }
576
- static get multiRegex() {
577
- return /^="(.*)"$/;
578
- }
579
- static get singleRegex() {
580
- return /^=(.*)$/;
581
- }
582
- search(e) {
583
- const s = e === this.pattern;
584
- return {
585
- isMatch: s,
586
- score: s ? 0 : 1,
587
- indices: [0, this.pattern.length - 1]
588
- };
589
- }
590
- }
591
- class Ot extends A {
592
- constructor(e) {
593
- super(e);
594
- }
595
- static get type() {
596
- return "inverse-exact";
597
- }
598
- static get multiRegex() {
599
- return /^!"(.*)"$/;
600
- }
601
- static get singleRegex() {
602
- return /^!(.*)$/;
603
- }
604
- search(e) {
605
- const r = e.indexOf(this.pattern) === -1;
606
- return {
607
- isMatch: r,
608
- score: r ? 0 : 1,
609
- indices: [0, e.length - 1]
610
- };
611
- }
612
- }
613
- class kt extends A {
614
- constructor(e) {
615
- super(e);
616
- }
617
- static get type() {
618
- return "prefix-exact";
619
- }
620
- static get multiRegex() {
621
- return /^\^"(.*)"$/;
622
- }
623
- static get singleRegex() {
624
- return /^\^(.*)$/;
625
- }
626
- search(e) {
627
- const s = e.startsWith(this.pattern);
628
- return {
629
- isMatch: s,
630
- score: s ? 0 : 1,
631
- indices: [0, this.pattern.length - 1]
632
- };
633
- }
634
- }
635
- class Lt extends A {
636
- constructor(e) {
637
- super(e);
638
- }
639
- static get type() {
640
- return "inverse-prefix-exact";
641
- }
642
- static get multiRegex() {
643
- return /^!\^"(.*)"$/;
644
- }
645
- static get singleRegex() {
646
- return /^!\^(.*)$/;
647
- }
648
- search(e) {
649
- const s = !e.startsWith(this.pattern);
650
- return {
651
- isMatch: s,
652
- score: s ? 0 : 1,
653
- indices: [0, e.length - 1]
654
- };
655
- }
656
- }
657
- class Rt extends A {
658
- constructor(e) {
659
- super(e);
660
- }
661
- static get type() {
662
- return "suffix-exact";
663
- }
664
- static get multiRegex() {
665
- return /^"(.*)"\$$/;
666
- }
667
- static get singleRegex() {
668
- return /^(.*)\$$/;
669
- }
670
- search(e) {
671
- const s = e.endsWith(this.pattern);
672
- return {
673
- isMatch: s,
674
- score: s ? 0 : 1,
675
- indices: [e.length - this.pattern.length, e.length - 1]
676
- };
677
- }
678
- }
679
- class Ct extends A {
680
- constructor(e) {
681
- super(e);
682
- }
683
- static get type() {
684
- return "inverse-suffix-exact";
685
- }
686
- static get multiRegex() {
687
- return /^!"(.*)"\$$/;
688
- }
689
- static get singleRegex() {
690
- return /^!(.*)\$$/;
691
- }
692
- search(e) {
693
- const s = !e.endsWith(this.pattern);
694
- return {
695
- isMatch: s,
696
- score: s ? 0 : 1,
697
- indices: [0, e.length - 1]
698
- };
699
- }
700
- }
701
- class Se extends A {
702
- constructor(e, {
703
- location: s = f.location,
704
- threshold: r = f.threshold,
705
- distance: n = f.distance,
706
- includeMatches: i = f.includeMatches,
707
- findAllMatches: c = f.findAllMatches,
708
- minMatchCharLength: o = f.minMatchCharLength,
709
- isCaseSensitive: a = f.isCaseSensitive,
710
- ignoreLocation: h = f.ignoreLocation
711
- } = {}) {
712
- super(e), this._bitapSearch = new Ee(e, {
713
- location: s,
714
- threshold: r,
715
- distance: n,
716
- includeMatches: i,
717
- findAllMatches: c,
718
- minMatchCharLength: o,
719
- isCaseSensitive: a,
720
- ignoreLocation: h
721
- });
722
- }
723
- static get type() {
724
- return "fuzzy";
725
- }
726
- static get multiRegex() {
727
- return /^"(.*)"$/;
728
- }
729
- static get singleRegex() {
730
- return /^(.*)$/;
731
- }
732
- search(e) {
733
- return this._bitapSearch.searchIn(e);
734
- }
735
- }
736
- class _e extends A {
737
- constructor(e) {
738
- super(e);
739
- }
740
- static get type() {
741
- return "include";
742
- }
743
- static get multiRegex() {
744
- return /^'"(.*)"$/;
745
- }
746
- static get singleRegex() {
747
- return /^'(.*)$/;
748
- }
749
- search(e) {
750
- let s = 0, r;
751
- const n = [], i = this.pattern.length;
752
- for (; (r = e.indexOf(this.pattern, s)) > -1; )
753
- s = r + i, n.push([r, s - 1]);
754
- const c = !!n.length;
755
- return {
756
- isMatch: c,
757
- score: c ? 0 : 1,
758
- indices: n
759
- };
760
- }
761
- }
762
- const V = [
763
- At,
764
- _e,
765
- kt,
766
- Lt,
767
- Ct,
768
- Rt,
769
- Ot,
770
- Se
771
- ], oe = V.length, jt = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, $t = "|";
772
- function vt(t, e = {}) {
773
- return t.split($t).map((s) => {
774
- let r = s.trim().split(jt).filter((i) => i && !!i.trim()), n = [];
775
- for (let i = 0, c = r.length; i < c; i += 1) {
776
- const o = r[i];
777
- let a = !1, h = -1;
778
- for (; !a && ++h < oe; ) {
779
- const l = V[h];
780
- let u = l.isMultiMatch(o);
781
- u && (n.push(new l(u, e)), a = !0);
782
- }
783
- if (!a)
784
- for (h = -1; ++h < oe; ) {
785
- const l = V[h];
786
- let u = l.isSingleMatch(o);
787
- if (u) {
788
- n.push(new l(u, e));
789
- break;
790
- }
791
- }
792
- }
793
- return n;
794
- });
795
- }
796
- const Nt = /* @__PURE__ */ new Set([Se.type, _e.type]);
797
- class Ft {
798
- constructor(e, {
799
- isCaseSensitive: s = f.isCaseSensitive,
800
- includeMatches: r = f.includeMatches,
801
- minMatchCharLength: n = f.minMatchCharLength,
802
- ignoreLocation: i = f.ignoreLocation,
803
- findAllMatches: c = f.findAllMatches,
804
- location: o = f.location,
805
- threshold: a = f.threshold,
806
- distance: h = f.distance
807
- } = {}) {
808
- this.query = null, this.options = {
809
- isCaseSensitive: s,
810
- includeMatches: r,
811
- minMatchCharLength: n,
812
- findAllMatches: c,
813
- ignoreLocation: i,
814
- location: o,
815
- threshold: a,
816
- distance: h
817
- }, this.pattern = s ? e : e.toLowerCase(), this.query = vt(this.pattern, this.options);
818
- }
819
- static condition(e, s) {
820
- return s.useExtendedSearch;
821
- }
822
- searchIn(e) {
823
- const s = this.query;
824
- if (!s)
825
- return {
826
- isMatch: !1,
827
- score: 1
828
- };
829
- const { includeMatches: r, isCaseSensitive: n } = this.options;
830
- e = n ? e : e.toLowerCase();
831
- let i = 0, c = [], o = 0;
832
- for (let a = 0, h = s.length; a < h; a += 1) {
833
- const l = s[a];
834
- c.length = 0, i = 0;
835
- for (let u = 0, d = l.length; u < d; u += 1) {
836
- const g = l[u], { isMatch: p, indices: m, score: M } = g.search(e);
837
- if (p) {
838
- if (i += 1, o += M, r) {
839
- const _ = g.constructor.type;
840
- Nt.has(_) ? c = [...c, ...m] : c.push(m);
841
- }
842
- } else {
843
- o = 0, i = 0, c.length = 0;
844
- break;
845
- }
846
- }
847
- if (i) {
848
- let u = {
849
- isMatch: !0,
850
- score: o / i
851
- };
852
- return r && (u.indices = c), u;
853
- }
854
- }
855
- return {
856
- isMatch: !1,
857
- score: 1
858
- };
859
- }
860
- }
861
- const B = [];
862
- function Tt(...t) {
863
- B.push(...t);
864
- }
865
- function G(t, e) {
866
- for (let s = 0, r = B.length; s < r; s += 1) {
867
- let n = B[s];
868
- if (n.condition(t, e))
869
- return new n(t, e);
870
- }
871
- return new Ee(t, e);
872
- }
873
- const F = {
874
- AND: "$and",
875
- OR: "$or"
876
- }, U = {
877
- PATH: "$path",
878
- PATTERN: "$val"
879
- }, Y = (t) => !!(t[F.AND] || t[F.OR]), Pt = (t) => !!t[U.PATH], Dt = (t) => !b(t) && me(t) && !Y(t), ae = (t) => ({
880
- [F.AND]: Object.keys(t).map((e) => ({
881
- [e]: t[e]
882
- }))
883
- });
884
- function be(t, e, { auto: s = !0 } = {}) {
885
- const r = (n) => {
886
- let i = Object.keys(n);
887
- const c = Pt(n);
888
- if (!c && i.length > 1 && !Y(n))
889
- return r(ae(n));
890
- if (Dt(n)) {
891
- const a = c ? n[U.PATH] : i[0], h = c ? n[U.PATTERN] : n[a];
892
- if (!S(h))
893
- throw new Error(ht(a));
894
- const l = {
895
- keyId: H(a),
896
- pattern: h
897
- };
898
- return s && (l.searcher = G(h, e)), l;
899
- }
900
- let o = {
901
- children: [],
902
- operator: i[0]
903
- };
904
- return i.forEach((a) => {
905
- const h = n[a];
906
- b(h) && h.forEach((l) => {
907
- o.children.push(r(l));
908
- });
909
- }), o;
910
- };
911
- return Y(t) || (t = ae(t)), r(t);
912
- }
913
- function Kt(t, { ignoreFieldNorm: e = f.ignoreFieldNorm }) {
914
- t.forEach((s) => {
915
- let r = 1;
916
- s.matches.forEach(({ key: n, norm: i, score: c }) => {
917
- const o = n ? n.weight : null;
918
- r *= Math.pow(
919
- c === 0 && o ? Number.EPSILON : c,
920
- (o || 1) * (e ? 1 : i)
921
- );
922
- }), s.score = r;
923
- });
924
- }
925
- function Wt(t, e) {
926
- const s = t.matches;
927
- e.matches = [], y(s) && s.forEach((r) => {
928
- if (!y(r.indices) || !r.indices.length)
929
- return;
930
- const { indices: n, value: i } = r;
931
- let c = {
932
- indices: n,
933
- value: i
934
- };
935
- r.key && (c.key = r.key.src), r.idx > -1 && (c.refIndex = r.idx), e.matches.push(c);
936
- });
937
- }
938
- function zt(t, e) {
939
- e.score = t.score;
940
- }
941
- function Ht(t, e, {
942
- includeMatches: s = f.includeMatches,
943
- includeScore: r = f.includeScore
944
- } = {}) {
945
- const n = [];
946
- return s && n.push(Wt), r && n.push(zt), t.map((i) => {
947
- const { idx: c } = i, o = {
948
- item: e[c],
949
- refIndex: c
950
- };
951
- return n.length && n.forEach((a) => {
952
- a(i, o);
953
- }), o;
954
- });
955
- }
956
- class C {
957
- constructor(e, s = {}, r) {
958
- this.options = { ...f, ...s }, this.options.useExtendedSearch, this._keyStore = new gt(this.options.keys), this.setCollection(e, r);
959
- }
960
- setCollection(e, s) {
961
- if (this._docs = e, s && !(s instanceof Z))
962
- throw new Error(lt);
963
- this._myIndex = s || xe(this.options.keys, this._docs, {
964
- getFn: this.options.getFn,
965
- fieldNormWeight: this.options.fieldNormWeight
966
- });
967
- }
968
- add(e) {
969
- y(e) && (this._docs.push(e), this._myIndex.add(e));
970
- }
971
- remove(e = () => !1) {
972
- const s = [];
973
- for (let r = 0, n = this._docs.length; r < n; r += 1) {
974
- const i = this._docs[r];
975
- e(i, r) && (this.removeAt(r), r -= 1, n -= 1, s.push(i));
976
- }
977
- return s;
978
- }
979
- removeAt(e) {
980
- this._docs.splice(e, 1), this._myIndex.removeAt(e);
981
- }
982
- getIndex() {
983
- return this._myIndex;
984
- }
985
- search(e, { limit: s = -1 } = {}) {
986
- const {
987
- includeMatches: r,
988
- includeScore: n,
989
- shouldSort: i,
990
- sortFn: c,
991
- ignoreFieldNorm: o
992
- } = this.options;
993
- let a = S(e) ? S(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
994
- return Kt(a, { ignoreFieldNorm: o }), i && a.sort(c), pe(s) && s > -1 && (a = a.slice(0, s)), Ht(a, this._docs, {
995
- includeMatches: r,
996
- includeScore: n
997
- });
998
- }
999
- _searchStringList(e) {
1000
- const s = G(e, this.options), { records: r } = this._myIndex, n = [];
1001
- return r.forEach(({ v: i, i: c, n: o }) => {
1002
- if (!y(i))
1003
- return;
1004
- const { isMatch: a, score: h, indices: l } = s.searchIn(i);
1005
- a && n.push({
1006
- item: i,
1007
- idx: c,
1008
- matches: [{ score: h, value: i, norm: o, indices: l }]
1009
- });
1010
- }), n;
1011
- }
1012
- _searchLogical(e) {
1013
- const s = be(e, this.options), r = (o, a, h) => {
1014
- if (!o.children) {
1015
- const { keyId: u, searcher: d } = o, g = this._findMatches({
1016
- key: this._keyStore.get(u),
1017
- value: this._myIndex.getValueForItemAtKeyId(a, u),
1018
- searcher: d
1019
- });
1020
- return g && g.length ? [
1021
- {
1022
- idx: h,
1023
- item: a,
1024
- matches: g
1025
- }
1026
- ] : [];
1027
- }
1028
- const l = [];
1029
- for (let u = 0, d = o.children.length; u < d; u += 1) {
1030
- const g = o.children[u], p = r(g, a, h);
1031
- if (p.length)
1032
- l.push(...p);
1033
- else if (o.operator === F.AND)
1034
- return [];
1035
- }
1036
- return l;
1037
- }, n = this._myIndex.records, i = {}, c = [];
1038
- return n.forEach(({ $: o, i: a }) => {
1039
- if (y(o)) {
1040
- let h = r(s, o, a);
1041
- h.length && (i[a] || (i[a] = { idx: a, item: o, matches: [] }, c.push(i[a])), h.forEach(({ matches: l }) => {
1042
- i[a].matches.push(...l);
1043
- }));
1044
- }
1045
- }), c;
1046
- }
1047
- _searchObjectList(e) {
1048
- const s = G(e, this.options), { keys: r, records: n } = this._myIndex, i = [];
1049
- return n.forEach(({ $: c, i: o }) => {
1050
- if (!y(c))
1051
- return;
1052
- let a = [];
1053
- r.forEach((h, l) => {
1054
- a.push(
1055
- ...this._findMatches({
1056
- key: h,
1057
- value: c[l],
1058
- searcher: s
1059
- })
1060
- );
1061
- }), a.length && i.push({
1062
- idx: o,
1063
- item: c,
1064
- matches: a
1065
- });
1066
- }), i;
1067
- }
1068
- _findMatches({ key: e, value: s, searcher: r }) {
1069
- if (!y(s))
1070
- return [];
1071
- let n = [];
1072
- if (b(s))
1073
- s.forEach(({ v: i, i: c, n: o }) => {
1074
- if (!y(i))
1075
- return;
1076
- const { isMatch: a, score: h, indices: l } = r.searchIn(i);
1077
- a && n.push({
1078
- score: h,
1079
- key: e,
1080
- value: i,
1081
- idx: c,
1082
- norm: o,
1083
- indices: l
1084
- });
1085
- });
1086
- else {
1087
- const { v: i, n: c } = s, { isMatch: o, score: a, indices: h } = r.searchIn(i);
1088
- o && n.push({ score: a, key: e, value: i, norm: c, indices: h });
1089
- }
1090
- return n;
1091
- }
1092
- }
1093
- C.version = "7.0.0";
1094
- C.createIndex = xe;
1095
- C.parseIndex = _t;
1096
- C.config = f;
1097
- C.parseQuery = be;
1098
- Tt(Ft);
1099
- const Vt = {
1100
- threshold: 0.3
1101
- }, Bt = (t) => (e) => {
1102
- const s = new C(e, {
1103
- keys: Object.keys(e[0]),
1104
- ...Vt,
1105
- ...t
1106
- });
1107
- return {
1108
- type: "fuse",
1109
- page: (r, n) => e.slice(r * n, (r + 1) * n),
1110
- search: (r) => s.search(r).map(({ item: n }) => n),
1111
- retrieve: (r) => e.filter((n) => r.includes(n.key))
1112
- };
1113
- }, Gt = Bt(), Ut = ({
1114
- term: t,
1115
- searcher: e = Gt
1116
- }) => rt(({ data: s }) => typeof e == "function" ? t.length === 0 || (s == null ? void 0 : s.length) === 0 ? { data: s, transformed: !1 } : { data: e(s).search(t), transformed: !0 } : { data: e.search(t), transformed: !0 }), we = ({
1117
- debounce: t = 250,
1118
- value: e,
1119
- onChange: s,
1120
- transformBefore: r
1121
- }) => {
1122
- const [n, i] = Je({
1123
- onChange: s,
1124
- value: e,
1125
- initial: ""
1126
- }), { setTransform: c, deleteTransform: o } = le(), a = Ae(c, t, []), h = Qe(
1127
- (l) => {
1128
- i(l), l.length === 0 ? o("filter") : (r != null && (l = r(l)), a("filter", Ut({ term: l })));
1129
- },
1130
- [i, r]
1131
- );
1132
- return { value: n, onChange: h };
1133
- }, Yt = ({
1134
- children: t = (s) => /* @__PURE__ */ Ye.jsx(Oe, { placeholder: "Filter", ...s }),
1135
- ...e
1136
- }) => t(we(e)), rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1137
- __proto__: null,
1138
- Column: ke,
1139
- ColumnContext: Le,
1140
- Core: Re,
1141
- DataProvider: Ce,
1142
- Filter: Yt,
1143
- Hover: je,
1144
- ItemFrame: $e,
1145
- List: Ze,
1146
- Search: ve,
1147
- Selector: Ne,
1148
- selectValueIsZero: Fe,
1149
- useDataContext: Te,
1150
- useDataUtilContext: le,
1151
- useFilter: we,
1152
- useGetTransformedData: Pe,
1153
- useHoverContext: De,
1154
- useSearch: Ke,
1155
- useSelect: We,
1156
- useSelection: ze,
1157
- useSelectionContext: He,
1158
- useSelectionUtils: Ve,
1159
- useSetSourceData: Be,
1160
- useSourceData: Ge,
1161
- useTransformedData: Ue
1162
- }, Symbol.toStringTag, { value: "Module" }));
1163
- export {
1164
- Yt as F,
1165
- Ut as c,
1166
- rs as e,
1167
- Bt as f,
1168
- rt as p
1169
- };