@searchcraft/react-sdk 0.12.1 → 0.12.2
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/client/index.js +43 -23
- package/dist/client/index.js.map +1 -1
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.js +259 -239
- package/dist/server/index.js.map +1 -1
- package/package.json +3 -3
package/dist/server/index.js
CHANGED
|
@@ -116,7 +116,7 @@ var yn = (r, t, e = !0) => {
|
|
|
116
116
|
s.push(r);
|
|
117
117
|
return s;
|
|
118
118
|
}, Ds = (r, t) => r.nodeType === 1 ? r.getAttribute("slot") === null && t === "" || r.getAttribute("slot") === t : r["s-sn"] === t ? !0 : t === "", zt = (r, t = "") => () => {
|
|
119
|
-
},
|
|
119
|
+
}, m = (r, t, ...e) => {
|
|
120
120
|
let s = null, a = null, o = null, n = !1, h = !1;
|
|
121
121
|
const u = [], l = (C) => {
|
|
122
122
|
for (let E = 0; E < C.length; E++)
|
|
@@ -135,8 +135,8 @@ var yn = (r, t, e = !0) => {
|
|
|
135
135
|
u,
|
|
136
136
|
xn
|
|
137
137
|
);
|
|
138
|
-
const
|
|
139
|
-
return
|
|
138
|
+
const p = vr(r, null);
|
|
139
|
+
return p.$attrs$ = t, u.length > 0 && (p.$children$ = u), p.$key$ = a, p.$name$ = o, p;
|
|
140
140
|
}, vr = (r, t) => {
|
|
141
141
|
const e = {
|
|
142
142
|
$flags$: 0,
|
|
@@ -159,7 +159,7 @@ var yn = (r, t, e = !0) => {
|
|
|
159
159
|
}), wn = (r) => {
|
|
160
160
|
if (typeof r.vtag == "function") {
|
|
161
161
|
const e = { ...r.vattrs };
|
|
162
|
-
return r.vkey && (e.key = r.vkey), r.vname && (e.name = r.vname),
|
|
162
|
+
return r.vkey && (e.key = r.vkey), r.vname && (e.name = r.vname), m(r.vtag, e, ...r.vchildren || []);
|
|
163
163
|
}
|
|
164
164
|
const t = vr(r.vtag, r.vtext);
|
|
165
165
|
return t.$attrs$ = r.vattrs, t.$children$ = r.vchildren, t.$key$ = r.vkey, t.$name$ = r.vname, t;
|
|
@@ -181,10 +181,10 @@ var yn = (r, t, e = !0) => {
|
|
|
181
181
|
let n = Os(r, t), h = t.toLowerCase();
|
|
182
182
|
if (t === "class") {
|
|
183
183
|
const u = r.classList, l = zs(e);
|
|
184
|
-
let
|
|
185
|
-
r["s-si"] ? (
|
|
186
|
-
C.startsWith(r["s-si"]) &&
|
|
187
|
-
}),
|
|
184
|
+
let p = zs(s);
|
|
185
|
+
r["s-si"] ? (p.push(r["s-si"]), l.forEach((C) => {
|
|
186
|
+
C.startsWith(r["s-si"]) && p.push(C);
|
|
187
|
+
}), p = [...new Set(p)], u.add(...p), delete r["s-si"]) : (u.remove(...l.filter((C) => C && !p.includes(C))), u.add(...p.filter((C) => C && !l.includes(C))));
|
|
188
188
|
} else if (t === "style") {
|
|
189
189
|
for (const u in e)
|
|
190
190
|
(!s || s[u] == null) && (u.includes("-") ? r.style.removeProperty(u) : r.style[u] = "");
|
|
@@ -275,24 +275,24 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
}, Tn = (r, t, e, s, a = !1) => {
|
|
278
|
-
let o = 0, n = 0, h = 0, u = 0, l = t.length - 1,
|
|
278
|
+
let o = 0, n = 0, h = 0, u = 0, l = t.length - 1, p = t[0], C = t[l], E = s.length - 1, _ = s[0], I = s[E], z, D;
|
|
279
279
|
for (; o <= l && n <= E; )
|
|
280
|
-
if (
|
|
281
|
-
|
|
280
|
+
if (p == null)
|
|
281
|
+
p = t[++o];
|
|
282
282
|
else if (C == null)
|
|
283
283
|
C = t[--l];
|
|
284
284
|
else if (_ == null)
|
|
285
285
|
_ = s[++n];
|
|
286
286
|
else if (I == null)
|
|
287
287
|
I = s[--E];
|
|
288
|
-
else if (dr(
|
|
289
|
-
xt(
|
|
288
|
+
else if (dr(p, _, a))
|
|
289
|
+
xt(p, _, a), p = t[++o], _ = s[++n];
|
|
290
290
|
else if (dr(C, I, a))
|
|
291
291
|
xt(C, I, a), C = t[--l], I = s[--E];
|
|
292
|
-
else if (dr(
|
|
293
|
-
(
|
|
292
|
+
else if (dr(p, I, a))
|
|
293
|
+
(p.$tag$ === "slot" || I.$tag$ === "slot") && Ut(p.$elm$.parentNode, !1), xt(p, I, a), rt(r, p.$elm$, C.$elm$.nextSibling), p = t[++o], I = s[--E];
|
|
294
294
|
else if (dr(C, _, a))
|
|
295
|
-
(
|
|
295
|
+
(p.$tag$ === "slot" || I.$tag$ === "slot") && Ut(C.$elm$.parentNode, !1), xt(C, _, a), rt(r, C.$elm$, p.$elm$), C = t[--l], _ = s[++n];
|
|
296
296
|
else {
|
|
297
297
|
for (h = -1, u = o; u <= l; ++u)
|
|
298
298
|
if (t[u] && t[u].$key$ !== null && t[u].$key$ === _.$key$) {
|
|
@@ -300,9 +300,9 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
300
300
|
break;
|
|
301
301
|
}
|
|
302
302
|
h >= 0 ? (D = t[h], D.$tag$ !== _.$tag$ ? z = Cr(t && t[n], e, h) : (xt(D, _, a), t[h] = void 0, z = D.$elm$), _ = s[++n]) : (z = Cr(t && t[n], e, n), _ = s[++n]), z && rt(
|
|
303
|
-
Bt(
|
|
303
|
+
Bt(p.$elm$).parentNode,
|
|
304
304
|
z,
|
|
305
|
-
Bt(
|
|
305
|
+
Bt(p.$elm$)
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
308
|
o > l ? ha(
|
|
@@ -345,23 +345,23 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
345
345
|
}
|
|
346
346
|
}, rt = (r, t, e) => r == null ? void 0 : r.insertBefore(t, e), Pn = (r, t, e = !1) => {
|
|
347
347
|
var s, a, o, n;
|
|
348
|
-
const h = r.$hostElement$, u = r.$vnode$ || vr(null, null), l = Cn(t) ? t :
|
|
348
|
+
const h = r.$hostElement$, u = r.$vnode$ || vr(null, null), l = Cn(t) ? t : m(null, null, t);
|
|
349
349
|
if (os = h.tagName, e && l.$attrs$)
|
|
350
|
-
for (const
|
|
351
|
-
h.hasAttribute(
|
|
350
|
+
for (const p of Object.keys(l.$attrs$))
|
|
351
|
+
h.hasAttribute(p) && !["key", "ref", "style", "class"].includes(p) && (l.$attrs$[p] = h[p]);
|
|
352
352
|
l.$tag$ = null, l.$flags$ |= 4, r.$vnode$ = l, l.$elm$ = u.$elm$ = h, yr = hn, Jr = h["s-cr"], kr = !1, xt(u, l, e);
|
|
353
353
|
{
|
|
354
354
|
if (we.$flags$ |= 1, is) {
|
|
355
355
|
fa(l.$elm$);
|
|
356
|
-
for (const
|
|
357
|
-
const C =
|
|
356
|
+
for (const p of We) {
|
|
357
|
+
const C = p.$nodeToRelocate$;
|
|
358
358
|
if (!C["s-ol"]) {
|
|
359
359
|
const E = St.createTextNode("");
|
|
360
360
|
E["s-nr"] = C, rt(C.parentNode, C["s-ol"] = E, C);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
for (const
|
|
364
|
-
const C =
|
|
363
|
+
for (const p of We) {
|
|
364
|
+
const C = p.$nodeToRelocate$, E = p.$slotRefNode$;
|
|
365
365
|
if (E) {
|
|
366
366
|
const _ = E.parentNode;
|
|
367
367
|
let I = E.nextSibling;
|
|
@@ -473,8 +473,8 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
473
473
|
const n = Object.entries((s = t.$members$) != null ? s : {});
|
|
474
474
|
n.map(([h, [u]]) => {
|
|
475
475
|
if (u & 31 || u & 32) {
|
|
476
|
-
const { get: l, set:
|
|
477
|
-
l && (t.$members$[h][0] |= 2048),
|
|
476
|
+
const { get: l, set: p } = Object.getOwnPropertyDescriptor(o, h) || {};
|
|
477
|
+
l && (t.$members$[h][0] |= 2048), p && (t.$members$[h][0] |= 4096), Object.defineProperty(o, h, {
|
|
478
478
|
get() {
|
|
479
479
|
return l ? l.apply(this) : Dn(this, h);
|
|
480
480
|
},
|
|
@@ -483,9 +483,9 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
483
483
|
}), Object.defineProperty(o, h, {
|
|
484
484
|
set(C) {
|
|
485
485
|
const E = st(this);
|
|
486
|
-
if (
|
|
486
|
+
if (p) {
|
|
487
487
|
const _ = u & 32 ? this[h] : E.$hostElement$[h];
|
|
488
|
-
typeof _ > "u" && E.$instanceValues$.get(h) ? C = E.$instanceValues$.get(h) : !E.$instanceValues$.get(h) && _ && E.$instanceValues$.set(h, _),
|
|
488
|
+
typeof _ > "u" && E.$instanceValues$.get(h) ? C = E.$instanceValues$.get(h) : !E.$instanceValues$.get(h) && _ && E.$instanceValues$.set(h, _), p.apply(this, [ia(C, u)]), C = u & 32 ? this[h] : E.$hostElement$[h], Bs(this, h, C, t);
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
{
|
|
@@ -498,27 +498,27 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
498
498
|
});
|
|
499
499
|
{
|
|
500
500
|
const h = /* @__PURE__ */ new Map();
|
|
501
|
-
o.attributeChangedCallback = function(u, l,
|
|
501
|
+
o.attributeChangedCallback = function(u, l, p) {
|
|
502
502
|
we.jmp(() => {
|
|
503
503
|
var C;
|
|
504
504
|
const E = h.get(u);
|
|
505
505
|
if (!(this.hasOwnProperty(E) && Rt.lazyLoad)) {
|
|
506
506
|
if (o.hasOwnProperty(E) && typeof this[E] == "number" && // cast type to number to avoid TS compiler issues
|
|
507
|
-
this[E] ==
|
|
507
|
+
this[E] == p)
|
|
508
508
|
return;
|
|
509
509
|
if (E == null) {
|
|
510
510
|
const I = st(this), z = I == null ? void 0 : I.$flags$;
|
|
511
|
-
if (z && !(z & 8) && z & 128 &&
|
|
511
|
+
if (z && !(z & 8) && z & 128 && p !== l) {
|
|
512
512
|
const P = this, M = (C = t.$watchers$) == null ? void 0 : C[u];
|
|
513
513
|
M == null || M.forEach((q) => {
|
|
514
|
-
P[q] != null && P[q].call(P,
|
|
514
|
+
P[q] != null && P[q].call(P, p, l, u);
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
const _ = Object.getOwnPropertyDescriptor(o, E);
|
|
521
|
-
|
|
521
|
+
p = p === null && typeof this[E] == "boolean" ? !1 : p, p !== this[E] && (!_.get || _.set) && (this[E] = p);
|
|
522
522
|
});
|
|
523
523
|
}, r.observedAttributes = Array.from(
|
|
524
524
|
/* @__PURE__ */ new Set([
|
|
@@ -527,8 +527,8 @@ var Jr, os, yr = !1, kr = !1, is = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
527
527
|
([u, l]) => l[0] & 15
|
|
528
528
|
/* HasAttribute */
|
|
529
529
|
).map(([u, l]) => {
|
|
530
|
-
const
|
|
531
|
-
return h.set(
|
|
530
|
+
const p = l[1] || u;
|
|
531
|
+
return h.set(p, u), p;
|
|
532
532
|
})
|
|
533
533
|
])
|
|
534
534
|
);
|
|
@@ -662,14 +662,14 @@ var ba = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
662
662
|
seal: u,
|
|
663
663
|
create: l
|
|
664
664
|
} = Object, {
|
|
665
|
-
apply:
|
|
665
|
+
apply: p,
|
|
666
666
|
construct: C
|
|
667
667
|
} = typeof Reflect < "u" && Reflect;
|
|
668
668
|
h || (h = function(O) {
|
|
669
669
|
return O;
|
|
670
670
|
}), u || (u = function(O) {
|
|
671
671
|
return O;
|
|
672
|
-
}),
|
|
672
|
+
}), p || (p = function(O, V, B) {
|
|
673
673
|
return O.apply(V, B);
|
|
674
674
|
}), C || (C = function(O, V) {
|
|
675
675
|
return new O(...V);
|
|
@@ -679,7 +679,7 @@ var ba = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
679
679
|
return function(O) {
|
|
680
680
|
for (var V = arguments.length, B = new Array(V > 1 ? V - 1 : 0), ie = 1; ie < V; ie++)
|
|
681
681
|
B[ie - 1] = arguments[ie];
|
|
682
|
-
return
|
|
682
|
+
return p(U, O, B);
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
function Tr(U) {
|
|
@@ -1304,7 +1304,7 @@ const Gn = /* @__PURE__ */ ee(class extends J {
|
|
|
1304
1304
|
let s = "<p>Ad Marketplace Ad Placeholder</p>";
|
|
1305
1305
|
return (n = (o = (a = this.core) == null ? void 0 : a.config) == null ? void 0 : o.admAdConfig) != null && n.template && (s = (u = (h = this.core) == null ? void 0 : h.config) == null ? void 0 : u.admAdConfig.template(e.admAd, {
|
|
1306
1306
|
html: qt
|
|
1307
|
-
})),
|
|
1307
|
+
})), m("div", { class: "searchcraft-ad searchcraft-adm-ad", "data-searchcraft-ad-container-id": this.adContainerId, id: `searchcraft-adm-ad-${this.adContainerId}`, innerHTML: s });
|
|
1308
1308
|
}
|
|
1309
1309
|
renderCustomAd() {
|
|
1310
1310
|
var o, n, h;
|
|
@@ -1313,12 +1313,12 @@ const Gn = /* @__PURE__ */ ee(class extends J {
|
|
|
1313
1313
|
return e && (a = e({
|
|
1314
1314
|
searchTerm: this.searchTerm || "",
|
|
1315
1315
|
adContainerId: this.adContainerId
|
|
1316
|
-
}, { html: qt })),
|
|
1316
|
+
}, { html: qt })), m("div", { class: "searchcraft-ad searchcraft-custom-ad", id: s, "data-searchcraft-ad-container-id": this.adContainerId, innerHTML: a });
|
|
1317
1317
|
}
|
|
1318
1318
|
renderNativoAd() {
|
|
1319
1319
|
var s, a;
|
|
1320
1320
|
const e = ((a = (s = this.core) == null ? void 0 : s.config.nativoConfig) == null ? void 0 : a.adClassName) || "ntv-item";
|
|
1321
|
-
return
|
|
1321
|
+
return m("div", { id: `searchcraft-native-ad-${this.adContainerId}`, class: xe("searchcraft-ad", e), "data-searchcraft-ad-container-id": this.adContainerId });
|
|
1322
1322
|
}
|
|
1323
1323
|
render() {
|
|
1324
1324
|
if (this.searchResultCount !== 0)
|
|
@@ -1395,11 +1395,11 @@ const Zn = Sr, Yn = /* @__PURE__ */ ee(class extends J {
|
|
|
1395
1395
|
this.__registerHost(), this.buttonClick = tt(this, "buttonClick");
|
|
1396
1396
|
}
|
|
1397
1397
|
render() {
|
|
1398
|
-
return
|
|
1398
|
+
return m("button", { key: "e54b4566e0286265bc0c8b6bb4e9ef26108575da", "aria-label": this.label, class: xe("searchcraft-button", {
|
|
1399
1399
|
"searchcraft-button-primary": this.hierarchy === "primary",
|
|
1400
1400
|
"searchcraft-button-tertiary": this.hierarchy === "tertiary",
|
|
1401
1401
|
"searchcraft-button-disabled": this.disabled
|
|
1402
|
-
}), disabled: this.disabled, onClick: this.handleButtonClick, type: this.type }, this.iconOnly ? this.icon :
|
|
1402
|
+
}), disabled: this.disabled, onClick: this.handleButtonClick, type: this.type }, this.iconOnly ? this.icon : m(Vn, null, this.iconPosition === "left" && this.icon, m("span", null, this.label), this.iconPosition === "right" && this.icon));
|
|
1403
1403
|
}
|
|
1404
1404
|
}, [0, "searchcraft-button", {
|
|
1405
1405
|
hierarchy: [1],
|
|
@@ -1426,7 +1426,7 @@ const Qn = Rr, Kn = /* @__PURE__ */ ee(class extends J {
|
|
|
1426
1426
|
super(), this.__registerHost();
|
|
1427
1427
|
}
|
|
1428
1428
|
render() {
|
|
1429
|
-
return
|
|
1429
|
+
return m("div", { key: "d42f7abf8dfb2620622b8012d868d32f04b2f354", class: "searchcraft-error-message" }, m("slot", { key: "75a7811576ea8afe80a7ae739f5cf2d411f976df" }, "Search term is required."));
|
|
1430
1430
|
}
|
|
1431
1431
|
}, [4, "searchcraft-error-message"]);
|
|
1432
1432
|
function Er() {
|
|
@@ -1468,31 +1468,46 @@ const qs = (r, t) => {
|
|
|
1468
1468
|
return n;
|
|
1469
1469
|
};
|
|
1470
1470
|
return s(e, []);
|
|
1471
|
-
}, Wr = (r) => {
|
|
1472
|
-
const
|
|
1471
|
+
}, Wr = (r, t) => {
|
|
1472
|
+
const e = {
|
|
1473
1473
|
path: "/",
|
|
1474
1474
|
count: 0,
|
|
1475
1475
|
children: {}
|
|
1476
|
-
},
|
|
1477
|
-
if (
|
|
1478
|
-
for (const
|
|
1479
|
-
|
|
1476
|
+
}, s = [], a = (o) => {
|
|
1477
|
+
if (o.path !== "/" && s.push({ path: o.path, count: o.count }), o.children)
|
|
1478
|
+
for (const n of o.children)
|
|
1479
|
+
a(n);
|
|
1480
1480
|
};
|
|
1481
|
-
|
|
1482
|
-
for (const { path:
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1481
|
+
a(r);
|
|
1482
|
+
for (const { path: o, count: n } of s) {
|
|
1483
|
+
const h = o.split("/").filter(Boolean);
|
|
1484
|
+
if (t && t.length > 0) {
|
|
1485
|
+
let l = !1;
|
|
1486
|
+
for (const p of t)
|
|
1487
|
+
if (p.startsWith("/")) {
|
|
1488
|
+
if (o === p || o.startsWith(`${p}/`)) {
|
|
1489
|
+
l = !0;
|
|
1490
|
+
break;
|
|
1491
|
+
}
|
|
1492
|
+
} else if (h.includes(p)) {
|
|
1493
|
+
l = !0;
|
|
1494
|
+
break;
|
|
1495
|
+
}
|
|
1496
|
+
if (l)
|
|
1497
|
+
continue;
|
|
1498
|
+
}
|
|
1499
|
+
let u = e;
|
|
1500
|
+
for (const l of h) {
|
|
1501
|
+
const p = u.path === "/" ? `/${l}` : `${u.path}/${l}`;
|
|
1502
|
+
u.children[l] || (u.children[l] = {
|
|
1503
|
+
path: p,
|
|
1504
|
+
count: n,
|
|
1490
1505
|
children: {}
|
|
1491
|
-
}),
|
|
1506
|
+
}), u = u.children[l];
|
|
1492
1507
|
}
|
|
1493
|
-
|
|
1508
|
+
u.count = n;
|
|
1494
1509
|
}
|
|
1495
|
-
return
|
|
1510
|
+
return e;
|
|
1496
1511
|
}, eo = /* @__PURE__ */ ee(class extends J {
|
|
1497
1512
|
constructor() {
|
|
1498
1513
|
super();
|
|
@@ -1504,6 +1519,10 @@ const qs = (r, t) => {
|
|
|
1504
1519
|
* The name of the field where facets are applied.
|
|
1505
1520
|
*/
|
|
1506
1521
|
c(this, "fieldName", "");
|
|
1522
|
+
/**
|
|
1523
|
+
* Array of facet values to exclude from rendering.
|
|
1524
|
+
*/
|
|
1525
|
+
c(this, "exclude");
|
|
1507
1526
|
/**
|
|
1508
1527
|
* Emitted when the facets are updated.
|
|
1509
1528
|
*/
|
|
@@ -1554,12 +1573,12 @@ const qs = (r, t) => {
|
|
|
1554
1573
|
return Object.keys(this.selectedPaths).some((e) => this.selectedPaths[e]);
|
|
1555
1574
|
}
|
|
1556
1575
|
handleIncomingSearchResponse(e, s) {
|
|
1557
|
-
var u, l,
|
|
1576
|
+
var u, l, p;
|
|
1558
1577
|
const a = (u = e.searchResponseFacetPrime) == null ? void 0 : u.find((C) => this.fieldName === Object.keys(C)[0]), o = a == null ? void 0 : a[this.fieldName], n = Wr({
|
|
1559
1578
|
path: "/",
|
|
1560
1579
|
count: 0,
|
|
1561
1580
|
children: o || []
|
|
1562
|
-
});
|
|
1581
|
+
}, this.exclude);
|
|
1563
1582
|
switch (s) {
|
|
1564
1583
|
case "SEARCH_TERM_EMPTY":
|
|
1565
1584
|
this.facetTreeCollectedFromSearchResponse = {
|
|
@@ -1579,7 +1598,7 @@ const qs = (r, t) => {
|
|
|
1579
1598
|
path: "/",
|
|
1580
1599
|
count: 0,
|
|
1581
1600
|
children: E || []
|
|
1582
|
-
});
|
|
1601
|
+
}, this.exclude);
|
|
1583
1602
|
this.facetTreeCollectedFromSearchResponse = qs(_, n);
|
|
1584
1603
|
} else
|
|
1585
1604
|
this.facetTreeCollectedFromSearchResponse = n;
|
|
@@ -1604,13 +1623,13 @@ const qs = (r, t) => {
|
|
|
1604
1623
|
};
|
|
1605
1624
|
for (const C of Object.keys(this.selectedPaths).filter((E) => this.selectedPaths[E])) {
|
|
1606
1625
|
const E = C.startsWith("/") ? C.substring(1).split("/") : C.split("/"), _ = !!ka(this.facetTreeCollectedFromSearchResponse, E), I = E.at(-1);
|
|
1607
|
-
!_ && I && ((
|
|
1626
|
+
!_ && I && ((p = h.children) == null || p.push({
|
|
1608
1627
|
children: [],
|
|
1609
1628
|
count: 0,
|
|
1610
1629
|
path: C
|
|
1611
1630
|
}));
|
|
1612
1631
|
}
|
|
1613
|
-
this.facetTreeFromFacetPathsNotInSearchResponse = Wr(h), this.renderedFacetTree = ls(this.facetTreeFromFacetPathsNotInSearchResponse, this.facetTreeCollectedFromSearchResponse);
|
|
1632
|
+
this.facetTreeFromFacetPathsNotInSearchResponse = Wr(h, this.exclude), this.renderedFacetTree = ls(this.facetTreeFromFacetPathsNotInSearchResponse, this.facetTreeCollectedFromSearchResponse);
|
|
1614
1633
|
}
|
|
1615
1634
|
handleStateUpdate(e) {
|
|
1616
1635
|
const s = { ...e }, a = typeof s.searchClientRequestProperties == "string" && s.searchTerm.trim() === "";
|
|
@@ -1623,7 +1642,7 @@ const qs = (r, t) => {
|
|
|
1623
1642
|
this.lastSearchTerm !== o.searchTerm ? this.areAnyFacetPathsSelected ? n = "NEW_SEARCH_TERM_WHILE_FACETS_ACTIVE" : n = "NEW_SEARCH_TERM" : this.lastRangeValues !== JSON.stringify(o.rangeValueForIndexFields) ? n = "RANGE_VALUE_UPDATE" : this.lastFacetValues !== JSON.stringify(o.facetPathsForIndexFields) ? n = "FACET_UPDATE" : this.lastSortType !== o.order_by ? n = "SORT_ORDER_UPDATE" : this.lastSearchMode !== o.mode && (n = "EXACT_MATCH_UPDATE"), this.lastRangeValues = JSON.stringify(o.rangeValueForIndexFields), this.lastFacetValues = JSON.stringify(o.facetPathsForIndexFields), this.lastSortType = o.order_by, this.lastSearchMode = o.mode, this.lastSearchTerm = o.searchTerm, this.lastTimeTaken = s.searchResponseTimeTaken, this.handleIncomingSearchResponse(s, n);
|
|
1624
1643
|
} else if (typeof s.searchClientRequestProperties == "string") {
|
|
1625
1644
|
let o = "NEW_SEARCH_TERM";
|
|
1626
|
-
const n = JSON.parse(s.searchClientRequestProperties), u = (Array.isArray(n.query) ? n.query : [n.query]).filter((
|
|
1645
|
+
const n = JSON.parse(s.searchClientRequestProperties), u = (Array.isArray(n.query) ? n.query : [n.query]).filter((p) => p.occur === "must"), l = JSON.stringify(u);
|
|
1627
1646
|
this.lastFacetValues !== void 0 && this.lastFacetValues !== l ? o = "FACET_UPDATE" : s.searchTerm.trim() === "" && this.lastSearchTerm === "" ? o = "NEW_SEARCH_TERM" : this.lastSearchTerm !== s.searchTerm && (this.areAnyFacetPathsSelected ? o = "NEW_SEARCH_TERM_WHILE_FACETS_ACTIVE" : o = "NEW_SEARCH_TERM"), this.lastFacetValues = l, this.lastSearchTerm = s.searchTerm, this.lastTimeTaken = s.searchResponseTimeTaken, this.handleIncomingSearchResponse(s, o);
|
|
1628
1647
|
}
|
|
1629
1648
|
}
|
|
@@ -1659,9 +1678,9 @@ const qs = (r, t) => {
|
|
|
1659
1678
|
for (const h of Object.keys(this.selectedPaths))
|
|
1660
1679
|
this.selectedPaths[h] && h.startsWith(s.path) && h.length > s.path.length && (a = !0);
|
|
1661
1680
|
const o = Object.keys(this.selectedPaths).includes(s.path), n = Object.keys(s.children).length > 0 && (o || a) || e === "@@root";
|
|
1662
|
-
return
|
|
1681
|
+
return m("div", { class: "searchcraft-facet-list-item" }, e !== "@@root" && m("label", { class: "searchcraft-facet-list-checkbox-label" }, m("div", { class: "searchcraft-facet-list-checkbox-input-wrapper" }, m("input", { class: "searchcraft-facet-list-checkbox-input", checked: this.selectedPaths[s.path], onChange: (h) => {
|
|
1663
1682
|
this.handleCheckboxChange(s.path);
|
|
1664
|
-
}, type: "checkbox" }), a ?
|
|
1683
|
+
}, type: "checkbox" }), a ? m("div", { class: "searchcraft-facet-list-checkbox-input-dash-icon" }, m("svg", { viewBox: "0 0 14 3", fill: "none" }, m("title", null, "Checkbox dash"), m("line", { x1: "1.5", y1: "1.5", x2: "12.5", y2: "1.5", stroke: "white", "stroke-width": "3", "stroke-linecap": "round" }))) : m("div", { class: "searchcraft-facet-list-checkbox-input-check-icon" }, m("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, m("title", null, "Checkbox check"), m("path", { d: "M13.9999 2L5.74988 10L1.99988 6.36364", stroke: "white", "stroke-width": "3", "stroke-linecap": "round", "stroke-linejoin": "round" })))), m("span", null, this.formatFacetName(e), " (", s.count, ")")), n && m("div", { class: "searchcraft-facet-list", style: {
|
|
1665
1684
|
paddingLeft: e !== "@@root" ? "24px" : "0px",
|
|
1666
1685
|
paddingTop: e !== "@@root" ? "6px" : "0px"
|
|
1667
1686
|
} }, Object.keys(s.children).map((h) => {
|
|
@@ -1671,11 +1690,12 @@ const qs = (r, t) => {
|
|
|
1671
1690
|
}
|
|
1672
1691
|
render() {
|
|
1673
1692
|
if (this.fieldName && !(Object.keys(this.facetTreeCollectedFromSearchResponse.children).length === 0 && (this.lastSearchTerm || "").trim().length === 0))
|
|
1674
|
-
return Object.keys(this.facetTreeCollectedFromSearchResponse.children).length === 0 && (this.lastSearchTerm || "").trim().length > 0 ?
|
|
1693
|
+
return Object.keys(this.facetTreeCollectedFromSearchResponse.children).length === 0 && (this.lastSearchTerm || "").trim().length > 0 ? m("p", { class: "searchcraft-facet-list-message" }, "No facets are available for this search query.") : m("div", { class: "searchcraft-facet-list" }, this.renderFacet("@@root", this.renderedFacetTree));
|
|
1675
1694
|
}
|
|
1676
1695
|
}, [0, "searchcraft-facet-list", {
|
|
1677
1696
|
searchcraftId: [1, "searchcraft-id"],
|
|
1678
1697
|
fieldName: [1, "field-name"],
|
|
1698
|
+
exclude: [16],
|
|
1679
1699
|
selectedPaths: [32],
|
|
1680
1700
|
facetTreeCollectedFromSearchResponse: [32],
|
|
1681
1701
|
renderedFacetTree: [32]
|
|
@@ -1720,8 +1740,8 @@ function ro(r, t = "en-US", e = {
|
|
|
1720
1740
|
}) {
|
|
1721
1741
|
const s = new Date(r), o = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), n = 30 * 24 * 60 * 60 * 1e3;
|
|
1722
1742
|
if (o < n) {
|
|
1723
|
-
const h = Math.trunc(o / 1e3), u = Math.trunc(h / 60), l = Math.trunc(u / 60),
|
|
1724
|
-
return
|
|
1743
|
+
const h = Math.trunc(o / 1e3), u = Math.trunc(h / 60), l = Math.trunc(u / 60), p = Math.trunc(l / 24), C = new Intl.RelativeTimeFormat(t, e);
|
|
1744
|
+
return p >= 1 ? C.format(-p, "day") : l >= 1 ? C.format(-l, "hour") : u >= 1 ? C.format(-u, "minute") : C.format(0, "second");
|
|
1725
1745
|
}
|
|
1726
1746
|
return new Intl.DateTimeFormat(t, e).format(s);
|
|
1727
1747
|
}
|
|
@@ -1887,10 +1907,10 @@ const oo = /* @__PURE__ */ ee(class extends J {
|
|
|
1887
1907
|
}
|
|
1888
1908
|
render() {
|
|
1889
1909
|
const e = (this.startValue - this.lowerBound) / (this.upperBound - this.lowerBound) * 100, s = (this.endValue - this.lowerBound) / (this.upperBound - this.lowerBound) * 100, a = this.getLabel(this.startValue), o = this.getLabel(this.endValue);
|
|
1890
|
-
return
|
|
1910
|
+
return m("div", { key: "2c72254f52151edd2e2fa89c092fc788db0b5562", class: "searchcraft-slider" }, m("div", { key: "98c25badf2c9386d7173ea552e510dcc168e7fc7", class: "searchcraft-slider-range" }, m("div", { key: "50774db2253e34b1bce68acc0a40b2706cab542d", class: "searchcraft-slider-active-range", style: {
|
|
1891
1911
|
left: `${e}%`,
|
|
1892
1912
|
width: `${s - e}%`
|
|
1893
|
-
} }),
|
|
1913
|
+
} }), m("input", { key: "229afedc1318a63cbd75806805210cf4f5695e6e", class: xe("searchcraft-slider-input", "searchcraft-slider-input-min-handle"), max: this.upperBound, min: this.lowerBound, onInput: this.handleStartValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === "min" ? "2" : "1" }, type: "range", value: this.startValue }), m("input", { key: "6aa038b01daaba86f501ebbbec30fc6720b549b3", class: xe("searchcraft-slider-input", "searchcraft-slider-input-max-handle"), max: this.upperBound, min: this.lowerBound, onInput: this.handleEndValueChange.bind(this), step: this.step, style: { zIndex: this.lastFocusedHandle === "max" ? "2" : "1" }, type: "range", value: this.endValue })), m("div", { key: "f70501538635c3b08ad1e6ac101d0b3192ef8e04", class: "searchcraft-slider-label" }, m("span", { key: "ddd539b86774f8900771d77d5ef7eb3a67c98d59", class: "searchcraft-slider-start-label" }, a), m("span", { key: "b754a9c8d284e0623032cee6b92f9df88873ec04", class: "searchcraft-slider-end-label" }, o)));
|
|
1894
1914
|
}
|
|
1895
1915
|
}, [0, "searchcraft-slider", {
|
|
1896
1916
|
max: [2],
|
|
@@ -1957,9 +1977,9 @@ const io = /* @__PURE__ */ ee(class extends J {
|
|
|
1957
1977
|
(e = this.unsubscribe) == null || e.call(this), (s = this.cleanupCore) == null || s.call(this);
|
|
1958
1978
|
}
|
|
1959
1979
|
render() {
|
|
1960
|
-
return
|
|
1980
|
+
return m("div", { key: "ab1d5ee21c7aaa28af1c405edc986556858366e8", class: xe("searchcraft-toggle-button", {
|
|
1961
1981
|
"searchcraft-toggle-button-active": this.isActive
|
|
1962
|
-
}) },
|
|
1982
|
+
}) }, m("div", { key: "44f86a16d796d448bdb2fb3af72d4d8e1484364b" }, m("p", { key: "9fedb38795d6379cae56dc005ab8e4a944b4261b", class: "searchcraft-toggle-button-label" }, this.label), this.subLabel && m("p", { key: "44f3d17175184032275fec89a4cfe7f8266b7014", class: "searchcraft-toggle-button-sub-label" }, this.subLabel)), m("button", { key: "15fc18906ff2fb21fe646a4e3a8a2ace4a37cae2", class: "searchcraft-toggle-button-background", onClick: this.handleToggle, type: "button" }, m("div", { key: "716d29c65a199f63f5fd294dc3e3ad2ea4d53aa3", class: "searchcraft-toggle-button-handle" })));
|
|
1963
1983
|
}
|
|
1964
1984
|
}, [0, "searchcraft-toggle-button", {
|
|
1965
1985
|
label: [1],
|
|
@@ -2023,12 +2043,12 @@ const co = /* @__PURE__ */ ee(class extends J {
|
|
|
2023
2043
|
}
|
|
2024
2044
|
}
|
|
2025
2045
|
handleDateRangeChanged(e, s, a) {
|
|
2026
|
-
var h, u, l,
|
|
2046
|
+
var h, u, l, p;
|
|
2027
2047
|
const o = new Date(s), n = new Date(a);
|
|
2028
2048
|
(u = (h = this.core) == null ? void 0 : h.store.getState()) == null || u.addRangeValueForIndexField({
|
|
2029
2049
|
fieldName: e.fieldName,
|
|
2030
2050
|
value: `${e.fieldName}:[${o.toISOString()} TO ${n.toISOString()}]`
|
|
2031
|
-
}), (
|
|
2051
|
+
}), (p = (l = this.core) == null ? void 0 : l.store.getState()) == null || p.search();
|
|
2032
2052
|
}
|
|
2033
2053
|
handleNumericRangeChanged(e, s, a) {
|
|
2034
2054
|
var o, n, h, u;
|
|
@@ -2062,35 +2082,35 @@ const co = /* @__PURE__ */ ee(class extends J {
|
|
|
2062
2082
|
* Iterate through `items` and render them based on `type`
|
|
2063
2083
|
*/
|
|
2064
2084
|
render() {
|
|
2065
|
-
return
|
|
2085
|
+
return m("div", { key: "ee8974e38b296a1ba27111bc2a4244d8915f5839", class: "searchcraft-filter-panel" }, this.items.map((e) => {
|
|
2066
2086
|
switch (e.type) {
|
|
2067
2087
|
case "dateRange": {
|
|
2068
2088
|
const s = e, a = s.options.maxDate || /* @__PURE__ */ new Date();
|
|
2069
|
-
return
|
|
2089
|
+
return m("div", { class: "searchcraft-filter-panel-section" }, m("p", { class: "searchcraft-filter-panel-label" }, e.label), m("searchcraft-slider", { min: s.options.minDate.getTime(), max: a.getTime(), dataType: "date", step: 1, dateGranularity: s.options.granularity, onRangeChanged: (o) => {
|
|
2070
2090
|
this.handleDateRangeChanged(s, o.detail.startValue, o.detail.endValue);
|
|
2071
2091
|
} }));
|
|
2072
2092
|
}
|
|
2073
2093
|
case "numericRange": {
|
|
2074
2094
|
const s = e;
|
|
2075
|
-
return
|
|
2095
|
+
return m("div", { class: "searchcraft-filter-panel-section" }, m("p", { class: "searchcraft-filter-panel-label" }, e.label), m("searchcraft-slider", { min: s.options.min, max: s.options.max, step: s.options.granularity, onRangeChanged: (a) => {
|
|
2076
2096
|
this.handleNumericRangeChanged(s.fieldName, a.detail.startValue, a.detail.endValue);
|
|
2077
2097
|
} }));
|
|
2078
2098
|
}
|
|
2079
2099
|
case "facets": {
|
|
2080
2100
|
const s = e;
|
|
2081
|
-
return
|
|
2101
|
+
return m("div", { class: "searchcraft-filter-panel-section" }, m("p", { class: "searchcraft-filter-panel-label" }, e.label), m("searchcraft-facet-list", { fieldName: s.fieldName, exclude: s.options.exclude, onFacetSelectionUpdated: (a) => {
|
|
2082
2102
|
this.handleFacetSelectionUpdated(s.fieldName, a.detail.paths);
|
|
2083
2103
|
} }));
|
|
2084
2104
|
}
|
|
2085
2105
|
case "exactMatchToggle": {
|
|
2086
2106
|
const s = e;
|
|
2087
|
-
return
|
|
2107
|
+
return m("searchcraft-toggle-button", { label: s.label, subLabel: s.options.subLabel, onToggleUpdated: (a) => {
|
|
2088
2108
|
this.handleExactMatchToggleUpdated(a.detail);
|
|
2089
2109
|
} });
|
|
2090
2110
|
}
|
|
2091
2111
|
case "mostRecentToggle": {
|
|
2092
2112
|
const s = e;
|
|
2093
|
-
return
|
|
2113
|
+
return m("searchcraft-toggle-button", { label: s.label, subLabel: s.options.subLabel, onToggleUpdated: (a) => {
|
|
2094
2114
|
this.handleMostRecentToggleUpdated(s.fieldName, a.detail);
|
|
2095
2115
|
} });
|
|
2096
2116
|
}
|
|
@@ -2133,7 +2153,7 @@ const uo = lo, ho = /* @__PURE__ */ ee(class extends J {
|
|
|
2133
2153
|
this.__registerHost();
|
|
2134
2154
|
}
|
|
2135
2155
|
render() {
|
|
2136
|
-
return
|
|
2156
|
+
return m("label", { key: "3622c616d480e57b1dfaa2d61637a30b843cb968", class: xe("searchcraft-input-label", this.inputLabelClassName), htmlFor: "searchcraft-input-id" }, this.label);
|
|
2137
2157
|
}
|
|
2138
2158
|
}, [0, "searchcraft-input-label", {
|
|
2139
2159
|
inputLabelClassName: [1, "input-label-class-name"],
|
|
@@ -2259,7 +2279,7 @@ const fo = /* @__PURE__ */ ee(class extends J {
|
|
|
2259
2279
|
}), o = {
|
|
2260
2280
|
gap: this.inputLabel || this.error ? "4px 8px" : "0px 8px"
|
|
2261
2281
|
};
|
|
2262
|
-
return
|
|
2282
|
+
return m("form", { key: "d214ace44e9209154d215e803de088aefa58a285", class: "searchcraft-input-form", onSubmit: this.handleFormSubmit }, m("div", { key: "5699f5dca28caf5e9584401f1883d2e08d26e3ec", class: s, style: o }, m("div", { key: "ef792a946414a680e9c99c145246d00b9b8f2ffb", class: "searchcraft-input-form-button" }, m("searchcraft-button", { key: "ba5a8cb98889bb486781af4915a21c94a0b1498a", onButtonClick: this.handleFormSubmit, label: this.buttonLabel })), this.inputLabel && m("div", { key: "a9e770ef967f7ab1c6ddf8f87f23cea509894536", class: "searchcraft-input-form-label" }, m("searchcraft-input-label", { key: "93b29e630e71a3c7724921aa9586aab76e592f4f", label: this.inputLabel })), this.error && m("div", { key: "641ef4f468d527c24a1635d49dcbbba03030686f", class: "searchcraft-input-form-error-message" }, m("searchcraft-error-message", { key: "2d839d17b702fe1b41d7e49aacfc52fb53315766" }, "Something went wrong.")), m("div", { key: "af0c73478de21447c992bd0037ba007d54f53a86", class: "searchcraft-input-form-input-wrapper" }, m("input", { key: "3de1be1aa71c143b58cd6080d422410bd400e4e5", autoComplete: "off", class: xe("searchcraft-input-form-input", {
|
|
2263
2283
|
"searchcraft-placeholder-hide-on-focus": this.placeholderBehavior === "hide-on-focus"
|
|
2264
2284
|
}), onFocus: () => {
|
|
2265
2285
|
var n;
|
|
@@ -2269,7 +2289,7 @@ const fo = /* @__PURE__ */ ee(class extends J {
|
|
|
2269
2289
|
return (n = this.inputBlur) == null ? void 0 : n.emit();
|
|
2270
2290
|
}, onInput: (n) => {
|
|
2271
2291
|
this.handleInput(n);
|
|
2272
|
-
}, placeholder: this.placeholderValue, type: "text", value: this.inputValue }),
|
|
2292
|
+
}, placeholder: this.placeholderValue, type: "text", value: this.inputValue }), m("div", { key: "fe9043c046e3b1b91129299f0860919ba8a8416b", class: "searchcraft-input-form-input-icon" }, m("svg", { key: "31ae1553cd214d5e2f97c9e3699862dff51a0916", class: "searchcraft-input-form-input-search-icon", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": "searchcraft-title" }, m("title", { key: "9db677da65283ff15b0d4e79b5d9daf89637b33f" }, "Search icon"), m("path", { key: "2a002eae6ed3725a432e7c3e4649c0bd2ffff7a0", d: "M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))), e && m("button", { key: "b7e92b22c3234eb31d85b0aa98d7c682b2fc0021", type: "button", class: "searchcraft-input-form-clear-button", onClick: this.handleClearInput }, m("svg", { key: "bfbeb742f197da0cac6dd5df2627db9df5349207", class: "searchcraft-input-form-clear-icon", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-labelledby": "icon-title" }, m("title", { key: "c62b9d237b3762609fed72e0520322fb5eabe979" }, "Clear icon"), m("path", { key: "198a13760ce8b076ef8e791dec933b210ff3017a", d: "M14 8L8 14M8 8L14 14M21 11C21 16.5228 16.5228 21 11 21C5.47715 21 1 16.5228 1 11C1 5.47715 5.47715 1 11 1C16.5228 1 21 5.47715 21 11Z", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))))));
|
|
2273
2293
|
}
|
|
2274
2294
|
static get watchers() {
|
|
2275
2295
|
return {
|
|
@@ -2320,7 +2340,7 @@ const po = Ra, mo = us, go = /* @__PURE__ */ ee(class extends J {
|
|
|
2320
2340
|
this.__registerHost();
|
|
2321
2341
|
}
|
|
2322
2342
|
render() {
|
|
2323
|
-
return
|
|
2343
|
+
return m("div", { key: "507cde7e8f74682d0535a65fbc787b18fa4c49f7", class: "searchcraft-loading" }, m("div", { key: "de8d4db44bd0d54baa276403063327b040a39ee4", class: "searchcraft-loading-bars" }, m("div", { key: "3ef1ad066aef5582de0afe08c598747e48533f0a", class: "searchcraft-loading-bar-1" }), m("div", { key: "0e9b5bfb8c031b1d788b0f39a63b1b325f123aad", class: "searchcraft-loading-bar-2" }), m("div", { key: "b342f47a3869301d17e66f0ae79cbea6b2a7ed41", class: "searchcraft-loading-bar-3" }), m("div", { key: "c11c58254a005b80c54b98f6713acb4c7f376a58", class: "searchcraft-loading-bar-4" }), m("div", { key: "c53ff4d003ed8e1d17fdc2ab8d61b2d3313dd5ac", class: "searchcraft-loading-bar-5" }), m("div", { key: "3f517f20a24a844c04562cbb95b3a39502905405", class: "searchcraft-loading-bar-6" })), m("p", { key: "11a63145472d8ded9d28bf7e9cfde9097e6a02e2", class: "searchcraft-loading-label" }, this.label));
|
|
2324
2344
|
}
|
|
2325
2345
|
}, [0, "searchcraft-loading", {
|
|
2326
2346
|
label: [1]
|
|
@@ -2377,28 +2397,28 @@ const bo = Ea, vo = /* @__PURE__ */ ee(class extends J {
|
|
|
2377
2397
|
this.setSearchResultsPage(e);
|
|
2378
2398
|
}
|
|
2379
2399
|
renderOddPaginationItem(e) {
|
|
2380
|
-
return
|
|
2400
|
+
return m("li", null, m("button", { class: xe("searchcraft-pagination-item", {
|
|
2381
2401
|
"searchcraft-pagination-item-active": this.searchResultsPage === e
|
|
2382
2402
|
}), onClick: () => this.handleGoToPage(e), type: "button" }, e));
|
|
2383
2403
|
}
|
|
2384
2404
|
renderEvenPaginationItem(e) {
|
|
2385
2405
|
if (!(this.searchResultsPagesCount <= e))
|
|
2386
|
-
return (this.searchResultsPagesCount <= 5 || e < Math.ceil(this.searchResultsPagesCount / 2) ? this.searchResultsPage <= e + 1 : this.searchResultsPage >= e - 1) ?
|
|
2406
|
+
return (this.searchResultsPagesCount <= 5 || e < Math.ceil(this.searchResultsPagesCount / 2) ? this.searchResultsPage <= e + 1 : this.searchResultsPage >= e - 1) ? m("li", null, m("button", { class: xe("searchcraft-pagination-item", {
|
|
2387
2407
|
"searchcraft-pagination-item-active": this.searchResultsPage === e
|
|
2388
|
-
}), onClick: () => this.handleGoToPage(e), type: "button" }, e)) :
|
|
2408
|
+
}), onClick: () => this.handleGoToPage(e), type: "button" }, e)) : m("li", null, m("span", { class: "searchcraft-pagination-item" }, "..."));
|
|
2389
2409
|
}
|
|
2390
2410
|
renderMiddlePaginationItem() {
|
|
2391
2411
|
if (!(this.searchResultsPagesCount <= 3))
|
|
2392
|
-
return this.searchResultsPagesCount <= 5 || this.searchResultsPage <= 3 || this.searchResultsPage >= this.searchResultsPagesCount - 2 ?
|
|
2412
|
+
return this.searchResultsPagesCount <= 5 || this.searchResultsPage <= 3 || this.searchResultsPage >= this.searchResultsPagesCount - 2 ? m("li", null, m("button", { class: xe("searchcraft-pagination-item", {
|
|
2393
2413
|
"searchcraft-pagination-item-active": this.searchResultsPage === 3 || this.searchResultsPage === this.searchResultsPagesCount - 2
|
|
2394
|
-
}), type: "button", onClick: () => this.handleGoToPage(this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3) }, this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3)) :
|
|
2414
|
+
}), type: "button", onClick: () => this.handleGoToPage(this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3) }, this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3)) : m("li", null, m("span", { class: "searchcraft-pagination-item searchcraft-pagination-item-active" }, this.searchResultsPage));
|
|
2395
2415
|
}
|
|
2396
2416
|
render() {
|
|
2397
2417
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
2398
2418
|
if (!(!this.searchTerm && !e || this.searchResultsPagesCount <= 1))
|
|
2399
|
-
return
|
|
2419
|
+
return m("div", { class: "searchcraft-pagination" }, m("div", { class: "searchcraft-pagination-control" }, m("searchcraft-button", { disabled: this.searchResultsPage === 1, hierarchy: "tertiary", onButtonClick: () => this.handleGoToPage(Math.max(1, this.searchResultsPage - 1)), label: "Previous", iconPosition: "left", icon: m("svg", { class: "searchcraft-button-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, m("title", null, "Previous page icon"), m("path", { d: "M12.5 15L7.5 10L12.5 5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), iconOnly: !0 })), m("ul", { class: "searchcraft-pagination-list" }, this.renderOddPaginationItem(1), this.renderEvenPaginationItem(2), this.renderMiddlePaginationItem(), this.renderEvenPaginationItem(this.searchResultsPagesCount > 4 ? this.searchResultsPagesCount - 1 : 4), this.renderOddPaginationItem(this.searchResultsPagesCount)), m("div", { class: "searchcraft-pagination-control" }, m("searchcraft-button", { disabled: this.searchResultsPage === this.searchResultsPagesCount, hierarchy: "tertiary", onButtonClick: () => {
|
|
2400
2420
|
this.handleGoToPage(Math.min(this.searchResultsPagesCount, this.searchResultsPage + 1));
|
|
2401
|
-
}, label: "Next", iconPosition: "right", icon:
|
|
2421
|
+
}, label: "Next", iconPosition: "right", icon: m("svg", { class: "searchcraft-button-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, m("title", null, "Next page icon"), m("path", { d: "M7.5 15L12.5 10L7.5 5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), iconOnly: !0 })));
|
|
2402
2422
|
}
|
|
2403
2423
|
}, [0, "searchcraft-pagination", {
|
|
2404
2424
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -2450,10 +2470,10 @@ const ko = yo, Co = /* @__PURE__ */ ee(class extends J {
|
|
|
2450
2470
|
});
|
|
2451
2471
|
c(this, "cleanupCore");
|
|
2452
2472
|
c(this, "core");
|
|
2453
|
-
c(this, "renderOptionSymbol", () =>
|
|
2454
|
-
c(this, "renderCtrlSymbol", () =>
|
|
2455
|
-
c(this, "renderWindowsMetaSymbol", () =>
|
|
2456
|
-
c(this, "renderMacMetaSymbol", () =>
|
|
2473
|
+
c(this, "renderOptionSymbol", () => m("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 512 512", fill: "none" }, m("title", null, "Option key"), m("path", { d: "M283,112c0-11.58,9.42-21,21-21h160c11.58,0,21,9.42,21,21s-9.42,21-21,21h-160c-11.58,0-21-9.42-21-21Z", fill: "currentColor" }), m("path", { d: "M485,400c0,11.58-9.42,21-21,21h-128c-8.29,0-15.82-4.9-19.19-12.47l-122.46-275.53H48c-11.58,0-21-9.42-21-21s9.42-21,21-21h160c8.29,0,15.82,4.9,19.19,12.47l122.46,275.53h114.35c11.58,0,21,9.42,21,21Z", fill: "currentColor" })));
|
|
2474
|
+
c(this, "renderCtrlSymbol", () => m("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 512 512", fill: "none" }, m("title", null, "Ctrl key"), m("path", { d: "M388.95,209.4c-.37,5.59-2.9,10.71-7.12,14.4-3.83,3.35-8.74,5.2-13.82,5.2-6.06,0-11.83-2.61-15.81-7.17l-96.2-109.94-96.2,109.94c-3.98,4.56-9.75,7.17-15.81,7.17-5.08,0-9.99-1.84-13.82-5.2-4.22-3.69-6.75-8.81-7.12-14.4-.38-5.6,1.45-11.01,5.15-15.23l112-128c3.98-4.56,9.74-7.17,15.8-7.17s11.82,2.61,15.8,7.17l112,128c3.7,4.22,5.53,9.63,5.15,15.23Z", fill: "currentColor" })));
|
|
2475
|
+
c(this, "renderWindowsMetaSymbol", () => m("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 512 512", fill: "none" }, m("title", null, "Windows meta key"), m("path", { d: "M206.115 255.957c-23.854-12.259-47.043-18.479-68.94-18.479-2.978 0-5.976 0.090-8.974 0.354-27.94 2.312-53.461 9.684-69.875 15.414-4.354 1.599-8.817 3.288-13.415 5.153l-44.911 155.697c30.851-11.416 58.146-16.969 83.135-16.969 40.423 0 69.764 15.104 93.996 30.652 11.481-38.959 39.022-133.045 47.241-161.162-5.975-3.642-12.038-7.285-18.257-10.66zM264.174 295.535l-45.223 157.074c13.416 7.686 58.549 32.025 93.106 32.025 27.896 0 59.126-7.148 95.417-21.896l43.178-150.988c-29.316 9.461-57.438 14.26-83.732 14.26-47.975 0-81.557-15.549-102.746-30.475zM146.411 184.395c38.559 0.399 67.076 15.104 90.708 30.251l46.376-158.672c-9.773-5.598-35.403-19.547-53.929-24.3-12.193-2.842-25.010-4.308-38.602-4.308-25.898 0.488-54.194 6.973-86.444 19.9l-44.22 155.298c32.404-12.218 60.322-18.17 86.043-18.17 0.023 0.001 0.068 0.001 0.068 0.001zM512 99.062c-29.407 11.416-58.104 17.233-85.514 17.233-45.843 0-79.646-15.901-101.547-31.183l-45.975 159.118c30.873 19.854 64.145 29.939 99.061 29.939 28.474 0 57.97-6.84 87.731-20.344l-0.091-1.111 1.867-0.443 44.468-153.209z", fill: "currentColor" })));
|
|
2476
|
+
c(this, "renderMacMetaSymbol", () => m("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 512 512", fill: "none" }, m("title", null, "Mac meta key"), m("path", { d: "M368,283h-43v-54h43c46.87,0,85-38.13,85-85s-38.13-85-85-85-85,38.13-85,85v43h-54v-43c0-46.87-38.13-85-85-85s-85,38.13-85,85,38.13,85,85,85h43v54h-43c-46.87,0-85,38.13-85,85s38.13,85,85,85,85-38.13,85-85v-43h54v43c0,46.87,38.13,85,85,85s85-38.13,85-85-38.13-85-85-85ZM325,144c0-23.71,19.29-43,43-43s43,19.29,43,43-19.29,43-43,43h-43v-43ZM144,187c-23.71,0-43-19.29-43-43s19.29-43,43-43,43,19.29,43,43v43h-43ZM187,368c0,23.71-19.29,43-43,43s-43-19.29-43-43,19.29-43,43-43h43v43ZM283,283h-54v-54h54v54ZM368,411c-23.71,0-43-19.29-43-43v-43h43c23.71,0,43,19.29,43,43s-19.29,43-43,43Z", fill: "currentColor" })));
|
|
2457
2477
|
this.__registerHost();
|
|
2458
2478
|
}
|
|
2459
2479
|
onCoreAvailable(e) {
|
|
@@ -2497,18 +2517,18 @@ const ko = yo, Co = /* @__PURE__ */ ee(class extends J {
|
|
|
2497
2517
|
}
|
|
2498
2518
|
}
|
|
2499
2519
|
renderSkeuomorphicSlot() {
|
|
2500
|
-
return
|
|
2520
|
+
return m("div", { class: "searchcraft-popover-button-wrapper" }, m("div", { class: "searchcraft-popover-button-input" }, m("svg", { class: "searchcraft-popover-button-input-search-icon", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", version: "1.1" }, m("title", null, "Search icon"), m("path", { d: "M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), m("span", null, "Search")), m("div", { class: "searchcraft-popover-button-keycaps" }, m("div", { class: "searchcraft-popover-button-keycaps-keycap searchcraft-popover-button-keycaps-keycap-modifier" }, m("span", null, this.hotkeyModifierSymbol)), m("div", { class: "searchcraft-popover-button-keycaps-keycap searchcraft-popover-button-keycaps-keycap-key" }, m("span", null, this.hotkey))));
|
|
2501
2521
|
}
|
|
2502
2522
|
renderSlot() {
|
|
2503
2523
|
switch (this.type) {
|
|
2504
2524
|
case "skeuomorphic":
|
|
2505
2525
|
return this.renderSkeuomorphicSlot();
|
|
2506
2526
|
default:
|
|
2507
|
-
return
|
|
2527
|
+
return m("div", null, m("slot", null));
|
|
2508
2528
|
}
|
|
2509
2529
|
}
|
|
2510
2530
|
render() {
|
|
2511
|
-
return
|
|
2531
|
+
return m("button", { key: "ef815c1ea4ecde68fe152f80b811a95ccb9a38be", class: `searchcraft-popover-button ${this.type ? ` searchcraft-popover-button-${this.type}` : ""}`, innerHTML: typeof this.template < "u" ? this.template({ isPopoverVisible: this.isPopoverVisible }, { html: qt }) : void 0, onClick: this.handleOnClick.bind(this), type: "button" }, typeof this.template < "u" ? void 0 : this.type ? this.renderSlot() : "Open Popover");
|
|
2512
2532
|
}
|
|
2513
2533
|
}, [4, "searchcraft-popover-button", {
|
|
2514
2534
|
template: [16],
|
|
@@ -2557,7 +2577,7 @@ const wo = xo, So = /* @__PURE__ */ ee(class extends J {
|
|
|
2557
2577
|
(e = this.unsubscribe) == null || e.call(this), (s = this.cleanupCore) == null || s.call(this);
|
|
2558
2578
|
}
|
|
2559
2579
|
render() {
|
|
2560
|
-
return
|
|
2580
|
+
return m("footer", { key: "e12fa32df3c1137e643af22323feb3dc33f7718f", class: "searchcraft-popover-footer" }, m("p", { key: "73a33859c1702d82625748f398d5402030cc71f4", class: "searchcraft-popover-footer-results-info" }, this.searchResultsCount ? `${xa(this.searchResultsCount)} Results Found` : " "), m("a", { key: "9d32f6b21b166fef3e17e5b2eb81bfafe32f8d1a", class: "searchcraft-popover-footer-link", href: "https://searchcraft.io/", target: "_blank", rel: "noreferrer" }, m("svg", { key: "e47249460b6e2b5bb2a25d37c33d8a85b8c6013e", class: "searchcraft-popover-footer-link-image", width: "169", height: "16", viewBox: "0 0 169 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, m("title", { key: "438e675ff71edfc2176c08abe8efa34aaf7496ca" }, "Powered by Searchcraft"), m("path", { key: "484e8935fb1cb84a79b8402748bac1da8171e9de", d: "M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z", fill: "currentColor" }))));
|
|
2561
2581
|
}
|
|
2562
2582
|
}, [0, "searchcraft-popover-footer", {
|
|
2563
2583
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -2620,7 +2640,7 @@ const Ro = Ta, Eo = /* @__PURE__ */ ee(class extends J {
|
|
|
2620
2640
|
(e = this.cleanupCore) == null || e.call(this);
|
|
2621
2641
|
}
|
|
2622
2642
|
render() {
|
|
2623
|
-
return
|
|
2643
|
+
return m("div", { key: "fe1f0a2803c05c7f7901a1e34e3751283683b841", class: "searchcraft-popover-list-item" }, m("a", { key: "b1765b28e4df4483554e4aa1e776f85817f45709", class: "searchcraft-popover-list-item-link", href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && m("div", { key: "d47112466fe3414278f88db73294c829eceb63ba", class: "searchcraft-popover-list-item-image-wrapper" }, m("img", { key: "cf65d6520a2586f9b056775a0d1c3e85cb81cdd7", alt: this.imageAlt, src: this.imageSource, class: "searchcraft-popover-list-item-image" })), m("div", { key: "b6bdaf2e52e216d20c23790b4b53563be8709d40", class: "searchcraft-popover-list-item-content" }, this.title && m("p", { key: "21a6541924914c8ea2b798d0e910c6e4544b7e46", class: "searchcraft-popover-list-item-content-title" }, this.title), this.subtitle && m("p", { key: "625a1d6b1a7e6bfb848fd49cb316968b396b0473", class: "searchcraft-popover-list-item-content-subtitle" }, this.subtitle))));
|
|
2624
2644
|
}
|
|
2625
2645
|
}, [0, "searchcraft-popover-list-item", {
|
|
2626
2646
|
item: [16],
|
|
@@ -2679,41 +2699,41 @@ const To = /* @__PURE__ */ ee(class extends J {
|
|
|
2679
2699
|
}
|
|
2680
2700
|
renderWithADMAds() {
|
|
2681
2701
|
var e, s;
|
|
2682
|
-
return
|
|
2702
|
+
return m("div", { class: "searchcraft-popover-list-view" }, (e = this.adClientResponseItems) == null ? void 0 : e.map((a) => m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adClientResponseItem: a, adSource: "adMarketplace", key: a.id, renderPosition: "top" })), (s = this.searchClientResponseItems) == null ? void 0 : s.map((a, o) => m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: a, key: a.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + o })));
|
|
2683
2703
|
}
|
|
2684
2704
|
renderWithCustomAds() {
|
|
2685
|
-
var u, l,
|
|
2686
|
-
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (
|
|
2705
|
+
var u, l, p, C, E, _, I, z;
|
|
2706
|
+
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (p = this.config) == null ? void 0 : p.customAdConfig) == null ? void 0 : C.adInterstitialQuantity) || 1, o = ((_ = (E = this.config) == null ? void 0 : E.customAdConfig) == null ? void 0 : _.adStartQuantity) || 0, n = ((z = (I = this.config) == null ? void 0 : I.customAdConfig) == null ? void 0 : z.adEndQuantity) || 0, h = this.searchClientResponseItems || [];
|
|
2687
2707
|
for (let D = 0; D < o; D++)
|
|
2688
|
-
e.push(
|
|
2708
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D}-ad`, renderPosition: "top" }));
|
|
2689
2709
|
h.forEach((D, P) => {
|
|
2690
2710
|
if (s && P % s === 0 && P + s < h.length && P >= s)
|
|
2691
2711
|
for (let M = 0; M < a; M++)
|
|
2692
|
-
e.push(
|
|
2693
|
-
e.push(
|
|
2712
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D.id}-ad-${M}`, renderPosition: "interstitial" }));
|
|
2713
|
+
e.push(m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: D, key: D.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + P }));
|
|
2694
2714
|
});
|
|
2695
2715
|
for (let D = 0; D < n; D++)
|
|
2696
|
-
e.push(
|
|
2697
|
-
return
|
|
2716
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D}-ad`, renderPosition: "bottom" }));
|
|
2717
|
+
return m("div", { class: "searchcraft-popover-list-view" }, e);
|
|
2698
2718
|
}
|
|
2699
2719
|
renderWithNativoAds() {
|
|
2700
|
-
var l,
|
|
2701
|
-
const e = [], s = ((
|
|
2720
|
+
var l, p, C, E, _, I, z, D, P, M;
|
|
2721
|
+
const e = [], s = ((p = (l = this.config) == null ? void 0 : l.nativoConfig) == null ? void 0 : p.adInterstialStartIndex) || 0, a = ((E = (C = this.config) == null ? void 0 : C.nativoConfig) == null ? void 0 : E.adInterstitialInterval) || 0, o = ((I = (_ = this.config) == null ? void 0 : _.nativoConfig) == null ? void 0 : I.adInterstitialQuantity) || 1, n = ((D = (z = this.config) == null ? void 0 : z.nativoConfig) == null ? void 0 : D.adStartQuantity) || 0, h = ((M = (P = this.config) == null ? void 0 : P.nativoConfig) == null ? void 0 : M.adEndQuantity) || 0, u = this.searchClientResponseItems || [];
|
|
2702
2722
|
for (let q = 0; q < n; q++)
|
|
2703
|
-
e.push(
|
|
2723
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q}-ad`, renderPosition: "top" }));
|
|
2704
2724
|
u.forEach((q, Y) => {
|
|
2705
2725
|
if (a && (Y + s) % a === 0 && Y + a < u.length && Y >= a)
|
|
2706
2726
|
for (let ge = 0; ge < o; ge++)
|
|
2707
|
-
e.push(
|
|
2708
|
-
e.push(
|
|
2727
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q.id}-ad-${ge}`, renderPosition: "interstitial" }));
|
|
2728
|
+
e.push(m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: q, key: q.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + Y }));
|
|
2709
2729
|
});
|
|
2710
2730
|
for (let q = 0; q < h; q++)
|
|
2711
|
-
e.push(
|
|
2712
|
-
return
|
|
2731
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q}-ad`, renderPosition: "bottom" }));
|
|
2732
|
+
return m("div", { class: "searchcraft-popover-list-view" }, e);
|
|
2713
2733
|
}
|
|
2714
2734
|
renderWithNoAds() {
|
|
2715
2735
|
var e;
|
|
2716
|
-
return
|
|
2736
|
+
return m("div", { class: "searchcraft-popover-list-view" }, (e = this.searchClientResponseItems) == null ? void 0 : e.map((s, a) => m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: s, key: s.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + a })));
|
|
2717
2737
|
}
|
|
2718
2738
|
render() {
|
|
2719
2739
|
var e, s, a;
|
|
@@ -2900,21 +2920,21 @@ const Po = /* @__PURE__ */ ee(class extends J {
|
|
|
2900
2920
|
}
|
|
2901
2921
|
renderInlinePopover() {
|
|
2902
2922
|
const e = this.hasResultsToShow && this.isFocused;
|
|
2903
|
-
return
|
|
2923
|
+
return m("div", { class: xe("searchcraft-popover-form searchcraft-popover-form-inline", {
|
|
2904
2924
|
"searchcraft-popover-form-active": e
|
|
2905
|
-
}) },
|
|
2925
|
+
}) }, m("div", { class: "searchcraft-popover-form-input searchcraft-popover-form-inline-input" }, m("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior })), e && m("div", { class: "searchcraft-popover-form-inline-wrapper" }, m("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId }), m("searchcraft-popover-footer", { searchcraftId: this.searchcraftId })));
|
|
2906
2926
|
}
|
|
2907
2927
|
renderModalPopover() {
|
|
2908
2928
|
if (this.isPopoverVisibleInState)
|
|
2909
|
-
return
|
|
2929
|
+
return m("div", { class: xe("searchcraft-popover-form searchcraft-popover-form-modal", {
|
|
2910
2930
|
"searchcraft-popover-form-active": this.hasResultsToShow
|
|
2911
|
-
}) },
|
|
2931
|
+
}) }, m("div", { class: "searchcraft-popover-form-modal-backdrop", onClick: this.handleModalBackdropClick }), m("div", { class: "searchcraft-popover-form-modal-wrapper" }, m("div", { class: "searchcraft-popover-form-input searchcraft-popover-form-modal-input" }, m("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), m("button", { type: "button", class: "searchcraft-popover-form-cancel-button searchcraft-popover-form-modal-cancel-button", onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), m("div", { class: "searchcraft-popover-form-modal-popover-list-view" }, this.hasResultsToShow && m("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId })), m("searchcraft-popover-footer", { searchcraftId: this.searchcraftId })));
|
|
2912
2932
|
}
|
|
2913
2933
|
renderFullscreenPopover() {
|
|
2914
2934
|
if (this.isPopoverVisibleInState)
|
|
2915
|
-
return
|
|
2935
|
+
return m("div", { class: xe("searchcraft-popover-form searchcraft-popover-form-fullscreen", {
|
|
2916
2936
|
"searchcraft-popover-form-active": this.hasResultsToShow
|
|
2917
|
-
}) },
|
|
2937
|
+
}) }, m("div", { class: "searchcraft-popover-form-input searchcraft-popover-form-fullscreen-input" }, m("searchcraft-input-form", { onInputFocus: this.handleInputFocus.bind(this), onInputInit: this.handleInputInit.bind(this), searchcraftId: this.searchcraftId, placeholderValue: this.placeholderValue, placeholderBehavior: this.placeholderBehavior }), m("button", { type: "button", class: "searchcraft-popover-form-cancel-button searchcraft-popover-form-fullscreen-cancel-button", onClick: this.handleCancelButtonClick.bind(this) }, "Cancel")), m("div", { class: "searchcraft-popover-form-fullscreen-popover-list-view" }, this.hasResultsToShow && m("searchcraft-popover-list-view", { popoverResultMappings: this.popoverResultMappings, searchClientResponseItems: this.searchClientResponseItems, adClientResponseItems: this.adClientResponseItems, searchResultsPage: this.searchResultsPage, searchResultsPerPage: this.searchResultsPerPage, searchcraftId: this.searchcraftId })), m("searchcraft-popover-footer", { searchcraftId: this.searchcraftId }));
|
|
2918
2938
|
}
|
|
2919
2939
|
render() {
|
|
2920
2940
|
switch (this.type) {
|
|
@@ -3024,7 +3044,7 @@ const $o = $a, _o = hs, Io = Pa, Ao = /* @__PURE__ */ ee(class extends J {
|
|
|
3024
3044
|
}
|
|
3025
3045
|
render() {
|
|
3026
3046
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
3027
|
-
return !this.searchTerm && !e || this.searchResultsCount === 0 ? null :
|
|
3047
|
+
return !this.searchTerm && !e || this.searchResultsCount === 0 ? null : m("p", { class: "searchcraft-results-info" }, typeof this.template < "u" ? this.template({
|
|
3028
3048
|
range: [Number(this.range[0]), Number(this.range[1])],
|
|
3029
3049
|
count: this.count,
|
|
3030
3050
|
responseTime: this.responseTime
|
|
@@ -3118,7 +3138,7 @@ const Oo = Mo, Lo = /* @__PURE__ */ ee(class extends J {
|
|
|
3118
3138
|
}
|
|
3119
3139
|
render() {
|
|
3120
3140
|
if (this.item)
|
|
3121
|
-
return typeof this.template > "u" ?
|
|
3141
|
+
return typeof this.template > "u" ? m("div", { class: "searchcraft-search-result searchcraft-search-result-no-template", onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown }, Object.entries(this.item.document).map(([e, s]) => m("p", { key: e }, m("strong", null, e), ": ", s))) : m("div", { class: "searchcraft-search-result", innerHTML: this.templateHtml, onClick: this.handleResultContainerClick, onKeyDown: this.handleKeyDown });
|
|
3122
3142
|
}
|
|
3123
3143
|
}, [0, "searchcraft-search-result", {
|
|
3124
3144
|
item: [16],
|
|
@@ -3182,49 +3202,49 @@ const Fo = _a, Do = /* @__PURE__ */ ee(class extends J {
|
|
|
3182
3202
|
this.adClientResponseItems = [...e.adClientResponseItems], this.config = (s = e.core) == null ? void 0 : s.config, this.isSearchInProgress = e.isSearchInProgress, this.searchClientResponseItems = [...e.searchClientResponseItems], this.searchResultsPage = e.searchResultsPage, this.searchResultsPerPage = e.searchResultsPerPage, this.searchTerm = e.searchTerm;
|
|
3183
3203
|
}
|
|
3184
3204
|
renderEmptyState() {
|
|
3185
|
-
return
|
|
3205
|
+
return m("div", { class: "searchcraft-search-results-empty-state" }, m("slot", { name: "empty-search" }));
|
|
3186
3206
|
}
|
|
3187
3207
|
renderNoResultsFoundState() {
|
|
3188
|
-
return
|
|
3208
|
+
return m("div", { class: "searchcraft-search-results" }, m("div", { class: "searchcraft-search-results-error-message" }, m("searchcraft-error-message", null, 'No search results found for "', this.searchTerm, '" query.')));
|
|
3189
3209
|
}
|
|
3190
3210
|
renderWithADMAds() {
|
|
3191
3211
|
var s;
|
|
3192
3212
|
const e = this.searchClientResponseItems || [];
|
|
3193
|
-
return
|
|
3213
|
+
return m("div", { class: "searchcraft-search-results" }, (s = this.adClientResponseItems) == null ? void 0 : s.map((a) => m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "adMarketplace", adClientResponseItem: a, key: a.id, renderPosition: "top" })), e.map((a, o) => m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: a.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + o, index: o, item: a, template: this.template })));
|
|
3194
3214
|
}
|
|
3195
3215
|
renderWithCustomAds() {
|
|
3196
|
-
var u, l,
|
|
3197
|
-
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (
|
|
3216
|
+
var u, l, p, C, E, _, I, z;
|
|
3217
|
+
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (p = this.config) == null ? void 0 : p.customAdConfig) == null ? void 0 : C.adInterstitialQuantity) || 1, o = ((_ = (E = this.config) == null ? void 0 : E.customAdConfig) == null ? void 0 : _.adStartQuantity) || 0, n = ((z = (I = this.config) == null ? void 0 : I.customAdConfig) == null ? void 0 : z.adEndQuantity) || 0, h = this.searchClientResponseItems || [];
|
|
3198
3218
|
for (let D = 0; D < o; D++)
|
|
3199
|
-
e.push(
|
|
3219
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D}-ad`, renderPosition: "top" }));
|
|
3200
3220
|
h.forEach((D, P) => {
|
|
3201
3221
|
if (s && P % s === 0 && P + s < h.length && P >= s)
|
|
3202
3222
|
for (let M = 0; M < a; M++)
|
|
3203
|
-
e.push(
|
|
3204
|
-
e.push(
|
|
3223
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D.id}-ad-${M}`, renderPosition: "interstitial" }));
|
|
3224
|
+
e.push(m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: D.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + P, index: P, item: D, template: this.template }));
|
|
3205
3225
|
});
|
|
3206
3226
|
for (let D = 0; D < n; D++)
|
|
3207
|
-
e.push(
|
|
3208
|
-
return
|
|
3227
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${D}-ad`, renderPosition: "bottom" }));
|
|
3228
|
+
return m("div", { class: "searchcraft-search-results" }, e);
|
|
3209
3229
|
}
|
|
3210
3230
|
renderWithNativoAds() {
|
|
3211
|
-
var l,
|
|
3212
|
-
const e = [], s = ((
|
|
3231
|
+
var l, p, C, E, _, I, z, D, P, M;
|
|
3232
|
+
const e = [], s = ((p = (l = this.config) == null ? void 0 : l.nativoConfig) == null ? void 0 : p.adInterstialStartIndex) || 0, a = ((E = (C = this.config) == null ? void 0 : C.nativoConfig) == null ? void 0 : E.adInterstitialInterval) || 0, o = ((I = (_ = this.config) == null ? void 0 : _.nativoConfig) == null ? void 0 : I.adInterstitialQuantity) || 1, n = ((D = (z = this.config) == null ? void 0 : z.nativoConfig) == null ? void 0 : D.adStartQuantity) || 0, h = ((M = (P = this.config) == null ? void 0 : P.nativoConfig) == null ? void 0 : M.adEndQuantity) || 0, u = this.searchClientResponseItems || [];
|
|
3213
3233
|
for (let q = 0; q < n; q++)
|
|
3214
|
-
e.push(
|
|
3234
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q}-ad`, renderPosition: "top" }));
|
|
3215
3235
|
u.forEach((q, Y) => {
|
|
3216
3236
|
if (a && (Y + s) % a === 0 && Y + a < u.length && Y >= a)
|
|
3217
3237
|
for (let ge = 0; ge < o; ge++)
|
|
3218
|
-
e.push(
|
|
3219
|
-
e.push(
|
|
3238
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q.id}-ad-${ge}`, renderPosition: "interstitial" }));
|
|
3239
|
+
e.push(m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: q.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + Y, index: Y, item: q, template: this.template }));
|
|
3220
3240
|
});
|
|
3221
3241
|
for (let q = 0; q < h; q++)
|
|
3222
|
-
e.push(
|
|
3223
|
-
return
|
|
3242
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${q}-ad`, renderPosition: "bottom" }));
|
|
3243
|
+
return m("div", { class: "searchcraft-search-results" }, e);
|
|
3224
3244
|
}
|
|
3225
3245
|
renderWithNoAds() {
|
|
3226
3246
|
const e = this.searchClientResponseItems || [];
|
|
3227
|
-
return
|
|
3247
|
+
return m("div", { class: "searchcraft-search-results" }, e.map((s, a) => m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: s.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + a, index: a, item: s, template: this.template })));
|
|
3228
3248
|
}
|
|
3229
3249
|
render() {
|
|
3230
3250
|
var s, a, o;
|
|
@@ -3312,7 +3332,7 @@ const Ho = No, zo = /* @__PURE__ */ ee(class extends J {
|
|
|
3312
3332
|
this.setSearchResultsPage(e);
|
|
3313
3333
|
}
|
|
3314
3334
|
render() {
|
|
3315
|
-
return
|
|
3335
|
+
return m("div", { key: "15ecbf48c824a161cd83bdab99dace8e44f1ab39", class: "searchcraft-select" }, this.label && m("label", { key: "aba433ae9c27c9405099cffcef923c3ad22d7fda", class: "searchcraft-select-label", id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label), m("div", { key: "8df8a2ff05924c9c55cdd6e3827cd927cddab82a", class: "searchcraft-select-input-wrapper" }, m("select", { key: "1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f", "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : void 0, class: "searchcraft-select-input", disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options == "string" ? JSON.parse(this.options) : this.options).map(({ label: e, value: s, selected: a }) => m("option", { key: s, value: s, selected: a }, e))), m("svg", { key: "0ec6892b529f2e70027aadea47208582a65a97b7", class: "searchcraft-select-input-icon", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, m("title", { key: "bced6b62378491d1d1c629b602d7d033d912c761" }, "Select dropdown icon"), m("path", { key: "659f8ebf9129e2e7941da949d29688c41c1472bb", d: "M5 7.5L10 12.5L15 7.5", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))), this.caption && m("p", { key: "51217d926f68f79b6c3514f5fd769b56549fdce9", class: "searchcraft-select-caption" }, this.caption));
|
|
3316
3336
|
}
|
|
3317
3337
|
}, [0, "searchcraft-select", {
|
|
3318
3338
|
caption: [1],
|
|
@@ -3383,7 +3403,7 @@ const Uo = /* @__PURE__ */ ee(class extends J {
|
|
|
3383
3403
|
render() {
|
|
3384
3404
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
3385
3405
|
if (!(!this.searchTerm && !e || this.searchResultsPagesCount <= 1))
|
|
3386
|
-
return
|
|
3406
|
+
return m("div", { class: "searchcraft-search-results-per-page" }, m("div", { class: "searchcraft-search-results-per-page-select" }, m("label", { class: "searchcraft-search-results-per-page-select-label", htmlFor: "searchcraft-search-results-per-page-select-input" }, "Results Per Page"), m("div", { class: "searchcraft-search-results-per-page-select-input" }, m("searchcraft-select", { inputId: "searchcraft-search-results-per-page-select-input", name: "results-per-page", options: [...Array(5)].map((s, a) => {
|
|
3387
3407
|
const o = this.initialSearchResultsPerPage + Number(this.increment) * a;
|
|
3388
3408
|
return {
|
|
3389
3409
|
label: `${o}`,
|
|
@@ -3430,12 +3450,12 @@ var Aa = { exports: {} };
|
|
|
3430
3450
|
var e = {}, s = e, a = { exports: e }, o = Object.defineProperty, n = Object.getOwnPropertyDescriptor, h = Object.getOwnPropertyNames, u = Object.prototype.hasOwnProperty, l = (f, i) => {
|
|
3431
3451
|
for (var d in i)
|
|
3432
3452
|
o(f, d, { get: i[d], enumerable: !0 });
|
|
3433
|
-
},
|
|
3453
|
+
}, p = (f, i, d, g) => {
|
|
3434
3454
|
if (i && typeof i == "object" || typeof i == "function")
|
|
3435
3455
|
for (let v of h(i))
|
|
3436
3456
|
!u.call(f, v) && v !== d && o(f, v, { get: () => i[v], enumerable: !(g = n(i, v)) || g.enumerable });
|
|
3437
3457
|
return f;
|
|
3438
|
-
}, C = (f) =>
|
|
3458
|
+
}, C = (f) => p(o({}, "__esModule", { value: !0 }), f), E = {};
|
|
3439
3459
|
l(E, {
|
|
3440
3460
|
Hooks: () => De,
|
|
3441
3461
|
Lexer: () => Te,
|
|
@@ -5050,10 +5070,10 @@ const Wo = /* @__PURE__ */ ee(class extends J {
|
|
|
5050
5070
|
* Renders the appropriate content based on current state.
|
|
5051
5071
|
*/
|
|
5052
5072
|
renderContent() {
|
|
5053
|
-
return this.isLoading ?
|
|
5073
|
+
return this.isLoading ? m("searchcraft-loading", { label: "LOADING" }) : this.isSummaryNotEnabled ? m("div", { class: "searchcraft-summary-box-content" }, "AI summaries are not enabled") : m("div", { class: "searchcraft-summary-box-content" }, this.summary);
|
|
5054
5074
|
}
|
|
5055
5075
|
render() {
|
|
5056
|
-
return
|
|
5076
|
+
return m("div", { key: "c88d0bf7e12ad0fa0c019d207854a6e92babc683", class: "searchcraft-summary-box" }, this.renderContent());
|
|
5057
5077
|
}
|
|
5058
5078
|
}, [0, "searchcraft-summary-box", {
|
|
5059
5079
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -5081,7 +5101,7 @@ const Zo = Go, Yo = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searc
|
|
|
5081
5101
|
super(), this.__registerHost();
|
|
5082
5102
|
}
|
|
5083
5103
|
render() {
|
|
5084
|
-
return
|
|
5104
|
+
return m("style", { key: "ef26626cdfa4fa98d516802d71443c49a9c6ecf9" }, Yo);
|
|
5085
5105
|
}
|
|
5086
5106
|
}, [0, "searchcraft-theme"]);
|
|
5087
5107
|
function Ko() {
|
|
@@ -5147,21 +5167,21 @@ function Ge(r, t, e, s) {
|
|
|
5147
5167
|
function n(l) {
|
|
5148
5168
|
try {
|
|
5149
5169
|
u(s.next(l));
|
|
5150
|
-
} catch (
|
|
5151
|
-
o(
|
|
5170
|
+
} catch (p) {
|
|
5171
|
+
o(p);
|
|
5152
5172
|
}
|
|
5153
5173
|
}
|
|
5154
5174
|
function h(l) {
|
|
5155
5175
|
try {
|
|
5156
5176
|
u(s.throw(l));
|
|
5157
|
-
} catch (
|
|
5158
|
-
o(
|
|
5177
|
+
} catch (p) {
|
|
5178
|
+
o(p);
|
|
5159
5179
|
}
|
|
5160
5180
|
}
|
|
5161
5181
|
function u(l) {
|
|
5162
|
-
var
|
|
5163
|
-
l.done ? a(l.value) : (
|
|
5164
|
-
C(
|
|
5182
|
+
var p;
|
|
5183
|
+
l.done ? a(l.value) : (p = l.value, p instanceof e ? p : new e(function(C) {
|
|
5184
|
+
C(p);
|
|
5165
5185
|
})).then(n, h);
|
|
5166
5186
|
}
|
|
5167
5187
|
u((s = s.apply(r, [])).next());
|
|
@@ -5177,51 +5197,51 @@ function Ze(r, t) {
|
|
|
5177
5197
|
}), o;
|
|
5178
5198
|
function h(u) {
|
|
5179
5199
|
return function(l) {
|
|
5180
|
-
return function(
|
|
5200
|
+
return function(p) {
|
|
5181
5201
|
if (e) throw new TypeError("Generator is already executing.");
|
|
5182
|
-
for (; o && (o = 0,
|
|
5183
|
-
if (e = 1, s && (a = 2 &
|
|
5184
|
-
switch (s = 0, a && (
|
|
5202
|
+
for (; o && (o = 0, p[0] && (n = 0)), n; ) try {
|
|
5203
|
+
if (e = 1, s && (a = 2 & p[0] ? s.return : p[0] ? s.throw || ((a = s.return) && a.call(s), 0) : s.next) && !(a = a.call(s, p[1])).done) return a;
|
|
5204
|
+
switch (s = 0, a && (p = [2 & p[0], a.value]), p[0]) {
|
|
5185
5205
|
case 0:
|
|
5186
5206
|
case 1:
|
|
5187
|
-
a =
|
|
5207
|
+
a = p;
|
|
5188
5208
|
break;
|
|
5189
5209
|
case 4:
|
|
5190
|
-
return n.label++, { value:
|
|
5210
|
+
return n.label++, { value: p[1], done: !1 };
|
|
5191
5211
|
case 5:
|
|
5192
|
-
n.label++, s =
|
|
5212
|
+
n.label++, s = p[1], p = [0];
|
|
5193
5213
|
continue;
|
|
5194
5214
|
case 7:
|
|
5195
|
-
|
|
5215
|
+
p = n.ops.pop(), n.trys.pop();
|
|
5196
5216
|
continue;
|
|
5197
5217
|
default:
|
|
5198
|
-
if (a = n.trys, !((a = a.length > 0 && a[a.length - 1]) ||
|
|
5218
|
+
if (a = n.trys, !((a = a.length > 0 && a[a.length - 1]) || p[0] !== 6 && p[0] !== 2)) {
|
|
5199
5219
|
n = 0;
|
|
5200
5220
|
continue;
|
|
5201
5221
|
}
|
|
5202
|
-
if (
|
|
5203
|
-
n.label =
|
|
5222
|
+
if (p[0] === 3 && (!a || p[1] > a[0] && p[1] < a[3])) {
|
|
5223
|
+
n.label = p[1];
|
|
5204
5224
|
break;
|
|
5205
5225
|
}
|
|
5206
|
-
if (
|
|
5207
|
-
n.label = a[1], a =
|
|
5226
|
+
if (p[0] === 6 && n.label < a[1]) {
|
|
5227
|
+
n.label = a[1], a = p;
|
|
5208
5228
|
break;
|
|
5209
5229
|
}
|
|
5210
5230
|
if (a && n.label < a[2]) {
|
|
5211
|
-
n.label = a[2], n.ops.push(
|
|
5231
|
+
n.label = a[2], n.ops.push(p);
|
|
5212
5232
|
break;
|
|
5213
5233
|
}
|
|
5214
5234
|
a[2] && n.ops.pop(), n.trys.pop();
|
|
5215
5235
|
continue;
|
|
5216
5236
|
}
|
|
5217
|
-
|
|
5237
|
+
p = t.call(r, n);
|
|
5218
5238
|
} catch (C) {
|
|
5219
|
-
|
|
5239
|
+
p = [6, C], s = 0;
|
|
5220
5240
|
} finally {
|
|
5221
5241
|
e = a = 0;
|
|
5222
5242
|
}
|
|
5223
|
-
if (5 &
|
|
5224
|
-
return { value:
|
|
5243
|
+
if (5 & p[0]) throw p[1];
|
|
5244
|
+
return { value: p[0] ? p[1] : void 0, done: !0 };
|
|
5225
5245
|
}([u, l]);
|
|
5226
5246
|
};
|
|
5227
5247
|
}
|
|
@@ -5249,42 +5269,42 @@ function ds(r, t) {
|
|
|
5249
5269
|
var s = new Uint32Array([t, t, t, t]);
|
|
5250
5270
|
(function(o, n) {
|
|
5251
5271
|
for (var h = o.byteLength / 16 | 0, u = new Uint32Array(o, 0, 4 * h), l = 0; l < h; l++) {
|
|
5252
|
-
var
|
|
5253
|
-
|
|
5272
|
+
var p = u.subarray(4 * l, 4 * (l + 1));
|
|
5273
|
+
p[0] = Math.imul(p[0], me[0]), p[0] = Pe(p[0], 15), p[0] = Math.imul(p[0], me[1]), n[0] = n[0] ^ p[0], n[0] = Pe(n[0], 19), n[0] = n[0] + n[1], n[0] = Math.imul(n[0], 5) + 1444728091, p[1] = Math.imul(p[1], me[1]), p[1] = Pe(p[1], 16), p[1] = Math.imul(p[1], me[2]), n[1] = n[1] ^ p[1], n[1] = Pe(n[1], 17), n[1] = n[1] + n[2], n[1] = Math.imul(n[1], 5) + 197830471, p[2] = Math.imul(p[2], me[2]), p[2] = Pe(p[2], 17), p[2] = Math.imul(p[2], me[3]), n[2] = n[2] ^ p[2], n[2] = Pe(n[2], 15), n[2] = n[2] + n[3], n[2] = Math.imul(n[2], 5) + 2530024501, p[3] = Math.imul(p[3], me[3]), p[3] = Pe(p[3], 18), p[3] = Math.imul(p[3], me[0]), n[3] = n[3] ^ p[3], n[3] = Pe(n[3], 13), n[3] = n[3] + n[0], n[3] = Math.imul(n[3], 5) + 850148119;
|
|
5254
5274
|
}
|
|
5255
5275
|
})(r, s), function(o, n) {
|
|
5256
|
-
var h = o.byteLength / 16 | 0, u = o.byteLength % 16, l = new Uint32Array(4),
|
|
5276
|
+
var h = o.byteLength / 16 | 0, u = o.byteLength % 16, l = new Uint32Array(4), p = new Uint8Array(o, 16 * h, u);
|
|
5257
5277
|
switch (u) {
|
|
5258
5278
|
case 15:
|
|
5259
|
-
l[3] = l[3] ^
|
|
5279
|
+
l[3] = l[3] ^ p[14] << 16;
|
|
5260
5280
|
case 14:
|
|
5261
|
-
l[3] = l[3] ^
|
|
5281
|
+
l[3] = l[3] ^ p[13] << 8;
|
|
5262
5282
|
case 13:
|
|
5263
|
-
l[3] = l[3] ^
|
|
5283
|
+
l[3] = l[3] ^ p[12] << 0, l[3] = Math.imul(l[3], me[3]), l[3] = Pe(l[3], 18), l[3] = Math.imul(l[3], me[0]), n[3] = n[3] ^ l[3];
|
|
5264
5284
|
case 12:
|
|
5265
|
-
l[2] = l[2] ^
|
|
5285
|
+
l[2] = l[2] ^ p[11] << 24;
|
|
5266
5286
|
case 11:
|
|
5267
|
-
l[2] = l[2] ^
|
|
5287
|
+
l[2] = l[2] ^ p[10] << 16;
|
|
5268
5288
|
case 10:
|
|
5269
|
-
l[2] = l[2] ^
|
|
5289
|
+
l[2] = l[2] ^ p[9] << 8;
|
|
5270
5290
|
case 9:
|
|
5271
|
-
l[2] = l[2] ^
|
|
5291
|
+
l[2] = l[2] ^ p[8] << 0, l[2] = Math.imul(l[2], me[2]), l[2] = Pe(l[2], 17), l[2] = Math.imul(l[2], me[3]), n[2] = n[2] ^ l[2];
|
|
5272
5292
|
case 8:
|
|
5273
|
-
l[1] = l[1] ^
|
|
5293
|
+
l[1] = l[1] ^ p[7] << 24;
|
|
5274
5294
|
case 7:
|
|
5275
|
-
l[1] = l[1] ^
|
|
5295
|
+
l[1] = l[1] ^ p[6] << 16;
|
|
5276
5296
|
case 6:
|
|
5277
|
-
l[1] = l[1] ^
|
|
5297
|
+
l[1] = l[1] ^ p[5] << 8;
|
|
5278
5298
|
case 5:
|
|
5279
|
-
l[1] = l[1] ^
|
|
5299
|
+
l[1] = l[1] ^ p[4] << 0, l[1] = Math.imul(l[1], me[1]), l[1] = Pe(l[1], 16), l[1] = Math.imul(l[1], me[2]), n[1] = n[1] ^ l[1];
|
|
5280
5300
|
case 4:
|
|
5281
|
-
l[0] = l[0] ^
|
|
5301
|
+
l[0] = l[0] ^ p[3] << 24;
|
|
5282
5302
|
case 3:
|
|
5283
|
-
l[0] = l[0] ^
|
|
5303
|
+
l[0] = l[0] ^ p[2] << 16;
|
|
5284
5304
|
case 2:
|
|
5285
|
-
l[0] = l[0] ^
|
|
5305
|
+
l[0] = l[0] ^ p[1] << 8;
|
|
5286
5306
|
case 1:
|
|
5287
|
-
l[0] = l[0] ^
|
|
5307
|
+
l[0] = l[0] ^ p[0] << 0, l[0] = Math.imul(l[0], me[0]), l[0] = Pe(l[0], 15), l[0] = Math.imul(l[0], me[1]), n[0] = n[0] ^ l[0];
|
|
5288
5308
|
}
|
|
5289
5309
|
}(r, s), function(o, n) {
|
|
5290
5310
|
n[0] = n[0] ^ o.byteLength, n[1] = n[1] ^ o.byteLength, n[2] = n[2] ^ o.byteLength, n[3] = n[3] ^ o.byteLength, n[0] = n[0] + n[1] | 0, n[0] = n[0] + n[2] | 0, n[0] = n[0] + n[3] | 0, n[1] = n[1] + n[0] | 0, n[2] = n[2] + n[0] | 0, n[3] = n[3] + n[0] | 0, n[0] = pr(n[0]), n[1] = pr(n[1]), n[2] = pr(n[2]), n[3] = pr(n[3]), n[0] = n[0] + n[1] | 0, n[0] = n[0] + n[2] | 0, n[0] = n[0] + n[3] | 0, n[1] = n[1] + n[0] | 0, n[2] = n[2] + n[0] | 0, n[3] = n[3] + n[0] | 0;
|
|
@@ -5457,8 +5477,8 @@ function pi(r, t) {
|
|
|
5457
5477
|
if (o.length === 0) return null;
|
|
5458
5478
|
var n = {};
|
|
5459
5479
|
o.forEach(function(l) {
|
|
5460
|
-
var
|
|
5461
|
-
n[
|
|
5480
|
+
var p = String(l);
|
|
5481
|
+
n[p] = (n[p] || 0) + 1;
|
|
5462
5482
|
});
|
|
5463
5483
|
var h = o[0], u = 1;
|
|
5464
5484
|
return Object.keys(n).forEach(function(l) {
|
|
@@ -5500,7 +5520,7 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5500
5520
|
switch (u.label) {
|
|
5501
5521
|
case 0:
|
|
5502
5522
|
return document.body ? [3, 2] : [4, (l = 50, new Promise(function(C) {
|
|
5503
|
-
return setTimeout(C, l,
|
|
5523
|
+
return setTimeout(C, l, p);
|
|
5504
5524
|
}))];
|
|
5505
5525
|
case 1:
|
|
5506
5526
|
return u.sent(), [3, 0];
|
|
@@ -5510,7 +5530,7 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5510
5530
|
document.body.removeChild(o);
|
|
5511
5531
|
}, 0), [2];
|
|
5512
5532
|
}
|
|
5513
|
-
var l,
|
|
5533
|
+
var l, p;
|
|
5514
5534
|
});
|
|
5515
5535
|
});
|
|
5516
5536
|
})(function(s) {
|
|
@@ -5518,11 +5538,11 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5518
5538
|
return Ge(r, void 0, void 0, function() {
|
|
5519
5539
|
var o, n, h, u;
|
|
5520
5540
|
return Ze(this, function(l) {
|
|
5521
|
-
return o = a.createElement("canvas"), n = o.getContext("2d"), h = hi.map(function(
|
|
5522
|
-
return Gs(n,
|
|
5523
|
-
}), u = {}, ui.forEach(function(
|
|
5524
|
-
var C = Gs(n,
|
|
5525
|
-
h.includes(C) || (u[
|
|
5541
|
+
return o = a.createElement("canvas"), n = o.getContext("2d"), h = hi.map(function(p) {
|
|
5542
|
+
return Gs(n, p);
|
|
5543
|
+
}), u = {}, ui.forEach(function(p) {
|
|
5544
|
+
var C = Gs(n, p);
|
|
5545
|
+
h.includes(C) || (u[p] = C);
|
|
5526
5546
|
}), t(u), [2];
|
|
5527
5547
|
});
|
|
5528
5548
|
});
|
|
@@ -5623,9 +5643,9 @@ Ie("webgl", function() {
|
|
|
5623
5643
|
if (!n) throw new Error("Failed to create shader program");
|
|
5624
5644
|
if (F.attachShader(n, a), F.attachShader(n, o), F.linkProgram(n), !F.getProgramParameter(n, F.LINK_STATUS)) throw new Error("Shader program linking failed: " + F.getProgramInfoLog(n));
|
|
5625
5645
|
F.useProgram(n);
|
|
5626
|
-
for (var h = 137, u = new Float32Array(4 * h), l = 2 * Math.PI / h,
|
|
5627
|
-
var C =
|
|
5628
|
-
u[4 *
|
|
5646
|
+
for (var h = 137, u = new Float32Array(4 * h), l = 2 * Math.PI / h, p = 0; p < h; p++) {
|
|
5647
|
+
var C = p * l;
|
|
5648
|
+
u[4 * p] = 0, u[4 * p + 1] = 0, u[4 * p + 2] = Math.cos(C) * (ve.width / 2), u[4 * p + 3] = Math.sin(C) * (ve.height / 2);
|
|
5629
5649
|
}
|
|
5630
5650
|
var E = F.createBuffer();
|
|
5631
5651
|
F.bindBuffer(F.ARRAY_BUFFER, E), F.bufferData(F.ARRAY_BUFFER, u, F.STATIC_DRAW);
|
|
@@ -5694,16 +5714,16 @@ class vi extends fs {
|
|
|
5694
5714
|
rfr: "searchcraft.io",
|
|
5695
5715
|
"results-ta": `${e.textAdQuantity || 0}`,
|
|
5696
5716
|
"results-pa": `${e.productAdQuantity || 0}`
|
|
5697
|
-
}).toString()}`, n = await (await fetch(a, { method: "GET" })).json(), h = n.product_ads.map((
|
|
5717
|
+
}).toString()}`, n = await (await fetch(a, { method: "GET" })).json(), h = n.product_ads.map((p) => ({
|
|
5698
5718
|
id: ht(),
|
|
5699
5719
|
adSource: "adMarketplace",
|
|
5700
5720
|
admAdType: "adm-product-ad",
|
|
5701
|
-
admAd:
|
|
5702
|
-
})), u = n.text_ads.map((
|
|
5721
|
+
admAd: p
|
|
5722
|
+
})), u = n.text_ads.map((p) => ({
|
|
5703
5723
|
id: ht(),
|
|
5704
5724
|
adSource: "adMarketplace",
|
|
5705
5725
|
admAdType: "adm-text-ad",
|
|
5706
|
-
admAd:
|
|
5726
|
+
admAd: p
|
|
5707
5727
|
}));
|
|
5708
5728
|
return h.concat(u);
|
|
5709
5729
|
}
|
|
@@ -5891,7 +5911,7 @@ class Ei {
|
|
|
5891
5911
|
* @returns
|
|
5892
5912
|
*/
|
|
5893
5913
|
c(this, "getSearchResponseItems", async (t, e = !1) => {
|
|
5894
|
-
var n, h, u, l,
|
|
5914
|
+
var n, h, u, l, p, C, E;
|
|
5895
5915
|
let s, a = "", o;
|
|
5896
5916
|
return e ? ((n = this.supplementalAbortController) == null || n.abort("A newer search request has replaced this one."), o = new AbortController(), this.supplementalAbortController = o) : ((h = this.abortController) == null || h.abort("A newer search request has replaced this one."), o = new AbortController(), this.abortController = o), typeof t == "string" ? a = mr(t) : (t.searchTerm = mr(t.searchTerm), a = t.searchTerm), (u = this.parent.measureClient) == null || u.sendMeasureEvent("search_requested", {
|
|
5897
5917
|
search_term: a
|
|
@@ -5900,7 +5920,7 @@ class Ei {
|
|
|
5900
5920
|
data: {
|
|
5901
5921
|
searchTerm: a
|
|
5902
5922
|
}
|
|
5903
|
-
}), (l = this.parent.adClient) == null || l.onQuerySubmitted(typeof t == "string" ? { searchTerm: a, mode: "exact" } : t), typeof t == "string" ? s = await this.handleGetSearchResponseItemsWithString(a, o) : s = await this.handleGetSearchResponseItemsWithObject(t, o), e || ((
|
|
5923
|
+
}), (l = this.parent.adClient) == null || l.onQuerySubmitted(typeof t == "string" ? { searchTerm: a, mode: "exact" } : t), typeof t == "string" ? s = await this.handleGetSearchResponseItemsWithString(a, o) : s = await this.handleGetSearchResponseItemsWithObject(t, o), e || ((p = this.parent.measureClient) == null || p.sendMeasureEvent("search_response_received", {
|
|
5904
5924
|
search_term: a,
|
|
5905
5925
|
number_of_documents: s.data.count
|
|
5906
5926
|
}), clearTimeout(this.searchCompletedEventTimeout), this.searchCompletedEventTimeout = setTimeout(() => {
|
|
@@ -6025,11 +6045,11 @@ class Ei {
|
|
|
6025
6045
|
var Da = {}, ps = {};
|
|
6026
6046
|
const Zs = (r) => {
|
|
6027
6047
|
let t;
|
|
6028
|
-
const e = /* @__PURE__ */ new Set(), s = (l,
|
|
6048
|
+
const e = /* @__PURE__ */ new Set(), s = (l, p) => {
|
|
6029
6049
|
const C = typeof l == "function" ? l(t) : l;
|
|
6030
6050
|
if (!Object.is(C, t)) {
|
|
6031
6051
|
const E = t;
|
|
6032
|
-
t =
|
|
6052
|
+
t = p ?? (typeof C != "object" || C === null) ? C : Object.assign({}, t, C), e.forEach((_) => _(t, E));
|
|
6033
6053
|
}
|
|
6034
6054
|
}, a = () => t, h = { setState: s, getState: a, getInitialState: () => u, subscribe: (l) => (e.add(l), () => e.delete(l)) }, u = t = r(s, a, h);
|
|
6035
6055
|
return h;
|
|
@@ -6488,7 +6508,7 @@ class Gi {
|
|
|
6488
6508
|
streamSummaryData() {
|
|
6489
6509
|
var s;
|
|
6490
6510
|
const t = async () => {
|
|
6491
|
-
var u, l,
|
|
6511
|
+
var u, l, p, C, E, _;
|
|
6492
6512
|
const a = this.get(), o = (u = a.core) == null ? void 0 : u.config;
|
|
6493
6513
|
if (!o) {
|
|
6494
6514
|
console.error("Could not stream summary data, no config found.");
|
|
@@ -6501,7 +6521,7 @@ class Gi {
|
|
|
6501
6521
|
const n = (l = a.core) == null ? void 0 : l.config.indexName;
|
|
6502
6522
|
if (!a.hasSummaryBox || !n)
|
|
6503
6523
|
return;
|
|
6504
|
-
(
|
|
6524
|
+
(p = this.abortController) == null || p.abort("A newer request has replaced this one."), this.abortController = new AbortController(), this.set({
|
|
6505
6525
|
isSummaryLoading: !0,
|
|
6506
6526
|
summary: ""
|
|
6507
6527
|
});
|
|
@@ -6617,10 +6637,10 @@ const ra = {
|
|
|
6617
6637
|
currentPage: o().searchResultsPage,
|
|
6618
6638
|
stackTrace: new Error().stack
|
|
6619
6639
|
}), a((l) => {
|
|
6620
|
-
const
|
|
6621
|
-
return delete
|
|
6640
|
+
const p = l.facetPathsForIndexFields;
|
|
6641
|
+
return delete p[u], {
|
|
6622
6642
|
facetPathsForIndexFields: {
|
|
6623
|
-
...
|
|
6643
|
+
...p
|
|
6624
6644
|
},
|
|
6625
6645
|
searchResultsPage: 1
|
|
6626
6646
|
// Reset to page 1 when filters change
|
|
@@ -6628,17 +6648,17 @@ const ra = {
|
|
|
6628
6648
|
});
|
|
6629
6649
|
},
|
|
6630
6650
|
removeRangeValueForIndexField: (u) => a((l) => {
|
|
6631
|
-
const
|
|
6632
|
-
return delete
|
|
6651
|
+
const p = l.rangeValueForIndexFields;
|
|
6652
|
+
return delete p[u], {
|
|
6633
6653
|
rangeValueForIndexFields: {
|
|
6634
|
-
...
|
|
6654
|
+
...p
|
|
6635
6655
|
}
|
|
6636
6656
|
};
|
|
6637
6657
|
}),
|
|
6638
6658
|
resetSearchValues: () => {
|
|
6639
|
-
var l,
|
|
6659
|
+
var l, p;
|
|
6640
6660
|
const u = o();
|
|
6641
|
-
(
|
|
6661
|
+
(p = (l = u.core) == null ? void 0 : l.searchClient) == null || p.abortRequests(), a({
|
|
6642
6662
|
searchTerm: "",
|
|
6643
6663
|
searchResultsPage: 1,
|
|
6644
6664
|
searchClientResponseItems: [...u.cachedSearchClientResponseItems],
|
|
@@ -6651,9 +6671,9 @@ const ra = {
|
|
|
6651
6671
|
if (!l.core)
|
|
6652
6672
|
throw new Error("Searchcraft instance is not initialized.");
|
|
6653
6673
|
l.core.config.cortexURL && !(u != null && u.skipSummary) && ((z = l.summaryClient) == null || z.streamSummaryData());
|
|
6654
|
-
const
|
|
6674
|
+
const p = typeof l.cachedSearchClientRequestProperties == "string" && l.searchTerm.trim() === "", C = Object.keys(l.facetPathsForIndexFields).length > 0 || Object.keys(l.rangeValueForIndexFields).length > 0, E = l.searchResultsPage !== 1, _ = l.searchMode !== "fuzzy";
|
|
6655
6675
|
if (!l.searchTerm.trim()) {
|
|
6656
|
-
if (
|
|
6676
|
+
if (p && (C || E || _)) {
|
|
6657
6677
|
const M = JSON.parse(l.cachedSearchClientRequestProperties);
|
|
6658
6678
|
a({ isSearchInProgress: !0 });
|
|
6659
6679
|
const Y = [...Array.isArray(M.query) ? M.query.filter((Se) => !Se.occur) : [M.query]];
|
|
@@ -6725,9 +6745,9 @@ const ra = {
|
|
|
6725
6745
|
setSearchMode: (u) => a({ searchMode: u }),
|
|
6726
6746
|
setSortOrder: ({ orderByField: u, sortType: l }) => a({ sortType: l, orderByField: u }),
|
|
6727
6747
|
setSearchTerm: (u) => {
|
|
6728
|
-
var
|
|
6748
|
+
var p;
|
|
6729
6749
|
const l = o();
|
|
6730
|
-
u.length === 0 && ((
|
|
6750
|
+
u.length === 0 && ((p = l.core) == null || p.handleInputCleared()), a({
|
|
6731
6751
|
searchTerm: u,
|
|
6732
6752
|
searchResultsPage: 1,
|
|
6733
6753
|
...u.trim().length === 0 && {
|
|
@@ -6754,9 +6774,9 @@ const ra = {
|
|
|
6754
6774
|
a({ searchResultsPerPage: u }), await n.search({ skipSummary: !0 });
|
|
6755
6775
|
},
|
|
6756
6776
|
setHotKeyAndHotKeyModifier: (u, l) => {
|
|
6757
|
-
const { hotkey:
|
|
6777
|
+
const { hotkey: p, hotkeyModifier: C } = ra;
|
|
6758
6778
|
a({
|
|
6759
|
-
hotkey: u ||
|
|
6779
|
+
hotkey: u || p,
|
|
6760
6780
|
hotkeyModifier: l || C
|
|
6761
6781
|
});
|
|
6762
6782
|
}
|
|
@@ -6816,17 +6836,17 @@ class Yi {
|
|
|
6816
6836
|
const { facetPathsForIndexFields: u, ...l } = t.requestProperties;
|
|
6817
6837
|
try {
|
|
6818
6838
|
o = await ((n = this == null ? void 0 : this.searchClient) == null ? void 0 : n.getSearchResponseItems(l, !0));
|
|
6819
|
-
} catch (
|
|
6820
|
-
fr.info(`Search request error: ${
|
|
6839
|
+
} catch (p) {
|
|
6840
|
+
fr.info(`Search request error: ${p}`);
|
|
6821
6841
|
return;
|
|
6822
6842
|
}
|
|
6823
6843
|
}
|
|
6824
6844
|
} else if (typeof t.requestProperties == "string") {
|
|
6825
6845
|
const u = JSON.parse(t.requestProperties), l = Array.isArray(u.query) ? u.query : [u.query];
|
|
6826
6846
|
if (l.length > 1) {
|
|
6827
|
-
const
|
|
6847
|
+
const p = l.filter((E) => E.occur !== "must"), C = {
|
|
6828
6848
|
...u,
|
|
6829
|
-
query:
|
|
6849
|
+
query: p.length > 0 ? p : l.slice(0, 1)
|
|
6830
6850
|
};
|
|
6831
6851
|
try {
|
|
6832
6852
|
o = await ((h = this == null ? void 0 : this.searchClient) == null ? void 0 : h.getSearchResponseItems(JSON.stringify(C), !0));
|
|
@@ -6942,7 +6962,7 @@ class Yi {
|
|
|
6942
6962
|
}), (t = this.adClient) == null || t.onInputCleared();
|
|
6943
6963
|
}
|
|
6944
6964
|
}
|
|
6945
|
-
const Qi = "@searchcraft/react-sdk", Ki = "0.12.
|
|
6965
|
+
const Qi = "@searchcraft/react-sdk", Ki = "0.12.2";
|
|
6946
6966
|
async function Fe(r, t) {
|
|
6947
6967
|
const e = Object.entries(t).map(([o, n]) => typeof n == "boolean" ? n ? o : "" : `${o}="${String(n)}"`).filter(Boolean).join(" "), s = `<${r} ${e}></${r}>`, a = await tn(s, {
|
|
6948
6968
|
fullDocument: !1,
|