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