@searchcraft/vue-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/index.d.ts +9 -0
- package/dist/index.es.js +260 -240
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -115,7 +115,7 @@ var Tn = (r, t, e = !0) => {
|
|
|
115
115
|
s.push(r);
|
|
116
116
|
return s;
|
|
117
117
|
}, Ns = (r, t) => r.nodeType === 1 ? r.getAttribute("slot") === null && t === "" || r.getAttribute("slot") === t : r["s-sn"] === t ? !0 : t === "", Ht = (r, t = "") => () => {
|
|
118
|
-
},
|
|
118
|
+
}, m = (r, t, ...e) => {
|
|
119
119
|
let s = null, a = null, o = null, n = !1, h = !1;
|
|
120
120
|
const u = [], l = (C) => {
|
|
121
121
|
for (let S = 0; S < C.length; S++)
|
|
@@ -134,8 +134,8 @@ var Tn = (r, t, e = !0) => {
|
|
|
134
134
|
u,
|
|
135
135
|
_n
|
|
136
136
|
);
|
|
137
|
-
const
|
|
138
|
-
return
|
|
137
|
+
const p = vr(r, null);
|
|
138
|
+
return p.$attrs$ = t, u.length > 0 && (p.$children$ = u), p.$key$ = a, p.$name$ = o, p;
|
|
139
139
|
}, vr = (r, t) => {
|
|
140
140
|
const e = {
|
|
141
141
|
$flags$: 0,
|
|
@@ -158,7 +158,7 @@ var Tn = (r, t, e = !0) => {
|
|
|
158
158
|
}), In = (r) => {
|
|
159
159
|
if (typeof r.vtag == "function") {
|
|
160
160
|
const e = { ...r.vattrs };
|
|
161
|
-
return r.vkey && (e.key = r.vkey), r.vname && (e.name = r.vname),
|
|
161
|
+
return r.vkey && (e.key = r.vkey), r.vname && (e.name = r.vname), m(r.vtag, e, ...r.vchildren || []);
|
|
162
162
|
}
|
|
163
163
|
const t = vr(r.vtag, r.vtext);
|
|
164
164
|
return t.$attrs$ = r.vattrs, t.$children$ = r.vchildren, t.$key$ = r.vkey, t.$name$ = r.vname, t;
|
|
@@ -180,10 +180,10 @@ var Tn = (r, t, e = !0) => {
|
|
|
180
180
|
let n = Ls(r, t), h = t.toLowerCase();
|
|
181
181
|
if (t === "class") {
|
|
182
182
|
const u = r.classList, l = Us(e);
|
|
183
|
-
let
|
|
184
|
-
r["s-si"] ? (
|
|
185
|
-
C.startsWith(r["s-si"]) &&
|
|
186
|
-
}),
|
|
183
|
+
let p = Us(s);
|
|
184
|
+
r["s-si"] ? (p.push(r["s-si"]), l.forEach((C) => {
|
|
185
|
+
C.startsWith(r["s-si"]) && p.push(C);
|
|
186
|
+
}), 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))));
|
|
187
187
|
} else if (t === "style") {
|
|
188
188
|
for (const u in e)
|
|
189
189
|
(!s || s[u] == null) && (u.includes("-") ? r.style.removeProperty(u) : r.style[u] = "");
|
|
@@ -274,24 +274,24 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
}, Ln = (r, t, e, s, a = !1) => {
|
|
277
|
-
let o = 0, n = 0, h = 0, u = 0, l = t.length - 1,
|
|
277
|
+
let o = 0, n = 0, h = 0, u = 0, l = t.length - 1, p = t[0], C = t[l], S = s.length - 1, $ = s[0], A = s[S], N, F;
|
|
278
278
|
for (; o <= l && n <= S; )
|
|
279
|
-
if (
|
|
280
|
-
|
|
279
|
+
if (p == null)
|
|
280
|
+
p = t[++o];
|
|
281
281
|
else if (C == null)
|
|
282
282
|
C = t[--l];
|
|
283
283
|
else if ($ == null)
|
|
284
284
|
$ = s[++n];
|
|
285
285
|
else if (A == null)
|
|
286
286
|
A = s[--S];
|
|
287
|
-
else if (dr(
|
|
288
|
-
Ct(
|
|
287
|
+
else if (dr(p, $, a))
|
|
288
|
+
Ct(p, $, a), p = t[++o], $ = s[++n];
|
|
289
289
|
else if (dr(C, A, a))
|
|
290
290
|
Ct(C, A, a), C = t[--l], A = s[--S];
|
|
291
|
-
else if (dr(
|
|
292
|
-
(
|
|
291
|
+
else if (dr(p, A, a))
|
|
292
|
+
(p.$tag$ === "slot" || A.$tag$ === "slot") && Ut(p.$elm$.parentNode, !1), Ct(p, A, a), tt(r, p.$elm$, C.$elm$.nextSibling), p = t[++o], A = s[--S];
|
|
293
293
|
else if (dr(C, $, a))
|
|
294
|
-
(
|
|
294
|
+
(p.$tag$ === "slot" || A.$tag$ === "slot") && Ut(C.$elm$.parentNode, !1), Ct(C, $, a), tt(r, C.$elm$, p.$elm$), C = t[--l], $ = s[++n];
|
|
295
295
|
else {
|
|
296
296
|
for (h = -1, u = o; u <= l; ++u)
|
|
297
297
|
if (t[u] && t[u].$key$ !== null && t[u].$key$ === $.$key$) {
|
|
@@ -299,9 +299,9 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
299
299
|
break;
|
|
300
300
|
}
|
|
301
301
|
h >= 0 ? (F = t[h], F.$tag$ !== $.$tag$ ? N = Cr(t && t[n], e, h) : (Ct(F, $, a), t[h] = void 0, N = F.$elm$), $ = s[++n]) : (N = Cr(t && t[n], e, n), $ = s[++n]), N && tt(
|
|
302
|
-
Bt(
|
|
302
|
+
Bt(p.$elm$).parentNode,
|
|
303
303
|
N,
|
|
304
|
-
Bt(
|
|
304
|
+
Bt(p.$elm$)
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
o > l ? ma(
|
|
@@ -344,23 +344,23 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
344
344
|
}
|
|
345
345
|
}, tt = (r, t, e) => r == null ? void 0 : r.insertBefore(t, e), Fn = (r, t, e = !1) => {
|
|
346
346
|
var s, a, o, n;
|
|
347
|
-
const h = r.$hostElement$, u = r.$vnode$ || vr(null, null), l = $n(t) ? t :
|
|
347
|
+
const h = r.$hostElement$, u = r.$vnode$ || vr(null, null), l = $n(t) ? t : m(null, null, t);
|
|
348
348
|
if (is = h.tagName, e && l.$attrs$)
|
|
349
|
-
for (const
|
|
350
|
-
h.hasAttribute(
|
|
349
|
+
for (const p of Object.keys(l.$attrs$))
|
|
350
|
+
h.hasAttribute(p) && !["key", "ref", "style", "class"].includes(p) && (l.$attrs$[p] = h[p]);
|
|
351
351
|
l.$tag$ = null, l.$flags$ |= 4, r.$vnode$ = l, l.$elm$ = u.$elm$ = h, yr = yn, es = h["s-cr"], kr = !1, Ct(u, l, e);
|
|
352
352
|
{
|
|
353
353
|
if (Se.$flags$ |= 1, cs) {
|
|
354
354
|
ba(l.$elm$);
|
|
355
|
-
for (const
|
|
356
|
-
const C =
|
|
355
|
+
for (const p of We) {
|
|
356
|
+
const C = p.$nodeToRelocate$;
|
|
357
357
|
if (!C["s-ol"]) {
|
|
358
358
|
const S = wt.createTextNode("");
|
|
359
359
|
S["s-nr"] = C, tt(C.parentNode, C["s-ol"] = S, C);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
for (const
|
|
363
|
-
const C =
|
|
362
|
+
for (const p of We) {
|
|
363
|
+
const C = p.$nodeToRelocate$, S = p.$slotRefNode$;
|
|
364
364
|
if (S) {
|
|
365
365
|
const $ = S.parentNode;
|
|
366
366
|
let A = S.nextSibling;
|
|
@@ -472,8 +472,8 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
472
472
|
const n = Object.entries((s = t.$members$) != null ? s : {});
|
|
473
473
|
n.map(([h, [u]]) => {
|
|
474
474
|
if (u & 31 || u & 32) {
|
|
475
|
-
const { get: l, set:
|
|
476
|
-
l && (t.$members$[h][0] |= 2048),
|
|
475
|
+
const { get: l, set: p } = Object.getOwnPropertyDescriptor(o, h) || {};
|
|
476
|
+
l && (t.$members$[h][0] |= 2048), p && (t.$members$[h][0] |= 4096), Object.defineProperty(o, h, {
|
|
477
477
|
get() {
|
|
478
478
|
return l ? l.apply(this) : jn(this, h);
|
|
479
479
|
},
|
|
@@ -482,9 +482,9 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
482
482
|
}), Object.defineProperty(o, h, {
|
|
483
483
|
set(C) {
|
|
484
484
|
const S = rt(this);
|
|
485
|
-
if (
|
|
485
|
+
if (p) {
|
|
486
486
|
const $ = u & 32 ? this[h] : S.$hostElement$[h];
|
|
487
|
-
typeof $ > "u" && S.$instanceValues$.get(h) ? C = S.$instanceValues$.get(h) : !S.$instanceValues$.get(h) && $ && S.$instanceValues$.set(h, $),
|
|
487
|
+
typeof $ > "u" && S.$instanceValues$.get(h) ? C = S.$instanceValues$.get(h) : !S.$instanceValues$.get(h) && $ && S.$instanceValues$.set(h, $), p.apply(this, [ha(C, u)]), C = u & 32 ? this[h] : S.$hostElement$[h], qs(this, h, C, t);
|
|
488
488
|
return;
|
|
489
489
|
}
|
|
490
490
|
{
|
|
@@ -497,27 +497,27 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
497
497
|
});
|
|
498
498
|
{
|
|
499
499
|
const h = /* @__PURE__ */ new Map();
|
|
500
|
-
o.attributeChangedCallback = function(u, l,
|
|
500
|
+
o.attributeChangedCallback = function(u, l, p) {
|
|
501
501
|
Se.jmp(() => {
|
|
502
502
|
var C;
|
|
503
503
|
const S = h.get(u);
|
|
504
504
|
if (!(this.hasOwnProperty(S) && St.lazyLoad)) {
|
|
505
505
|
if (o.hasOwnProperty(S) && typeof this[S] == "number" && // cast type to number to avoid TS compiler issues
|
|
506
|
-
this[S] ==
|
|
506
|
+
this[S] == p)
|
|
507
507
|
return;
|
|
508
508
|
if (S == null) {
|
|
509
509
|
const A = rt(this), N = A == null ? void 0 : A.$flags$;
|
|
510
|
-
if (N && !(N & 8) && N & 128 &&
|
|
510
|
+
if (N && !(N & 8) && N & 128 && p !== l) {
|
|
511
511
|
const P = this, _ = (C = t.$watchers$) == null ? void 0 : C[u];
|
|
512
512
|
_ == null || _.forEach((U) => {
|
|
513
|
-
P[U] != null && P[U].call(P,
|
|
513
|
+
P[U] != null && P[U].call(P, p, l, u);
|
|
514
514
|
});
|
|
515
515
|
}
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
const $ = Object.getOwnPropertyDescriptor(o, S);
|
|
520
|
-
|
|
520
|
+
p = p === null && typeof this[S] == "boolean" ? !1 : p, p !== this[S] && (!$.get || $.set) && (this[S] = p);
|
|
521
521
|
});
|
|
522
522
|
}, r.observedAttributes = Array.from(
|
|
523
523
|
/* @__PURE__ */ new Set([
|
|
@@ -526,8 +526,8 @@ var es, is, yr = !1, kr = !1, cs = !1, Re = !1, Cr = (r, t, e) => {
|
|
|
526
526
|
([u, l]) => l[0] & 15
|
|
527
527
|
/* HasAttribute */
|
|
528
528
|
).map(([u, l]) => {
|
|
529
|
-
const
|
|
530
|
-
return h.set(
|
|
529
|
+
const p = l[1] || u;
|
|
530
|
+
return h.set(p, u), p;
|
|
531
531
|
})
|
|
532
532
|
])
|
|
533
533
|
);
|
|
@@ -661,14 +661,14 @@ var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
661
661
|
seal: u,
|
|
662
662
|
create: l
|
|
663
663
|
} = Object, {
|
|
664
|
-
apply:
|
|
664
|
+
apply: p,
|
|
665
665
|
construct: C
|
|
666
666
|
} = typeof Reflect < "u" && Reflect;
|
|
667
667
|
h || (h = function(O) {
|
|
668
668
|
return O;
|
|
669
669
|
}), u || (u = function(O) {
|
|
670
670
|
return O;
|
|
671
|
-
}),
|
|
671
|
+
}), p || (p = function(O, V, q) {
|
|
672
672
|
return O.apply(V, q);
|
|
673
673
|
}), C || (C = function(O, V) {
|
|
674
674
|
return new O(...V);
|
|
@@ -678,7 +678,7 @@ var Ca = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
678
678
|
return function(O) {
|
|
679
679
|
for (var V = arguments.length, q = new Array(V > 1 ? V - 1 : 0), le = 1; le < V; le++)
|
|
680
680
|
q[le - 1] = arguments[le];
|
|
681
|
-
return
|
|
681
|
+
return p(B, O, q);
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
function Tr(B) {
|
|
@@ -1303,7 +1303,7 @@ const to = /* @__PURE__ */ te(class extends ee {
|
|
|
1303
1303
|
let s = "<p>Ad Marketplace Ad Placeholder</p>";
|
|
1304
1304
|
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, {
|
|
1305
1305
|
html: qt
|
|
1306
|
-
})),
|
|
1306
|
+
})), m("div", { class: "searchcraft-ad searchcraft-adm-ad", "data-searchcraft-ad-container-id": this.adContainerId, id: `searchcraft-adm-ad-${this.adContainerId}`, innerHTML: s });
|
|
1307
1307
|
}
|
|
1308
1308
|
renderCustomAd() {
|
|
1309
1309
|
var o, n, h;
|
|
@@ -1312,12 +1312,12 @@ const to = /* @__PURE__ */ te(class extends ee {
|
|
|
1312
1312
|
return e && (a = e({
|
|
1313
1313
|
searchTerm: this.searchTerm || "",
|
|
1314
1314
|
adContainerId: this.adContainerId
|
|
1315
|
-
}, { html: qt })),
|
|
1315
|
+
}, { html: qt })), m("div", { class: "searchcraft-ad searchcraft-custom-ad", id: s, "data-searchcraft-ad-container-id": this.adContainerId, innerHTML: a });
|
|
1316
1316
|
}
|
|
1317
1317
|
renderNativoAd() {
|
|
1318
1318
|
var s, a;
|
|
1319
1319
|
const e = ((a = (s = this.core) == null ? void 0 : s.config.nativoConfig) == null ? void 0 : a.adClassName) || "ntv-item";
|
|
1320
|
-
return
|
|
1320
|
+
return m("div", { id: `searchcraft-native-ad-${this.adContainerId}`, class: we("searchcraft-ad", e), "data-searchcraft-ad-container-id": this.adContainerId });
|
|
1321
1321
|
}
|
|
1322
1322
|
render() {
|
|
1323
1323
|
if (this.searchResultCount !== 0)
|
|
@@ -1394,11 +1394,11 @@ const ro = Sr, so = /* @__PURE__ */ te(class extends ee {
|
|
|
1394
1394
|
this.__registerHost(), this.buttonClick = et(this, "buttonClick");
|
|
1395
1395
|
}
|
|
1396
1396
|
render() {
|
|
1397
|
-
return
|
|
1397
|
+
return m("button", { key: "e54b4566e0286265bc0c8b6bb4e9ef26108575da", "aria-label": this.label, class: we("searchcraft-button", {
|
|
1398
1398
|
"searchcraft-button-primary": this.hierarchy === "primary",
|
|
1399
1399
|
"searchcraft-button-tertiary": this.hierarchy === "tertiary",
|
|
1400
1400
|
"searchcraft-button-disabled": this.disabled
|
|
1401
|
-
}), disabled: this.disabled, onClick: this.handleButtonClick, type: this.type }, this.iconOnly ? this.icon :
|
|
1401
|
+
}), disabled: this.disabled, onClick: this.handleButtonClick, type: this.type }, this.iconOnly ? this.icon : m(Xn, null, this.iconPosition === "left" && this.icon, m("span", null, this.label), this.iconPosition === "right" && this.icon));
|
|
1402
1402
|
}
|
|
1403
1403
|
}, [0, "searchcraft-button", {
|
|
1404
1404
|
hierarchy: [1],
|
|
@@ -1425,7 +1425,7 @@ const ao = Rr, no = /* @__PURE__ */ te(class extends ee {
|
|
|
1425
1425
|
super(), this.__registerHost();
|
|
1426
1426
|
}
|
|
1427
1427
|
render() {
|
|
1428
|
-
return
|
|
1428
|
+
return m("div", { key: "d42f7abf8dfb2620622b8012d868d32f04b2f354", class: "searchcraft-error-message" }, m("slot", { key: "75a7811576ea8afe80a7ae739f5cf2d411f976df" }, "Search term is required."));
|
|
1429
1429
|
}
|
|
1430
1430
|
}, [4, "searchcraft-error-message"]);
|
|
1431
1431
|
function Er() {
|
|
@@ -1467,31 +1467,46 @@ const Vs = (r, t) => {
|
|
|
1467
1467
|
return n;
|
|
1468
1468
|
};
|
|
1469
1469
|
return s(e, []);
|
|
1470
|
-
}, Wr = (r) => {
|
|
1471
|
-
const
|
|
1470
|
+
}, Wr = (r, t) => {
|
|
1471
|
+
const e = {
|
|
1472
1472
|
path: "/",
|
|
1473
1473
|
count: 0,
|
|
1474
1474
|
children: {}
|
|
1475
|
-
},
|
|
1476
|
-
if (
|
|
1477
|
-
for (const
|
|
1478
|
-
|
|
1475
|
+
}, s = [], a = (o) => {
|
|
1476
|
+
if (o.path !== "/" && s.push({ path: o.path, count: o.count }), o.children)
|
|
1477
|
+
for (const n of o.children)
|
|
1478
|
+
a(n);
|
|
1479
1479
|
};
|
|
1480
|
-
|
|
1481
|
-
for (const { path:
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1480
|
+
a(r);
|
|
1481
|
+
for (const { path: o, count: n } of s) {
|
|
1482
|
+
const h = o.split("/").filter(Boolean);
|
|
1483
|
+
if (t && t.length > 0) {
|
|
1484
|
+
let l = !1;
|
|
1485
|
+
for (const p of t)
|
|
1486
|
+
if (p.startsWith("/")) {
|
|
1487
|
+
if (o === p || o.startsWith(`${p}/`)) {
|
|
1488
|
+
l = !0;
|
|
1489
|
+
break;
|
|
1490
|
+
}
|
|
1491
|
+
} else if (h.includes(p)) {
|
|
1492
|
+
l = !0;
|
|
1493
|
+
break;
|
|
1494
|
+
}
|
|
1495
|
+
if (l)
|
|
1496
|
+
continue;
|
|
1497
|
+
}
|
|
1498
|
+
let u = e;
|
|
1499
|
+
for (const l of h) {
|
|
1500
|
+
const p = u.path === "/" ? `/${l}` : `${u.path}/${l}`;
|
|
1501
|
+
u.children[l] || (u.children[l] = {
|
|
1502
|
+
path: p,
|
|
1503
|
+
count: n,
|
|
1489
1504
|
children: {}
|
|
1490
|
-
}),
|
|
1505
|
+
}), u = u.children[l];
|
|
1491
1506
|
}
|
|
1492
|
-
|
|
1507
|
+
u.count = n;
|
|
1493
1508
|
}
|
|
1494
|
-
return
|
|
1509
|
+
return e;
|
|
1495
1510
|
}, co = /* @__PURE__ */ te(class extends ee {
|
|
1496
1511
|
constructor() {
|
|
1497
1512
|
super();
|
|
@@ -1503,6 +1518,10 @@ const Vs = (r, t) => {
|
|
|
1503
1518
|
* The name of the field where facets are applied.
|
|
1504
1519
|
*/
|
|
1505
1520
|
c(this, "fieldName", "");
|
|
1521
|
+
/**
|
|
1522
|
+
* Array of facet values to exclude from rendering.
|
|
1523
|
+
*/
|
|
1524
|
+
c(this, "exclude");
|
|
1506
1525
|
/**
|
|
1507
1526
|
* Emitted when the facets are updated.
|
|
1508
1527
|
*/
|
|
@@ -1553,12 +1572,12 @@ const Vs = (r, t) => {
|
|
|
1553
1572
|
return Object.keys(this.selectedPaths).some((e) => this.selectedPaths[e]);
|
|
1554
1573
|
}
|
|
1555
1574
|
handleIncomingSearchResponse(e, s) {
|
|
1556
|
-
var u, l,
|
|
1575
|
+
var u, l, p;
|
|
1557
1576
|
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({
|
|
1558
1577
|
path: "/",
|
|
1559
1578
|
count: 0,
|
|
1560
1579
|
children: o || []
|
|
1561
|
-
});
|
|
1580
|
+
}, this.exclude);
|
|
1562
1581
|
switch (s) {
|
|
1563
1582
|
case "SEARCH_TERM_EMPTY":
|
|
1564
1583
|
this.facetTreeCollectedFromSearchResponse = {
|
|
@@ -1578,7 +1597,7 @@ const Vs = (r, t) => {
|
|
|
1578
1597
|
path: "/",
|
|
1579
1598
|
count: 0,
|
|
1580
1599
|
children: S || []
|
|
1581
|
-
});
|
|
1600
|
+
}, this.exclude);
|
|
1582
1601
|
this.facetTreeCollectedFromSearchResponse = Vs($, n);
|
|
1583
1602
|
} else
|
|
1584
1603
|
this.facetTreeCollectedFromSearchResponse = n;
|
|
@@ -1603,13 +1622,13 @@ const Vs = (r, t) => {
|
|
|
1603
1622
|
};
|
|
1604
1623
|
for (const C of Object.keys(this.selectedPaths).filter((S) => this.selectedPaths[S])) {
|
|
1605
1624
|
const S = C.startsWith("/") ? C.substring(1).split("/") : C.split("/"), $ = !!Sa(this.facetTreeCollectedFromSearchResponse, S), A = S.at(-1);
|
|
1606
|
-
!$ && A && ((
|
|
1625
|
+
!$ && A && ((p = h.children) == null || p.push({
|
|
1607
1626
|
children: [],
|
|
1608
1627
|
count: 0,
|
|
1609
1628
|
path: C
|
|
1610
1629
|
}));
|
|
1611
1630
|
}
|
|
1612
|
-
this.facetTreeFromFacetPathsNotInSearchResponse = Wr(h), this.renderedFacetTree = us(this.facetTreeFromFacetPathsNotInSearchResponse, this.facetTreeCollectedFromSearchResponse);
|
|
1631
|
+
this.facetTreeFromFacetPathsNotInSearchResponse = Wr(h, this.exclude), this.renderedFacetTree = us(this.facetTreeFromFacetPathsNotInSearchResponse, this.facetTreeCollectedFromSearchResponse);
|
|
1613
1632
|
}
|
|
1614
1633
|
handleStateUpdate(e) {
|
|
1615
1634
|
const s = { ...e }, a = typeof s.searchClientRequestProperties == "string" && s.searchTerm.trim() === "";
|
|
@@ -1622,7 +1641,7 @@ const Vs = (r, t) => {
|
|
|
1622
1641
|
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);
|
|
1623
1642
|
} else if (typeof s.searchClientRequestProperties == "string") {
|
|
1624
1643
|
let o = "NEW_SEARCH_TERM";
|
|
1625
|
-
const n = JSON.parse(s.searchClientRequestProperties), u = (Array.isArray(n.query) ? n.query : [n.query]).filter((
|
|
1644
|
+
const n = JSON.parse(s.searchClientRequestProperties), u = (Array.isArray(n.query) ? n.query : [n.query]).filter((p) => p.occur === "must"), l = JSON.stringify(u);
|
|
1626
1645
|
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);
|
|
1627
1646
|
}
|
|
1628
1647
|
}
|
|
@@ -1658,9 +1677,9 @@ const Vs = (r, t) => {
|
|
|
1658
1677
|
for (const h of Object.keys(this.selectedPaths))
|
|
1659
1678
|
this.selectedPaths[h] && h.startsWith(s.path) && h.length > s.path.length && (a = !0);
|
|
1660
1679
|
const o = Object.keys(this.selectedPaths).includes(s.path), n = Object.keys(s.children).length > 0 && (o || a) || e === "@@root";
|
|
1661
|
-
return
|
|
1680
|
+
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) => {
|
|
1662
1681
|
this.handleCheckboxChange(s.path);
|
|
1663
|
-
}, type: "checkbox" }), a ?
|
|
1682
|
+
}, 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: {
|
|
1664
1683
|
paddingLeft: e !== "@@root" ? "24px" : "0px",
|
|
1665
1684
|
paddingTop: e !== "@@root" ? "6px" : "0px"
|
|
1666
1685
|
} }, Object.keys(s.children).map((h) => {
|
|
@@ -1670,11 +1689,12 @@ const Vs = (r, t) => {
|
|
|
1670
1689
|
}
|
|
1671
1690
|
render() {
|
|
1672
1691
|
if (this.fieldName && !(Object.keys(this.facetTreeCollectedFromSearchResponse.children).length === 0 && (this.lastSearchTerm || "").trim().length === 0))
|
|
1673
|
-
return Object.keys(this.facetTreeCollectedFromSearchResponse.children).length === 0 && (this.lastSearchTerm || "").trim().length > 0 ?
|
|
1692
|
+
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));
|
|
1674
1693
|
}
|
|
1675
1694
|
}, [0, "searchcraft-facet-list", {
|
|
1676
1695
|
searchcraftId: [1, "searchcraft-id"],
|
|
1677
1696
|
fieldName: [1, "field-name"],
|
|
1697
|
+
exclude: [16],
|
|
1678
1698
|
selectedPaths: [32],
|
|
1679
1699
|
facetTreeCollectedFromSearchResponse: [32],
|
|
1680
1700
|
renderedFacetTree: [32]
|
|
@@ -1719,8 +1739,8 @@ function uo(r, t = "en-US", e = {
|
|
|
1719
1739
|
}) {
|
|
1720
1740
|
const s = new Date(r), o = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), n = 30 * 24 * 60 * 60 * 1e3;
|
|
1721
1741
|
if (o < n) {
|
|
1722
|
-
const h = Math.trunc(o / 1e3), u = Math.trunc(h / 60), l = Math.trunc(u / 60),
|
|
1723
|
-
return
|
|
1742
|
+
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);
|
|
1743
|
+
return p >= 1 ? C.format(-p, "day") : l >= 1 ? C.format(-l, "hour") : u >= 1 ? C.format(-u, "minute") : C.format(0, "second");
|
|
1724
1744
|
}
|
|
1725
1745
|
return new Intl.DateTimeFormat(t, e).format(s);
|
|
1726
1746
|
}
|
|
@@ -1886,10 +1906,10 @@ const mo = /* @__PURE__ */ te(class extends ee {
|
|
|
1886
1906
|
}
|
|
1887
1907
|
render() {
|
|
1888
1908
|
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);
|
|
1889
|
-
return
|
|
1909
|
+
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: {
|
|
1890
1910
|
left: `${e}%`,
|
|
1891
1911
|
width: `${s - e}%`
|
|
1892
|
-
} }),
|
|
1912
|
+
} }), m("input", { key: "229afedc1318a63cbd75806805210cf4f5695e6e", class: we("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: we("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)));
|
|
1893
1913
|
}
|
|
1894
1914
|
}, [0, "searchcraft-slider", {
|
|
1895
1915
|
max: [2],
|
|
@@ -1956,9 +1976,9 @@ const go = /* @__PURE__ */ te(class extends ee {
|
|
|
1956
1976
|
(e = this.unsubscribe) == null || e.call(this), (s = this.cleanupCore) == null || s.call(this);
|
|
1957
1977
|
}
|
|
1958
1978
|
render() {
|
|
1959
|
-
return
|
|
1979
|
+
return m("div", { key: "ab1d5ee21c7aaa28af1c405edc986556858366e8", class: we("searchcraft-toggle-button", {
|
|
1960
1980
|
"searchcraft-toggle-button-active": this.isActive
|
|
1961
|
-
}) },
|
|
1981
|
+
}) }, 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" })));
|
|
1962
1982
|
}
|
|
1963
1983
|
}, [0, "searchcraft-toggle-button", {
|
|
1964
1984
|
label: [1],
|
|
@@ -2022,12 +2042,12 @@ const bo = /* @__PURE__ */ te(class extends ee {
|
|
|
2022
2042
|
}
|
|
2023
2043
|
}
|
|
2024
2044
|
handleDateRangeChanged(e, s, a) {
|
|
2025
|
-
var h, u, l,
|
|
2045
|
+
var h, u, l, p;
|
|
2026
2046
|
const o = new Date(s), n = new Date(a);
|
|
2027
2047
|
(u = (h = this.core) == null ? void 0 : h.store.getState()) == null || u.addRangeValueForIndexField({
|
|
2028
2048
|
fieldName: e.fieldName,
|
|
2029
2049
|
value: `${e.fieldName}:[${o.toISOString()} TO ${n.toISOString()}]`
|
|
2030
|
-
}), (
|
|
2050
|
+
}), (p = (l = this.core) == null ? void 0 : l.store.getState()) == null || p.search();
|
|
2031
2051
|
}
|
|
2032
2052
|
handleNumericRangeChanged(e, s, a) {
|
|
2033
2053
|
var o, n, h, u;
|
|
@@ -2061,35 +2081,35 @@ const bo = /* @__PURE__ */ te(class extends ee {
|
|
|
2061
2081
|
* Iterate through `items` and render them based on `type`
|
|
2062
2082
|
*/
|
|
2063
2083
|
render() {
|
|
2064
|
-
return
|
|
2084
|
+
return m("div", { key: "ee8974e38b296a1ba27111bc2a4244d8915f5839", class: "searchcraft-filter-panel" }, this.items.map((e) => {
|
|
2065
2085
|
switch (e.type) {
|
|
2066
2086
|
case "dateRange": {
|
|
2067
2087
|
const s = e, a = s.options.maxDate || /* @__PURE__ */ new Date();
|
|
2068
|
-
return
|
|
2088
|
+
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) => {
|
|
2069
2089
|
this.handleDateRangeChanged(s, o.detail.startValue, o.detail.endValue);
|
|
2070
2090
|
} }));
|
|
2071
2091
|
}
|
|
2072
2092
|
case "numericRange": {
|
|
2073
2093
|
const s = e;
|
|
2074
|
-
return
|
|
2094
|
+
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) => {
|
|
2075
2095
|
this.handleNumericRangeChanged(s.fieldName, a.detail.startValue, a.detail.endValue);
|
|
2076
2096
|
} }));
|
|
2077
2097
|
}
|
|
2078
2098
|
case "facets": {
|
|
2079
2099
|
const s = e;
|
|
2080
|
-
return
|
|
2100
|
+
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) => {
|
|
2081
2101
|
this.handleFacetSelectionUpdated(s.fieldName, a.detail.paths);
|
|
2082
2102
|
} }));
|
|
2083
2103
|
}
|
|
2084
2104
|
case "exactMatchToggle": {
|
|
2085
2105
|
const s = e;
|
|
2086
|
-
return
|
|
2106
|
+
return m("searchcraft-toggle-button", { label: s.label, subLabel: s.options.subLabel, onToggleUpdated: (a) => {
|
|
2087
2107
|
this.handleExactMatchToggleUpdated(a.detail);
|
|
2088
2108
|
} });
|
|
2089
2109
|
}
|
|
2090
2110
|
case "mostRecentToggle": {
|
|
2091
2111
|
const s = e;
|
|
2092
|
-
return
|
|
2112
|
+
return m("searchcraft-toggle-button", { label: s.label, subLabel: s.options.subLabel, onToggleUpdated: (a) => {
|
|
2093
2113
|
this.handleMostRecentToggleUpdated(s.fieldName, a.detail);
|
|
2094
2114
|
} });
|
|
2095
2115
|
}
|
|
@@ -2132,7 +2152,7 @@ const yo = vo, ko = /* @__PURE__ */ te(class extends ee {
|
|
|
2132
2152
|
this.__registerHost();
|
|
2133
2153
|
}
|
|
2134
2154
|
render() {
|
|
2135
|
-
return
|
|
2155
|
+
return m("label", { key: "3622c616d480e57b1dfaa2d61637a30b843cb968", class: we("searchcraft-input-label", this.inputLabelClassName), htmlFor: "searchcraft-input-id" }, this.label);
|
|
2136
2156
|
}
|
|
2137
2157
|
}, [0, "searchcraft-input-label", {
|
|
2138
2158
|
inputLabelClassName: [1, "input-label-class-name"],
|
|
@@ -2258,7 +2278,7 @@ const Co = /* @__PURE__ */ te(class extends ee {
|
|
|
2258
2278
|
}), o = {
|
|
2259
2279
|
gap: this.inputLabel || this.error ? "4px 8px" : "0px 8px"
|
|
2260
2280
|
};
|
|
2261
|
-
return
|
|
2281
|
+
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: we("searchcraft-input-form-input", {
|
|
2262
2282
|
"searchcraft-placeholder-hide-on-focus": this.placeholderBehavior === "hide-on-focus"
|
|
2263
2283
|
}), onFocus: () => {
|
|
2264
2284
|
var n;
|
|
@@ -2268,7 +2288,7 @@ const Co = /* @__PURE__ */ te(class extends ee {
|
|
|
2268
2288
|
return (n = this.inputBlur) == null ? void 0 : n.emit();
|
|
2269
2289
|
}, onInput: (n) => {
|
|
2270
2290
|
this.handleInput(n);
|
|
2271
|
-
}, placeholder: this.placeholderValue, type: "text", value: this.inputValue }),
|
|
2291
|
+
}, 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" }))))));
|
|
2272
2292
|
}
|
|
2273
2293
|
static get watchers() {
|
|
2274
2294
|
return {
|
|
@@ -2319,7 +2339,7 @@ const xo = $a, wo = hs, So = /* @__PURE__ */ te(class extends ee {
|
|
|
2319
2339
|
this.__registerHost();
|
|
2320
2340
|
}
|
|
2321
2341
|
render() {
|
|
2322
|
-
return
|
|
2342
|
+
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));
|
|
2323
2343
|
}
|
|
2324
2344
|
}, [0, "searchcraft-loading", {
|
|
2325
2345
|
label: [1]
|
|
@@ -2376,28 +2396,28 @@ const Ro = _a, Eo = /* @__PURE__ */ te(class extends ee {
|
|
|
2376
2396
|
this.setSearchResultsPage(e);
|
|
2377
2397
|
}
|
|
2378
2398
|
renderOddPaginationItem(e) {
|
|
2379
|
-
return
|
|
2399
|
+
return m("li", null, m("button", { class: we("searchcraft-pagination-item", {
|
|
2380
2400
|
"searchcraft-pagination-item-active": this.searchResultsPage === e
|
|
2381
2401
|
}), onClick: () => this.handleGoToPage(e), type: "button" }, e));
|
|
2382
2402
|
}
|
|
2383
2403
|
renderEvenPaginationItem(e) {
|
|
2384
2404
|
if (!(this.searchResultsPagesCount <= e))
|
|
2385
|
-
return (this.searchResultsPagesCount <= 5 || e < Math.ceil(this.searchResultsPagesCount / 2) ? this.searchResultsPage <= e + 1 : this.searchResultsPage >= e - 1) ?
|
|
2405
|
+
return (this.searchResultsPagesCount <= 5 || e < Math.ceil(this.searchResultsPagesCount / 2) ? this.searchResultsPage <= e + 1 : this.searchResultsPage >= e - 1) ? m("li", null, m("button", { class: we("searchcraft-pagination-item", {
|
|
2386
2406
|
"searchcraft-pagination-item-active": this.searchResultsPage === e
|
|
2387
|
-
}), onClick: () => this.handleGoToPage(e), type: "button" }, e)) :
|
|
2407
|
+
}), onClick: () => this.handleGoToPage(e), type: "button" }, e)) : m("li", null, m("span", { class: "searchcraft-pagination-item" }, "..."));
|
|
2388
2408
|
}
|
|
2389
2409
|
renderMiddlePaginationItem() {
|
|
2390
2410
|
if (!(this.searchResultsPagesCount <= 3))
|
|
2391
|
-
return this.searchResultsPagesCount <= 5 || this.searchResultsPage <= 3 || this.searchResultsPage >= this.searchResultsPagesCount - 2 ?
|
|
2411
|
+
return this.searchResultsPagesCount <= 5 || this.searchResultsPage <= 3 || this.searchResultsPage >= this.searchResultsPagesCount - 2 ? m("li", null, m("button", { class: we("searchcraft-pagination-item", {
|
|
2392
2412
|
"searchcraft-pagination-item-active": this.searchResultsPage === 3 || this.searchResultsPage === this.searchResultsPagesCount - 2
|
|
2393
|
-
}), type: "button", onClick: () => this.handleGoToPage(this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3) }, this.searchResultsPage >= this.searchResultsPagesCount - 2 ? this.searchResultsPagesCount - 2 : 3)) :
|
|
2413
|
+
}), 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));
|
|
2394
2414
|
}
|
|
2395
2415
|
render() {
|
|
2396
2416
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
2397
2417
|
if (!(!this.searchTerm && !e || this.searchResultsPagesCount <= 1))
|
|
2398
|
-
return
|
|
2418
|
+
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: () => {
|
|
2399
2419
|
this.handleGoToPage(Math.min(this.searchResultsPagesCount, this.searchResultsPage + 1));
|
|
2400
|
-
}, label: "Next", iconPosition: "right", icon:
|
|
2420
|
+
}, 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 })));
|
|
2401
2421
|
}
|
|
2402
2422
|
}, [0, "searchcraft-pagination", {
|
|
2403
2423
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -2449,10 +2469,10 @@ const Po = To, $o = /* @__PURE__ */ te(class extends ee {
|
|
|
2449
2469
|
});
|
|
2450
2470
|
c(this, "cleanupCore");
|
|
2451
2471
|
c(this, "core");
|
|
2452
|
-
c(this, "renderOptionSymbol", () =>
|
|
2453
|
-
c(this, "renderCtrlSymbol", () =>
|
|
2454
|
-
c(this, "renderWindowsMetaSymbol", () =>
|
|
2455
|
-
c(this, "renderMacMetaSymbol", () =>
|
|
2472
|
+
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" })));
|
|
2473
|
+
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" })));
|
|
2474
|
+
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" })));
|
|
2475
|
+
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" })));
|
|
2456
2476
|
this.__registerHost();
|
|
2457
2477
|
}
|
|
2458
2478
|
onCoreAvailable(e) {
|
|
@@ -2496,18 +2516,18 @@ const Po = To, $o = /* @__PURE__ */ te(class extends ee {
|
|
|
2496
2516
|
}
|
|
2497
2517
|
}
|
|
2498
2518
|
renderSkeuomorphicSlot() {
|
|
2499
|
-
return
|
|
2519
|
+
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))));
|
|
2500
2520
|
}
|
|
2501
2521
|
renderSlot() {
|
|
2502
2522
|
switch (this.type) {
|
|
2503
2523
|
case "skeuomorphic":
|
|
2504
2524
|
return this.renderSkeuomorphicSlot();
|
|
2505
2525
|
default:
|
|
2506
|
-
return
|
|
2526
|
+
return m("div", null, m("slot", null));
|
|
2507
2527
|
}
|
|
2508
2528
|
}
|
|
2509
2529
|
render() {
|
|
2510
|
-
return
|
|
2530
|
+
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");
|
|
2511
2531
|
}
|
|
2512
2532
|
}, [4, "searchcraft-popover-button", {
|
|
2513
2533
|
template: [16],
|
|
@@ -2556,7 +2576,7 @@ const Io = _o, Ao = /* @__PURE__ */ te(class extends ee {
|
|
|
2556
2576
|
(e = this.unsubscribe) == null || e.call(this), (s = this.cleanupCore) == null || s.call(this);
|
|
2557
2577
|
}
|
|
2558
2578
|
render() {
|
|
2559
|
-
return
|
|
2579
|
+
return m("footer", { key: "e12fa32df3c1137e643af22323feb3dc33f7718f", class: "searchcraft-popover-footer" }, m("p", { key: "73a33859c1702d82625748f398d5402030cc71f4", class: "searchcraft-popover-footer-results-info" }, this.searchResultsCount ? `${Ea(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" }))));
|
|
2560
2580
|
}
|
|
2561
2581
|
}, [0, "searchcraft-popover-footer", {
|
|
2562
2582
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -2619,7 +2639,7 @@ const Mo = Ia, Oo = /* @__PURE__ */ te(class extends ee {
|
|
|
2619
2639
|
(e = this.cleanupCore) == null || e.call(this);
|
|
2620
2640
|
}
|
|
2621
2641
|
render() {
|
|
2622
|
-
return
|
|
2642
|
+
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))));
|
|
2623
2643
|
}
|
|
2624
2644
|
}, [0, "searchcraft-popover-list-item", {
|
|
2625
2645
|
item: [16],
|
|
@@ -2678,41 +2698,41 @@ const Lo = /* @__PURE__ */ te(class extends ee {
|
|
|
2678
2698
|
}
|
|
2679
2699
|
renderWithADMAds() {
|
|
2680
2700
|
var e, s;
|
|
2681
|
-
return
|
|
2701
|
+
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 })));
|
|
2682
2702
|
}
|
|
2683
2703
|
renderWithCustomAds() {
|
|
2684
|
-
var u, l,
|
|
2685
|
-
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (
|
|
2704
|
+
var u, l, p, C, S, $, A, N;
|
|
2705
|
+
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 = (($ = (S = this.config) == null ? void 0 : S.customAdConfig) == null ? void 0 : $.adStartQuantity) || 0, n = ((N = (A = this.config) == null ? void 0 : A.customAdConfig) == null ? void 0 : N.adEndQuantity) || 0, h = this.searchClientResponseItems || [];
|
|
2686
2706
|
for (let F = 0; F < o; F++)
|
|
2687
|
-
e.push(
|
|
2707
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F}-ad`, renderPosition: "top" }));
|
|
2688
2708
|
h.forEach((F, P) => {
|
|
2689
2709
|
if (s && P % s === 0 && P + s < h.length && P >= s)
|
|
2690
2710
|
for (let _ = 0; _ < a; _++)
|
|
2691
|
-
e.push(
|
|
2692
|
-
e.push(
|
|
2711
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F.id}-ad-${_}`, renderPosition: "interstitial" }));
|
|
2712
|
+
e.push(m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: F, key: F.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + P }));
|
|
2693
2713
|
});
|
|
2694
2714
|
for (let F = 0; F < n; F++)
|
|
2695
|
-
e.push(
|
|
2696
|
-
return
|
|
2715
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F}-ad`, renderPosition: "bottom" }));
|
|
2716
|
+
return m("div", { class: "searchcraft-popover-list-view" }, e);
|
|
2697
2717
|
}
|
|
2698
2718
|
renderWithNativoAds() {
|
|
2699
|
-
var l,
|
|
2700
|
-
const e = [], s = ((
|
|
2719
|
+
var l, p, C, S, $, A, N, F, P, _;
|
|
2720
|
+
const e = [], s = ((p = (l = this.config) == null ? void 0 : l.nativoConfig) == null ? void 0 : p.adInterstialStartIndex) || 0, a = ((S = (C = this.config) == null ? void 0 : C.nativoConfig) == null ? void 0 : S.adInterstitialInterval) || 0, o = ((A = ($ = this.config) == null ? void 0 : $.nativoConfig) == null ? void 0 : A.adInterstitialQuantity) || 1, n = ((F = (N = this.config) == null ? void 0 : N.nativoConfig) == null ? void 0 : F.adStartQuantity) || 0, h = ((_ = (P = this.config) == null ? void 0 : P.nativoConfig) == null ? void 0 : _.adEndQuantity) || 0, u = this.searchClientResponseItems || [];
|
|
2701
2721
|
for (let U = 0; U < n; U++)
|
|
2702
|
-
e.push(
|
|
2722
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U}-ad`, renderPosition: "top" }));
|
|
2703
2723
|
u.forEach((U, j) => {
|
|
2704
2724
|
if (a && (j + s) % a === 0 && j + a < u.length && j >= a)
|
|
2705
2725
|
for (let se = 0; se < o; se++)
|
|
2706
|
-
e.push(
|
|
2707
|
-
e.push(
|
|
2726
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U.id}-ad-${se}`, renderPosition: "interstitial" }));
|
|
2727
|
+
e.push(m("searchcraft-popover-list-item", { "searchcraft-id": this.searchcraftId, item: U, key: U.id, popoverResultMappings: this.popoverResultMappings, documentPosition: this.searchResultsPerPage * (this.searchResultsPage - 1) + j }));
|
|
2708
2728
|
});
|
|
2709
2729
|
for (let U = 0; U < h; U++)
|
|
2710
|
-
e.push(
|
|
2711
|
-
return
|
|
2730
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U}-ad`, renderPosition: "bottom" }));
|
|
2731
|
+
return m("div", { class: "searchcraft-popover-list-view" }, e);
|
|
2712
2732
|
}
|
|
2713
2733
|
renderWithNoAds() {
|
|
2714
2734
|
var e;
|
|
2715
|
-
return
|
|
2735
|
+
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 })));
|
|
2716
2736
|
}
|
|
2717
2737
|
render() {
|
|
2718
2738
|
var e, s, a;
|
|
@@ -2899,21 +2919,21 @@ const Fo = /* @__PURE__ */ te(class extends ee {
|
|
|
2899
2919
|
}
|
|
2900
2920
|
renderInlinePopover() {
|
|
2901
2921
|
const e = this.hasResultsToShow && this.isFocused;
|
|
2902
|
-
return
|
|
2922
|
+
return m("div", { class: we("searchcraft-popover-form searchcraft-popover-form-inline", {
|
|
2903
2923
|
"searchcraft-popover-form-active": e
|
|
2904
|
-
}) },
|
|
2924
|
+
}) }, 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 })));
|
|
2905
2925
|
}
|
|
2906
2926
|
renderModalPopover() {
|
|
2907
2927
|
if (this.isPopoverVisibleInState)
|
|
2908
|
-
return
|
|
2928
|
+
return m("div", { class: we("searchcraft-popover-form searchcraft-popover-form-modal", {
|
|
2909
2929
|
"searchcraft-popover-form-active": this.hasResultsToShow
|
|
2910
|
-
}) },
|
|
2930
|
+
}) }, 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 })));
|
|
2911
2931
|
}
|
|
2912
2932
|
renderFullscreenPopover() {
|
|
2913
2933
|
if (this.isPopoverVisibleInState)
|
|
2914
|
-
return
|
|
2934
|
+
return m("div", { class: we("searchcraft-popover-form searchcraft-popover-form-fullscreen", {
|
|
2915
2935
|
"searchcraft-popover-form-active": this.hasResultsToShow
|
|
2916
|
-
}) },
|
|
2936
|
+
}) }, 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 }));
|
|
2917
2937
|
}
|
|
2918
2938
|
render() {
|
|
2919
2939
|
switch (this.type) {
|
|
@@ -3023,7 +3043,7 @@ const Do = Ma, No = ds, zo = Aa, Ho = /* @__PURE__ */ te(class extends ee {
|
|
|
3023
3043
|
}
|
|
3024
3044
|
render() {
|
|
3025
3045
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
3026
|
-
return !this.searchTerm && !e || this.searchResultsCount === 0 ? null :
|
|
3046
|
+
return !this.searchTerm && !e || this.searchResultsCount === 0 ? null : m("p", { class: "searchcraft-results-info" }, typeof this.template < "u" ? this.template({
|
|
3027
3047
|
range: [Number(this.range[0]), Number(this.range[1])],
|
|
3028
3048
|
count: this.count,
|
|
3029
3049
|
responseTime: this.responseTime
|
|
@@ -3117,7 +3137,7 @@ const Bo = Uo, qo = /* @__PURE__ */ te(class extends ee {
|
|
|
3117
3137
|
}
|
|
3118
3138
|
render() {
|
|
3119
3139
|
if (this.item)
|
|
3120
|
-
return typeof this.template > "u" ?
|
|
3140
|
+
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 });
|
|
3121
3141
|
}
|
|
3122
3142
|
}, [0, "searchcraft-search-result", {
|
|
3123
3143
|
item: [16],
|
|
@@ -3181,49 +3201,49 @@ const Vo = Oa, jo = /* @__PURE__ */ te(class extends ee {
|
|
|
3181
3201
|
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;
|
|
3182
3202
|
}
|
|
3183
3203
|
renderEmptyState() {
|
|
3184
|
-
return
|
|
3204
|
+
return m("div", { class: "searchcraft-search-results-empty-state" }, m("slot", { name: "empty-search" }));
|
|
3185
3205
|
}
|
|
3186
3206
|
renderNoResultsFoundState() {
|
|
3187
|
-
return
|
|
3207
|
+
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.')));
|
|
3188
3208
|
}
|
|
3189
3209
|
renderWithADMAds() {
|
|
3190
3210
|
var s;
|
|
3191
3211
|
const e = this.searchClientResponseItems || [];
|
|
3192
|
-
return
|
|
3212
|
+
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 })));
|
|
3193
3213
|
}
|
|
3194
3214
|
renderWithCustomAds() {
|
|
3195
|
-
var u, l,
|
|
3196
|
-
const e = [], s = ((l = (u = this.config) == null ? void 0 : u.customAdConfig) == null ? void 0 : l.adInterstitialInterval) || 0, a = ((C = (
|
|
3215
|
+
var u, l, p, C, S, $, A, N;
|
|
3216
|
+
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 = (($ = (S = this.config) == null ? void 0 : S.customAdConfig) == null ? void 0 : $.adStartQuantity) || 0, n = ((N = (A = this.config) == null ? void 0 : A.customAdConfig) == null ? void 0 : N.adEndQuantity) || 0, h = this.searchClientResponseItems || [];
|
|
3197
3217
|
for (let F = 0; F < o; F++)
|
|
3198
|
-
e.push(
|
|
3218
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F}-ad`, renderPosition: "top" }));
|
|
3199
3219
|
h.forEach((F, P) => {
|
|
3200
3220
|
if (s && P % s === 0 && P + s < h.length && P >= s)
|
|
3201
3221
|
for (let _ = 0; _ < a; _++)
|
|
3202
|
-
e.push(
|
|
3203
|
-
e.push(
|
|
3222
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F.id}-ad-${_}`, renderPosition: "interstitial" }));
|
|
3223
|
+
e.push(m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: F.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + P, index: P, item: F, template: this.template }));
|
|
3204
3224
|
});
|
|
3205
3225
|
for (let F = 0; F < n; F++)
|
|
3206
|
-
e.push(
|
|
3207
|
-
return
|
|
3226
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Custom", key: `${F}-ad`, renderPosition: "bottom" }));
|
|
3227
|
+
return m("div", { class: "searchcraft-search-results" }, e);
|
|
3208
3228
|
}
|
|
3209
3229
|
renderWithNativoAds() {
|
|
3210
|
-
var l,
|
|
3211
|
-
const e = [], s = ((
|
|
3230
|
+
var l, p, C, S, $, A, N, F, P, _;
|
|
3231
|
+
const e = [], s = ((p = (l = this.config) == null ? void 0 : l.nativoConfig) == null ? void 0 : p.adInterstialStartIndex) || 0, a = ((S = (C = this.config) == null ? void 0 : C.nativoConfig) == null ? void 0 : S.adInterstitialInterval) || 0, o = ((A = ($ = this.config) == null ? void 0 : $.nativoConfig) == null ? void 0 : A.adInterstitialQuantity) || 1, n = ((F = (N = this.config) == null ? void 0 : N.nativoConfig) == null ? void 0 : F.adStartQuantity) || 0, h = ((_ = (P = this.config) == null ? void 0 : P.nativoConfig) == null ? void 0 : _.adEndQuantity) || 0, u = this.searchClientResponseItems || [];
|
|
3212
3232
|
for (let U = 0; U < n; U++)
|
|
3213
|
-
e.push(
|
|
3233
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U}-ad`, renderPosition: "top" }));
|
|
3214
3234
|
u.forEach((U, j) => {
|
|
3215
3235
|
if (a && (j + s) % a === 0 && j + a < u.length && j >= a)
|
|
3216
3236
|
for (let se = 0; se < o; se++)
|
|
3217
|
-
e.push(
|
|
3218
|
-
e.push(
|
|
3237
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U.id}-ad-${se}`, renderPosition: "interstitial" }));
|
|
3238
|
+
e.push(m("searchcraft-search-result", { "searchcraft-id": this.searchcraftId, key: U.id, "document-position": this.searchResultsPerPage * (this.searchResultsPage - 1) + j, index: j, item: U, template: this.template }));
|
|
3219
3239
|
});
|
|
3220
3240
|
for (let U = 0; U < h; U++)
|
|
3221
|
-
e.push(
|
|
3222
|
-
return
|
|
3241
|
+
e.push(m("searchcraft-ad", { "searchcraft-id": this.searchcraftId, adSource: "Nativo", key: `${U}-ad`, renderPosition: "bottom" }));
|
|
3242
|
+
return m("div", { class: "searchcraft-search-results" }, e);
|
|
3223
3243
|
}
|
|
3224
3244
|
renderWithNoAds() {
|
|
3225
3245
|
const e = this.searchClientResponseItems || [];
|
|
3226
|
-
return
|
|
3246
|
+
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 })));
|
|
3227
3247
|
}
|
|
3228
3248
|
render() {
|
|
3229
3249
|
var s, a, o;
|
|
@@ -3311,7 +3331,7 @@ const Go = Wo, Zo = /* @__PURE__ */ te(class extends ee {
|
|
|
3311
3331
|
this.setSearchResultsPage(e);
|
|
3312
3332
|
}
|
|
3313
3333
|
render() {
|
|
3314
|
-
return
|
|
3334
|
+
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));
|
|
3315
3335
|
}
|
|
3316
3336
|
}, [0, "searchcraft-select", {
|
|
3317
3337
|
caption: [1],
|
|
@@ -3382,7 +3402,7 @@ const Yo = /* @__PURE__ */ te(class extends ee {
|
|
|
3382
3402
|
render() {
|
|
3383
3403
|
const e = typeof this.searchClientRequestProperties == "string" && this.searchTerm.trim() === "";
|
|
3384
3404
|
if (!(!this.searchTerm && !e || this.searchResultsPagesCount <= 1))
|
|
3385
|
-
return
|
|
3405
|
+
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) => {
|
|
3386
3406
|
const o = this.initialSearchResultsPerPage + Number(this.increment) * a;
|
|
3387
3407
|
return {
|
|
3388
3408
|
label: `${o}`,
|
|
@@ -3429,12 +3449,12 @@ var Fa = { exports: {} };
|
|
|
3429
3449
|
var e = {}, s = e, a = { exports: e }, o = Object.defineProperty, n = Object.getOwnPropertyDescriptor, h = Object.getOwnPropertyNames, u = Object.prototype.hasOwnProperty, l = (f, i) => {
|
|
3430
3450
|
for (var d in i)
|
|
3431
3451
|
o(f, d, { get: i[d], enumerable: !0 });
|
|
3432
|
-
},
|
|
3452
|
+
}, p = (f, i, d, g) => {
|
|
3433
3453
|
if (i && typeof i == "object" || typeof i == "function")
|
|
3434
3454
|
for (let v of h(i))
|
|
3435
3455
|
!u.call(f, v) && v !== d && o(f, v, { get: () => i[v], enumerable: !(g = n(i, v)) || g.enumerable });
|
|
3436
3456
|
return f;
|
|
3437
|
-
}, C = (f) =>
|
|
3457
|
+
}, C = (f) => p(o({}, "__esModule", { value: !0 }), f), S = {};
|
|
3438
3458
|
l(S, {
|
|
3439
3459
|
Hooks: () => De,
|
|
3440
3460
|
Lexer: () => Te,
|
|
@@ -5049,10 +5069,10 @@ const ei = /* @__PURE__ */ te(class extends ee {
|
|
|
5049
5069
|
* Renders the appropriate content based on current state.
|
|
5050
5070
|
*/
|
|
5051
5071
|
renderContent() {
|
|
5052
|
-
return this.isLoading ?
|
|
5072
|
+
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);
|
|
5053
5073
|
}
|
|
5054
5074
|
render() {
|
|
5055
|
-
return
|
|
5075
|
+
return m("div", { key: "c88d0bf7e12ad0fa0c019d207854a6e92babc683", class: "searchcraft-summary-box" }, this.renderContent());
|
|
5056
5076
|
}
|
|
5057
5077
|
}, [0, "searchcraft-summary-box", {
|
|
5058
5078
|
searchcraftId: [1, "searchcraft-id"],
|
|
@@ -5080,7 +5100,7 @@ const ri = ti, si = `[class*=searchcraft-],[class*=searchcraft-] *,[class*=searc
|
|
|
5080
5100
|
super(), this.__registerHost();
|
|
5081
5101
|
}
|
|
5082
5102
|
render() {
|
|
5083
|
-
return
|
|
5103
|
+
return m("style", { key: "ef26626cdfa4fa98d516802d71443c49a9c6ecf9" }, si);
|
|
5084
5104
|
}
|
|
5085
5105
|
}, [0, "searchcraft-theme"]);
|
|
5086
5106
|
function ni() {
|
|
@@ -5146,21 +5166,21 @@ function Ge(r, t, e, s) {
|
|
|
5146
5166
|
function n(l) {
|
|
5147
5167
|
try {
|
|
5148
5168
|
u(s.next(l));
|
|
5149
|
-
} catch (
|
|
5150
|
-
o(
|
|
5169
|
+
} catch (p) {
|
|
5170
|
+
o(p);
|
|
5151
5171
|
}
|
|
5152
5172
|
}
|
|
5153
5173
|
function h(l) {
|
|
5154
5174
|
try {
|
|
5155
5175
|
u(s.throw(l));
|
|
5156
|
-
} catch (
|
|
5157
|
-
o(
|
|
5176
|
+
} catch (p) {
|
|
5177
|
+
o(p);
|
|
5158
5178
|
}
|
|
5159
5179
|
}
|
|
5160
5180
|
function u(l) {
|
|
5161
|
-
var
|
|
5162
|
-
l.done ? a(l.value) : (
|
|
5163
|
-
C(
|
|
5181
|
+
var p;
|
|
5182
|
+
l.done ? a(l.value) : (p = l.value, p instanceof e ? p : new e(function(C) {
|
|
5183
|
+
C(p);
|
|
5164
5184
|
})).then(n, h);
|
|
5165
5185
|
}
|
|
5166
5186
|
u((s = s.apply(r, [])).next());
|
|
@@ -5176,51 +5196,51 @@ function Ze(r, t) {
|
|
|
5176
5196
|
}), o;
|
|
5177
5197
|
function h(u) {
|
|
5178
5198
|
return function(l) {
|
|
5179
|
-
return function(
|
|
5199
|
+
return function(p) {
|
|
5180
5200
|
if (e) throw new TypeError("Generator is already executing.");
|
|
5181
|
-
for (; o && (o = 0,
|
|
5182
|
-
if (e = 1, s && (a = 2 &
|
|
5183
|
-
switch (s = 0, a && (
|
|
5201
|
+
for (; o && (o = 0, p[0] && (n = 0)), n; ) try {
|
|
5202
|
+
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;
|
|
5203
|
+
switch (s = 0, a && (p = [2 & p[0], a.value]), p[0]) {
|
|
5184
5204
|
case 0:
|
|
5185
5205
|
case 1:
|
|
5186
|
-
a =
|
|
5206
|
+
a = p;
|
|
5187
5207
|
break;
|
|
5188
5208
|
case 4:
|
|
5189
|
-
return n.label++, { value:
|
|
5209
|
+
return n.label++, { value: p[1], done: !1 };
|
|
5190
5210
|
case 5:
|
|
5191
|
-
n.label++, s =
|
|
5211
|
+
n.label++, s = p[1], p = [0];
|
|
5192
5212
|
continue;
|
|
5193
5213
|
case 7:
|
|
5194
|
-
|
|
5214
|
+
p = n.ops.pop(), n.trys.pop();
|
|
5195
5215
|
continue;
|
|
5196
5216
|
default:
|
|
5197
|
-
if (a = n.trys, !((a = a.length > 0 && a[a.length - 1]) ||
|
|
5217
|
+
if (a = n.trys, !((a = a.length > 0 && a[a.length - 1]) || p[0] !== 6 && p[0] !== 2)) {
|
|
5198
5218
|
n = 0;
|
|
5199
5219
|
continue;
|
|
5200
5220
|
}
|
|
5201
|
-
if (
|
|
5202
|
-
n.label =
|
|
5221
|
+
if (p[0] === 3 && (!a || p[1] > a[0] && p[1] < a[3])) {
|
|
5222
|
+
n.label = p[1];
|
|
5203
5223
|
break;
|
|
5204
5224
|
}
|
|
5205
|
-
if (
|
|
5206
|
-
n.label = a[1], a =
|
|
5225
|
+
if (p[0] === 6 && n.label < a[1]) {
|
|
5226
|
+
n.label = a[1], a = p;
|
|
5207
5227
|
break;
|
|
5208
5228
|
}
|
|
5209
5229
|
if (a && n.label < a[2]) {
|
|
5210
|
-
n.label = a[2], n.ops.push(
|
|
5230
|
+
n.label = a[2], n.ops.push(p);
|
|
5211
5231
|
break;
|
|
5212
5232
|
}
|
|
5213
5233
|
a[2] && n.ops.pop(), n.trys.pop();
|
|
5214
5234
|
continue;
|
|
5215
5235
|
}
|
|
5216
|
-
|
|
5236
|
+
p = t.call(r, n);
|
|
5217
5237
|
} catch (C) {
|
|
5218
|
-
|
|
5238
|
+
p = [6, C], s = 0;
|
|
5219
5239
|
} finally {
|
|
5220
5240
|
e = a = 0;
|
|
5221
5241
|
}
|
|
5222
|
-
if (5 &
|
|
5223
|
-
return { value:
|
|
5242
|
+
if (5 & p[0]) throw p[1];
|
|
5243
|
+
return { value: p[0] ? p[1] : void 0, done: !0 };
|
|
5224
5244
|
}([u, l]);
|
|
5225
5245
|
};
|
|
5226
5246
|
}
|
|
@@ -5248,42 +5268,42 @@ function fs(r, t) {
|
|
|
5248
5268
|
var s = new Uint32Array([t, t, t, t]);
|
|
5249
5269
|
(function(o, n) {
|
|
5250
5270
|
for (var h = o.byteLength / 16 | 0, u = new Uint32Array(o, 0, 4 * h), l = 0; l < h; l++) {
|
|
5251
|
-
var
|
|
5252
|
-
|
|
5271
|
+
var p = u.subarray(4 * l, 4 * (l + 1));
|
|
5272
|
+
p[0] = Math.imul(p[0], be[0]), p[0] = Pe(p[0], 15), p[0] = Math.imul(p[0], be[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], be[1]), p[1] = Pe(p[1], 16), p[1] = Math.imul(p[1], be[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], be[2]), p[2] = Pe(p[2], 17), p[2] = Math.imul(p[2], be[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], be[3]), p[3] = Pe(p[3], 18), p[3] = Math.imul(p[3], be[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;
|
|
5253
5273
|
}
|
|
5254
5274
|
})(r, s), function(o, n) {
|
|
5255
|
-
var h = o.byteLength / 16 | 0, u = o.byteLength % 16, l = new Uint32Array(4),
|
|
5275
|
+
var h = o.byteLength / 16 | 0, u = o.byteLength % 16, l = new Uint32Array(4), p = new Uint8Array(o, 16 * h, u);
|
|
5256
5276
|
switch (u) {
|
|
5257
5277
|
case 15:
|
|
5258
|
-
l[3] = l[3] ^
|
|
5278
|
+
l[3] = l[3] ^ p[14] << 16;
|
|
5259
5279
|
case 14:
|
|
5260
|
-
l[3] = l[3] ^
|
|
5280
|
+
l[3] = l[3] ^ p[13] << 8;
|
|
5261
5281
|
case 13:
|
|
5262
|
-
l[3] = l[3] ^
|
|
5282
|
+
l[3] = l[3] ^ p[12] << 0, l[3] = Math.imul(l[3], be[3]), l[3] = Pe(l[3], 18), l[3] = Math.imul(l[3], be[0]), n[3] = n[3] ^ l[3];
|
|
5263
5283
|
case 12:
|
|
5264
|
-
l[2] = l[2] ^
|
|
5284
|
+
l[2] = l[2] ^ p[11] << 24;
|
|
5265
5285
|
case 11:
|
|
5266
|
-
l[2] = l[2] ^
|
|
5286
|
+
l[2] = l[2] ^ p[10] << 16;
|
|
5267
5287
|
case 10:
|
|
5268
|
-
l[2] = l[2] ^
|
|
5288
|
+
l[2] = l[2] ^ p[9] << 8;
|
|
5269
5289
|
case 9:
|
|
5270
|
-
l[2] = l[2] ^
|
|
5290
|
+
l[2] = l[2] ^ p[8] << 0, l[2] = Math.imul(l[2], be[2]), l[2] = Pe(l[2], 17), l[2] = Math.imul(l[2], be[3]), n[2] = n[2] ^ l[2];
|
|
5271
5291
|
case 8:
|
|
5272
|
-
l[1] = l[1] ^
|
|
5292
|
+
l[1] = l[1] ^ p[7] << 24;
|
|
5273
5293
|
case 7:
|
|
5274
|
-
l[1] = l[1] ^
|
|
5294
|
+
l[1] = l[1] ^ p[6] << 16;
|
|
5275
5295
|
case 6:
|
|
5276
|
-
l[1] = l[1] ^
|
|
5296
|
+
l[1] = l[1] ^ p[5] << 8;
|
|
5277
5297
|
case 5:
|
|
5278
|
-
l[1] = l[1] ^
|
|
5298
|
+
l[1] = l[1] ^ p[4] << 0, l[1] = Math.imul(l[1], be[1]), l[1] = Pe(l[1], 16), l[1] = Math.imul(l[1], be[2]), n[1] = n[1] ^ l[1];
|
|
5279
5299
|
case 4:
|
|
5280
|
-
l[0] = l[0] ^
|
|
5300
|
+
l[0] = l[0] ^ p[3] << 24;
|
|
5281
5301
|
case 3:
|
|
5282
|
-
l[0] = l[0] ^
|
|
5302
|
+
l[0] = l[0] ^ p[2] << 16;
|
|
5283
5303
|
case 2:
|
|
5284
|
-
l[0] = l[0] ^
|
|
5304
|
+
l[0] = l[0] ^ p[1] << 8;
|
|
5285
5305
|
case 1:
|
|
5286
|
-
l[0] = l[0] ^
|
|
5306
|
+
l[0] = l[0] ^ p[0] << 0, l[0] = Math.imul(l[0], be[0]), l[0] = Pe(l[0], 15), l[0] = Math.imul(l[0], be[1]), n[0] = n[0] ^ l[0];
|
|
5287
5307
|
}
|
|
5288
5308
|
}(r, s), function(o, n) {
|
|
5289
5309
|
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;
|
|
@@ -5456,8 +5476,8 @@ function xi(r, t) {
|
|
|
5456
5476
|
if (o.length === 0) return null;
|
|
5457
5477
|
var n = {};
|
|
5458
5478
|
o.forEach(function(l) {
|
|
5459
|
-
var
|
|
5460
|
-
n[
|
|
5479
|
+
var p = String(l);
|
|
5480
|
+
n[p] = (n[p] || 0) + 1;
|
|
5461
5481
|
});
|
|
5462
5482
|
var h = o[0], u = 1;
|
|
5463
5483
|
return Object.keys(n).forEach(function(l) {
|
|
@@ -5499,7 +5519,7 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5499
5519
|
switch (u.label) {
|
|
5500
5520
|
case 0:
|
|
5501
5521
|
return document.body ? [3, 2] : [4, (l = 50, new Promise(function(C) {
|
|
5502
|
-
return setTimeout(C, l,
|
|
5522
|
+
return setTimeout(C, l, p);
|
|
5503
5523
|
}))];
|
|
5504
5524
|
case 1:
|
|
5505
5525
|
return u.sent(), [3, 0];
|
|
@@ -5509,7 +5529,7 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5509
5529
|
document.body.removeChild(o);
|
|
5510
5530
|
}, 0), [2];
|
|
5511
5531
|
}
|
|
5512
|
-
var l,
|
|
5532
|
+
var l, p;
|
|
5513
5533
|
});
|
|
5514
5534
|
});
|
|
5515
5535
|
})(function(s) {
|
|
@@ -5517,11 +5537,11 @@ Vt().name != "Firefox" && Ie("fonts", function() {
|
|
|
5517
5537
|
return Ge(r, void 0, void 0, function() {
|
|
5518
5538
|
var o, n, h, u;
|
|
5519
5539
|
return Ze(this, function(l) {
|
|
5520
|
-
return o = a.createElement("canvas"), n = o.getContext("2d"), h = yi.map(function(
|
|
5521
|
-
return Zs(n,
|
|
5522
|
-
}), u = {}, vi.forEach(function(
|
|
5523
|
-
var C = Zs(n,
|
|
5524
|
-
h.includes(C) || (u[
|
|
5540
|
+
return o = a.createElement("canvas"), n = o.getContext("2d"), h = yi.map(function(p) {
|
|
5541
|
+
return Zs(n, p);
|
|
5542
|
+
}), u = {}, vi.forEach(function(p) {
|
|
5543
|
+
var C = Zs(n, p);
|
|
5544
|
+
h.includes(C) || (u[p] = C);
|
|
5525
5545
|
}), t(u), [2];
|
|
5526
5546
|
});
|
|
5527
5547
|
});
|
|
@@ -5622,9 +5642,9 @@ Ie("webgl", function() {
|
|
|
5622
5642
|
if (!n) throw new Error("Failed to create shader program");
|
|
5623
5643
|
if (D.attachShader(n, a), D.attachShader(n, o), D.linkProgram(n), !D.getProgramParameter(n, D.LINK_STATUS)) throw new Error("Shader program linking failed: " + D.getProgramInfoLog(n));
|
|
5624
5644
|
D.useProgram(n);
|
|
5625
|
-
for (var h = 137, u = new Float32Array(4 * h), l = 2 * Math.PI / h,
|
|
5626
|
-
var C =
|
|
5627
|
-
u[4 *
|
|
5645
|
+
for (var h = 137, u = new Float32Array(4 * h), l = 2 * Math.PI / h, p = 0; p < h; p++) {
|
|
5646
|
+
var C = p * l;
|
|
5647
|
+
u[4 * p] = 0, u[4 * p + 1] = 0, u[4 * p + 2] = Math.cos(C) * (ye.width / 2), u[4 * p + 3] = Math.sin(C) * (ye.height / 2);
|
|
5628
5648
|
}
|
|
5629
5649
|
var S = D.createBuffer();
|
|
5630
5650
|
D.bindBuffer(D.ARRAY_BUFFER, S), D.bufferData(D.ARRAY_BUFFER, u, D.STATIC_DRAW);
|
|
@@ -5693,16 +5713,16 @@ class Ei extends ps {
|
|
|
5693
5713
|
rfr: "searchcraft.io",
|
|
5694
5714
|
"results-ta": `${e.textAdQuantity || 0}`,
|
|
5695
5715
|
"results-pa": `${e.productAdQuantity || 0}`
|
|
5696
|
-
}).toString()}`, n = await (await fetch(a, { method: "GET" })).json(), h = n.product_ads.map((
|
|
5716
|
+
}).toString()}`, n = await (await fetch(a, { method: "GET" })).json(), h = n.product_ads.map((p) => ({
|
|
5697
5717
|
id: ut(),
|
|
5698
5718
|
adSource: "adMarketplace",
|
|
5699
5719
|
admAdType: "adm-product-ad",
|
|
5700
|
-
admAd:
|
|
5701
|
-
})), u = n.text_ads.map((
|
|
5720
|
+
admAd: p
|
|
5721
|
+
})), u = n.text_ads.map((p) => ({
|
|
5702
5722
|
id: ut(),
|
|
5703
5723
|
adSource: "adMarketplace",
|
|
5704
5724
|
admAdType: "adm-text-ad",
|
|
5705
|
-
admAd:
|
|
5725
|
+
admAd: p
|
|
5706
5726
|
}));
|
|
5707
5727
|
return h.concat(u);
|
|
5708
5728
|
}
|
|
@@ -5890,7 +5910,7 @@ class Oi {
|
|
|
5890
5910
|
* @returns
|
|
5891
5911
|
*/
|
|
5892
5912
|
c(this, "getSearchResponseItems", async (t, e = !1) => {
|
|
5893
|
-
var n, h, u, l,
|
|
5913
|
+
var n, h, u, l, p, C, S;
|
|
5894
5914
|
let s, a = "", o;
|
|
5895
5915
|
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", {
|
|
5896
5916
|
search_term: a
|
|
@@ -5899,7 +5919,7 @@ class Oi {
|
|
|
5899
5919
|
data: {
|
|
5900
5920
|
searchTerm: a
|
|
5901
5921
|
}
|
|
5902
|
-
}), (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 || ((
|
|
5922
|
+
}), (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", {
|
|
5903
5923
|
search_term: a,
|
|
5904
5924
|
number_of_documents: s.data.count
|
|
5905
5925
|
}), clearTimeout(this.searchCompletedEventTimeout), this.searchCompletedEventTimeout = setTimeout(() => {
|
|
@@ -6024,11 +6044,11 @@ class Oi {
|
|
|
6024
6044
|
var Ua = {}, ms = {};
|
|
6025
6045
|
const Ys = (r) => {
|
|
6026
6046
|
let t;
|
|
6027
|
-
const e = /* @__PURE__ */ new Set(), s = (l,
|
|
6047
|
+
const e = /* @__PURE__ */ new Set(), s = (l, p) => {
|
|
6028
6048
|
const C = typeof l == "function" ? l(t) : l;
|
|
6029
6049
|
if (!Object.is(C, t)) {
|
|
6030
6050
|
const S = t;
|
|
6031
|
-
t =
|
|
6051
|
+
t = p ?? (typeof C != "object" || C === null) ? C : Object.assign({}, t, C), e.forEach(($) => $(t, S));
|
|
6032
6052
|
}
|
|
6033
6053
|
}, a = () => t, h = { setState: s, getState: a, getInitialState: () => u, subscribe: (l) => (e.add(l), () => e.delete(l)) }, u = t = r(s, a, h);
|
|
6034
6054
|
return h;
|
|
@@ -6487,7 +6507,7 @@ class tc {
|
|
|
6487
6507
|
streamSummaryData() {
|
|
6488
6508
|
var s;
|
|
6489
6509
|
const t = async () => {
|
|
6490
|
-
var u, l,
|
|
6510
|
+
var u, l, p, C, S, $;
|
|
6491
6511
|
const a = this.get(), o = (u = a.core) == null ? void 0 : u.config;
|
|
6492
6512
|
if (!o) {
|
|
6493
6513
|
console.error("Could not stream summary data, no config found.");
|
|
@@ -6500,7 +6520,7 @@ class tc {
|
|
|
6500
6520
|
const n = (l = a.core) == null ? void 0 : l.config.indexName;
|
|
6501
6521
|
if (!a.hasSummaryBox || !n)
|
|
6502
6522
|
return;
|
|
6503
|
-
(
|
|
6523
|
+
(p = this.abortController) == null || p.abort("A newer request has replaced this one."), this.abortController = new AbortController(), this.set({
|
|
6504
6524
|
isSummaryLoading: !0,
|
|
6505
6525
|
summary: ""
|
|
6506
6526
|
});
|
|
@@ -6616,10 +6636,10 @@ const sa = {
|
|
|
6616
6636
|
currentPage: o().searchResultsPage,
|
|
6617
6637
|
stackTrace: new Error().stack
|
|
6618
6638
|
}), a((l) => {
|
|
6619
|
-
const
|
|
6620
|
-
return delete
|
|
6639
|
+
const p = l.facetPathsForIndexFields;
|
|
6640
|
+
return delete p[u], {
|
|
6621
6641
|
facetPathsForIndexFields: {
|
|
6622
|
-
...
|
|
6642
|
+
...p
|
|
6623
6643
|
},
|
|
6624
6644
|
searchResultsPage: 1
|
|
6625
6645
|
// Reset to page 1 when filters change
|
|
@@ -6627,17 +6647,17 @@ const sa = {
|
|
|
6627
6647
|
});
|
|
6628
6648
|
},
|
|
6629
6649
|
removeRangeValueForIndexField: (u) => a((l) => {
|
|
6630
|
-
const
|
|
6631
|
-
return delete
|
|
6650
|
+
const p = l.rangeValueForIndexFields;
|
|
6651
|
+
return delete p[u], {
|
|
6632
6652
|
rangeValueForIndexFields: {
|
|
6633
|
-
...
|
|
6653
|
+
...p
|
|
6634
6654
|
}
|
|
6635
6655
|
};
|
|
6636
6656
|
}),
|
|
6637
6657
|
resetSearchValues: () => {
|
|
6638
|
-
var l,
|
|
6658
|
+
var l, p;
|
|
6639
6659
|
const u = o();
|
|
6640
|
-
(
|
|
6660
|
+
(p = (l = u.core) == null ? void 0 : l.searchClient) == null || p.abortRequests(), a({
|
|
6641
6661
|
searchTerm: "",
|
|
6642
6662
|
searchResultsPage: 1,
|
|
6643
6663
|
searchClientResponseItems: [...u.cachedSearchClientResponseItems],
|
|
@@ -6650,9 +6670,9 @@ const sa = {
|
|
|
6650
6670
|
if (!l.core)
|
|
6651
6671
|
throw new Error("Searchcraft instance is not initialized.");
|
|
6652
6672
|
l.core.config.cortexURL && !(u != null && u.skipSummary) && ((N = l.summaryClient) == null || N.streamSummaryData());
|
|
6653
|
-
const
|
|
6673
|
+
const p = typeof l.cachedSearchClientRequestProperties == "string" && l.searchTerm.trim() === "", C = Object.keys(l.facetPathsForIndexFields).length > 0 || Object.keys(l.rangeValueForIndexFields).length > 0, S = l.searchResultsPage !== 1, $ = l.searchMode !== "fuzzy";
|
|
6654
6674
|
if (!l.searchTerm.trim()) {
|
|
6655
|
-
if (
|
|
6675
|
+
if (p && (C || S || $)) {
|
|
6656
6676
|
const _ = JSON.parse(l.cachedSearchClientRequestProperties);
|
|
6657
6677
|
a({ isSearchInProgress: !0 });
|
|
6658
6678
|
const j = [...Array.isArray(_.query) ? _.query.filter((Y) => !Y.occur) : [_.query]];
|
|
@@ -6724,9 +6744,9 @@ const sa = {
|
|
|
6724
6744
|
setSearchMode: (u) => a({ searchMode: u }),
|
|
6725
6745
|
setSortOrder: ({ orderByField: u, sortType: l }) => a({ sortType: l, orderByField: u }),
|
|
6726
6746
|
setSearchTerm: (u) => {
|
|
6727
|
-
var
|
|
6747
|
+
var p;
|
|
6728
6748
|
const l = o();
|
|
6729
|
-
u.length === 0 && ((
|
|
6749
|
+
u.length === 0 && ((p = l.core) == null || p.handleInputCleared()), a({
|
|
6730
6750
|
searchTerm: u,
|
|
6731
6751
|
searchResultsPage: 1,
|
|
6732
6752
|
...u.trim().length === 0 && {
|
|
@@ -6753,9 +6773,9 @@ const sa = {
|
|
|
6753
6773
|
a({ searchResultsPerPage: u }), await n.search({ skipSummary: !0 });
|
|
6754
6774
|
},
|
|
6755
6775
|
setHotKeyAndHotKeyModifier: (u, l) => {
|
|
6756
|
-
const { hotkey:
|
|
6776
|
+
const { hotkey: p, hotkeyModifier: C } = sa;
|
|
6757
6777
|
a({
|
|
6758
|
-
hotkey: u ||
|
|
6778
|
+
hotkey: u || p,
|
|
6759
6779
|
hotkeyModifier: l || C
|
|
6760
6780
|
});
|
|
6761
6781
|
}
|
|
@@ -6815,17 +6835,17 @@ class sc {
|
|
|
6815
6835
|
const { facetPathsForIndexFields: u, ...l } = t.requestProperties;
|
|
6816
6836
|
try {
|
|
6817
6837
|
o = await ((n = this == null ? void 0 : this.searchClient) == null ? void 0 : n.getSearchResponseItems(l, !0));
|
|
6818
|
-
} catch (
|
|
6819
|
-
fr.info(`Search request error: ${
|
|
6838
|
+
} catch (p) {
|
|
6839
|
+
fr.info(`Search request error: ${p}`);
|
|
6820
6840
|
return;
|
|
6821
6841
|
}
|
|
6822
6842
|
}
|
|
6823
6843
|
} else if (typeof t.requestProperties == "string") {
|
|
6824
6844
|
const u = JSON.parse(t.requestProperties), l = Array.isArray(u.query) ? u.query : [u.query];
|
|
6825
6845
|
if (l.length > 1) {
|
|
6826
|
-
const
|
|
6846
|
+
const p = l.filter((S) => S.occur !== "must"), C = {
|
|
6827
6847
|
...u,
|
|
6828
|
-
query:
|
|
6848
|
+
query: p.length > 0 ? p : l.slice(0, 1)
|
|
6829
6849
|
};
|
|
6830
6850
|
try {
|
|
6831
6851
|
o = await ((h = this == null ? void 0 : this.searchClient) == null ? void 0 : h.getSearchResponseItems(JSON.stringify(C), !0));
|
|
@@ -6941,12 +6961,12 @@ class sc {
|
|
|
6941
6961
|
}), (t = this.adClient) == null || t.onInputCleared();
|
|
6942
6962
|
}
|
|
6943
6963
|
}
|
|
6944
|
-
const ac = "@searchcraft/vue-sdk", nc = "0.12.
|
|
6964
|
+
const ac = "@searchcraft/vue-sdk", nc = "0.12.2", Qr = "routerLink", aa = "navManager", oc = "router", ic = "aria", zt = Symbol(), na = { default: zt }, oa = (r) => (r == null ? void 0 : r.split(" ")) || [], cc = (r, t, e = []) => {
|
|
6945
6965
|
var s;
|
|
6946
6966
|
return [...Array.from(((s = r.value) == null ? void 0 : s.classList) || []), ...e].filter((a, o, n) => !t.has(a) && n.indexOf(a) === o);
|
|
6947
6967
|
}, Fe = (r, t, e = [], s = [], a, o) => {
|
|
6948
6968
|
t !== void 0 && t();
|
|
6949
|
-
const n = nn((h, { attrs: u, slots: l, emit:
|
|
6969
|
+
const n = nn((h, { attrs: u, slots: l, emit: p }) => {
|
|
6950
6970
|
var P;
|
|
6951
6971
|
const C = on(), S = new Set(oa(u.class)), $ = cn(), N = ((P = $ == null ? void 0 : $.appContext) == null ? void 0 : P.provides[aa]) ? ln(aa) : void 0, F = (_) => {
|
|
6952
6972
|
const { routerLink: U } = h;
|