@indxsearch/intrface 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +350 -345
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var ht = Object.defineProperty;
|
|
|
2
2
|
var ft = (r, o, u) => o in r ? ht(r, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : r[o] = u;
|
|
3
3
|
var et = (r, o, u) => ft(r, typeof o != "symbol" ? o + "" : o, u);
|
|
4
4
|
import "@indxsearch/systm/styles.css";
|
|
5
|
-
import te, { createContext as gt, useRef as Fe, useState as
|
|
5
|
+
import te, { createContext as gt, useRef as Fe, useState as G, useEffect as ue, useCallback as ee, useMemo as ze, useContext as mt, memo as at, Component as pt } from "react";
|
|
6
6
|
import { SearchField as vt, Button as be, FilterPanelBase as xe, ToggleSwitch as oe, Checkbox as tt, Slider as it, InputField as Y, Select as xt, RadioButton as bt } from "@indxsearch/systm";
|
|
7
7
|
var Be = { exports: {} }, Pe = {};
|
|
8
8
|
/**
|
|
@@ -49,150 +49,150 @@ var He = {};
|
|
|
49
49
|
var st;
|
|
50
50
|
function yt() {
|
|
51
51
|
return st || (st = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
52
|
-
function r(
|
|
53
|
-
if (
|
|
54
|
-
if (typeof
|
|
55
|
-
return
|
|
56
|
-
if (typeof
|
|
57
|
-
switch (
|
|
52
|
+
function r(e) {
|
|
53
|
+
if (e == null) return null;
|
|
54
|
+
if (typeof e == "function")
|
|
55
|
+
return e.$$typeof === de ? null : e.displayName || e.name || null;
|
|
56
|
+
if (typeof e == "string") return e;
|
|
57
|
+
switch (e) {
|
|
58
58
|
case x:
|
|
59
59
|
return "Fragment";
|
|
60
60
|
case f:
|
|
61
61
|
return "Profiler";
|
|
62
|
-
case
|
|
62
|
+
case V:
|
|
63
63
|
return "StrictMode";
|
|
64
|
-
case
|
|
64
|
+
case D:
|
|
65
65
|
return "Suspense";
|
|
66
66
|
case g:
|
|
67
67
|
return "SuspenseList";
|
|
68
|
-
case
|
|
68
|
+
case U:
|
|
69
69
|
return "Activity";
|
|
70
70
|
}
|
|
71
|
-
if (typeof
|
|
72
|
-
switch (typeof
|
|
71
|
+
if (typeof e == "object")
|
|
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
|
-
),
|
|
75
|
-
case
|
|
74
|
+
), e.$$typeof) {
|
|
75
|
+
case W:
|
|
76
76
|
return "Portal";
|
|
77
|
-
case
|
|
78
|
-
return
|
|
77
|
+
case w:
|
|
78
|
+
return e.displayName || "Context";
|
|
79
79
|
case s:
|
|
80
|
-
return (
|
|
80
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
81
81
|
case M:
|
|
82
|
-
var a =
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
return a =
|
|
86
|
-
case
|
|
87
|
-
a =
|
|
82
|
+
var a = e.render;
|
|
83
|
+
return e = e.displayName, e || (e = a.displayName || a.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
84
|
+
case L:
|
|
85
|
+
return a = e.displayName || null, a !== null ? a : r(e.type) || "Memo";
|
|
86
|
+
case ae:
|
|
87
|
+
a = e._payload, e = e._init;
|
|
88
88
|
try {
|
|
89
|
-
return r(
|
|
89
|
+
return r(e(a));
|
|
90
90
|
} catch {
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return null;
|
|
94
94
|
}
|
|
95
|
-
function o(
|
|
96
|
-
return "" +
|
|
95
|
+
function o(e) {
|
|
96
|
+
return "" + e;
|
|
97
97
|
}
|
|
98
|
-
function u(
|
|
98
|
+
function u(e) {
|
|
99
99
|
try {
|
|
100
|
-
o(
|
|
100
|
+
o(e);
|
|
101
101
|
var a = !1;
|
|
102
102
|
} catch {
|
|
103
103
|
a = !0;
|
|
104
104
|
}
|
|
105
105
|
if (a) {
|
|
106
106
|
a = console;
|
|
107
|
-
var v = a.error, k = typeof Symbol == "function" && Symbol.toStringTag &&
|
|
107
|
+
var v = a.error, k = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
108
108
|
return v.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
111
|
k
|
|
112
|
-
), o(
|
|
112
|
+
), o(e);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
function i(
|
|
116
|
-
if (
|
|
117
|
-
if (typeof
|
|
115
|
+
function i(e) {
|
|
116
|
+
if (e === x) return "<>";
|
|
117
|
+
if (typeof e == "object" && e !== null && e.$$typeof === ae)
|
|
118
118
|
return "<...>";
|
|
119
119
|
try {
|
|
120
|
-
var a = r(
|
|
120
|
+
var a = r(e);
|
|
121
121
|
return a ? "<" + a + ">" : "<...>";
|
|
122
122
|
} catch {
|
|
123
123
|
return "<...>";
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
function c() {
|
|
127
|
-
var
|
|
128
|
-
return
|
|
127
|
+
var e = T.A;
|
|
128
|
+
return e === null ? null : e.getOwner();
|
|
129
129
|
}
|
|
130
130
|
function m() {
|
|
131
131
|
return Error("react-stack-top-frame");
|
|
132
132
|
}
|
|
133
|
-
function F(
|
|
134
|
-
if (me.call(
|
|
135
|
-
var a = Object.getOwnPropertyDescriptor(
|
|
133
|
+
function F(e) {
|
|
134
|
+
if (me.call(e, "key")) {
|
|
135
|
+
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
136
136
|
if (a && a.isReactWarning) return !1;
|
|
137
137
|
}
|
|
138
|
-
return
|
|
138
|
+
return e.key !== void 0;
|
|
139
139
|
}
|
|
140
|
-
function p(
|
|
140
|
+
function p(e, a) {
|
|
141
141
|
function v() {
|
|
142
142
|
z || (z = !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
144
|
a
|
|
145
145
|
));
|
|
146
146
|
}
|
|
147
|
-
v.isReactWarning = !0, Object.defineProperty(
|
|
147
|
+
v.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
148
148
|
get: v,
|
|
149
149
|
configurable: !0
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function n() {
|
|
153
|
-
var
|
|
154
|
-
return pe[
|
|
153
|
+
var e = r(this.type);
|
|
154
|
+
return pe[e] || (pe[e] = !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
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
157
157
|
}
|
|
158
|
-
function j(
|
|
158
|
+
function j(e, a, v, k, ie, ve) {
|
|
159
159
|
var N = v.ref;
|
|
160
|
-
return
|
|
160
|
+
return e = {
|
|
161
161
|
$$typeof: Z,
|
|
162
|
-
type:
|
|
162
|
+
type: e,
|
|
163
163
|
key: a,
|
|
164
164
|
props: v,
|
|
165
165
|
_owner: k
|
|
166
|
-
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(
|
|
166
|
+
}, (N !== void 0 ? N : null) !== null ? Object.defineProperty(e, "ref", {
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
get: n
|
|
169
|
-
}) : Object.defineProperty(
|
|
169
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
170
170
|
configurable: !1,
|
|
171
171
|
enumerable: !1,
|
|
172
172
|
writable: !0,
|
|
173
173
|
value: 0
|
|
174
|
-
}), Object.defineProperty(
|
|
174
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
178
|
value: null
|
|
179
|
-
}), Object.defineProperty(
|
|
179
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.defineProperty(
|
|
183
|
+
value: ie
|
|
184
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
185
185
|
configurable: !1,
|
|
186
186
|
enumerable: !1,
|
|
187
187
|
writable: !0,
|
|
188
188
|
value: ve
|
|
189
|
-
}), Object.freeze && (Object.freeze(
|
|
189
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
190
190
|
}
|
|
191
|
-
function I(
|
|
191
|
+
function I(e, a, v, k, ie, ve) {
|
|
192
192
|
var N = a.children;
|
|
193
193
|
if (N !== void 0)
|
|
194
194
|
if (k)
|
|
195
|
-
if (
|
|
195
|
+
if (A(N)) {
|
|
196
196
|
for (k = 0; k < N.length; k++)
|
|
197
197
|
R(N[k]);
|
|
198
198
|
Object.freeze && Object.freeze(N);
|
|
@@ -202,11 +202,11 @@ function yt() {
|
|
|
202
202
|
);
|
|
203
203
|
else R(N);
|
|
204
204
|
if (me.call(a, "key")) {
|
|
205
|
-
N = r(
|
|
205
|
+
N = r(e);
|
|
206
206
|
var re = Object.keys(a).filter(function(Ne) {
|
|
207
207
|
return Ne !== "key";
|
|
208
208
|
});
|
|
209
|
-
k = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
209
|
+
k = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", C[N + k] || (re = 0 < re.length ? "{" + re.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} />
|
|
@@ -217,7 +217,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
217
217
|
N,
|
|
218
218
|
re,
|
|
219
219
|
N
|
|
220
|
-
),
|
|
220
|
+
), C[N + k] = !0);
|
|
221
221
|
}
|
|
222
222
|
if (N = null, v !== void 0 && (u(v), N = "" + v), F(a) && (u(a.key), N = "" + a.key), "key" in a) {
|
|
223
223
|
v = {};
|
|
@@ -226,53 +226,53 @@ React keys must be passed directly to JSX without using spread:
|
|
|
226
226
|
} else v = a;
|
|
227
227
|
return N && p(
|
|
228
228
|
v,
|
|
229
|
-
typeof
|
|
229
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
230
230
|
), j(
|
|
231
|
-
|
|
231
|
+
e,
|
|
232
232
|
N,
|
|
233
233
|
v,
|
|
234
234
|
c(),
|
|
235
|
-
|
|
235
|
+
ie,
|
|
236
236
|
ve
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
-
function R(
|
|
240
|
-
B(
|
|
239
|
+
function R(e) {
|
|
240
|
+
B(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === ae && (e._payload.status === "fulfilled" ? B(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
241
241
|
}
|
|
242
|
-
function B(
|
|
243
|
-
return typeof
|
|
242
|
+
function B(e) {
|
|
243
|
+
return typeof e == "object" && e !== null && e.$$typeof === Z;
|
|
244
244
|
}
|
|
245
|
-
var b = te, Z = Symbol.for("react.transitional.element"),
|
|
245
|
+
var b = te, Z = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), s = Symbol.for("react.consumer"), w = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), ae = Symbol.for("react.lazy"), U = Symbol.for("react.activity"), de = Symbol.for("react.client.reference"), T = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, me = Object.prototype.hasOwnProperty, A = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
246
246
|
return null;
|
|
247
247
|
};
|
|
248
248
|
b = {
|
|
249
|
-
react_stack_bottom_frame: function(
|
|
250
|
-
return
|
|
249
|
+
react_stack_bottom_frame: function(e) {
|
|
250
|
+
return e();
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
|
-
var z, pe = {},
|
|
253
|
+
var z, pe = {}, he = b.react_stack_bottom_frame.bind(
|
|
254
254
|
b,
|
|
255
255
|
m
|
|
256
|
-
)(), h = S(i(m)),
|
|
257
|
-
He.Fragment = x, He.jsx = function(
|
|
256
|
+
)(), h = S(i(m)), C = {};
|
|
257
|
+
He.Fragment = x, He.jsx = function(e, a, v) {
|
|
258
258
|
var k = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
259
259
|
return I(
|
|
260
|
-
|
|
260
|
+
e,
|
|
261
261
|
a,
|
|
262
262
|
v,
|
|
263
263
|
!1,
|
|
264
|
-
k ? Error("react-stack-top-frame") :
|
|
265
|
-
k ? S(i(
|
|
264
|
+
k ? Error("react-stack-top-frame") : he,
|
|
265
|
+
k ? S(i(e)) : h
|
|
266
266
|
);
|
|
267
|
-
}, He.jsxs = function(
|
|
267
|
+
}, He.jsxs = function(e, a, v) {
|
|
268
268
|
var k = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
269
269
|
return I(
|
|
270
|
-
|
|
270
|
+
e,
|
|
271
271
|
a,
|
|
272
272
|
v,
|
|
273
273
|
!0,
|
|
274
|
-
k ? Error("react-stack-top-frame") :
|
|
275
|
-
k ? S(i(
|
|
274
|
+
k ? Error("react-stack-top-frame") : he,
|
|
275
|
+
k ? S(i(e)) : h
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
})()), He;
|
|
@@ -281,7 +281,7 @@ var nt;
|
|
|
281
281
|
function jt() {
|
|
282
282
|
return nt || (nt = 1, process.env.NODE_ENV === "production" ? Be.exports = St() : Be.exports = yt()), Be.exports;
|
|
283
283
|
}
|
|
284
|
-
var
|
|
284
|
+
var t = jt();
|
|
285
285
|
const lt = gt(void 0);
|
|
286
286
|
function Ct(r, o) {
|
|
287
287
|
let u;
|
|
@@ -308,7 +308,7 @@ const Xt = ({
|
|
|
308
308
|
enableDebugLogs: b = !1,
|
|
309
309
|
preAuthenticatedToken: Z
|
|
310
310
|
}) => {
|
|
311
|
-
const
|
|
311
|
+
const W = Fe(0), x = Fe(void 0), V = Fe(!1), f = Fe(!1), [s, w] = G({
|
|
312
312
|
query: "",
|
|
313
313
|
results: null,
|
|
314
314
|
isLoading: !1,
|
|
@@ -345,15 +345,15 @@ const Xt = ({
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
|
-
|
|
348
|
+
ue(() => {
|
|
349
349
|
b && console.log("SearchContext mounted on client");
|
|
350
|
-
}, [b]),
|
|
351
|
-
|
|
350
|
+
}, [b]), ue(() => {
|
|
351
|
+
w((l) => ({
|
|
352
352
|
...l,
|
|
353
353
|
facetDebounceDelayMillis: p
|
|
354
354
|
}));
|
|
355
355
|
}, [p]);
|
|
356
|
-
const [M,
|
|
356
|
+
const [M, D] = G(null), [g] = G(n), L = ee((l, d = {}) => {
|
|
357
357
|
if (!M)
|
|
358
358
|
throw new Error("No authentication token available");
|
|
359
359
|
return fetch(l, {
|
|
@@ -364,20 +364,20 @@ const Xt = ({
|
|
|
364
364
|
},
|
|
365
365
|
credentials: "include"
|
|
366
366
|
});
|
|
367
|
-
}, [M]), [
|
|
368
|
-
|
|
367
|
+
}, [M]), [ae, U] = G([]), [de, T] = G([]), [me, A] = G([]), [S, z] = G(!0), [pe, he] = G({}), [h, C] = G({}), [e, a] = G({}), [v, k] = G(""), [ie, ve] = G(""), [N, re] = G({}), Se = Fe(null), Ne = ee((l) => {
|
|
368
|
+
w((d) => ({
|
|
369
369
|
...d,
|
|
370
370
|
query: l,
|
|
371
371
|
filters: {},
|
|
372
372
|
rangeFilters: {}
|
|
373
373
|
}));
|
|
374
374
|
}, []), O = ee((l) => {
|
|
375
|
-
|
|
375
|
+
w((d) => ({
|
|
376
376
|
...d,
|
|
377
377
|
facetDebounceDelayMillis: l
|
|
378
378
|
}));
|
|
379
379
|
}, []), P = ee((l) => {
|
|
380
|
-
|
|
380
|
+
w((d) => ({
|
|
381
381
|
...d,
|
|
382
382
|
searchSettings: {
|
|
383
383
|
...d.searchSettings,
|
|
@@ -389,15 +389,15 @@ const Xt = ({
|
|
|
389
389
|
}
|
|
390
390
|
}));
|
|
391
391
|
}, []), X = ee((l, d) => {
|
|
392
|
-
|
|
393
|
-
const _ = { ...y.filters }, H = _[l] || [],
|
|
394
|
-
return
|
|
392
|
+
w((y) => {
|
|
393
|
+
const _ = { ...y.filters }, H = _[l] || [], q = H.includes(d) ? H.filter((Q) => Q !== d) : [...H, d];
|
|
394
|
+
return q.length ? _[l] = q : delete _[l], {
|
|
395
395
|
...y,
|
|
396
396
|
filters: _
|
|
397
397
|
};
|
|
398
398
|
});
|
|
399
399
|
}, []), _e = ee((l, d, y) => {
|
|
400
|
-
|
|
400
|
+
w((_) => ({
|
|
401
401
|
..._,
|
|
402
402
|
rangeFilters: {
|
|
403
403
|
..._.rangeFilters,
|
|
@@ -405,16 +405,16 @@ const Xt = ({
|
|
|
405
405
|
}
|
|
406
406
|
}));
|
|
407
407
|
}, []), Te = ee(() => {
|
|
408
|
-
|
|
408
|
+
w((l) => ({
|
|
409
409
|
...l,
|
|
410
410
|
filters: {},
|
|
411
411
|
rangeFilters: {}
|
|
412
412
|
}));
|
|
413
413
|
}, []), Ae = ee((l, d) => {
|
|
414
|
-
|
|
414
|
+
w((y) => {
|
|
415
415
|
const _ = { ...y.filters }, H = { ...y.rangeFilters };
|
|
416
416
|
if (d !== void 0) {
|
|
417
|
-
const Q = (_[l] || []).filter((
|
|
417
|
+
const Q = (_[l] || []).filter((ce) => ce !== d);
|
|
418
418
|
Q.length > 0 ? _[l] = Q : delete _[l];
|
|
419
419
|
} else
|
|
420
420
|
delete H[l];
|
|
@@ -425,7 +425,7 @@ const Xt = ({
|
|
|
425
425
|
};
|
|
426
426
|
});
|
|
427
427
|
}, []), Le = ee((l, d) => {
|
|
428
|
-
|
|
428
|
+
w((y) => ({
|
|
429
429
|
...y,
|
|
430
430
|
sortBy: l || void 0,
|
|
431
431
|
sortAscending: l ? d : void 0
|
|
@@ -435,7 +435,7 @@ const Xt = ({
|
|
|
435
435
|
if (l.length === 1) return l[0];
|
|
436
436
|
let _ = l[0];
|
|
437
437
|
for (let H = 1; H < l.length; H++) {
|
|
438
|
-
const
|
|
438
|
+
const q = await L(`${d}/api/CombineFilters/${y}`, {
|
|
439
439
|
// Combine the current filter with the next filter
|
|
440
440
|
method: "PUT",
|
|
441
441
|
headers: {
|
|
@@ -443,14 +443,14 @@ const Xt = ({
|
|
|
443
443
|
},
|
|
444
444
|
body: JSON.stringify({ A: _, B: l[H], useAndOperation: !0 })
|
|
445
445
|
});
|
|
446
|
-
if (!
|
|
447
|
-
const Q = await
|
|
446
|
+
if (!q.ok) {
|
|
447
|
+
const Q = await q.json();
|
|
448
448
|
throw console.error("CombineFilters failed:", Q), new Error("CombineFilters failed");
|
|
449
449
|
}
|
|
450
|
-
_ = await
|
|
450
|
+
_ = await q.json();
|
|
451
451
|
}
|
|
452
452
|
return _;
|
|
453
|
-
}, [
|
|
453
|
+
}, [L]), Ue = s.searchSettings.maxNumberOfRecordsToReturn, Ge = s.searchSettings.enableCoverage, Xe = s.searchSettings.removeDuplicates, Je = s.searchSettings.coverageDepth, Qe = s.searchSettings.minimumScore, Ie = s.sortBy, We = s.sortAscending, Ye = ze(() => s.searchSettings.coverageSetup, [
|
|
454
454
|
s.searchSettings.coverageSetup.levenshteinMaxWordSize,
|
|
455
455
|
s.searchSettings.coverageSetup.minWordSize,
|
|
456
456
|
s.searchSettings.coverageSetup.coverageMinWordHitsAbs,
|
|
@@ -466,36 +466,36 @@ const Xt = ({
|
|
|
466
466
|
]), Ze = ee(
|
|
467
467
|
async ({ enableFacets: l }) => {
|
|
468
468
|
if (!M) return;
|
|
469
|
-
const d = ++
|
|
470
|
-
|
|
469
|
+
const d = ++W.current;
|
|
470
|
+
w((y) => ({ ...y, isLoading: !0 }));
|
|
471
471
|
try {
|
|
472
472
|
const y = Object.entries(s.filters ?? {}), H = (await Promise.all(
|
|
473
473
|
y.map(
|
|
474
474
|
async ([$, J]) => Promise.all(
|
|
475
475
|
J.map(
|
|
476
|
-
(K) =>
|
|
476
|
+
(K) => L(`${i}/api/CreateValueFilter/${c}`, {
|
|
477
477
|
method: "PUT",
|
|
478
478
|
headers: {
|
|
479
479
|
"Content-Type": "application/json"
|
|
480
480
|
},
|
|
481
481
|
body: JSON.stringify({ FieldName: $, Value: K })
|
|
482
|
-
}).then((
|
|
482
|
+
}).then((ge) => ge.json())
|
|
483
483
|
)
|
|
484
484
|
)
|
|
485
485
|
)
|
|
486
|
-
)).flat(),
|
|
487
|
-
|
|
488
|
-
([$, { min: J, max: K }]) =>
|
|
486
|
+
)).flat(), q = Object.entries(s.rangeFilters ?? {}), Q = await Promise.all(
|
|
487
|
+
q.map(
|
|
488
|
+
([$, { min: J, max: K }]) => L(`${i}/api/CreateRangeFilter/${c}`, {
|
|
489
489
|
method: "PUT",
|
|
490
490
|
headers: {
|
|
491
491
|
"Content-Type": "application/json"
|
|
492
492
|
},
|
|
493
493
|
body: JSON.stringify({ FieldName: $, LowerLimit: J, UpperLimit: K })
|
|
494
|
-
}).then((
|
|
494
|
+
}).then((ge) => ge.json())
|
|
495
495
|
)
|
|
496
|
-
),
|
|
496
|
+
), ce = [...H, ...Q].filter(
|
|
497
497
|
($) => $ && typeof $.hashString == "string"
|
|
498
|
-
), se = await $e(
|
|
498
|
+
), se = await $e(ce, i, c), ye = m || s.query.trim() !== "", De = {
|
|
499
499
|
text: s.query,
|
|
500
500
|
maxNumberOfRecordsToReturn: ye ? Ue : 0,
|
|
501
501
|
enableFacets: l,
|
|
@@ -508,7 +508,7 @@ const Xt = ({
|
|
|
508
508
|
coverageSetup: Ye
|
|
509
509
|
};
|
|
510
510
|
b && console.log("[performSearch] request body:", JSON.stringify(De, null, 2));
|
|
511
|
-
const we = await (await
|
|
511
|
+
const we = await (await L(`${i}/api/Search/${c}`, {
|
|
512
512
|
method: "POST",
|
|
513
513
|
headers: {
|
|
514
514
|
"Content-Type": "application/json"
|
|
@@ -516,33 +516,33 @@ const Xt = ({
|
|
|
516
516
|
body: JSON.stringify(De)
|
|
517
517
|
})).json(), je = we.truncationIndex ?? -1, Ce = we.records || [], ke = Ce.map(($) => $.documentKey), E = Ce.map(($) => $.score);
|
|
518
518
|
let ne = [];
|
|
519
|
-
ye && ke.length > 0 && (ne = (await (await
|
|
519
|
+
ye && ke.length > 0 && (ne = (await (await L(`${i}/api/GetJson/${c}`, {
|
|
520
520
|
method: "POST",
|
|
521
521
|
headers: {
|
|
522
522
|
"Content-Type": "application/json"
|
|
523
523
|
},
|
|
524
524
|
body: JSON.stringify(ke)
|
|
525
|
-
})).json()).map((K,
|
|
525
|
+
})).json()).map((K, ge) => ({
|
|
526
526
|
document: K,
|
|
527
|
-
documentKey: ke[
|
|
528
|
-
score: E[
|
|
527
|
+
documentKey: ke[ge],
|
|
528
|
+
score: E[ge]
|
|
529
529
|
})));
|
|
530
|
-
let
|
|
530
|
+
let fe = {};
|
|
531
531
|
if (l && we.facets) {
|
|
532
532
|
for (const [$, J] of Object.entries(we.facets))
|
|
533
533
|
if (Array.isArray(J) && J.length > 0) {
|
|
534
|
-
const K = J.map((
|
|
535
|
-
K.length > 0 && (
|
|
534
|
+
const K = J.map((ge) => Number(ge.key)).filter((ge) => !isNaN(ge));
|
|
535
|
+
K.length > 0 && (fe[$] = {
|
|
536
536
|
min: Math.min(...K),
|
|
537
537
|
max: Math.max(...K)
|
|
538
538
|
});
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
const Ve = s.query !== v, ut = s.query !==
|
|
541
|
+
const Ve = s.query !== v, ut = s.query !== ie;
|
|
542
542
|
let qe = s.facetStats ?? {};
|
|
543
|
-
if (Ve ? (qe = { ...pe, ...
|
|
543
|
+
if (Ve ? (qe = { ...pe, ...fe }, a(qe), k(s.query)) : qe = { ...e, ...fe }, ut && l) {
|
|
544
544
|
const $ = { ...N };
|
|
545
|
-
for (const [J, K] of Object.entries(
|
|
545
|
+
for (const [J, K] of Object.entries(fe))
|
|
546
546
|
$[J] = K;
|
|
547
547
|
re($), ve(s.query);
|
|
548
548
|
}
|
|
@@ -552,13 +552,13 @@ const Xt = ({
|
|
|
552
552
|
for (const [$, J] of Object.entries(h))
|
|
553
553
|
Oe[$] = J.map((K) => ({ key: K, value: null }));
|
|
554
554
|
}
|
|
555
|
-
if (d !==
|
|
555
|
+
if (d !== W.current)
|
|
556
556
|
return;
|
|
557
557
|
const dt = ne.filter(($) => {
|
|
558
558
|
const J = s.query.trim();
|
|
559
559
|
return J === "" || J.length === 1 ? !0 : $.score >= Qe;
|
|
560
560
|
});
|
|
561
|
-
|
|
561
|
+
w(($) => ({
|
|
562
562
|
...$,
|
|
563
563
|
results: dt,
|
|
564
564
|
resultsSuppressed: !ye,
|
|
@@ -570,9 +570,9 @@ const Xt = ({
|
|
|
570
570
|
truncationIndex: je
|
|
571
571
|
}));
|
|
572
572
|
} catch (y) {
|
|
573
|
-
if (console.error("[Search] ❌ Search failed:", y), y instanceof TypeError && y.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", i)) : y instanceof Error && (y.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"}'`)) : y.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", y.message)), d !==
|
|
573
|
+
if (console.error("[Search] ❌ Search failed:", y), y instanceof TypeError && y.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", i)) : y instanceof Error && (y.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"}'`)) : y.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error('[Search] 💡 Check that dataset "' + c + '" exists')) : console.error("[Search] 💡 Error:", y.message)), d !== W.current)
|
|
574
574
|
return;
|
|
575
|
-
|
|
575
|
+
w((_) => ({
|
|
576
576
|
..._,
|
|
577
577
|
results: null,
|
|
578
578
|
isLoading: !1,
|
|
@@ -593,7 +593,7 @@ const Xt = ({
|
|
|
593
593
|
Je,
|
|
594
594
|
Ye,
|
|
595
595
|
Qe,
|
|
596
|
-
|
|
596
|
+
L,
|
|
597
597
|
$e,
|
|
598
598
|
i,
|
|
599
599
|
c,
|
|
@@ -601,46 +601,46 @@ const Xt = ({
|
|
|
601
601
|
M
|
|
602
602
|
]
|
|
603
603
|
);
|
|
604
|
-
|
|
604
|
+
ue(() => {
|
|
605
605
|
x.current = Ze;
|
|
606
606
|
}, [Ze]), ee(() => {
|
|
607
607
|
var l;
|
|
608
608
|
b && console.log("Search fired"), (l = x.current) == null || l.call(x, { enableFacets: !1 });
|
|
609
609
|
}, []);
|
|
610
|
-
const
|
|
611
|
-
return
|
|
610
|
+
const le = Fe(null);
|
|
611
|
+
return ue(() => {
|
|
612
612
|
var l;
|
|
613
|
-
return (l =
|
|
613
|
+
return (l = le.current) == null || l.cancel(), le.current = Ct(() => {
|
|
614
614
|
var d;
|
|
615
615
|
b && console.log("Debounced searchWithFacets fired"), (d = x.current) == null || d.call(x, { enableFacets: !0 });
|
|
616
616
|
}, s.facetDebounceDelayMillis ?? 500), () => {
|
|
617
617
|
var d;
|
|
618
|
-
(d =
|
|
618
|
+
(d = le.current) == null || d.cancel();
|
|
619
619
|
};
|
|
620
620
|
}, [s.facetDebounceDelayMillis]), ee(() => {
|
|
621
621
|
var l;
|
|
622
|
-
(l =
|
|
623
|
-
}, []),
|
|
622
|
+
(l = le.current) == null || l.call(le);
|
|
623
|
+
}, []), ue(() => {
|
|
624
624
|
var l;
|
|
625
|
-
!S && M && !
|
|
626
|
-
}, [S, M, m, g]),
|
|
627
|
-
var _, H,
|
|
628
|
-
if (!M || !
|
|
625
|
+
!S && M && !V.current && (m && ((l = x.current) == null || l.call(x, { enableFacets: g })), V.current = !0);
|
|
626
|
+
}, [S, M, m, g]), ue(() => {
|
|
627
|
+
var _, H, q, Q, ce;
|
|
628
|
+
if (!M || !V.current) return;
|
|
629
629
|
const l = s.query.trim(), d = l === "" && m;
|
|
630
630
|
if (l === "" && !m) {
|
|
631
|
-
s.resultsSuppressed ||
|
|
631
|
+
s.resultsSuppressed || w((se) => ({
|
|
632
632
|
...se,
|
|
633
633
|
resultsSuppressed: !0
|
|
634
634
|
}));
|
|
635
635
|
return;
|
|
636
636
|
}
|
|
637
|
-
return d ? ((_ =
|
|
637
|
+
return d ? ((_ = le.current) == null || _.cancel(), (H = x.current) == null || H.call(x, { enableFacets: g })) : g ? (b && console.log("Search fired"), (q = x.current) == null || q.call(x, { enableFacets: !1 }), (Q = le.current) == null || Q.call(le)) : (ce = x.current) == null || ce.call(x, { enableFacets: !1 }), () => {
|
|
638
638
|
var se;
|
|
639
|
-
(se =
|
|
639
|
+
(se = le.current) == null || se.cancel();
|
|
640
640
|
};
|
|
641
|
-
}, [s.query, m, g]),
|
|
641
|
+
}, [s.query, m, g]), ue(() => {
|
|
642
642
|
var y;
|
|
643
|
-
if (!
|
|
643
|
+
if (!V.current || !M) return;
|
|
644
644
|
if (!f.current) {
|
|
645
645
|
f.current = !0, b && console.log("[Filter effect] First run, skipping");
|
|
646
646
|
return;
|
|
@@ -651,12 +651,12 @@ const Xt = ({
|
|
|
651
651
|
}
|
|
652
652
|
const l = s.query.trim();
|
|
653
653
|
g && !(!m && l === "") && (b && console.log("[Filter effect] Firing search"), (y = x.current) == null || y.call(x, { enableFacets: !0 }));
|
|
654
|
-
}, [s.filters, s.rangeFilters]),
|
|
654
|
+
}, [s.filters, s.rangeFilters]), ue(() => {
|
|
655
655
|
var y;
|
|
656
|
-
if (!
|
|
656
|
+
if (!V.current || !M) return;
|
|
657
657
|
const l = s.query.trim();
|
|
658
658
|
g && !(!m && l === "") && ((y = x.current) == null || y.call(x, { enableFacets: !0 }));
|
|
659
|
-
}, [Ie, We]),
|
|
659
|
+
}, [Ie, We]), ue(() => {
|
|
660
660
|
(async () => {
|
|
661
661
|
try {
|
|
662
662
|
let d;
|
|
@@ -699,7 +699,7 @@ const Xt = ({
|
|
|
699
699
|
});
|
|
700
700
|
if (!y.ok)
|
|
701
701
|
throw console.error("[Auth] ❌ CreateOrOpen failed:", y.status, await y.text()), new Error("Failed to open dataset session.");
|
|
702
|
-
|
|
702
|
+
D(d), b && console.log("[Auth] ✅ Dataset session established");
|
|
703
703
|
const _ = (E) => fetch(E, {
|
|
704
704
|
method: "GET",
|
|
705
705
|
headers: {
|
|
@@ -720,23 +720,23 @@ const Xt = ({
|
|
|
720
720
|
throw console.error("[Auth] ❌ Failed to get dataset status:", H.status, E), console.error("[Auth] 💡 Check if your INDX server is running at:", i), new Error("Failed to connect to INDX server. Check console for details.");
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
|
-
const
|
|
724
|
-
b && console.log("[Auth] 📊 Dataset status:",
|
|
725
|
-
const Q =
|
|
723
|
+
const q = await H.json();
|
|
724
|
+
b && console.log("[Auth] 📊 Dataset status:", q), q.state && q.state !== "Ready" && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", q.state), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
|
|
725
|
+
const Q = q.documentCount ?? q.numberOfRecords ?? 0;
|
|
726
726
|
Q === 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")) : b && console.log("[Auth] ✅ Dataset has", Q, "records");
|
|
727
|
-
const [
|
|
727
|
+
const [ce, se, ye] = await Promise.all([
|
|
728
728
|
_(`${i}/api/GetFilterableFields/${c}`),
|
|
729
729
|
_(`${i}/api/GetFacetableFields/${c}`),
|
|
730
730
|
_(`${i}/api/GetSortableFields/${c}`)
|
|
731
731
|
]);
|
|
732
|
-
if (!
|
|
733
|
-
throw console.error("[Auth] ❌ GetFilterableFields failed:",
|
|
732
|
+
if (!ce.ok)
|
|
733
|
+
throw console.error("[Auth] ❌ GetFilterableFields failed:", ce.status, await ce.text()), new Error("Failed to get filterable fields. Check console for details.");
|
|
734
734
|
if (!se.ok)
|
|
735
735
|
throw console.error("[Auth] ❌ GetFacetableFields failed:", se.status, await se.text()), new Error("Failed to get facetable fields. Check console for details.");
|
|
736
736
|
if (!ye.ok)
|
|
737
737
|
throw console.error("[Auth] ❌ GetSortableFields failed:", ye.status, await ye.text()), new Error("Failed to get sortable fields. Check console for details.");
|
|
738
|
-
const De = await
|
|
739
|
-
|
|
738
|
+
const De = await ce.json().catch((E) => (console.error("Failed to parse GetFilterableFields response:", E), [])), Ke = await se.json().catch((E) => (console.error("Failed to parse GetFacetableFields response:", E), [])), we = await ye.json().catch((E) => (console.error("Failed to parse GetSortableFields response:", E), []));
|
|
739
|
+
U(De || []), T(Ke || []), A(we || []);
|
|
740
740
|
let je = { facets: {} };
|
|
741
741
|
try {
|
|
742
742
|
const E = await fetch(`${i}/api/Search/${c}`, {
|
|
@@ -756,22 +756,22 @@ const Xt = ({
|
|
|
756
756
|
if (je.facets) {
|
|
757
757
|
for (const [E, ne] of Object.entries(je.facets))
|
|
758
758
|
if (Array.isArray(ne) && ne.length > 0) {
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
min: Math.min(...
|
|
762
|
-
max: Math.max(...
|
|
759
|
+
const fe = ne.map((Ve) => Number(Ve.key)).filter((Ve) => !isNaN(Ve));
|
|
760
|
+
fe.length > 0 && (Ce[E] = {
|
|
761
|
+
min: Math.min(...fe),
|
|
762
|
+
max: Math.max(...fe)
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
766
|
const ke = {};
|
|
767
767
|
if (je.facets)
|
|
768
768
|
for (const [E, ne] of Object.entries(je.facets))
|
|
769
|
-
Array.isArray(ne) && (ke[E] = ne.map((
|
|
769
|
+
Array.isArray(ne) && (ke[E] = ne.map((fe) => fe.key));
|
|
770
770
|
Se.current = {
|
|
771
771
|
facets: je.facets,
|
|
772
772
|
facetStats: Ce,
|
|
773
773
|
facetKeys: ke
|
|
774
|
-
},
|
|
774
|
+
}, he(Ce), C(ke), re(Ce), w((E) => ({
|
|
775
775
|
...E,
|
|
776
776
|
facetStats: Ce
|
|
777
777
|
})), b && console.log("[Auth] ✅ Initialization complete");
|
|
@@ -781,14 +781,14 @@ const Xt = ({
|
|
|
781
781
|
z(!1);
|
|
782
782
|
}
|
|
783
783
|
})();
|
|
784
|
-
}, [o, u, i, c]), /* @__PURE__ */
|
|
784
|
+
}, [o, u, i, c]), /* @__PURE__ */ t.jsx(
|
|
785
785
|
lt.Provider,
|
|
786
786
|
{
|
|
787
787
|
value: {
|
|
788
788
|
state: {
|
|
789
789
|
...s,
|
|
790
|
-
filterableFields:
|
|
791
|
-
facetableFields:
|
|
790
|
+
filterableFields: ae,
|
|
791
|
+
facetableFields: de,
|
|
792
792
|
sortableFields: me,
|
|
793
793
|
rangeBounds: N
|
|
794
794
|
},
|
|
@@ -822,7 +822,7 @@ const Xt = ({
|
|
|
822
822
|
const { state: { query: F, filters: p, rangeFilters: n, searchSettings: j }, setQuery: I } = Me();
|
|
823
823
|
Object.keys(p).length > 0 || Object.keys(n).length > 0;
|
|
824
824
|
const R = F.length > 0;
|
|
825
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ t.jsx(
|
|
826
826
|
vt,
|
|
827
827
|
{
|
|
828
828
|
type: "text",
|
|
@@ -835,7 +835,7 @@ const Xt = ({
|
|
|
835
835
|
inputSize: u,
|
|
836
836
|
showFocusBorder: c,
|
|
837
837
|
...m,
|
|
838
|
-
children: i && R && /* @__PURE__ */
|
|
838
|
+
children: i && R && /* @__PURE__ */ t.jsx(
|
|
839
839
|
be,
|
|
840
840
|
{
|
|
841
841
|
variant: "ghost",
|
|
@@ -855,57 +855,57 @@ const Xt = ({
|
|
|
855
855
|
scoreNumber: Ft
|
|
856
856
|
}, Mt = ({ color: r = "black", size: o = 21 }) => {
|
|
857
857
|
const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
858
|
-
return
|
|
858
|
+
return t.jsx("svg", { width: i, 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 }) });
|
|
859
859
|
}, Nt = ({ color: r = "black", size: o = 21 }) => {
|
|
860
860
|
const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
861
|
-
return
|
|
861
|
+
return t.jsx("svg", { width: i, 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 }) });
|
|
862
862
|
}, _t = ({ color: r = "black", size: o = 21 }) => {
|
|
863
863
|
const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
864
|
-
return
|
|
864
|
+
return t.jsx("svg", { width: i, 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 }) });
|
|
865
865
|
}, ct = ({ color: r = "black", size: o = 21 }) => {
|
|
866
866
|
const u = 0.7142857142857143, i = o, c = typeof o == "number" ? o * u : `calc(${o} * 0.7142857142857143)`;
|
|
867
|
-
return
|
|
867
|
+
return t.jsx("svg", { width: i, 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 }) });
|
|
868
868
|
}, Qt = ({ fields: r, resultsPerPage: o, children: u }) => {
|
|
869
869
|
const {
|
|
870
870
|
state: { results: i, resultsSuppressed: c, searchSettings: m, truncationIndex: F },
|
|
871
871
|
isFetchingInitial: p
|
|
872
|
-
} = Me(), n = o ?? 30, [j, I] =
|
|
873
|
-
|
|
872
|
+
} = Me(), n = o ?? 30, [j, I] = G(n);
|
|
873
|
+
ue(() => {
|
|
874
874
|
I(n);
|
|
875
875
|
}, [i]);
|
|
876
876
|
const R = i && i.length > j, B = () => {
|
|
877
877
|
I((b) => b + n);
|
|
878
878
|
};
|
|
879
|
-
return p || c || i === null ? /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
const
|
|
882
|
-
let
|
|
879
|
+
return p || c || i === null ? /* @__PURE__ */ t.jsx("div", { className: Re.placeholder, children: /* @__PURE__ */ t.jsx(_t, { size: 200, color: "var(--lv5)" }) }) : i.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: Re.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "No results found." }) }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
880
|
+
/* @__PURE__ */ t.jsx("div", { className: Re.container, children: (i ?? []).slice(0, j).map((b, Z) => {
|
|
881
|
+
const W = b.document, x = b.score;
|
|
882
|
+
let V;
|
|
883
883
|
try {
|
|
884
|
-
|
|
884
|
+
V = typeof W == "string" ? JSON.parse(W) : W;
|
|
885
885
|
} catch {
|
|
886
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ t.jsx("div", { className: Re.invalid, children: /* @__PURE__ */ t.jsx("p", { children: "Invalid JSON" }) }, Z);
|
|
887
887
|
}
|
|
888
888
|
let f;
|
|
889
889
|
if (r && r.length > 0) {
|
|
890
890
|
f = {};
|
|
891
891
|
for (const s of r)
|
|
892
|
-
s in
|
|
892
|
+
s in V && (f[s] = V[s]);
|
|
893
893
|
} else
|
|
894
|
-
f = { ...
|
|
894
|
+
f = { ...V };
|
|
895
895
|
for (const s in f) {
|
|
896
|
-
const
|
|
897
|
-
if (typeof
|
|
898
|
-
const
|
|
899
|
-
f[s] =
|
|
896
|
+
const w = f[s];
|
|
897
|
+
if (typeof w == "string" && w.startsWith("[") && w.endsWith("]")) {
|
|
898
|
+
const D = w.replace(/^\[|\]$/g, "").split(",").map((g) => g.trim().replace(/^'|'$/g, "")).filter((g) => g.length > 0);
|
|
899
|
+
f[s] = D;
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
902
|
+
return /* @__PURE__ */ t.jsxs("div", { className: Re.row, children: [
|
|
903
|
+
/* @__PURE__ */ t.jsx("div", { className: Re.indexNumber, children: Z }),
|
|
904
904
|
u(f),
|
|
905
|
-
m.showScore && /* @__PURE__ */
|
|
905
|
+
m.showScore && /* @__PURE__ */ t.jsx("div", { className: Re.scoreNumber, children: x })
|
|
906
906
|
] }, Z);
|
|
907
907
|
}) }),
|
|
908
|
-
R && /* @__PURE__ */
|
|
908
|
+
R && /* @__PURE__ */ t.jsx("div", { style: { textAlign: "center", marginTop: "20px" }, children: /* @__PURE__ */ t.jsxs(
|
|
909
909
|
be,
|
|
910
910
|
{
|
|
911
911
|
variant: "secondary",
|
|
@@ -937,19 +937,21 @@ const Xt = ({
|
|
|
937
937
|
showCount: R = !0,
|
|
938
938
|
showNull: B = !1,
|
|
939
939
|
displayIfEmptyQuery: b = !0,
|
|
940
|
-
displayCondition: Z = (
|
|
940
|
+
displayCondition: Z = (W) => !0
|
|
941
941
|
}) => {
|
|
942
942
|
const {
|
|
943
|
-
state: { facets:
|
|
944
|
-
toggleFilter:
|
|
943
|
+
state: { facets: W, filterableFields: x, facetableFields: V, filters: f, query: s },
|
|
944
|
+
toggleFilter: w,
|
|
945
945
|
isFetchingInitial: M,
|
|
946
|
-
allowEmptySearch:
|
|
947
|
-
} = Me(), g = Fe(null), [
|
|
948
|
-
if (
|
|
946
|
+
allowEmptySearch: D
|
|
947
|
+
} = Me(), g = Fe(null), [L, ae] = G(m);
|
|
948
|
+
if (ue(() => {
|
|
949
|
+
ae(m);
|
|
950
|
+
}, [W == null ? void 0 : W[r], m]), !D && !s || M || !W || !Z({ query: s ?? "", filters: f, facets: W }) || !b && !s && Object.keys(f).length < 1)
|
|
949
951
|
return null;
|
|
950
|
-
if (!(x != null && x.includes(r)) || !(
|
|
952
|
+
if (!(x != null && x.includes(r)) || !(V != null && V.includes(r))) {
|
|
951
953
|
const h = [];
|
|
952
|
-
return x != null && x.includes(r) || h.push("filterable"),
|
|
954
|
+
return x != null && x.includes(r) || h.push("filterable"), V != null && V.includes(r) || h.push("facetable"), /* @__PURE__ */ t.jsx(xe, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { style: { color: "red", fontSize: "12px" }, children: [
|
|
953
955
|
'Cannot render filter for "',
|
|
954
956
|
r,
|
|
955
957
|
'": missing ',
|
|
@@ -957,28 +959,28 @@ const Xt = ({
|
|
|
957
959
|
"."
|
|
958
960
|
] }) });
|
|
959
961
|
}
|
|
960
|
-
const
|
|
961
|
-
if (!
|
|
962
|
-
const
|
|
963
|
-
u && !g.current &&
|
|
964
|
-
(h,
|
|
962
|
+
const U = W == null ? void 0 : W[r];
|
|
963
|
+
if (!U || !Array.isArray(U)) return null;
|
|
964
|
+
const de = (f == null ? void 0 : f[r]) ?? [];
|
|
965
|
+
u && !g.current && U.length > 0 && (g.current = U.reduce(
|
|
966
|
+
(h, C) => (h[C.key] = C.value, h),
|
|
965
967
|
{}
|
|
966
968
|
));
|
|
967
969
|
const T = /* @__PURE__ */ new Map();
|
|
968
970
|
u && g.current ? (Object.keys(g.current).forEach((h) => {
|
|
969
971
|
T.set(h, 0);
|
|
970
|
-
}),
|
|
972
|
+
}), U.forEach((h) => {
|
|
971
973
|
T.set(h.key, h.value);
|
|
972
|
-
})) :
|
|
974
|
+
})) : U.forEach((h) => {
|
|
973
975
|
T.set(h.key, h.value);
|
|
974
976
|
});
|
|
975
977
|
const me = n === "toggle" && T.size === 2 && T.has("true") && (T.has("false") || T.has("null"));
|
|
976
978
|
if (T.has("null")) {
|
|
977
|
-
const h = T.get("null") ?? 0,
|
|
978
|
-
T.set("false", (
|
|
979
|
+
const h = T.get("null") ?? 0, C = T.get("false") ?? 0;
|
|
980
|
+
T.set("false", (C ?? 0) + h), T.delete("null");
|
|
979
981
|
}
|
|
980
982
|
if (n === "toggle" && !me)
|
|
981
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ t.jsx(xe, { collapsible: !1, children: /* @__PURE__ */ t.jsx("div", { className: Ee.count, children: /* @__PURE__ */ t.jsx(
|
|
982
984
|
oe,
|
|
983
985
|
{
|
|
984
986
|
label: o,
|
|
@@ -989,14 +991,14 @@ const Xt = ({
|
|
|
989
991
|
}
|
|
990
992
|
) }) });
|
|
991
993
|
if (me) {
|
|
992
|
-
const h = T.get("true"),
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
994
|
+
const h = T.get("true"), C = typeof h == "number" ? h : null, e = de.includes("true"), a = C === 0, v = R && (C ?? 0) > 0 ? `${C}` : "";
|
|
995
|
+
return /* @__PURE__ */ t.jsx(xe, { collapsible: !1, children: /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
996
|
+
/* @__PURE__ */ t.jsx(
|
|
995
997
|
oe,
|
|
996
998
|
{
|
|
997
999
|
label: o,
|
|
998
|
-
checked:
|
|
999
|
-
onChange: () =>
|
|
1000
|
+
checked: e,
|
|
1001
|
+
onChange: () => w(r, "true"),
|
|
1000
1002
|
disabled: a
|
|
1001
1003
|
}
|
|
1002
1004
|
),
|
|
@@ -1004,106 +1006,109 @@ const Xt = ({
|
|
|
1004
1006
|
v
|
|
1005
1007
|
] }) });
|
|
1006
1008
|
}
|
|
1007
|
-
let
|
|
1008
|
-
if (B || (
|
|
1009
|
+
let A = Array.from(T.entries());
|
|
1010
|
+
if (B || (A = A.filter(([h]) => h !== "null")), A.length === 0 && !u)
|
|
1009
1011
|
return null;
|
|
1010
1012
|
if (!i) if (c === "alphabetical") {
|
|
1011
|
-
const h =
|
|
1012
|
-
|
|
1013
|
+
const h = A.filter(([, e]) => typeof e == "number" && e > 0).sort(([e], [a]) => e.localeCompare(a)), C = A.filter(([, e]) => e === 0 || e === null).sort(([e], [a]) => e.localeCompare(a));
|
|
1014
|
+
A = [...h, ...C];
|
|
1013
1015
|
} else if (c === "numeric") {
|
|
1014
1016
|
const h = (a, v) => {
|
|
1015
|
-
const k = Number(a),
|
|
1016
|
-
return ve && N ? k -
|
|
1017
|
-
},
|
|
1018
|
-
|
|
1017
|
+
const k = Number(a), ie = Number(v), ve = !isNaN(k), N = !isNaN(ie);
|
|
1018
|
+
return ve && N ? k - ie : a.localeCompare(v);
|
|
1019
|
+
}, C = A.filter(([, a]) => typeof a == "number" && a > 0).sort(([a], [v]) => h(a, v)), e = A.filter(([, a]) => a === 0 || a === null).sort(([a], [v]) => h(a, v));
|
|
1020
|
+
A = [...C, ...e];
|
|
1019
1021
|
} else {
|
|
1020
|
-
const h =
|
|
1021
|
-
|
|
1022
|
+
const h = A.filter(([, e]) => typeof e == "number" && e > 0), C = A.filter(([, e]) => e === 0 || e === null);
|
|
1023
|
+
A = [...h, ...C];
|
|
1022
1024
|
}
|
|
1023
|
-
const S = typeof m == "number" &&
|
|
1024
|
-
const
|
|
1025
|
+
const S = typeof m == "number" && A.length > m, z = S ? A.slice(0, L) : A, pe = (h, C) => {
|
|
1026
|
+
const e = de.includes(h), a = C === 0, v = R && (C ?? 0) > 0 ? ` (${C})` : "", k = R && (C ?? 0) > 0 ? C : "";
|
|
1025
1027
|
switch (n) {
|
|
1026
1028
|
case "button":
|
|
1027
|
-
return j === "list" ? /* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
+
return j === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
1030
|
+
/* @__PURE__ */ t.jsx(
|
|
1029
1031
|
be,
|
|
1030
1032
|
{
|
|
1031
|
-
variant:
|
|
1032
|
-
onClick: () =>
|
|
1033
|
+
variant: e ? "primary" : "secondary",
|
|
1034
|
+
onClick: () => w(r, h),
|
|
1033
1035
|
disabled: a,
|
|
1034
1036
|
size: "micro",
|
|
1035
1037
|
children: h
|
|
1036
1038
|
}
|
|
1037
1039
|
),
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
] }) : /* @__PURE__ */
|
|
1040
|
+
/* @__PURE__ */ t.jsx("span", { children: k })
|
|
1041
|
+
] }) : /* @__PURE__ */ t.jsx(
|
|
1040
1042
|
be,
|
|
1041
1043
|
{
|
|
1042
|
-
variant:
|
|
1043
|
-
onClick: () =>
|
|
1044
|
+
variant: e ? "primary" : "secondary",
|
|
1045
|
+
onClick: () => w(r, h),
|
|
1044
1046
|
disabled: a,
|
|
1045
1047
|
size: "micro",
|
|
1046
1048
|
children: `${h}${v}`
|
|
1047
1049
|
}
|
|
1048
1050
|
);
|
|
1049
1051
|
case "toggle":
|
|
1050
|
-
return /* @__PURE__ */
|
|
1052
|
+
return /* @__PURE__ */ t.jsx(
|
|
1051
1053
|
oe,
|
|
1052
1054
|
{
|
|
1053
1055
|
label: h,
|
|
1054
|
-
checked:
|
|
1055
|
-
onChange: () =>
|
|
1056
|
+
checked: e,
|
|
1057
|
+
onChange: () => w(r, h),
|
|
1056
1058
|
disabled: a
|
|
1057
1059
|
}
|
|
1058
1060
|
);
|
|
1059
1061
|
case "checkbox":
|
|
1060
1062
|
default:
|
|
1061
|
-
return j === "list" ? /* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1063
|
+
return j === "list" ? /* @__PURE__ */ t.jsxs("div", { className: Ee.count, children: [
|
|
1064
|
+
/* @__PURE__ */ t.jsx(
|
|
1063
1065
|
tt,
|
|
1064
1066
|
{
|
|
1065
1067
|
label: h,
|
|
1066
1068
|
score: "",
|
|
1067
|
-
checked:
|
|
1068
|
-
onChange: () =>
|
|
1069
|
+
checked: e,
|
|
1070
|
+
onChange: () => w(r, h),
|
|
1069
1071
|
disabled: a
|
|
1070
1072
|
}
|
|
1071
1073
|
),
|
|
1072
|
-
/* @__PURE__ */
|
|
1073
|
-
] }) : /* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ t.jsx("span", { children: k })
|
|
1075
|
+
] }) : /* @__PURE__ */ t.jsx(
|
|
1074
1076
|
tt,
|
|
1075
1077
|
{
|
|
1076
1078
|
label: h,
|
|
1077
1079
|
score: v,
|
|
1078
|
-
checked:
|
|
1079
|
-
onChange: () =>
|
|
1080
|
+
checked: e,
|
|
1081
|
+
onChange: () => w(r, h),
|
|
1080
1082
|
disabled: a
|
|
1081
1083
|
}
|
|
1082
1084
|
);
|
|
1083
1085
|
}
|
|
1084
|
-
},
|
|
1085
|
-
return /* @__PURE__ */
|
|
1086
|
+
}, he = F ? p : !1;
|
|
1087
|
+
return /* @__PURE__ */ t.jsx(
|
|
1086
1088
|
xe,
|
|
1087
1089
|
{
|
|
1088
1090
|
title: o,
|
|
1089
1091
|
collapsible: F,
|
|
1090
|
-
collapsed:
|
|
1091
|
-
children: /* @__PURE__ */
|
|
1092
|
+
collapsed: he,
|
|
1093
|
+
children: /* @__PURE__ */ t.jsxs(
|
|
1092
1094
|
"ul",
|
|
1093
1095
|
{
|
|
1094
1096
|
className: j === "grid" ? Ee.grid : Ee.list,
|
|
1095
1097
|
style: { listStyle: "none", padding: 0, margin: 0 },
|
|
1096
1098
|
children: [
|
|
1097
|
-
z.map(([h,
|
|
1098
|
-
S &&
|
|
1099
|
-
|
|
1100
|
-
{
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1099
|
+
z.map(([h, C]) => /* @__PURE__ */ t.jsx("li", { children: pe(h, C) }, h)),
|
|
1100
|
+
S && L < A.length && (() => {
|
|
1101
|
+
const h = A.length - L, C = Math.min(50, h);
|
|
1102
|
+
return /* @__PURE__ */ t.jsx("li", { className: Ee.toggleItem, children: /* @__PURE__ */ t.jsx(
|
|
1103
|
+
be,
|
|
1104
|
+
{
|
|
1105
|
+
variant: "ghost",
|
|
1106
|
+
size: "micro",
|
|
1107
|
+
onClick: () => ae((e) => e + 50),
|
|
1108
|
+
children: `Show ${C} more of ${A.length} total`
|
|
1109
|
+
}
|
|
1110
|
+
) });
|
|
1111
|
+
})()
|
|
1107
1112
|
]
|
|
1108
1113
|
}
|
|
1109
1114
|
)
|
|
@@ -1125,11 +1130,11 @@ const Xt = ({
|
|
|
1125
1130
|
setRangeFilter: B,
|
|
1126
1131
|
resetSingleFilter: b,
|
|
1127
1132
|
allowEmptySearch: Z,
|
|
1128
|
-
isFetchingInitial:
|
|
1129
|
-
} = Me(), x = (n == null ? void 0 : n[r]) !== void 0,
|
|
1130
|
-
|
|
1133
|
+
isFetchingInitial: W
|
|
1134
|
+
} = Me(), x = (n == null ? void 0 : n[r]) !== void 0, V = (n == null ? void 0 : n[r]) ?? { min: u, max: i }, f = V.min, s = V.max, w = (j == null ? void 0 : j[r]) ?? V, M = w.min, D = w.max, g = x && f === s, L = g ? u : f, ae = g ? i : s, U = p == null ? void 0 : p[r], de = U ? U.min : f, T = U ? U.max : s, me = U !== void 0, A = M !== f || D !== s, [S, z] = te.useState([
|
|
1135
|
+
de,
|
|
1131
1136
|
T
|
|
1132
|
-
]), [pe,
|
|
1137
|
+
]), [pe, he] = te.useState(!1), [h, C] = te.useState(!1), { finalMin: e, finalMax: a, isValidMin: v, isValidMax: k } = te.useMemo(() => {
|
|
1133
1138
|
const [O, P] = S, X = Math.max(f, Math.min(s, O)), _e = Math.max(f, Math.min(s, P)), Te = Math.min(X, _e), Ae = Math.max(X, _e), Le = Te >= f && Te < Ae, $e = Ae <= s && Ae > Te;
|
|
1134
1139
|
return { finalMin: Te, finalMax: Ae, isValidMin: Le, isValidMax: $e };
|
|
1135
1140
|
}, [S, f, s]);
|
|
@@ -1137,36 +1142,36 @@ const Xt = ({
|
|
|
1137
1142
|
if (g)
|
|
1138
1143
|
return;
|
|
1139
1144
|
if (S[0] === f && S[1] === s) {
|
|
1140
|
-
|
|
1145
|
+
he(!1), C(!1);
|
|
1141
1146
|
return;
|
|
1142
1147
|
}
|
|
1143
1148
|
const P = R ?? 500, X = setTimeout(() => {
|
|
1144
|
-
|
|
1149
|
+
he(!v), C(!k);
|
|
1145
1150
|
}, 300), _e = setTimeout(() => {
|
|
1146
|
-
v && k && (
|
|
1151
|
+
v && k && (e === f && a === s ? b(r) : B(r, e, a));
|
|
1147
1152
|
}, P);
|
|
1148
1153
|
return () => {
|
|
1149
1154
|
clearTimeout(X), clearTimeout(_e);
|
|
1150
1155
|
};
|
|
1151
|
-
}, [
|
|
1152
|
-
z([
|
|
1153
|
-
}, [
|
|
1154
|
-
const
|
|
1156
|
+
}, [e, a, v, k, f, s, r, b, B, R, g]), te.useEffect(() => {
|
|
1157
|
+
z([de, T]), he(!1), C(!1);
|
|
1158
|
+
}, [de, T, r]);
|
|
1159
|
+
const ie = te.useCallback((O) => {
|
|
1155
1160
|
if (g) return;
|
|
1156
|
-
const P = Math.max(f, Math.min(
|
|
1161
|
+
const P = Math.max(f, Math.min(D, O[0])), X = Math.max(M, Math.min(s, O[1]));
|
|
1157
1162
|
z([P, X]);
|
|
1158
|
-
}, [g, f, s, M,
|
|
1163
|
+
}, [g, f, s, M, D]), ve = te.useCallback((O) => {
|
|
1159
1164
|
if (g) return;
|
|
1160
|
-
const P = Math.max(f, Math.min(
|
|
1165
|
+
const P = Math.max(f, Math.min(D, O[0])), X = Math.max(M, Math.min(s, O[1]));
|
|
1161
1166
|
P === f && X === s ? (z([f, s]), b(r)) : z([P, X]);
|
|
1162
|
-
}, [g, f, s, M,
|
|
1167
|
+
}, [g, f, s, M, D, r, b]), N = te.useCallback((O) => {
|
|
1163
1168
|
if (g) return;
|
|
1164
1169
|
const P = Number(O.target.value);
|
|
1165
1170
|
if (!isNaN(P)) {
|
|
1166
|
-
const X = Math.max(f, Math.min(
|
|
1171
|
+
const X = Math.max(f, Math.min(D, P));
|
|
1167
1172
|
z([X, S[1]]);
|
|
1168
1173
|
}
|
|
1169
|
-
}, [g, S, f,
|
|
1174
|
+
}, [g, S, f, D]), re = te.useCallback((O) => {
|
|
1170
1175
|
if (g) return;
|
|
1171
1176
|
const P = Number(O.target.value);
|
|
1172
1177
|
if (!isNaN(P)) {
|
|
@@ -1174,35 +1179,35 @@ const Xt = ({
|
|
|
1174
1179
|
z([S[0], X]);
|
|
1175
1180
|
}
|
|
1176
1181
|
}, [g, S, M, s]), Se = te.useCallback(() => {
|
|
1177
|
-
const O = S[0], P = Math.max(f, Math.min(
|
|
1182
|
+
const O = S[0], P = Math.max(f, Math.min(D, O));
|
|
1178
1183
|
P < S[1] ? z([P, S[1]]) : z([f, S[1]]);
|
|
1179
|
-
}, [S, f,
|
|
1184
|
+
}, [S, f, D]), Ne = te.useCallback(() => {
|
|
1180
1185
|
const O = S[1], P = Math.max(M, Math.min(s, O));
|
|
1181
1186
|
P > S[0] ? z([S[0], P]) : z([S[0], s]);
|
|
1182
1187
|
}, [S, M, s]);
|
|
1183
|
-
return
|
|
1184
|
-
g && /* @__PURE__ */
|
|
1188
|
+
return W || !Z && !I ? null : c === "slider" ? /* @__PURE__ */ t.jsxs(xe, { title: o, collapsed: F, collapsible: m, children: [
|
|
1189
|
+
g && /* @__PURE__ */ t.jsxs("div", { className: ot.disabledMessage, children: [
|
|
1185
1190
|
"No adjustable range (all results have the same value: ",
|
|
1186
1191
|
f,
|
|
1187
1192
|
")."
|
|
1188
1193
|
] }),
|
|
1189
|
-
/* @__PURE__ */
|
|
1194
|
+
/* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
|
|
1190
1195
|
it,
|
|
1191
1196
|
{
|
|
1192
|
-
min:
|
|
1193
|
-
max:
|
|
1194
|
-
value: g ? [
|
|
1197
|
+
min: L,
|
|
1198
|
+
max: ae,
|
|
1199
|
+
value: g ? [L, ae] : [e, a],
|
|
1195
1200
|
isRange: !0,
|
|
1196
|
-
onChange: (O) =>
|
|
1201
|
+
onChange: (O) => ie(O),
|
|
1197
1202
|
onFinalChange: (O) => ve(O),
|
|
1198
1203
|
disabled: g,
|
|
1199
1204
|
activeMin: M,
|
|
1200
|
-
activeMax:
|
|
1201
|
-
isFaceted:
|
|
1205
|
+
activeMax: D,
|
|
1206
|
+
isFaceted: A,
|
|
1202
1207
|
highlightFaceted: me
|
|
1203
1208
|
}
|
|
1204
1209
|
) }),
|
|
1205
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ t.jsxs(
|
|
1206
1211
|
"div",
|
|
1207
1212
|
{
|
|
1208
1213
|
style: {
|
|
@@ -1213,20 +1218,20 @@ const Xt = ({
|
|
|
1213
1218
|
justifyContent: "space-between"
|
|
1214
1219
|
},
|
|
1215
1220
|
children: [
|
|
1216
|
-
/* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ t.jsx(
|
|
1217
1222
|
Y,
|
|
1218
1223
|
{
|
|
1219
1224
|
type: "number",
|
|
1220
1225
|
value: g ? f : S[0],
|
|
1221
1226
|
min: f,
|
|
1222
|
-
max: Math.min(
|
|
1227
|
+
max: Math.min(D, S[1] - 1),
|
|
1223
1228
|
onChange: N,
|
|
1224
1229
|
onBlur: Se,
|
|
1225
1230
|
disabled: g,
|
|
1226
1231
|
isValid: g || !pe
|
|
1227
1232
|
}
|
|
1228
1233
|
),
|
|
1229
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ t.jsx(
|
|
1230
1235
|
Y,
|
|
1231
1236
|
{
|
|
1232
1237
|
type: "number",
|
|
@@ -1242,28 +1247,28 @@ const Xt = ({
|
|
|
1242
1247
|
]
|
|
1243
1248
|
}
|
|
1244
1249
|
)
|
|
1245
|
-
] }) : /* @__PURE__ */
|
|
1246
|
-
g && /* @__PURE__ */
|
|
1250
|
+
] }) : /* @__PURE__ */ t.jsxs(xe, { title: o, children: [
|
|
1251
|
+
g && /* @__PURE__ */ t.jsxs("div", { className: ot.disabledMessage, children: [
|
|
1247
1252
|
"No adjustable range (all results have the same value: ",
|
|
1248
1253
|
f,
|
|
1249
1254
|
")."
|
|
1250
1255
|
] }),
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "flex-start" }, children: [
|
|
1257
|
+
/* @__PURE__ */ t.jsx(
|
|
1253
1258
|
Y,
|
|
1254
1259
|
{
|
|
1255
1260
|
label: "Min:",
|
|
1256
1261
|
type: "number",
|
|
1257
1262
|
value: g ? f : S[0],
|
|
1258
1263
|
min: f,
|
|
1259
|
-
max: Math.min(
|
|
1264
|
+
max: Math.min(D, S[1] - 1),
|
|
1260
1265
|
onChange: N,
|
|
1261
1266
|
onBlur: Se,
|
|
1262
1267
|
disabled: g,
|
|
1263
1268
|
isValid: g || !pe
|
|
1264
1269
|
}
|
|
1265
1270
|
),
|
|
1266
|
-
/* @__PURE__ */
|
|
1271
|
+
/* @__PURE__ */ t.jsx(
|
|
1267
1272
|
Y,
|
|
1268
1273
|
{
|
|
1269
1274
|
label: "Max:",
|
|
@@ -1281,11 +1286,11 @@ const Xt = ({
|
|
|
1281
1286
|
] });
|
|
1282
1287
|
}, Pt = "_grid_nvpmn_2", Ht = {
|
|
1283
1288
|
grid: Pt
|
|
1284
|
-
}, $t = at(({ field: r, value: o, onReset: u }) => /* @__PURE__ */
|
|
1289
|
+
}, $t = at(({ field: r, value: o, onReset: u }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1285
1290
|
be,
|
|
1286
1291
|
{
|
|
1287
1292
|
onClick: u,
|
|
1288
|
-
iconRight: /* @__PURE__ */
|
|
1293
|
+
iconRight: /* @__PURE__ */ t.jsx(ct, {}),
|
|
1289
1294
|
variant: "primary",
|
|
1290
1295
|
size: "micro",
|
|
1291
1296
|
children: [
|
|
@@ -1294,11 +1299,11 @@ const Xt = ({
|
|
|
1294
1299
|
o
|
|
1295
1300
|
]
|
|
1296
1301
|
}
|
|
1297
|
-
) })), It = at(({ field: r, min: o, max: u, onReset: i }) => /* @__PURE__ */
|
|
1302
|
+
) })), It = at(({ field: r, min: o, max: u, onReset: i }) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsxs(
|
|
1298
1303
|
be,
|
|
1299
1304
|
{
|
|
1300
1305
|
onClick: i,
|
|
1301
|
-
iconRight: /* @__PURE__ */
|
|
1306
|
+
iconRight: /* @__PURE__ */ t.jsx(ct, {}),
|
|
1302
1307
|
variant: "primary",
|
|
1303
1308
|
size: "micro",
|
|
1304
1309
|
children: [
|
|
@@ -1327,8 +1332,8 @@ function Kt() {
|
|
|
1327
1332
|
return ze(
|
|
1328
1333
|
() => Object.keys(r).length > 0 || Object.keys(o).length > 0,
|
|
1329
1334
|
[r, o]
|
|
1330
|
-
) ? /* @__PURE__ */
|
|
1331
|
-
c.map(({ field: p, value: n }) => /* @__PURE__ */
|
|
1335
|
+
) ? /* @__PURE__ */ t.jsx(xe, { collapsible: !1, title: "Active filters", children: /* @__PURE__ */ t.jsxs("ul", { className: Ht.grid, children: [
|
|
1336
|
+
c.map(({ field: p, value: n }) => /* @__PURE__ */ t.jsx(
|
|
1332
1337
|
$t,
|
|
1333
1338
|
{
|
|
1334
1339
|
field: p,
|
|
@@ -1337,7 +1342,7 @@ function Kt() {
|
|
|
1337
1342
|
},
|
|
1338
1343
|
`${p}-${n}`
|
|
1339
1344
|
)),
|
|
1340
|
-
m.map(({ field: p, min: n, max: j }) => /* @__PURE__ */
|
|
1345
|
+
m.map(({ field: p, min: n, max: j }) => /* @__PURE__ */ t.jsx(
|
|
1341
1346
|
It,
|
|
1342
1347
|
{
|
|
1343
1348
|
field: p,
|
|
@@ -1347,7 +1352,7 @@ function Kt() {
|
|
|
1347
1352
|
},
|
|
1348
1353
|
p
|
|
1349
1354
|
)),
|
|
1350
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1351
1356
|
be,
|
|
1352
1357
|
{
|
|
1353
1358
|
onClick: u,
|
|
@@ -1380,13 +1385,13 @@ const Wt = "_radioGroup_nwf7i_6", Dt = {
|
|
|
1380
1385
|
F(B, b === "asc");
|
|
1381
1386
|
}
|
|
1382
1387
|
}, I = o ? u : !1;
|
|
1383
|
-
return /* @__PURE__ */
|
|
1388
|
+
return /* @__PURE__ */ t.jsx(
|
|
1384
1389
|
xe,
|
|
1385
1390
|
{
|
|
1386
1391
|
title: "Sort by",
|
|
1387
1392
|
collapsible: o,
|
|
1388
1393
|
collapsed: I,
|
|
1389
|
-
children: r === "dropdown" ? /* @__PURE__ */
|
|
1394
|
+
children: r === "dropdown" ? /* @__PURE__ */ t.jsx(
|
|
1390
1395
|
xt,
|
|
1391
1396
|
{
|
|
1392
1397
|
value: p,
|
|
@@ -1394,7 +1399,7 @@ const Wt = "_radioGroup_nwf7i_6", Dt = {
|
|
|
1394
1399
|
options: n,
|
|
1395
1400
|
placeholder: "Select sort..."
|
|
1396
1401
|
}
|
|
1397
|
-
) : /* @__PURE__ */
|
|
1402
|
+
) : /* @__PURE__ */ t.jsx("div", { className: Dt.radioGroup, children: n.map((R) => /* @__PURE__ */ t.jsx(
|
|
1398
1403
|
bt,
|
|
1399
1404
|
{
|
|
1400
1405
|
id: `sort-${R.value}`,
|
|
@@ -1415,7 +1420,7 @@ function tr() {
|
|
|
1415
1420
|
const {
|
|
1416
1421
|
state: { searchSettings: r },
|
|
1417
1422
|
setSearchSettings: o
|
|
1418
|
-
} = Me(), [u, i] =
|
|
1423
|
+
} = Me(), [u, i] = G(!1), c = (n, j) => {
|
|
1419
1424
|
const I = parseInt(j, 10);
|
|
1420
1425
|
isNaN(I) || o({
|
|
1421
1426
|
[n]: I
|
|
@@ -1440,8 +1445,8 @@ function tr() {
|
|
|
1440
1445
|
}
|
|
1441
1446
|
});
|
|
1442
1447
|
};
|
|
1443
|
-
return /* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ t.jsx(xe, { collapsed: !0, title: "Settings", children: /* @__PURE__ */ t.jsxs("ul", { className: Bt.list, children: [
|
|
1449
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1445
1450
|
Y,
|
|
1446
1451
|
{
|
|
1447
1452
|
label: "Max Results",
|
|
@@ -1450,7 +1455,7 @@ function tr() {
|
|
|
1450
1455
|
onChange: (n) => c("maxNumberOfRecordsToReturn", n.target.value)
|
|
1451
1456
|
}
|
|
1452
1457
|
) }),
|
|
1453
|
-
/* @__PURE__ */
|
|
1458
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1454
1459
|
Y,
|
|
1455
1460
|
{
|
|
1456
1461
|
label: "Coverage Depth",
|
|
@@ -1459,8 +1464,8 @@ function tr() {
|
|
|
1459
1464
|
onChange: (n) => c("coverageDepth", n.target.value)
|
|
1460
1465
|
}
|
|
1461
1466
|
) }),
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ t.jsxs("li", { children: [
|
|
1468
|
+
/* @__PURE__ */ t.jsx(
|
|
1464
1469
|
Y,
|
|
1465
1470
|
{
|
|
1466
1471
|
label: "Minimum Score",
|
|
@@ -1472,7 +1477,7 @@ function tr() {
|
|
|
1472
1477
|
}
|
|
1473
1478
|
}
|
|
1474
1479
|
),
|
|
1475
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ t.jsx("div", { style: { padding: "10px 10px 20px 10px" }, children: /* @__PURE__ */ t.jsx(
|
|
1476
1481
|
it,
|
|
1477
1482
|
{
|
|
1478
1483
|
min: 0,
|
|
@@ -1485,7 +1490,7 @@ function tr() {
|
|
|
1485
1490
|
}
|
|
1486
1491
|
) })
|
|
1487
1492
|
] }),
|
|
1488
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1489
1494
|
Y,
|
|
1490
1495
|
{
|
|
1491
1496
|
label: "Placeholder text",
|
|
@@ -1496,7 +1501,7 @@ function tr() {
|
|
|
1496
1501
|
}
|
|
1497
1502
|
}
|
|
1498
1503
|
) }),
|
|
1499
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1500
1505
|
oe,
|
|
1501
1506
|
{
|
|
1502
1507
|
label: "Show score",
|
|
@@ -1504,7 +1509,7 @@ function tr() {
|
|
|
1504
1509
|
onChange: (n) => m("showScore", n)
|
|
1505
1510
|
}
|
|
1506
1511
|
) }),
|
|
1507
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1508
1513
|
oe,
|
|
1509
1514
|
{
|
|
1510
1515
|
label: "Enable Coverage",
|
|
@@ -1512,7 +1517,7 @@ function tr() {
|
|
|
1512
1517
|
onChange: (n) => m("enableCoverage", n)
|
|
1513
1518
|
}
|
|
1514
1519
|
) }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1520
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1516
1521
|
oe,
|
|
1517
1522
|
{
|
|
1518
1523
|
label: "Remove Duplicates",
|
|
@@ -1520,9 +1525,9 @@ function tr() {
|
|
|
1520
1525
|
onChange: (n) => m("removeDuplicates", n)
|
|
1521
1526
|
}
|
|
1522
1527
|
) }),
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
u && /* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(be, { variant: "ghost", size: "micro", iconRight: u ? /* @__PURE__ */ t.jsx(Mt, {}) : /* @__PURE__ */ t.jsx(Nt, {}), onClick: () => i((n) => !n), children: u ? "Hide Coverage Setup" : "Show Coverage Setup" }) }),
|
|
1529
|
+
u && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1530
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1526
1531
|
oe,
|
|
1527
1532
|
{
|
|
1528
1533
|
label: "Cover Whole Query",
|
|
@@ -1530,7 +1535,7 @@ function tr() {
|
|
|
1530
1535
|
onChange: (n) => p("coverWholeQuery", n)
|
|
1531
1536
|
}
|
|
1532
1537
|
) }),
|
|
1533
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1534
1539
|
oe,
|
|
1535
1540
|
{
|
|
1536
1541
|
label: "Cover Whole Words",
|
|
@@ -1538,7 +1543,7 @@ function tr() {
|
|
|
1538
1543
|
onChange: (n) => p("coverWholeWords", n)
|
|
1539
1544
|
}
|
|
1540
1545
|
) }),
|
|
1541
|
-
/* @__PURE__ */
|
|
1546
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1542
1547
|
oe,
|
|
1543
1548
|
{
|
|
1544
1549
|
label: "Cover Fuzzy Words",
|
|
@@ -1546,7 +1551,7 @@ function tr() {
|
|
|
1546
1551
|
onChange: (n) => p("coverFuzzyWords", n)
|
|
1547
1552
|
}
|
|
1548
1553
|
) }),
|
|
1549
|
-
/* @__PURE__ */
|
|
1554
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1550
1555
|
oe,
|
|
1551
1556
|
{
|
|
1552
1557
|
label: "Cover Joined Words",
|
|
@@ -1554,7 +1559,7 @@ function tr() {
|
|
|
1554
1559
|
onChange: (n) => p("coverJoinedWords", n)
|
|
1555
1560
|
}
|
|
1556
1561
|
) }),
|
|
1557
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1558
1563
|
oe,
|
|
1559
1564
|
{
|
|
1560
1565
|
label: "Cover Prefix Suffix",
|
|
@@ -1562,7 +1567,7 @@ function tr() {
|
|
|
1562
1567
|
onChange: (n) => p("coverPrefixSuffix", n)
|
|
1563
1568
|
}
|
|
1564
1569
|
) }),
|
|
1565
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1566
1571
|
oe,
|
|
1567
1572
|
{
|
|
1568
1573
|
label: "Truncate list",
|
|
@@ -1570,7 +1575,7 @@ function tr() {
|
|
|
1570
1575
|
onChange: (n) => p("truncate", n)
|
|
1571
1576
|
}
|
|
1572
1577
|
) }),
|
|
1573
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1574
1579
|
Y,
|
|
1575
1580
|
{
|
|
1576
1581
|
label: "Levenshtein Max Word Size",
|
|
@@ -1579,7 +1584,7 @@ function tr() {
|
|
|
1579
1584
|
onChange: (n) => F("levenshteinMaxWordSize", n.target.value)
|
|
1580
1585
|
}
|
|
1581
1586
|
) }),
|
|
1582
|
-
/* @__PURE__ */
|
|
1587
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1583
1588
|
Y,
|
|
1584
1589
|
{
|
|
1585
1590
|
label: "Min Word Size",
|
|
@@ -1588,7 +1593,7 @@ function tr() {
|
|
|
1588
1593
|
onChange: (n) => F("minWordSize", n.target.value)
|
|
1589
1594
|
}
|
|
1590
1595
|
) }),
|
|
1591
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1592
1597
|
Y,
|
|
1593
1598
|
{
|
|
1594
1599
|
label: "Coverage Min Word Hits Abs",
|
|
@@ -1597,7 +1602,7 @@ function tr() {
|
|
|
1597
1602
|
onChange: (n) => F("coverageMinWordHitsAbs", n.target.value)
|
|
1598
1603
|
}
|
|
1599
1604
|
) }),
|
|
1600
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1601
1606
|
Y,
|
|
1602
1607
|
{
|
|
1603
1608
|
label: "Coverage Min Word Hits Relative",
|
|
@@ -1606,7 +1611,7 @@ function tr() {
|
|
|
1606
1611
|
onChange: (n) => F("coverageMinWordHitsRelative", n.target.value)
|
|
1607
1612
|
}
|
|
1608
1613
|
) }),
|
|
1609
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1610
1615
|
Y,
|
|
1611
1616
|
{
|
|
1612
1617
|
label: "Coverage Q Limit For Error Tolerance",
|
|
@@ -1615,7 +1620,7 @@ function tr() {
|
|
|
1615
1620
|
onChange: (n) => F("coverageQLimitForErrorTolerance", n.target.value)
|
|
1616
1621
|
}
|
|
1617
1622
|
) }),
|
|
1618
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx(
|
|
1619
1624
|
Y,
|
|
1620
1625
|
{
|
|
1621
1626
|
label: "Coverage LCS Error Tolerance Relative Q",
|
|
@@ -1642,7 +1647,7 @@ class rr extends pt {
|
|
|
1642
1647
|
console.error("[SearchErrorBoundary] Caught error:", u, i);
|
|
1643
1648
|
}
|
|
1644
1649
|
render() {
|
|
1645
|
-
return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : /* @__PURE__ */
|
|
1650
|
+
return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback(this.state.error, this.reset) : /* @__PURE__ */ t.jsxs("div", { style: {
|
|
1646
1651
|
padding: "2rem",
|
|
1647
1652
|
backgroundColor: "#fee",
|
|
1648
1653
|
border: "2px solid #c33",
|
|
@@ -1650,29 +1655,29 @@ class rr extends pt {
|
|
|
1650
1655
|
maxWidth: "600px",
|
|
1651
1656
|
margin: "2rem auto"
|
|
1652
1657
|
}, children: [
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ t.jsx("h2", { style: { color: "#c33", marginTop: 0 }, children: "⚠️ Search Initialization Error" }),
|
|
1659
|
+
/* @__PURE__ */ t.jsxs("p", { style: { marginBottom: "1rem" }, children: [
|
|
1660
|
+
/* @__PURE__ */ t.jsx("strong", { children: "Error:" }),
|
|
1656
1661
|
" ",
|
|
1657
1662
|
this.state.error.message
|
|
1658
1663
|
] }),
|
|
1659
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ t.jsxs("div", { style: {
|
|
1660
1665
|
backgroundColor: "#fff",
|
|
1661
1666
|
padding: "1rem",
|
|
1662
1667
|
borderRadius: "4px",
|
|
1663
1668
|
marginBottom: "1rem",
|
|
1664
1669
|
fontSize: "0.9rem"
|
|
1665
1670
|
}, children: [
|
|
1666
|
-
/* @__PURE__ */
|
|
1667
|
-
/* @__PURE__ */
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
/* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ t.jsx("strong", { children: "💡 Common fixes:" }),
|
|
1672
|
+
/* @__PURE__ */ t.jsxs("ul", { style: { marginBottom: 0, paddingLeft: "1.5rem" }, children: [
|
|
1673
|
+
/* @__PURE__ */ t.jsx("li", { children: "Check browser console for detailed error messages" }),
|
|
1674
|
+
/* @__PURE__ */ t.jsx("li", { children: "Verify NEXT_PUBLIC_INDX_URL is correct in .env.local" }),
|
|
1675
|
+
/* @__PURE__ */ t.jsx("li", { children: "Verify NEXT_PUBLIC_INDX_EMAIL and NEXT_PUBLIC_INDX_PASSWORD are correct" }),
|
|
1676
|
+
/* @__PURE__ */ t.jsx("li", { children: "Ensure INDX server is running" }),
|
|
1677
|
+
/* @__PURE__ */ t.jsx("li", { children: "Check dataset name spelling" })
|
|
1673
1678
|
] })
|
|
1674
1679
|
] }),
|
|
1675
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ t.jsx(
|
|
1676
1681
|
"button",
|
|
1677
1682
|
{
|
|
1678
1683
|
onClick: this.reset,
|