@indxsearch/intrface 2.0.1 → 2.1.0

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