@indxsearch/intrface 3.7.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +22 -1
- package/dist/components/SearchResults.d.ts +11 -1
- package/dist/context/SearchContext.d.ts +5 -0
- package/dist/context/buildFilterProxy.d.ts +9 -1
- package/dist/context/useIndxAuth.d.ts +8 -0
- package/dist/context/useSearchExecution.d.ts +2 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +384 -330
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -6,10 +6,10 @@ import { Button as m, Checkbox as h, FilterPanelBase as g, InputField as _, Radi
|
|
|
6
6
|
import { ArrowDown as C, ArrowRight as w, Indx as T, X_or_error as E } from "@indxsearch/pixl";
|
|
7
7
|
//#region src/context/useIndxAuth.ts
|
|
8
8
|
function D({ url: e, team: t, dataset: n, preAuthenticatedToken: r, enableDebugLogs: i = !1 }) {
|
|
9
|
-
let [a, s] = l(null), [c, d] = l(!0), [f, p] = l([]), [m, h] = l([]), [g, _] = l([]), [v, y] = l({}), [b, x] = l({}), [S, C] = l(
|
|
9
|
+
let [a, s] = l(null), [c, d] = l(!0), [f, p] = l([]), [m, h] = l([]), [g, _] = l([]), [v, y] = l({}), [b, x] = l({}), [S, C] = l({}), [w, T] = l(0), [E, D] = l(null);
|
|
10
10
|
return o(() => {
|
|
11
11
|
(async () => {
|
|
12
|
-
|
|
12
|
+
D(null);
|
|
13
13
|
try {
|
|
14
14
|
if (!r) throw console.error("[Auth] ❌ Missing bearer token"), console.error("[Auth] 💡 Pass preAuthenticatedToken to SearchProvider (create a token on the Indx Dashboard)"), Error("A bearer token is required. Check console for instructions.");
|
|
15
15
|
if (!e) throw console.error("[Auth] ❌ Missing INDX server URL"), console.error("[Auth] 💡 Pass a url to SearchProvider"), Error("INDX server URL is required. Check console for instructions.");
|
|
@@ -36,21 +36,28 @@ function D({ url: e, team: t, dataset: n, preAuthenticatedToken: r, enableDebugL
|
|
|
36
36
|
i && console.log("[Auth] 📊 Dataset status:", l), s(a), i && console.log("[Auth] ✅ Dataset session established"), l.systemState !== void 0 && l.systemState !== u.Ready && (console.warn("[Auth] ⚠️ Dataset is not ready yet. Current state:", u[l.systemState]), console.warn("[Auth] 💡 Wait for indexing to complete before searching"));
|
|
37
37
|
let d = l.documentCount ?? l.numberOfRecords ?? 0;
|
|
38
38
|
d === 0 ? (console.warn("[Auth] ⚠️ Dataset \"" + n + "\" is empty (0 records)"), console.warn("[Auth] 💡 Add documents to your dataset before searching"), console.warn("[Auth] 💡 Search will work but return no results")) : i && console.log("[Auth] ✅ Dataset has", d, "records");
|
|
39
|
-
let [f, m, g] = await Promise.all([
|
|
39
|
+
let [f, m, g, v] = await Promise.all([
|
|
40
40
|
o(`${e}/api/teams/${t}/datasets/${n}/fields/filterable`),
|
|
41
41
|
o(`${e}/api/teams/${t}/datasets/${n}/fields/facetable`),
|
|
42
|
-
o(`${e}/api/teams/${t}/datasets/${n}/fields/sortable`)
|
|
42
|
+
o(`${e}/api/teams/${t}/datasets/${n}/fields/sortable`),
|
|
43
|
+
o(`${e}/api/teams/${t}/datasets/${n}/fields/configuration`).catch(() => null)
|
|
43
44
|
]);
|
|
44
45
|
if (!f.ok) throw console.error("[Auth] ❌ GetFilterableFields failed:", f.status, await f.text()), Error("Failed to get filterable fields. Check console for details.");
|
|
45
46
|
if (!m.ok) throw console.error("[Auth] ❌ GetFacetableFields failed:", m.status, await m.text()), Error("Failed to get facetable fields. Check console for details.");
|
|
46
47
|
if (!g.ok) throw console.error("[Auth] ❌ GetSortableFields failed:", g.status, await g.text()), Error("Failed to get sortable fields. Check console for details.");
|
|
47
|
-
let [
|
|
48
|
+
let [b, S, w] = await Promise.all([
|
|
48
49
|
f.json().catch((e) => (console.error("Failed to parse GetFilterableFields response:", e), [])),
|
|
49
50
|
m.json().catch((e) => (console.error("Failed to parse GetFacetableFields response:", e), [])),
|
|
50
51
|
g.json().catch((e) => (console.error("Failed to parse GetSortableFields response:", e), []))
|
|
51
52
|
]);
|
|
52
|
-
p(
|
|
53
|
-
let
|
|
53
|
+
p(b || []), h(S || []), _(w || []), T(d);
|
|
54
|
+
let E = {};
|
|
55
|
+
if (v?.ok) {
|
|
56
|
+
let e = await v.json().catch((e) => (console.error("Failed to parse GetFieldConfiguration response:", e), []));
|
|
57
|
+
for (let t of e ?? []) t?.fieldName && t?.fieldType && (E[t.fieldName] = t.fieldType);
|
|
58
|
+
} else i && console.log("[Auth] fields/configuration not available", v?.status, "- every selected value will be sent as a value filter");
|
|
59
|
+
y(E);
|
|
60
|
+
let D = { facets: {} };
|
|
54
61
|
try {
|
|
55
62
|
let r = await fetch(`${e}/api/teams/${t}/datasets/${n}/search`, {
|
|
56
63
|
method: "POST",
|
|
@@ -64,25 +71,25 @@ function D({ url: e, team: t, dataset: n, preAuthenticatedToken: r, enableDebugL
|
|
|
64
71
|
enableFacets: !0
|
|
65
72
|
})
|
|
66
73
|
});
|
|
67
|
-
r.ok ?
|
|
74
|
+
r.ok ? D = await r.json().catch((e) => (console.warn("Failed to parse blank search response:", e), { facets: {} })) : (console.warn("Blank search failed:", r.status, r.statusText), console.warn("Continuing without initial facet data - facets will be populated after first search"));
|
|
68
75
|
} catch (e) {
|
|
69
76
|
console.warn("Blank search error:", e), console.warn("Continuing without initial facet data - facets will be populated after first search");
|
|
70
77
|
}
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
for (let [e, t] of Object.entries(
|
|
78
|
+
let O = {};
|
|
79
|
+
if (D.facets) {
|
|
80
|
+
for (let [e, t] of Object.entries(D.facets)) if (Array.isArray(t) && t.length > 0) {
|
|
74
81
|
let n = t.map((e) => Number(e.key)).filter((e) => !isNaN(e));
|
|
75
|
-
n.length > 0 && (
|
|
82
|
+
n.length > 0 && (O[e] = {
|
|
76
83
|
min: Math.min(...n),
|
|
77
84
|
max: Math.max(...n)
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
|
|
88
|
+
let k = {};
|
|
89
|
+
if (D.facets) for (let [e, t] of Object.entries(D.facets)) Array.isArray(t) && (k[e] = t.map((e) => e.key));
|
|
90
|
+
x(O), C(k), i && console.log("[Auth] ✅ Initialization complete");
|
|
84
91
|
} catch (t) {
|
|
85
|
-
console.error("[Auth] ❌ Initialization failed:", t), (t instanceof Error || typeof t == "object" && t && "message" in t) && console.error("[Auth] 💡 Error:", t.message), t instanceof TypeError && t.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", e), console.error("[Auth] 💡 Check the url you passed to SearchProvider"), console.error("[Auth] 💡 For local development, it should be: http://localhost:5001")),
|
|
92
|
+
console.error("[Auth] ❌ Initialization failed:", t), (t instanceof Error || typeof t == "object" && t && "message" in t) && console.error("[Auth] 💡 Error:", t.message), t instanceof TypeError && t.message.includes("fetch") && (console.error("[Auth] ❌ Network error - cannot connect to INDX server"), console.error("[Auth] 💡 Check if the server is running at:", e), console.error("[Auth] 💡 Check the url you passed to SearchProvider"), console.error("[Auth] 💡 For local development, it should be: http://localhost:5001")), D(t instanceof Error ? t.message : String(t));
|
|
86
93
|
} finally {
|
|
87
94
|
d(!1);
|
|
88
95
|
}
|
|
@@ -94,13 +101,14 @@ function D({ url: e, team: t, dataset: n, preAuthenticatedToken: r, enableDebugL
|
|
|
94
101
|
]), {
|
|
95
102
|
token: a,
|
|
96
103
|
isFetchingInitial: c,
|
|
97
|
-
authError:
|
|
98
|
-
initialFacetStats:
|
|
99
|
-
initialFacetKeys:
|
|
104
|
+
authError: E,
|
|
105
|
+
initialFacetStats: b,
|
|
106
|
+
initialFacetKeys: S,
|
|
100
107
|
filterableFields: f,
|
|
101
108
|
facetableFields: m,
|
|
102
109
|
sortableFields: g,
|
|
103
|
-
|
|
110
|
+
fieldTypes: v,
|
|
111
|
+
totalDocumentCount: w
|
|
104
112
|
};
|
|
105
113
|
}
|
|
106
114
|
//#endregion
|
|
@@ -154,23 +162,29 @@ async function A(e, t, n, r, i, a) {
|
|
|
154
162
|
}, "CombineFilters", n, r, i, a);
|
|
155
163
|
return o;
|
|
156
164
|
}
|
|
157
|
-
async function ee(e, t, n, r, i, a, o = {}, s = {}) {
|
|
158
|
-
let
|
|
165
|
+
async function ee(e, t, n, r, i, a, o = {}, s = {}, c = {}) {
|
|
166
|
+
let l = Object.entries(e ?? {}).filter(([, e]) => e.length > 0), u = Object.entries(t ?? {}), d = Object.entries(s ?? {}).filter(([, e]) => e.length > 0), f = (e, { min: t, max: o }) => k("range", {
|
|
159
167
|
fieldName: e,
|
|
160
168
|
lowerLimit: t,
|
|
161
169
|
upperLimit: o
|
|
162
|
-
}, `Range filter '${e}'`, n, r, i, a),
|
|
163
|
-
|
|
170
|
+
}, `Range filter '${e}'`, n, r, i, a), p = (e, t) => {
|
|
171
|
+
let o = c[e] === "Number" ? Number(t) : NaN;
|
|
172
|
+
return Number.isFinite(o) ? f(e, {
|
|
173
|
+
min: o,
|
|
174
|
+
max: o
|
|
175
|
+
}) : k("value", {
|
|
164
176
|
fieldName: e,
|
|
165
177
|
value: t
|
|
166
|
-
}, `Value filter '${e}'`, n, r, i, a)
|
|
167
|
-
|
|
168
|
-
Promise.all(
|
|
178
|
+
}, `Value filter '${e}'`, n, r, i, a);
|
|
179
|
+
}, [m, h, g] = await Promise.all([
|
|
180
|
+
Promise.all(l.map(async ([e, t]) => A(await Promise.all(t.map((t) => p(e, t))), o[e] === "any" ? "or" : "and", n, r, i, a))),
|
|
181
|
+
Promise.all(u.map(([e, t]) => f(e, t))),
|
|
182
|
+
Promise.all(d.map(async ([e, t]) => A(await Promise.all(t.map((t) => f(e, t))), "or", n, r, i, a)))
|
|
169
183
|
]);
|
|
170
184
|
return A([
|
|
171
|
-
...
|
|
172
|
-
...
|
|
173
|
-
...
|
|
185
|
+
...m,
|
|
186
|
+
...h,
|
|
187
|
+
...g
|
|
174
188
|
], "and", n, r, i, a);
|
|
175
189
|
}
|
|
176
190
|
//#endregion
|
|
@@ -181,8 +195,8 @@ function j(e, t) {
|
|
|
181
195
|
};
|
|
182
196
|
return r.cancel = () => clearTimeout(n), r;
|
|
183
197
|
}
|
|
184
|
-
function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team: s, dataset: u, allowEmptySearch: d, facetsEnabled: f, enableDebugLogs: p, shouldFetchMore: m }) {
|
|
185
|
-
let
|
|
198
|
+
function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team: s, dataset: u, allowEmptySearch: d, facetsEnabled: f, enableDebugLogs: p, shouldFetchMore: m, sessionId: h }) {
|
|
199
|
+
let g = c(0), _ = c(void 0), v = c(!1), [y, b] = l({}), [x, S] = l(""), [C, w] = l("");
|
|
186
200
|
o(() => {
|
|
187
201
|
r.isFetchingInitial || t((e) => ({
|
|
188
202
|
...e,
|
|
@@ -192,6 +206,7 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
192
206
|
filterableFields: r.filterableFields,
|
|
193
207
|
facetableFields: r.facetableFields,
|
|
194
208
|
sortableFields: r.sortableFields,
|
|
209
|
+
fieldTypes: r.fieldTypes,
|
|
195
210
|
fieldsSeeded: !0
|
|
196
211
|
}));
|
|
197
212
|
}, [
|
|
@@ -203,9 +218,9 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
203
218
|
r.sortableFields,
|
|
204
219
|
t
|
|
205
220
|
]);
|
|
206
|
-
let
|
|
221
|
+
let T = e.searchSettings.maxNumberOfRecordsToReturn, E = e.searchSettings.enableCoverage, D = e.searchSettings.removeDuplicates, k = e.searchSettings.coverageDepth, A = e.searchSettings.minimumScore, M = e.searchSettings.coverageSetup, N = e.sortBy, P = e.sortAscending, F = i(async ({ enableFacets: i }) => {
|
|
207
222
|
if (!r.token) return;
|
|
208
|
-
let o = ++
|
|
223
|
+
let o = ++g.current;
|
|
209
224
|
if (t((e) => ({
|
|
210
225
|
...e,
|
|
211
226
|
isLoading: !0
|
|
@@ -214,114 +229,118 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
214
229
|
i = !0;
|
|
215
230
|
}
|
|
216
231
|
try {
|
|
217
|
-
let c = i ? Array.from(new Set([...Object.keys(e.filters).filter((t) => e.valueMatch[t] === "any" && (e.filters[t]?.length ?? 0) > 0), ...Object.keys(e.bucketFilters).filter((t) => (e.bucketFilters[t]?.length ?? 0) > 0)])) : [], [l, ...f] = await Promise.all([ee(e.filters, e.rangeFilters, a, s, u, n, e.valueMatch, e.bucketFilters), ...c.map((t) => ee({
|
|
232
|
+
let c = i ? Array.from(new Set([...Object.keys(e.filters).filter((t) => e.valueMatch[t] === "any" && (e.filters[t]?.length ?? 0) > 0), ...Object.keys(e.bucketFilters).filter((t) => (e.bucketFilters[t]?.length ?? 0) > 0)])) : [], [l, ...f] = await Promise.all([ee(e.filters, e.rangeFilters, a, s, u, n, e.valueMatch, e.bucketFilters, e.fieldTypes), ...c.map((t) => ee({
|
|
218
233
|
...e.filters,
|
|
219
234
|
[t]: []
|
|
220
235
|
}, e.rangeFilters, a, s, u, n, e.valueMatch, {
|
|
221
236
|
...e.bucketFilters,
|
|
222
237
|
[t]: []
|
|
223
|
-
}))]), m = d || e.query.trim() !== "",
|
|
238
|
+
}, e.fieldTypes))]), m = d || e.query.trim() !== "", _ = {
|
|
224
239
|
text: e.query,
|
|
225
|
-
enableCoverage:
|
|
226
|
-
removeDuplicates:
|
|
227
|
-
coverageDepth:
|
|
228
|
-
coverageSetup:
|
|
229
|
-
},
|
|
230
|
-
...
|
|
231
|
-
maxNumberOfRecordsToReturn: m ?
|
|
240
|
+
enableCoverage: E,
|
|
241
|
+
removeDuplicates: D,
|
|
242
|
+
coverageDepth: k,
|
|
243
|
+
coverageSetup: M
|
|
244
|
+
}, v = {
|
|
245
|
+
..._,
|
|
246
|
+
maxNumberOfRecordsToReturn: m ? T : 0,
|
|
232
247
|
enableFacets: i,
|
|
233
248
|
...l ? { filter: l } : {},
|
|
234
|
-
...
|
|
235
|
-
...
|
|
249
|
+
...N ? { sortBy: N } : {},
|
|
250
|
+
...P === void 0 ? {} : { sortAscending: P }
|
|
236
251
|
};
|
|
237
|
-
p && console.log("[performSearch] request body:", JSON.stringify(
|
|
238
|
-
let j = (e) => n(`${a}/api/teams/${s}/datasets/${u}/search`, {
|
|
252
|
+
p && console.log("[performSearch] request body:", JSON.stringify(v, null, 2));
|
|
253
|
+
let j = (e) => n(`${a}/api/teams/${s}/datasets/${u}/search?session=${encodeURIComponent(h)}`, {
|
|
239
254
|
method: "POST",
|
|
240
255
|
headers: { "Content-Type": "application/json" },
|
|
241
256
|
body: JSON.stringify(e)
|
|
242
|
-
}), [
|
|
243
|
-
...
|
|
257
|
+
}), [F, ...I] = await Promise.all([j(v), ...f.map((e) => j({
|
|
258
|
+
..._,
|
|
244
259
|
maxNumberOfRecordsToReturn: 0,
|
|
245
260
|
enableFacets: !0,
|
|
246
261
|
...e ? { filter: e } : {}
|
|
247
262
|
}))]);
|
|
248
|
-
if (!
|
|
249
|
-
let
|
|
263
|
+
if (!F.ok) throw await O.fromResponse("Search", F);
|
|
264
|
+
let L = await F.json(), R = F.headers.get("Indx-Query-Id") ?? void 0, z = L.truncationIndex ?? -1, B = {};
|
|
250
265
|
for (let e = 0; e < c.length; e++) {
|
|
251
266
|
let t = c[e];
|
|
252
|
-
if (!
|
|
253
|
-
let n = await
|
|
254
|
-
n.facets?.[t] !== void 0 && (
|
|
267
|
+
if (!I[e].ok) throw await O.fromResponse(`Facets for '${t}'`, I[e]);
|
|
268
|
+
let n = await I[e].json();
|
|
269
|
+
n.facets?.[t] !== void 0 && (B[t] = n.facets[t]);
|
|
255
270
|
}
|
|
256
|
-
let
|
|
257
|
-
if (m &&
|
|
271
|
+
let V = L.records || [], H = V.map((e) => e.documentKey), U = V.map((e) => e.score), te = [];
|
|
272
|
+
if (m && H.length > 0) {
|
|
258
273
|
let e = await n(`${a}/api/teams/${s}/datasets/${u}/documents/lookup`, {
|
|
259
274
|
method: "POST",
|
|
260
275
|
headers: { "Content-Type": "application/json" },
|
|
261
|
-
body: JSON.stringify(
|
|
276
|
+
body: JSON.stringify(H)
|
|
262
277
|
});
|
|
263
278
|
if (!e.ok) throw await O.fromResponse("Document lookup", e);
|
|
264
|
-
|
|
279
|
+
te = (await e.json()).map((e, t) => ({
|
|
265
280
|
document: e,
|
|
266
|
-
documentKey:
|
|
267
|
-
score:
|
|
281
|
+
documentKey: H[t],
|
|
282
|
+
score: U[t]
|
|
268
283
|
}));
|
|
269
284
|
}
|
|
270
|
-
let
|
|
271
|
-
if (i &&
|
|
272
|
-
for (let [e, t] of Object.entries(
|
|
285
|
+
let W = {};
|
|
286
|
+
if (i && L.facets) {
|
|
287
|
+
for (let [e, t] of Object.entries(L.facets)) if (Array.isArray(t) && t.length > 0) {
|
|
273
288
|
let n = t.map((e) => Number(e.key)).filter((e) => !isNaN(e));
|
|
274
|
-
n.length > 0 && (
|
|
289
|
+
n.length > 0 && (W[e] = {
|
|
275
290
|
min: Math.min(...n),
|
|
276
291
|
max: Math.max(...n)
|
|
277
292
|
});
|
|
278
293
|
}
|
|
279
294
|
}
|
|
280
|
-
if (o !==
|
|
281
|
-
let
|
|
282
|
-
if (
|
|
295
|
+
if (o !== g.current) return;
|
|
296
|
+
let G = e.query !== x, K = e.query !== C, ne = e.facetStats ?? {};
|
|
297
|
+
if (G ? (ne = {
|
|
283
298
|
...r.initialFacetStats,
|
|
284
|
-
...
|
|
285
|
-
},
|
|
286
|
-
...
|
|
287
|
-
...
|
|
288
|
-
},
|
|
299
|
+
...W
|
|
300
|
+
}, b(ne), S(e.query)) : ne = {
|
|
301
|
+
...y,
|
|
302
|
+
...W
|
|
303
|
+
}, K && i) {
|
|
289
304
|
let n = { ...e.rangeBounds };
|
|
290
|
-
for (let [e, t] of Object.entries(
|
|
305
|
+
for (let [e, t] of Object.entries(W)) n[e] = t;
|
|
291
306
|
t((e) => ({
|
|
292
307
|
...e,
|
|
293
308
|
rangeBounds: n
|
|
294
|
-
})),
|
|
309
|
+
})), w(e.query);
|
|
295
310
|
}
|
|
296
|
-
let
|
|
297
|
-
...
|
|
298
|
-
...
|
|
299
|
-
} :
|
|
300
|
-
if (i && (!
|
|
301
|
-
|
|
302
|
-
for (let [e, t] of Object.entries(r.initialFacetKeys))
|
|
311
|
+
let q = Object.keys(B).length > 0 ? {
|
|
312
|
+
...L.facets ?? {},
|
|
313
|
+
...B
|
|
314
|
+
} : L.facets;
|
|
315
|
+
if (i && (!q || Object.keys(q).length === 0)) {
|
|
316
|
+
q = {};
|
|
317
|
+
for (let [e, t] of Object.entries(r.initialFacetKeys)) q[e] = t.map((e) => ({
|
|
303
318
|
key: e,
|
|
304
319
|
value: null
|
|
305
320
|
}));
|
|
306
321
|
}
|
|
307
|
-
let
|
|
322
|
+
let J = te.filter((t) => {
|
|
308
323
|
let n = e.query.trim();
|
|
309
|
-
return n === "" || n.length === 1 ? !0 : t.score >=
|
|
310
|
-
})
|
|
324
|
+
return n === "" || n.length === 1 ? !0 : t.score >= A;
|
|
325
|
+
}).map((e, t) => ({
|
|
326
|
+
...e,
|
|
327
|
+
position: t + 1
|
|
328
|
+
}));
|
|
311
329
|
t((e) => ({
|
|
312
330
|
...e,
|
|
313
|
-
results:
|
|
331
|
+
results: J,
|
|
314
332
|
error: void 0,
|
|
315
333
|
resultsSuppressed: !m,
|
|
316
334
|
...i ? {
|
|
317
|
-
facets:
|
|
318
|
-
facetStats:
|
|
335
|
+
facets: q,
|
|
336
|
+
facetStats: ne
|
|
319
337
|
} : {},
|
|
320
338
|
isLoading: !1,
|
|
321
|
-
truncationIndex:
|
|
339
|
+
truncationIndex: z,
|
|
340
|
+
queryId: R
|
|
322
341
|
}));
|
|
323
342
|
} catch (e) {
|
|
324
|
-
if (console.error("[Search] ❌ Search failed:", e), e instanceof TypeError && e.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", a)) : e instanceof Error && (e.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Create or refresh it on the Indx Dashboard.")) : e.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error("[Search] 💡 Check that dataset \"" + u + "\" exists")) : console.error("[Search] 💡 Error:", e.message)), o !==
|
|
343
|
+
if (console.error("[Search] ❌ Search failed:", e), e instanceof TypeError && e.message.includes("fetch") ? (console.error("[Search] ❌ Network error - cannot reach INDX server"), console.error("[Search] 💡 Check if server is running at:", a)) : e instanceof Error && (e.message.includes("401") ? (console.error("[Search] ❌ Authentication failed"), console.error("[Search] 💡 Your token may have expired. Create or refresh it on the Indx Dashboard.")) : e.message.includes("404") ? (console.error("[Search] ❌ Dataset not found"), console.error("[Search] 💡 Check that dataset \"" + u + "\" exists")) : console.error("[Search] 💡 Error:", e.message)), o !== g.current) return;
|
|
325
344
|
t((t) => ({
|
|
326
345
|
...t,
|
|
327
346
|
results: null,
|
|
@@ -337,21 +356,21 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
337
356
|
e.rangeFilters,
|
|
338
357
|
e.bucketFilters,
|
|
339
358
|
e.facetStats,
|
|
340
|
-
M,
|
|
341
359
|
N,
|
|
342
|
-
|
|
360
|
+
P,
|
|
343
361
|
T,
|
|
344
362
|
E,
|
|
345
363
|
D,
|
|
346
|
-
A,
|
|
347
364
|
k,
|
|
365
|
+
M,
|
|
366
|
+
A,
|
|
348
367
|
n,
|
|
349
368
|
r.initialFacetStats,
|
|
350
369
|
r.initialFacetKeys,
|
|
351
370
|
r.token,
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
371
|
+
y,
|
|
372
|
+
x,
|
|
373
|
+
C,
|
|
355
374
|
e.rangeBounds,
|
|
356
375
|
a,
|
|
357
376
|
s,
|
|
@@ -361,22 +380,22 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
361
380
|
t
|
|
362
381
|
]);
|
|
363
382
|
o(() => {
|
|
364
|
-
|
|
365
|
-
}, [
|
|
366
|
-
let
|
|
367
|
-
o(() => (
|
|
368
|
-
p && console.log("Debounced searchWithFacets fired"),
|
|
383
|
+
_.current = F;
|
|
384
|
+
}, [F]);
|
|
385
|
+
let I = c(null);
|
|
386
|
+
o(() => (I.current?.cancel(), I.current = j(() => {
|
|
387
|
+
p && console.log("Debounced searchWithFacets fired"), _.current?.({ enableFacets: !0 });
|
|
369
388
|
}, e.facetDebounceDelayMillis ?? 500), () => {
|
|
370
|
-
|
|
389
|
+
I.current?.cancel();
|
|
371
390
|
}), [e.facetDebounceDelayMillis]), o(() => {
|
|
372
|
-
!r.isFetchingInitial && r.token && !
|
|
391
|
+
!r.isFetchingInitial && r.token && !v.current && (d && _.current?.({ enableFacets: f }), v.current = !0);
|
|
373
392
|
}, [
|
|
374
393
|
r.isFetchingInitial,
|
|
375
394
|
r.token,
|
|
376
395
|
d,
|
|
377
396
|
f
|
|
378
397
|
]), o(() => {
|
|
379
|
-
if (!r.token || !
|
|
398
|
+
if (!r.token || !v.current) return;
|
|
380
399
|
let n = e.query.trim(), i = n === "" && d;
|
|
381
400
|
if (n === "" && !d) {
|
|
382
401
|
e.resultsSuppressed || t((e) => ({
|
|
@@ -385,50 +404,54 @@ function M({ state: e, setState: t, authenticatedFetch: n, auth: r, url: a, team
|
|
|
385
404
|
}));
|
|
386
405
|
return;
|
|
387
406
|
}
|
|
388
|
-
return i ? (
|
|
389
|
-
|
|
407
|
+
return i ? (I.current?.cancel(), _.current?.({ enableFacets: f })) : f ? (p && console.log("Search fired"), _.current?.({ enableFacets: !1 }), I.current?.()) : _.current?.({ enableFacets: !1 }), () => {
|
|
408
|
+
I.current?.cancel();
|
|
390
409
|
};
|
|
391
410
|
}, [
|
|
392
411
|
e.query,
|
|
393
412
|
d,
|
|
394
413
|
f
|
|
395
414
|
]), o(() => {
|
|
396
|
-
if (!
|
|
415
|
+
if (!v.current || !r.token || e.filterRevision === 0) return;
|
|
397
416
|
let t = e.query.trim();
|
|
398
|
-
!d && t === "" ||
|
|
417
|
+
!d && t === "" || _.current?.({ enableFacets: f });
|
|
399
418
|
}, [e.filterRevision]), o(() => {
|
|
400
|
-
if (!
|
|
419
|
+
if (!v.current || !r.token) return;
|
|
401
420
|
let t = e.query.trim();
|
|
402
|
-
!d && t === "" ||
|
|
403
|
-
}, [
|
|
404
|
-
let
|
|
421
|
+
!d && t === "" || _.current?.({ enableFacets: f });
|
|
422
|
+
}, [N, P]);
|
|
423
|
+
let L = c(!0), R = c(e.query);
|
|
405
424
|
o(() => {
|
|
406
|
-
if (
|
|
407
|
-
|
|
425
|
+
if (L.current) {
|
|
426
|
+
L.current = !1;
|
|
408
427
|
return;
|
|
409
428
|
}
|
|
410
|
-
if (
|
|
429
|
+
if (R.current !== e.query || !v.current || !r.token) return;
|
|
411
430
|
if (m.current) {
|
|
412
|
-
m.current = !1,
|
|
431
|
+
m.current = !1, _.current?.({ enableFacets: !1 });
|
|
413
432
|
return;
|
|
414
433
|
}
|
|
415
434
|
let t = e.query.trim();
|
|
416
|
-
!d && t === "" ||
|
|
435
|
+
!d && t === "" || _.current?.({ enableFacets: f });
|
|
417
436
|
}, [
|
|
418
|
-
w,
|
|
419
437
|
T,
|
|
420
438
|
E,
|
|
421
439
|
D,
|
|
422
|
-
|
|
423
|
-
|
|
440
|
+
k,
|
|
441
|
+
M,
|
|
442
|
+
A
|
|
424
443
|
]), o(() => {
|
|
425
|
-
|
|
444
|
+
R.current = e.query;
|
|
426
445
|
}, [e.query]);
|
|
427
446
|
}
|
|
428
447
|
//#endregion
|
|
429
448
|
//#region src/context/SearchContext.tsx
|
|
430
|
-
|
|
431
|
-
let
|
|
449
|
+
function N() {
|
|
450
|
+
let e = globalThis.crypto;
|
|
451
|
+
return e?.randomUUID ? e.randomUUID() : Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
452
|
+
}
|
|
453
|
+
var P = n(void 0), F = ({ children: e, url: t, team: n, dataset: r, allowEmptySearch: a = !1, maxResults: s = 10, facetDebounceDelayMillis: u = 500, enableFacets: d = !0, coverageDepth: p = 500, removeDuplicates: m = !0, enableCoverage: h = !0, initialCoverageSetup: g = {}, enableDebugLogs: _ = !1, preAuthenticatedToken: v }) => {
|
|
454
|
+
let y = c(!1), b = c(N()).current, x = c(s), [S, C] = l({
|
|
432
455
|
query: "",
|
|
433
456
|
results: null,
|
|
434
457
|
isLoading: !1,
|
|
@@ -437,6 +460,7 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
437
460
|
filterableFields: [],
|
|
438
461
|
facetableFields: [],
|
|
439
462
|
sortableFields: [],
|
|
463
|
+
fieldTypes: {},
|
|
440
464
|
filters: {},
|
|
441
465
|
valueMatch: {},
|
|
442
466
|
rangeFilters: {},
|
|
@@ -473,42 +497,67 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
473
497
|
o(() => {
|
|
474
498
|
_ && console.log("SearchContext mounted on client");
|
|
475
499
|
}, [_]), o(() => {
|
|
476
|
-
|
|
500
|
+
C((e) => ({
|
|
477
501
|
...e,
|
|
478
502
|
facetDebounceDelayMillis: u
|
|
479
503
|
}));
|
|
480
504
|
}, [u]);
|
|
481
|
-
let [
|
|
505
|
+
let [w] = l(d), T = D({
|
|
482
506
|
url: t,
|
|
483
507
|
team: n,
|
|
484
508
|
dataset: r,
|
|
485
509
|
preAuthenticatedToken: v,
|
|
486
510
|
enableDebugLogs: _
|
|
487
|
-
}),
|
|
488
|
-
if (!
|
|
511
|
+
}), E = i((e, t = {}) => {
|
|
512
|
+
if (!T.token) throw Error("No authentication token available");
|
|
489
513
|
return fetch(e, {
|
|
490
514
|
...t,
|
|
491
515
|
headers: {
|
|
492
516
|
...t.headers,
|
|
493
|
-
Authorization: `Bearer ${
|
|
517
|
+
Authorization: `Bearer ${T.token}`
|
|
494
518
|
}
|
|
495
519
|
});
|
|
496
|
-
}, [
|
|
520
|
+
}, [T.token]);
|
|
497
521
|
M({
|
|
498
|
-
state:
|
|
499
|
-
setState:
|
|
500
|
-
authenticatedFetch:
|
|
501
|
-
auth:
|
|
522
|
+
state: S,
|
|
523
|
+
setState: C,
|
|
524
|
+
authenticatedFetch: E,
|
|
525
|
+
auth: T,
|
|
502
526
|
url: t,
|
|
503
527
|
team: n,
|
|
504
528
|
dataset: r,
|
|
505
529
|
allowEmptySearch: a,
|
|
506
|
-
facetsEnabled:
|
|
530
|
+
facetsEnabled: w,
|
|
507
531
|
enableDebugLogs: _,
|
|
508
|
-
shouldFetchMore: y
|
|
532
|
+
shouldFetchMore: y,
|
|
533
|
+
sessionId: b
|
|
509
534
|
});
|
|
510
|
-
let
|
|
511
|
-
|
|
535
|
+
let O = c(void 0);
|
|
536
|
+
O.current = S.queryId;
|
|
537
|
+
let k = i(async (e) => {
|
|
538
|
+
if (T.token) try {
|
|
539
|
+
let i = await E(`${t}/api/teams/${n}/datasets/${r}/events/select`, {
|
|
540
|
+
method: "POST",
|
|
541
|
+
headers: { "Content-Type": "application/json" },
|
|
542
|
+
body: JSON.stringify({
|
|
543
|
+
queryId: O.current,
|
|
544
|
+
documentKey: e.documentKey,
|
|
545
|
+
position: e.position
|
|
546
|
+
})
|
|
547
|
+
});
|
|
548
|
+
_ && (i.ok ? console.log(`[select] document ${e.documentKey} at position ${e.position}`) : console.warn(`[select] not recorded: ${i.status}`));
|
|
549
|
+
} catch (e) {
|
|
550
|
+
_ && console.warn("[select] failed:", e);
|
|
551
|
+
}
|
|
552
|
+
}, [
|
|
553
|
+
T.token,
|
|
554
|
+
E,
|
|
555
|
+
t,
|
|
556
|
+
n,
|
|
557
|
+
r,
|
|
558
|
+
_
|
|
559
|
+
]), A = i((e) => {
|
|
560
|
+
C((t) => {
|
|
512
561
|
let n = Object.keys(t.filters).length > 0, r = Object.keys(t.rangeFilters).length > 0, i = Object.keys(t.bucketFilters).length > 0;
|
|
513
562
|
return {
|
|
514
563
|
...t,
|
|
@@ -518,17 +567,17 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
518
567
|
bucketFilters: i ? {} : t.bucketFilters,
|
|
519
568
|
searchSettings: {
|
|
520
569
|
...t.searchSettings,
|
|
521
|
-
maxNumberOfRecordsToReturn:
|
|
570
|
+
maxNumberOfRecordsToReturn: x.current
|
|
522
571
|
}
|
|
523
572
|
};
|
|
524
573
|
});
|
|
525
|
-
}, []),
|
|
526
|
-
|
|
574
|
+
}, []), ee = i((e) => {
|
|
575
|
+
C((t) => ({
|
|
527
576
|
...t,
|
|
528
577
|
facetDebounceDelayMillis: e
|
|
529
578
|
}));
|
|
530
|
-
}, []),
|
|
531
|
-
typeof e.maxNumberOfRecordsToReturn == "number" && (
|
|
579
|
+
}, []), j = i((e) => {
|
|
580
|
+
typeof e.maxNumberOfRecordsToReturn == "number" && (x.current = e.maxNumberOfRecordsToReturn), C((t) => {
|
|
532
581
|
let n = {
|
|
533
582
|
...t.searchSettings,
|
|
534
583
|
...e
|
|
@@ -541,16 +590,16 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
541
590
|
searchSettings: n
|
|
542
591
|
};
|
|
543
592
|
});
|
|
544
|
-
}, []),
|
|
545
|
-
y.current = !0,
|
|
593
|
+
}, []), F = i((e) => {
|
|
594
|
+
y.current = !0, C((t) => ({
|
|
546
595
|
...t,
|
|
547
596
|
searchSettings: {
|
|
548
597
|
...t.searchSettings,
|
|
549
598
|
maxNumberOfRecordsToReturn: e
|
|
550
599
|
}
|
|
551
600
|
}));
|
|
552
|
-
}, []),
|
|
553
|
-
|
|
601
|
+
}, []), I = i((e, t, n = !1) => {
|
|
602
|
+
C((r) => {
|
|
554
603
|
let i = { ...r.filters }, a = i[e] || [], o = a.includes(t) ? a.filter((e) => e !== t) : n ? [t] : [...a, t];
|
|
555
604
|
return o.length ? i[e] = o : delete i[e], {
|
|
556
605
|
...r,
|
|
@@ -558,16 +607,16 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
558
607
|
filterRevision: r.filterRevision + 1
|
|
559
608
|
};
|
|
560
609
|
});
|
|
561
|
-
}, []),
|
|
562
|
-
|
|
610
|
+
}, []), L = i((e, t) => {
|
|
611
|
+
C((n) => n.valueMatch[e] === t ? n : {
|
|
563
612
|
...n,
|
|
564
613
|
valueMatch: {
|
|
565
614
|
...n.valueMatch,
|
|
566
615
|
[e]: t
|
|
567
616
|
}
|
|
568
617
|
});
|
|
569
|
-
}, []),
|
|
570
|
-
|
|
618
|
+
}, []), R = i((e, t, n) => {
|
|
619
|
+
C((r) => ({
|
|
571
620
|
...r,
|
|
572
621
|
rangeFilters: {
|
|
573
622
|
...r.rangeFilters,
|
|
@@ -578,16 +627,16 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
578
627
|
},
|
|
579
628
|
filterRevision: r.filterRevision + 1
|
|
580
629
|
}));
|
|
581
|
-
}, []),
|
|
582
|
-
|
|
630
|
+
}, []), z = i(() => {
|
|
631
|
+
C((e) => ({
|
|
583
632
|
...e,
|
|
584
633
|
filters: {},
|
|
585
634
|
rangeFilters: {},
|
|
586
635
|
bucketFilters: {},
|
|
587
636
|
filterRevision: e.filterRevision + 1
|
|
588
637
|
}));
|
|
589
|
-
}, []),
|
|
590
|
-
|
|
638
|
+
}, []), B = i((e, t, n = !0) => {
|
|
639
|
+
C((r) => {
|
|
591
640
|
let i = { ...r.filters }, a = (i[e] || []).filter((e) => e !== t);
|
|
592
641
|
return a.length > 0 ? i[e] = a : delete i[e], {
|
|
593
642
|
...r,
|
|
@@ -595,8 +644,8 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
595
644
|
filterRevision: r.filterRevision + +!!n
|
|
596
645
|
};
|
|
597
646
|
});
|
|
598
|
-
}, []),
|
|
599
|
-
|
|
647
|
+
}, []), V = i((e, t = !0) => {
|
|
648
|
+
C((n) => {
|
|
600
649
|
if (!(e in n.rangeFilters)) return n;
|
|
601
650
|
let r = { ...n.rangeFilters };
|
|
602
651
|
return delete r[e], {
|
|
@@ -605,63 +654,65 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
605
654
|
filterRevision: n.filterRevision + +!!t
|
|
606
655
|
};
|
|
607
656
|
});
|
|
608
|
-
}, []),
|
|
609
|
-
|
|
610
|
-
let i = r.bucketFilters[e] ?? [], a = i.some((e) =>
|
|
657
|
+
}, []), H = (e, t) => e.min === t.min && e.max === t.max, U = i((e, t, n = !1) => {
|
|
658
|
+
C((r) => {
|
|
659
|
+
let i = r.bucketFilters[e] ?? [], a = i.some((e) => H(e, t)) ? i.filter((e) => !H(e, t)) : n ? [t] : [...i, t], o = { ...r.bucketFilters };
|
|
611
660
|
return a.length > 0 ? o[e] = a : delete o[e], {
|
|
612
661
|
...r,
|
|
613
662
|
bucketFilters: o,
|
|
614
663
|
filterRevision: r.filterRevision + 1
|
|
615
664
|
};
|
|
616
665
|
});
|
|
617
|
-
}, []),
|
|
618
|
-
|
|
619
|
-
let i = { ...r.bucketFilters }, a = t ? (i[e] ?? []).filter((e) => !
|
|
666
|
+
}, []), te = i((e, t, n = !0) => {
|
|
667
|
+
C((r) => {
|
|
668
|
+
let i = { ...r.bucketFilters }, a = t ? (i[e] ?? []).filter((e) => !H(e, t)) : [];
|
|
620
669
|
return a.length > 0 ? i[e] = a : delete i[e], {
|
|
621
670
|
...r,
|
|
622
671
|
bucketFilters: i,
|
|
623
672
|
filterRevision: r.filterRevision + +!!n
|
|
624
673
|
};
|
|
625
674
|
});
|
|
626
|
-
}, []),
|
|
627
|
-
|
|
675
|
+
}, []), W = i((e, t) => {
|
|
676
|
+
C((n) => ({
|
|
628
677
|
...n,
|
|
629
678
|
sortBy: e || void 0,
|
|
630
679
|
sortAscending: e ? t : void 0
|
|
631
680
|
}));
|
|
632
681
|
}, []);
|
|
633
|
-
return /* @__PURE__ */ f(
|
|
682
|
+
return /* @__PURE__ */ f(P.Provider, {
|
|
634
683
|
value: {
|
|
635
|
-
state:
|
|
636
|
-
isFetchingInitial:
|
|
637
|
-
authError:
|
|
684
|
+
state: S,
|
|
685
|
+
isFetchingInitial: T.isFetchingInitial || !S.fieldsSeeded,
|
|
686
|
+
authError: T.authError ?? void 0,
|
|
638
687
|
allowEmptySearch: a,
|
|
639
688
|
url: t,
|
|
640
689
|
team: n,
|
|
641
690
|
dataset: r,
|
|
642
|
-
authenticatedFetch:
|
|
643
|
-
setQuery:
|
|
644
|
-
toggleFilter:
|
|
645
|
-
setValueMatch:
|
|
646
|
-
setRangeFilter:
|
|
647
|
-
resetFilters:
|
|
648
|
-
resetSingleFilter:
|
|
649
|
-
resetRangeFilter:
|
|
650
|
-
toggleBucketFilter:
|
|
651
|
-
resetBucketFilter:
|
|
652
|
-
setSort:
|
|
653
|
-
setDebounceDelay:
|
|
654
|
-
setSearchSettings:
|
|
655
|
-
fetchMoreResults:
|
|
691
|
+
authenticatedFetch: E,
|
|
692
|
+
setQuery: A,
|
|
693
|
+
toggleFilter: I,
|
|
694
|
+
setValueMatch: L,
|
|
695
|
+
setRangeFilter: R,
|
|
696
|
+
resetFilters: z,
|
|
697
|
+
resetSingleFilter: B,
|
|
698
|
+
resetRangeFilter: V,
|
|
699
|
+
toggleBucketFilter: U,
|
|
700
|
+
resetBucketFilter: te,
|
|
701
|
+
setSort: W,
|
|
702
|
+
setDebounceDelay: ee,
|
|
703
|
+
setSearchSettings: j,
|
|
704
|
+
fetchMoreResults: F,
|
|
705
|
+
selectResult: k,
|
|
706
|
+
sessionId: b
|
|
656
707
|
},
|
|
657
708
|
children: e
|
|
658
709
|
});
|
|
659
|
-
},
|
|
660
|
-
let e = a(
|
|
710
|
+
}, I = () => {
|
|
711
|
+
let e = a(P);
|
|
661
712
|
if (!e) throw Error("useSearchContext must be used within a SearchProvider");
|
|
662
713
|
return e;
|
|
663
|
-
},
|
|
664
|
-
let { state: { query: o, filters: s, rangeFilters: c, searchSettings: l }, setQuery: u } =
|
|
714
|
+
}, L = ({ className: e = "", autoFocus: t = !1, inputSize: n = "default", showClear: r = !0, showFocus: i = !1, ...a }) => {
|
|
715
|
+
let { state: { query: o, filters: s, rangeFilters: c, searchSettings: l }, setQuery: u } = I();
|
|
665
716
|
Object.keys(s).length > 0 || Object.keys(c).length;
|
|
666
717
|
let d = o.length > 0;
|
|
667
718
|
return /* @__PURE__ */ f(y, {
|
|
@@ -683,10 +734,10 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
683
734
|
children: "Clear"
|
|
684
735
|
})
|
|
685
736
|
});
|
|
686
|
-
},
|
|
737
|
+
}, R = {
|
|
687
738
|
placeholder: "_placeholder_ee9qi_1",
|
|
688
739
|
invalid: "_invalid_ee9qi_11"
|
|
689
|
-
},
|
|
740
|
+
}, z = {
|
|
690
741
|
row: "_row_1i201_1",
|
|
691
742
|
content: "_content_1i201_19",
|
|
692
743
|
indexNumber: "_indexNumber_1i201_31",
|
|
@@ -695,25 +746,25 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
695
746
|
skeletonBarLg: "_skeletonBarLg_1i201_59",
|
|
696
747
|
fade: "_fade_1i201_1",
|
|
697
748
|
skeletonBarSm: "_skeletonBarSm_1i201_66"
|
|
698
|
-
},
|
|
699
|
-
className:
|
|
749
|
+
}, B = ({ skeleton: e = !1, index: t, score: n, showScore: r = !1, children: i, skeletonDelay: a = 0, skeletonWidths: o = [62, 38] }) => /* @__PURE__ */ p("div", {
|
|
750
|
+
className: z.row,
|
|
700
751
|
children: [
|
|
701
752
|
t !== void 0 && /* @__PURE__ */ f("div", {
|
|
702
|
-
className:
|
|
753
|
+
className: z.indexNumber,
|
|
703
754
|
children: t
|
|
704
755
|
}),
|
|
705
756
|
/* @__PURE__ */ f("div", {
|
|
706
|
-
className:
|
|
757
|
+
className: z.content,
|
|
707
758
|
children: e ? /* @__PURE__ */ p("div", {
|
|
708
|
-
className:
|
|
759
|
+
className: z.skeletonBars,
|
|
709
760
|
children: [/* @__PURE__ */ f("div", {
|
|
710
|
-
className:
|
|
761
|
+
className: z.skeletonBarLg,
|
|
711
762
|
style: {
|
|
712
763
|
width: `${o[0]}%`,
|
|
713
764
|
animationDelay: `${a}s`
|
|
714
765
|
}
|
|
715
766
|
}), /* @__PURE__ */ f("div", {
|
|
716
|
-
className:
|
|
767
|
+
className: z.skeletonBarSm,
|
|
717
768
|
style: {
|
|
718
769
|
width: `${o[1]}%`,
|
|
719
770
|
animationDelay: `${a + .05}s`
|
|
@@ -722,14 +773,14 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
722
773
|
}) : i
|
|
723
774
|
}),
|
|
724
775
|
r && n !== void 0 && /* @__PURE__ */ f("div", {
|
|
725
|
-
className:
|
|
776
|
+
className: z.scoreNumber,
|
|
726
777
|
children: n
|
|
727
778
|
})
|
|
728
779
|
]
|
|
729
|
-
}),
|
|
780
|
+
}), V = {
|
|
730
781
|
wrapper: "_wrapper_81m3c_6",
|
|
731
782
|
skeletonAppear: "_skeletonAppear_81m3c_1"
|
|
732
|
-
},
|
|
783
|
+
}, H = [
|
|
733
784
|
[62, 38],
|
|
734
785
|
[75, 45],
|
|
735
786
|
[58, 33],
|
|
@@ -738,68 +789,68 @@ var N = n(void 0), P = ({ children: e, url: t, team: n, dataset: r, allowEmptySe
|
|
|
738
789
|
[55, 35],
|
|
739
790
|
[72, 40],
|
|
740
791
|
[60, 30]
|
|
741
|
-
],
|
|
742
|
-
className:
|
|
743
|
-
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ f(
|
|
792
|
+
], U = ({ rows: e = 6 }) => /* @__PURE__ */ f("div", {
|
|
793
|
+
className: V.wrapper,
|
|
794
|
+
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ f(B, {
|
|
744
795
|
skeleton: !0,
|
|
745
796
|
skeletonDelay: t * .1,
|
|
746
|
-
skeletonWidths:
|
|
797
|
+
skeletonWidths: H[t % H.length]
|
|
747
798
|
}, t))
|
|
748
|
-
}),
|
|
749
|
-
function
|
|
799
|
+
}), te = /^\[\s*(?:'[^']*'(?:\s*,\s*'[^']*')*)?\s*\]$/;
|
|
800
|
+
function W(e) {
|
|
750
801
|
let t = e.trim();
|
|
751
802
|
if (!t.startsWith("[") || !t.endsWith("]")) return;
|
|
752
803
|
try {
|
|
753
804
|
let e = JSON.parse(t);
|
|
754
805
|
if (Array.isArray(e)) return e.map((e) => String(e));
|
|
755
806
|
} catch {}
|
|
756
|
-
if (!
|
|
807
|
+
if (!te.test(t)) return;
|
|
757
808
|
let n = [], r = /'([^']*)'/g, i;
|
|
758
809
|
for (; (i = r.exec(t)) !== null;) n.push(i[1]);
|
|
759
810
|
return n;
|
|
760
811
|
}
|
|
761
|
-
var
|
|
762
|
-
let { state: { results: i, resultsSuppressed: a, searchSettings: s, truncationIndex: u, query: h, error: g }, isFetchingInitial: _, authError: v, allowEmptySearch: y, fetchMoreResults: b } =
|
|
812
|
+
var G = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r }) => {
|
|
813
|
+
let { state: { results: i, resultsSuppressed: a, searchSettings: s, truncationIndex: u, query: h, error: g }, isFetchingInitial: _, authError: v, allowEmptySearch: y, fetchMoreResults: b, selectResult: x } = I(), S = t ?? 30, [C, w] = l(S), E = c(0), D = c("");
|
|
763
814
|
o(() => {
|
|
764
|
-
let e = h !==
|
|
765
|
-
(!i || i.length <
|
|
815
|
+
let e = h !== D.current;
|
|
816
|
+
(!i || i.length < E.current || e) && w(S), E.current = i?.length ?? 0, D.current = h;
|
|
766
817
|
}, [
|
|
767
818
|
i,
|
|
768
|
-
|
|
819
|
+
S,
|
|
769
820
|
h
|
|
770
821
|
]);
|
|
771
|
-
let
|
|
772
|
-
let e =
|
|
773
|
-
|
|
822
|
+
let O = i && i.length > C, k = () => {
|
|
823
|
+
let e = C + S;
|
|
824
|
+
w(e), i && e >= i.length && (!u || u === -1 || u > i.length) && b(i.length + S);
|
|
774
825
|
};
|
|
775
|
-
if (_) return y ? /* @__PURE__ */ f(
|
|
776
|
-
className:
|
|
826
|
+
if (_) return y ? /* @__PURE__ */ f(U, { rows: S }) : /* @__PURE__ */ f("div", {
|
|
827
|
+
className: R.placeholder,
|
|
777
828
|
children: /* @__PURE__ */ f(T, {
|
|
778
829
|
size: 200,
|
|
779
830
|
color: "var(--lv5)"
|
|
780
831
|
})
|
|
781
832
|
});
|
|
782
|
-
let
|
|
783
|
-
return
|
|
784
|
-
className:
|
|
833
|
+
let A = v ?? g;
|
|
834
|
+
return A ? /* @__PURE__ */ f("div", {
|
|
835
|
+
className: R.invalid,
|
|
785
836
|
role: "alert",
|
|
786
|
-
children: /* @__PURE__ */ f("p", { children:
|
|
837
|
+
children: /* @__PURE__ */ f("p", { children: A })
|
|
787
838
|
}) : a || i === null ? /* @__PURE__ */ f("div", {
|
|
788
|
-
className:
|
|
839
|
+
className: R.placeholder,
|
|
789
840
|
children: /* @__PURE__ */ f(T, {
|
|
790
841
|
size: 200,
|
|
791
842
|
color: "var(--lv5)"
|
|
792
843
|
})
|
|
793
844
|
}) : i.length === 0 ? /* @__PURE__ */ f("div", {
|
|
794
|
-
className:
|
|
845
|
+
className: R.invalid,
|
|
795
846
|
children: /* @__PURE__ */ f("p", { children: "No results found." })
|
|
796
|
-
}) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", { children: (i ?? []).slice(0,
|
|
847
|
+
}) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", { children: (i ?? []).slice(0, C).map((t, i) => {
|
|
797
848
|
let a = t.document, o = t.score, c;
|
|
798
849
|
try {
|
|
799
850
|
c = typeof a == "string" ? JSON.parse(a) : a;
|
|
800
851
|
} catch {
|
|
801
852
|
return /* @__PURE__ */ f("div", {
|
|
802
|
-
className:
|
|
853
|
+
className: R.invalid,
|
|
803
854
|
children: /* @__PURE__ */ f("p", { children: "Invalid JSON" })
|
|
804
855
|
}, i);
|
|
805
856
|
}
|
|
@@ -811,17 +862,20 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
811
862
|
if (n) for (let e in l) {
|
|
812
863
|
let t = l[e];
|
|
813
864
|
if (typeof t == "string") {
|
|
814
|
-
let n =
|
|
865
|
+
let n = W(t);
|
|
815
866
|
n && (l[e] = n);
|
|
816
867
|
}
|
|
817
868
|
}
|
|
818
|
-
return /* @__PURE__ */ f(
|
|
869
|
+
return /* @__PURE__ */ f(B, {
|
|
819
870
|
index: i,
|
|
820
871
|
score: o,
|
|
821
872
|
showScore: s.showScore,
|
|
822
|
-
children: r(l
|
|
873
|
+
children: r(l, {
|
|
874
|
+
result: t,
|
|
875
|
+
select: () => x?.(t) ?? Promise.resolve()
|
|
876
|
+
})
|
|
823
877
|
}, i);
|
|
824
|
-
}) }),
|
|
878
|
+
}) }), O && /* @__PURE__ */ f("div", {
|
|
825
879
|
style: {
|
|
826
880
|
textAlign: "center",
|
|
827
881
|
marginTop: "20px"
|
|
@@ -829,15 +883,15 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
829
883
|
children: /* @__PURE__ */ f(m, {
|
|
830
884
|
variant: "secondary",
|
|
831
885
|
size: "micro",
|
|
832
|
-
onClick:
|
|
833
|
-
children: h.trim() === "" ? "Load more" : u !== -1 && u !== void 0 && u > 0 ? `Load results ${
|
|
886
|
+
onClick: k,
|
|
887
|
+
children: h.trim() === "" ? "Load more" : u !== -1 && u !== void 0 && u > 0 ? `Load results ${C + 1}-${Math.min(C + S, i.length, u)} of ${u}` : "Load more"
|
|
834
888
|
})
|
|
835
889
|
})] });
|
|
836
|
-
},
|
|
890
|
+
}, K = {
|
|
837
891
|
row: "_row_ujwhc_1",
|
|
838
892
|
title: "_title_ujwhc_8"
|
|
839
|
-
},
|
|
840
|
-
className: [
|
|
893
|
+
}, ne = ({ variant: e = "default", children: t }) => /* @__PURE__ */ f("div", {
|
|
894
|
+
className: [K.row, e === "title" ? K.title : ""].filter(Boolean).join(" "),
|
|
841
895
|
children: t
|
|
842
896
|
}), q = {
|
|
843
897
|
bar: "_bar_4nxla_12",
|
|
@@ -858,7 +912,7 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
858
912
|
75,
|
|
859
913
|
50,
|
|
860
914
|
68
|
|
861
|
-
],
|
|
915
|
+
], re = ({ title: e, rows: t = 5, variant: n = "list", withHistogram: r = !1, collapsible: i = !0, startCollapsed: a = !1 }) => /* @__PURE__ */ f(g, {
|
|
862
916
|
title: e,
|
|
863
917
|
collapsible: i,
|
|
864
918
|
collapsed: a,
|
|
@@ -896,8 +950,8 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
896
950
|
chipLabel: "_chipLabel_18vbb_32",
|
|
897
951
|
grid: "_grid_18vbb_40",
|
|
898
952
|
active: "_active_18vbb_54"
|
|
899
|
-
},
|
|
900
|
-
let { state: { facets: D, filterableFields: O, facetableFields: k, filters: A, query: ee }, toggleFilter: j, setValueMatch: M, isFetchingInitial: N, allowEmptySearch: P } =
|
|
953
|
+
}, ie = ({ field: e, label: t, preserveBlankFacetState: n = !1, preserveBlankFacetStateOrder: r = !1, sortFacetsBy: i = "histogram", limit: a = 10, collapsible: s = !0, startCollapsed: u = !1, control: d, displayType: _, layout: y = "list", showActivePanel: b = !1, showCount: x = !0, showNull: C = !1, match: w = "all", displayIfEmptyQuery: T = !0, displayCondition: E = (e) => !0 }) => {
|
|
954
|
+
let { state: { facets: D, filterableFields: O, facetableFields: k, filters: A, query: ee }, toggleFilter: j, setValueMatch: M, isFetchingInitial: N, allowEmptySearch: P } = I(), F = d ?? _ ?? "checkbox", L = F === "radio" ? "any" : w;
|
|
901
955
|
o(() => {
|
|
902
956
|
M(e, L);
|
|
903
957
|
}, [
|
|
@@ -909,10 +963,10 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
909
963
|
if (o(() => {
|
|
910
964
|
B(a);
|
|
911
965
|
}, [D?.[e], a]), !P && !ee) return null;
|
|
912
|
-
if (N || !D) return
|
|
966
|
+
if (N || !D) return F === "toggle" ? /* @__PURE__ */ f(re, {
|
|
913
967
|
rows: 1,
|
|
914
968
|
collapsible: !1
|
|
915
|
-
}) : /* @__PURE__ */ f(
|
|
969
|
+
}) : /* @__PURE__ */ f(re, {
|
|
916
970
|
title: t,
|
|
917
971
|
rows: Math.min(a, 6),
|
|
918
972
|
collapsible: s,
|
|
@@ -942,7 +996,7 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
942
996
|
})
|
|
943
997
|
});
|
|
944
998
|
}
|
|
945
|
-
let V = D?.[e] ?? (
|
|
999
|
+
let V = D?.[e] ?? (F === "toggle" ? [] : void 0);
|
|
946
1000
|
if (!V || !Array.isArray(V)) return null;
|
|
947
1001
|
let H = A?.[e] ?? [];
|
|
948
1002
|
n && !R.current && V.length > 0 && (R.current = V.reduce((e, t) => (e[t.key] = t.value, e), {}));
|
|
@@ -956,12 +1010,12 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
956
1010
|
"true",
|
|
957
1011
|
"false",
|
|
958
1012
|
"null"
|
|
959
|
-
]), W = Array.from(U.keys()), G =
|
|
1013
|
+
]), W = Array.from(U.keys()), G = F === "toggle" && (W.length > 0 && W.every((e) => te.has(e)) || W.length === 0 && H.length > 0);
|
|
960
1014
|
if (G && U.has("null")) {
|
|
961
1015
|
let e = U.get("null") ?? 0, t = U.get("false") ?? 0;
|
|
962
1016
|
U.set("false", t + e), U.delete("null");
|
|
963
1017
|
}
|
|
964
|
-
if (
|
|
1018
|
+
if (F === "toggle" && !G) return /* @__PURE__ */ f(g, {
|
|
965
1019
|
collapsible: !1,
|
|
966
1020
|
children: /* @__PURE__ */ f("div", {
|
|
967
1021
|
className: Y.count,
|
|
@@ -1007,9 +1061,9 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
1007
1061
|
let e = K.filter(([, e]) => typeof e == "number" && e > 0), t = K.filter(([, e]) => e === 0 || e === null);
|
|
1008
1062
|
K = [...e, ...t];
|
|
1009
1063
|
}
|
|
1010
|
-
let
|
|
1011
|
-
let r = H.includes(t), i = n === 0, a = x && (n ?? 0) > 0 ? ` (${n})` : "", o = x && (n ?? 0) > 0 ? n : "", s = () => j(e, t,
|
|
1012
|
-
switch (
|
|
1064
|
+
let ne = typeof a == "number" && K.length > a, q = ne ? K.slice(0, z) : K, J = (t, n) => {
|
|
1065
|
+
let r = H.includes(t), i = n === 0, a = x && (n ?? 0) > 0 ? ` (${n})` : "", o = x && (n ?? 0) > 0 ? n : "", s = () => j(e, t, F === "radio");
|
|
1066
|
+
switch (F) {
|
|
1013
1067
|
case "button": return y === "list" ? /* @__PURE__ */ p("div", {
|
|
1014
1068
|
className: Y.count,
|
|
1015
1069
|
children: [/* @__PURE__ */ f(m, {
|
|
@@ -1096,7 +1150,7 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
1096
1150
|
padding: 0,
|
|
1097
1151
|
margin: 0
|
|
1098
1152
|
},
|
|
1099
|
-
children: [
|
|
1153
|
+
children: [q.map(([e, t]) => /* @__PURE__ */ f("li", { children: J(e, t) }, e)), ne && z < K.length && (() => {
|
|
1100
1154
|
let e = K.length - z, t = Math.min(50, e);
|
|
1101
1155
|
return /* @__PURE__ */ f("li", {
|
|
1102
1156
|
className: Y.toggleItem,
|
|
@@ -1124,33 +1178,33 @@ var W = ({ fields: e, resultsPerPage: t, parseArrayStrings: n = !1, children: r
|
|
|
1124
1178
|
};
|
|
1125
1179
|
//#endregion
|
|
1126
1180
|
//#region src/utils/numeric.ts
|
|
1127
|
-
function
|
|
1181
|
+
function ae(e) {
|
|
1128
1182
|
if (!Number.isFinite(e)) return 0;
|
|
1129
1183
|
let t = String(e), n = t.indexOf(".");
|
|
1130
1184
|
return n === -1 ? 0 : Math.min(6, t.length - n - 1);
|
|
1131
1185
|
}
|
|
1132
|
-
function
|
|
1186
|
+
function oe(e) {
|
|
1133
1187
|
let t = 0;
|
|
1134
|
-
for (let n of e) t = Math.max(t,
|
|
1188
|
+
for (let n of e) t = Math.max(t, ae(n));
|
|
1135
1189
|
return t === 0 ? 1 : Number((10 ** -t).toFixed(t));
|
|
1136
1190
|
}
|
|
1137
1191
|
function Z(e, t) {
|
|
1138
|
-
return Number(e.toFixed(
|
|
1192
|
+
return Number(e.toFixed(ae(t)));
|
|
1139
1193
|
}
|
|
1140
1194
|
//#endregion
|
|
1141
1195
|
//#region src/components/RangeFilterPanel.tsx
|
|
1142
|
-
function
|
|
1196
|
+
function se(e, t, n) {
|
|
1143
1197
|
let r = t + Math.round((e - t) / n) * n;
|
|
1144
|
-
return Number(r.toFixed(
|
|
1198
|
+
return Number(r.toFixed(ae(n)));
|
|
1145
1199
|
}
|
|
1146
|
-
var
|
|
1147
|
-
let { state: { rangeFilters: v, rangeBounds: y, facetStats: b, facets: S, filterableFields: C, facetableFields: w, query: T, facetDebounceDelayMillis: E }, setRangeFilter: D, resetRangeFilter: O, allowEmptySearch: k, isFetchingInitial: A } =
|
|
1200
|
+
var ce = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, control: a, displayType: o, showActivePanel: s = !1, collapsible: c = !0, startCollapsed: l = !1, showHistogram: u = !1, resolution: d, step: m, stepMarks: h }) => {
|
|
1201
|
+
let { state: { rangeFilters: v, rangeBounds: y, facetStats: b, facets: S, filterableFields: C, facetableFields: w, query: T, facetDebounceDelayMillis: E }, setRangeFilter: D, resetRangeFilter: O, allowEmptySearch: k, isFetchingInitial: A } = I(), ee = a ?? o ?? "input", j = y?.[t] !== void 0, M = y?.[t] ?? {
|
|
1148
1202
|
min: r,
|
|
1149
1203
|
max: i
|
|
1150
|
-
}, N = M.min, P = M.max,
|
|
1204
|
+
}, N = M.min, P = M.max, F = b?.[t] ?? M, L = Math.max(N, Math.min(P, F.min)), R = Math.max(N, Math.min(P, F.max)), z = e.useMemo(() => {
|
|
1151
1205
|
if (m) return m;
|
|
1152
|
-
let e = Math.max(
|
|
1153
|
-
if (Array.isArray(n)) for (let t of n) e = Math.max(e,
|
|
1206
|
+
let e = Math.max(ae(N), ae(P)), n = S?.[t];
|
|
1207
|
+
if (Array.isArray(n)) for (let t of n) e = Math.max(e, ae(Number(t.key)));
|
|
1154
1208
|
return e === 0 ? 1 : Number((10 ** -e).toFixed(e));
|
|
1155
1209
|
}, [
|
|
1156
1210
|
m,
|
|
@@ -1158,21 +1212,21 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1158
1212
|
P,
|
|
1159
1213
|
S,
|
|
1160
1214
|
t
|
|
1161
|
-
]), B = j && N === P, V = B ? r : N, H = B ? i : P, U = v?.[t], te = s && U !== void 0 ? X.active : void 0, W = U ? U.min : N, G = U ? U.max : P, K = U !== void 0,
|
|
1162
|
-
let e =
|
|
1163
|
-
return { width: `calc(${Math.max(3, N.toFixed(e).length, P.toFixed(e).length,
|
|
1215
|
+
]), B = j && N === P, V = B ? r : N, H = B ? i : P, U = v?.[t], te = s && U !== void 0 ? X.active : void 0, W = U ? U.min : N, G = U ? U.max : P, K = U !== void 0, ne = L !== N || R !== P, [q, J] = e.useState([W, G]), [Y, ie] = e.useState(!1), [oe, ce] = e.useState(!1), [Q, le] = e.useState(String(W)), [ue, $] = e.useState(String(G)), de = e.useMemo(() => {
|
|
1216
|
+
let e = ae(z);
|
|
1217
|
+
return { width: `calc(${Math.max(3, N.toFixed(e).length, P.toFixed(e).length, Q.length, ue.length) + 1}ch + 20px)` };
|
|
1164
1218
|
}, [
|
|
1165
1219
|
z,
|
|
1166
1220
|
N,
|
|
1167
1221
|
P,
|
|
1168
|
-
|
|
1169
|
-
|
|
1222
|
+
Q,
|
|
1223
|
+
ue
|
|
1170
1224
|
]);
|
|
1171
1225
|
e.useEffect(() => {
|
|
1172
|
-
le(String(
|
|
1173
|
-
}, [
|
|
1226
|
+
le(String(q[0])), $(String(q[1]));
|
|
1227
|
+
}, [q]);
|
|
1174
1228
|
let { finalMin: fe, finalMax: pe, isValidMin: me, isValidMax: he } = e.useMemo(() => {
|
|
1175
|
-
let [e, t] =
|
|
1229
|
+
let [e, t] = q, n = Math.max(N, Math.min(P, e)), r = Math.max(N, Math.min(P, t)), i = Math.min(n, r), a = Math.max(n, r);
|
|
1176
1230
|
return {
|
|
1177
1231
|
finalMin: i,
|
|
1178
1232
|
finalMax: a,
|
|
@@ -1180,18 +1234,18 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1180
1234
|
isValidMax: a <= P && a >= i
|
|
1181
1235
|
};
|
|
1182
1236
|
}, [
|
|
1183
|
-
|
|
1237
|
+
q,
|
|
1184
1238
|
N,
|
|
1185
1239
|
P
|
|
1186
1240
|
]);
|
|
1187
1241
|
e.useEffect(() => {
|
|
1188
1242
|
if (B) return;
|
|
1189
|
-
if (
|
|
1190
|
-
|
|
1243
|
+
if (q[0] === N && q[1] === P) {
|
|
1244
|
+
ie(!1), ce(!1);
|
|
1191
1245
|
return;
|
|
1192
1246
|
}
|
|
1193
1247
|
let e = E ?? 500, n = setTimeout(() => {
|
|
1194
|
-
|
|
1248
|
+
ie(!me), ce(!he);
|
|
1195
1249
|
}, 300), r = setTimeout(() => {
|
|
1196
1250
|
me && he && (fe === N && pe === P ? O(t, !1) : D(t, fe, pe));
|
|
1197
1251
|
}, e);
|
|
@@ -1211,7 +1265,7 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1211
1265
|
E,
|
|
1212
1266
|
B
|
|
1213
1267
|
]), e.useEffect(() => {
|
|
1214
|
-
|
|
1268
|
+
J([W, G]), ie(!1), ce(!1);
|
|
1215
1269
|
}, [
|
|
1216
1270
|
W,
|
|
1217
1271
|
G,
|
|
@@ -1223,7 +1277,7 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1223
1277
|
}, [z]), _e = e.useCallback((e) => {
|
|
1224
1278
|
if (B) return;
|
|
1225
1279
|
let [t, n] = ge(e);
|
|
1226
|
-
|
|
1280
|
+
J([Math.max(N, Math.min(R, t)), Math.max(L, Math.min(P, n))]);
|
|
1227
1281
|
}, [
|
|
1228
1282
|
B,
|
|
1229
1283
|
ge,
|
|
@@ -1234,7 +1288,7 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1234
1288
|
]), ve = e.useCallback((e) => {
|
|
1235
1289
|
if (B) return;
|
|
1236
1290
|
let [n, r] = ge(e), i = Math.max(N, Math.min(R, n)), a = Math.max(L, Math.min(P, r));
|
|
1237
|
-
i === N && a === P ? (
|
|
1291
|
+
i === N && a === P ? (J([N, P]), O(t, !0)) : J([i, a]);
|
|
1238
1292
|
}, [
|
|
1239
1293
|
B,
|
|
1240
1294
|
ge,
|
|
@@ -1248,14 +1302,14 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1248
1302
|
if (B) return;
|
|
1249
1303
|
let r = ye.current;
|
|
1250
1304
|
if (U && r && r.start === e && r.last === n) {
|
|
1251
|
-
ye.current = null,
|
|
1305
|
+
ye.current = null, J([N, P]), O(t, !0);
|
|
1252
1306
|
return;
|
|
1253
1307
|
}
|
|
1254
|
-
let i =
|
|
1308
|
+
let i = se(Math.max(N, L, e), N, z), a = Math.max(i, se(Math.min(P, R, n), N, z));
|
|
1255
1309
|
ye.current = {
|
|
1256
1310
|
start: e,
|
|
1257
1311
|
last: n
|
|
1258
|
-
},
|
|
1312
|
+
}, J([i, a]);
|
|
1259
1313
|
}, [
|
|
1260
1314
|
B,
|
|
1261
1315
|
U,
|
|
@@ -1268,32 +1322,32 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1268
1322
|
O
|
|
1269
1323
|
]), xe = e.useCallback(() => {
|
|
1270
1324
|
if (B) return;
|
|
1271
|
-
let e =
|
|
1325
|
+
let e = Q.trim(), t = e === "" ? NaN : Number(e);
|
|
1272
1326
|
if (isNaN(t)) {
|
|
1273
|
-
le(String(
|
|
1327
|
+
le(String(q[0]));
|
|
1274
1328
|
return;
|
|
1275
1329
|
}
|
|
1276
1330
|
let n = Math.max(N, Math.min(R, t));
|
|
1277
|
-
n <
|
|
1331
|
+
n < q[1] ? J([n, q[1]]) : J([N, q[1]]), le(String(n < q[1] ? n : N));
|
|
1278
1332
|
}, [
|
|
1279
1333
|
B,
|
|
1280
|
-
|
|
1281
|
-
|
|
1334
|
+
Q,
|
|
1335
|
+
q,
|
|
1282
1336
|
N,
|
|
1283
1337
|
R
|
|
1284
1338
|
]), Se = e.useCallback(() => {
|
|
1285
1339
|
if (B) return;
|
|
1286
|
-
let e =
|
|
1340
|
+
let e = ue.trim(), t = e === "" ? NaN : Number(e);
|
|
1287
1341
|
if (isNaN(t)) {
|
|
1288
|
-
|
|
1342
|
+
$(String(q[1]));
|
|
1289
1343
|
return;
|
|
1290
1344
|
}
|
|
1291
1345
|
let n = Math.max(L, Math.min(P, t));
|
|
1292
|
-
n >
|
|
1346
|
+
n > q[0] ? J([q[0], n]) : J([q[0], P]), $(String(n > q[0] ? n : P));
|
|
1293
1347
|
}, [
|
|
1294
1348
|
B,
|
|
1295
|
-
|
|
1296
|
-
|
|
1349
|
+
ue,
|
|
1350
|
+
q,
|
|
1297
1351
|
L,
|
|
1298
1352
|
P
|
|
1299
1353
|
]), Ce = (e) => (t) => {
|
|
@@ -1346,7 +1400,7 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1346
1400
|
d,
|
|
1347
1401
|
z
|
|
1348
1402
|
]), Oe = e.useMemo(() => Math.max(...De.map((e) => e.count), 1), [De]);
|
|
1349
|
-
return u && !A && !w?.includes(t) && console.warn(`RangeFilterPanel: showHistogram=true but field "${t}" is not facetable. Add .Facetable = true to this field.`), A ? /* @__PURE__ */ f(
|
|
1403
|
+
return u && !A && !w?.includes(t) && console.warn(`RangeFilterPanel: showHistogram=true but field "${t}" is not facetable. Add .Facetable = true to this field.`), A ? /* @__PURE__ */ f(re, {
|
|
1350
1404
|
title: n,
|
|
1351
1405
|
variant: "slider",
|
|
1352
1406
|
withHistogram: u,
|
|
@@ -1438,14 +1492,14 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1438
1492
|
max: Z(H + z, z),
|
|
1439
1493
|
step: z,
|
|
1440
1494
|
stepMarks: h,
|
|
1441
|
-
value: B ? [V, Z(H + z, z)] : [
|
|
1495
|
+
value: B ? [V, Z(H + z, z)] : [se(fe, V, z), se(pe + z, V, z)],
|
|
1442
1496
|
isRange: !0,
|
|
1443
1497
|
onChange: (e) => _e(e),
|
|
1444
1498
|
onFinalChange: (e) => ve(e),
|
|
1445
1499
|
disabled: B,
|
|
1446
1500
|
activeMin: L,
|
|
1447
1501
|
activeMax: Z(R + z, z),
|
|
1448
|
-
isFaceted:
|
|
1502
|
+
isFaceted: ne,
|
|
1449
1503
|
highlightFaceted: K,
|
|
1450
1504
|
"aria-label": n || `Filter by ${t}`
|
|
1451
1505
|
})
|
|
@@ -1461,26 +1515,26 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1461
1515
|
label: "Min:",
|
|
1462
1516
|
type: "number",
|
|
1463
1517
|
style: de,
|
|
1464
|
-
value: B ? String(N) :
|
|
1518
|
+
value: B ? String(N) : Q,
|
|
1465
1519
|
min: N,
|
|
1466
|
-
max: Z(Math.min(R,
|
|
1520
|
+
max: Z(Math.min(R, q[1] - z), z),
|
|
1467
1521
|
onChange: (e) => le(e.target.value),
|
|
1468
1522
|
onBlur: xe,
|
|
1469
1523
|
onKeyDown: Ce(xe),
|
|
1470
1524
|
disabled: B,
|
|
1471
|
-
isValid: B || !
|
|
1525
|
+
isValid: B || !Y
|
|
1472
1526
|
}), /* @__PURE__ */ f(_, {
|
|
1473
1527
|
label: "Max:",
|
|
1474
1528
|
type: "number",
|
|
1475
1529
|
style: de,
|
|
1476
|
-
value: B ? String(P) :
|
|
1477
|
-
min: Z(Math.max(L,
|
|
1530
|
+
value: B ? String(P) : ue,
|
|
1531
|
+
min: Z(Math.max(L, q[0] + z), z),
|
|
1478
1532
|
max: P,
|
|
1479
|
-
onChange: (e) =>
|
|
1533
|
+
onChange: (e) => $(e.target.value),
|
|
1480
1534
|
onBlur: Se,
|
|
1481
1535
|
onKeyDown: Ce(Se),
|
|
1482
1536
|
disabled: B,
|
|
1483
|
-
isValid: B || !
|
|
1537
|
+
isValid: B || !oe
|
|
1484
1538
|
})]
|
|
1485
1539
|
})
|
|
1486
1540
|
]
|
|
@@ -1504,26 +1558,26 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1504
1558
|
label: "Min:",
|
|
1505
1559
|
type: "number",
|
|
1506
1560
|
style: de,
|
|
1507
|
-
value: B ? String(N) :
|
|
1561
|
+
value: B ? String(N) : Q,
|
|
1508
1562
|
min: N,
|
|
1509
|
-
max: Z(Math.min(R,
|
|
1563
|
+
max: Z(Math.min(R, q[1] - z), z),
|
|
1510
1564
|
onChange: (e) => le(e.target.value),
|
|
1511
1565
|
onBlur: xe,
|
|
1512
1566
|
onKeyDown: Ce(xe),
|
|
1513
1567
|
disabled: B,
|
|
1514
|
-
isValid: B || !
|
|
1568
|
+
isValid: B || !Y
|
|
1515
1569
|
}), /* @__PURE__ */ f(_, {
|
|
1516
1570
|
label: "Max:",
|
|
1517
1571
|
type: "number",
|
|
1518
1572
|
style: de,
|
|
1519
|
-
value: B ? String(P) :
|
|
1520
|
-
min: Z(Math.max(L,
|
|
1573
|
+
value: B ? String(P) : ue,
|
|
1574
|
+
min: Z(Math.max(L, q[0] + z), z),
|
|
1521
1575
|
max: P,
|
|
1522
|
-
onChange: (e) =>
|
|
1576
|
+
onChange: (e) => $(e.target.value),
|
|
1523
1577
|
onBlur: Se,
|
|
1524
1578
|
onKeyDown: Ce(Se),
|
|
1525
1579
|
disabled: B,
|
|
1526
|
-
isValid: B || !
|
|
1580
|
+
isValid: B || !oe
|
|
1527
1581
|
})]
|
|
1528
1582
|
})]
|
|
1529
1583
|
}) : /* @__PURE__ */ f(g, {
|
|
@@ -1551,7 +1605,7 @@ var se = ({ field: t, label: n, expectedMin: r = 0, expectedMax: i = 1e3, contro
|
|
|
1551
1605
|
};
|
|
1552
1606
|
//#endregion
|
|
1553
1607
|
//#region src/components/BucketFilterPanel.tsx
|
|
1554
|
-
function
|
|
1608
|
+
function le(e, t) {
|
|
1555
1609
|
if (!t) return null;
|
|
1556
1610
|
let n = 0, r = !1;
|
|
1557
1611
|
for (let i of t) {
|
|
@@ -1563,15 +1617,15 @@ function ce(e, t) {
|
|
|
1563
1617
|
}
|
|
1564
1618
|
return r ? n : 0;
|
|
1565
1619
|
}
|
|
1566
|
-
var
|
|
1567
|
-
let { state: { facets: S, filterableFields: C, facetableFields: w, bucketFilters: T, rangeBounds: E, facetStats: D, query: O }, toggleBucketFilter: k, isFetchingInitial: A, allowEmptySearch: ee } =
|
|
1620
|
+
var ue = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a, layout: c = "list", showCount: u = !0, showEmpty: d = !1, limit: _, showActivePanel: y = !1, collapsible: b = !0, startCollapsed: x = !1 }) => {
|
|
1621
|
+
let { state: { facets: S, filterableFields: C, facetableFields: w, bucketFilters: T, rangeBounds: E, facetStats: D, query: O }, toggleBucketFilter: k, isFetchingInitial: A, allowEmptySearch: ee } = I(), j = i ?? a ?? "checkbox", M = S?.[e], N = T[e] ?? [], [P, F] = l(_ ?? Infinity);
|
|
1568
1622
|
o(() => {
|
|
1569
|
-
|
|
1623
|
+
F(_ ?? Infinity);
|
|
1570
1624
|
}, [_, M]);
|
|
1571
1625
|
let L = E?.[e] ?? D?.[e], R = s(() => {
|
|
1572
1626
|
let e = [];
|
|
1573
1627
|
if (L && e.push(L.min, L.max), Array.isArray(M)) for (let t of M) e.push(Number(t.key));
|
|
1574
|
-
return
|
|
1628
|
+
return oe(e.filter(Number.isFinite));
|
|
1575
1629
|
}, [L, M]), z = s(() => {
|
|
1576
1630
|
let e = L?.min ?? -Number.MAX_VALUE, t = L?.max ?? Number.MAX_VALUE, i = (n, r, i) => ({
|
|
1577
1631
|
label: i ?? (n === void 0 ? `up to ${r}` : r === void 0 ? `${n} and up` : `${n}-${r}`),
|
|
@@ -1599,7 +1653,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1599
1653
|
L,
|
|
1600
1654
|
R
|
|
1601
1655
|
]);
|
|
1602
|
-
if (A || !S) return /* @__PURE__ */ f(
|
|
1656
|
+
if (A || !S) return /* @__PURE__ */ f(re, {
|
|
1603
1657
|
title: t,
|
|
1604
1658
|
rows: Math.max(1, Math.min(z.length || 5, 8)),
|
|
1605
1659
|
collapsible: b,
|
|
@@ -1619,7 +1673,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1619
1673
|
});
|
|
1620
1674
|
let B = w?.includes(e) && Array.isArray(M), V = (e) => N.some((t) => t.min === e.range.min && t.max === e.range.max), H = z.map((e) => ({
|
|
1621
1675
|
bucket: e,
|
|
1622
|
-
count: B ?
|
|
1676
|
+
count: B ? le(e, M) : null
|
|
1623
1677
|
}));
|
|
1624
1678
|
if (d || (H = H.filter((e) => e.count !== 0 || V(e.bucket))), H.length === 0) return null;
|
|
1625
1679
|
let U = H.slice(0, P), te = (t, n) => {
|
|
@@ -1694,7 +1748,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1694
1748
|
children: [U.map(({ bucket: e, count: t }) => /* @__PURE__ */ f("li", { children: te(e, t) }, `${e.range.min}-${e.range.max}`)), U.length < H.length && /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(m, {
|
|
1695
1749
|
variant: "ghost",
|
|
1696
1750
|
size: "micro",
|
|
1697
|
-
onClick: () =>
|
|
1751
|
+
onClick: () => F(H.length),
|
|
1698
1752
|
children: `Show ${H.length - U.length} more of ${H.length} total`
|
|
1699
1753
|
}) })]
|
|
1700
1754
|
})
|
|
@@ -1703,7 +1757,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1703
1757
|
grid: "_grid_xm2uh_2",
|
|
1704
1758
|
chip: "_chip_xm2uh_17",
|
|
1705
1759
|
chipLabel: "_chipLabel_xm2uh_28"
|
|
1706
|
-
},
|
|
1760
|
+
}, de = r(({ field: e, value: t, onReset: n }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(m, {
|
|
1707
1761
|
onClick: n,
|
|
1708
1762
|
iconRight: /* @__PURE__ */ f(E, {}),
|
|
1709
1763
|
variant: "primary",
|
|
@@ -1718,7 +1772,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1718
1772
|
t
|
|
1719
1773
|
]
|
|
1720
1774
|
})
|
|
1721
|
-
}) })),
|
|
1775
|
+
}) })), fe = r(({ field: e, min: t, max: n, onReset: r }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(m, {
|
|
1722
1776
|
onClick: r,
|
|
1723
1777
|
iconRight: /* @__PURE__ */ f(E, {}),
|
|
1724
1778
|
variant: "primary",
|
|
@@ -1735,7 +1789,7 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1735
1789
|
n
|
|
1736
1790
|
]
|
|
1737
1791
|
})
|
|
1738
|
-
}) })),
|
|
1792
|
+
}) })), pe = r(({ field: e, label: t, onReset: n }) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(m, {
|
|
1739
1793
|
onClick: n,
|
|
1740
1794
|
iconRight: /* @__PURE__ */ f(E, {}),
|
|
1741
1795
|
variant: "primary",
|
|
@@ -1751,8 +1805,8 @@ var le = ({ field: e, label: t, width: n, buckets: r, control: i, displayType: a
|
|
|
1751
1805
|
]
|
|
1752
1806
|
})
|
|
1753
1807
|
}) }));
|
|
1754
|
-
function
|
|
1755
|
-
let { state: { filters: e, rangeFilters: t, bucketFilters: n }, resetFilters: r, resetSingleFilter: i, resetRangeFilter: a, resetBucketFilter: o } =
|
|
1808
|
+
function me() {
|
|
1809
|
+
let { state: { filters: e, rangeFilters: t, bucketFilters: n }, resetFilters: r, resetSingleFilter: i, resetRangeFilter: a, resetBucketFilter: o } = I(), c = s(() => Object.entries(e).map(([e, t]) => t.map((t) => ({
|
|
1756
1810
|
field: e,
|
|
1757
1811
|
value: t
|
|
1758
1812
|
}))).flat(), [e]), l = s(() => Object.entries(t).map(([e, { min: t, max: n }]) => ({
|
|
@@ -1774,18 +1828,18 @@ function pe() {
|
|
|
1774
1828
|
children: /* @__PURE__ */ p("ul", {
|
|
1775
1829
|
className: $.grid,
|
|
1776
1830
|
children: [
|
|
1777
|
-
c.map(({ field: e, value: t }) => /* @__PURE__ */ f(
|
|
1831
|
+
c.map(({ field: e, value: t }) => /* @__PURE__ */ f(de, {
|
|
1778
1832
|
field: e,
|
|
1779
1833
|
value: t,
|
|
1780
1834
|
onReset: () => i(e, t)
|
|
1781
1835
|
}, `${e}-${t}`)),
|
|
1782
|
-
l.map(({ field: e, min: t, max: n }) => /* @__PURE__ */ f(
|
|
1836
|
+
l.map(({ field: e, min: t, max: n }) => /* @__PURE__ */ f(fe, {
|
|
1783
1837
|
field: e,
|
|
1784
1838
|
min: t,
|
|
1785
1839
|
max: n,
|
|
1786
1840
|
onReset: () => a(e)
|
|
1787
1841
|
}, e)),
|
|
1788
|
-
u.map(({ field: e, range: t, label: n }) => /* @__PURE__ */ f(
|
|
1842
|
+
u.map(({ field: e, range: t, label: n }) => /* @__PURE__ */ f(pe, {
|
|
1789
1843
|
field: e,
|
|
1790
1844
|
label: n,
|
|
1791
1845
|
onReset: () => o(e, t)
|
|
@@ -1800,12 +1854,12 @@ function pe() {
|
|
|
1800
1854
|
})
|
|
1801
1855
|
}) : null;
|
|
1802
1856
|
}
|
|
1803
|
-
var
|
|
1857
|
+
var he = {
|
|
1804
1858
|
select: "_select_nwf7i_1",
|
|
1805
1859
|
radioGroup: "_radioGroup_nwf7i_6"
|
|
1806
|
-
},
|
|
1807
|
-
let i = e ?? (t === "radio" ? "radio" : "select"), { state: { sortableFields: a, sortBy: o, sortAscending: s }, setSort: c, isFetchingInitial: l } =
|
|
1808
|
-
if (l) return /* @__PURE__ */ f(
|
|
1860
|
+
}, ge = ({ control: e, displayType: t, collapsible: n = !0, startCollapsed: r = !1 }) => {
|
|
1861
|
+
let i = e ?? (t === "radio" ? "radio" : "select"), { state: { sortableFields: a, sortBy: o, sortAscending: s }, setSort: c, isFetchingInitial: l } = I();
|
|
1862
|
+
if (l) return /* @__PURE__ */ f(re, {
|
|
1809
1863
|
title: "Sort by",
|
|
1810
1864
|
rows: i === "radio" ? 3 : 1,
|
|
1811
1865
|
collapsible: n,
|
|
@@ -1839,7 +1893,7 @@ var me = {
|
|
|
1839
1893
|
placeholder: "Select sort...",
|
|
1840
1894
|
"aria-label": "Sort by"
|
|
1841
1895
|
}) : /* @__PURE__ */ f("div", {
|
|
1842
|
-
className:
|
|
1896
|
+
className: he.radioGroup,
|
|
1843
1897
|
children: d.map((e) => /* @__PURE__ */ f(v, {
|
|
1844
1898
|
id: `sort-${e.value}`,
|
|
1845
1899
|
name: "sort-by",
|
|
@@ -1850,11 +1904,11 @@ var me = {
|
|
|
1850
1904
|
}, e.value))
|
|
1851
1905
|
})
|
|
1852
1906
|
});
|
|
1853
|
-
},
|
|
1907
|
+
}, _e = { list: "_list_1y4fk_1" };
|
|
1854
1908
|
//#endregion
|
|
1855
1909
|
//#region src/components/SearchSettingsPanel.tsx
|
|
1856
|
-
function
|
|
1857
|
-
let { state: { searchSettings: e }, setSearchSettings: t } =
|
|
1910
|
+
function ve() {
|
|
1911
|
+
let { state: { searchSettings: e }, setSearchSettings: t } = I(), [n, r] = l(!1), i = (e, n) => {
|
|
1858
1912
|
let r = parseInt(n, 10);
|
|
1859
1913
|
isNaN(r) || t({ [e]: r });
|
|
1860
1914
|
}, a = (e, n) => {
|
|
@@ -1875,7 +1929,7 @@ function _e() {
|
|
|
1875
1929
|
collapsed: !0,
|
|
1876
1930
|
title: "Settings",
|
|
1877
1931
|
children: /* @__PURE__ */ p("ul", {
|
|
1878
|
-
className:
|
|
1932
|
+
className: _e.list,
|
|
1879
1933
|
children: [
|
|
1880
1934
|
/* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(_, {
|
|
1881
1935
|
label: "Max Results",
|
|
@@ -2009,7 +2063,7 @@ function _e() {
|
|
|
2009
2063
|
}
|
|
2010
2064
|
//#endregion
|
|
2011
2065
|
//#region src/components/SearchErrorBoundary.tsx
|
|
2012
|
-
var
|
|
2066
|
+
var ye = class extends t {
|
|
2013
2067
|
constructor(e) {
|
|
2014
2068
|
super(e), this.state = {
|
|
2015
2069
|
hasError: !1,
|
|
@@ -2091,8 +2145,8 @@ var ve = class extends t {
|
|
|
2091
2145
|
};
|
|
2092
2146
|
//#endregion
|
|
2093
2147
|
//#region src/hooks/useVectorSearch.ts
|
|
2094
|
-
function
|
|
2095
|
-
let { url: n, team: r, dataset: a, authenticatedFetch: o } =
|
|
2148
|
+
function be(e, t) {
|
|
2149
|
+
let { url: n, team: r, dataset: a, authenticatedFetch: o } = I(), [s, c] = l(null), [u, d] = l(!1), [f, p] = l(void 0);
|
|
2096
2150
|
return {
|
|
2097
2151
|
results: s,
|
|
2098
2152
|
isLoading: u,
|
|
@@ -2147,8 +2201,8 @@ function ye(e, t) {
|
|
|
2147
2201
|
}
|
|
2148
2202
|
//#endregion
|
|
2149
2203
|
//#region src/hooks/useHybridSearch.ts
|
|
2150
|
-
function
|
|
2151
|
-
let { url: n, team: r, dataset: a, authenticatedFetch: o } =
|
|
2204
|
+
function xe(e, t) {
|
|
2205
|
+
let { url: n, team: r, dataset: a, authenticatedFetch: o } = I(), [s, c] = l(null), [u, d] = l(!1), [f, p] = l(void 0);
|
|
2152
2206
|
return {
|
|
2153
2207
|
results: s,
|
|
2154
2208
|
isLoading: u,
|
|
@@ -2206,4 +2260,4 @@ function be(e, t) {
|
|
|
2206
2260
|
};
|
|
2207
2261
|
}
|
|
2208
2262
|
//#endregion
|
|
2209
|
-
export {
|
|
2263
|
+
export { me as ActiveFiltersPanel, ue as BucketFilterPanel, re as FilterPanelSkeleton, O as IndxApiError, ce as RangeFilterPanel, P as SearchContext, ye as SearchErrorBoundary, L as SearchInput, F as SearchProvider, B as SearchResult, ne as SearchResultRow, G as SearchResults, U as SearchResultsSkeleton, ve as SearchSettingsPanel, ge as SortByPanel, ie as ValueFilterPanel, xe as useHybridSearch, I as useSearch, I as useSearchContext, be as useVectorSearch };
|