@indxsearch/intrface 1.0.0 → 1.0.3

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/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
- var dt = Object.defineProperty;
2
- var ht = (r, a, d) => a in r ? dt(r, a, { enumerable: !0, configurable: !0, writable: !0, value: d }) : r[a] = d;
3
- var et = (r, a, d) => ht(r, typeof a != "symbol" ? a + "" : a, d);
1
+ var ht = Object.defineProperty;
2
+ var ft = (r, o, u) => o in r ? ht(r, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : r[o] = u;
3
+ var Ke = (r, o, u) => ft(r, typeof o != "symbol" ? o + "" : o, u);
4
4
  import "@indxsearch/systm/styles.css";
5
- import re, { createContext as ft, useRef as Ne, useState as X, useEffect as me, useCallback as te, useMemo as Ue, useContext as gt, memo as at, Component as mt } from "react";
6
- import { SearchField as pt, Button as xe, FilterPanelBase as ve, ToggleSwitch as ne, Checkbox as tt, Slider as it, InputField as Y, Select as vt, RadioButton as xt } from "@indxsearch/systm";
7
- var Le = { exports: {} }, Ie = {};
5
+ import te, { createContext as gt, useRef as Re, useState as U, useEffect as me, useCallback as ee, useMemo as Be, useContext as mt, memo as ot, Component as pt } from "react";
6
+ import { SearchField as vt, Button as Se, FilterPanelBase as be, ToggleSwitch as ae, Checkbox as et, Slider as at, InputField as Z, Select as xt, RadioButton as bt } from "@indxsearch/systm";
7
+ var qe = { exports: {} }, Oe = {};
8
8
  /**
9
9
  * @license React
10
10
  * react-jsx-runtime.production.js
@@ -14,29 +14,29 @@ var Le = { exports: {} }, Ie = {};
14
14
  * This source code is licensed under the MIT license found in the
15
15
  * LICENSE file in the root directory of this source tree.
16
16
  */
17
- var rt;
18
- function bt() {
19
- if (rt) return Ie;
20
- rt = 1;
21
- var r = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
22
- function d(i, c, v) {
23
- var R = null;
24
- if (v !== void 0 && (R = "" + v), c.key !== void 0 && (R = "" + c.key), "key" in c) {
25
- v = {};
26
- for (var x in c)
27
- x !== "key" && (v[x] = c[x]);
28
- } else v = c;
29
- return c = v.ref, {
17
+ var tt;
18
+ function St() {
19
+ if (tt) return Oe;
20
+ tt = 1;
21
+ var r = Symbol.for("react.transitional.element"), o = Symbol.for("react.fragment");
22
+ function u(i, c, m) {
23
+ var M = null;
24
+ if (m !== void 0 && (M = "" + m), c.key !== void 0 && (M = "" + c.key), "key" in c) {
25
+ m = {};
26
+ for (var p in c)
27
+ p !== "key" && (m[p] = c[p]);
28
+ } else m = c;
29
+ return c = m.ref, {
30
30
  $$typeof: r,
31
31
  type: i,
32
- key: R,
32
+ key: M,
33
33
  ref: c !== void 0 ? c : null,
34
- props: v
34
+ props: m
35
35
  };
36
36
  }
37
- return Ie.Fragment = a, Ie.jsx = d, Ie.jsxs = d, Ie;
37
+ return Oe.Fragment = o, Oe.jsx = u, Oe.jsxs = u, Oe;
38
38
  }
39
- var $e = {};
39
+ var Pe = {};
40
40
  /**
41
41
  * @license React
42
42
  * react-jsx-runtime.development.js
@@ -46,123 +46,124 @@ var $e = {};
46
46
  * This source code is licensed under the MIT license found in the
47
47
  * LICENSE file in the root directory of this source tree.
48
48
  */
49
- var st;
50
- function St() {
51
- return st || (st = 1, process.env.NODE_ENV !== "production" && function() {
49
+ var rt;
50
+ function yt() {
51
+ return rt || (rt = 1, process.env.NODE_ENV !== "production" && (function() {
52
52
  function r(t) {
53
53
  if (t == null) return null;
54
54
  if (typeof t == "function")
55
- return t.$$typeof === G ? null : t.displayName || t.name || null;
55
+ return t.$$typeof === he ? null : t.displayName || t.name || null;
56
56
  if (typeof t == "string") return t;
57
57
  switch (t) {
58
- case p:
58
+ case x:
59
59
  return "Fragment";
60
- case H:
60
+ case f:
61
61
  return "Profiler";
62
- case q:
62
+ case A:
63
63
  return "StrictMode";
64
64
  case W:
65
65
  return "Suspense";
66
- case M:
66
+ case g:
67
67
  return "SuspenseList";
68
- case be:
68
+ case z:
69
69
  return "Activity";
70
70
  }
71
71
  if (typeof t == "object")
72
72
  switch (typeof t.tag == "number" && console.error(
73
73
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
74
74
  ), t.$$typeof) {
75
- case Z:
75
+ case D:
76
76
  return "Portal";
77
- case h:
78
- return (t.displayName || "Context") + ".Provider";
77
+ case C:
78
+ return t.displayName || "Context";
79
79
  case s:
80
80
  return (t._context.displayName || "Context") + ".Consumer";
81
- case E:
82
- var o = t.render;
83
- return t = t.displayName, t || (t = o.displayName || o.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
84
- case m:
85
- return o = t.displayName || null, o !== null ? o : r(t.type) || "Memo";
86
- case le:
87
- o = t._payload, t = t._init;
81
+ case N:
82
+ var a = t.render;
83
+ return t = t.displayName, t || (t = a.displayName || a.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
84
+ case G:
85
+ return a = t.displayName || null, a !== null ? a : r(t.type) || "Memo";
86
+ case de:
87
+ a = t._payload, t = t._init;
88
88
  try {
89
- return r(t(o));
89
+ return r(t(a));
90
90
  } catch {
91
91
  }
92
92
  }
93
93
  return null;
94
94
  }
95
- function a(t) {
95
+ function o(t) {
96
96
  return "" + t;
97
97
  }
98
- function d(t) {
98
+ function u(t) {
99
99
  try {
100
- a(t);
101
- var o = !1;
100
+ o(t);
101
+ var a = !1;
102
102
  } catch {
103
- o = !0;
103
+ a = !0;
104
104
  }
105
- if (o) {
106
- o = console;
107
- var u = o.error, j = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
108
- return u.call(
109
- o,
105
+ if (a) {
106
+ a = console;
107
+ var v = a.error, k = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
108
+ return v.call(
109
+ a,
110
110
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
111
- j
112
- ), a(t);
111
+ k
112
+ ), o(t);
113
113
  }
114
114
  }
115
115
  function i(t) {
116
- if (t === p) return "<>";
117
- if (typeof t == "object" && t !== null && t.$$typeof === le)
116
+ if (t === x) return "<>";
117
+ if (typeof t == "object" && t !== null && t.$$typeof === de)
118
118
  return "<...>";
119
119
  try {
120
- var o = r(t);
121
- return o ? "<" + o + ">" : "<...>";
120
+ var a = r(t);
121
+ return a ? "<" + a + ">" : "<...>";
122
122
  } catch {
123
123
  return "<...>";
124
124
  }
125
125
  }
126
126
  function c() {
127
- var t = se.A;
127
+ var t = T.A;
128
128
  return t === null ? null : t.getOwner();
129
129
  }
130
- function v() {
130
+ function m() {
131
131
  return Error("react-stack-top-frame");
132
132
  }
133
- function R(t) {
134
- if (A.call(t, "key")) {
135
- var o = Object.getOwnPropertyDescriptor(t, "key").get;
136
- if (o && o.isReactWarning) return !1;
133
+ function M(t) {
134
+ if (pe.call(t, "key")) {
135
+ var a = Object.getOwnPropertyDescriptor(t, "key").get;
136
+ if (a && a.isReactWarning) return !1;
137
137
  }
138
138
  return t.key !== void 0;
139
139
  }
140
- function x(t, o) {
141
- function u() {
142
- y || (y = !0, console.error(
140
+ function p(t, a) {
141
+ function v() {
142
+ B || (B = !0, console.error(
143
143
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
144
- o
144
+ a
145
145
  ));
146
146
  }
147
- u.isReactWarning = !0, Object.defineProperty(t, "key", {
148
- get: u,
147
+ v.isReactWarning = !0, Object.defineProperty(t, "key", {
148
+ get: v,
149
149
  configurable: !0
150
150
  });
151
151
  }
152
152
  function n() {
153
153
  var t = r(this.type);
154
- return z[t] || (z[t] = !0, console.error(
154
+ return ve[t] || (ve[t] = !0, console.error(
155
155
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
156
156
  )), t = this.props.ref, t !== void 0 ? t : null;
157
157
  }
158
- function b(t, o, u, j, I, L, ue, oe) {
159
- return u = L.ref, t = {
160
- $$typeof: S,
158
+ function j(t, a, v, k, ie, xe) {
159
+ var _ = v.ref;
160
+ return t = {
161
+ $$typeof: Y,
161
162
  type: t,
162
- key: o,
163
- props: L,
164
- _owner: I
165
- }, (u !== void 0 ? u : null) !== null ? Object.defineProperty(t, "ref", {
163
+ key: a,
164
+ props: v,
165
+ _owner: k
166
+ }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(t, "ref", {
166
167
  enumerable: !1,
167
168
  get: n
168
169
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
@@ -179,151 +180,149 @@ function St() {
179
180
  configurable: !1,
180
181
  enumerable: !1,
181
182
  writable: !0,
182
- value: ue
183
+ value: ie
183
184
  }), Object.defineProperty(t, "_debugTask", {
184
185
  configurable: !1,
185
186
  enumerable: !1,
186
187
  writable: !0,
187
- value: oe
188
+ value: xe
188
189
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
189
190
  }
190
- function O(t, o, u, j, I, L, ue, oe) {
191
- var P = o.children;
192
- if (P !== void 0)
193
- if (j)
194
- if (Se(P)) {
195
- for (j = 0; j < P.length; j++)
196
- w(P[j]);
197
- Object.freeze && Object.freeze(P);
191
+ function I(t, a, v, k, ie, xe) {
192
+ var _ = a.children;
193
+ if (_ !== void 0)
194
+ if (k)
195
+ if (V(_)) {
196
+ for (k = 0; k < _.length; k++)
197
+ E(_[k]);
198
+ Object.freeze && Object.freeze(_);
198
199
  } else
199
200
  console.error(
200
201
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
202
  );
202
- else w(P);
203
- if (A.call(o, "key")) {
204
- P = r(t);
205
- var ae = Object.keys(o).filter(function(T) {
206
- return T !== "key";
203
+ else E(_);
204
+ if (pe.call(a, "key")) {
205
+ _ = r(t);
206
+ var re = Object.keys(a).filter(function(Fe) {
207
+ return Fe !== "key";
207
208
  });
208
- j = 0 < ae.length ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}", f[P + j] || (ae = 0 < ae.length ? "{" + ae.join(": ..., ") + ": ...}" : "{}", console.error(
209
+ k = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", w[_ + k] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
209
210
  `A props object containing a "key" prop is being spread into JSX:
210
211
  let props = %s;
211
212
  <%s {...props} />
212
213
  React keys must be passed directly to JSX without using spread:
213
214
  let props = %s;
214
215
  <%s key={someKey} {...props} />`,
215
- j,
216
- P,
217
- ae,
218
- P
219
- ), f[P + j] = !0);
216
+ k,
217
+ _,
218
+ re,
219
+ _
220
+ ), w[_ + k] = !0);
220
221
  }
221
- if (P = null, u !== void 0 && (d(u), P = "" + u), R(o) && (d(o.key), P = "" + o.key), "key" in o) {
222
- u = {};
223
- for (var ye in o)
224
- ye !== "key" && (u[ye] = o[ye]);
225
- } else u = o;
226
- return P && x(
227
- u,
222
+ if (_ = null, v !== void 0 && (u(v), _ = "" + v), M(a) && (u(a.key), _ = "" + a.key), "key" in a) {
223
+ v = {};
224
+ for (var ye in a)
225
+ ye !== "key" && (v[ye] = a[ye]);
226
+ } else v = a;
227
+ return _ && p(
228
+ v,
228
229
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
229
- ), b(
230
+ ), j(
230
231
  t,
231
- P,
232
- L,
233
- I,
232
+ _,
233
+ v,
234
234
  c(),
235
- u,
236
- ue,
237
- oe
235
+ ie,
236
+ xe
238
237
  );
239
238
  }
240
- function w(t) {
241
- typeof t == "object" && t !== null && t.$$typeof === S && t._store && (t._store.validated = 1);
239
+ function E(t) {
240
+ q(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === de && (t._payload.status === "fulfilled" ? q(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
241
+ }
242
+ function q(t) {
243
+ return typeof t == "object" && t !== null && t.$$typeof === Y;
242
244
  }
243
- var $ = re, S = Symbol.for("react.transitional.element"), Z = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), H = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), h = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), M = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), le = Symbol.for("react.lazy"), be = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), se = $.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, Se = Array.isArray, N = console.createTask ? console.createTask : function() {
245
+ var S = te, Y = Symbol.for("react.transitional.element"), D = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), A = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), C = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), de = Symbol.for("react.lazy"), z = Symbol.for("react.activity"), he = Symbol.for("react.client.reference"), T = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pe = Object.prototype.hasOwnProperty, V = Array.isArray, y = console.createTask ? console.createTask : function() {
244
246
  return null;
245
247
  };
246
- $ = {
247
- "react-stack-bottom-frame": function(t) {
248
+ S = {
249
+ react_stack_bottom_frame: function(t) {
248
250
  return t();
249
251
  }
250
252
  };
251
- var y, z = {}, pe = $["react-stack-bottom-frame"].bind(
252
- $,
253
- v
254
- )(), ce = N(i(v)), f = {};
255
- $e.Fragment = p, $e.jsx = function(t, o, u, j, I) {
256
- var L = 1e4 > se.recentlyCreatedOwnerStacks++;
257
- return O(
253
+ var B, ve = {}, fe = S.react_stack_bottom_frame.bind(
254
+ S,
255
+ m
256
+ )(), h = y(i(m)), w = {};
257
+ Pe.Fragment = x, Pe.jsx = function(t, a, v) {
258
+ var k = 1e4 > T.recentlyCreatedOwnerStacks++;
259
+ return I(
258
260
  t,
259
- o,
260
- u,
261
+ a,
262
+ v,
261
263
  !1,
262
- j,
263
- I,
264
- L ? Error("react-stack-top-frame") : pe,
265
- L ? N(i(t)) : ce
264
+ k ? Error("react-stack-top-frame") : fe,
265
+ k ? y(i(t)) : h
266
266
  );
267
- }, $e.jsxs = function(t, o, u, j, I) {
268
- var L = 1e4 > se.recentlyCreatedOwnerStacks++;
269
- return O(
267
+ }, Pe.jsxs = function(t, a, v) {
268
+ var k = 1e4 > T.recentlyCreatedOwnerStacks++;
269
+ return I(
270
270
  t,
271
- o,
272
- u,
271
+ a,
272
+ v,
273
273
  !0,
274
- j,
275
- I,
276
- L ? Error("react-stack-top-frame") : pe,
277
- L ? N(i(t)) : ce
274
+ k ? Error("react-stack-top-frame") : fe,
275
+ k ? y(i(t)) : h
278
276
  );
279
277
  };
280
- }()), $e;
278
+ })()), Pe;
281
279
  }
282
- var nt;
283
- function yt() {
284
- return nt || (nt = 1, process.env.NODE_ENV === "production" ? Le.exports = bt() : Le.exports = St()), Le.exports;
280
+ var st;
281
+ function jt() {
282
+ return st || (st = 1, process.env.NODE_ENV === "production" ? qe.exports = St() : qe.exports = yt()), qe.exports;
285
283
  }
286
- var e = yt();
287
- const lt = ft(void 0);
288
- function jt(r, a) {
289
- let d;
284
+ var e = jt();
285
+ const it = gt(void 0);
286
+ function Ct(r, o) {
287
+ let u;
290
288
  const i = (...c) => {
291
- clearTimeout(d), d = setTimeout(() => r(...c), a);
289
+ clearTimeout(u), u = setTimeout(() => r(...c), o);
292
290
  };
293
- return i.cancel = () => clearTimeout(d), i;
291
+ return i.cancel = () => clearTimeout(u), i;
294
292
  }
295
- const Gt = ({
293
+ const Xt = ({
296
294
  children: r,
297
- email: a,
298
- password: d,
295
+ email: o,
296
+ password: u,
299
297
  url: i,
300
298
  dataset: c,
301
- allowEmptySearch: v = !1,
302
- maxResults: R = 10,
303
- facetDebounceDelayMillis: x = 500,
299
+ allowEmptySearch: m = !1,
300
+ maxResults: M = 10,
301
+ facetDebounceDelayMillis: p = 500,
304
302
  // debounce faceted searches only
305
303
  enableFacets: n = !0,
306
- coverageDepth: b = 500,
307
- removeDuplicates: O = !0,
308
- enableCoverage: w = !0,
309
- initialCoverageSetup: $ = {},
310
- enableDebugLogs: S = !1
304
+ coverageDepth: j = 500,
305
+ removeDuplicates: I = !0,
306
+ enableCoverage: E = !0,
307
+ initialCoverageSetup: q = {},
308
+ enableDebugLogs: S = !1,
309
+ preAuthenticatedToken: Y
311
310
  }) => {
312
- const Z = Ne(0), p = Ne(void 0), q = Ne(!1), H = Ne(!1), [s, h] = X({
311
+ const D = Re(0), x = Re(void 0), A = Re(!1), f = Re(!1), [s, C] = U({
313
312
  query: "",
314
313
  results: null,
315
314
  isLoading: !1,
316
- resultsSuppressed: !v,
315
+ resultsSuppressed: !m,
317
316
  // Show placeholder if empty search not allowed
318
- facetDebounceDelayMillis: x,
317
+ facetDebounceDelayMillis: p,
319
318
  filters: {},
320
319
  rangeFilters: {},
321
320
  facetStats: {},
322
321
  searchSettings: {
323
- maxNumberOfRecordsToReturn: R,
324
- coverageDepth: b,
325
- enableCoverage: w,
326
- removeDuplicates: O,
322
+ maxNumberOfRecordsToReturn: M,
323
+ coverageDepth: j,
324
+ enableCoverage: E,
325
+ removeDuplicates: I,
327
326
  minimumScore: 0,
328
327
  showScore: !0,
329
328
  placeholderText: "Type to search",
@@ -341,7 +340,7 @@ const Gt = ({
341
340
  coverJoinedWords: !0,
342
341
  coverPrefixSuffix: !0,
343
342
  truncate: !0,
344
- ...$
343
+ ...q
345
344
  // Allow prop-based override
346
345
  }
347
346
  }
@@ -349,109 +348,109 @@ const Gt = ({
349
348
  me(() => {
350
349
  S && console.log("SearchContext mounted on client");
351
350
  }, [S]), me(() => {
352
- h((l) => ({
351
+ C((l) => ({
353
352
  ...l,
354
- facetDebounceDelayMillis: x
353
+ facetDebounceDelayMillis: p
355
354
  }));
356
- }, [x]);
357
- const [E, W] = X(null), [M] = X(n), m = te((l, g = {}) => {
358
- if (!E)
355
+ }, [p]);
356
+ const [N, W] = U(null), [g] = U(n), G = ee((l, d = {}) => {
357
+ if (!N)
359
358
  throw new Error("No authentication token available");
360
359
  return fetch(l, {
361
- ...g,
360
+ ...d,
362
361
  credentials: "include",
363
362
  headers: {
364
- ...g.headers,
365
- Authorization: `Bearer ${E}`
363
+ ...d.headers,
364
+ Authorization: `Bearer ${N}`
366
365
  }
367
366
  });
368
- }, [E]), [le, be] = X([]), [G, se] = X([]), [A, Se] = X([]), [N, y] = X(!0), [z, pe] = X({}), [ce, f] = X({}), [t, o] = X({}), [u, j] = X(""), [I, L] = X(""), [ue, oe] = X({}), P = Ne(null), ae = te((l) => {
369
- h((g) => ({
370
- ...g,
367
+ }, [N]), [de, z] = U([]), [he, T] = U([]), [pe, V] = U([]), [y, B] = U(!0), [ve, fe] = U({}), [h, w] = U({}), [t, a] = U({}), [v, k] = U(""), [ie, xe] = U(""), [_, re] = U({}), ye = Re(null), Fe = ee((l) => {
368
+ C((d) => ({
369
+ ...d,
371
370
  query: l,
372
371
  filters: {},
373
372
  rangeFilters: {}
374
373
  }));
375
- }, []), ye = te((l) => {
376
- h((g) => ({
377
- ...g,
374
+ }, []), O = ee((l) => {
375
+ C((d) => ({
376
+ ...d,
378
377
  facetDebounceDelayMillis: l
379
378
  }));
380
- }, []), T = te((l) => {
381
- h((g) => ({
382
- ...g,
379
+ }, []), P = ee((l) => {
380
+ C((d) => ({
381
+ ...d,
383
382
  searchSettings: {
384
- ...g.searchSettings,
383
+ ...d.searchSettings,
385
384
  ...l,
386
385
  coverageSetup: {
387
- ...g.searchSettings.coverageSetup,
386
+ ...d.searchSettings.coverageSetup,
388
387
  ...l.coverageSetup || {}
389
388
  }
390
389
  }
391
390
  }));
392
- }, []), _ = te((l, g) => {
393
- h((C) => {
394
- const k = { ...C.filters }, D = k[l] || [], U = D.includes(g) ? D.filter((B) => B !== g) : [...D, g];
395
- return U.length ? k[l] = U : delete k[l], {
396
- ...C,
397
- filters: k
391
+ }, []), X = ee((l, d) => {
392
+ C((b) => {
393
+ const F = { ...b.filters }, H = F[l] || [], J = H.includes(d) ? H.filter((L) => L !== d) : [...H, d];
394
+ return J.length ? F[l] = J : delete F[l], {
395
+ ...b,
396
+ filters: F
398
397
  };
399
398
  });
400
- }, []), J = te((l, g, C) => {
401
- h((k) => ({
402
- ...k,
399
+ }, []), Me = ee((l, d, b) => {
400
+ C((F) => ({
401
+ ...F,
403
402
  rangeFilters: {
404
- ...k.rangeFilters,
405
- [l]: { min: g, max: C }
403
+ ...F.rangeFilters,
404
+ [l]: { min: d, max: b }
406
405
  }
407
406
  }));
408
- }, []), Ae = te(() => {
409
- h((l) => ({
407
+ }, []), Ne = ee(() => {
408
+ C((l) => ({
410
409
  ...l,
411
410
  filters: {},
412
411
  rangeFilters: {}
413
412
  }));
414
- }, []), _e = te((l, g) => {
415
- h((C) => {
416
- const k = { ...C.filters }, D = { ...C.rangeFilters };
417
- if (g !== void 0) {
418
- const B = (k[l] || []).filter((K) => K !== g);
419
- B.length > 0 ? k[l] = B : delete k[l];
413
+ }, []), _e = ee((l, d) => {
414
+ C((b) => {
415
+ const F = { ...b.filters }, H = { ...b.rangeFilters };
416
+ if (d !== void 0) {
417
+ const L = (F[l] || []).filter((ce) => ce !== d);
418
+ L.length > 0 ? F[l] = L : delete F[l];
420
419
  } else
421
- delete D[l];
420
+ delete H[l];
422
421
  return {
423
- ...C,
424
- filters: k,
425
- rangeFilters: D
422
+ ...b,
423
+ filters: F,
424
+ rangeFilters: H
426
425
  };
427
426
  });
428
- }, []), Ve = te((l, g) => {
429
- h((C) => ({
430
- ...C,
427
+ }, []), ze = ee((l, d) => {
428
+ C((b) => ({
429
+ ...b,
431
430
  sortBy: l || void 0,
432
- sortAscending: l ? g : void 0
431
+ sortAscending: l ? d : void 0
433
432
  }));
434
- }, []), We = te(async (l, g, C) => {
433
+ }, []), He = ee(async (l, d, b) => {
435
434
  if (l.length === 0) return null;
436
435
  if (l.length === 1) return l[0];
437
- let k = l[0];
438
- for (let D = 1; D < l.length; D++) {
439
- const U = await m(`${g}/api/CombineFilters/${C}`, {
436
+ let F = l[0];
437
+ for (let H = 1; H < l.length; H++) {
438
+ const J = await G(`${d}/api/CombineFilters/${b}`, {
440
439
  // Combine the current filter with the next filter
441
440
  method: "PUT",
442
441
  headers: {
443
442
  "Content-Type": "application/json"
444
443
  },
445
- body: JSON.stringify({ A: k, B: l[D], useAndOperation: !0 })
444
+ body: JSON.stringify({ A: F, B: l[H], useAndOperation: !0 })
446
445
  });
447
- if (!U.ok) {
448
- const B = await U.json();
449
- throw console.error("CombineFilters failed:", B), new Error("CombineFilters failed");
446
+ if (!J.ok) {
447
+ const L = await J.json();
448
+ throw console.error("CombineFilters failed:", L), new Error("CombineFilters failed");
450
449
  }
451
- k = await U.json();
450
+ F = await J.json();
452
451
  }
453
- return k;
454
- }, [m]), De = s.searchSettings.maxNumberOfRecordsToReturn, Xe = s.searchSettings.enableCoverage, Je = s.searchSettings.removeDuplicates, Qe = s.searchSettings.coverageDepth, Ye = s.searchSettings.minimumScore, qe = s.sortBy, Be = s.sortAscending, Ze = Ue(() => s.searchSettings.coverageSetup, [
452
+ return F;
453
+ }, [G]), Le = s.searchSettings.maxNumberOfRecordsToReturn, Ue = s.searchSettings.enableCoverage, Ge = s.searchSettings.removeDuplicates, Xe = s.searchSettings.coverageDepth, Je = s.searchSettings.minimumScore, $e = s.sortBy, Ie = s.sortAscending, Qe = Be(() => s.searchSettings.coverageSetup, [
455
454
  s.searchSettings.coverageSetup.levenshteinMaxWordSize,
456
455
  s.searchSettings.coverageSetup.minWordSize,
457
456
  s.searchSettings.coverageSetup.coverageMinWordHitsAbs,
@@ -464,121 +463,121 @@ const Gt = ({
464
463
  s.searchSettings.coverageSetup.coverJoinedWords,
465
464
  s.searchSettings.coverageSetup.coverPrefixSuffix,
466
465
  s.searchSettings.coverageSetup.truncate
467
- ]), Ke = te(
466
+ ]), Ye = ee(
468
467
  async ({ enableFacets: l }) => {
469
- if (!E) return;
470
- const g = ++Z.current;
471
- h((C) => ({ ...C, isLoading: !0 }));
468
+ if (!N) return;
469
+ const d = ++D.current;
470
+ C((b) => ({ ...b, isLoading: !0 }));
472
471
  try {
473
- const C = Object.entries(s.filters ?? {}), D = (await Promise.all(
474
- C.map(
475
- async ([V, Q]) => Promise.all(
472
+ const b = Object.entries(s.filters ?? {}), H = (await Promise.all(
473
+ b.map(
474
+ async ([$, Q]) => Promise.all(
476
475
  Q.map(
477
- (ee) => m(`${i}/api/CreateValueFilter/${c}`, {
476
+ (K) => G(`${i}/api/CreateValueFilter/${c}`, {
478
477
  method: "PUT",
479
478
  headers: {
480
479
  "Content-Type": "application/json"
481
480
  },
482
- body: JSON.stringify({ FieldName: V, Value: ee })
481
+ body: JSON.stringify({ FieldName: $, Value: K })
483
482
  }).then((ge) => ge.json())
484
483
  )
485
484
  )
486
485
  )
487
- )).flat(), U = Object.entries(s.rangeFilters ?? {}), B = await Promise.all(
488
- U.map(
489
- ([V, { min: Q, max: ee }]) => m(`${i}/api/CreateRangeFilter/${c}`, {
486
+ )).flat(), J = Object.entries(s.rangeFilters ?? {}), L = await Promise.all(
487
+ J.map(
488
+ ([$, { min: Q, max: K }]) => G(`${i}/api/CreateRangeFilter/${c}`, {
490
489
  method: "PUT",
491
490
  headers: {
492
491
  "Content-Type": "application/json"
493
492
  },
494
- body: JSON.stringify({ FieldName: V, LowerLimit: Q, UpperLimit: ee })
493
+ body: JSON.stringify({ FieldName: $, LowerLimit: Q, UpperLimit: K })
495
494
  }).then((ge) => ge.json())
496
495
  )
497
- ), K = [...D, ...B].filter(
498
- (V) => V && typeof V.hashString == "string"
499
- ), de = await We(K, i, c), je = v || s.query.trim() !== "", we = {
496
+ ), ce = [...H, ...L].filter(
497
+ ($) => $ && typeof $.hashString == "string"
498
+ ), se = await He(ce, i, c), Ae = m || s.query.trim() !== "", We = {
500
499
  text: s.query,
501
- maxNumberOfRecordsToReturn: je ? De : 0,
500
+ maxNumberOfRecordsToReturn: Ae ? Le : 0,
502
501
  enableFacets: l,
503
- ...de ? { filter: de } : {},
504
- ...qe ? { sortBy: qe } : {},
505
- ...Be !== void 0 ? { sortAscending: Be } : {},
506
- enableCoverage: Xe,
507
- removeDuplicates: Je,
508
- coverageDepth: Qe,
509
- coverageSetup: Ze
502
+ ...se ? { filter: se } : {},
503
+ ...$e ? { sortBy: $e } : {},
504
+ ...Ie !== void 0 ? { sortAscending: Ie } : {},
505
+ enableCoverage: Ue,
506
+ removeDuplicates: Ge,
507
+ coverageDepth: Xe,
508
+ coverageSetup: Qe
510
509
  };
511
- S && console.log("[performSearch] request body:", JSON.stringify(we, null, 2));
512
- const ke = await (await m(`${i}/api/Search/${c}`, {
510
+ S && console.log("[performSearch] request body:", JSON.stringify(We, null, 2));
511
+ const ne = await (await G(`${i}/api/Search/${c}`, {
513
512
  method: "POST",
514
513
  headers: {
515
514
  "Content-Type": "application/json"
516
515
  },
517
- body: JSON.stringify(we)
518
- })).json(), Ge = ke.truncationIndex ?? -1, ze = ke.records || [], he = ze.map((V) => V.documentKey), Re = ze.map((V) => V.score);
519
- let Oe = [];
520
- je && he.length > 0 && (Oe = (await (await m(`${i}/api/GetJson/${c}`, {
516
+ body: JSON.stringify(We)
517
+ })).json(), Ce = ne.truncationIndex ?? -1, Te = ne.records || [], R = Te.map(($) => $.documentKey), ue = Te.map(($) => $.score);
518
+ let oe = [];
519
+ Ae && R.length > 0 && (oe = (await (await G(`${i}/api/GetJson/${c}`, {
521
520
  method: "POST",
522
521
  headers: {
523
522
  "Content-Type": "application/json"
524
523
  },
525
- body: JSON.stringify(he)
526
- })).json()).map((ee, ge) => ({
527
- document: ee,
528
- documentKey: he[ge],
529
- score: Re[ge]
524
+ body: JSON.stringify(R)
525
+ })).json()).map((K, ge) => ({
526
+ document: K,
527
+ documentKey: R[ge],
528
+ score: ue[ge]
530
529
  })));
531
- let F = {};
532
- if (l && ke.facets) {
533
- for (const [V, Q] of Object.entries(ke.facets))
530
+ let je = {};
531
+ if (l && ne.facets) {
532
+ for (const [$, Q] of Object.entries(ne.facets))
534
533
  if (Array.isArray(Q) && Q.length > 0) {
535
- const ee = Q.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
536
- ee.length > 0 && (F[V] = {
537
- min: Math.min(...ee),
538
- max: Math.max(...ee)
534
+ const K = Q.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
535
+ K.length > 0 && (je[$] = {
536
+ min: Math.min(...K),
537
+ max: Math.max(...K)
539
538
  });
540
539
  }
541
540
  }
542
- const fe = s.query !== u, Ee = s.query !== I;
543
- let Ce = s.facetStats ?? {};
544
- if (fe ? (Ce = { ...z, ...F }, o(Ce), j(s.query)) : Ce = { ...t, ...F }, Ee && l) {
545
- const V = { ...ue };
546
- for (const [Q, ee] of Object.entries(F))
547
- V[Q] = ee;
548
- oe(V), L(s.query);
541
+ const ct = s.query !== v, ut = s.query !== ie;
542
+ let De = s.facetStats ?? {};
543
+ if (ct ? (De = { ...ve, ...je }, a(De), k(s.query)) : De = { ...t, ...je }, ut && l) {
544
+ const $ = { ..._ };
545
+ for (const [Q, K] of Object.entries(je))
546
+ $[Q] = K;
547
+ re($), xe(s.query);
549
548
  }
550
- let He = ke.facets;
551
- if (l && (!He || Object.keys(He).length === 0)) {
552
- He = {};
553
- for (const [V, Q] of Object.entries(ce))
554
- He[V] = Q.map((ee) => ({ key: ee, value: null }));
549
+ let Ve = ne.facets;
550
+ if (l && (!Ve || Object.keys(Ve).length === 0)) {
551
+ Ve = {};
552
+ for (const [$, Q] of Object.entries(h))
553
+ Ve[$] = Q.map((K) => ({ key: K, value: null }));
555
554
  }
556
- if (g !== Z.current)
555
+ if (d !== D.current)
557
556
  return;
558
- const ut = Oe.filter((V) => {
557
+ const dt = oe.filter(($) => {
559
558
  const Q = s.query.trim();
560
- return Q === "" || Q.length === 1 ? !0 : V.score >= Ye;
559
+ return Q === "" || Q.length === 1 ? !0 : $.score >= Je;
561
560
  });
562
- h((V) => ({
563
- ...V,
564
- results: ut,
565
- resultsSuppressed: !je,
561
+ C(($) => ({
562
+ ...$,
563
+ results: dt,
564
+ resultsSuppressed: !Ae,
566
565
  ...l ? {
567
- facets: He,
568
- facetStats: Ce
566
+ facets: Ve,
567
+ facetStats: De
569
568
  } : {},
570
569
  isLoading: !1,
571
- truncationIndex: Ge
570
+ truncationIndex: Ce
572
571
  }));
573
- } catch (C) {
574
- if (console.error("[Search] ❌ Search failed:", C), C instanceof TypeError && C.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", i)) : C instanceof Error && (C.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"), console.error('[Search] 💡 curl -X POST "' + i + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)) : C.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", C.message)), g !== Z.current)
572
+ } catch (b) {
573
+ if (console.error("[Search] ❌ Search failed:", b), b instanceof TypeError && b.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", i)) : b instanceof Error && (b.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Get a fresh token with:"), console.error('[Search] 💡 curl -X POST "' + i + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`)) : b.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", b.message)), d !== D.current)
575
574
  return;
576
- h((k) => ({
577
- ...k,
575
+ C((F) => ({
576
+ ...F,
578
577
  results: null,
579
578
  isLoading: !1,
580
579
  resultsSuppressed: !1,
581
- error: C instanceof Error ? C.message : "Search failed"
580
+ error: b instanceof Error ? b.message : "Search failed"
582
581
  }));
583
582
  }
584
583
  },
@@ -586,521 +585,523 @@ const Gt = ({
586
585
  s.query,
587
586
  s.filters,
588
587
  s.rangeFilters,
589
- qe,
590
- Be,
591
- De,
588
+ $e,
589
+ Ie,
590
+ Le,
591
+ Ue,
592
+ Ge,
592
593
  Xe,
593
- Je,
594
594
  Qe,
595
- Ze,
596
- Ye,
597
- m,
598
- We,
595
+ Je,
596
+ G,
597
+ He,
599
598
  i,
600
599
  c,
601
- v,
602
- E
600
+ m,
601
+ N
603
602
  ]
604
603
  );
605
604
  me(() => {
606
- p.current = Ke;
607
- }, [Ke]), te(() => {
605
+ x.current = Ye;
606
+ }, [Ye]), ee(() => {
608
607
  var l;
609
- S && console.log("Search fired"), (l = p.current) == null || l.call(p, { enableFacets: !1 });
608
+ S && console.log("Search fired"), (l = x.current) == null || l.call(x, { enableFacets: !1 });
610
609
  }, []);
611
- const ie = Ne(null);
610
+ const le = Re(null);
612
611
  return me(() => {
613
612
  var l;
614
- return (l = ie.current) == null || l.cancel(), ie.current = jt(() => {
615
- var g;
616
- S && console.log("Debounced searchWithFacets fired"), (g = p.current) == null || g.call(p, { enableFacets: !0 });
613
+ return (l = le.current) == null || l.cancel(), le.current = Ct(() => {
614
+ var d;
615
+ S && console.log("Debounced searchWithFacets fired"), (d = x.current) == null || d.call(x, { enableFacets: !0 });
617
616
  }, s.facetDebounceDelayMillis ?? 500), () => {
618
- var g;
619
- (g = ie.current) == null || g.cancel();
617
+ var d;
618
+ (d = le.current) == null || d.cancel();
620
619
  };
621
- }, [s.facetDebounceDelayMillis]), te(() => {
620
+ }, [s.facetDebounceDelayMillis]), ee(() => {
622
621
  var l;
623
- (l = ie.current) == null || l.call(ie);
622
+ (l = le.current) == null || l.call(le);
624
623
  }, []), me(() => {
625
624
  var l;
626
- !N && E && !q.current && (v && ((l = p.current) == null || l.call(p, { enableFacets: M })), q.current = !0);
627
- }, [N, E, v, M]), me(() => {
628
- var k, D, U, B, K;
629
- if (!E || !q.current) return;
630
- const l = s.query.trim(), g = l === "" && v;
631
- if (l === "" && !v) {
632
- s.resultsSuppressed || h((de) => ({
633
- ...de,
625
+ !y && N && !A.current && (m && ((l = x.current) == null || l.call(x, { enableFacets: g })), A.current = !0);
626
+ }, [y, N, m, g]), me(() => {
627
+ var F, H, J, L, ce;
628
+ if (!N || !A.current) return;
629
+ const l = s.query.trim(), d = l === "" && m;
630
+ if (l === "" && !m) {
631
+ s.resultsSuppressed || C((se) => ({
632
+ ...se,
634
633
  resultsSuppressed: !0
635
634
  }));
636
635
  return;
637
636
  }
638
- return g ? ((k = ie.current) == null || k.cancel(), (D = p.current) == null || D.call(p, { enableFacets: M })) : M ? (S && console.log("Search fired"), (U = p.current) == null || U.call(p, { enableFacets: !1 }), (B = ie.current) == null || B.call(ie)) : (K = p.current) == null || K.call(p, { enableFacets: !1 }), () => {
639
- var de;
640
- (de = ie.current) == null || de.cancel();
637
+ return d ? ((F = le.current) == null || F.cancel(), (H = x.current) == null || H.call(x, { enableFacets: g })) : g ? (S && console.log("Search fired"), (J = x.current) == null || J.call(x, { enableFacets: !1 }), (L = le.current) == null || L.call(le)) : (ce = x.current) == null || ce.call(x, { enableFacets: !1 }), () => {
638
+ var se;
639
+ (se = le.current) == null || se.cancel();
641
640
  };
642
- }, [s.query, v, M]), me(() => {
643
- var C;
644
- if (!q.current || !E) return;
645
- if (!H.current) {
646
- H.current = !0, S && console.log("[Filter effect] First run, skipping");
641
+ }, [s.query, m, g]), me(() => {
642
+ var b;
643
+ if (!A.current || !N) return;
644
+ if (!f.current) {
645
+ f.current = !0, S && console.log("[Filter effect] First run, skipping");
647
646
  return;
648
647
  }
649
- if (s.query !== u) {
648
+ if (s.query !== v) {
650
649
  S && console.log("[Filter effect] Skipping because query changed");
651
650
  return;
652
651
  }
653
652
  const l = s.query.trim();
654
- M && !(!v && l === "") && (S && console.log("[Filter effect] Firing search"), (C = p.current) == null || C.call(p, { enableFacets: !0 }));
653
+ g && !(!m && l === "") && (S && console.log("[Filter effect] Firing search"), (b = x.current) == null || b.call(x, { enableFacets: !0 }));
655
654
  }, [s.filters, s.rangeFilters]), me(() => {
656
- var C;
657
- if (!q.current || !E) return;
655
+ var b;
656
+ if (!A.current || !N) return;
658
657
  const l = s.query.trim();
659
- M && !(!v && l === "") && ((C = p.current) == null || C.call(p, { enableFacets: !0 }));
660
- }, [qe, Be]), me(() => {
658
+ g && !(!m && l === "") && ((b = x.current) == null || b.call(x, { enableFacets: !0 }));
659
+ }, [$e, Ie]), me(() => {
661
660
  (async () => {
662
661
  try {
663
- if (!a)
664
- throw console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider'), new Error("Email is required. Check console for instructions.");
665
- if (!d)
666
- throw console.error("[Auth] ❌ Missing password"), console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider'), new Error("Password is required. Check console for instructions.");
667
- if (!i)
668
- throw console.error("[Auth] ❌ Missing INDX server URL"), console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"), new Error("INDX server URL is required. Check console for instructions.");
669
- if (!c)
670
- throw console.error("[Auth] ❌ Missing dataset name"), console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'), new Error("Dataset name is required. Check console for instructions.");
671
- S && console.log("[Auth] 🔐 Logging in to get session token...");
672
- const g = await fetch(`${i}/api/Login`, {
673
- method: "POST",
674
- headers: {
675
- "Content-Type": "application/json",
676
- accept: "*/*"
677
- },
678
- credentials: "include",
679
- body: JSON.stringify({
680
- userEmail: a,
681
- userPassWord: d
682
- })
683
- });
684
- if (!g.ok)
685
- throw console.error("[Auth] ❌ Login failed:", g.status, await g.text()), new Error("Login failed. Check your email and password.");
686
- const k = (await g.json()).token;
687
- if (!k)
688
- throw console.error("[Auth] No token received from login response"), new Error("No token received from login.");
689
- S && console.log("[Auth] Login successful, token received (length:", k.length, ")"), W(k), S && console.log("[Auth] 🔓 Opening dataset session...");
690
- const D = await fetch(`${i}/api/CreateOrOpen/${c}/400`, {
691
- method: "PUT",
692
- headers: {
693
- "Content-Type": "application/json",
694
- Authorization: `Bearer ${k}`
695
- },
696
- credentials: "include",
697
- body: '""'
698
- });
699
- if (!D.ok)
700
- throw console.error("[Auth] ❌ CreateOrOpen failed:", D.status, await D.text()), new Error("Failed to open dataset session.");
701
- S && console.log("[Auth] Dataset session established");
702
- const U = (F) => fetch(F, {
662
+ let d;
663
+ if (Y)
664
+ S && console.log("[Auth] ✅ Using pre-authenticated token"), d = Y, W(Y);
665
+ else {
666
+ if (!o || !u)
667
+ throw console.error("[Auth] ❌ Missing credentials"), o || (console.error("[Auth] ❌ Missing email"), console.error('[Auth] 💡 Pass email="your@email.com" to SearchProvider')), u || (console.error("[Auth] ❌ Missing password"), console.error('[Auth] 💡 Pass password="yourpassword" to SearchProvider')), new Error("Email and password are required. Check console for instructions.");
668
+ if (!i)
669
+ throw console.error("[Auth] ❌ Missing INDX server URL"), console.error("[Auth] 💡 Add NEXT_PUBLIC_INDX_URL to your .env.local file"), new Error("INDX server URL is required. Check console for instructions.");
670
+ if (!c)
671
+ throw console.error("[Auth] ❌ Missing dataset name"), console.error('[Auth] 💡 Pass dataset="your-dataset-name" to SearchProvider'), new Error("Dataset name is required. Check console for instructions.");
672
+ S && console.log("[Auth] 🔐 Logging in to get session token...");
673
+ const R = await fetch(`${i}/api/Login`, {
674
+ method: "POST",
675
+ headers: {
676
+ "Content-Type": "application/json",
677
+ accept: "*/*"
678
+ },
679
+ credentials: "include",
680
+ body: JSON.stringify({
681
+ userEmail: o,
682
+ userPassWord: u
683
+ })
684
+ });
685
+ if (!R.ok)
686
+ throw console.error("[Auth] ❌ Login failed:", R.status, await R.text()), new Error("Login failed. Check your email and password.");
687
+ if (d = (await R.json()).token, !d)
688
+ throw console.error("[Auth] No token received from login response"), new Error("No token received from login.");
689
+ S && console.log("[Auth] Login successful, token received (length:", d.length, ")"), W(d), S && console.log("[Auth] 🔓 Opening dataset session...");
690
+ const oe = await fetch(`${i}/api/CreateOrOpen/${c}/400`, {
691
+ method: "PUT",
692
+ headers: {
693
+ "Content-Type": "application/json",
694
+ Authorization: `Bearer ${d}`
695
+ },
696
+ credentials: "include",
697
+ body: '""'
698
+ });
699
+ if (!oe.ok)
700
+ throw console.error("[Auth] CreateOrOpen failed:", oe.status, await oe.text()), new Error("Failed to open dataset session.");
701
+ S && console.log("[Auth] Dataset session established");
702
+ }
703
+ const b = (R) => fetch(R, {
703
704
  method: "GET",
704
705
  headers: {
705
706
  accept: "text/plain",
706
- Authorization: `Bearer ${k}`
707
+ Authorization: `Bearer ${d}`
707
708
  },
708
709
  credentials: "include"
709
710
  });
710
711
  S && console.log("[Auth] 🔍 Checking dataset status...");
711
- const B = await U(`${i}/api/GetStatus/${c}`);
712
- if (!B.ok) {
713
- if (B.status === 401)
712
+ const F = await b(`${i}/api/GetStatus/${c}`);
713
+ if (!F.ok) {
714
+ if (F.status === 401)
714
715
  throw console.error("[Auth] ❌ Authentication failed (401 Unauthorized)"), console.error("[Auth] 💡 Your token may be expired or invalid"), console.error('[Auth] 💡 Get a fresh token with: curl -X POST "' + i + `/api/Login" -H "Content-Type: application/json" -d '{"userEmail":"your@email.com","userPassWord":"yourpassword"}'`), new Error("Authentication failed (401). Token may be expired. Check console for instructions.");
715
- if (B.status === 404)
716
+ if (F.status === 404)
716
717
  throw console.error('[Auth] ❌ Dataset "' + c + '" not found (404)'), console.error('[Auth] 💡 Available datasets can be checked with: curl -X GET "' + i + '/api/GetUserDataSets" -H "Authorization: Bearer YOUR_TOKEN"'), console.error("[Auth] 💡 Make sure you spelled the dataset name correctly"), new Error('Dataset "' + c + '" not found. Check console for instructions.');
717
718
  {
718
- const F = await B.text();
719
- throw console.error("[Auth] ❌ Failed to get dataset status:", B.status, F), console.error("[Auth] 💡 Check if your INDX server is running at:", i), new Error("Failed to connect to INDX server. Check console for details.");
719
+ const R = await F.text();
720
+ throw console.error("[Auth] ❌ Failed to get dataset status:", F.status, R), console.error("[Auth] 💡 Check if your INDX server is running at:", i), new Error("Failed to connect to INDX server. Check console for details.");
720
721
  }
721
722
  }
722
- const K = await B.json();
723
- S && console.log("[Auth] 📊 Dataset status:", K), K.state && K.state !== "Ready" && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", K.state), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
724
- const de = K.documentCount ?? K.numberOfRecords ?? 0;
725
- de === 0 ? (console.warn('[Auth] ⚠️ Dataset "' + c + '" is empty (0 records)'), console.warn("[Auth] 💡 Add documents to your dataset before searching"), console.warn("[Auth] 💡 Search will work but return no results")) : S && console.log("[Auth] ✅ Dataset has", de, "records");
726
- const [je, we, Pe] = await Promise.all([
727
- U(`${i}/api/GetFilterableFields/${c}`),
728
- U(`${i}/api/GetFacetableFields/${c}`),
729
- U(`${i}/api/GetSortableFields/${c}`)
723
+ const H = await F.json();
724
+ S && console.log("[Auth] 📊 Dataset status:", H), H.state && H.state !== "Ready" && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", H.state), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
725
+ const J = H.documentCount ?? H.numberOfRecords ?? 0;
726
+ J === 0 ? (console.warn('[Auth] ⚠️ Dataset "' + c + '" is empty (0 records)'), console.warn("[Auth] 💡 Add documents to your dataset before searching"), console.warn("[Auth] 💡 Search will work but return no results")) : S && console.log("[Auth] ✅ Dataset has", J, "records");
727
+ const [L, ce, se] = await Promise.all([
728
+ b(`${i}/api/GetFilterableFields/${c}`),
729
+ b(`${i}/api/GetFacetableFields/${c}`),
730
+ b(`${i}/api/GetSortableFields/${c}`)
730
731
  ]);
731
- if (!je.ok)
732
- throw console.error("[Auth] ❌ GetFilterableFields failed:", je.status, await je.text()), new Error("Failed to get filterable fields. Check console for details.");
733
- if (!we.ok)
734
- throw console.error("[Auth] ❌ GetFacetableFields failed:", we.status, await we.text()), new Error("Failed to get facetable fields. Check console for details.");
735
- if (!Pe.ok)
736
- throw console.error("[Auth] ❌ GetSortableFields failed:", Pe.status, await Pe.text()), new Error("Failed to get sortable fields. Check console for details.");
737
- const ke = await je.json().catch((F) => (console.error("Failed to parse GetFilterableFields response:", F), [])), Ge = await we.json().catch((F) => (console.error("Failed to parse GetFacetableFields response:", F), [])), ze = await Pe.json().catch((F) => (console.error("Failed to parse GetSortableFields response:", F), []));
738
- be(ke || []), se(Ge || []), Se(ze || []);
739
- let he = { facets: {} };
732
+ if (!L.ok)
733
+ throw console.error("[Auth] ❌ GetFilterableFields failed:", L.status, await L.text()), new Error("Failed to get filterable fields. Check console for details.");
734
+ if (!ce.ok)
735
+ throw console.error("[Auth] ❌ GetFacetableFields failed:", ce.status, await ce.text()), new Error("Failed to get facetable fields. Check console for details.");
736
+ if (!se.ok)
737
+ throw console.error("[Auth] ❌ GetSortableFields failed:", se.status, await se.text()), new Error("Failed to get sortable fields. Check console for details.");
738
+ const Ae = await L.json().catch((R) => (console.error("Failed to parse GetFilterableFields response:", R), [])), We = await ce.json().catch((R) => (console.error("Failed to parse GetFacetableFields response:", R), [])), Ze = await se.json().catch((R) => (console.error("Failed to parse GetSortableFields response:", R), []));
739
+ z(Ae || []), T(We || []), V(Ze || []);
740
+ let ne = { facets: {} };
740
741
  try {
741
- const F = await fetch(`${i}/api/Search/${c}`, {
742
+ const R = await fetch(`${i}/api/Search/${c}`, {
742
743
  method: "POST",
743
744
  headers: {
744
745
  "Content-Type": "application/json",
745
- Authorization: `Bearer ${k}`
746
+ Authorization: `Bearer ${d}`
746
747
  },
747
748
  credentials: "include",
748
749
  body: JSON.stringify({ text: "", maxNumberOfRecordsToReturn: 0, enableFacets: !0 })
749
750
  });
750
- F.ok ? he = await F.json().catch((fe) => (console.warn("Failed to parse blank search response:", fe), { facets: {} })) : (console.warn("Blank search failed:", F.status, F.statusText), console.warn("Continuing without initial facet data - facets will be populated after first search"));
751
- } catch (F) {
752
- console.warn("Blank search error:", F), console.warn("Continuing without initial facet data - facets will be populated after first search");
751
+ R.ok ? ne = await R.json().catch((ue) => (console.warn("Failed to parse blank search response:", ue), { facets: {} })) : (console.warn("Blank search failed:", R.status, R.statusText), console.warn("Continuing without initial facet data - facets will be populated after first search"));
752
+ } catch (R) {
753
+ console.warn("Blank search error:", R), console.warn("Continuing without initial facet data - facets will be populated after first search");
753
754
  }
754
- const Re = {};
755
- if (he.facets) {
756
- for (const [F, fe] of Object.entries(he.facets))
757
- if (Array.isArray(fe) && fe.length > 0) {
758
- const Ee = fe.map((Ce) => Number(Ce.key)).filter((Ce) => !isNaN(Ce));
759
- Ee.length > 0 && (Re[F] = {
760
- min: Math.min(...Ee),
761
- max: Math.max(...Ee)
755
+ const Ce = {};
756
+ if (ne.facets) {
757
+ for (const [R, ue] of Object.entries(ne.facets))
758
+ if (Array.isArray(ue) && ue.length > 0) {
759
+ const oe = ue.map((je) => Number(je.key)).filter((je) => !isNaN(je));
760
+ oe.length > 0 && (Ce[R] = {
761
+ min: Math.min(...oe),
762
+ max: Math.max(...oe)
762
763
  });
763
764
  }
764
765
  }
765
- const Oe = {};
766
- if (he.facets)
767
- for (const [F, fe] of Object.entries(he.facets))
768
- Array.isArray(fe) && (Oe[F] = fe.map((Ee) => Ee.key));
769
- P.current = {
770
- facets: he.facets,
771
- facetStats: Re,
772
- facetKeys: Oe
773
- }, pe(Re), f(Oe), oe(Re), h((F) => ({
774
- ...F,
775
- facetStats: Re
766
+ const Te = {};
767
+ if (ne.facets)
768
+ for (const [R, ue] of Object.entries(ne.facets))
769
+ Array.isArray(ue) && (Te[R] = ue.map((oe) => oe.key));
770
+ ye.current = {
771
+ facets: ne.facets,
772
+ facetStats: Ce,
773
+ facetKeys: Te
774
+ }, fe(Ce), w(Te), re(Ce), C((R) => ({
775
+ ...R,
776
+ facetStats: Ce
776
777
  })), S && console.log("[Auth] ✅ Initialization complete");
777
- } catch (g) {
778
- throw console.error("[Auth] ❌ Initialization failed:", g), (g instanceof Error || typeof g == "object" && g !== null && "message" in g) && console.error("[Auth] 💡 Error:", g.message), g instanceof TypeError && g.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", i), console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"), console.error("[Auth] 💡 For local development, it should be: http://localhost:38171")), g;
778
+ } catch (d) {
779
+ throw console.error("[Auth] ❌ Initialization failed:", d), (d instanceof Error || typeof d == "object" && d !== null && "message" in d) && console.error("[Auth] 💡 Error:", d.message), d instanceof TypeError && d.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", i), console.error("[Auth] 💡 Check your NEXT_PUBLIC_INDX_URL in .env.local"), console.error("[Auth] 💡 For local development, it should be: http://localhost:38171")), d;
779
780
  } finally {
780
- y(!1);
781
+ B(!1);
781
782
  }
782
783
  })();
783
- }, [a, d, i, c]), /* @__PURE__ */ e.jsx(
784
- lt.Provider,
784
+ }, [o, u, i, c]), /* @__PURE__ */ e.jsx(
785
+ it.Provider,
785
786
  {
786
787
  value: {
787
788
  state: {
788
789
  ...s,
789
- filterableFields: le,
790
- facetableFields: G,
791
- sortableFields: A,
792
- rangeBounds: ue
790
+ filterableFields: de,
791
+ facetableFields: he,
792
+ sortableFields: pe,
793
+ rangeBounds: _
793
794
  },
794
- isFetchingInitial: N,
795
- allowEmptySearch: v,
796
- setQuery: ae,
797
- toggleFilter: _,
798
- setRangeFilter: J,
799
- resetFilters: Ae,
795
+ isFetchingInitial: y,
796
+ allowEmptySearch: m,
797
+ setQuery: Fe,
798
+ toggleFilter: X,
799
+ setRangeFilter: Me,
800
+ resetFilters: Ne,
800
801
  resetSingleFilter: _e,
801
- setSort: Ve,
802
- setDebounceDelay: ye,
803
- setSearchSettings: T
802
+ setSort: ze,
803
+ setDebounceDelay: O,
804
+ setSearchSettings: P
804
805
  },
805
806
  children: r
806
807
  }
807
808
  );
808
- }, Te = () => {
809
- const r = gt(lt);
809
+ }, Ee = () => {
810
+ const r = mt(it);
810
811
  if (!r)
811
812
  throw new Error("useSearchContext must be used within a SearchProvider");
812
813
  return r;
813
- }, Xt = ({
814
+ }, Jt = ({
814
815
  className: r = "",
815
- autoFocus: a = !1,
816
- inputSize: d = "default",
816
+ autoFocus: o = !1,
817
+ inputSize: u = "default",
817
818
  showClear: i = !0,
818
819
  showFocus: c = !1,
819
- ...v
820
+ ...m
820
821
  }) => {
821
- const { state: { query: R, filters: x, rangeFilters: n, searchSettings: b }, setQuery: O } = Te();
822
- Object.keys(x).length > 0 || Object.keys(n).length > 0;
823
- const w = R.length > 0;
822
+ const { state: { query: M, filters: p, rangeFilters: n, searchSettings: j }, setQuery: I } = Ee();
823
+ Object.keys(p).length > 0 || Object.keys(n).length > 0;
824
+ const E = M.length > 0;
824
825
  return /* @__PURE__ */ e.jsx(
825
- pt,
826
+ vt,
826
827
  {
827
828
  type: "text",
828
- value: R,
829
- onChange: ($) => O($.target.value),
830
- placeholder: b.placeholderText,
831
- autoFocus: a,
829
+ value: M,
830
+ onChange: (q) => I(q.target.value),
831
+ placeholder: j.placeholderText,
832
+ autoFocus: o,
832
833
  className: r,
833
834
  showSearchIcon: !0,
834
- inputSize: d,
835
+ inputSize: u,
835
836
  showFocusBorder: c,
836
- ...v,
837
- children: i && w && /* @__PURE__ */ e.jsx(
838
- xe,
837
+ ...m,
838
+ children: i && E && /* @__PURE__ */ e.jsx(
839
+ Se,
839
840
  {
840
841
  variant: "ghost",
841
842
  size: "micro",
842
- onClick: () => O(""),
843
+ onClick: () => I(""),
843
844
  "aria-label": "Clear search",
844
845
  children: "Clear"
845
846
  }
846
847
  )
847
848
  }
848
849
  );
849
- }, Ct = "_placeholder_bcpqa_1", wt = "_invalid_bcpqa_10", kt = "_row_bcpqa_14", Rt = "_indexNumber_bcpqa_42", Et = "_scoreNumber_bcpqa_49", Fe = {
850
- placeholder: Ct,
851
- invalid: wt,
852
- row: kt,
853
- indexNumber: Rt,
854
- scoreNumber: Et
855
- }, Ft = ({ color: r = "black", size: a = 21 }) => {
856
- const d = 0.7142857142857143, i = a, c = typeof a == "number" ? a * d : `calc(${a} * 0.7142857142857143)`;
850
+ }, wt = "_placeholder_bcpqa_1", kt = "_invalid_bcpqa_10", Rt = "_row_bcpqa_14", Et = "_indexNumber_bcpqa_42", Ft = "_scoreNumber_bcpqa_49", we = {
851
+ placeholder: wt,
852
+ invalid: kt,
853
+ row: Rt,
854
+ indexNumber: Et,
855
+ scoreNumber: Ft
856
+ }, Mt = ({ color: r = "black", size: o = 21 }) => {
857
+ const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
857
858
  return e.jsx("svg", { width: i, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 0H3V1V2V3H2V2H1V3H2V4H3V5H4V4H5V3H6V2H5V3H4V2V1V0ZM4 3V4H3V3H4Z", fill: r }) });
858
- }, Mt = ({ color: r = "black", size: a = 21 }) => {
859
- const d = 0.7142857142857143, i = a, c = typeof a == "number" ? a * d : `calc(${a} * 0.7142857142857143)`;
859
+ }, Nt = ({ color: r = "black", size: o = 21 }) => {
860
+ const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
860
861
  return e.jsx("svg", { width: i, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H4V1H5V2H4H3H2H1V3H2H3H4H5V4H4V5H5V4H6V3H7V2H6V1H5V0ZM6 2H5V3H6V2Z", fill: r }) });
861
- }, Nt = ({ color: r = "black", size: a = 21 }) => {
862
- const d = 0.7142857142857143, i = a, c = typeof a == "number" ? a * d : `calc(${a} * 0.7142857142857143)`;
862
+ }, _t = ({ color: r = "black", size: o = 21 }) => {
863
+ const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
863
864
  return e.jsx("svg", { width: i, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0H6V1H5V0ZM6 1H7V2H6V1ZM0 1H1V2H0V1ZM1 1V0H2V1H1ZM6 3H7V4H6V3ZM6 4V5H5V4H6ZM1 4H2V5H1V4ZM1 4H0V3H1V4ZM2 2H5V3H2V2Z", fill: r }) });
864
- }, ct = ({ color: r = "black", size: a = 21 }) => {
865
- const d = 0.7142857142857143, i = a, c = typeof a == "number" ? a * d : `calc(${a} * 0.7142857142857143)`;
865
+ }, lt = ({ color: r = "black", size: o = 21 }) => {
866
+ const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
866
867
  return e.jsx("svg", { width: i, height: c, viewBox: "0 0 7 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 0H2V1H1V0ZM3 2H2V1H3V2ZM4 2H3V3H2V4H1V5H2V4H3V3H4V4H5V5H6V4H5V3H4V2ZM5 1V2H4V1H5ZM5 1V0H6V1H5Z", fill: r }) });
867
- }, Jt = ({ fields: r, resultsPerPage: a, children: d }) => {
868
+ }, Qt = ({ fields: r, resultsPerPage: o, children: u }) => {
868
869
  const {
869
- state: { results: i, resultsSuppressed: c, searchSettings: v, truncationIndex: R },
870
- isFetchingInitial: x
871
- } = Te(), n = a ?? 30, [b, O] = X(n);
870
+ state: { results: i, resultsSuppressed: c, searchSettings: m, truncationIndex: M },
871
+ isFetchingInitial: p
872
+ } = Ee(), n = o ?? 30, [j, I] = U(n);
872
873
  me(() => {
873
- O(n);
874
+ I(n);
874
875
  }, [i]);
875
- const w = i && i.length > b, $ = () => {
876
- O((S) => S + n);
876
+ const E = i && i.length > j, q = () => {
877
+ I((S) => S + n);
877
878
  };
878
- return x || c ? /* @__PURE__ */ e.jsx("div", { className: Fe.placeholder, children: /* @__PURE__ */ e.jsx(Nt, { size: 350, color: "var(--lv5)" }) }) : !i || i.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: Fe.invalid, children: /* @__PURE__ */ e.jsx("p", { children: "No results found." }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
879
- /* @__PURE__ */ e.jsx("div", { className: Fe.container, children: (i ?? []).slice(0, b).map((S, Z) => {
880
- const p = S.document, q = S.score;
881
- let H;
879
+ return p || c ? /* @__PURE__ */ e.jsx("div", { className: we.placeholder, children: /* @__PURE__ */ e.jsx(_t, { size: 350, color: "var(--lv5)" }) }) : !i || i.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: we.invalid, children: /* @__PURE__ */ e.jsx("p", { children: "No results found." }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
880
+ /* @__PURE__ */ e.jsx("div", { className: we.container, children: (i ?? []).slice(0, j).map((S, Y) => {
881
+ const D = S.document, x = S.score;
882
+ let A;
882
883
  try {
883
- H = typeof p == "string" ? JSON.parse(p) : p;
884
+ A = typeof D == "string" ? JSON.parse(D) : D;
884
885
  } catch {
885
- return /* @__PURE__ */ e.jsx("div", { className: Fe.invalid, children: /* @__PURE__ */ e.jsx("p", { children: "Invalid JSON" }) }, Z);
886
+ return /* @__PURE__ */ e.jsx("div", { className: we.invalid, children: /* @__PURE__ */ e.jsx("p", { children: "Invalid JSON" }) }, Y);
886
887
  }
887
- let s;
888
+ let f;
888
889
  if (r && r.length > 0) {
889
- s = {};
890
- for (const h of r)
891
- h in H && (s[h] = H[h]);
890
+ f = {};
891
+ for (const s of r)
892
+ s in A && (f[s] = A[s]);
892
893
  } else
893
- s = { ...H };
894
- for (const h in s) {
895
- const E = s[h];
896
- if (typeof E == "string" && E.startsWith("[") && E.endsWith("]")) {
897
- const M = E.replace(/^\[|\]$/g, "").split(",").map((m) => m.trim().replace(/^'|'$/g, "")).filter((m) => m.length > 0);
898
- s[h] = M;
894
+ f = { ...A };
895
+ for (const s in f) {
896
+ const C = f[s];
897
+ if (typeof C == "string" && C.startsWith("[") && C.endsWith("]")) {
898
+ const W = C.replace(/^\[|\]$/g, "").split(",").map((g) => g.trim().replace(/^'|'$/g, "")).filter((g) => g.length > 0);
899
+ f[s] = W;
899
900
  }
900
901
  }
901
- return /* @__PURE__ */ e.jsxs("div", { className: Fe.row, children: [
902
- /* @__PURE__ */ e.jsx("div", { className: Fe.indexNumber, children: Z }),
903
- d(s),
904
- v.showScore && /* @__PURE__ */ e.jsx("div", { className: Fe.scoreNumber, children: q })
905
- ] }, Z);
902
+ return /* @__PURE__ */ e.jsxs("div", { className: we.row, children: [
903
+ /* @__PURE__ */ e.jsx("div", { className: we.indexNumber, children: Y }),
904
+ u(f),
905
+ m.showScore && /* @__PURE__ */ e.jsx("div", { className: we.scoreNumber, children: x })
906
+ ] }, Y);
906
907
  }) }),
907
- w && /* @__PURE__ */ e.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ e.jsxs(
908
- xe,
908
+ E && /* @__PURE__ */ e.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ e.jsxs(
909
+ Se,
909
910
  {
910
911
  variant: "secondary",
911
912
  size: "micro",
912
- onClick: $,
913
+ onClick: q,
913
914
  children: [
914
915
  "Load more ",
915
- R
916
+ M
916
917
  ]
917
918
  }
918
919
  ) })
919
920
  ] });
920
- }, Tt = "_list_mwzqq_2", At = "_count_mwzqq_7", _t = "_grid_mwzqq_16", Me = {
921
+ }, Tt = "_list_mwzqq_2", At = "_count_mwzqq_7", Vt = "_grid_mwzqq_16", ke = {
921
922
  list: Tt,
922
923
  count: At,
923
- grid: _t
924
- }, Qt = ({
924
+ grid: Vt
925
+ }, Yt = ({
925
926
  field: r,
926
- label: a,
927
- preserveBlankFacetState: d = !1,
927
+ label: o,
928
+ preserveBlankFacetState: u = !1,
928
929
  preserveBlankFacetStateOrder: i = !1,
929
930
  sortFacetsBy: c = "histogram",
930
- limit: v = 10,
931
- collapsible: R = !0,
932
- startCollapsed: x = !1,
931
+ limit: m = 10,
932
+ collapsible: M = !0,
933
+ startCollapsed: p = !1,
933
934
  displayType: n = "checkbox",
934
- layout: b = "list",
935
- showActivePanel: O = !1,
936
- showCount: w = !0,
937
- showNull: $ = !1,
935
+ layout: j = "list",
936
+ showActivePanel: I = !1,
937
+ showCount: E = !0,
938
+ showNull: q = !1,
938
939
  displayIfEmptyQuery: S = !0,
939
- displayCondition: Z = (p) => !0
940
+ displayCondition: Y = (D) => !0
940
941
  }) => {
941
942
  const {
942
- state: { facets: p, filterableFields: q, facetableFields: H, filters: s, query: h },
943
- toggleFilter: E,
944
- isFetchingInitial: W,
945
- allowEmptySearch: M
946
- } = Te(), m = Ne(null), [le, be] = X(!1);
947
- if (!M && !h || W || !p || !Z({ query: h ?? "", filters: s, facets: p }) || !S && !h && Object.keys(s).length < 1)
943
+ state: { facets: D, filterableFields: x, facetableFields: A, filters: f, query: s },
944
+ toggleFilter: C,
945
+ isFetchingInitial: N,
946
+ allowEmptySearch: W
947
+ } = Ee(), g = Re(null), [G, de] = U(!1);
948
+ if (!W && !s || N || !D || !Y({ query: s ?? "", filters: f, facets: D }) || !S && !s && Object.keys(f).length < 1)
948
949
  return null;
949
- if (!(q != null && q.includes(r)) || !(H != null && H.includes(r))) {
950
- const f = [];
951
- return q != null && q.includes(r) || f.push("filterable"), H != null && H.includes(r) || f.push("facetable"), /* @__PURE__ */ e.jsx(ve, { collapsible: !1, children: /* @__PURE__ */ e.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
950
+ if (!(x != null && x.includes(r)) || !(A != null && A.includes(r))) {
951
+ const h = [];
952
+ return x != null && x.includes(r) || h.push("filterable"), A != null && A.includes(r) || h.push("facetable"), /* @__PURE__ */ e.jsx(be, { collapsible: !1, children: /* @__PURE__ */ e.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
952
953
  'Cannot render filter for "',
953
954
  r,
954
955
  '": missing ',
955
- f.join(" and "),
956
+ h.join(" and "),
956
957
  "."
957
958
  ] }) });
958
959
  }
959
- const G = p == null ? void 0 : p[r];
960
- if (!G || !Array.isArray(G)) return null;
961
- const se = (s == null ? void 0 : s[r]) ?? [];
962
- d && !m.current && G.length > 0 && (m.current = G.reduce(
963
- (f, t) => (f[t.key] = t.value, f),
960
+ const z = D == null ? void 0 : D[r];
961
+ if (!z || !Array.isArray(z)) return null;
962
+ const he = (f == null ? void 0 : f[r]) ?? [];
963
+ u && !g.current && z.length > 0 && (g.current = z.reduce(
964
+ (h, w) => (h[w.key] = w.value, h),
964
965
  {}
965
966
  ));
966
- const A = /* @__PURE__ */ new Map();
967
- d && m.current ? (Object.keys(m.current).forEach((f) => {
968
- A.set(f, 0);
969
- }), G.forEach((f) => {
970
- A.set(f.key, f.value);
971
- })) : G.forEach((f) => {
972
- A.set(f.key, f.value);
967
+ const T = /* @__PURE__ */ new Map();
968
+ u && g.current ? (Object.keys(g.current).forEach((h) => {
969
+ T.set(h, 0);
970
+ }), z.forEach((h) => {
971
+ T.set(h.key, h.value);
972
+ })) : z.forEach((h) => {
973
+ T.set(h.key, h.value);
973
974
  });
974
- const Se = n === "toggle" && A.size === 2 && A.has("true") && (A.has("false") || A.has("null"));
975
- if (A.has("null")) {
976
- const f = A.get("null") ?? 0, t = A.get("false") ?? 0;
977
- A.set("false", (t ?? 0) + f), A.delete("null");
975
+ const pe = n === "toggle" && T.size === 2 && T.has("true") && (T.has("false") || T.has("null"));
976
+ if (T.has("null")) {
977
+ const h = T.get("null") ?? 0, w = T.get("false") ?? 0;
978
+ T.set("false", (w ?? 0) + h), T.delete("null");
978
979
  }
979
- if (n === "toggle" && !Se)
980
- return /* @__PURE__ */ e.jsx(ve, { collapsible: !1, children: /* @__PURE__ */ e.jsx("div", { className: Me.count, children: /* @__PURE__ */ e.jsx(
981
- ne,
980
+ if (n === "toggle" && !pe)
981
+ return /* @__PURE__ */ e.jsx(be, { collapsible: !1, children: /* @__PURE__ */ e.jsx("div", { className: ke.count, children: /* @__PURE__ */ e.jsx(
982
+ ae,
982
983
  {
983
- label: a,
984
+ label: o,
984
985
  checked: !1,
985
986
  onChange: () => {
986
987
  },
987
988
  disabled: !0
988
989
  }
989
990
  ) }) });
990
- if (Se) {
991
- const f = A.get("true"), t = typeof f == "number" ? f : null, o = se.includes("true"), u = t === 0, j = w && (t ?? 0) > 0 ? `${t}` : "";
992
- return /* @__PURE__ */ e.jsx(ve, { collapsible: !1, children: /* @__PURE__ */ e.jsxs("div", { className: Me.count, children: [
991
+ if (pe) {
992
+ const h = T.get("true"), w = typeof h == "number" ? h : null, t = he.includes("true"), a = w === 0, v = E && (w ?? 0) > 0 ? `${w}` : "";
993
+ return /* @__PURE__ */ e.jsx(be, { collapsible: !1, children: /* @__PURE__ */ e.jsxs("div", { className: ke.count, children: [
993
994
  /* @__PURE__ */ e.jsx(
994
- ne,
995
+ ae,
995
996
  {
996
- label: a,
997
- checked: o,
998
- onChange: () => E(r, "true"),
999
- disabled: u
997
+ label: o,
998
+ checked: t,
999
+ onChange: () => C(r, "true"),
1000
+ disabled: a
1000
1001
  }
1001
1002
  ),
1002
1003
  " ",
1003
- j
1004
+ v
1004
1005
  ] }) });
1005
1006
  }
1006
- let N = Array.from(A.entries());
1007
- if ($ || (N = N.filter(([f]) => f !== "null")), N.length === 0 && !d)
1007
+ let V = Array.from(T.entries());
1008
+ if (q || (V = V.filter(([h]) => h !== "null")), V.length === 0 && !u)
1008
1009
  return null;
1009
1010
  if (!i) if (c === "alphabetical") {
1010
- const f = N.filter(([, o]) => typeof o == "number" && o > 0).sort(([o], [u]) => o.localeCompare(u)), t = N.filter(([, o]) => o === 0 || o === null).sort(([o], [u]) => o.localeCompare(u));
1011
- N = [...f, ...t];
1011
+ const h = V.filter(([, t]) => typeof t == "number" && t > 0).sort(([t], [a]) => t.localeCompare(a)), w = V.filter(([, t]) => t === 0 || t === null).sort(([t], [a]) => t.localeCompare(a));
1012
+ V = [...h, ...w];
1012
1013
  } else if (c === "numeric") {
1013
- const f = (u, j) => {
1014
- const I = Number(u), L = Number(j), ue = !isNaN(I), oe = !isNaN(L);
1015
- return ue && oe ? I - L : u.localeCompare(j);
1016
- }, t = N.filter(([, u]) => typeof u == "number" && u > 0).sort(([u], [j]) => f(u, j)), o = N.filter(([, u]) => u === 0 || u === null).sort(([u], [j]) => f(u, j));
1017
- N = [...t, ...o];
1014
+ const h = (a, v) => {
1015
+ const k = Number(a), ie = Number(v), xe = !isNaN(k), _ = !isNaN(ie);
1016
+ return xe && _ ? k - ie : a.localeCompare(v);
1017
+ }, w = V.filter(([, a]) => typeof a == "number" && a > 0).sort(([a], [v]) => h(a, v)), t = V.filter(([, a]) => a === 0 || a === null).sort(([a], [v]) => h(a, v));
1018
+ V = [...w, ...t];
1018
1019
  } else {
1019
- const f = N.filter(([, o]) => typeof o == "number" && o > 0), t = N.filter(([, o]) => o === 0 || o === null);
1020
- N = [...f, ...t];
1020
+ const h = V.filter(([, t]) => typeof t == "number" && t > 0), w = V.filter(([, t]) => t === 0 || t === null);
1021
+ V = [...h, ...w];
1021
1022
  }
1022
- const y = typeof v == "number" && N.length > v, z = y && !le ? N.slice(0, v) : N, pe = (f, t) => {
1023
- const o = se.includes(f), u = t === 0, j = w && (t ?? 0) > 0 ? ` (${t})` : "", I = w && (t ?? 0) > 0 ? t : "";
1023
+ const y = typeof m == "number" && V.length > m, B = y && !G ? V.slice(0, m) : V, ve = (h, w) => {
1024
+ const t = he.includes(h), a = w === 0, v = E && (w ?? 0) > 0 ? ` (${w})` : "", k = E && (w ?? 0) > 0 ? w : "";
1024
1025
  switch (n) {
1025
1026
  case "button":
1026
- return b === "list" ? /* @__PURE__ */ e.jsxs("div", { className: Me.count, children: [
1027
+ return j === "list" ? /* @__PURE__ */ e.jsxs("div", { className: ke.count, children: [
1027
1028
  /* @__PURE__ */ e.jsx(
1028
- xe,
1029
+ Se,
1029
1030
  {
1030
- variant: o ? "primary" : "secondary",
1031
- onClick: () => E(r, f),
1032
- disabled: u,
1031
+ variant: t ? "primary" : "secondary",
1032
+ onClick: () => C(r, h),
1033
+ disabled: a,
1033
1034
  size: "micro",
1034
- children: f
1035
+ children: h
1035
1036
  }
1036
1037
  ),
1037
- /* @__PURE__ */ e.jsx("span", { children: I })
1038
+ /* @__PURE__ */ e.jsx("span", { children: k })
1038
1039
  ] }) : /* @__PURE__ */ e.jsx(
1039
- xe,
1040
+ Se,
1040
1041
  {
1041
- variant: o ? "primary" : "secondary",
1042
- onClick: () => E(r, f),
1043
- disabled: u,
1042
+ variant: t ? "primary" : "secondary",
1043
+ onClick: () => C(r, h),
1044
+ disabled: a,
1044
1045
  size: "micro",
1045
- children: `${f}${j}`
1046
+ children: `${h}${v}`
1046
1047
  }
1047
1048
  );
1048
1049
  case "toggle":
1049
1050
  return /* @__PURE__ */ e.jsx(
1050
- ne,
1051
+ ae,
1051
1052
  {
1052
- label: f,
1053
- checked: o,
1054
- onChange: () => E(r, f),
1055
- disabled: u
1053
+ label: h,
1054
+ checked: t,
1055
+ onChange: () => C(r, h),
1056
+ disabled: a
1056
1057
  }
1057
1058
  );
1058
1059
  case "checkbox":
1059
1060
  default:
1060
- return b === "list" ? /* @__PURE__ */ e.jsxs("div", { className: Me.count, children: [
1061
+ return j === "list" ? /* @__PURE__ */ e.jsxs("div", { className: ke.count, children: [
1061
1062
  /* @__PURE__ */ e.jsx(
1062
- tt,
1063
+ et,
1063
1064
  {
1064
- label: f,
1065
+ label: h,
1065
1066
  score: "",
1066
- checked: o,
1067
- onChange: () => E(r, f),
1068
- disabled: u
1067
+ checked: t,
1068
+ onChange: () => C(r, h),
1069
+ disabled: a
1069
1070
  }
1070
1071
  ),
1071
- /* @__PURE__ */ e.jsx("span", { children: I })
1072
+ /* @__PURE__ */ e.jsx("span", { children: k })
1072
1073
  ] }) : /* @__PURE__ */ e.jsx(
1073
- tt,
1074
+ et,
1074
1075
  {
1075
- label: f,
1076
- score: j,
1077
- checked: o,
1078
- onChange: () => E(r, f),
1079
- disabled: u
1076
+ label: h,
1077
+ score: v,
1078
+ checked: t,
1079
+ onChange: () => C(r, h),
1080
+ disabled: a
1080
1081
  }
1081
1082
  );
1082
1083
  }
1083
- }, ce = R ? x : !1;
1084
+ }, fe = M ? p : !1;
1084
1085
  return /* @__PURE__ */ e.jsx(
1085
- ve,
1086
+ be,
1086
1087
  {
1087
- title: a,
1088
- collapsible: R,
1089
- collapsed: ce,
1088
+ title: o,
1089
+ collapsible: M,
1090
+ collapsed: fe,
1090
1091
  children: /* @__PURE__ */ e.jsxs(
1091
1092
  "ul",
1092
1093
  {
1093
- className: b === "grid" ? Me.grid : Me.list,
1094
+ className: j === "grid" ? ke.grid : ke.list,
1094
1095
  style: { listStyle: "none", padding: 0, margin: 0 },
1095
1096
  children: [
1096
- z.map(([f, t]) => /* @__PURE__ */ e.jsx("li", { children: pe(f, t) }, f)),
1097
- y && /* @__PURE__ */ e.jsx("li", { className: Me.toggleItem, children: /* @__PURE__ */ e.jsx(
1098
- xe,
1097
+ B.map(([h, w]) => /* @__PURE__ */ e.jsx("li", { children: ve(h, w) }, h)),
1098
+ y && /* @__PURE__ */ e.jsx("li", { className: ke.toggleItem, children: /* @__PURE__ */ e.jsx(
1099
+ Se,
1099
1100
  {
1100
1101
  variant: "ghost",
1101
1102
  size: "micro",
1102
- onClick: () => be((f) => !f),
1103
- children: le ? "Show less" : `Show ${N.length - (v ?? 0)} more`
1103
+ onClick: () => de((h) => !h),
1104
+ children: G ? "Show less" : `Show ${V.length - (m ?? 0)} more`
1104
1105
  }
1105
1106
  ) })
1106
1107
  ]
@@ -1108,97 +1109,97 @@ const Gt = ({
1108
1109
  )
1109
1110
  }
1110
1111
  );
1111
- }, Vt = "_disabledMessage_o89gh_1", ot = {
1112
- disabledMessage: Vt
1113
- }, Yt = ({
1112
+ }, Ot = "_disabledMessage_o89gh_1", nt = {
1113
+ disabledMessage: Ot
1114
+ }, Zt = ({
1114
1115
  field: r,
1115
- label: a,
1116
- expectedMin: d = 0,
1116
+ label: o,
1117
+ expectedMin: u = 0,
1117
1118
  expectedMax: i = 1e3,
1118
1119
  displayType: c = "input",
1119
- collapsible: v = !0,
1120
- startCollapsed: R = !1
1120
+ collapsible: m = !0,
1121
+ startCollapsed: M = !1
1121
1122
  }) => {
1122
1123
  const {
1123
- state: { rangeFilters: x, rangeBounds: n, facetStats: b, query: O, facetDebounceDelayMillis: w },
1124
- setRangeFilter: $,
1124
+ state: { rangeFilters: p, rangeBounds: n, facetStats: j, query: I, facetDebounceDelayMillis: E },
1125
+ setRangeFilter: q,
1125
1126
  resetSingleFilter: S,
1126
- allowEmptySearch: Z,
1127
- isFetchingInitial: p
1128
- } = Te(), q = (n == null ? void 0 : n[r]) !== void 0, H = (n == null ? void 0 : n[r]) ?? { min: d, max: i }, s = H.min, h = H.max, E = (b == null ? void 0 : b[r]) ?? H, W = E.min, M = E.max, m = q && s === h, le = m ? d : s, be = m ? i : h, G = x == null ? void 0 : x[r], se = G ? G.min : s, A = G ? G.max : h, Se = G !== void 0, N = W !== s || M !== h, [y, z] = re.useState([
1129
- se,
1130
- A
1131
- ]), [pe, ce] = re.useState(!1), [f, t] = re.useState(!1), { finalMin: o, finalMax: u, isValidMin: j, isValidMax: I } = re.useMemo(() => {
1132
- const [T, _] = y, J = Math.max(s, Math.min(h, T)), Ae = Math.max(s, Math.min(h, _)), _e = Math.min(J, Ae), Ve = Math.max(J, Ae), We = _e >= s && _e < Ve, De = Ve <= h && Ve > _e;
1133
- return { finalMin: _e, finalMax: Ve, isValidMin: We, isValidMax: De };
1134
- }, [y, s, h]);
1135
- re.useEffect(() => {
1136
- if (m)
1127
+ allowEmptySearch: Y,
1128
+ isFetchingInitial: D
1129
+ } = Ee(), x = (n == null ? void 0 : n[r]) !== void 0, A = (n == null ? void 0 : n[r]) ?? { min: u, max: i }, f = A.min, s = A.max, C = (j == null ? void 0 : j[r]) ?? A, N = C.min, W = C.max, g = x && f === s, G = g ? u : f, de = g ? i : s, z = p == null ? void 0 : p[r], he = z ? z.min : f, T = z ? z.max : s, pe = z !== void 0, V = N !== f || W !== s, [y, B] = te.useState([
1130
+ he,
1131
+ T
1132
+ ]), [ve, fe] = te.useState(!1), [h, w] = te.useState(!1), { finalMin: t, finalMax: a, isValidMin: v, isValidMax: k } = te.useMemo(() => {
1133
+ const [O, P] = y, X = Math.max(f, Math.min(s, O)), Me = Math.max(f, Math.min(s, P)), Ne = Math.min(X, Me), _e = Math.max(X, Me), ze = Ne >= f && Ne < _e, He = _e <= s && _e > Ne;
1134
+ return { finalMin: Ne, finalMax: _e, isValidMin: ze, isValidMax: He };
1135
+ }, [y, f, s]);
1136
+ te.useEffect(() => {
1137
+ if (g)
1137
1138
  return;
1138
- if (y[0] === s && y[1] === h) {
1139
- ce(!1), t(!1);
1139
+ if (y[0] === f && y[1] === s) {
1140
+ fe(!1), w(!1);
1140
1141
  return;
1141
1142
  }
1142
- const _ = w ?? 500, J = setTimeout(() => {
1143
- ce(!j), t(!I);
1144
- }, 300), Ae = setTimeout(() => {
1145
- j && I && (o === s && u === h ? S(r) : $(r, o, u));
1146
- }, _);
1143
+ const P = E ?? 500, X = setTimeout(() => {
1144
+ fe(!v), w(!k);
1145
+ }, 300), Me = setTimeout(() => {
1146
+ v && k && (t === f && a === s ? S(r) : q(r, t, a));
1147
+ }, P);
1147
1148
  return () => {
1148
- clearTimeout(J), clearTimeout(Ae);
1149
+ clearTimeout(X), clearTimeout(Me);
1149
1150
  };
1150
- }, [o, u, j, I, s, h, r, S, $, w, m]), re.useEffect(() => {
1151
- z([se, A]), ce(!1), t(!1);
1152
- }, [se, A, r]);
1153
- const L = re.useCallback((T) => {
1154
- if (m) return;
1155
- const _ = Math.max(s, Math.min(M, T[0])), J = Math.max(W, Math.min(h, T[1]));
1156
- z([_, J]);
1157
- }, [m, s, h, W, M]), ue = re.useCallback((T) => {
1158
- if (m) return;
1159
- const _ = Math.max(s, Math.min(M, T[0])), J = Math.max(W, Math.min(h, T[1]));
1160
- _ === s && J === h ? (z([s, h]), S(r)) : z([_, J]);
1161
- }, [m, s, h, W, M, r, S]), oe = re.useCallback((T) => {
1162
- if (m) return;
1163
- const _ = Number(T.target.value);
1164
- if (!isNaN(_)) {
1165
- const J = Math.max(s, Math.min(M, _));
1166
- z([J, y[1]]);
1151
+ }, [t, a, v, k, f, s, r, S, q, E, g]), te.useEffect(() => {
1152
+ B([he, T]), fe(!1), w(!1);
1153
+ }, [he, T, r]);
1154
+ const ie = te.useCallback((O) => {
1155
+ if (g) return;
1156
+ const P = Math.max(f, Math.min(W, O[0])), X = Math.max(N, Math.min(s, O[1]));
1157
+ B([P, X]);
1158
+ }, [g, f, s, N, W]), xe = te.useCallback((O) => {
1159
+ if (g) return;
1160
+ const P = Math.max(f, Math.min(W, O[0])), X = Math.max(N, Math.min(s, O[1]));
1161
+ P === f && X === s ? (B([f, s]), S(r)) : B([P, X]);
1162
+ }, [g, f, s, N, W, r, S]), _ = te.useCallback((O) => {
1163
+ if (g) return;
1164
+ const P = Number(O.target.value);
1165
+ if (!isNaN(P)) {
1166
+ const X = Math.max(f, Math.min(W, P));
1167
+ B([X, y[1]]);
1167
1168
  }
1168
- }, [m, y, s, M]), P = re.useCallback((T) => {
1169
- if (m) return;
1170
- const _ = Number(T.target.value);
1171
- if (!isNaN(_)) {
1172
- const J = Math.max(W, Math.min(h, _));
1173
- z([y[0], J]);
1169
+ }, [g, y, f, W]), re = te.useCallback((O) => {
1170
+ if (g) return;
1171
+ const P = Number(O.target.value);
1172
+ if (!isNaN(P)) {
1173
+ const X = Math.max(N, Math.min(s, P));
1174
+ B([y[0], X]);
1174
1175
  }
1175
- }, [m, y, W, h]), ae = re.useCallback(() => {
1176
- const T = y[0], _ = Math.max(s, Math.min(M, T));
1177
- _ < y[1] ? z([_, y[1]]) : z([s, y[1]]);
1178
- }, [y, s, M]), ye = re.useCallback(() => {
1179
- const T = y[1], _ = Math.max(W, Math.min(h, T));
1180
- _ > y[0] ? z([y[0], _]) : z([y[0], h]);
1181
- }, [y, W, h]);
1182
- return p || !Z && !O ? null : c === "slider" ? /* @__PURE__ */ e.jsxs(ve, { title: a, collapsed: R, collapsible: v, children: [
1183
- m && /* @__PURE__ */ e.jsxs("div", { className: ot.disabledMessage, children: [
1176
+ }, [g, y, N, s]), ye = te.useCallback(() => {
1177
+ const O = y[0], P = Math.max(f, Math.min(W, O));
1178
+ P < y[1] ? B([P, y[1]]) : B([f, y[1]]);
1179
+ }, [y, f, W]), Fe = te.useCallback(() => {
1180
+ const O = y[1], P = Math.max(N, Math.min(s, O));
1181
+ P > y[0] ? B([y[0], P]) : B([y[0], s]);
1182
+ }, [y, N, s]);
1183
+ return D || !Y && !I ? null : c === "slider" ? /* @__PURE__ */ e.jsxs(be, { title: o, collapsed: M, collapsible: m, children: [
1184
+ g && /* @__PURE__ */ e.jsxs("div", { className: nt.disabledMessage, children: [
1184
1185
  "No adjustable range (all results have the same value: ",
1185
- s,
1186
+ f,
1186
1187
  ")."
1187
1188
  ] }),
1188
1189
  /* @__PURE__ */ e.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ e.jsx(
1189
- it,
1190
+ at,
1190
1191
  {
1191
- min: le,
1192
- max: be,
1193
- value: m ? [le, be] : [o, u],
1192
+ min: G,
1193
+ max: de,
1194
+ value: g ? [G, de] : [t, a],
1194
1195
  isRange: !0,
1195
- onChange: (T) => L(T),
1196
- onFinalChange: (T) => ue(T),
1197
- disabled: m,
1198
- activeMin: W,
1199
- activeMax: M,
1200
- isFaceted: N,
1201
- highlightFaceted: Se
1196
+ onChange: (O) => ie(O),
1197
+ onFinalChange: (O) => xe(O),
1198
+ disabled: g,
1199
+ activeMin: N,
1200
+ activeMax: W,
1201
+ isFaceted: V,
1202
+ highlightFaceted: pe
1202
1203
  }
1203
1204
  ) }),
1204
1205
  /* @__PURE__ */ e.jsxs(
@@ -1213,143 +1214,143 @@ const Gt = ({
1213
1214
  },
1214
1215
  children: [
1215
1216
  /* @__PURE__ */ e.jsx(
1216
- Y,
1217
+ Z,
1217
1218
  {
1218
1219
  type: "number",
1219
- value: m ? s : y[0],
1220
- min: s,
1221
- max: Math.min(M, y[1] - 1),
1222
- onChange: oe,
1223
- onBlur: ae,
1224
- disabled: m,
1225
- isValid: m || !pe
1220
+ value: g ? f : y[0],
1221
+ min: f,
1222
+ max: Math.min(W, y[1] - 1),
1223
+ onChange: _,
1224
+ onBlur: ye,
1225
+ disabled: g,
1226
+ isValid: g || !ve
1226
1227
  }
1227
1228
  ),
1228
1229
  /* @__PURE__ */ e.jsx(
1229
- Y,
1230
+ Z,
1230
1231
  {
1231
1232
  type: "number",
1232
- value: m ? h : y[1],
1233
- min: Math.max(W, y[0] + 1),
1234
- max: h,
1235
- onChange: P,
1236
- onBlur: ye,
1237
- disabled: m,
1238
- isValid: m || !f
1233
+ value: g ? s : y[1],
1234
+ min: Math.max(N, y[0] + 1),
1235
+ max: s,
1236
+ onChange: re,
1237
+ onBlur: Fe,
1238
+ disabled: g,
1239
+ isValid: g || !h
1239
1240
  }
1240
1241
  )
1241
1242
  ]
1242
1243
  }
1243
1244
  )
1244
- ] }) : /* @__PURE__ */ e.jsxs(ve, { title: a, children: [
1245
- m && /* @__PURE__ */ e.jsxs("div", { className: ot.disabledMessage, children: [
1245
+ ] }) : /* @__PURE__ */ e.jsxs(be, { title: o, children: [
1246
+ g && /* @__PURE__ */ e.jsxs("div", { className: nt.disabledMessage, children: [
1246
1247
  "No adjustable range (all results have the same value: ",
1247
- s,
1248
+ f,
1248
1249
  ")."
1249
1250
  ] }),
1250
1251
  /* @__PURE__ */ e.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "flex-start" }, children: [
1251
1252
  /* @__PURE__ */ e.jsx(
1252
- Y,
1253
+ Z,
1253
1254
  {
1254
1255
  label: "Min:",
1255
1256
  type: "number",
1256
- value: m ? s : y[0],
1257
- min: s,
1258
- max: Math.min(M, y[1] - 1),
1259
- onChange: oe,
1260
- onBlur: ae,
1261
- disabled: m,
1262
- isValid: m || !pe
1257
+ value: g ? f : y[0],
1258
+ min: f,
1259
+ max: Math.min(W, y[1] - 1),
1260
+ onChange: _,
1261
+ onBlur: ye,
1262
+ disabled: g,
1263
+ isValid: g || !ve
1263
1264
  }
1264
1265
  ),
1265
1266
  /* @__PURE__ */ e.jsx(
1266
- Y,
1267
+ Z,
1267
1268
  {
1268
1269
  label: "Max:",
1269
1270
  type: "number",
1270
- value: m ? h : y[1],
1271
- min: Math.max(W, y[0] + 1),
1272
- max: h,
1273
- onChange: P,
1274
- onBlur: ye,
1275
- disabled: m,
1276
- isValid: m || !f
1271
+ value: g ? s : y[1],
1272
+ min: Math.max(N, y[0] + 1),
1273
+ max: s,
1274
+ onChange: re,
1275
+ onBlur: Fe,
1276
+ disabled: g,
1277
+ isValid: g || !h
1277
1278
  }
1278
1279
  )
1279
1280
  ] })
1280
1281
  ] });
1281
- }, Ot = "_grid_nvpmn_2", Pt = {
1282
- grid: Ot
1283
- }, Ht = at(({ field: r, value: a, onReset: d }) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
1284
- xe,
1282
+ }, Pt = "_grid_nvpmn_2", Ht = {
1283
+ grid: Pt
1284
+ }, $t = ot(({ field: r, value: o, onReset: u }) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
1285
+ Se,
1285
1286
  {
1286
- onClick: d,
1287
- iconRight: /* @__PURE__ */ e.jsx(ct, {}),
1287
+ onClick: u,
1288
+ iconRight: /* @__PURE__ */ e.jsx(lt, {}),
1288
1289
  variant: "primary",
1289
1290
  size: "micro",
1290
1291
  children: [
1291
1292
  r,
1292
1293
  ": ",
1293
- a
1294
+ o
1294
1295
  ]
1295
1296
  }
1296
- ) })), It = at(({ field: r, min: a, max: d, onReset: i }) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
1297
- xe,
1297
+ ) })), It = ot(({ field: r, min: o, max: u, onReset: i }) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsxs(
1298
+ Se,
1298
1299
  {
1299
1300
  onClick: i,
1300
- iconRight: /* @__PURE__ */ e.jsx(ct, {}),
1301
+ iconRight: /* @__PURE__ */ e.jsx(lt, {}),
1301
1302
  variant: "primary",
1302
1303
  size: "micro",
1303
1304
  children: [
1304
1305
  r,
1305
1306
  ": ",
1306
- a,
1307
+ o,
1307
1308
  " – ",
1308
- d
1309
+ u
1309
1310
  ]
1310
1311
  }
1311
1312
  ) }));
1312
- function Zt() {
1313
+ function Kt() {
1313
1314
  const {
1314
- state: { filters: r, rangeFilters: a },
1315
- resetFilters: d,
1315
+ state: { filters: r, rangeFilters: o },
1316
+ resetFilters: u,
1316
1317
  resetSingleFilter: i
1317
- } = Te(), c = Ue(
1318
+ } = Ee(), c = Be(
1318
1319
  () => Object.entries(r).map(
1319
- ([x, n]) => n.map((b) => ({ field: x, value: b }))
1320
+ ([p, n]) => n.map((j) => ({ field: p, value: j }))
1320
1321
  ).flat(),
1321
1322
  [r]
1322
- ), v = Ue(
1323
- () => Object.entries(a).map(([x, { min: n, max: b }]) => ({ field: x, min: n, max: b })),
1324
- [a]
1323
+ ), m = Be(
1324
+ () => Object.entries(o).map(([p, { min: n, max: j }]) => ({ field: p, min: n, max: j })),
1325
+ [o]
1325
1326
  );
1326
- return Ue(
1327
- () => Object.keys(r).length > 0 || Object.keys(a).length > 0,
1328
- [r, a]
1329
- ) ? /* @__PURE__ */ e.jsx(ve, { collapsible: !1, title: "Active filters", children: /* @__PURE__ */ e.jsxs("ul", { className: Pt.grid, children: [
1330
- c.map(({ field: x, value: n }) => /* @__PURE__ */ e.jsx(
1331
- Ht,
1327
+ return Be(
1328
+ () => Object.keys(r).length > 0 || Object.keys(o).length > 0,
1329
+ [r, o]
1330
+ ) ? /* @__PURE__ */ e.jsx(be, { collapsible: !1, title: "Active filters", children: /* @__PURE__ */ e.jsxs("ul", { className: Ht.grid, children: [
1331
+ c.map(({ field: p, value: n }) => /* @__PURE__ */ e.jsx(
1332
+ $t,
1332
1333
  {
1333
- field: x,
1334
+ field: p,
1334
1335
  value: n,
1335
- onReset: () => i(x, n)
1336
+ onReset: () => i(p, n)
1336
1337
  },
1337
- `${x}-${n}`
1338
+ `${p}-${n}`
1338
1339
  )),
1339
- v.map(({ field: x, min: n, max: b }) => /* @__PURE__ */ e.jsx(
1340
+ m.map(({ field: p, min: n, max: j }) => /* @__PURE__ */ e.jsx(
1340
1341
  It,
1341
1342
  {
1342
- field: x,
1343
+ field: p,
1343
1344
  min: n,
1344
- max: b,
1345
- onReset: () => i(x)
1345
+ max: j,
1346
+ onReset: () => i(p)
1346
1347
  },
1347
- x
1348
+ p
1348
1349
  )),
1349
1350
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1350
- xe,
1351
+ Se,
1351
1352
  {
1352
- onClick: d,
1353
+ onClick: u,
1353
1354
  size: "micro",
1354
1355
  variant: "ghost",
1355
1356
  children: "Reset"
@@ -1357,91 +1358,91 @@ function Zt() {
1357
1358
  ) })
1358
1359
  ] }) }) : null;
1359
1360
  }
1360
- const $t = "_radioGroup_nwf7i_6", Wt = {
1361
- radioGroup: $t
1362
- }, Kt = ({ displayType: r = "dropdown", collapsible: a = !0, startCollapsed: d = !1 }) => {
1361
+ const Wt = "_radioGroup_nwf7i_6", Dt = {
1362
+ radioGroup: Wt
1363
+ }, er = ({ displayType: r = "dropdown", collapsible: o = !0, startCollapsed: u = !1 }) => {
1363
1364
  const {
1364
- state: { sortableFields: i, sortBy: c, sortAscending: v },
1365
- setSort: R
1366
- } = Te();
1365
+ state: { sortableFields: i, sortBy: c, sortAscending: m },
1366
+ setSort: M
1367
+ } = Ee();
1367
1368
  if (!i || i.length === 0) return null;
1368
- const x = c ? `${c}:${v ? "asc" : "desc"}` : "none", n = [
1369
+ const p = c ? `${c}:${m ? "asc" : "desc"}` : "none", n = [
1369
1370
  { label: "None", value: "none" },
1370
- ...i.flatMap((w) => [
1371
- { label: `${w} (asc)`, value: `${w}:asc` },
1372
- { label: `${w} (desc)`, value: `${w}:desc` }
1371
+ ...i.flatMap((E) => [
1372
+ { label: `${E} (asc)`, value: `${E}:asc` },
1373
+ { label: `${E} (desc)`, value: `${E}:desc` }
1373
1374
  ])
1374
- ], b = (w) => {
1375
- if (w === "none" || w === "")
1376
- R(null, !0);
1375
+ ], j = (E) => {
1376
+ if (E === "none" || E === "")
1377
+ M(null, !0);
1377
1378
  else {
1378
- const [$, S] = w.split(":");
1379
- R($, S === "asc");
1379
+ const [q, S] = E.split(":");
1380
+ M(q, S === "asc");
1380
1381
  }
1381
- }, O = a ? d : !1;
1382
+ }, I = o ? u : !1;
1382
1383
  return /* @__PURE__ */ e.jsx(
1383
- ve,
1384
+ be,
1384
1385
  {
1385
1386
  title: "Sort by",
1386
- collapsible: a,
1387
- collapsed: O,
1387
+ collapsible: o,
1388
+ collapsed: I,
1388
1389
  children: r === "dropdown" ? /* @__PURE__ */ e.jsx(
1389
- vt,
1390
+ xt,
1390
1391
  {
1391
- value: x,
1392
- onValueChange: b,
1392
+ value: p,
1393
+ onValueChange: j,
1393
1394
  options: n,
1394
1395
  placeholder: "Select sort..."
1395
1396
  }
1396
- ) : /* @__PURE__ */ e.jsx("div", { className: Wt.radioGroup, children: n.map((w) => /* @__PURE__ */ e.jsx(
1397
- xt,
1397
+ ) : /* @__PURE__ */ e.jsx("div", { className: Dt.radioGroup, children: n.map((E) => /* @__PURE__ */ e.jsx(
1398
+ bt,
1398
1399
  {
1399
- id: `sort-${w.value}`,
1400
+ id: `sort-${E.value}`,
1400
1401
  name: "sort-by",
1401
- value: w.value,
1402
- label: w.label,
1403
- checked: x === w.value,
1404
- onChange: ($) => b($.target.value)
1402
+ value: E.value,
1403
+ label: E.label,
1404
+ checked: p === E.value,
1405
+ onChange: (q) => j(q.target.value)
1405
1406
  },
1406
- w.value
1407
+ E.value
1407
1408
  )) })
1408
1409
  }
1409
1410
  );
1410
- }, Dt = "_list_1y4fk_1", qt = {
1411
- list: Dt
1411
+ }, qt = "_list_1y4fk_1", Bt = {
1412
+ list: qt
1412
1413
  };
1413
- function er() {
1414
+ function tr() {
1414
1415
  const {
1415
1416
  state: { searchSettings: r },
1416
- setSearchSettings: a
1417
- } = Te(), [d, i] = X(!1), c = (n, b) => {
1418
- const O = parseInt(b, 10);
1419
- isNaN(O) || a({
1420
- [n]: O
1417
+ setSearchSettings: o
1418
+ } = Ee(), [u, i] = U(!1), c = (n, j) => {
1419
+ const I = parseInt(j, 10);
1420
+ isNaN(I) || o({
1421
+ [n]: I
1421
1422
  });
1422
- }, v = (n, b) => {
1423
- a({
1424
- [n]: b
1423
+ }, m = (n, j) => {
1424
+ o({
1425
+ [n]: j
1425
1426
  });
1426
- }, R = (n, b) => {
1427
- const O = parseInt(b, 10);
1428
- isNaN(O) || a({
1427
+ }, M = (n, j) => {
1428
+ const I = parseInt(j, 10);
1429
+ isNaN(I) || o({
1429
1430
  coverageSetup: {
1430
1431
  ...r.coverageSetup,
1431
- [n]: O
1432
+ [n]: I
1432
1433
  }
1433
1434
  });
1434
- }, x = (n, b) => {
1435
- a({
1435
+ }, p = (n, j) => {
1436
+ o({
1436
1437
  coverageSetup: {
1437
1438
  ...r.coverageSetup,
1438
- [n]: b
1439
+ [n]: j
1439
1440
  }
1440
1441
  });
1441
1442
  };
1442
- return /* @__PURE__ */ e.jsx(ve, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ e.jsxs("ul", { className: qt.list, children: [
1443
+ return /* @__PURE__ */ e.jsx(be, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ e.jsxs("ul", { className: Bt.list, children: [
1443
1444
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1444
- Y,
1445
+ Z,
1445
1446
  {
1446
1447
  label: "Max Results",
1447
1448
  type: "number",
@@ -1450,7 +1451,7 @@ function er() {
1450
1451
  }
1451
1452
  ) }),
1452
1453
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1453
- Y,
1454
+ Z,
1454
1455
  {
1455
1456
  label: "Coverage Depth",
1456
1457
  type: "number",
@@ -1460,185 +1461,185 @@ function er() {
1460
1461
  ) }),
1461
1462
  /* @__PURE__ */ e.jsxs("li", { children: [
1462
1463
  /* @__PURE__ */ e.jsx(
1463
- Y,
1464
+ Z,
1464
1465
  {
1465
1466
  label: "Minimum Score",
1466
1467
  type: "number",
1467
1468
  value: r.minimumScore.toString(),
1468
1469
  onChange: (n) => {
1469
- const b = parseFloat(n.target.value);
1470
- isNaN(b) || a({ minimumScore: b });
1470
+ const j = parseFloat(n.target.value);
1471
+ isNaN(j) || o({ minimumScore: j });
1471
1472
  }
1472
1473
  }
1473
1474
  ),
1474
1475
  /* @__PURE__ */ e.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ e.jsx(
1475
- it,
1476
+ at,
1476
1477
  {
1477
1478
  min: 0,
1478
1479
  max: 255,
1479
1480
  step: 1,
1480
1481
  value: r.minimumScore,
1481
1482
  onChange: (n) => {
1482
- a({ minimumScore: n });
1483
+ o({ minimumScore: n });
1483
1484
  }
1484
1485
  }
1485
1486
  ) })
1486
1487
  ] }),
1487
1488
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1488
- Y,
1489
+ Z,
1489
1490
  {
1490
1491
  label: "Placeholder text",
1491
1492
  type: "text",
1492
1493
  value: r.placeholderText,
1493
1494
  onChange: (n) => {
1494
- a({ placeholderText: n.target.value });
1495
+ o({ placeholderText: n.target.value });
1495
1496
  }
1496
1497
  }
1497
1498
  ) }),
1498
1499
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1499
- ne,
1500
+ ae,
1500
1501
  {
1501
1502
  label: "Show score",
1502
1503
  checked: r.showScore,
1503
- onChange: (n) => v("showScore", n)
1504
+ onChange: (n) => m("showScore", n)
1504
1505
  }
1505
1506
  ) }),
1506
1507
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1507
- ne,
1508
+ ae,
1508
1509
  {
1509
1510
  label: "Enable Coverage",
1510
1511
  checked: r.enableCoverage,
1511
- onChange: (n) => v("enableCoverage", n)
1512
+ onChange: (n) => m("enableCoverage", n)
1512
1513
  }
1513
1514
  ) }),
1514
1515
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1515
- ne,
1516
+ ae,
1516
1517
  {
1517
1518
  label: "Remove Duplicates",
1518
1519
  checked: r.removeDuplicates,
1519
- onChange: (n) => v("removeDuplicates", n)
1520
+ onChange: (n) => m("removeDuplicates", n)
1520
1521
  }
1521
1522
  ) }),
1522
- /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(xe, { variant: "ghost", size: "micro", iconRight: d ? /* @__PURE__ */ e.jsx(Ft, {}) : /* @__PURE__ */ e.jsx(Mt, {}), onClick: () => i((n) => !n), children: d ? "Hide Coverage Setup" : "Show Coverage Setup" }) }),
1523
- d && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1523
+ /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(Se, { variant: "ghost", size: "micro", iconRight: u ? /* @__PURE__ */ e.jsx(Mt, {}) : /* @__PURE__ */ e.jsx(Nt, {}), onClick: () => i((n) => !n), children: u ? "Hide Coverage Setup" : "Show Coverage Setup" }) }),
1524
+ u && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1524
1525
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1525
- ne,
1526
+ ae,
1526
1527
  {
1527
1528
  label: "Cover Whole Query",
1528
1529
  checked: r.coverageSetup.coverWholeQuery,
1529
- onChange: (n) => x("coverWholeQuery", n)
1530
+ onChange: (n) => p("coverWholeQuery", n)
1530
1531
  }
1531
1532
  ) }),
1532
1533
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1533
- ne,
1534
+ ae,
1534
1535
  {
1535
1536
  label: "Cover Whole Words",
1536
1537
  checked: r.coverageSetup.coverWholeWords,
1537
- onChange: (n) => x("coverWholeWords", n)
1538
+ onChange: (n) => p("coverWholeWords", n)
1538
1539
  }
1539
1540
  ) }),
1540
1541
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1541
- ne,
1542
+ ae,
1542
1543
  {
1543
1544
  label: "Cover Fuzzy Words",
1544
1545
  checked: r.coverageSetup.coverFuzzyWords,
1545
- onChange: (n) => x("coverFuzzyWords", n)
1546
+ onChange: (n) => p("coverFuzzyWords", n)
1546
1547
  }
1547
1548
  ) }),
1548
1549
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1549
- ne,
1550
+ ae,
1550
1551
  {
1551
1552
  label: "Cover Joined Words",
1552
1553
  checked: r.coverageSetup.coverJoinedWords,
1553
- onChange: (n) => x("coverJoinedWords", n)
1554
+ onChange: (n) => p("coverJoinedWords", n)
1554
1555
  }
1555
1556
  ) }),
1556
1557
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1557
- ne,
1558
+ ae,
1558
1559
  {
1559
1560
  label: "Cover Prefix Suffix",
1560
1561
  checked: r.coverageSetup.coverPrefixSuffix,
1561
- onChange: (n) => x("coverPrefixSuffix", n)
1562
+ onChange: (n) => p("coverPrefixSuffix", n)
1562
1563
  }
1563
1564
  ) }),
1564
1565
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1565
- ne,
1566
+ ae,
1566
1567
  {
1567
1568
  label: "Truncate list",
1568
1569
  checked: r.coverageSetup.truncate,
1569
- onChange: (n) => x("truncate", n)
1570
+ onChange: (n) => p("truncate", n)
1570
1571
  }
1571
1572
  ) }),
1572
1573
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1573
- Y,
1574
+ Z,
1574
1575
  {
1575
1576
  label: "Levenshtein Max Word Size",
1576
1577
  type: "number",
1577
1578
  value: r.coverageSetup.levenshteinMaxWordSize.toString(),
1578
- onChange: (n) => R("levenshteinMaxWordSize", n.target.value)
1579
+ onChange: (n) => M("levenshteinMaxWordSize", n.target.value)
1579
1580
  }
1580
1581
  ) }),
1581
1582
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1582
- Y,
1583
+ Z,
1583
1584
  {
1584
1585
  label: "Min Word Size",
1585
1586
  type: "number",
1586
1587
  value: r.coverageSetup.minWordSize.toString(),
1587
- onChange: (n) => R("minWordSize", n.target.value)
1588
+ onChange: (n) => M("minWordSize", n.target.value)
1588
1589
  }
1589
1590
  ) }),
1590
1591
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1591
- Y,
1592
+ Z,
1592
1593
  {
1593
1594
  label: "Coverage Min Word Hits Abs",
1594
1595
  type: "number",
1595
1596
  value: r.coverageSetup.coverageMinWordHitsAbs.toString(),
1596
- onChange: (n) => R("coverageMinWordHitsAbs", n.target.value)
1597
+ onChange: (n) => M("coverageMinWordHitsAbs", n.target.value)
1597
1598
  }
1598
1599
  ) }),
1599
1600
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1600
- Y,
1601
+ Z,
1601
1602
  {
1602
1603
  label: "Coverage Min Word Hits Relative",
1603
1604
  type: "number",
1604
1605
  value: r.coverageSetup.coverageMinWordHitsRelative.toString(),
1605
- onChange: (n) => R("coverageMinWordHitsRelative", n.target.value)
1606
+ onChange: (n) => M("coverageMinWordHitsRelative", n.target.value)
1606
1607
  }
1607
1608
  ) }),
1608
1609
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1609
- Y,
1610
+ Z,
1610
1611
  {
1611
1612
  label: "Coverage Q Limit For Error Tolerance",
1612
1613
  type: "number",
1613
1614
  value: r.coverageSetup.coverageQLimitForErrorTolerance.toString(),
1614
- onChange: (n) => R("coverageQLimitForErrorTolerance", n.target.value)
1615
+ onChange: (n) => M("coverageQLimitForErrorTolerance", n.target.value)
1615
1616
  }
1616
1617
  ) }),
1617
1618
  /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx(
1618
- Y,
1619
+ Z,
1619
1620
  {
1620
1621
  label: "Coverage LCS Error Tolerance Relative Q",
1621
1622
  type: "number",
1622
1623
  value: r.coverageSetup.coverageLcsErrorToleranceRelativeq.toString(),
1623
- onChange: (n) => R("coverageLcsErrorToleranceRelativeq", n.target.value)
1624
+ onChange: (n) => M("coverageLcsErrorToleranceRelativeq", n.target.value)
1624
1625
  }
1625
1626
  ) })
1626
1627
  ] })
1627
1628
  ] }) });
1628
1629
  }
1629
- class tr extends mt {
1630
- constructor(d) {
1631
- super(d);
1632
- et(this, "reset", () => {
1630
+ class rr extends pt {
1631
+ constructor(u) {
1632
+ super(u);
1633
+ Ke(this, "reset", () => {
1633
1634
  this.setState({ hasError: !1, error: null });
1634
1635
  });
1635
1636
  this.state = { hasError: !1, error: null };
1636
1637
  }
1637
- static getDerivedStateFromError(d) {
1638
- return { hasError: !0, error: d };
1638
+ static getDerivedStateFromError(u) {
1639
+ return { hasError: !0, error: u };
1639
1640
  }
1640
- componentDidCatch(d, i) {
1641
- console.error("[SearchErrorBoundary] Caught error:", d, i);
1641
+ componentDidCatch(u, i) {
1642
+ console.error("[SearchErrorBoundary] Caught error:", u, i);
1642
1643
  }
1643
1644
  render() {
1644
1645
  return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : /* @__PURE__ */ e.jsxs("div", { style: {
@@ -1691,15 +1692,15 @@ class tr extends mt {
1691
1692
  }
1692
1693
  }
1693
1694
  export {
1694
- Zt as ActiveFiltersPanel,
1695
- Yt as RangeFilterPanel,
1696
- tr as SearchErrorBoundary,
1697
- Xt as SearchInput,
1698
- Gt as SearchProvider,
1699
- Jt as SearchResults,
1700
- er as SearchSettingsPanel,
1701
- Kt as SortByPanel,
1702
- Qt as ValueFilterPanel,
1703
- Te as useSearch,
1704
- Te as useSearchContext
1695
+ Kt as ActiveFiltersPanel,
1696
+ Zt as RangeFilterPanel,
1697
+ rr as SearchErrorBoundary,
1698
+ Jt as SearchInput,
1699
+ Xt as SearchProvider,
1700
+ Qt as SearchResults,
1701
+ tr as SearchSettingsPanel,
1702
+ er as SortByPanel,
1703
+ Yt as ValueFilterPanel,
1704
+ Ee as useSearch,
1705
+ Ee as useSearchContext
1705
1706
  };