@searchstax-inc/searchstudio-ux-react 0.2.4 → 0.2.6
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/README.md +40 -1
- package/dist/@searchstax-inc/components/SearchstaxPaginationWidget.d.ts +1 -0
- package/dist/@searchstax-inc/components/SearchstaxResultWidget.d.ts +2 -0
- package/dist/@searchstax-inc/searchstudio-ux-react.cjs +38 -21
- package/dist/@searchstax-inc/searchstudio-ux-react.iife.js +37 -20
- package/dist/@searchstax-inc/searchstudio-ux-react.mjs +1369 -1160
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import nt, { useState as H, useEffect as ee, createRef as et } from "react";
|
|
2
|
+
var Pe = { exports: {} }, oe = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.min.js
|
|
@@ -9,25 +9,25 @@ var je = { exports: {} }, le = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
function c(l,
|
|
19
|
-
var p, v = {},
|
|
20
|
-
d !== void 0 && (
|
|
21
|
-
for (p in
|
|
22
|
-
|
|
12
|
+
var tt;
|
|
13
|
+
function Ft() {
|
|
14
|
+
if (tt)
|
|
15
|
+
return oe;
|
|
16
|
+
tt = 1;
|
|
17
|
+
var i = nt, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function c(l, u, d) {
|
|
19
|
+
var p, v = {}, y = null, R = null;
|
|
20
|
+
d !== void 0 && (y = "" + d), u.key !== void 0 && (y = "" + u.key), u.ref !== void 0 && (R = u.ref);
|
|
21
|
+
for (p in u)
|
|
22
|
+
s.call(u, p) && !r.hasOwnProperty(p) && (v[p] = u[p]);
|
|
23
23
|
if (l && l.defaultProps)
|
|
24
|
-
for (p in
|
|
25
|
-
v[p] === void 0 && (v[p] =
|
|
26
|
-
return { $$typeof: e, type: l, key:
|
|
24
|
+
for (p in u = l.defaultProps, u)
|
|
25
|
+
v[p] === void 0 && (v[p] = u[p]);
|
|
26
|
+
return { $$typeof: e, type: l, key: y, ref: R, props: v, _owner: a.current };
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return oe.Fragment = t, oe.jsx = c, oe.jsxs = c, oe;
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var he = {};
|
|
31
31
|
/**
|
|
32
32
|
* @license React
|
|
33
33
|
* react-jsx-runtime.development.js
|
|
@@ -37,91 +37,91 @@ var oe = {};
|
|
|
37
37
|
* This source code is licensed under the MIT license found in the
|
|
38
38
|
* LICENSE file in the root directory of this source tree.
|
|
39
39
|
*/
|
|
40
|
-
var
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
40
|
+
var at;
|
|
41
|
+
function Ot() {
|
|
42
|
+
return at || (at = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
+
var i = nt, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), M = Symbol.iterator, k = "@@iterator";
|
|
44
|
+
function T(n) {
|
|
45
|
+
if (n === null || typeof n != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var g = M &&
|
|
47
|
+
var g = M && n[M] || n[k];
|
|
48
48
|
return typeof g == "function" ? g : null;
|
|
49
49
|
}
|
|
50
|
-
var I =
|
|
51
|
-
function
|
|
50
|
+
var I = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function L(n) {
|
|
52
52
|
{
|
|
53
53
|
for (var g = arguments.length, f = new Array(g > 1 ? g - 1 : 0), S = 1; S < g; S++)
|
|
54
54
|
f[S - 1] = arguments[S];
|
|
55
|
-
N("error",
|
|
55
|
+
N("error", n, f);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function N(
|
|
58
|
+
function N(n, g, f) {
|
|
59
59
|
{
|
|
60
|
-
var S = I.ReactDebugCurrentFrame,
|
|
61
|
-
|
|
62
|
-
var O = f.map(function(
|
|
63
|
-
return String(
|
|
60
|
+
var S = I.ReactDebugCurrentFrame, j = S.getStackAddendum();
|
|
61
|
+
j !== "" && (g += "%s", f = f.concat([j]));
|
|
62
|
+
var O = f.map(function(E) {
|
|
63
|
+
return String(E);
|
|
64
64
|
});
|
|
65
|
-
O.unshift("Warning: " + g), Function.prototype.apply.call(console[
|
|
65
|
+
O.unshift("Warning: " + g), Function.prototype.apply.call(console[n], console, O);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var W = !1, A = !1,
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
return !!(typeof
|
|
68
|
+
var W = !1, A = !1, Q = !1, m = !1, b = !1, F;
|
|
69
|
+
F = Symbol.for("react.module.reference");
|
|
70
|
+
function $(n) {
|
|
71
|
+
return !!(typeof n == "string" || typeof n == "function" || n === s || n === r || b || n === a || n === d || n === p || m || n === R || W || A || Q || typeof n == "object" && n !== null && (n.$$typeof === y || n.$$typeof === v || n.$$typeof === c || n.$$typeof === l || n.$$typeof === u || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
|
-
|
|
75
|
+
n.$$typeof === F || n.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
var S =
|
|
77
|
+
function G(n, g, f) {
|
|
78
|
+
var S = n.displayName;
|
|
79
79
|
if (S)
|
|
80
80
|
return S;
|
|
81
|
-
var
|
|
82
|
-
return
|
|
81
|
+
var j = g.displayName || g.name || "";
|
|
82
|
+
return j !== "" ? f + "(" + j + ")" : f;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
84
|
+
function ne(n) {
|
|
85
|
+
return n.displayName || "Context";
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
if (
|
|
87
|
+
function K(n) {
|
|
88
|
+
if (n == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof
|
|
91
|
-
return
|
|
92
|
-
if (typeof
|
|
93
|
-
return
|
|
94
|
-
switch (
|
|
95
|
-
case
|
|
90
|
+
if (typeof n.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function")
|
|
91
|
+
return n.displayName || n.name || null;
|
|
92
|
+
if (typeof n == "string")
|
|
93
|
+
return n;
|
|
94
|
+
switch (n) {
|
|
95
|
+
case s:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case t:
|
|
98
98
|
return "Portal";
|
|
99
99
|
case r:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case a:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case d:
|
|
104
104
|
return "Suspense";
|
|
105
105
|
case p:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
|
-
if (typeof
|
|
109
|
-
switch (
|
|
108
|
+
if (typeof n == "object")
|
|
109
|
+
switch (n.$$typeof) {
|
|
110
110
|
case l:
|
|
111
|
-
var g =
|
|
112
|
-
return
|
|
111
|
+
var g = n;
|
|
112
|
+
return ne(g) + ".Consumer";
|
|
113
113
|
case c:
|
|
114
|
-
var f =
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
return
|
|
114
|
+
var f = n;
|
|
115
|
+
return ne(f._context) + ".Provider";
|
|
116
|
+
case u:
|
|
117
|
+
return G(n, n.render, "ForwardRef");
|
|
118
118
|
case v:
|
|
119
|
-
var S =
|
|
120
|
-
return S !== null ? S :
|
|
121
|
-
case
|
|
122
|
-
var
|
|
119
|
+
var S = n.displayName || null;
|
|
120
|
+
return S !== null ? S : K(n.type) || "Memo";
|
|
121
|
+
case y: {
|
|
122
|
+
var j = n, O = j._payload, E = j._init;
|
|
123
123
|
try {
|
|
124
|
-
return
|
|
124
|
+
return K(E(O));
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
@@ -129,372 +129,372 @@ function Ft() {
|
|
|
129
129
|
}
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
132
|
-
var Y = Object.assign,
|
|
133
|
-
function
|
|
132
|
+
var Y = Object.assign, ce = 0, Fe, Oe, Me, Ae, De, Ne, $e;
|
|
133
|
+
function qe() {
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
135
|
+
qe.__reactDisabledLog = !0;
|
|
136
|
+
function ct() {
|
|
137
137
|
{
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
var
|
|
138
|
+
if (ce === 0) {
|
|
139
|
+
Fe = console.log, Oe = console.info, Me = console.warn, Ae = console.error, De = console.group, Ne = console.groupCollapsed, $e = console.groupEnd;
|
|
140
|
+
var n = {
|
|
141
141
|
configurable: !0,
|
|
142
142
|
enumerable: !0,
|
|
143
|
-
value:
|
|
143
|
+
value: qe,
|
|
144
144
|
writable: !0
|
|
145
145
|
};
|
|
146
146
|
Object.defineProperties(console, {
|
|
147
|
-
info:
|
|
148
|
-
log:
|
|
149
|
-
warn:
|
|
150
|
-
error:
|
|
151
|
-
group:
|
|
152
|
-
groupCollapsed:
|
|
153
|
-
groupEnd:
|
|
147
|
+
info: n,
|
|
148
|
+
log: n,
|
|
149
|
+
warn: n,
|
|
150
|
+
error: n,
|
|
151
|
+
group: n,
|
|
152
|
+
groupCollapsed: n,
|
|
153
|
+
groupEnd: n
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
ce++;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function lt() {
|
|
160
160
|
{
|
|
161
|
-
if (
|
|
162
|
-
var
|
|
161
|
+
if (ce--, ce === 0) {
|
|
162
|
+
var n = {
|
|
163
163
|
configurable: !0,
|
|
164
164
|
enumerable: !0,
|
|
165
165
|
writable: !0
|
|
166
166
|
};
|
|
167
167
|
Object.defineProperties(console, {
|
|
168
|
-
log: Y({},
|
|
169
|
-
value: Pe
|
|
170
|
-
}),
|
|
171
|
-
info: Y({}, i, {
|
|
168
|
+
log: Y({}, n, {
|
|
172
169
|
value: Fe
|
|
173
170
|
}),
|
|
174
|
-
|
|
175
|
-
value: we
|
|
176
|
-
}),
|
|
177
|
-
error: Y({}, i, {
|
|
171
|
+
info: Y({}, n, {
|
|
178
172
|
value: Oe
|
|
179
173
|
}),
|
|
180
|
-
|
|
174
|
+
warn: Y({}, n, {
|
|
181
175
|
value: Me
|
|
182
176
|
}),
|
|
183
|
-
|
|
177
|
+
error: Y({}, n, {
|
|
184
178
|
value: Ae
|
|
185
179
|
}),
|
|
186
|
-
|
|
180
|
+
group: Y({}, n, {
|
|
181
|
+
value: De
|
|
182
|
+
}),
|
|
183
|
+
groupCollapsed: Y({}, n, {
|
|
187
184
|
value: Ne
|
|
185
|
+
}),
|
|
186
|
+
groupEnd: Y({}, n, {
|
|
187
|
+
value: $e
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
|
|
191
|
+
ce < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
var
|
|
195
|
-
function
|
|
194
|
+
var be = I.ReactCurrentDispatcher, Ce;
|
|
195
|
+
function me(n, g, f) {
|
|
196
196
|
{
|
|
197
|
-
if (
|
|
197
|
+
if (Ce === void 0)
|
|
198
198
|
try {
|
|
199
199
|
throw Error();
|
|
200
|
-
} catch (
|
|
201
|
-
var S =
|
|
202
|
-
|
|
200
|
+
} catch (j) {
|
|
201
|
+
var S = j.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
+
Ce = S && S[1] || "";
|
|
203
203
|
}
|
|
204
204
|
return `
|
|
205
|
-
` +
|
|
205
|
+
` + Ce + n;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var Se = !1, fe;
|
|
209
209
|
{
|
|
210
|
-
var
|
|
211
|
-
|
|
210
|
+
var ot = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
fe = new ot();
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
if (!
|
|
213
|
+
function _e(n, g) {
|
|
214
|
+
if (!n || Se)
|
|
215
215
|
return "";
|
|
216
216
|
{
|
|
217
|
-
var f =
|
|
217
|
+
var f = fe.get(n);
|
|
218
218
|
if (f !== void 0)
|
|
219
219
|
return f;
|
|
220
220
|
}
|
|
221
221
|
var S;
|
|
222
|
-
|
|
223
|
-
var
|
|
222
|
+
Se = !0;
|
|
223
|
+
var j = Error.prepareStackTrace;
|
|
224
224
|
Error.prepareStackTrace = void 0;
|
|
225
225
|
var O;
|
|
226
|
-
O =
|
|
226
|
+
O = be.current, be.current = null, ct();
|
|
227
227
|
try {
|
|
228
228
|
if (g) {
|
|
229
|
-
var
|
|
229
|
+
var E = function() {
|
|
230
230
|
throw Error();
|
|
231
231
|
};
|
|
232
|
-
if (Object.defineProperty(
|
|
232
|
+
if (Object.defineProperty(E.prototype, "props", {
|
|
233
233
|
set: function() {
|
|
234
234
|
throw Error();
|
|
235
235
|
}
|
|
236
236
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
237
|
try {
|
|
238
|
-
Reflect.construct(
|
|
239
|
-
} catch (
|
|
240
|
-
S =
|
|
238
|
+
Reflect.construct(E, []);
|
|
239
|
+
} catch (X) {
|
|
240
|
+
S = X;
|
|
241
241
|
}
|
|
242
|
-
Reflect.construct(
|
|
242
|
+
Reflect.construct(n, [], E);
|
|
243
243
|
} else {
|
|
244
244
|
try {
|
|
245
|
-
|
|
246
|
-
} catch (
|
|
247
|
-
S =
|
|
245
|
+
E.call();
|
|
246
|
+
} catch (X) {
|
|
247
|
+
S = X;
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
n.call(E.prototype);
|
|
250
250
|
}
|
|
251
251
|
} else {
|
|
252
252
|
try {
|
|
253
253
|
throw Error();
|
|
254
|
-
} catch (
|
|
255
|
-
S =
|
|
254
|
+
} catch (X) {
|
|
255
|
+
S = X;
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
n();
|
|
258
258
|
}
|
|
259
|
-
} catch (
|
|
260
|
-
if (
|
|
261
|
-
for (var
|
|
259
|
+
} catch (X) {
|
|
260
|
+
if (X && S && typeof X.stack == "string") {
|
|
261
|
+
for (var w = X.stack.split(`
|
|
262
262
|
`), V = S.stack.split(`
|
|
263
|
-
`),
|
|
263
|
+
`), q = w.length - 1, _ = V.length - 1; q >= 1 && _ >= 0 && w[q] !== V[_]; )
|
|
264
264
|
_--;
|
|
265
|
-
for (;
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
265
|
+
for (; q >= 1 && _ >= 0; q--, _--)
|
|
266
|
+
if (w[q] !== V[_]) {
|
|
267
|
+
if (q !== 1 || _ !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
269
|
+
if (q--, _--, _ < 0 || w[q] !== V[_]) {
|
|
270
270
|
var z = `
|
|
271
|
-
` +
|
|
272
|
-
return
|
|
271
|
+
` + w[q].replace(" at new ", " at ");
|
|
272
|
+
return n.displayName && z.includes("<anonymous>") && (z = z.replace("<anonymous>", n.displayName)), typeof n == "function" && fe.set(n, z), z;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (q >= 1 && _ >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} finally {
|
|
279
|
-
|
|
279
|
+
Se = !1, be.current = O, lt(), Error.prepareStackTrace = j;
|
|
280
280
|
}
|
|
281
|
-
var ae =
|
|
282
|
-
return typeof
|
|
281
|
+
var ae = n ? n.displayName || n.name : "", Ze = ae ? me(ae) : "";
|
|
282
|
+
return typeof n == "function" && fe.set(n, Ze), Ze;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function ht(n, g, f) {
|
|
285
|
+
return _e(n, !1);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
var g =
|
|
287
|
+
function ut(n) {
|
|
288
|
+
var g = n.prototype;
|
|
289
289
|
return !!(g && g.isReactComponent);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
if (
|
|
291
|
+
function ve(n, g, f) {
|
|
292
|
+
if (n == null)
|
|
293
293
|
return "";
|
|
294
|
-
if (typeof
|
|
295
|
-
return
|
|
296
|
-
if (typeof
|
|
297
|
-
return
|
|
298
|
-
switch (
|
|
294
|
+
if (typeof n == "function")
|
|
295
|
+
return _e(n, ut(n));
|
|
296
|
+
if (typeof n == "string")
|
|
297
|
+
return me(n);
|
|
298
|
+
switch (n) {
|
|
299
299
|
case d:
|
|
300
|
-
return
|
|
300
|
+
return me("Suspense");
|
|
301
301
|
case p:
|
|
302
|
-
return
|
|
302
|
+
return me("SuspenseList");
|
|
303
303
|
}
|
|
304
|
-
if (typeof
|
|
305
|
-
switch (
|
|
306
|
-
case
|
|
307
|
-
return
|
|
304
|
+
if (typeof n == "object")
|
|
305
|
+
switch (n.$$typeof) {
|
|
306
|
+
case u:
|
|
307
|
+
return ht(n.render);
|
|
308
308
|
case v:
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
var S =
|
|
309
|
+
return ve(n.type, g, f);
|
|
310
|
+
case y: {
|
|
311
|
+
var S = n, j = S._payload, O = S._init;
|
|
312
312
|
try {
|
|
313
|
-
return
|
|
313
|
+
return ve(O(j), g, f);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
return "";
|
|
319
319
|
}
|
|
320
|
-
var
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
323
|
-
var g =
|
|
324
|
-
|
|
320
|
+
var ye = Object.prototype.hasOwnProperty, He = {}, We = I.ReactDebugCurrentFrame;
|
|
321
|
+
function xe(n) {
|
|
322
|
+
if (n) {
|
|
323
|
+
var g = n._owner, f = ve(n.type, n._source, g ? g.type : null);
|
|
324
|
+
We.setExtraStackFrame(f);
|
|
325
325
|
} else
|
|
326
|
-
|
|
326
|
+
We.setExtraStackFrame(null);
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function dt(n, g, f, S, j) {
|
|
329
329
|
{
|
|
330
|
-
var O = Function.call.bind(
|
|
331
|
-
for (var
|
|
332
|
-
if (O(
|
|
333
|
-
var
|
|
330
|
+
var O = Function.call.bind(ye);
|
|
331
|
+
for (var E in n)
|
|
332
|
+
if (O(n, E)) {
|
|
333
|
+
var w = void 0;
|
|
334
334
|
try {
|
|
335
|
-
if (typeof
|
|
336
|
-
var V = Error((S || "React class") + ": " + f + " type `" +
|
|
335
|
+
if (typeof n[E] != "function") {
|
|
336
|
+
var V = Error((S || "React class") + ": " + f + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw V.name = "Invariant Violation", V;
|
|
338
338
|
}
|
|
339
|
-
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
339
|
+
w = n[E](g, E, S, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (q) {
|
|
341
|
+
w = q;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
w && !(w instanceof Error) && (xe(j), L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", S || "React class", f, E, typeof w), xe(null)), w instanceof Error && !(w.message in He) && (He[w.message] = !0, xe(j), L("Failed %s type: %s", f, w.message), xe(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
349
|
-
return
|
|
347
|
+
var gt = Array.isArray;
|
|
348
|
+
function Le(n) {
|
|
349
|
+
return gt(n);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function pt(n) {
|
|
352
352
|
{
|
|
353
|
-
var g = typeof Symbol == "function" && Symbol.toStringTag, f = g &&
|
|
353
|
+
var g = typeof Symbol == "function" && Symbol.toStringTag, f = g && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
354
354
|
return f;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function mt(n) {
|
|
358
358
|
try {
|
|
359
|
-
return
|
|
359
|
+
return Be(n), !1;
|
|
360
360
|
} catch {
|
|
361
361
|
return !0;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
function
|
|
365
|
-
return "" +
|
|
364
|
+
function Be(n) {
|
|
365
|
+
return "" + n;
|
|
366
366
|
}
|
|
367
|
-
function
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
367
|
+
function Ve(n) {
|
|
368
|
+
if (mt(n))
|
|
369
|
+
return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pt(n)), Be(n);
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var le = I.ReactCurrentOwner, ft = {
|
|
372
372
|
key: !0,
|
|
373
373
|
ref: !0,
|
|
374
374
|
__self: !0,
|
|
375
375
|
__source: !0
|
|
376
|
-
},
|
|
376
|
+
}, Ue, Qe, Te;
|
|
377
377
|
Te = {};
|
|
378
|
-
function
|
|
379
|
-
if (
|
|
380
|
-
var g = Object.getOwnPropertyDescriptor(
|
|
378
|
+
function vt(n) {
|
|
379
|
+
if (ye.call(n, "ref")) {
|
|
380
|
+
var g = Object.getOwnPropertyDescriptor(n, "ref").get;
|
|
381
381
|
if (g && g.isReactWarning)
|
|
382
382
|
return !1;
|
|
383
383
|
}
|
|
384
|
-
return
|
|
384
|
+
return n.ref !== void 0;
|
|
385
385
|
}
|
|
386
|
-
function
|
|
387
|
-
if (
|
|
388
|
-
var g = Object.getOwnPropertyDescriptor(
|
|
386
|
+
function yt(n) {
|
|
387
|
+
if (ye.call(n, "key")) {
|
|
388
|
+
var g = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
389
389
|
if (g && g.isReactWarning)
|
|
390
390
|
return !1;
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return n.key !== void 0;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
if (typeof
|
|
396
|
-
var f =
|
|
397
|
-
Te[f] || (
|
|
394
|
+
function xt(n, g) {
|
|
395
|
+
if (typeof n.ref == "string" && le.current && g && le.current.stateNode !== g) {
|
|
396
|
+
var f = K(le.current.type);
|
|
397
|
+
Te[f] || (L('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', K(le.current.type), n.ref), Te[f] = !0);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function bt(n, g) {
|
|
401
401
|
{
|
|
402
402
|
var f = function() {
|
|
403
|
-
|
|
403
|
+
Ue || (Ue = !0, L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
404
404
|
};
|
|
405
|
-
f.isReactWarning = !0, Object.defineProperty(
|
|
405
|
+
f.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
406
406
|
get: f,
|
|
407
407
|
configurable: !0
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function Ct(n, g) {
|
|
412
412
|
{
|
|
413
413
|
var f = function() {
|
|
414
|
-
|
|
414
|
+
Qe || (Qe = !0, L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
|
|
415
415
|
};
|
|
416
|
-
f.isReactWarning = !0, Object.defineProperty(
|
|
416
|
+
f.isReactWarning = !0, Object.defineProperty(n, "ref", {
|
|
417
417
|
get: f,
|
|
418
418
|
configurable: !0
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
var
|
|
422
|
+
var St = function(n, g, f, S, j, O, E) {
|
|
423
|
+
var w = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: e,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
427
|
-
type:
|
|
427
|
+
type: n,
|
|
428
428
|
key: g,
|
|
429
429
|
ref: f,
|
|
430
|
-
props:
|
|
430
|
+
props: E,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
432
|
_owner: O
|
|
433
433
|
};
|
|
434
|
-
return
|
|
434
|
+
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !0,
|
|
438
438
|
value: !1
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(w, "_self", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
443
|
value: S
|
|
444
|
-
}), Object.defineProperty(
|
|
444
|
+
}), Object.defineProperty(w, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
|
-
value:
|
|
449
|
-
}), Object.freeze && (Object.freeze(
|
|
448
|
+
value: j
|
|
449
|
+
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
450
450
|
};
|
|
451
|
-
function
|
|
451
|
+
function Lt(n, g, f, S, j) {
|
|
452
452
|
{
|
|
453
|
-
var O,
|
|
454
|
-
f !== void 0 && (
|
|
453
|
+
var O, E = {}, w = null, V = null;
|
|
454
|
+
f !== void 0 && (Ve(f), w = "" + f), yt(g) && (Ve(g.key), w = "" + g.key), vt(g) && (V = g.ref, xt(g, j));
|
|
455
455
|
for (O in g)
|
|
456
|
-
|
|
457
|
-
if (
|
|
458
|
-
var
|
|
459
|
-
for (O in
|
|
460
|
-
|
|
456
|
+
ye.call(g, O) && !ft.hasOwnProperty(O) && (E[O] = g[O]);
|
|
457
|
+
if (n && n.defaultProps) {
|
|
458
|
+
var q = n.defaultProps;
|
|
459
|
+
for (O in q)
|
|
460
|
+
E[O] === void 0 && (E[O] = q[O]);
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
463
|
-
var _ = typeof
|
|
464
|
-
|
|
462
|
+
if (w || V) {
|
|
463
|
+
var _ = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
|
464
|
+
w && bt(E, _), V && Ct(E, _);
|
|
465
465
|
}
|
|
466
|
-
return
|
|
466
|
+
return St(n, w, V, j, S, le.current, E);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
function te(
|
|
471
|
-
if (
|
|
472
|
-
var g =
|
|
473
|
-
|
|
469
|
+
var ke = I.ReactCurrentOwner, Ke = I.ReactDebugCurrentFrame;
|
|
470
|
+
function te(n) {
|
|
471
|
+
if (n) {
|
|
472
|
+
var g = n._owner, f = ve(n.type, n._source, g ? g.type : null);
|
|
473
|
+
Ke.setExtraStackFrame(f);
|
|
474
474
|
} else
|
|
475
|
-
|
|
475
|
+
Ke.setExtraStackFrame(null);
|
|
476
476
|
}
|
|
477
477
|
var Re;
|
|
478
478
|
Re = !1;
|
|
479
|
-
function
|
|
480
|
-
return typeof
|
|
479
|
+
function we(n) {
|
|
480
|
+
return typeof n == "object" && n !== null && n.$$typeof === e;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function ze() {
|
|
483
483
|
{
|
|
484
|
-
if (
|
|
485
|
-
var
|
|
486
|
-
if (
|
|
484
|
+
if (ke.current) {
|
|
485
|
+
var n = K(ke.current.type);
|
|
486
|
+
if (n)
|
|
487
487
|
return `
|
|
488
488
|
|
|
489
|
-
Check the render method of \`` +
|
|
489
|
+
Check the render method of \`` + n + "`.";
|
|
490
490
|
}
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Tt(n) {
|
|
495
495
|
{
|
|
496
|
-
if (
|
|
497
|
-
var g =
|
|
496
|
+
if (n !== void 0) {
|
|
497
|
+
var g = n.fileName.replace(/^.*[\\\/]/, ""), f = n.lineNumber;
|
|
498
498
|
return `
|
|
499
499
|
|
|
500
500
|
Check your code at ` + g + ":" + f + ".";
|
|
@@ -502,12 +502,12 @@ Check your code at ` + g + ":" + f + ".";
|
|
|
502
502
|
return "";
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
var
|
|
506
|
-
function
|
|
505
|
+
var Je = {};
|
|
506
|
+
function kt(n) {
|
|
507
507
|
{
|
|
508
|
-
var g =
|
|
508
|
+
var g = ze();
|
|
509
509
|
if (!g) {
|
|
510
|
-
var f = typeof
|
|
510
|
+
var f = typeof n == "string" ? n : n.displayName || n.name;
|
|
511
511
|
f && (g = `
|
|
512
512
|
|
|
513
513
|
Check the top-level render call using <` + f + ">.");
|
|
@@ -515,120 +515,120 @@ Check the top-level render call using <` + f + ">.");
|
|
|
515
515
|
return g;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Ye(n, g) {
|
|
519
519
|
{
|
|
520
|
-
if (!
|
|
520
|
+
if (!n._store || n._store.validated || n.key != null)
|
|
521
521
|
return;
|
|
522
|
-
|
|
523
|
-
var f =
|
|
524
|
-
if (
|
|
522
|
+
n._store.validated = !0;
|
|
523
|
+
var f = kt(g);
|
|
524
|
+
if (Je[f])
|
|
525
525
|
return;
|
|
526
|
-
|
|
526
|
+
Je[f] = !0;
|
|
527
527
|
var S = "";
|
|
528
|
-
|
|
528
|
+
n && n._owner && n._owner !== ke.current && (S = " It was passed a child from " + K(n._owner.type) + "."), te(n), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, S), te(null);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function Ge(n, g) {
|
|
532
532
|
{
|
|
533
|
-
if (typeof
|
|
533
|
+
if (typeof n != "object")
|
|
534
534
|
return;
|
|
535
|
-
if (
|
|
536
|
-
for (var f = 0; f <
|
|
537
|
-
var S =
|
|
538
|
-
|
|
535
|
+
if (Le(n))
|
|
536
|
+
for (var f = 0; f < n.length; f++) {
|
|
537
|
+
var S = n[f];
|
|
538
|
+
we(S) && Ye(S, g);
|
|
539
539
|
}
|
|
540
|
-
else if (
|
|
541
|
-
|
|
542
|
-
else if (
|
|
543
|
-
var
|
|
544
|
-
if (typeof
|
|
545
|
-
for (var O =
|
|
546
|
-
|
|
540
|
+
else if (we(n))
|
|
541
|
+
n._store && (n._store.validated = !0);
|
|
542
|
+
else if (n) {
|
|
543
|
+
var j = T(n);
|
|
544
|
+
if (typeof j == "function" && j !== n.entries)
|
|
545
|
+
for (var O = j.call(n), E; !(E = O.next()).done; )
|
|
546
|
+
we(E.value) && Ye(E.value, g);
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Rt(n) {
|
|
551
551
|
{
|
|
552
|
-
var g =
|
|
552
|
+
var g = n.type;
|
|
553
553
|
if (g == null || typeof g == "string")
|
|
554
554
|
return;
|
|
555
555
|
var f;
|
|
556
556
|
if (typeof g == "function")
|
|
557
557
|
f = g.propTypes;
|
|
558
|
-
else if (typeof g == "object" && (g.$$typeof ===
|
|
558
|
+
else if (typeof g == "object" && (g.$$typeof === u || // Note: Memo only checks outer props here.
|
|
559
559
|
// Inner props are checked in the reconciler.
|
|
560
560
|
g.$$typeof === v))
|
|
561
561
|
f = g.propTypes;
|
|
562
562
|
else
|
|
563
563
|
return;
|
|
564
564
|
if (f) {
|
|
565
|
-
var S =
|
|
566
|
-
|
|
565
|
+
var S = K(g);
|
|
566
|
+
dt(f, n.props, "prop", S, n);
|
|
567
567
|
} else if (g.PropTypes !== void 0 && !Re) {
|
|
568
568
|
Re = !0;
|
|
569
|
-
var
|
|
570
|
-
|
|
569
|
+
var j = K(g);
|
|
570
|
+
L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
571
571
|
}
|
|
572
|
-
typeof g.getDefaultProps == "function" && !g.getDefaultProps.isReactClassApproved &&
|
|
572
|
+
typeof g.getDefaultProps == "function" && !g.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function wt(n) {
|
|
576
576
|
{
|
|
577
|
-
for (var g = Object.keys(
|
|
577
|
+
for (var g = Object.keys(n.props), f = 0; f < g.length; f++) {
|
|
578
578
|
var S = g[f];
|
|
579
579
|
if (S !== "children" && S !== "key") {
|
|
580
|
-
te(
|
|
580
|
+
te(n), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), te(null);
|
|
581
581
|
break;
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
|
|
584
|
+
n.ref !== null && (te(n), L("Invalid attribute `ref` supplied to `React.Fragment`."), te(null));
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function Xe(n, g, f, S, j, O) {
|
|
588
588
|
{
|
|
589
|
-
var
|
|
590
|
-
if (!
|
|
591
|
-
var
|
|
592
|
-
(
|
|
593
|
-
var V =
|
|
594
|
-
V ?
|
|
595
|
-
var
|
|
596
|
-
|
|
589
|
+
var E = $(n);
|
|
590
|
+
if (!E) {
|
|
591
|
+
var w = "";
|
|
592
|
+
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
593
|
+
var V = Tt(j);
|
|
594
|
+
V ? w += V : w += ze();
|
|
595
|
+
var q;
|
|
596
|
+
n === null ? q = "null" : Le(n) ? q = "array" : n !== void 0 && n.$$typeof === e ? (q = "<" + (K(n.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : q = typeof n, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", q, w);
|
|
597
597
|
}
|
|
598
|
-
var _ =
|
|
598
|
+
var _ = Lt(n, g, f, j, O);
|
|
599
599
|
if (_ == null)
|
|
600
600
|
return _;
|
|
601
|
-
if (
|
|
601
|
+
if (E) {
|
|
602
602
|
var z = g.children;
|
|
603
603
|
if (z !== void 0)
|
|
604
604
|
if (S)
|
|
605
|
-
if (
|
|
605
|
+
if (Le(z)) {
|
|
606
606
|
for (var ae = 0; ae < z.length; ae++)
|
|
607
|
-
|
|
607
|
+
Ge(z[ae], n);
|
|
608
608
|
Object.freeze && Object.freeze(z);
|
|
609
609
|
} else
|
|
610
|
-
|
|
610
|
+
L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
611
611
|
else
|
|
612
|
-
|
|
612
|
+
Ge(z, n);
|
|
613
613
|
}
|
|
614
|
-
return
|
|
614
|
+
return n === s ? wt(_) : Rt(_), _;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
function
|
|
618
|
-
return
|
|
617
|
+
function Et(n, g, f) {
|
|
618
|
+
return Xe(n, g, f, !0);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
return
|
|
620
|
+
function It(n, g, f) {
|
|
621
|
+
return Xe(n, g, f, !1);
|
|
622
622
|
}
|
|
623
|
-
var
|
|
624
|
-
|
|
625
|
-
}()),
|
|
623
|
+
var Pt = It, jt = Et;
|
|
624
|
+
he.Fragment = s, he.jsx = Pt, he.jsxs = jt;
|
|
625
|
+
}()), he;
|
|
626
626
|
}
|
|
627
|
-
process.env.NODE_ENV === "production" ?
|
|
628
|
-
var o =
|
|
629
|
-
class
|
|
627
|
+
process.env.NODE_ENV === "production" ? Pe.exports = Ft() : Pe.exports = Ot();
|
|
628
|
+
var o = Pe.exports, Mt = Object.defineProperty, At = (i, e, t) => e in i ? Mt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, h = (i, e, t) => (At(i, typeof e != "symbol" ? e + "" : e, t), t), B = /* @__PURE__ */ ((i) => (i[i.mustache = 0] = "mustache", i[i.vue = 1] = "vue", i[i.react = 2] = "react", i[i.angular = 3] = "angular", i))(B || {});
|
|
629
|
+
class Dt {
|
|
630
630
|
constructor(e) {
|
|
631
|
-
|
|
631
|
+
h(this, "dataLayer"), this.dataLayer = e;
|
|
632
632
|
}
|
|
633
633
|
get currentPage() {
|
|
634
634
|
var e;
|
|
@@ -639,8 +639,7 @@ class Mt {
|
|
|
639
639
|
return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.totalResultsValue) || 0;
|
|
640
640
|
}
|
|
641
641
|
get resultsPerPage() {
|
|
642
|
-
|
|
643
|
-
return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.recordsPerPageValue) || 0;
|
|
642
|
+
return this.dataLayer.searchObject.itemsPerPage || 0;
|
|
644
643
|
}
|
|
645
644
|
get startResultIndex() {
|
|
646
645
|
var e;
|
|
@@ -657,7 +656,10 @@ class Mt {
|
|
|
657
656
|
}
|
|
658
657
|
get isLastPage() {
|
|
659
658
|
var e;
|
|
660
|
-
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page)
|
|
659
|
+
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) >= Math.ceil(this.totalResults / this.resultsPerPage);
|
|
660
|
+
}
|
|
661
|
+
get percentageOfResultsLoaded() {
|
|
662
|
+
return this.endResultIndex / this.totalResults * 100;
|
|
661
663
|
}
|
|
662
664
|
get results() {
|
|
663
665
|
return this.dataLayer.searchResults ?? [];
|
|
@@ -670,26 +672,38 @@ class Mt {
|
|
|
670
672
|
var e;
|
|
671
673
|
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.query) || "";
|
|
672
674
|
}
|
|
675
|
+
get getAnswerData() {
|
|
676
|
+
return this.dataLayer.getAnswerData || "";
|
|
677
|
+
}
|
|
678
|
+
get shouldShowAnswer() {
|
|
679
|
+
return this.isFirstPage && this.dataLayer.getAnswerData !== "" && this.dataLayer.searchObject.query !== "*" && this.dataLayer.searchObject.facets.length === 0;
|
|
680
|
+
}
|
|
673
681
|
get searchTerm() {
|
|
674
682
|
var e, t;
|
|
675
683
|
return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.autoCorrectedQuery) || ((t = this.dataLayer.searchObject) == null ? void 0 : t.query) || "";
|
|
676
684
|
}
|
|
685
|
+
get searchingEverything() {
|
|
686
|
+
return this.searchTerm === "*";
|
|
687
|
+
}
|
|
688
|
+
get isInfiniteScroll() {
|
|
689
|
+
return this.dataLayer.isInfiniteScroll ?? !1;
|
|
690
|
+
}
|
|
677
691
|
get searchExecuted() {
|
|
678
|
-
var e, t,
|
|
679
|
-
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.query) !== void 0 && ((t = this.dataLayer.searchObject) == null ? void 0 : t.query) !== "undefined" && ((
|
|
692
|
+
var e, t, s;
|
|
693
|
+
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.query) !== void 0 && ((t = this.dataLayer.searchObject) == null ? void 0 : t.query) !== "undefined" && ((s = this.dataLayer.searchObject) == null ? void 0 : s.query) !== "";
|
|
680
694
|
}
|
|
681
695
|
get selectedFacets() {
|
|
682
696
|
var e;
|
|
683
697
|
const t = this.dataLayer.searchFacetsCached ?? this.dataLayer.searchFacets;
|
|
684
|
-
return t ? (((e = this.dataLayer.searchObject) == null ? void 0 : e.facets) ?? []).map((
|
|
685
|
-
const
|
|
698
|
+
return t ? (((e = this.dataLayer.searchObject) == null ? void 0 : e.facets) ?? []).map((s) => {
|
|
699
|
+
const a = s.name, r = s.value, c = t.find((l) => l.name === a);
|
|
686
700
|
if (c) {
|
|
687
|
-
const l = c.values.find((
|
|
701
|
+
const l = c.values.find((u) => u.type === "range" ? !1 : u.type === "checkbox" ? '"' + u.value + '"' === r : !1);
|
|
688
702
|
if (l)
|
|
689
703
|
return l;
|
|
690
704
|
}
|
|
691
705
|
return null;
|
|
692
|
-
}).filter((
|
|
706
|
+
}).filter((s) => s !== null) : [];
|
|
693
707
|
}
|
|
694
708
|
get relatedSearches() {
|
|
695
709
|
const e = this.dataLayer.searchRelatedSearches ?? [];
|
|
@@ -713,36 +727,41 @@ class Mt {
|
|
|
713
727
|
originalQuery: this.originalQuery,
|
|
714
728
|
selectedFacets: this.selectedFacets,
|
|
715
729
|
searchExecuted: this.searchExecuted,
|
|
730
|
+
searchingEverything: this.searchingEverything,
|
|
716
731
|
relatedSearches: this.relatedSearches,
|
|
717
732
|
hasRelatedSearches: this.relatedSearches.length > 0,
|
|
718
733
|
externalPromotions: this.externalPromotions,
|
|
719
734
|
hasExternalPromotions: this.externalPromotions.length > 0,
|
|
720
735
|
hasResults: this.results.length > 0,
|
|
721
|
-
hasResultsOrExternalPromotions: this.results.length > 0 || this.externalPromotions.length > 0
|
|
736
|
+
hasResultsOrExternalPromotions: this.results.length > 0 || this.externalPromotions.length > 0,
|
|
737
|
+
answer: this.getAnswerData,
|
|
738
|
+
shouldShowAnswer: this.shouldShowAnswer,
|
|
739
|
+
isInfiniteScroll: this.isInfiniteScroll,
|
|
740
|
+
percentageOfResultsLoaded: this.percentageOfResultsLoaded
|
|
722
741
|
};
|
|
723
742
|
}
|
|
724
743
|
get trackingData() {
|
|
725
|
-
var e, t,
|
|
744
|
+
var e, t, s, a;
|
|
726
745
|
return {
|
|
727
746
|
searchTerm: this.dataLayer.searchTerm !== "undefined" ? this.dataLayer.searchTerm : "",
|
|
728
747
|
trackApiKey: ((e = this.dataLayer.searchstaxConfig) == null ? void 0 : e.trackApiKey) ?? "",
|
|
729
748
|
session: this.dataLayer.sessionId,
|
|
730
749
|
language: this.dataLayer.language,
|
|
731
750
|
recordsPerPage: ((t = this.dataLayer.searchResultsMetadata) == null ? void 0 : t.recordsPerPageValue) ?? 0,
|
|
732
|
-
totalResults: ((
|
|
751
|
+
totalResults: ((s = this.dataLayer.searchResultsMetadata) == null ? void 0 : s.totalResultsValue) ?? 0,
|
|
733
752
|
currentPage: this.dataLayer.currentPage,
|
|
734
|
-
latencyVal: ((
|
|
753
|
+
latencyVal: ((a = this.dataLayer.searchResultsMetadata) == null ? void 0 : a.latency) ?? 0
|
|
735
754
|
};
|
|
736
755
|
}
|
|
737
756
|
}
|
|
738
757
|
class J {
|
|
739
758
|
static deepEqual(e, t) {
|
|
740
|
-
const
|
|
741
|
-
if (
|
|
759
|
+
const s = Object.keys(e), a = Object.keys(t);
|
|
760
|
+
if (s.length !== a.length)
|
|
742
761
|
return !1;
|
|
743
|
-
for (const r of
|
|
744
|
-
const c = e[r], l = t[r],
|
|
745
|
-
if (
|
|
762
|
+
for (const r of s) {
|
|
763
|
+
const c = e[r], l = t[r], u = this.isObject(c) && this.isObject(l);
|
|
764
|
+
if (u && !this.deepEqual(c, l) || !u && c !== l)
|
|
746
765
|
return !1;
|
|
747
766
|
}
|
|
748
767
|
return !0;
|
|
@@ -751,9 +770,9 @@ class J {
|
|
|
751
770
|
return e != null && typeof e == "object";
|
|
752
771
|
}
|
|
753
772
|
}
|
|
754
|
-
class
|
|
773
|
+
class D {
|
|
755
774
|
constructor(e) {
|
|
756
|
-
|
|
775
|
+
h(this, "value"), h(this, "observers", []), this.value = e, this.observers = [];
|
|
757
776
|
}
|
|
758
777
|
subscribe(e) {
|
|
759
778
|
this.observers.push(e), e(this.value);
|
|
@@ -772,21 +791,71 @@ class q {
|
|
|
772
791
|
this.observers.forEach((e) => e(this.value));
|
|
773
792
|
}
|
|
774
793
|
}
|
|
794
|
+
class Ee {
|
|
795
|
+
static getOrSetCookie(e) {
|
|
796
|
+
let t = this.getCookie(e);
|
|
797
|
+
return t == null && (t = this.makeid(25), this.setCookie(e, t, {
|
|
798
|
+
secure: !0,
|
|
799
|
+
"max-age": 3600
|
|
800
|
+
})), t;
|
|
801
|
+
}
|
|
802
|
+
static deleteCookie(e) {
|
|
803
|
+
this.getCookie(e) && this.setCookie(e, "", {
|
|
804
|
+
secure: !0,
|
|
805
|
+
"max-age": -1
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
static makeid(e) {
|
|
809
|
+
let t = "";
|
|
810
|
+
const s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", a = s.length;
|
|
811
|
+
for (let r = 0; r < e; r++)
|
|
812
|
+
t += s.charAt(Math.floor(Math.random() * a));
|
|
813
|
+
return t;
|
|
814
|
+
}
|
|
815
|
+
static getCookie(e) {
|
|
816
|
+
const t = document.cookie.match(
|
|
817
|
+
new RegExp(
|
|
818
|
+
"(?:^|; )" + e.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"
|
|
819
|
+
)
|
|
820
|
+
);
|
|
821
|
+
return t ? decodeURIComponent(t[1]) : void 0;
|
|
822
|
+
}
|
|
823
|
+
static setCookie(e, t, s) {
|
|
824
|
+
const a = { path: "/", ...s };
|
|
825
|
+
s.expires instanceof Date && (a.expires = s.expires.toUTCString());
|
|
826
|
+
let r = encodeURIComponent(e) + "=" + encodeURIComponent(t);
|
|
827
|
+
for (const c in a) {
|
|
828
|
+
r += "; " + c;
|
|
829
|
+
const l = a[c];
|
|
830
|
+
l !== !0 && (r += "=" + l);
|
|
831
|
+
}
|
|
832
|
+
document.cookie = r;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
775
835
|
class Z {
|
|
776
836
|
static removeXSSRiskyTags(e) {
|
|
777
|
-
var t = "script|style|iframe|object|embed|form|input|button",
|
|
778
|
-
return e ? e.replace(
|
|
837
|
+
var t = "script|style|iframe|object|embed|form|input|button", s = new RegExp("</?(" + t + ")(\\s[^>]*)?>", "gi");
|
|
838
|
+
return e ? e.replace(s, "") : "";
|
|
779
839
|
}
|
|
780
840
|
}
|
|
781
|
-
class
|
|
841
|
+
class Nt {
|
|
782
842
|
constructor(e) {
|
|
783
|
-
|
|
843
|
+
h(this, "$searchTermChange", new D("")), h(this, "$loadingChange", new D(!1)), h(this, "$searchResults", new D(null)), h(this, "$searchResultsMetadata", new D(null)), h(this, "$searchAutosuggest", new D(null)), h(this, "$searchFacets", new D(null)), h(this, "$searchFacetsCached", new D(null)), h(this, "$searchstaxConfig", new D(null)), h(this, "$autosuggestResults", new D(null)), h(this, "$searchObject", new D({
|
|
784
844
|
query: "",
|
|
845
|
+
itemsPerPage: null,
|
|
785
846
|
page: 99999999,
|
|
786
847
|
order: "",
|
|
787
848
|
facets: [],
|
|
788
849
|
additionalProps: []
|
|
789
|
-
})),
|
|
850
|
+
})), h(this, "$searchRelatedSearches", new D(null)), h(this, "$searchInputConfig", new D(null)), h(this, "$searchExternalPromotions", new D(null)), h(this, "$facetsTemplateData", new D(null)), h(this, "$selectedFacetsTemplateData", new D(null)), h(this, "$paginationData", new D(null)), h(this, "$searchFeedbackData", new D(null)), h(this, "$searchSortingData", new D(null)), h(this, "$searchRelatedSearchesData", new D(null)), h(this, "$searchExternalPromotionsData", new D(null)), h(this, "$cookiesDisabled", new D(null)), h(this, "$answer", new D("")), h(this, "$language", new D("en")), h(this, "currentPageValue", 1), h(this, "isAnswerWidgetCreatedValue", !1), h(this, "renderingEngineValue", B.mustache), h(this, "parsedData", new Dt(this)), h(this, "sessionId"), h(this, "autoCorrect", !0), h(this, "forceNotCorrect", !1), h(this, "lastSearchValue", ""), h(this, "turnAIAnswerGenerationOn", !1), h(this, "isInfiniteScroll", !1), this.sessionId = e, this.cookieHandlingCallback(), this.$cookiesDisabled.subscribe(() => {
|
|
851
|
+
this.cookieHandlingCallback();
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
cookieHandlingCallback() {
|
|
855
|
+
this.cookiesDisabled ? (Ee.deleteCookie(this.sessionId), Ee.deleteCookie("ms_visitorid")) : Ee.getOrSetCookie(this.sessionId);
|
|
856
|
+
}
|
|
857
|
+
setIsInfiniteScroll(e) {
|
|
858
|
+
this.isInfiniteScroll = e;
|
|
790
859
|
}
|
|
791
860
|
setSearchTerm(e) {
|
|
792
861
|
this.$searchTermChange.setValue(Z.removeXSSRiskyTags(e));
|
|
@@ -797,6 +866,9 @@ class At {
|
|
|
797
866
|
setCurrentPage(e) {
|
|
798
867
|
this.currentPageValue = e;
|
|
799
868
|
}
|
|
869
|
+
setIsAnswerWidgetCreated(e) {
|
|
870
|
+
this.isAnswerWidgetCreatedValue = e;
|
|
871
|
+
}
|
|
800
872
|
setLoading(e) {
|
|
801
873
|
this.$loadingChange.setValue(e);
|
|
802
874
|
}
|
|
@@ -810,9 +882,9 @@ class At {
|
|
|
810
882
|
this.$searchAutosuggest.setValue(e);
|
|
811
883
|
}
|
|
812
884
|
setSearchObject(e) {
|
|
813
|
-
var t,
|
|
814
|
-
let
|
|
815
|
-
(
|
|
885
|
+
var t, s;
|
|
886
|
+
let a = e;
|
|
887
|
+
(s = (t = this.searchstaxConfig) == null ? void 0 : t.hooks) != null && s.beforeSearch && a && (a = this.searchstaxConfig.hooks.beforeSearch(a)), a && (!J.deepEqual(a, this.searchObject ?? {}) || this.forceNotCorrect) && this.$searchObject.setValue(a);
|
|
816
888
|
}
|
|
817
889
|
setSearchFacets(e) {
|
|
818
890
|
J.deepEqual(e, this.searchFacets ?? []) || this.$searchFacets.setValue(e);
|
|
@@ -859,6 +931,15 @@ class At {
|
|
|
859
931
|
setExternalPromotionsData(e) {
|
|
860
932
|
this.$searchExternalPromotionsData.setValue(e);
|
|
861
933
|
}
|
|
934
|
+
setCookiesDisabled(e) {
|
|
935
|
+
this.$cookiesDisabled.setValue(e);
|
|
936
|
+
}
|
|
937
|
+
setAnswerData(e) {
|
|
938
|
+
this.$answer.setValue(e);
|
|
939
|
+
}
|
|
940
|
+
get getAnswerData() {
|
|
941
|
+
return this.$answer.getValue();
|
|
942
|
+
}
|
|
862
943
|
get searchstaxConfig() {
|
|
863
944
|
return this.$searchstaxConfig.getValue();
|
|
864
945
|
}
|
|
@@ -886,6 +967,9 @@ class At {
|
|
|
886
967
|
get currentPage() {
|
|
887
968
|
return this.currentPageValue;
|
|
888
969
|
}
|
|
970
|
+
get isAnswerWidgetCreated() {
|
|
971
|
+
return this.isAnswerWidgetCreatedValue;
|
|
972
|
+
}
|
|
889
973
|
get renderingEngine() {
|
|
890
974
|
return this.renderingEngineValue;
|
|
891
975
|
}
|
|
@@ -904,6 +988,9 @@ class At {
|
|
|
904
988
|
get searchInputConfig() {
|
|
905
989
|
return this.$searchInputConfig.getValue();
|
|
906
990
|
}
|
|
991
|
+
get answerConfig() {
|
|
992
|
+
return this.$answer.getValue();
|
|
993
|
+
}
|
|
907
994
|
get autosuggestResults() {
|
|
908
995
|
return this.$autosuggestResults.getValue();
|
|
909
996
|
}
|
|
@@ -928,10 +1015,13 @@ class At {
|
|
|
928
1015
|
get searchExternalPromotionsData() {
|
|
929
1016
|
return this.$searchExternalPromotionsData.getValue();
|
|
930
1017
|
}
|
|
1018
|
+
get cookiesDisabled() {
|
|
1019
|
+
return (this.$cookiesDisabled.getValue() ?? !1) || !navigator.cookieEnabled;
|
|
1020
|
+
}
|
|
931
1021
|
}
|
|
932
|
-
class
|
|
1022
|
+
class ue {
|
|
933
1023
|
static combineResultsWithMetadata(e) {
|
|
934
|
-
const t = [],
|
|
1024
|
+
const t = [], s = parseInt(e.response.start + "") - 1, a = parseInt(e.responseHeader.params.rows);
|
|
935
1025
|
return e.response.docs.forEach((r, c) => {
|
|
936
1026
|
const l = {
|
|
937
1027
|
custom: null,
|
|
@@ -940,7 +1030,7 @@ class he {
|
|
|
940
1030
|
r,
|
|
941
1031
|
e
|
|
942
1032
|
) ?? "",
|
|
943
|
-
position:
|
|
1033
|
+
position: s * a + 1 + c,
|
|
944
1034
|
ribbon: this.doesMapExist("ribbon", e) ? this.getValueByKey("ribbon", r, e) : null,
|
|
945
1035
|
paths: this.doesMapExist("paths", e) ? this.getValueByKey("paths", r, e) : null,
|
|
946
1036
|
url: this.doesMapExist("url", e) ? this.getValueByKey("url", r, e) : null,
|
|
@@ -958,23 +1048,23 @@ class he {
|
|
|
958
1048
|
}
|
|
959
1049
|
static extractFacets(e) {
|
|
960
1050
|
const t = [];
|
|
961
|
-
for (const
|
|
962
|
-
let
|
|
963
|
-
if (
|
|
964
|
-
const r = e.facet_counts.facet_fields[
|
|
1051
|
+
for (const s of e.metadata.facets) {
|
|
1052
|
+
let a = { values: [] };
|
|
1053
|
+
if (a.name = s.name, a.label = s.label, s.name in e.facet_counts.facet_fields) {
|
|
1054
|
+
const r = e.facet_counts.facet_fields[s.name];
|
|
965
1055
|
for (let c = 0; c < r.length; c += 2) {
|
|
966
1056
|
const l = {};
|
|
967
|
-
l.value = r[c], l.parentName =
|
|
1057
|
+
l.value = r[c], l.parentName = a.name, l.count = r[c + 1], l.type = "checkbox", a.values.push(l);
|
|
968
1058
|
}
|
|
969
1059
|
}
|
|
970
|
-
|
|
1060
|
+
a.values.length > 0 && t.push(a);
|
|
971
1061
|
}
|
|
972
1062
|
return t;
|
|
973
1063
|
}
|
|
974
1064
|
static extractSearchResultsMetadata(e) {
|
|
975
|
-
var t,
|
|
1065
|
+
var t, s, a, r;
|
|
976
1066
|
let c = "";
|
|
977
|
-
return c = ((r = (
|
|
1067
|
+
return c = ((r = (a = (s = (t = e == null ? void 0 : e.spellcheck) == null ? void 0 : t.suggestions) == null ? void 0 : s[0]) == null ? void 0 : a.suggestion) == null ? void 0 : r[0]) ?? "", typeof c != "string" && (c = (c == null ? void 0 : c.word) ?? ""), {
|
|
978
1068
|
recordsPerPageValue: parseInt(e.responseHeader.params.rows),
|
|
979
1069
|
startDocVal: parseInt(e.response.start + ""),
|
|
980
1070
|
totalResultsValue: parseInt(e.response.numFound + ""),
|
|
@@ -986,9 +1076,9 @@ class he {
|
|
|
986
1076
|
};
|
|
987
1077
|
}
|
|
988
1078
|
static getImpressions(e) {
|
|
989
|
-
const t = [],
|
|
990
|
-
for (const
|
|
991
|
-
const r = a
|
|
1079
|
+
const t = [], s = this.combineResultsWithMetadata(e);
|
|
1080
|
+
for (const a in s) {
|
|
1081
|
+
const r = s[a], c = {};
|
|
992
1082
|
c.cDocId = this.getDataForAnalytics(r.uniqueId), r.title && (c.cDocTitle = this.getDataForAnalytics(r.title)), c.position = r.position, t.push(c);
|
|
993
1083
|
}
|
|
994
1084
|
return t;
|
|
@@ -997,120 +1087,121 @@ class he {
|
|
|
997
1087
|
return e !== null ? typeof e > "u" ? "" : typeof e == "string" ? e : typeof e.join < "u" ? e[0] : e : "";
|
|
998
1088
|
}
|
|
999
1089
|
static findResultByUniqueId(e, t) {
|
|
1000
|
-
return t.find((
|
|
1090
|
+
return t.find((s) => s.uniqueId === e) ?? null;
|
|
1001
1091
|
}
|
|
1002
1092
|
static getUnmappedFields(e, t) {
|
|
1003
|
-
const
|
|
1093
|
+
const s = t.metadata.results.filter((r) => r.result_card === "").map((r) => r.name), a = [];
|
|
1004
1094
|
for (const r of Object.keys(e))
|
|
1005
|
-
if (
|
|
1095
|
+
if (s.indexOf(r) !== -1) {
|
|
1006
1096
|
const c = Array.isArray(e[r]) ? e[r].join(", ") : e[r];
|
|
1007
|
-
|
|
1097
|
+
a.push({
|
|
1008
1098
|
key: r,
|
|
1009
1099
|
value: c,
|
|
1010
1100
|
isImage: this.checkIfImage(e[r])
|
|
1011
1101
|
});
|
|
1012
1102
|
}
|
|
1013
|
-
return
|
|
1103
|
+
return a;
|
|
1014
1104
|
}
|
|
1015
1105
|
static checkIfImage(e) {
|
|
1016
1106
|
return e === void 0 ? !1 : typeof e != "string" ? Array.isArray(e) && e[0] ? /\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e[0]) : !1 : /\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e);
|
|
1017
1107
|
}
|
|
1018
1108
|
static getAllFields(e, t) {
|
|
1019
|
-
const
|
|
1109
|
+
const s = t.metadata.results.map((r) => r.name), a = [];
|
|
1020
1110
|
for (const r of Object.keys(e))
|
|
1021
|
-
|
|
1111
|
+
s.indexOf(r) !== -1 && a.push({
|
|
1022
1112
|
key: r,
|
|
1023
1113
|
value: e[r],
|
|
1024
1114
|
isImage: this.checkIfImage(e[r])
|
|
1025
1115
|
});
|
|
1026
|
-
return
|
|
1116
|
+
return a;
|
|
1027
1117
|
}
|
|
1028
1118
|
static doesMapExist(e, t) {
|
|
1029
|
-
return t.metadata.results.find((
|
|
1119
|
+
return t.metadata.results.find((s) => s.result_card === e) !== void 0;
|
|
1030
1120
|
}
|
|
1031
|
-
static getValueByKey(e, t,
|
|
1032
|
-
const
|
|
1121
|
+
static getValueByKey(e, t, s) {
|
|
1122
|
+
const a = s.metadata.results.find(
|
|
1033
1123
|
(c) => c.result_card === e
|
|
1034
1124
|
);
|
|
1035
|
-
if (
|
|
1125
|
+
if (a === void 0)
|
|
1036
1126
|
return null;
|
|
1037
|
-
const r = t[
|
|
1127
|
+
const r = t[a.name];
|
|
1038
1128
|
return r === void 0 ? null : typeof r == "string" ? r : Array.isArray(r) ? r.join(", ") : null;
|
|
1039
1129
|
}
|
|
1040
1130
|
}
|
|
1041
|
-
class
|
|
1131
|
+
class st {
|
|
1042
1132
|
constructor(e) {
|
|
1043
|
-
|
|
1133
|
+
h(this, "routeName", "searchstax"), h(this, "ignoredKeys", []), h(this, "queryStringHelper"), h(this, "titleParser"), e.routeName && (this.routeName = e.routeName), e.ignoredKeys && (this.ignoredKeys = e.ignoredKeys), e.title && (this.titleParser = e.title), this.queryStringHelper = new $t(this.routeName);
|
|
1044
1134
|
}
|
|
1045
1135
|
updateUrl(e) {
|
|
1046
1136
|
const t = this.searchObjectToUrl(e);
|
|
1047
|
-
let
|
|
1048
|
-
this.titleParser && (
|
|
1137
|
+
let s = document.title;
|
|
1138
|
+
this.titleParser && (s = this.titleParser(e)), document.title = s, window.location.href !== t && window.history.pushState({}, s, t);
|
|
1049
1139
|
}
|
|
1050
1140
|
searchObjectToUrl(e) {
|
|
1051
1141
|
return this.queryStringHelper.urlHasQueryParams(window.location.href) ? window.location.href.split("?")[0] + "?" + this.queryStringHelper.stringify(this.searchObjectToParams(e), { ignoredKeys: this.ignoredKeys }) : window.location.href + "?" + this.queryStringHelper.stringify(this.searchObjectToParams(e), { ignoredKeys: this.ignoredKeys });
|
|
1052
1142
|
}
|
|
1053
1143
|
searchObjectToParams(e) {
|
|
1054
|
-
const t = {},
|
|
1055
|
-
if (e.query && (t[this.routeName + "[query]"] = encodeURIComponent(e.query)), t[this.routeName + "[page]"] =
|
|
1056
|
-
for (const
|
|
1057
|
-
const r = e.facets[
|
|
1058
|
-
t[this.routeName + `[facets][${
|
|
1144
|
+
const t = {}, s = e.page || 1;
|
|
1145
|
+
if (e.query && (t[this.routeName + "[query]"] = encodeURIComponent(e.query)), e.page && (t[this.routeName + "[page]"] = s + ""), e.order && (t[this.routeName + "[order]"] = e.order), e.facets)
|
|
1146
|
+
for (const a in e.facets) {
|
|
1147
|
+
const r = e.facets[a].type + ":" + encodeURIComponent(e.facets[a].name) + ":" + encodeURIComponent(e.facets[a].value);
|
|
1148
|
+
t[this.routeName + `[facets][${a}]`] = r;
|
|
1059
1149
|
}
|
|
1060
1150
|
if (this.queryStringHelper.urlHasQueryParams(window.location.href)) {
|
|
1061
|
-
const
|
|
1062
|
-
for (const r in
|
|
1063
|
-
r.startsWith(this.routeName) && delete
|
|
1064
|
-
return { ...
|
|
1151
|
+
const a = this.queryStringHelper.urlToParams(window.location.href);
|
|
1152
|
+
for (const r in a)
|
|
1153
|
+
r.startsWith(this.routeName) && delete a[r];
|
|
1154
|
+
return { ...a, ...t };
|
|
1065
1155
|
} else
|
|
1066
1156
|
return t;
|
|
1067
1157
|
}
|
|
1068
1158
|
extractParamsThatDoNotStartWithRouteName(e) {
|
|
1069
1159
|
const t = {};
|
|
1070
|
-
for (const
|
|
1071
|
-
|
|
1160
|
+
for (const s in e)
|
|
1161
|
+
s.startsWith(this.routeName) || (t[s] = e[s]);
|
|
1072
1162
|
return t;
|
|
1073
1163
|
}
|
|
1074
1164
|
extractArrayOfFacetsFromQueryParameters(e) {
|
|
1075
|
-
var t,
|
|
1165
|
+
var t, s, a;
|
|
1076
1166
|
const r = [];
|
|
1077
1167
|
for (const c in e)
|
|
1078
1168
|
if (c.startsWith(this.routeName + "[facets]")) {
|
|
1079
|
-
const l = Z.removeXSSRiskyTags((t = e[c].split(":")) == null ? void 0 : t[0]),
|
|
1080
|
-
r.push({ type: l, name:
|
|
1169
|
+
const l = Z.removeXSSRiskyTags((t = e[c].split(":")) == null ? void 0 : t[0]), u = Z.removeXSSRiskyTags(decodeURIComponent((s = e[c].split(":")) == null ? void 0 : s[1])), d = Z.removeXSSRiskyTags(decodeURIComponent((a = e[c].split(":")) == null ? void 0 : a[2]));
|
|
1170
|
+
r.push({ type: l, name: u, value: d });
|
|
1081
1171
|
}
|
|
1082
1172
|
return r;
|
|
1083
1173
|
}
|
|
1084
1174
|
urlToSearchObject(e) {
|
|
1085
|
-
const t = this.queryStringHelper.urlToParams(e),
|
|
1175
|
+
const t = this.queryStringHelper.urlToParams(e), s = Z.removeXSSRiskyTags(decodeURIComponent(t[this.routeName + "[page]"])), a = parseInt(s), r = isNaN(a) ? 1 : a;
|
|
1086
1176
|
return {
|
|
1087
1177
|
query: Z.removeXSSRiskyTags(decodeURIComponent(t[this.routeName + "[query]"])) || "",
|
|
1088
1178
|
page: r,
|
|
1179
|
+
itemsPerPage: void 0,
|
|
1089
1180
|
order: Z.removeXSSRiskyTags(t[this.routeName + "[order]"]) || "",
|
|
1090
1181
|
facets: this.extractArrayOfFacetsFromQueryParameters(t) || []
|
|
1091
1182
|
};
|
|
1092
1183
|
}
|
|
1093
1184
|
}
|
|
1094
|
-
class
|
|
1185
|
+
class $t {
|
|
1095
1186
|
constructor(e) {
|
|
1096
|
-
|
|
1097
|
-
const
|
|
1098
|
-
return Object.keys(
|
|
1099
|
-
const c =
|
|
1187
|
+
h(this, "routeName", ""), h(this, "stringify", (t, s) => {
|
|
1188
|
+
const a = this.filterOutIgnoredKeys(t, s.ignoredKeys);
|
|
1189
|
+
return Object.keys(a).map((r) => {
|
|
1190
|
+
const c = a[r];
|
|
1100
1191
|
return Array.isArray(c) ? c.map((l) => `${r}=${l}`).join("&") : `${r}=${c}`;
|
|
1101
1192
|
}).join("&");
|
|
1102
1193
|
}), this.routeName = e;
|
|
1103
1194
|
}
|
|
1104
1195
|
filterOutIgnoredKeys(e, t) {
|
|
1105
|
-
const
|
|
1196
|
+
const s = t || [], a = {};
|
|
1106
1197
|
return Object.keys(e).forEach((r) => {
|
|
1107
|
-
|
|
1108
|
-
}),
|
|
1198
|
+
s.includes(r) || e[r] !== "" && (a[r] = e[r]);
|
|
1199
|
+
}), a;
|
|
1109
1200
|
}
|
|
1110
1201
|
urlToParams(e) {
|
|
1111
|
-
const t = {},
|
|
1112
|
-
return
|
|
1113
|
-
const [r, c] =
|
|
1202
|
+
const t = {}, s = e.split("?")[1];
|
|
1203
|
+
return s && s.split("&").forEach((a) => {
|
|
1204
|
+
const [r, c] = a.split("=");
|
|
1114
1205
|
t[r] = c;
|
|
1115
1206
|
}), t;
|
|
1116
1207
|
}
|
|
@@ -1121,39 +1212,45 @@ class Nt {
|
|
|
1121
1212
|
return e.indexOf("?") !== -1;
|
|
1122
1213
|
}
|
|
1123
1214
|
}
|
|
1124
|
-
|
|
1215
|
+
const se = {
|
|
1216
|
+
questionURL: "http://smartsearch-dev.searchstax.co/completion/?q=",
|
|
1217
|
+
question: "I_AM_A_QUESTION",
|
|
1218
|
+
notQuestion: "I_AM_NOT_A_QUESTION",
|
|
1219
|
+
close: "CLOSE"
|
|
1220
|
+
};
|
|
1221
|
+
class qt {
|
|
1125
1222
|
constructor(e, t) {
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
this.authHeader.append("Authorization",
|
|
1223
|
+
h(this, "cachedQuery", ""), h(this, "url", ""), h(this, "relatedSearches", ""), h(this, "suggester", ""), h(this, "authHeader"), h(this, "authHeaderRelated"), h(this, "trackApiKey", ""), h(this, "session", ""), h(this, "searchAuthType"), h(this, "searchAuth", ""), h(this, "controllerSearch"), h(this, "signalSearch"), h(this, "controllerSuggest"), h(this, "signalSuggest"), h(this, "dataLayer"), this.dataLayer = t, this.url = e.searchURL, this.dataLayer.setLanguage(e.language), this.suggester = e.suggesterURL, this.trackApiKey = e.trackApiKey, this.session = e.sessionId, this.searchAuthType = e.authType, this.searchAuth = e.searchAuth, this.authHeader = new Headers(), this.authHeader.append("Accept", "application/json");
|
|
1224
|
+
const s = this.searchAuthType === "token" ? `Token ${e.searchAuth}` : `Basic ${e.searchAuth}`;
|
|
1225
|
+
this.authHeader.append("Authorization", s), this.authHeaderRelated = new Headers(), this.authHeaderRelated.append("Accept", "application/json"), this.authHeaderRelated.append("Authorization", e.searchAuth);
|
|
1129
1226
|
}
|
|
1130
1227
|
generateFacetQuery(e, t) {
|
|
1131
|
-
let
|
|
1228
|
+
let s = [];
|
|
1132
1229
|
if (!t)
|
|
1133
|
-
e.forEach(function(
|
|
1134
|
-
const r =
|
|
1135
|
-
|
|
1230
|
+
e.forEach(function(a) {
|
|
1231
|
+
const r = a.name + ':"' + a.value + '"';
|
|
1232
|
+
s = s.concat("fq=" + decodeURIComponent(r).replace(" ", " "));
|
|
1136
1233
|
});
|
|
1137
1234
|
else {
|
|
1138
|
-
const
|
|
1235
|
+
const a = {};
|
|
1139
1236
|
e.forEach(function(r) {
|
|
1140
1237
|
const c = r.name + ":" + r.value, l = decodeURIComponent(c).replace(" ", " ").split(":");
|
|
1141
|
-
|
|
1238
|
+
a[l[0]] ? a[l[0]].push(l[1]) : a[l[0]] = [l[1]];
|
|
1142
1239
|
});
|
|
1143
|
-
for (const r in
|
|
1144
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
1145
|
-
const c =
|
|
1146
|
-
let
|
|
1240
|
+
for (const r in a)
|
|
1241
|
+
if (Object.prototype.hasOwnProperty.call(a, r)) {
|
|
1242
|
+
const c = a[r], l = r;
|
|
1243
|
+
let u = "";
|
|
1147
1244
|
for (const d of c)
|
|
1148
|
-
|
|
1149
|
-
|
|
1245
|
+
u += ` ${l}:"${d}"`;
|
|
1246
|
+
s = s.concat("fq=" + u.trim());
|
|
1150
1247
|
}
|
|
1151
1248
|
}
|
|
1152
|
-
return
|
|
1249
|
+
return s.length ? "&" + s.join("&") : "";
|
|
1153
1250
|
}
|
|
1154
|
-
getRelatedSearches(e, t,
|
|
1251
|
+
getRelatedSearches(e, t, s, a) {
|
|
1155
1252
|
const r = new Headers();
|
|
1156
|
-
r.append("Accept", "application/json"), r.append("Authorization",
|
|
1253
|
+
r.append("Accept", "application/json"), r.append("Authorization", s), fetch(
|
|
1157
1254
|
t + "?search=" + encodeURIComponent(e.query) + "&language=" + this.dataLayer.language,
|
|
1158
1255
|
{
|
|
1159
1256
|
method: "GET",
|
|
@@ -1161,56 +1258,78 @@ class Dt {
|
|
|
1161
1258
|
credentials: "same-origin"
|
|
1162
1259
|
}
|
|
1163
1260
|
).then((c) => c.json()).then((c) => {
|
|
1164
|
-
|
|
1261
|
+
a(c);
|
|
1165
1262
|
});
|
|
1166
1263
|
}
|
|
1167
1264
|
cacheFacets() {
|
|
1168
1265
|
this.dataLayer.searchObject.query !== this.cachedQuery && (this.cachedQuery = this.dataLayer.searchObject.query, this.search(
|
|
1169
1266
|
{
|
|
1170
1267
|
query: this.dataLayer.searchObject.query ?? "*",
|
|
1268
|
+
itemsPerPage: 10,
|
|
1171
1269
|
page: 1,
|
|
1172
1270
|
order: "",
|
|
1173
1271
|
facets: [],
|
|
1174
1272
|
additionalProps: this.dataLayer.searchObject.additionalProps
|
|
1175
1273
|
},
|
|
1176
|
-
this.cacheFacetsCallback.bind(this)
|
|
1274
|
+
this.cacheFacetsCallback.bind(this),
|
|
1275
|
+
!0
|
|
1177
1276
|
));
|
|
1178
1277
|
}
|
|
1179
1278
|
cacheFacetsCallback(e) {
|
|
1180
|
-
let t =
|
|
1279
|
+
let t = ue.extractFacets(e);
|
|
1181
1280
|
this.dataLayer.setSearchFacetsCached(t);
|
|
1182
1281
|
}
|
|
1183
|
-
search(e, t,
|
|
1184
|
-
if (e.query && e.query !== "undefined") {
|
|
1282
|
+
search(e, t, s = !1, a = !1) {
|
|
1283
|
+
if (e.query && e.query !== "undefined" && e.itemsPerPage !== void 0) {
|
|
1185
1284
|
this.dataLayer.setSearchTerm(e.query), this.dataLayer.setLoading(!0), this.controllerSearch && this.controllerSearch.abort(), this.controllerSearch = new AbortController(), this.signalSearch = this.controllerSearch.signal;
|
|
1186
1285
|
const r = new Proxy(new URLSearchParams(window.location.search), {
|
|
1187
|
-
get: (
|
|
1286
|
+
get: (y, R) => y.get(R) ?? ""
|
|
1188
1287
|
}), c = r.languageVariant ? (
|
|
1189
1288
|
//@ts-expect-error - this is a hack to get around the fact that the urlQueryParams is a proxy
|
|
1190
1289
|
"&fq=_language:" + r.languageVariant
|
|
1191
|
-
) : ""
|
|
1192
|
-
|
|
1290
|
+
) : "";
|
|
1291
|
+
let l = e.itemsPerPage, u = e.itemsPerPage * (e.page - 1), d = e.order ? `&sort=${e.order}` : "";
|
|
1292
|
+
const p = this.url + "?q=" + encodeURIComponent(e.query.trim()) + "&start=" + u + this.toQueryString(e.additionalProps ?? []) + this.generateFacetQuery(
|
|
1293
|
+
e.facets.filter((y) => y.type === "or" || y.type === "showUnavailable"),
|
|
1193
1294
|
!0
|
|
1194
1295
|
) + this.generateFacetQuery(
|
|
1195
|
-
e.facets.filter((
|
|
1296
|
+
e.facets.filter((y) => y.type === "and" || y.type === "tabs"),
|
|
1196
1297
|
!1
|
|
1197
|
-
) +
|
|
1298
|
+
) + d + `&spellcheck.correct=${this.dataLayer.autoCorrect && !a}&rows=${l}&language=` + this.dataLayer.language + c, v = {
|
|
1198
1299
|
method: "GET",
|
|
1199
1300
|
headers: this.authHeader,
|
|
1200
1301
|
credentials: "same-origin",
|
|
1201
1302
|
signal: this.signalSearch
|
|
1202
1303
|
};
|
|
1203
|
-
|
|
1204
|
-
this.dataLayer.setLoading(!1), t(
|
|
1304
|
+
s && delete v.signal, fetch(p, v).then((y) => y.json()).then((y) => {
|
|
1305
|
+
this.dataLayer.setLoading(!1), t(y);
|
|
1205
1306
|
}).catch(() => {
|
|
1206
1307
|
this.dataLayer.setLoading(!1);
|
|
1207
1308
|
});
|
|
1208
1309
|
}
|
|
1209
1310
|
}
|
|
1210
|
-
|
|
1311
|
+
startSSE(e, t) {
|
|
1312
|
+
if (!this.dataLayer.turnAIAnswerGenerationOn || e === "*" || this.dataLayer.lastSearchValue === e || this.dataLayer.searchObject.facets.length > 0 || this.dataLayer.searchObject.page !== 1)
|
|
1313
|
+
return;
|
|
1314
|
+
const s = new EventSource(se.questionURL + e), a = this.dataLayer;
|
|
1315
|
+
s.onmessage = function(r) {
|
|
1316
|
+
if (r.data === se.question || r.data === se.notQuestion) {
|
|
1317
|
+
a.setAnswerData("");
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
if (r.data === se.close) {
|
|
1321
|
+
s.close();
|
|
1322
|
+
return;
|
|
1323
|
+
}
|
|
1324
|
+
t(r.data);
|
|
1325
|
+
}, s.onerror = function(r) {
|
|
1326
|
+
console.log(r), s.close();
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
suggest(e, t, s) {
|
|
1211
1330
|
this.controllerSuggest && this.controllerSuggest.abort(), this.controllerSuggest = new AbortController(), this.signalSuggest = this.controllerSuggest.signal;
|
|
1212
|
-
const
|
|
1213
|
-
fetch(
|
|
1331
|
+
const a = this.suggester + "?q=" + e.trim() + this.toQueryString(s) + "&language=" + this.dataLayer.language;
|
|
1332
|
+
fetch(a, {
|
|
1214
1333
|
method: "GET",
|
|
1215
1334
|
headers: this.authHeader,
|
|
1216
1335
|
credentials: "same-origin",
|
|
@@ -1227,47 +1346,12 @@ class Dt {
|
|
|
1227
1346
|
if (e.length === 0)
|
|
1228
1347
|
return "";
|
|
1229
1348
|
const t = [];
|
|
1230
|
-
for (const
|
|
1231
|
-
t.push(encodeURIComponent(
|
|
1349
|
+
for (const s of e)
|
|
1350
|
+
t.push(encodeURIComponent(s.key) + "=" + encodeURIComponent(s.value));
|
|
1232
1351
|
return "&" + t.join("&");
|
|
1233
1352
|
}
|
|
1234
1353
|
}
|
|
1235
|
-
class
|
|
1236
|
-
static getOrSetCookie(e) {
|
|
1237
|
-
let t = this.getCookie(e);
|
|
1238
|
-
return t == null && (t = this.makeid(25), this.setCookie(e, t, {
|
|
1239
|
-
secure: !0,
|
|
1240
|
-
"max-age": 3600
|
|
1241
|
-
})), t;
|
|
1242
|
-
}
|
|
1243
|
-
static makeid(e) {
|
|
1244
|
-
let t = "";
|
|
1245
|
-
const a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", s = a.length;
|
|
1246
|
-
for (let r = 0; r < e; r++)
|
|
1247
|
-
t += a.charAt(Math.floor(Math.random() * s));
|
|
1248
|
-
return t;
|
|
1249
|
-
}
|
|
1250
|
-
static getCookie(e) {
|
|
1251
|
-
const t = document.cookie.match(
|
|
1252
|
-
new RegExp(
|
|
1253
|
-
"(?:^|; )" + e.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"
|
|
1254
|
-
)
|
|
1255
|
-
);
|
|
1256
|
-
return t ? decodeURIComponent(t[1]) : void 0;
|
|
1257
|
-
}
|
|
1258
|
-
static setCookie(e, t, a) {
|
|
1259
|
-
const s = { path: "/", ...a };
|
|
1260
|
-
a.expires instanceof Date && (s.expires = a.expires.toUTCString());
|
|
1261
|
-
let r = encodeURIComponent(e) + "=" + encodeURIComponent(t);
|
|
1262
|
-
for (const c in s) {
|
|
1263
|
-
r += "; " + c;
|
|
1264
|
-
const l = s[c];
|
|
1265
|
-
l !== !0 && (r += "=" + l);
|
|
1266
|
-
}
|
|
1267
|
-
document.cookie = r;
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
class ue {
|
|
1354
|
+
class de {
|
|
1271
1355
|
static trackClick(e) {
|
|
1272
1356
|
const t = {
|
|
1273
1357
|
key: e.trackApiKey,
|
|
@@ -1283,7 +1367,7 @@ class ue {
|
|
|
1283
1367
|
language: e.language
|
|
1284
1368
|
};
|
|
1285
1369
|
setTimeout(() => {
|
|
1286
|
-
this.msq.push(["trackClick", t]);
|
|
1370
|
+
t.key && this.msq.push(["trackClick", t]);
|
|
1287
1371
|
}, 0);
|
|
1288
1372
|
}
|
|
1289
1373
|
static trackSearch(e) {
|
|
@@ -1299,7 +1383,7 @@ class ue {
|
|
|
1299
1383
|
impressions: e.impressions
|
|
1300
1384
|
};
|
|
1301
1385
|
setTimeout(() => {
|
|
1302
|
-
this.msq.push(["
|
|
1386
|
+
t.key && this.msq.push(["trackSearch", t]);
|
|
1303
1387
|
}, 0);
|
|
1304
1388
|
}
|
|
1305
1389
|
static trackRelatedSearchClick(e) {
|
|
@@ -1315,7 +1399,7 @@ class ue {
|
|
|
1315
1399
|
language: e.language
|
|
1316
1400
|
};
|
|
1317
1401
|
setTimeout(() => {
|
|
1318
|
-
this.msq.push(["trackRelatedSearchClick", t]);
|
|
1402
|
+
t.key && this.msq.push(["trackRelatedSearchClick", t]);
|
|
1319
1403
|
}, 0);
|
|
1320
1404
|
}
|
|
1321
1405
|
static trackRelatedSearches(e) {
|
|
@@ -1329,40 +1413,40 @@ class ue {
|
|
|
1329
1413
|
impressions: e.impressions
|
|
1330
1414
|
};
|
|
1331
1415
|
setTimeout(() => {
|
|
1332
|
-
this.msq.push(["trackRelatedSearch", t]);
|
|
1416
|
+
t.key && this.msq.push(["trackRelatedSearch", t]);
|
|
1333
1417
|
}, 0);
|
|
1334
1418
|
}
|
|
1335
1419
|
}
|
|
1336
|
-
|
|
1420
|
+
h(de, "msq", window._msq || []);
|
|
1337
1421
|
/*!
|
|
1338
1422
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
1339
1423
|
* http://github.com/janl/mustache.js
|
|
1340
1424
|
*/
|
|
1341
|
-
var
|
|
1342
|
-
return
|
|
1425
|
+
var _t = Object.prototype.toString, ie = Array.isArray || function(i) {
|
|
1426
|
+
return _t.call(i) === "[object Array]";
|
|
1343
1427
|
};
|
|
1344
|
-
function
|
|
1345
|
-
return typeof
|
|
1428
|
+
function je(i) {
|
|
1429
|
+
return typeof i == "function";
|
|
1346
1430
|
}
|
|
1347
|
-
function
|
|
1348
|
-
return
|
|
1431
|
+
function Ht(i) {
|
|
1432
|
+
return ie(i) ? "array" : typeof i;
|
|
1349
1433
|
}
|
|
1350
|
-
function
|
|
1351
|
-
return
|
|
1434
|
+
function Ie(i) {
|
|
1435
|
+
return i.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
1352
1436
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1437
|
+
function rt(i, e) {
|
|
1438
|
+
return i != null && typeof i == "object" && e in i;
|
|
1355
1439
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return
|
|
1440
|
+
function Wt(i, e) {
|
|
1441
|
+
return i != null && typeof i != "object" && i.hasOwnProperty && i.hasOwnProperty(e);
|
|
1358
1442
|
}
|
|
1359
|
-
var
|
|
1360
|
-
function
|
|
1361
|
-
return
|
|
1443
|
+
var Bt = RegExp.prototype.test;
|
|
1444
|
+
function Vt(i, e) {
|
|
1445
|
+
return Bt.call(i, e);
|
|
1362
1446
|
}
|
|
1363
|
-
var
|
|
1364
|
-
function
|
|
1365
|
-
return !
|
|
1447
|
+
var Ut = /\S/;
|
|
1448
|
+
function Qt(i) {
|
|
1449
|
+
return !Vt(Ut, i);
|
|
1366
1450
|
}
|
|
1367
1451
|
var Kt = {
|
|
1368
1452
|
"&": "&",
|
|
@@ -1374,89 +1458,89 @@ var Kt = {
|
|
|
1374
1458
|
"`": "`",
|
|
1375
1459
|
"=": "="
|
|
1376
1460
|
};
|
|
1377
|
-
function
|
|
1378
|
-
return String(
|
|
1461
|
+
function zt(i) {
|
|
1462
|
+
return String(i).replace(/[&<>"'`=\/]/g, function(e) {
|
|
1379
1463
|
return Kt[e];
|
|
1380
1464
|
});
|
|
1381
1465
|
}
|
|
1382
|
-
var
|
|
1383
|
-
function
|
|
1384
|
-
if (!
|
|
1466
|
+
var Jt = /\s*/, Yt = /\s+/, it = /\s*=/, Gt = /\s*\}/, Xt = /#|\^|\/|>|\{|&|=|!/;
|
|
1467
|
+
function Zt(i, e) {
|
|
1468
|
+
if (!i)
|
|
1385
1469
|
return [];
|
|
1386
|
-
var t = !1,
|
|
1470
|
+
var t = !1, s = [], a = [], r = [], c = !1, l = !1, u = "", d = 0;
|
|
1387
1471
|
function p() {
|
|
1388
1472
|
if (c && !l)
|
|
1389
1473
|
for (; r.length; )
|
|
1390
|
-
delete
|
|
1474
|
+
delete a[r.pop()];
|
|
1391
1475
|
else
|
|
1392
1476
|
r = [];
|
|
1393
1477
|
c = !1, l = !1;
|
|
1394
1478
|
}
|
|
1395
|
-
var v,
|
|
1396
|
-
function M(
|
|
1397
|
-
if (typeof
|
|
1398
|
-
throw new Error("Invalid tags: " +
|
|
1399
|
-
v = new RegExp(
|
|
1400
|
-
}
|
|
1401
|
-
M(e ||
|
|
1402
|
-
for (var
|
|
1403
|
-
if (
|
|
1404
|
-
for (var
|
|
1405
|
-
N =
|
|
1406
|
-
` && (p(),
|
|
1407
|
-
if (!
|
|
1479
|
+
var v, y, R;
|
|
1480
|
+
function M(b) {
|
|
1481
|
+
if (typeof b == "string" && (b = b.split(Yt, 2)), !ie(b) || b.length !== 2)
|
|
1482
|
+
throw new Error("Invalid tags: " + b);
|
|
1483
|
+
v = new RegExp(Ie(b[0]) + "\\s*"), y = new RegExp("\\s*" + Ie(b[1])), R = new RegExp("\\s*" + Ie("}" + b[1]));
|
|
1484
|
+
}
|
|
1485
|
+
M(e || P.tags);
|
|
1486
|
+
for (var k = new pe(i), T, I, L, N, W, A; !k.eos(); ) {
|
|
1487
|
+
if (T = k.pos, L = k.scanUntil(v), L)
|
|
1488
|
+
for (var Q = 0, m = L.length; Q < m; ++Q)
|
|
1489
|
+
N = L.charAt(Q), Qt(N) ? (r.push(a.length), u += N) : (l = !0, t = !0, u += " "), a.push(["text", N, T, T + 1]), T += 1, N === `
|
|
1490
|
+
` && (p(), u = "", d = 0, t = !1);
|
|
1491
|
+
if (!k.scan(v))
|
|
1408
1492
|
break;
|
|
1409
|
-
if (c = !0, I =
|
|
1410
|
-
throw new Error("Unclosed tag at " +
|
|
1411
|
-
if (I == ">" ? W = [I,
|
|
1412
|
-
|
|
1493
|
+
if (c = !0, I = k.scan(Xt) || "name", k.scan(Jt), I === "=" ? (L = k.scanUntil(it), k.scan(it), k.scanUntil(y)) : I === "{" ? (L = k.scanUntil(R), k.scan(Gt), k.scanUntil(y), I = "&") : L = k.scanUntil(y), !k.scan(y))
|
|
1494
|
+
throw new Error("Unclosed tag at " + k.pos);
|
|
1495
|
+
if (I == ">" ? W = [I, L, T, k.pos, u, d, t] : W = [I, L, T, k.pos], d++, a.push(W), I === "#" || I === "^")
|
|
1496
|
+
s.push(W);
|
|
1413
1497
|
else if (I === "/") {
|
|
1414
|
-
if (A =
|
|
1415
|
-
throw new Error('Unopened section "' +
|
|
1416
|
-
if (A[1] !==
|
|
1417
|
-
throw new Error('Unclosed section "' + A[1] + '" at ' +
|
|
1498
|
+
if (A = s.pop(), !A)
|
|
1499
|
+
throw new Error('Unopened section "' + L + '" at ' + T);
|
|
1500
|
+
if (A[1] !== L)
|
|
1501
|
+
throw new Error('Unclosed section "' + A[1] + '" at ' + T);
|
|
1418
1502
|
} else
|
|
1419
|
-
I === "name" || I === "{" || I === "&" ? l = !0 : I === "=" && M(
|
|
1503
|
+
I === "name" || I === "{" || I === "&" ? l = !0 : I === "=" && M(L);
|
|
1420
1504
|
}
|
|
1421
|
-
if (p(), A =
|
|
1422
|
-
throw new Error('Unclosed section "' + A[1] + '" at ' +
|
|
1423
|
-
return ea(
|
|
1505
|
+
if (p(), A = s.pop(), A)
|
|
1506
|
+
throw new Error('Unclosed section "' + A[1] + '" at ' + k.pos);
|
|
1507
|
+
return ta(ea(a));
|
|
1424
1508
|
}
|
|
1425
|
-
function
|
|
1426
|
-
for (var e = [], t,
|
|
1427
|
-
t =
|
|
1509
|
+
function ea(i) {
|
|
1510
|
+
for (var e = [], t, s, a = 0, r = i.length; a < r; ++a)
|
|
1511
|
+
t = i[a], t && (t[0] === "text" && s && s[0] === "text" ? (s[1] += t[1], s[3] = t[3]) : (e.push(t), s = t));
|
|
1428
1512
|
return e;
|
|
1429
1513
|
}
|
|
1430
|
-
function
|
|
1431
|
-
for (var e = [], t = e,
|
|
1432
|
-
switch (
|
|
1514
|
+
function ta(i) {
|
|
1515
|
+
for (var e = [], t = e, s = [], a, r, c = 0, l = i.length; c < l; ++c)
|
|
1516
|
+
switch (a = i[c], a[0]) {
|
|
1433
1517
|
case "#":
|
|
1434
1518
|
case "^":
|
|
1435
|
-
t.push(
|
|
1519
|
+
t.push(a), s.push(a), t = a[4] = [];
|
|
1436
1520
|
break;
|
|
1437
1521
|
case "/":
|
|
1438
|
-
r =
|
|
1522
|
+
r = s.pop(), r[5] = a[2], t = s.length > 0 ? s[s.length - 1][4] : e;
|
|
1439
1523
|
break;
|
|
1440
1524
|
default:
|
|
1441
|
-
t.push(
|
|
1525
|
+
t.push(a);
|
|
1442
1526
|
}
|
|
1443
1527
|
return e;
|
|
1444
1528
|
}
|
|
1445
|
-
function
|
|
1446
|
-
this.string =
|
|
1529
|
+
function pe(i) {
|
|
1530
|
+
this.string = i, this.tail = i, this.pos = 0;
|
|
1447
1531
|
}
|
|
1448
|
-
|
|
1532
|
+
pe.prototype.eos = function() {
|
|
1449
1533
|
return this.tail === "";
|
|
1450
1534
|
};
|
|
1451
|
-
|
|
1452
|
-
var e = this.tail.match(
|
|
1535
|
+
pe.prototype.scan = function(i) {
|
|
1536
|
+
var e = this.tail.match(i);
|
|
1453
1537
|
if (!e || e.index !== 0)
|
|
1454
1538
|
return "";
|
|
1455
1539
|
var t = e[0];
|
|
1456
1540
|
return this.tail = this.tail.substring(t.length), this.pos += t.length, t;
|
|
1457
1541
|
};
|
|
1458
|
-
|
|
1459
|
-
var e = this.tail.search(
|
|
1542
|
+
pe.prototype.scanUntil = function(i) {
|
|
1543
|
+
var e = this.tail.search(i), t;
|
|
1460
1544
|
switch (e) {
|
|
1461
1545
|
case -1:
|
|
1462
1546
|
t = this.tail, this.tail = "";
|
|
@@ -1469,41 +1553,41 @@ ge.prototype.scanUntil = function(n) {
|
|
|
1469
1553
|
}
|
|
1470
1554
|
return this.pos += t.length, t;
|
|
1471
1555
|
};
|
|
1472
|
-
function
|
|
1473
|
-
this.view =
|
|
1556
|
+
function re(i, e) {
|
|
1557
|
+
this.view = i, this.cache = { ".": this.view }, this.parent = e;
|
|
1474
1558
|
}
|
|
1475
|
-
|
|
1476
|
-
return new
|
|
1559
|
+
re.prototype.push = function(i) {
|
|
1560
|
+
return new re(i, this);
|
|
1477
1561
|
};
|
|
1478
|
-
|
|
1562
|
+
re.prototype.lookup = function(i) {
|
|
1479
1563
|
var e = this.cache, t;
|
|
1480
|
-
if (e.hasOwnProperty(
|
|
1481
|
-
t = e[
|
|
1564
|
+
if (e.hasOwnProperty(i))
|
|
1565
|
+
t = e[i];
|
|
1482
1566
|
else {
|
|
1483
|
-
for (var
|
|
1484
|
-
if (
|
|
1485
|
-
for (
|
|
1486
|
-
c === r.length - 1 && (l =
|
|
1567
|
+
for (var s = this, a, r, c, l = !1; s; ) {
|
|
1568
|
+
if (i.indexOf(".") > 0)
|
|
1569
|
+
for (a = s.view, r = i.split("."), c = 0; a != null && c < r.length; )
|
|
1570
|
+
c === r.length - 1 && (l = rt(a, r[c]) || Wt(a, r[c])), a = a[r[c++]];
|
|
1487
1571
|
else
|
|
1488
|
-
|
|
1572
|
+
a = s.view[i], l = rt(s.view, i);
|
|
1489
1573
|
if (l) {
|
|
1490
|
-
t =
|
|
1574
|
+
t = a;
|
|
1491
1575
|
break;
|
|
1492
1576
|
}
|
|
1493
|
-
|
|
1577
|
+
s = s.parent;
|
|
1494
1578
|
}
|
|
1495
|
-
e[
|
|
1579
|
+
e[i] = t;
|
|
1496
1580
|
}
|
|
1497
|
-
return
|
|
1581
|
+
return je(t) && (t = t.call(this.view)), t;
|
|
1498
1582
|
};
|
|
1499
1583
|
function U() {
|
|
1500
1584
|
this.templateCache = {
|
|
1501
1585
|
_cache: {},
|
|
1502
|
-
set: function(
|
|
1503
|
-
this._cache[
|
|
1586
|
+
set: function(i, e) {
|
|
1587
|
+
this._cache[i] = e;
|
|
1504
1588
|
},
|
|
1505
|
-
get: function(
|
|
1506
|
-
return this._cache[
|
|
1589
|
+
get: function(i) {
|
|
1590
|
+
return this._cache[i];
|
|
1507
1591
|
},
|
|
1508
1592
|
clear: function() {
|
|
1509
1593
|
this._cache = {};
|
|
@@ -1513,83 +1597,83 @@ function U() {
|
|
|
1513
1597
|
U.prototype.clearCache = function() {
|
|
1514
1598
|
typeof this.templateCache < "u" && this.templateCache.clear();
|
|
1515
1599
|
};
|
|
1516
|
-
U.prototype.parse = function(
|
|
1517
|
-
var t = this.templateCache,
|
|
1518
|
-
return r == null && (r =
|
|
1600
|
+
U.prototype.parse = function(i, e) {
|
|
1601
|
+
var t = this.templateCache, s = i + ":" + (e || P.tags).join(":"), a = typeof t < "u", r = a ? t.get(s) : void 0;
|
|
1602
|
+
return r == null && (r = Zt(i, e), a && t.set(s, r)), r;
|
|
1519
1603
|
};
|
|
1520
|
-
U.prototype.render = function(
|
|
1521
|
-
var
|
|
1522
|
-
return this.renderTokens(r, c, t,
|
|
1604
|
+
U.prototype.render = function(i, e, t, s) {
|
|
1605
|
+
var a = this.getConfigTags(s), r = this.parse(i, a), c = e instanceof re ? e : new re(e, void 0);
|
|
1606
|
+
return this.renderTokens(r, c, t, i, s);
|
|
1523
1607
|
};
|
|
1524
|
-
U.prototype.renderTokens = function(
|
|
1525
|
-
for (var r = "", c, l,
|
|
1526
|
-
|
|
1608
|
+
U.prototype.renderTokens = function(i, e, t, s, a) {
|
|
1609
|
+
for (var r = "", c, l, u, d = 0, p = i.length; d < p; ++d)
|
|
1610
|
+
u = void 0, c = i[d], l = c[0], l === "#" ? u = this.renderSection(c, e, t, s, a) : l === "^" ? u = this.renderInverted(c, e, t, s, a) : l === ">" ? u = this.renderPartial(c, e, t, a) : l === "&" ? u = this.unescapedValue(c, e) : l === "name" ? u = this.escapedValue(c, e, a) : l === "text" && (u = this.rawValue(c)), u !== void 0 && (r += u);
|
|
1527
1611
|
return r;
|
|
1528
1612
|
};
|
|
1529
|
-
U.prototype.renderSection = function(
|
|
1530
|
-
var r = this, c = "", l = e.lookup(
|
|
1531
|
-
function
|
|
1532
|
-
return r.render(v, e, t,
|
|
1613
|
+
U.prototype.renderSection = function(i, e, t, s, a) {
|
|
1614
|
+
var r = this, c = "", l = e.lookup(i[1]);
|
|
1615
|
+
function u(v) {
|
|
1616
|
+
return r.render(v, e, t, a);
|
|
1533
1617
|
}
|
|
1534
1618
|
if (l) {
|
|
1535
|
-
if (
|
|
1619
|
+
if (ie(l))
|
|
1536
1620
|
for (var d = 0, p = l.length; d < p; ++d)
|
|
1537
|
-
c += this.renderTokens(
|
|
1621
|
+
c += this.renderTokens(i[4], e.push(l[d]), t, s, a);
|
|
1538
1622
|
else if (typeof l == "object" || typeof l == "string" || typeof l == "number")
|
|
1539
|
-
c += this.renderTokens(
|
|
1540
|
-
else if (
|
|
1541
|
-
if (typeof
|
|
1623
|
+
c += this.renderTokens(i[4], e.push(l), t, s, a);
|
|
1624
|
+
else if (je(l)) {
|
|
1625
|
+
if (typeof s != "string")
|
|
1542
1626
|
throw new Error("Cannot use higher-order sections without the original template");
|
|
1543
|
-
l = l.call(e.view,
|
|
1627
|
+
l = l.call(e.view, s.slice(i[3], i[5]), u), l != null && (c += l);
|
|
1544
1628
|
} else
|
|
1545
|
-
c += this.renderTokens(
|
|
1629
|
+
c += this.renderTokens(i[4], e, t, s, a);
|
|
1546
1630
|
return c;
|
|
1547
1631
|
}
|
|
1548
1632
|
};
|
|
1549
|
-
U.prototype.renderInverted = function(
|
|
1550
|
-
var r = e.lookup(
|
|
1551
|
-
if (!r ||
|
|
1552
|
-
return this.renderTokens(
|
|
1633
|
+
U.prototype.renderInverted = function(i, e, t, s, a) {
|
|
1634
|
+
var r = e.lookup(i[1]);
|
|
1635
|
+
if (!r || ie(r) && r.length === 0)
|
|
1636
|
+
return this.renderTokens(i[4], e, t, s, a);
|
|
1553
1637
|
};
|
|
1554
|
-
U.prototype.indentPartial = function(
|
|
1555
|
-
for (var
|
|
1556
|
-
`), r = 0; r <
|
|
1557
|
-
|
|
1558
|
-
return
|
|
1638
|
+
U.prototype.indentPartial = function(i, e, t) {
|
|
1639
|
+
for (var s = e.replace(/[^ \t]/g, ""), a = i.split(`
|
|
1640
|
+
`), r = 0; r < a.length; r++)
|
|
1641
|
+
a[r].length && (r > 0 || !t) && (a[r] = s + a[r]);
|
|
1642
|
+
return a.join(`
|
|
1559
1643
|
`);
|
|
1560
1644
|
};
|
|
1561
|
-
U.prototype.renderPartial = function(
|
|
1645
|
+
U.prototype.renderPartial = function(i, e, t, s) {
|
|
1562
1646
|
if (t) {
|
|
1563
|
-
var
|
|
1647
|
+
var a = this.getConfigTags(s), r = je(t) ? t(i[1]) : t[i[1]];
|
|
1564
1648
|
if (r != null) {
|
|
1565
|
-
var c =
|
|
1566
|
-
l == 0 &&
|
|
1567
|
-
var p = this.parse(d,
|
|
1568
|
-
return this.renderTokens(p, e, t, d,
|
|
1649
|
+
var c = i[6], l = i[5], u = i[4], d = r;
|
|
1650
|
+
l == 0 && u && (d = this.indentPartial(r, u, c));
|
|
1651
|
+
var p = this.parse(d, a);
|
|
1652
|
+
return this.renderTokens(p, e, t, d, s);
|
|
1569
1653
|
}
|
|
1570
1654
|
}
|
|
1571
1655
|
};
|
|
1572
|
-
U.prototype.unescapedValue = function(
|
|
1573
|
-
var t = e.lookup(
|
|
1656
|
+
U.prototype.unescapedValue = function(i, e) {
|
|
1657
|
+
var t = e.lookup(i[1]);
|
|
1574
1658
|
if (t != null)
|
|
1575
1659
|
return t;
|
|
1576
1660
|
};
|
|
1577
|
-
U.prototype.escapedValue = function(
|
|
1578
|
-
var
|
|
1579
|
-
if (
|
|
1580
|
-
return typeof
|
|
1661
|
+
U.prototype.escapedValue = function(i, e, t) {
|
|
1662
|
+
var s = this.getConfigEscape(t) || P.escape, a = e.lookup(i[1]);
|
|
1663
|
+
if (a != null)
|
|
1664
|
+
return typeof a == "number" && s === P.escape ? String(a) : s(a);
|
|
1581
1665
|
};
|
|
1582
|
-
U.prototype.rawValue = function(
|
|
1583
|
-
return
|
|
1666
|
+
U.prototype.rawValue = function(i) {
|
|
1667
|
+
return i[1];
|
|
1584
1668
|
};
|
|
1585
|
-
U.prototype.getConfigTags = function(
|
|
1586
|
-
return
|
|
1669
|
+
U.prototype.getConfigTags = function(i) {
|
|
1670
|
+
return ie(i) ? i : i && typeof i == "object" ? i.tags : void 0;
|
|
1587
1671
|
};
|
|
1588
|
-
U.prototype.getConfigEscape = function(
|
|
1589
|
-
if (
|
|
1590
|
-
return
|
|
1672
|
+
U.prototype.getConfigEscape = function(i) {
|
|
1673
|
+
if (i && typeof i == "object" && !ie(i))
|
|
1674
|
+
return i.escape;
|
|
1591
1675
|
};
|
|
1592
|
-
var
|
|
1676
|
+
var P = {
|
|
1593
1677
|
name: "mustache.js",
|
|
1594
1678
|
version: "4.2.0",
|
|
1595
1679
|
tags: ["{{", "}}"],
|
|
@@ -1605,32 +1689,45 @@ var F = {
|
|
|
1605
1689
|
* object with set, get and clear methods. This can also be used to disable
|
|
1606
1690
|
* the cache by setting it to the literal `undefined`.
|
|
1607
1691
|
*/
|
|
1608
|
-
set templateCache(
|
|
1609
|
-
|
|
1692
|
+
set templateCache(i) {
|
|
1693
|
+
ge.templateCache = i;
|
|
1610
1694
|
},
|
|
1611
1695
|
/**
|
|
1612
1696
|
* Gets the default or overridden caching object from the default writer.
|
|
1613
1697
|
*/
|
|
1614
1698
|
get templateCache() {
|
|
1615
|
-
return
|
|
1699
|
+
return ge.templateCache;
|
|
1616
1700
|
}
|
|
1617
|
-
},
|
|
1618
|
-
|
|
1619
|
-
return
|
|
1701
|
+
}, ge = new U();
|
|
1702
|
+
P.clearCache = function() {
|
|
1703
|
+
return ge.clearCache();
|
|
1620
1704
|
};
|
|
1621
|
-
|
|
1622
|
-
return
|
|
1705
|
+
P.parse = function(i, e) {
|
|
1706
|
+
return ge.parse(i, e);
|
|
1623
1707
|
};
|
|
1624
|
-
|
|
1625
|
-
if (typeof
|
|
1626
|
-
throw new TypeError('Invalid template! Template should be a "string" but "' +
|
|
1627
|
-
return
|
|
1708
|
+
P.render = function(i, e, t, s) {
|
|
1709
|
+
if (typeof i != "string")
|
|
1710
|
+
throw new TypeError('Invalid template! Template should be a "string" but "' + Ht(i) + '" was given as the first argument for mustache#render(template, view, partials)');
|
|
1711
|
+
return ge.render(i, e, t, s);
|
|
1628
1712
|
};
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
const
|
|
1713
|
+
P.escape = zt;
|
|
1714
|
+
P.Scanner = pe;
|
|
1715
|
+
P.Context = re;
|
|
1716
|
+
P.Writer = U;
|
|
1717
|
+
const aa = {
|
|
1718
|
+
main: {
|
|
1719
|
+
template: `
|
|
1720
|
+
{{#shouldShowAnswer}}
|
|
1721
|
+
<div class="searchstax-answer-container">
|
|
1722
|
+
<div class="searchstax-answer-title">Answer</div>
|
|
1723
|
+
<div class="searchstax-answer-description">
|
|
1724
|
+
{{answer}}
|
|
1725
|
+
</div>
|
|
1726
|
+
</div>
|
|
1727
|
+
{{/shouldShowAnswer}}
|
|
1728
|
+
`
|
|
1729
|
+
}
|
|
1730
|
+
}, sa = {
|
|
1634
1731
|
mainTemplate: {
|
|
1635
1732
|
template: `
|
|
1636
1733
|
{{#hasExternalPromotions}}
|
|
@@ -1664,7 +1761,7 @@ const ta = {
|
|
|
1664
1761
|
</div>
|
|
1665
1762
|
`
|
|
1666
1763
|
}
|
|
1667
|
-
},
|
|
1764
|
+
}, ra = {
|
|
1668
1765
|
mainTemplateDesktop: {
|
|
1669
1766
|
template: `
|
|
1670
1767
|
{{#hasResultsOrExternalPromotions}}
|
|
@@ -1767,7 +1864,7 @@ const ta = {
|
|
|
1767
1864
|
`,
|
|
1768
1865
|
containerClass: "searchstax-facets-pill-facets"
|
|
1769
1866
|
}
|
|
1770
|
-
},
|
|
1867
|
+
}, ia = {
|
|
1771
1868
|
mainTemplate: {
|
|
1772
1869
|
template: `
|
|
1773
1870
|
{{#results.length}}
|
|
@@ -1784,8 +1881,18 @@ const ta = {
|
|
|
1784
1881
|
`,
|
|
1785
1882
|
nextButtonClass: "searchstax-pagination-next",
|
|
1786
1883
|
previousButtonClass: "searchstax-pagination-previous"
|
|
1884
|
+
},
|
|
1885
|
+
infiniteScrollTemplate: {
|
|
1886
|
+
template: `
|
|
1887
|
+
{{#results.length}}
|
|
1888
|
+
{{^isLastPage}}
|
|
1889
|
+
<a class="searchstax-pagination-load-more">Show More</a>
|
|
1890
|
+
{{/isLastPage}}
|
|
1891
|
+
{{/results.length}}
|
|
1892
|
+
`,
|
|
1893
|
+
loadMoreButtonClass: "searchstax-pagination-load-more"
|
|
1787
1894
|
}
|
|
1788
|
-
},
|
|
1895
|
+
}, na = {
|
|
1789
1896
|
main: {
|
|
1790
1897
|
template: `
|
|
1791
1898
|
{{#hasRelatedSearches}}
|
|
@@ -1809,7 +1916,7 @@ const ta = {
|
|
|
1809
1916
|
`,
|
|
1810
1917
|
relatedSearchContainerClass: "searchstax-related-search-item"
|
|
1811
1918
|
}
|
|
1812
|
-
},
|
|
1919
|
+
}, ca = {
|
|
1813
1920
|
main: {
|
|
1814
1921
|
template: `
|
|
1815
1922
|
{{#searchExecuted}}
|
|
@@ -1827,7 +1934,7 @@ const ta = {
|
|
|
1827
1934
|
`,
|
|
1828
1935
|
originalQueryClass: "searchstax-feedback-original-query"
|
|
1829
1936
|
}
|
|
1830
|
-
},
|
|
1937
|
+
}, la = {
|
|
1831
1938
|
mainTemplate: {
|
|
1832
1939
|
template: `
|
|
1833
1940
|
<div class="searchstax-search-input-container">
|
|
@@ -1844,7 +1951,7 @@ const ta = {
|
|
|
1844
1951
|
<div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>
|
|
1845
1952
|
`
|
|
1846
1953
|
}
|
|
1847
|
-
},
|
|
1954
|
+
}, oa = {
|
|
1848
1955
|
mainTemplate: {
|
|
1849
1956
|
template: `
|
|
1850
1957
|
<div class="searchstax-search-results-container">
|
|
@@ -1907,6 +2014,7 @@ const ta = {
|
|
|
1907
2014
|
},
|
|
1908
2015
|
noSearchResultTemplate: {
|
|
1909
2016
|
template: `
|
|
2017
|
+
{{#searchExecuted}}
|
|
1910
2018
|
<div class="searchstax-no-results">
|
|
1911
2019
|
Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
|
|
1912
2020
|
<br>
|
|
@@ -1918,9 +2026,10 @@ const ta = {
|
|
|
1918
2026
|
<p>Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need.</p>
|
|
1919
2027
|
<p>Lost? Click on the ‘X” in the Search Box to reset your search.</p>
|
|
1920
2028
|
</div>
|
|
2029
|
+
{{/searchExecuted}}
|
|
1921
2030
|
`
|
|
1922
2031
|
}
|
|
1923
|
-
},
|
|
2032
|
+
}, ha = {
|
|
1924
2033
|
main: {
|
|
1925
2034
|
template: `
|
|
1926
2035
|
{{#searchExecuted}}
|
|
@@ -1947,12 +2056,12 @@ const ta = {
|
|
|
1947
2056
|
};
|
|
1948
2057
|
class x {
|
|
1949
2058
|
}
|
|
1950
|
-
|
|
1951
|
-
class
|
|
2059
|
+
h(x, "answer", aa), h(x, "externalPromotions", sa), h(x, "facets", ra), h(x, "pagination", ia), h(x, "relatedSearches", na), h(x, "searchFeedback", ca), h(x, "searchInput", la), h(x, "searchResults", oa), h(x, "sorting", ha);
|
|
2060
|
+
class ua {
|
|
1952
2061
|
constructor(e) {
|
|
1953
|
-
|
|
1954
|
-
var t,
|
|
1955
|
-
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.externalPromotionsContainerId = ((
|
|
2062
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "externalPromotionsContainerId"), h(this, "searchExternalPromotionsMainContainer", null);
|
|
2063
|
+
var t, s;
|
|
2064
|
+
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.externalPromotionsContainerId = ((s = (t = this.config.templates) == null ? void 0 : t.mainTemplate) == null ? void 0 : s.externalPromotionsContainerId) || x.externalPromotions.mainTemplate.externalPromotionsContainerId, this.searchExternalPromotionsMainContainer = document.getElementById(
|
|
1956
2065
|
this.containerId
|
|
1957
2066
|
), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
|
|
1958
2067
|
}
|
|
@@ -1969,44 +2078,44 @@ class oa {
|
|
|
1969
2078
|
return this.dataLayer.setExternalPromotionsData(e), e;
|
|
1970
2079
|
}
|
|
1971
2080
|
addExternalSearch(e) {
|
|
1972
|
-
var t,
|
|
2081
|
+
var t, s, a, r;
|
|
1973
2082
|
const c = document.getElementById(this.externalPromotionsContainerId);
|
|
1974
2083
|
if (c) {
|
|
1975
|
-
const l = ((
|
|
1976
|
-
|
|
2084
|
+
const l = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.externalPromotion) == null ? void 0 : a.template) || ((r = x.externalPromotions.externalPromotion) == null ? void 0 : r.template), u = document.createElement("div");
|
|
2085
|
+
u.classList.add("searchstax-external-promotion"), u.addEventListener("click", (d) => {
|
|
1977
2086
|
this.trackClick(e, d);
|
|
1978
|
-
}),
|
|
2087
|
+
}), u.innerHTML = P.render(l, e), c.appendChild(u);
|
|
1979
2088
|
}
|
|
1980
2089
|
}
|
|
1981
2090
|
trackClick(e, t) {
|
|
1982
2091
|
t.stopPropagation(), t.preventDefault(), window.open(e.url, "_blank");
|
|
1983
2092
|
}
|
|
1984
2093
|
renderMainTemplate(e) {
|
|
1985
|
-
var t,
|
|
1986
|
-
const c = ((
|
|
2094
|
+
var t, s, a, r;
|
|
2095
|
+
const c = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.mainTemplate) == null ? void 0 : a.template) || ((r = x.externalPromotions.mainTemplate) == null ? void 0 : r.template);
|
|
1987
2096
|
if (this.dataLayer.renderingEngine === B.mustache) {
|
|
1988
2097
|
this.searchExternalPromotionsMainContainer.innerHTML = //@ts-expect-error - mustache is not a module
|
|
1989
|
-
|
|
2098
|
+
P.render(c, e);
|
|
1990
2099
|
const l = document.getElementById(
|
|
1991
2100
|
this.externalPromotionsContainerId
|
|
1992
2101
|
);
|
|
1993
2102
|
l && (l.innerHTML = "");
|
|
1994
|
-
for (const
|
|
1995
|
-
this.addExternalSearch(
|
|
2103
|
+
for (const u of e.externalPromotions)
|
|
2104
|
+
this.addExternalSearch(u);
|
|
1996
2105
|
}
|
|
1997
2106
|
}
|
|
1998
2107
|
}
|
|
1999
|
-
class
|
|
2108
|
+
class da {
|
|
2000
2109
|
constructor(e, t) {
|
|
2001
|
-
|
|
2002
|
-
if (
|
|
2110
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "routerHelper"), h(this, "cachedPhrase", ""), h(this, "isCached", !1), h(this, "overlayOpened", !1), h(this, "facetPaginationStep"), h(this, "facetPaginationStepMobile"), h(this, "searchFacetsMainContainer", null), h(this, "searchFacetsMobileContainer", null), h(this, "searchFacetsDesktopContainer", null), h(this, "facetLimits", {}), h(this, "facetLimitsMobile", {}), h(this, "deactivatedFacets", {}), h(this, "cachedData", null), h(this, "cacheFacets"), h(this, "onFacetSelect", (s, a, r, c) => {
|
|
2111
|
+
if (s.stopPropagation(), !a.disabled) {
|
|
2003
2112
|
const l = r.querySelector("input");
|
|
2004
2113
|
l.checked = c ? l.checked : !l.checked;
|
|
2005
|
-
const
|
|
2006
|
-
let d = [...
|
|
2007
|
-
const p = this.extractFacetValue(
|
|
2114
|
+
const u = this.dataLayer.searchObject;
|
|
2115
|
+
let d = [...u.facets];
|
|
2116
|
+
const p = this.extractFacetValue(a);
|
|
2008
2117
|
l.checked ? d.find((v) => J.deepEqual(v, p) ? v : !1) || (this.config.facetingType === "tabs" && (d = d.filter((v) => v.name !== p.name)), d.push(p)) : d = d.filter((v) => !J.deepEqual(v, p)), setTimeout(() => {
|
|
2009
|
-
this.dataLayer.setSearchObject({ ...
|
|
2118
|
+
this.dataLayer.setSearchObject({ ...u, facets: d, page: 1 }), this.config.facetingType === "tabs" && this.renderMainTemplate(this.generateTemplateData(), !0);
|
|
2010
2119
|
}, 0);
|
|
2011
2120
|
}
|
|
2012
2121
|
}), this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.routerHelper = e.routerHelper, this.cacheFacets = t, this.facetPaginationStep = this.config.itemsPerPageDesktop, this.facetPaginationStepMobile = this.config.itemsPerPageMobile, this.searchFacetsMainContainer = document.getElementById(this.containerId), this.needCache && t(), this.initializeSubscriptions();
|
|
@@ -2034,138 +2143,138 @@ class ha {
|
|
|
2034
2143
|
};
|
|
2035
2144
|
}
|
|
2036
2145
|
applyFacetLimits(e, t) {
|
|
2037
|
-
const
|
|
2146
|
+
const s = t ? this.facetPaginationStepMobile : this.facetPaginationStep, a = t ? this.facetLimits : this.facetLimitsMobile;
|
|
2038
2147
|
return e.forEach((r) => {
|
|
2039
|
-
|
|
2148
|
+
a[r.name] || (a[r.name] = s);
|
|
2040
2149
|
}), e.map((r) => ({
|
|
2041
2150
|
...r,
|
|
2042
|
-
values: r.values.slice(0,
|
|
2043
|
-
showingAllFacets: r.values.length <=
|
|
2044
|
-
hasMoreFacets: r.values.length >
|
|
2151
|
+
values: r.values.slice(0, a[r.name]),
|
|
2152
|
+
showingAllFacets: r.values.length <= a[r.name],
|
|
2153
|
+
hasMoreFacets: r.values.length > s
|
|
2045
2154
|
}));
|
|
2046
2155
|
}
|
|
2047
2156
|
generateTemplateData(e) {
|
|
2048
2157
|
if (this.generateSelectedFacetsData(), this.dataLayer.searchFacets) {
|
|
2049
2158
|
let t = this.dataLayer.searchFacets;
|
|
2050
|
-
this.needCache && this.dataLayer.searchFacetsCached && (t = this.dataLayer.searchFacetsCached, this.needDisabling && (t = t.map((
|
|
2159
|
+
this.needCache && this.dataLayer.searchFacetsCached && (t = this.dataLayer.searchFacetsCached, this.needDisabling && (t = t.map((a) => {
|
|
2051
2160
|
var r;
|
|
2052
|
-
const c = (r = this.dataLayer.searchFacets) == null ? void 0 : r.find((l) => l.name ===
|
|
2161
|
+
const c = (r = this.dataLayer.searchFacets) == null ? void 0 : r.find((l) => l.name === a.name);
|
|
2053
2162
|
return c ? {
|
|
2054
|
-
...
|
|
2055
|
-
values:
|
|
2056
|
-
const
|
|
2163
|
+
...a,
|
|
2164
|
+
values: a.values.map((l) => {
|
|
2165
|
+
const u = c.values.find((d) => l.type === "range" ? !1 : l.type === "checkbox" ? d.value === l.value : !1);
|
|
2057
2166
|
return {
|
|
2058
2167
|
...l,
|
|
2059
|
-
disabled: !
|
|
2168
|
+
disabled: !u,
|
|
2060
2169
|
isMobile: e
|
|
2061
2170
|
};
|
|
2062
2171
|
})
|
|
2063
2172
|
} : {
|
|
2064
|
-
...
|
|
2065
|
-
values:
|
|
2173
|
+
...a,
|
|
2174
|
+
values: a.values.map((l) => ({
|
|
2066
2175
|
...l,
|
|
2067
2176
|
disabled: !0
|
|
2068
2177
|
})),
|
|
2069
2178
|
isMobile: e
|
|
2070
2179
|
};
|
|
2071
|
-
}))), this.config.specificFacets && (t = t.filter((
|
|
2180
|
+
}))), this.config.specificFacets && (t = t.filter((a) => {
|
|
2072
2181
|
var r;
|
|
2073
|
-
return (r = this.config.specificFacets) == null ? void 0 : r.includes(
|
|
2182
|
+
return (r = this.config.specificFacets) == null ? void 0 : r.includes(a.name);
|
|
2074
2183
|
}));
|
|
2075
|
-
const
|
|
2184
|
+
const s = {
|
|
2076
2185
|
facets: this.applyFacetLimits(t, e),
|
|
2077
2186
|
...this.dataLayer.parsedData.data,
|
|
2078
2187
|
isMobile: e
|
|
2079
2188
|
};
|
|
2080
|
-
return this.dataLayer.setFacetsTemplateData(
|
|
2189
|
+
return this.dataLayer.setFacetsTemplateData(s), s;
|
|
2081
2190
|
} else {
|
|
2082
2191
|
const t = { facets: [], ...this.dataLayer.parsedData.data, isMobile: e };
|
|
2083
2192
|
return this.dataLayer.setFacetsTemplateData(t), t;
|
|
2084
2193
|
}
|
|
2085
2194
|
}
|
|
2086
|
-
createFacetItem(e, t,
|
|
2087
|
-
var
|
|
2088
|
-
const
|
|
2089
|
-
|
|
2090
|
-
const I = ((c = (r = (
|
|
2091
|
-
|
|
2092
|
-
const
|
|
2093
|
-
"." + (((p = (d = (
|
|
2195
|
+
createFacetItem(e, t, s) {
|
|
2196
|
+
var a, r, c, l, u, d, p, v, y, R, M, k;
|
|
2197
|
+
const T = document.createElement("div");
|
|
2198
|
+
T.classList.add("searchstax-facet-container"), this.deactivatedFacets[e.name] || T.classList.add("active");
|
|
2199
|
+
const I = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.facetItemContainerTemplate) == null ? void 0 : c.template) || ((l = x.facets.facetItemContainerTemplate) == null ? void 0 : l.template);
|
|
2200
|
+
T.innerHTML = P.render(I, e), t.appendChild(T);
|
|
2201
|
+
const L = T.querySelector(
|
|
2202
|
+
"." + (((p = (d = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : d.facetItemContainerTemplate) == null ? void 0 : p.facetListTitleContainerClass) || ((v = x.facets.facetItemContainerTemplate) == null ? void 0 : v.facetListTitleContainerClass))
|
|
2094
2203
|
);
|
|
2095
|
-
|
|
2096
|
-
|
|
2204
|
+
L == null || L.addEventListener("click", () => {
|
|
2205
|
+
T.classList.toggle("active");
|
|
2097
2206
|
});
|
|
2098
|
-
const N =
|
|
2099
|
-
"." + (((M = (
|
|
2207
|
+
const N = T.querySelector(
|
|
2208
|
+
"." + (((M = (R = (y = this.config) == null ? void 0 : y.templates) == null ? void 0 : R.facetItemContainerTemplate) == null ? void 0 : M.facetListContainerClass) || ((k = x.facets.facetItemContainerTemplate) == null ? void 0 : k.facetListContainerClass))
|
|
2100
2209
|
);
|
|
2101
2210
|
N && (e.values.forEach((W) => {
|
|
2102
2211
|
this.createFacetListItem(W, N);
|
|
2103
|
-
}), e.hasMoreFacets && this.createHasMoreComponent(e, N,
|
|
2212
|
+
}), e.hasMoreFacets && this.createHasMoreComponent(e, N, s));
|
|
2104
2213
|
}
|
|
2105
2214
|
isChecked(e) {
|
|
2106
2215
|
var t;
|
|
2107
|
-
return !!((t = this.dataLayer.searchObject.facets) != null && t.find((
|
|
2216
|
+
return !!((t = this.dataLayer.searchObject.facets) != null && t.find((s) => J.deepEqual(s, this.extractFacetValue(e))));
|
|
2108
2217
|
}
|
|
2109
2218
|
createFacetListItem(e, t) {
|
|
2110
|
-
var
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
const I = this.isChecked(e),
|
|
2114
|
-
|
|
2219
|
+
var s, a, r, c, l, u, d, p, v, y, R, M, k;
|
|
2220
|
+
const T = document.createElement("div");
|
|
2221
|
+
T.classList.add("searchstax-facet-value-container"), e.disabled && T.classList.add("searchstax-facet-value-disabled");
|
|
2222
|
+
const I = this.isChecked(e), L = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.facetItemTemplate) == null ? void 0 : r.template) || ((c = x.facets.facetItemTemplate) == null ? void 0 : c.template);
|
|
2223
|
+
T.innerHTML = P.render(L, { ...e, isChecked: I });
|
|
2115
2224
|
let N = (l = x.facets.facetItemTemplate) == null ? void 0 : l.checkTriggerClasses;
|
|
2116
|
-
N = ((p = (d = (
|
|
2225
|
+
N = ((p = (d = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : d.facetItemTemplate) == null ? void 0 : p.checkTriggerClasses) || N, N.forEach((W) => {
|
|
2117
2226
|
var A;
|
|
2118
|
-
(A =
|
|
2119
|
-
this.onFacetSelect(
|
|
2227
|
+
(A = T.querySelector("." + W)) == null || A.addEventListener("click", (Q) => {
|
|
2228
|
+
this.onFacetSelect(Q, e, T);
|
|
2120
2229
|
});
|
|
2121
|
-
}), (
|
|
2122
|
-
"." + (((
|
|
2123
|
-
)) == null ||
|
|
2124
|
-
this.onFacetSelect(W, e,
|
|
2125
|
-
}), t.appendChild(
|
|
2126
|
-
}
|
|
2127
|
-
createHasMoreComponent(e, t,
|
|
2128
|
-
var
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
const M =
|
|
2134
|
-
"." + (((p = (d = (
|
|
2230
|
+
}), (k = T.querySelector(
|
|
2231
|
+
"." + (((R = (y = (v = this.config) == null ? void 0 : v.templates) == null ? void 0 : y.facetItemTemplate) == null ? void 0 : R.inputCheckboxClass) || ((M = x.facets.facetItemTemplate) == null ? void 0 : M.inputCheckboxClass))
|
|
2232
|
+
)) == null || k.addEventListener("click", (W) => {
|
|
2233
|
+
this.onFacetSelect(W, e, T, !0);
|
|
2234
|
+
}), t.appendChild(T);
|
|
2235
|
+
}
|
|
2236
|
+
createHasMoreComponent(e, t, s) {
|
|
2237
|
+
var a, r, c, l, u, d, p, v;
|
|
2238
|
+
const y = document.createElement("div");
|
|
2239
|
+
y.classList.add("searchstax-facet-show-more-container");
|
|
2240
|
+
const R = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.showMoreButtonContainerTemplate) == null ? void 0 : c.template) || ((l = x.facets.showMoreButtonContainerTemplate) == null ? void 0 : l.template);
|
|
2241
|
+
y.innerHTML = P.render(R, e);
|
|
2242
|
+
const M = y.querySelector(
|
|
2243
|
+
"." + (((p = (d = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : d.showMoreButtonContainerTemplate) == null ? void 0 : p.showMoreButtonClass) || ((v = x.facets.showMoreButtonContainerTemplate) == null ? void 0 : v.showMoreButtonClass))
|
|
2135
2244
|
);
|
|
2136
|
-
M && (this.attachOnclickToShowMore(e, M,
|
|
2245
|
+
M && (this.attachOnclickToShowMore(e, M, s), t && t.appendChild(M));
|
|
2137
2246
|
}
|
|
2138
|
-
attachOnclickToShowMore(e, t,
|
|
2139
|
-
t.addEventListener("click", (
|
|
2140
|
-
this.onShowMoreLessClick(
|
|
2247
|
+
attachOnclickToShowMore(e, t, s) {
|
|
2248
|
+
t.addEventListener("click", (a) => {
|
|
2249
|
+
this.onShowMoreLessClick(a, e, s);
|
|
2141
2250
|
});
|
|
2142
2251
|
}
|
|
2143
|
-
onShowMoreLessClick(e, t,
|
|
2252
|
+
onShowMoreLessClick(e, t, s) {
|
|
2144
2253
|
e.preventDefault();
|
|
2145
|
-
const
|
|
2146
|
-
r[t.name] === void 0 ? r[t.name] =
|
|
2254
|
+
const a = s ? this.facetPaginationStepMobile : this.facetPaginationStep, r = s ? this.facetLimits : this.facetLimitsMobile;
|
|
2255
|
+
r[t.name] === void 0 ? r[t.name] = a * 2 : r[t.name] <= t.values.length ? r[t.name] = r[t.name] + a : r[t.name] = a, this.generateTemplateData(s), this.renderMainTemplate(this.generateTemplateData());
|
|
2147
2256
|
}
|
|
2148
2257
|
renderMainTemplate(e, t) {
|
|
2149
|
-
var
|
|
2258
|
+
var s, a, r, c, l, u, d, p, v, y, R;
|
|
2150
2259
|
if (e && (!J.deepEqual(this.cachedData ?? {}, e) || t)) {
|
|
2151
2260
|
this.cachedData = e;
|
|
2152
|
-
const M = ((r = (
|
|
2261
|
+
const M = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.mainTemplateDesktop) == null ? void 0 : r.template) || ((c = x.facets.mainTemplateDesktop) == null ? void 0 : c.template);
|
|
2153
2262
|
if (this.dataLayer.renderingEngine === B.mustache && this.searchFacetsMainContainer) {
|
|
2154
|
-
this.searchFacetsMainContainer.innerHTML =
|
|
2263
|
+
this.searchFacetsMainContainer.innerHTML = P.render(M, {
|
|
2155
2264
|
...e
|
|
2156
2265
|
});
|
|
2157
|
-
const
|
|
2158
|
-
"." + (((d = (
|
|
2266
|
+
const k = (p = this.searchFacetsMainContainer) == null ? void 0 : p.querySelector(
|
|
2267
|
+
"." + (((d = (u = (l = this.config) == null ? void 0 : l.templates) == null ? void 0 : u.mainTemplateDesktop) == null ? void 0 : d.facetsContainerClass) || x.facets.mainTemplateDesktop.facetsContainerClass)
|
|
2159
2268
|
);
|
|
2160
|
-
if (
|
|
2161
|
-
|
|
2162
|
-
for (const
|
|
2163
|
-
this.createFacetItem(
|
|
2269
|
+
if (k) {
|
|
2270
|
+
k.innerHTML = "";
|
|
2271
|
+
for (const T of e.facets)
|
|
2272
|
+
this.createFacetItem(T, k);
|
|
2164
2273
|
if (this.searchFacetsMainContainer) {
|
|
2165
|
-
const
|
|
2166
|
-
"." + (((
|
|
2274
|
+
const T = this.searchFacetsMainContainer.querySelector(
|
|
2275
|
+
"." + (((R = (y = (v = this.config) == null ? void 0 : v.templates) == null ? void 0 : y.mainTemplateDesktop) == null ? void 0 : R.selectedFacetsContainerClass) || x.facets.mainTemplateDesktop.selectedFacetsContainerClass)
|
|
2167
2276
|
);
|
|
2168
|
-
|
|
2277
|
+
T && (this.createSelectedFacetsComponents(T), this.createClearFacetsComponents(T));
|
|
2169
2278
|
}
|
|
2170
2279
|
}
|
|
2171
2280
|
}
|
|
@@ -2175,13 +2284,13 @@ class ha {
|
|
|
2175
2284
|
}
|
|
2176
2285
|
generateSelectedFacetsData() {
|
|
2177
2286
|
const e = [], t = this.dataLayer.searchObject.facets;
|
|
2178
|
-
for (const
|
|
2179
|
-
const
|
|
2287
|
+
for (const s of t) {
|
|
2288
|
+
const a = decodeURIComponent(s.name), r = decodeURIComponent(s.value);
|
|
2180
2289
|
if (this.dataLayer.searchFacets) {
|
|
2181
|
-
const c = this.needCache ? this.dataLayer.searchFacetsCached : this.dataLayer.searchFacets, l = c == null ? void 0 : c.find((
|
|
2290
|
+
const c = this.needCache ? this.dataLayer.searchFacetsCached : this.dataLayer.searchFacets, l = c == null ? void 0 : c.find((u) => u.name === a);
|
|
2182
2291
|
if (l) {
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2292
|
+
const u = l.values.find((d) => d.type === "range" ? !1 : d.type === "checkbox" ? `"${d.value}"` == `"${r}"` : !1);
|
|
2293
|
+
u && e.push(u);
|
|
2185
2294
|
}
|
|
2186
2295
|
}
|
|
2187
2296
|
}
|
|
@@ -2189,39 +2298,39 @@ class ha {
|
|
|
2189
2298
|
}
|
|
2190
2299
|
createSelectedFacetsComponents(e) {
|
|
2191
2300
|
var t;
|
|
2192
|
-
this.generateSelectedFacetsData(), (t = this.dataLayer.selectedFacetsTemplateData) == null || t.forEach((
|
|
2193
|
-
this.createSelectedFacetsComponent(e,
|
|
2301
|
+
this.generateSelectedFacetsData(), (t = this.dataLayer.selectedFacetsTemplateData) == null || t.forEach((s) => {
|
|
2302
|
+
this.createSelectedFacetsComponent(e, s);
|
|
2194
2303
|
});
|
|
2195
2304
|
}
|
|
2196
2305
|
createClearFacetsComponents(e) {
|
|
2197
|
-
var t,
|
|
2198
|
-
const p = this.dataLayer.searchObject, v = ((
|
|
2199
|
-
|
|
2306
|
+
var t, s, a, r, c, l, u, d;
|
|
2307
|
+
const p = this.dataLayer.searchObject, v = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.clearFacetsTemplate) == null ? void 0 : a.template) || ((r = x.facets.clearFacetsTemplate) == null ? void 0 : r.template), y = document.createElement("div");
|
|
2308
|
+
y.innerHTML = P.render(v, {
|
|
2200
2309
|
shouldShow: p.facets.length > 0
|
|
2201
2310
|
});
|
|
2202
|
-
const
|
|
2203
|
-
"." + (((
|
|
2311
|
+
const R = y.querySelector(
|
|
2312
|
+
"." + (((u = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.clearFacetsTemplate) == null ? void 0 : u.containerClass) || ((d = x.facets.clearFacetsTemplate) == null ? void 0 : d.containerClass))
|
|
2204
2313
|
);
|
|
2205
|
-
|
|
2314
|
+
R && (R.addEventListener("click", () => {
|
|
2206
2315
|
this.removeSelectedFacets();
|
|
2207
|
-
}), e.appendChild(
|
|
2316
|
+
}), e.appendChild(R));
|
|
2208
2317
|
}
|
|
2209
2318
|
createSelectedFacetsComponent(e, t) {
|
|
2210
|
-
var
|
|
2211
|
-
const v = ((r = (
|
|
2212
|
-
|
|
2213
|
-
const
|
|
2214
|
-
"." + (((d = (
|
|
2319
|
+
var s, a, r, c, l, u, d, p;
|
|
2320
|
+
const v = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.selectedFacetsTemplate) == null ? void 0 : r.template) || ((c = x.facets.selectedFacetsTemplate) == null ? void 0 : c.template), y = document.createElement("div");
|
|
2321
|
+
y.innerHTML = P.render(v, t);
|
|
2322
|
+
const R = y.querySelector(
|
|
2323
|
+
"." + (((d = (u = (l = this.config) == null ? void 0 : l.templates) == null ? void 0 : u.selectedFacetsTemplate) == null ? void 0 : d.containerClass) || ((p = x.facets.selectedFacetsTemplate) == null ? void 0 : p.containerClass))
|
|
2215
2324
|
);
|
|
2216
|
-
|
|
2325
|
+
R && (R.addEventListener("click", () => {
|
|
2217
2326
|
this.unselectFacet(t);
|
|
2218
|
-
}), e.appendChild(
|
|
2327
|
+
}), e.appendChild(R));
|
|
2219
2328
|
}
|
|
2220
2329
|
unselectFacet(e) {
|
|
2221
2330
|
const t = this.dataLayer.searchObject;
|
|
2222
|
-
let
|
|
2223
|
-
e.type === "checkbox" && (
|
|
2224
|
-
this.dataLayer.setSearchObject({ ...t, facets:
|
|
2331
|
+
let s = [...t.facets];
|
|
2332
|
+
e.type === "checkbox" && (s = s.filter((a) => JSON.stringify(a) !== JSON.stringify(this.extractFacetValue(e)))), setTimeout(() => {
|
|
2333
|
+
this.dataLayer.setSearchObject({ ...t, facets: s }), this.generateSelectedFacetsData();
|
|
2225
2334
|
}, 0);
|
|
2226
2335
|
}
|
|
2227
2336
|
removeSelectedFacets() {
|
|
@@ -2229,13 +2338,13 @@ class ha {
|
|
|
2229
2338
|
this.dataLayer.setSearchObject({ ...e, facets: [] });
|
|
2230
2339
|
}
|
|
2231
2340
|
createFilterByComponent(e) {
|
|
2232
|
-
var t,
|
|
2233
|
-
const p = ((
|
|
2234
|
-
v.innerHTML =
|
|
2235
|
-
const
|
|
2236
|
-
"." + (((
|
|
2341
|
+
var t, s, a, r, c, l, u, d;
|
|
2342
|
+
const p = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.filterByTemplate) == null ? void 0 : a.template) || ((r = x.facets.filterByTemplate) == null ? void 0 : r.template), v = document.createElement("div");
|
|
2343
|
+
v.innerHTML = P.render(p, {});
|
|
2344
|
+
const y = v.querySelector(
|
|
2345
|
+
"." + (((u = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.filterByTemplate) == null ? void 0 : u.containerClass) || ((d = x.facets.filterByTemplate) == null ? void 0 : d.containerClass))
|
|
2237
2346
|
);
|
|
2238
|
-
|
|
2347
|
+
y && (e.prepend(y), y.addEventListener("click", this.openOverlay.bind(this)));
|
|
2239
2348
|
}
|
|
2240
2349
|
openOverlay() {
|
|
2241
2350
|
var e;
|
|
@@ -2246,58 +2355,59 @@ class ha {
|
|
|
2246
2355
|
this.overlayOpened = !1, this.searchFacetsMainContainer && (document.body.classList.toggle("searchstax-no-scroll"), (e = this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay")) == null || e.classList.remove("searchstax-show"));
|
|
2247
2356
|
}
|
|
2248
2357
|
renderMobileTemplate(e) {
|
|
2249
|
-
var t,
|
|
2358
|
+
var t, s, a, r, c, l, u, d, p, v, y, R, M, k, T, I, L, N, W;
|
|
2250
2359
|
if (e) {
|
|
2251
2360
|
const A = document.createElement("div");
|
|
2252
2361
|
A.classList.add("searchstax-facets-container-mobile");
|
|
2253
|
-
const
|
|
2362
|
+
const Q = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.mainTemplateMobile) == null ? void 0 : a.template) || ((r = x.facets.mainTemplateMobile) == null ? void 0 : r.template);
|
|
2254
2363
|
if (this.dataLayer.renderingEngine === B.mustache) {
|
|
2255
|
-
if (A.innerHTML =
|
|
2364
|
+
if (A.innerHTML = P.render(Q, {
|
|
2256
2365
|
...e,
|
|
2257
2366
|
overlayOpened: this.overlayOpened
|
|
2258
|
-
}), (c = this.searchFacetsMainContainer) == null || c.appendChild(A), (
|
|
2259
|
-
for (const
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2367
|
+
}), (c = this.searchFacetsMainContainer) == null || c.appendChild(A), (u = (l = this.config) == null ? void 0 : l.templates) != null && u.mainTemplateMobile)
|
|
2368
|
+
for (const $ of ((v = (p = (d = this.config) == null ? void 0 : d.templates) == null ? void 0 : p.mainTemplateMobile) == null ? void 0 : v.closeOverlayTriggerClasses) || []) {
|
|
2369
|
+
const G = A.querySelector("." + $);
|
|
2370
|
+
G && G.addEventListener("click", this.closeOverlay.bind(this));
|
|
2262
2371
|
}
|
|
2263
2372
|
else
|
|
2264
|
-
for (const
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2373
|
+
for (const $ of x.facets.mainTemplateMobile.closeOverlayTriggerClasses) {
|
|
2374
|
+
const G = A.querySelector("." + $);
|
|
2375
|
+
G && G.addEventListener("click", this.closeOverlay.bind(this));
|
|
2267
2376
|
}
|
|
2268
2377
|
const m = A.querySelector(
|
|
2269
|
-
"." + (((M = (
|
|
2378
|
+
"." + (((M = (R = (y = this.config) == null ? void 0 : y.templates) == null ? void 0 : R.mainTemplateMobile) == null ? void 0 : M.filterByContainerClass) || x.facets.mainTemplateMobile.filterByContainerClass)
|
|
2270
2379
|
);
|
|
2271
2380
|
m && this.createFilterByComponent(m);
|
|
2272
|
-
const
|
|
2273
|
-
"." + (((I = (
|
|
2381
|
+
const b = A.querySelector(
|
|
2382
|
+
"." + (((I = (T = (k = this.config) == null ? void 0 : k.templates) == null ? void 0 : T.mainTemplateMobile) == null ? void 0 : I.selectedFacetsContainerClass) || x.facets.mainTemplateMobile.selectedFacetsContainerClass)
|
|
2274
2383
|
);
|
|
2275
|
-
|
|
2276
|
-
const
|
|
2277
|
-
"." + (((W = (N = (
|
|
2384
|
+
b && (this.createSelectedFacetsComponents(b), this.createClearFacetsComponents(b));
|
|
2385
|
+
const F = A.querySelector(
|
|
2386
|
+
"." + (((W = (N = (L = this.config) == null ? void 0 : L.templates) == null ? void 0 : N.mainTemplateMobile) == null ? void 0 : W.facetsContainerClass) || x.facets.mainTemplateMobile.facetsContainerClass)
|
|
2278
2387
|
);
|
|
2279
|
-
if (
|
|
2280
|
-
|
|
2281
|
-
for (const
|
|
2282
|
-
this.createFacetItem(
|
|
2388
|
+
if (F) {
|
|
2389
|
+
F.innerHTML = "";
|
|
2390
|
+
for (const $ of e.facets)
|
|
2391
|
+
this.createFacetItem($, F, !0);
|
|
2283
2392
|
}
|
|
2284
2393
|
}
|
|
2285
2394
|
}
|
|
2286
2395
|
}
|
|
2287
2396
|
}
|
|
2288
|
-
class
|
|
2397
|
+
class ga {
|
|
2289
2398
|
constructor(e) {
|
|
2290
|
-
|
|
2291
|
-
var t,
|
|
2292
|
-
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.routerHelper = e.routerHelper, this.previousButtonClass = ((
|
|
2399
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "previousButtonClass"), h(this, "nextButtonClass"), h(this, "loadMoreButtonClass"), h(this, "routerHelper"), h(this, "searchPaginationMainContainer", null);
|
|
2400
|
+
var t, s, a, r, c, l, u, d, p;
|
|
2401
|
+
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.routerHelper = e.routerHelper, this.previousButtonClass = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.mainTemplate) == null ? void 0 : a.previousButtonClass) ?? x.pagination.mainTemplate.previousButtonClass, this.nextButtonClass = ((l = (c = (r = this.config) == null ? void 0 : r.templates) == null ? void 0 : c.mainTemplate) == null ? void 0 : l.nextButtonClass) ?? x.pagination.mainTemplate.nextButtonClass, this.loadMoreButtonClass = ((p = (d = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : d.infiniteScrollTemplate) == null ? void 0 : p.loadMoreButtonClass) ?? x.pagination.infiniteScrollTemplate.loadMoreButtonClass, this.searchPaginationMainContainer = document.getElementById(
|
|
2402
|
+
this.containerId
|
|
2403
|
+
), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
|
|
2293
2404
|
}
|
|
2294
2405
|
get isFirstPage() {
|
|
2295
2406
|
var e;
|
|
2296
2407
|
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === 1;
|
|
2297
2408
|
}
|
|
2298
2409
|
get isLastPage() {
|
|
2299
|
-
|
|
2300
|
-
return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === Math.ceil((((t = this.dataLayer.searchResultsMetadata) == null ? void 0 : t.totalResultsValue) ?? 0) / 10);
|
|
2410
|
+
return this.dataLayer.parsedData.data.isLastPage;
|
|
2301
2411
|
}
|
|
2302
2412
|
initializeSubscriptions() {
|
|
2303
2413
|
this.dataLayer.$searchResults.subscribe((e) => {
|
|
@@ -2305,27 +2415,30 @@ class ua {
|
|
|
2305
2415
|
});
|
|
2306
2416
|
}
|
|
2307
2417
|
generateTemplateData() {
|
|
2308
|
-
var e, t,
|
|
2418
|
+
var e, t, s, a;
|
|
2309
2419
|
const r = {
|
|
2310
2420
|
...this.dataLayer.parsedData.data,
|
|
2311
2421
|
previousPageLink: (t = this.routerHelper) == null ? void 0 : t.searchObjectToUrl({
|
|
2312
2422
|
...this.dataLayer.searchObject,
|
|
2313
2423
|
page: ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) - 1
|
|
2314
2424
|
}),
|
|
2315
|
-
nextPageLink: (
|
|
2425
|
+
nextPageLink: (a = this.routerHelper) == null ? void 0 : a.searchObjectToUrl({
|
|
2316
2426
|
...this.dataLayer.searchObject,
|
|
2317
|
-
page: ((
|
|
2427
|
+
page: ((s = this.dataLayer.searchObject) == null ? void 0 : s.page) + 1
|
|
2318
2428
|
})
|
|
2319
2429
|
};
|
|
2320
2430
|
return this.dataLayer.setPaginationData(r), r;
|
|
2321
2431
|
}
|
|
2322
|
-
goToPage(e) {
|
|
2323
|
-
const
|
|
2324
|
-
|
|
2432
|
+
goToPage(e, t) {
|
|
2433
|
+
const s = this.dataLayer.searchObject;
|
|
2434
|
+
s && (s.page = e, this.dataLayer.setSearchObject(s)), t || window.scrollTo(0, 0);
|
|
2325
2435
|
}
|
|
2326
2436
|
nextPage(e) {
|
|
2327
2437
|
var t;
|
|
2328
|
-
e.preventDefault(), e.stopPropagation(), this.isLastPage || this.goToPage(
|
|
2438
|
+
e.preventDefault(), e.stopPropagation(), this.isLastPage || this.goToPage(
|
|
2439
|
+
((t = this.dataLayer.searchObject) == null ? void 0 : t.page) + 1,
|
|
2440
|
+
this.dataLayer.isInfiniteScroll
|
|
2441
|
+
);
|
|
2329
2442
|
}
|
|
2330
2443
|
previousPage(e) {
|
|
2331
2444
|
var t;
|
|
@@ -2333,24 +2446,36 @@ class ua {
|
|
|
2333
2446
|
}
|
|
2334
2447
|
overridePaginationEvents() {
|
|
2335
2448
|
if (this.searchPaginationMainContainer) {
|
|
2336
|
-
const e = this.searchPaginationMainContainer.querySelector(
|
|
2337
|
-
|
|
2449
|
+
const e = this.searchPaginationMainContainer.querySelector(
|
|
2450
|
+
"." + this.previousButtonClass
|
|
2451
|
+
), t = this.searchPaginationMainContainer.querySelector(
|
|
2452
|
+
"." + this.nextButtonClass
|
|
2453
|
+
), s = this.searchPaginationMainContainer.querySelector(
|
|
2454
|
+
"." + this.loadMoreButtonClass
|
|
2455
|
+
);
|
|
2456
|
+
e && e.addEventListener(
|
|
2457
|
+
"click",
|
|
2458
|
+
this.previousPage.bind(this)
|
|
2459
|
+
), t && t.addEventListener("click", this.nextPage.bind(this)), s && s.addEventListener("click", this.nextPage.bind(this));
|
|
2338
2460
|
}
|
|
2339
2461
|
}
|
|
2340
2462
|
renderMainTemplate(e) {
|
|
2341
|
-
var t,
|
|
2342
|
-
this.searchPaginationMainContainer && ((t = this.searchPaginationMainContainer.querySelector("." + this.previousButtonClass)) == null || t.removeEventListener("click", this.previousPage), (
|
|
2343
|
-
|
|
2344
|
-
this.dataLayer.renderingEngine === B.mustache && (this.searchPaginationMainContainer.innerHTML =
|
|
2463
|
+
var t, s, a, r, c, l, u, d, p, v;
|
|
2464
|
+
this.searchPaginationMainContainer && ((t = this.searchPaginationMainContainer.querySelector("." + this.previousButtonClass)) == null || t.removeEventListener("click", this.previousPage), (s = this.searchPaginationMainContainer.querySelector("." + this.nextButtonClass)) == null || s.removeEventListener("click", this.nextPage));
|
|
2465
|
+
let y = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.mainTemplate) == null ? void 0 : c.template) || ((l = x.pagination.mainTemplate) == null ? void 0 : l.template);
|
|
2466
|
+
this.dataLayer.isInfiniteScroll && (y = ((p = (d = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : d.infiniteScrollTemplate) == null ? void 0 : p.template) || ((v = x.pagination.infiniteScrollTemplate) == null ? void 0 : v.template)), this.dataLayer.renderingEngine === B.mustache && (this.searchPaginationMainContainer.innerHTML = P.render(
|
|
2467
|
+
y,
|
|
2468
|
+
e
|
|
2469
|
+
), setTimeout(() => {
|
|
2345
2470
|
this.overridePaginationEvents();
|
|
2346
2471
|
}, 0));
|
|
2347
2472
|
}
|
|
2348
2473
|
}
|
|
2349
|
-
class
|
|
2474
|
+
class pa {
|
|
2350
2475
|
constructor(e) {
|
|
2351
|
-
|
|
2352
|
-
var t,
|
|
2353
|
-
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.relatedSearchesContainerClass = ((
|
|
2476
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "relatedSearchesContainerClass"), h(this, "searchRelatedSearchesMainContainer", null), h(this, "track");
|
|
2477
|
+
var t, s;
|
|
2478
|
+
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.relatedSearchesContainerClass = ((s = (t = this.config.templates) == null ? void 0 : t.main) == null ? void 0 : s.relatedSearchesContainerClass) || x.relatedSearches.main.relatedSearchesContainerClass, this.searchRelatedSearchesMainContainer = document.getElementById(this.containerId), this.track = e.trackRelatedSearchClick, this.initializeSubscriptions();
|
|
2354
2479
|
}
|
|
2355
2480
|
initializeSubscriptions() {
|
|
2356
2481
|
this.dataLayer.$searchRelatedSearches.subscribe((e) => {
|
|
@@ -2364,11 +2489,11 @@ class da {
|
|
|
2364
2489
|
return this.dataLayer.setRelatedSearchesData(e), e;
|
|
2365
2490
|
}
|
|
2366
2491
|
addRelatedSearchComponent(e, t) {
|
|
2367
|
-
var
|
|
2368
|
-
const
|
|
2492
|
+
var s, a, r, c, l;
|
|
2493
|
+
const u = document.createElement("div"), d = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.relatedSearch) == null ? void 0 : r.template) || x.relatedSearches.relatedSearch.template;
|
|
2369
2494
|
if (this.dataLayer.renderingEngine === B.mustache) {
|
|
2370
|
-
|
|
2371
|
-
const p =
|
|
2495
|
+
u.innerHTML = P.render(d, e);
|
|
2496
|
+
const p = u.querySelector(
|
|
2372
2497
|
"." + (((l = (c = this.config.templates) == null ? void 0 : c.relatedSearch) == null ? void 0 : l.relatedSearchContainerClass) || x.relatedSearches.relatedSearch.relatedSearchContainerClass)
|
|
2373
2498
|
);
|
|
2374
2499
|
p && (t.appendChild(p), p.addEventListener("click", () => {
|
|
@@ -2381,23 +2506,23 @@ class da {
|
|
|
2381
2506
|
t.query = e.related_search, this.dataLayer.setSearchObject(t), this.track(e);
|
|
2382
2507
|
}
|
|
2383
2508
|
renderMainTemplate(e) {
|
|
2384
|
-
var t,
|
|
2385
|
-
const c = ((
|
|
2509
|
+
var t, s, a, r;
|
|
2510
|
+
const c = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || x.relatedSearches.main.template;
|
|
2386
2511
|
if (this.dataLayer.renderingEngine === B.mustache && this.searchRelatedSearchesMainContainer) {
|
|
2387
2512
|
this.searchRelatedSearchesMainContainer.innerHTML = "", this.searchRelatedSearchesMainContainer.innerHTML = //@ts-expect-error - mustache is not a module
|
|
2388
|
-
|
|
2513
|
+
P.render(c, e);
|
|
2389
2514
|
const l = (r = this.searchRelatedSearchesMainContainer) == null ? void 0 : r.querySelector(
|
|
2390
2515
|
`.${this.relatedSearchesContainerClass}`
|
|
2391
2516
|
);
|
|
2392
2517
|
if (l)
|
|
2393
|
-
for (const
|
|
2394
|
-
this.addRelatedSearchComponent(
|
|
2518
|
+
for (const u of e.relatedSearches)
|
|
2519
|
+
this.addRelatedSearchComponent(u, l);
|
|
2395
2520
|
}
|
|
2396
2521
|
}
|
|
2397
2522
|
}
|
|
2398
|
-
class
|
|
2523
|
+
class ma {
|
|
2399
2524
|
constructor(e) {
|
|
2400
|
-
|
|
2525
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "searchFeedbackMainContainer", null), h(this, "searchTrigger"), this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.searchTrigger = e.searchTrigger, this.searchFeedbackMainContainer = document.getElementById(this.containerId), this.initializeSubscriptions();
|
|
2401
2526
|
}
|
|
2402
2527
|
initializeSubscriptions() {
|
|
2403
2528
|
this.dataLayer.$searchResults.subscribe((e) => {
|
|
@@ -2413,41 +2538,41 @@ class ga {
|
|
|
2413
2538
|
onOriginalQueryClick(e) {
|
|
2414
2539
|
var t;
|
|
2415
2540
|
e.stopPropagation(), e.preventDefault();
|
|
2416
|
-
const
|
|
2417
|
-
this.searchTrigger(
|
|
2541
|
+
const s = (t = e.target) == null ? void 0 : t.innerHTML;
|
|
2542
|
+
this.searchTrigger(s, !0);
|
|
2418
2543
|
}
|
|
2419
2544
|
attachClick() {
|
|
2420
|
-
var e, t,
|
|
2545
|
+
var e, t, s, a, r;
|
|
2421
2546
|
const c = (r = this.searchFeedbackMainContainer) == null ? void 0 : r.querySelector(
|
|
2422
|
-
"." + (((
|
|
2547
|
+
"." + (((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.main) == null ? void 0 : s.originalQueryClass) || ((a = x.searchFeedback.main) == null ? void 0 : a.originalQueryClass))
|
|
2423
2548
|
);
|
|
2424
2549
|
c && c.addEventListener("click", this.onOriginalQueryClick.bind(this));
|
|
2425
2550
|
}
|
|
2426
2551
|
renderMainTemplate(e) {
|
|
2427
|
-
var t,
|
|
2428
|
-
const r = ((
|
|
2429
|
-
this.dataLayer.renderingEngine === B.mustache && (this.searchFeedbackMainContainer.innerHTML =
|
|
2552
|
+
var t, s, a;
|
|
2553
|
+
const r = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || x.searchFeedback.main.template;
|
|
2554
|
+
this.dataLayer.renderingEngine === B.mustache && (this.searchFeedbackMainContainer.innerHTML = P.render(r, e), setTimeout(() => {
|
|
2430
2555
|
this.attachClick();
|
|
2431
2556
|
}, 0));
|
|
2432
2557
|
}
|
|
2433
2558
|
}
|
|
2434
|
-
class
|
|
2559
|
+
class fa {
|
|
2435
2560
|
constructor(e) {
|
|
2436
|
-
|
|
2561
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "suggestAfterMinChars"), h(this, "containerId"), h(this, "currentInputValue", ""), h(this, "autosuggestResults"), h(this, "searchInput"), h(this, "actionButton"), h(this, "autosuggestContainer"), h(this, "buttonState", "search"), h(this, "selectedAutosuggestItem", -1), h(this, "suggestTrigger"), h(this, "searchTrigger"), this.dataLayer = e.dataLayer, this.config = e.config, this.searchTrigger = e.searchTrigger, this.suggestTrigger = e.suggestTrigger, this.containerId = e.containerId, this.suggestAfterMinChars = e.config.suggestAfterMinChars, this.renderMainTemplate(), this.actionButtonInit(), this.updateActionButtonState("search"), this.searchInput && (this.createAutosuggestContainer(), this.attachSubscriptions());
|
|
2437
2562
|
}
|
|
2438
2563
|
renderMainTemplate() {
|
|
2439
|
-
var e, t,
|
|
2564
|
+
var e, t, s, a;
|
|
2440
2565
|
const r = document.getElementById(this.containerId);
|
|
2441
2566
|
if (!r)
|
|
2442
2567
|
throw new Error("Search input container not found");
|
|
2443
2568
|
const c = ((t = (e = this.config.templates) == null ? void 0 : e.mainTemplate) == null ? void 0 : t.template) || x.searchInput.mainTemplate.template;
|
|
2444
2569
|
if (this.dataLayer.renderingEngine === B.mustache) {
|
|
2445
|
-
const d =
|
|
2570
|
+
const d = P.render(c, {});
|
|
2446
2571
|
r.innerHTML = d;
|
|
2447
2572
|
}
|
|
2448
|
-
const l = ((
|
|
2449
|
-
if (
|
|
2450
|
-
this.searchInput =
|
|
2573
|
+
const l = ((a = (s = this.config.templates) == null ? void 0 : s.mainTemplate) == null ? void 0 : a.searchInputId) || x.searchInput.mainTemplate.searchInputId, u = document.querySelector(`#${l}`);
|
|
2574
|
+
if (u)
|
|
2575
|
+
this.searchInput = u, u.addEventListener("keyup", this.inputKeyupEvent.bind(this)), u.addEventListener("blur", this.hideAutosuggest.bind(this)), u.addEventListener("paste", this.inputPasteEvent.bind(this));
|
|
2451
2576
|
else
|
|
2452
2577
|
throw new Error("Input not found");
|
|
2453
2578
|
}
|
|
@@ -2507,8 +2632,8 @@ class pa {
|
|
|
2507
2632
|
markActiveAutosuggestItem() {
|
|
2508
2633
|
const e = document.getElementsByClassName("searchstax-autosuggest-item");
|
|
2509
2634
|
for (let t = 0; t < e.length; t++) {
|
|
2510
|
-
const
|
|
2511
|
-
t === this.selectedAutosuggestItem ?
|
|
2635
|
+
const s = e[t];
|
|
2636
|
+
t === this.selectedAutosuggestItem ? s.classList.add("active") : s.classList.remove("active");
|
|
2512
2637
|
}
|
|
2513
2638
|
}
|
|
2514
2639
|
inputKeyupEvent(e) {
|
|
@@ -2544,15 +2669,15 @@ class pa {
|
|
|
2544
2669
|
this.searchInput.value = this.cleanSuggestionTerm(e.term ?? ""), this.executeSearch(this.cleanSuggestionTerm(e.term));
|
|
2545
2670
|
}
|
|
2546
2671
|
createAutosuggestItem(e) {
|
|
2547
|
-
var t,
|
|
2672
|
+
var t, s, a;
|
|
2548
2673
|
const r = document.createElement("div");
|
|
2549
2674
|
r.classList.add("searchstax-autosuggest-item"), r.addEventListener("click", () => {
|
|
2550
2675
|
this.autosuggestItemClicked(e);
|
|
2551
2676
|
}), r.addEventListener("mouseenter", () => {
|
|
2552
2677
|
this.onSuggestionEnter(e);
|
|
2553
2678
|
});
|
|
2554
|
-
const c = ((
|
|
2555
|
-
return r.innerHTML =
|
|
2679
|
+
const c = ((s = (t = this.config.templates) == null ? void 0 : t.autosuggestItemTemplate) == null ? void 0 : s.template) || ((a = x.searchInput.autosuggestItemTemplate) == null ? void 0 : a.template);
|
|
2680
|
+
return r.innerHTML = P.render(c, e), r;
|
|
2556
2681
|
}
|
|
2557
2682
|
onSuggestionEnter(e) {
|
|
2558
2683
|
var t;
|
|
@@ -2562,10 +2687,10 @@ class pa {
|
|
|
2562
2687
|
this.autosuggestContainer && (this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.remove("hidden"));
|
|
2563
2688
|
for (const t in e.suggest)
|
|
2564
2689
|
if (Object.prototype.hasOwnProperty.call(e.suggest, t)) {
|
|
2565
|
-
const
|
|
2566
|
-
for (const
|
|
2567
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2568
|
-
const r = a
|
|
2690
|
+
const s = e.suggest[t];
|
|
2691
|
+
for (const a in s)
|
|
2692
|
+
if (Object.prototype.hasOwnProperty.call(s, a)) {
|
|
2693
|
+
const r = s[a];
|
|
2569
2694
|
this.autosuggestResults = r, this.dataLayer.setAutosuggestResults(r), r.numFound > 0 ? r.suggestions.forEach((c) => {
|
|
2570
2695
|
this.autosuggestContainer && this.autosuggestContainer.appendChild(this.createAutosuggestItem(c));
|
|
2571
2696
|
}) : this.autosuggestContainer && this.autosuggestContainer.classList.add("hidden");
|
|
@@ -2573,9 +2698,11 @@ class pa {
|
|
|
2573
2698
|
}
|
|
2574
2699
|
}
|
|
2575
2700
|
}
|
|
2576
|
-
class
|
|
2701
|
+
class va {
|
|
2577
2702
|
constructor(e) {
|
|
2578
|
-
|
|
2703
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "linkClickCallback"), h(this, "searchCallback"), h(this, "containerId"), h(this, "searchResultsMainContainer"), h(this, "searchResultsContainer"), h(this, "searchResultLinks", []), this.linkClickCallback = e.linkClickCallback, this.searchCallback = e.searchTrigger, this.dataLayer = e.dataLayer, this.config = e.config, setTimeout(() => {
|
|
2704
|
+
this.dataLayer.setSearchObject({ ...this.dataLayer.searchObject, itemsPerPage: this.config.resultsPerPage || 10 });
|
|
2705
|
+
}, 0), this.containerId = e.containerId;
|
|
2579
2706
|
const t = document.getElementById(this.containerId);
|
|
2580
2707
|
if (t)
|
|
2581
2708
|
this.searchResultsMainContainer = t;
|
|
@@ -2583,7 +2710,7 @@ class ma {
|
|
|
2583
2710
|
throw new Error(
|
|
2584
2711
|
`Search Results Main Container with id ${this.containerId} not found`
|
|
2585
2712
|
);
|
|
2586
|
-
this.initializeSubscriptions(), this.renderMainTemplate();
|
|
2713
|
+
this.dataLayer.setIsInfiniteScroll(e.config.renderMethod === "infiniteScroll"), this.initializeSubscriptions(), this.renderMainTemplate();
|
|
2587
2714
|
}
|
|
2588
2715
|
initializeSubscriptions() {
|
|
2589
2716
|
this.dataLayer.$searchResults.subscribe((e) => {
|
|
@@ -2594,29 +2721,29 @@ class ma {
|
|
|
2594
2721
|
this.dataLayer.searchResults && this.renderResults(this.dataLayer.searchResults);
|
|
2595
2722
|
}
|
|
2596
2723
|
renderNoResultsTemplate() {
|
|
2597
|
-
var e, t,
|
|
2598
|
-
const c = ((
|
|
2599
|
-
if (this.dataLayer.renderingEngine === B.mustache && this.searchResultsContainer && (this.searchResultsContainer.innerHTML =
|
|
2724
|
+
var e, t, s, a, r;
|
|
2725
|
+
const c = ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.noSearchResultTemplate) == null ? void 0 : s.template) || ((a = x.searchResults.noSearchResultTemplate) == null ? void 0 : a.template), l = ((r = this.dataLayer.searchResultsMetadata) == null ? void 0 : r.spellingSuggestion) ?? "";
|
|
2726
|
+
if (this.dataLayer.renderingEngine === B.mustache && this.searchResultsContainer && (this.searchResultsContainer.innerHTML = P.render(
|
|
2600
2727
|
c,
|
|
2601
2728
|
{
|
|
2602
2729
|
spellingSuggestion: l,
|
|
2603
2730
|
searchTerm: this.dataLayer.searchTerm
|
|
2604
2731
|
}
|
|
2605
2732
|
)), l && this.searchResultsContainer) {
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2733
|
+
const u = this.searchResultsContainer.querySelector("a");
|
|
2734
|
+
u && u.addEventListener("click", (d) => {
|
|
2608
2735
|
d.preventDefault(), d.stopPropagation(), this.searchCallback(l);
|
|
2609
2736
|
});
|
|
2610
2737
|
}
|
|
2611
2738
|
}
|
|
2612
2739
|
renderResults(e) {
|
|
2613
|
-
var t, a,
|
|
2740
|
+
var t, s, a, r, c;
|
|
2614
2741
|
if (this.dataLayer.renderingEngine === B.mustache && this.searchResultsContainer)
|
|
2615
2742
|
if (this.removeLinkClickEvents(), e.length === 0)
|
|
2616
2743
|
this.renderNoResultsTemplate();
|
|
2617
2744
|
else {
|
|
2618
|
-
const
|
|
2619
|
-
this.searchResultsContainer.innerHTML =
|
|
2745
|
+
const l = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.searchResultTemplate) == null ? void 0 : a.template) || ((r = x.searchResults.searchResultTemplate) == null ? void 0 : r.template), u = e.map((d) => P.render(l, d));
|
|
2746
|
+
((c = this.config) == null ? void 0 : c.renderMethod) === "infiniteScroll" && this.dataLayer.searchObject.page > 1 ? this.searchResultsContainer.innerHTML += u.join("") : this.searchResultsContainer.innerHTML = u.join(""), this.searchResultLinks = Array.from(
|
|
2620
2747
|
this.searchResultsContainer.querySelectorAll(
|
|
2621
2748
|
`[${this.uniqueIdAttribute}]`
|
|
2622
2749
|
)
|
|
@@ -2630,39 +2757,39 @@ class ma {
|
|
|
2630
2757
|
});
|
|
2631
2758
|
}
|
|
2632
2759
|
get uniqueIdAttribute() {
|
|
2633
|
-
var e, t,
|
|
2634
|
-
return ((
|
|
2760
|
+
var e, t, s, a;
|
|
2761
|
+
return ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.searchResultTemplate) == null ? void 0 : s.searchResultUniqueIdAttribute) || ((a = x.searchResults.searchResultTemplate) == null ? void 0 : a.searchResultUniqueIdAttribute);
|
|
2635
2762
|
}
|
|
2636
2763
|
attachLinkClickEvents() {
|
|
2637
2764
|
this.searchResultLinks.forEach((e) => {
|
|
2638
2765
|
e.addEventListener("click", (t) => {
|
|
2639
2766
|
t.preventDefault(), t.stopPropagation();
|
|
2640
|
-
const
|
|
2641
|
-
|
|
2767
|
+
const s = e.getAttribute(this.uniqueIdAttribute) ?? "";
|
|
2768
|
+
s && this.linkClickCallback(s);
|
|
2642
2769
|
});
|
|
2643
2770
|
});
|
|
2644
2771
|
}
|
|
2645
2772
|
renderMainTemplate() {
|
|
2646
|
-
var e, t,
|
|
2647
|
-
const r = ((
|
|
2648
|
-
this.dataLayer.renderingEngine === B.mustache && (this.searchResultsMainContainer.innerHTML =
|
|
2773
|
+
var e, t, s, a;
|
|
2774
|
+
const r = ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.mainTemplate) == null ? void 0 : s.template) || ((a = x.searchResults.mainTemplate) == null ? void 0 : a.template);
|
|
2775
|
+
this.dataLayer.renderingEngine === B.mustache && (this.searchResultsMainContainer.innerHTML = P.render(
|
|
2649
2776
|
r,
|
|
2650
2777
|
{}
|
|
2651
2778
|
), setTimeout(() => {
|
|
2652
|
-
var c, l,
|
|
2653
|
-
const
|
|
2779
|
+
var c, l, u, d, p, v, y;
|
|
2780
|
+
const R = (u = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.mainTemplate) != null && u.searchResultsContainerId ? (v = (p = (d = this.config) == null ? void 0 : d.templates) == null ? void 0 : p.mainTemplate) == null ? void 0 : v.searchResultsContainerId : (y = x.searchResults.mainTemplate) == null ? void 0 : y.searchResultsContainerId, M = document.getElementById(R);
|
|
2654
2781
|
if (M)
|
|
2655
2782
|
this.searchResultsContainer = M;
|
|
2656
2783
|
else
|
|
2657
|
-
throw new Error(`Search Results Container with id ${
|
|
2784
|
+
throw new Error(`Search Results Container with id ${R} not found`);
|
|
2658
2785
|
}, 0));
|
|
2659
2786
|
}
|
|
2660
2787
|
}
|
|
2661
|
-
class
|
|
2788
|
+
class ya {
|
|
2662
2789
|
constructor(e) {
|
|
2663
|
-
|
|
2664
|
-
var t,
|
|
2665
|
-
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.selectId = ((
|
|
2790
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "selectId"), h(this, "searchSortingMainContainer", null);
|
|
2791
|
+
var t, s;
|
|
2792
|
+
this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.selectId = ((s = (t = this.config.templates) == null ? void 0 : t.main) == null ? void 0 : s.selectId) || x.sorting.main.selectId, this.searchSortingMainContainer = document.getElementById(this.containerId), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
|
|
2666
2793
|
}
|
|
2667
2794
|
initializeSubscriptions() {
|
|
2668
2795
|
this.dataLayer.$searchResults.subscribe((e) => {
|
|
@@ -2693,10 +2820,10 @@ class fa {
|
|
|
2693
2820
|
}
|
|
2694
2821
|
}
|
|
2695
2822
|
renderMainTemplate(e) {
|
|
2696
|
-
var t,
|
|
2697
|
-
const r = ((
|
|
2823
|
+
var t, s, a;
|
|
2824
|
+
const r = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || x.sorting.main.template;
|
|
2698
2825
|
if (this.dataLayer.renderingEngine === B.mustache) {
|
|
2699
|
-
this.searchSortingMainContainer.innerHTML =
|
|
2826
|
+
this.searchSortingMainContainer.innerHTML = P.render(
|
|
2700
2827
|
r,
|
|
2701
2828
|
e
|
|
2702
2829
|
), this.markOptionSelected();
|
|
@@ -2709,37 +2836,67 @@ class fa {
|
|
|
2709
2836
|
}
|
|
2710
2837
|
}
|
|
2711
2838
|
}
|
|
2712
|
-
class
|
|
2839
|
+
class xa {
|
|
2840
|
+
constructor(e) {
|
|
2841
|
+
h(this, "dataLayer"), h(this, "config"), h(this, "containerId"), h(this, "answerContainer", null), this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId, this.answerContainer = document.getElementById(this.containerId), this.initializeSubscriptions(), this.dataLayer.setIsAnswerWidgetCreated(!0);
|
|
2842
|
+
}
|
|
2843
|
+
initializeSubscriptions() {
|
|
2844
|
+
this.dataLayer.$answer.subscribe(() => {
|
|
2845
|
+
this.renderMainTemplate(this.dataLayer.parsedData.data);
|
|
2846
|
+
}), this.dataLayer.$paginationData.subscribe(() => {
|
|
2847
|
+
this.renderMainTemplate(this.dataLayer.parsedData.data);
|
|
2848
|
+
});
|
|
2849
|
+
}
|
|
2850
|
+
renderMainTemplate(e) {
|
|
2851
|
+
var t, s, a;
|
|
2852
|
+
const r = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || x.answer.main.template;
|
|
2853
|
+
this.dataLayer.renderingEngine === B.mustache && (this.answerContainer.innerHTML = P.render(
|
|
2854
|
+
r,
|
|
2855
|
+
e
|
|
2856
|
+
));
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
class ba {
|
|
2713
2860
|
constructor(e = B.mustache) {
|
|
2714
|
-
|
|
2861
|
+
h(this, "routerEnabled", !1), h(this, "cachedQuery", ""), h(this, "routerHelper"), h(this, "searchHelper"), h(this, "searchResultsConfig"), h(this, "searchPaginationConfig"), h(this, "searchFeedbackConfig"), h(this, "searchSortingConfig"), h(this, "searchFacetsConfig"), h(this, "relatedSearchesConfig"), h(this, "externalPromotionsConfig"), h(this, "searchInputWidget"), h(this, "searchResultsWidget"), h(this, "searchFacetsWidget"), h(this, "searchPaginationWidget"), h(this, "searchFeedbackWidget"), h(this, "searchSortingWidget"), h(this, "relatedSearchesWidget"), h(this, "externalPromotionsWidget"), h(this, "answerWidget"), h(this, "dataLayer"), h(this, "firstRequest", !0), this.dataLayer = new Nt("searchstax_session_id"), e && this.dataLayer.setRenderingEngine(e), this.handleHooks();
|
|
2715
2862
|
}
|
|
2716
2863
|
setRenderingEngine(e = B.mustache) {
|
|
2717
2864
|
this.dataLayer.setRenderingEngine(e);
|
|
2718
2865
|
}
|
|
2719
2866
|
handleHooks() {
|
|
2720
2867
|
var e, t;
|
|
2721
|
-
(t = (e = this.dataLayer.searchstaxConfig) == null ? void 0 : e.hooks) != null && t.afterSearch && this.dataLayer.$searchResults.subscribe((
|
|
2722
|
-
this.dataLayer.searchstaxConfig.hooks.afterSearch(
|
|
2723
|
-
}), this.dataLayer.$searchObject.subscribe((
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2868
|
+
(t = (e = this.dataLayer.searchstaxConfig) == null ? void 0 : e.hooks) != null && t.afterSearch && this.dataLayer.$searchResults.subscribe((s) => {
|
|
2869
|
+
this.dataLayer.searchstaxConfig.hooks.afterSearch(s);
|
|
2870
|
+
}), this.dataLayer.$searchObject.subscribe((s) => {
|
|
2871
|
+
var a;
|
|
2872
|
+
s.query !== "" && s.query !== void 0 && s.query !== "undefined" && (this.search(s), this.dataLayer.turnAIAnswerGenerationOn === !0 && ((a = this.searchHelper) == null || a.startSSE(
|
|
2873
|
+
s.query,
|
|
2874
|
+
this.parseAnswerResultsResponse.bind(this)
|
|
2875
|
+
)));
|
|
2876
|
+
}), this.dataLayer.$searchResults.subscribe((s) => {
|
|
2877
|
+
s && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && de.trackSearch({
|
|
2727
2878
|
...this.dataLayer.parsedData.trackingData,
|
|
2728
2879
|
impressions: this.dataLayer.searchResultsMetadata.impressions
|
|
2729
2880
|
});
|
|
2730
2881
|
});
|
|
2731
2882
|
}
|
|
2732
2883
|
initialize(e) {
|
|
2733
|
-
var t,
|
|
2734
|
-
e.autoCorrect === !1 && (this.dataLayer.autoCorrect = !1), this.dataLayer.searchstaxConfig || (this.dataLayer.setSearchstaxConfig(e), this.searchHelper = new
|
|
2884
|
+
var t, s;
|
|
2885
|
+
e.turnAIAnswerGenerationOn === !0 && (this.dataLayer.turnAIAnswerGenerationOn = !0), e.autoCorrect === !1 && (this.dataLayer.autoCorrect = !1), this.dataLayer.searchstaxConfig || (this.dataLayer.setSearchstaxConfig(e), this.searchHelper = new qt(
|
|
2735
2886
|
{ ...e, sessionId: this.dataLayer.sessionId },
|
|
2736
2887
|
this.dataLayer
|
|
2737
|
-
)), ((t = e.router) == null ? void 0 : t.enabled) === void 0 || ((
|
|
2738
|
-
|
|
2739
|
-
|
|
2888
|
+
)), ((t = e.router) == null ? void 0 : t.enabled) === void 0 || ((s = e.router) == null ? void 0 : s.enabled) === !0 ? (this.routerEnabled = !0, this.routerHelper = new st(
|
|
2889
|
+
e.router ? e.router : { enabled: !0 }
|
|
2890
|
+
), this.dataLayer.setSearchObject(
|
|
2891
|
+
this.routerHelper.urlToSearchObject(window.location.href)
|
|
2892
|
+
), addEventListener("popstate", () => {
|
|
2893
|
+
this.routerHelper && this.dataLayer.setSearchObject(
|
|
2894
|
+
this.routerHelper.urlToSearchObject(window.location.href)
|
|
2895
|
+
);
|
|
2896
|
+
})) : this.routerHelper = new st({});
|
|
2740
2897
|
}
|
|
2741
2898
|
search(e) {
|
|
2742
|
-
if (this.searchHelper
|
|
2899
|
+
if (this.searchHelper) {
|
|
2743
2900
|
const t = this.dataLayer.forceNotCorrect;
|
|
2744
2901
|
this.searchHelper.search(
|
|
2745
2902
|
e,
|
|
@@ -2759,45 +2916,55 @@ class va {
|
|
|
2759
2916
|
}
|
|
2760
2917
|
parseRelatedSearchesResponse(e) {
|
|
2761
2918
|
var t;
|
|
2762
|
-
const
|
|
2763
|
-
for (const r of
|
|
2764
|
-
|
|
2919
|
+
const s = (((t = e.response) == null ? void 0 : t.docs) ?? []).map((r, c) => ({ ...r, position: c + 1 })), a = [];
|
|
2920
|
+
for (const r of s)
|
|
2921
|
+
a.push({
|
|
2765
2922
|
relatedSearch: r.related_search,
|
|
2766
2923
|
position: r.position
|
|
2767
2924
|
});
|
|
2768
|
-
this.dataLayer.searchResultsMetadata &&
|
|
2925
|
+
this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && de.trackRelatedSearches({
|
|
2769
2926
|
...this.dataLayer.parsedData.trackingData,
|
|
2770
|
-
impressions:
|
|
2771
|
-
}), this.dataLayer.setSearchRelatedSearches(
|
|
2927
|
+
impressions: a
|
|
2928
|
+
}), this.dataLayer.setSearchRelatedSearches(s);
|
|
2772
2929
|
}
|
|
2773
2930
|
handleRouter() {
|
|
2774
|
-
|
|
2931
|
+
if (this.routerEnabled) {
|
|
2932
|
+
const e = { ...this.dataLayer.searchObject };
|
|
2933
|
+
this.dataLayer.isInfiniteScroll && delete e.page, this.routerHelper.updateUrl(e);
|
|
2934
|
+
}
|
|
2775
2935
|
}
|
|
2776
2936
|
parseSearchResultsResponse(e) {
|
|
2777
|
-
var t,
|
|
2937
|
+
var t, s;
|
|
2778
2938
|
this.handleRouter();
|
|
2779
|
-
let
|
|
2780
|
-
this.dataLayer.setSearchFacets(r), (
|
|
2781
|
-
const c =
|
|
2782
|
-
this.dataLayer.setSearchResultsMetadata(c), this.dataLayer.setSearchResults(
|
|
2939
|
+
let a = ue.combineResultsWithMetadata(e), r = ue.extractFacets(e);
|
|
2940
|
+
this.dataLayer.setSearchFacets(r), (s = (t = this.dataLayer.searchstaxConfig) == null ? void 0 : t.hooks) != null && s.afterSearch && (a = this.dataLayer.searchstaxConfig.hooks.afterSearch(a)), this.dataLayer.setSearchExternalPromotions(e.externalLinks ?? []);
|
|
2941
|
+
const c = ue.extractSearchResultsMetadata(e);
|
|
2942
|
+
this.dataLayer.setSearchResultsMetadata(c), this.dataLayer.setSearchResults(a);
|
|
2943
|
+
}
|
|
2944
|
+
parseAnswerResultsResponse(e) {
|
|
2945
|
+
this.handleRouter(), e !== se.question && e !== se.notQuestion && this.dataLayer.setAnswerData(this.dataLayer.getAnswerData + e);
|
|
2783
2946
|
}
|
|
2784
2947
|
cacheFacets() {
|
|
2785
2948
|
var e;
|
|
2786
2949
|
(e = this.searchHelper) == null || e.cacheFacets();
|
|
2787
2950
|
}
|
|
2788
2951
|
parseSuggestSuggestResponse(e) {
|
|
2789
|
-
var t,
|
|
2790
|
-
let
|
|
2791
|
-
(
|
|
2952
|
+
var t, s;
|
|
2953
|
+
let a = e;
|
|
2954
|
+
(s = (t = this.dataLayer.searchInputConfig) == null ? void 0 : t.hooks) != null && s.afterAutosuggest && (a = this.dataLayer.searchInputConfig.hooks.afterAutosuggest(e)), this.dataLayer.setSearchAutosuggest(a);
|
|
2792
2955
|
}
|
|
2793
2956
|
suggest(e, t) {
|
|
2794
|
-
this.searchHelper && this.searchHelper.suggest(
|
|
2957
|
+
this.searchHelper && this.searchHelper.suggest(
|
|
2958
|
+
e,
|
|
2959
|
+
this.parseSuggestSuggestResponse.bind(this),
|
|
2960
|
+
t
|
|
2961
|
+
);
|
|
2795
2962
|
}
|
|
2796
2963
|
changeLanguage(e) {
|
|
2797
2964
|
this.searchHelper && this.dataLayer.setLanguage(e);
|
|
2798
2965
|
}
|
|
2799
2966
|
addSearchInputWidget(e, t) {
|
|
2800
|
-
this.dataLayer.searchInputConfig || (this.dataLayer.setSearchInputConfig(t), this.searchInputWidget = new
|
|
2967
|
+
this.dataLayer.searchInputConfig || (this.dataLayer.setSearchInputConfig(t), this.searchInputWidget = new fa({
|
|
2801
2968
|
containerId: e,
|
|
2802
2969
|
config: t,
|
|
2803
2970
|
searchTrigger: this.executeSearch.bind(this),
|
|
@@ -2805,8 +2972,15 @@ class va {
|
|
|
2805
2972
|
dataLayer: this.dataLayer
|
|
2806
2973
|
}));
|
|
2807
2974
|
}
|
|
2975
|
+
addAnswerWidget(e, t) {
|
|
2976
|
+
this.dataLayer.setAnswerData(""), this.answerWidget = new xa({
|
|
2977
|
+
containerId: e,
|
|
2978
|
+
config: t,
|
|
2979
|
+
dataLayer: this.dataLayer
|
|
2980
|
+
});
|
|
2981
|
+
}
|
|
2808
2982
|
addSearchResultsWidget(e, t) {
|
|
2809
|
-
this.searchResultsConfig || (this.searchResultsConfig = t, this.searchResultsWidget = new
|
|
2983
|
+
this.searchResultsConfig || (this.searchResultsConfig = t, this.searchResultsWidget = new va({
|
|
2810
2984
|
containerId: e,
|
|
2811
2985
|
linkClickCallback: this.executeLinkClick.bind(this),
|
|
2812
2986
|
searchTrigger: this.executeSearch.bind(this),
|
|
@@ -2815,7 +2989,7 @@ class va {
|
|
|
2815
2989
|
}));
|
|
2816
2990
|
}
|
|
2817
2991
|
addPaginationWidget(e, t) {
|
|
2818
|
-
this.searchPaginationConfig = t, this.searchPaginationWidget = new
|
|
2992
|
+
this.searchPaginationConfig = t, this.searchPaginationWidget = new ga({
|
|
2819
2993
|
containerId: e,
|
|
2820
2994
|
config: t,
|
|
2821
2995
|
dataLayer: this.dataLayer,
|
|
@@ -2823,7 +2997,7 @@ class va {
|
|
|
2823
2997
|
});
|
|
2824
2998
|
}
|
|
2825
2999
|
addSearchFeedbackWidget(e, t) {
|
|
2826
|
-
this.searchFeedbackConfig || (this.searchFeedbackConfig = t, this.searchFeedbackWidget = new
|
|
3000
|
+
this.searchFeedbackConfig || (this.searchFeedbackConfig = t, this.searchFeedbackWidget = new ma({
|
|
2827
3001
|
containerId: e,
|
|
2828
3002
|
config: t,
|
|
2829
3003
|
dataLayer: this.dataLayer,
|
|
@@ -2831,14 +3005,14 @@ class va {
|
|
|
2831
3005
|
}));
|
|
2832
3006
|
}
|
|
2833
3007
|
addSearchSortingWidget(e, t) {
|
|
2834
|
-
this.searchSortingConfig || (this.searchSortingConfig = t, this.searchSortingWidget = new
|
|
3008
|
+
this.searchSortingConfig || (this.searchSortingConfig = t, this.searchSortingWidget = new ya({
|
|
2835
3009
|
containerId: e,
|
|
2836
3010
|
config: t,
|
|
2837
3011
|
dataLayer: this.dataLayer
|
|
2838
3012
|
}));
|
|
2839
3013
|
}
|
|
2840
3014
|
addRelatedSearchesWidget(e, t) {
|
|
2841
|
-
this.relatedSearchesConfig || (this.relatedSearchesConfig = t, this.relatedSearchesWidget = new
|
|
3015
|
+
this.relatedSearchesConfig || (this.relatedSearchesConfig = t, this.relatedSearchesWidget = new pa({
|
|
2842
3016
|
containerId: e,
|
|
2843
3017
|
config: t,
|
|
2844
3018
|
dataLayer: this.dataLayer,
|
|
@@ -2848,14 +3022,14 @@ class va {
|
|
|
2848
3022
|
}, 0));
|
|
2849
3023
|
}
|
|
2850
3024
|
addExternalPromotionsWidget(e, t) {
|
|
2851
|
-
this.externalPromotionsConfig || (this.externalPromotionsConfig = t, this.externalPromotionsWidget = new
|
|
3025
|
+
this.externalPromotionsConfig || (this.externalPromotionsConfig = t, this.externalPromotionsWidget = new ua({
|
|
2852
3026
|
containerId: e,
|
|
2853
3027
|
config: t,
|
|
2854
3028
|
dataLayer: this.dataLayer
|
|
2855
3029
|
}));
|
|
2856
3030
|
}
|
|
2857
3031
|
addFacetsWidget(e, t) {
|
|
2858
|
-
this.searchFacetsConfig = t, this.searchFacetsWidget = new
|
|
3032
|
+
this.searchFacetsConfig = t, this.searchFacetsWidget = new da(
|
|
2859
3033
|
{
|
|
2860
3034
|
containerId: e,
|
|
2861
3035
|
config: t,
|
|
@@ -2866,84 +3040,90 @@ class va {
|
|
|
2866
3040
|
);
|
|
2867
3041
|
}
|
|
2868
3042
|
executeSearch(e, t) {
|
|
2869
|
-
var
|
|
3043
|
+
var s, a;
|
|
2870
3044
|
const r = { ...this.dataLayer.searchObject };
|
|
2871
3045
|
r.query = Z.removeXSSRiskyTags(e), r.page = 1, r.facets = [], this.dataLayer.forceNotCorrect = !!t;
|
|
2872
|
-
let c = (
|
|
2873
|
-
c && (c = (
|
|
3046
|
+
let c = (s = this.routerHelper) == null ? void 0 : s.searchObjectToParams(r);
|
|
3047
|
+
c && (c = (a = this.routerHelper) == null ? void 0 : a.extractParamsThatDoNotStartWithRouteName(c)), c && (r.additionalProps = Object.keys(c).map((l) => c ? { key: l, value: c[l] } : { key: "", value: "" })), this.dataLayer.setSearchObject(r), this.dataLayer.lastSearchValue = r.query;
|
|
2874
3048
|
}
|
|
2875
3049
|
executeSuggest(e) {
|
|
2876
|
-
var t,
|
|
2877
|
-
let
|
|
2878
|
-
(
|
|
3050
|
+
var t, s;
|
|
3051
|
+
let a = { term: e, queryParams: [] };
|
|
3052
|
+
(s = (t = this.dataLayer.searchInputConfig) == null ? void 0 : t.hooks) != null && s.beforeAutosuggest && (a = this.dataLayer.searchInputConfig.hooks.beforeAutosuggest(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.suggest(a.term, a.queryParams);
|
|
2879
3053
|
}
|
|
2880
3054
|
trackRelatedSearchClick(e) {
|
|
2881
|
-
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches &&
|
|
3055
|
+
this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && !this.dataLayer.cookiesDisabled && de.trackRelatedSearchClick({
|
|
2882
3056
|
...this.dataLayer.parsedData.trackingData,
|
|
2883
3057
|
relatedSearch: e
|
|
2884
3058
|
});
|
|
2885
3059
|
}
|
|
2886
3060
|
executeLinkClick(e) {
|
|
2887
|
-
var t,
|
|
2888
|
-
let
|
|
2889
|
-
|
|
2890
|
-
|
|
3061
|
+
var t, s;
|
|
3062
|
+
let a = ue.findResultByUniqueId(
|
|
3063
|
+
e,
|
|
3064
|
+
this.dataLayer.searchResults ?? []
|
|
3065
|
+
);
|
|
3066
|
+
a && ((s = (t = this.searchResultsConfig) == null ? void 0 : t.hooks) != null && s.afterLinkClick && (a = this.searchResultsConfig.hooks.afterLinkClick(a)), a && this.dataLayer.searchResultsMetadata && !this.dataLayer.cookiesDisabled && (de.trackClick({
|
|
3067
|
+
result: a,
|
|
2891
3068
|
...this.dataLayer.parsedData.trackingData
|
|
2892
3069
|
}), setTimeout(() => {
|
|
2893
|
-
window.location.href = (
|
|
3070
|
+
window.location.href = (a == null ? void 0 : a.url) ?? "";
|
|
2894
3071
|
}, 0)));
|
|
2895
3072
|
}
|
|
2896
3073
|
setPage(e) {
|
|
2897
3074
|
var t;
|
|
2898
3075
|
(t = this.searchPaginationWidget) == null || t.goToPage(e);
|
|
2899
3076
|
}
|
|
3077
|
+
setCookiesDisabled(e) {
|
|
3078
|
+
this.dataLayer.setCookiesDisabled(e);
|
|
3079
|
+
}
|
|
2900
3080
|
changeResultTemplate(e) {
|
|
2901
|
-
var t,
|
|
2902
|
-
this.searchResultsConfig && (this.searchResultsConfig.templates = (t = this.searchResultsConfig) != null && t.templates ? { ...(
|
|
3081
|
+
var t, s, a;
|
|
3082
|
+
this.searchResultsConfig && (this.searchResultsConfig.templates = (t = this.searchResultsConfig) != null && t.templates ? { ...(s = this.searchResultsConfig) == null ? void 0 : s.templates, ...e } : e, (a = this.searchResultsWidget) == null || a.changeTemplate());
|
|
2903
3083
|
}
|
|
2904
3084
|
}
|
|
2905
|
-
const
|
|
3085
|
+
const C = {
|
|
2906
3086
|
//@ts-ignore
|
|
2907
|
-
searchstax: new
|
|
3087
|
+
searchstax: new ba("react")
|
|
2908
3088
|
};
|
|
2909
|
-
function
|
|
3089
|
+
function Sa(i) {
|
|
2910
3090
|
let e = !1;
|
|
2911
|
-
const [t,
|
|
3091
|
+
const [t, s] = H([]);
|
|
2912
3092
|
ee(() => {
|
|
2913
|
-
if (
|
|
2914
|
-
const
|
|
2915
|
-
|
|
2916
|
-
suggestAfterMinChars:
|
|
2917
|
-
hooks:
|
|
3093
|
+
if (a(), C.searchstax) {
|
|
3094
|
+
const u = {};
|
|
3095
|
+
i.afterAutosuggest && (u.afterAutosuggest = i.afterAutosuggest), i.beforeAutosuggest && (u.beforeAutosuggest = i.beforeAutosuggest), C.searchstax.addSearchInputWidget("searchstax-input-container", {
|
|
3096
|
+
suggestAfterMinChars: i.suggestAfterMinChars ?? 3,
|
|
3097
|
+
hooks: u,
|
|
2918
3098
|
templates: {
|
|
2919
3099
|
mainTemplate: {
|
|
2920
3100
|
template: "",
|
|
2921
|
-
searchInputId:
|
|
3101
|
+
searchInputId: i.searchInputId ?? "searchstax-search-input"
|
|
2922
3102
|
}
|
|
2923
3103
|
}
|
|
2924
3104
|
});
|
|
2925
3105
|
} else
|
|
2926
3106
|
throw Error("Searchstax instance needs to be passed via props");
|
|
2927
3107
|
}, []);
|
|
2928
|
-
function
|
|
2929
|
-
e || (
|
|
2930
|
-
|
|
3108
|
+
function a() {
|
|
3109
|
+
e || (C.searchstax.dataLayer.$autosuggestResults.subscribe((u) => {
|
|
3110
|
+
s((u == null ? void 0 : u.suggestions) ?? []);
|
|
2931
3111
|
}), e = !0);
|
|
2932
3112
|
}
|
|
2933
3113
|
function r() {
|
|
2934
|
-
var
|
|
2935
|
-
(
|
|
3114
|
+
var u, d;
|
|
3115
|
+
(u = C.searchstax.searchInputWidget) == null || u.resetAutosuggestSelection(), (d = C.searchstax.searchInputWidget) == null || d.markActiveAutosuggestItem();
|
|
2936
3116
|
}
|
|
2937
|
-
function c(
|
|
3117
|
+
function c(u) {
|
|
2938
3118
|
var d;
|
|
2939
|
-
(d =
|
|
3119
|
+
(d = C.searchstax.searchInputWidget) == null || d.onSuggestionEnter(u);
|
|
2940
3120
|
}
|
|
2941
3121
|
function l() {
|
|
2942
|
-
var
|
|
2943
|
-
(
|
|
3122
|
+
var u;
|
|
3123
|
+
(u = C.searchstax.searchInputWidget) == null || u.suggestionChosen();
|
|
2944
3124
|
}
|
|
2945
3125
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsx("div", { id: "searchstax-input-container", children: /* @__PURE__ */ o.jsxs("div", { className: "searchstax-search-input-container", children: [
|
|
2946
|
-
!
|
|
3126
|
+
!i.inputTemplate && /* @__PURE__ */ o.jsxs("div", { className: "searchstax-search-input-wrapper", children: [
|
|
2947
3127
|
/* @__PURE__ */ o.jsx(
|
|
2948
3128
|
"input",
|
|
2949
3129
|
{
|
|
@@ -2958,67 +3138,69 @@ function xa(n) {
|
|
|
2958
3138
|
{
|
|
2959
3139
|
className: `searchstax-autosuggest-container ${t.length === 0 ? "hidden" : ""}`,
|
|
2960
3140
|
onMouseLeave: r,
|
|
2961
|
-
children: t.map(function(
|
|
3141
|
+
children: t.map(function(u) {
|
|
2962
3142
|
return /* @__PURE__ */ o.jsx("div", { className: "searchstax-autosuggest-item", children: /* @__PURE__ */ o.jsx(
|
|
2963
3143
|
"div",
|
|
2964
3144
|
{
|
|
2965
3145
|
className: "searchstax-autosuggest-item-term-container",
|
|
2966
|
-
dangerouslySetInnerHTML: { __html:
|
|
3146
|
+
dangerouslySetInnerHTML: { __html: u.term },
|
|
2967
3147
|
onMouseOver: () => {
|
|
2968
|
-
c(
|
|
3148
|
+
c(u);
|
|
2969
3149
|
},
|
|
2970
3150
|
onClick: () => {
|
|
2971
3151
|
l();
|
|
2972
3152
|
}
|
|
2973
3153
|
}
|
|
2974
|
-
) },
|
|
3154
|
+
) }, u.term);
|
|
2975
3155
|
})
|
|
2976
3156
|
}
|
|
2977
3157
|
),
|
|
2978
3158
|
/* @__PURE__ */ o.jsx("button", { className: "searchstax-spinner-icon", id: "searchstax-search-input-action-button" })
|
|
2979
3159
|
] }),
|
|
2980
|
-
|
|
3160
|
+
i.inputTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.inputTemplate(t, r, c, l) })
|
|
2981
3161
|
] }) }) });
|
|
2982
3162
|
}
|
|
2983
|
-
function
|
|
3163
|
+
function La(i) {
|
|
2984
3164
|
return ee(() => {
|
|
2985
3165
|
const e = {};
|
|
2986
|
-
|
|
2987
|
-
language:
|
|
2988
|
-
searchURL:
|
|
2989
|
-
suggesterURL:
|
|
2990
|
-
trackApiKey:
|
|
2991
|
-
searchAuth:
|
|
2992
|
-
authType:
|
|
2993
|
-
autoCorrect:
|
|
2994
|
-
router:
|
|
3166
|
+
i.beforeSearch && (e.beforeSearch = i.beforeSearch), i != null && i.afterSearch && (e.afterSearch = i.afterSearch), C.searchstax.initialize({
|
|
3167
|
+
language: i.language ?? "en",
|
|
3168
|
+
searchURL: i.searchURL,
|
|
3169
|
+
suggesterURL: i.suggesterURL,
|
|
3170
|
+
trackApiKey: i.trackApiKey,
|
|
3171
|
+
searchAuth: i.searchAuth,
|
|
3172
|
+
authType: i.authType ?? "basic",
|
|
3173
|
+
autoCorrect: i.autoCorrect,
|
|
3174
|
+
router: i.router,
|
|
2995
3175
|
hooks: e
|
|
2996
|
-
}),
|
|
2997
|
-
}, [
|
|
3176
|
+
}), i.initialized(C.searchstax);
|
|
3177
|
+
}, [i.initialized]), /* @__PURE__ */ o.jsx(o.Fragment, { children: i.children });
|
|
2998
3178
|
}
|
|
2999
|
-
function
|
|
3000
|
-
const [e, t] = H(null), [
|
|
3001
|
-
p.preventDefault(), p.stopPropagation(),
|
|
3179
|
+
function Ta(i) {
|
|
3180
|
+
const [e, t] = H(null), [s, a] = H(""), [r, c] = H(null), l = (d, p) => {
|
|
3181
|
+
p.preventDefault(), p.stopPropagation(), C.searchstax.executeLinkClick(d.uniqueId);
|
|
3002
3182
|
};
|
|
3003
3183
|
ee(() => {
|
|
3004
|
-
|
|
3184
|
+
u();
|
|
3005
3185
|
const d = {};
|
|
3006
|
-
|
|
3186
|
+
i.afterLinkClick && (d.afterLinkClick = i.afterLinkClick), C.searchstax.addSearchResultsWidget("searchstax-results-container", {
|
|
3007
3187
|
templates: {},
|
|
3188
|
+
resultsPerPage: i.resultsPerPage ?? 10,
|
|
3189
|
+
renderMethod: i.renderMethod ?? "pagination",
|
|
3008
3190
|
hooks: d
|
|
3009
3191
|
});
|
|
3010
3192
|
}, []);
|
|
3011
|
-
function
|
|
3012
|
-
|
|
3193
|
+
function u() {
|
|
3194
|
+
C.searchstax.dataLayer.$searchResults.subscribe((d) => {
|
|
3013
3195
|
t(d);
|
|
3014
|
-
}),
|
|
3015
|
-
|
|
3016
|
-
}),
|
|
3196
|
+
}), C.searchstax.dataLayer.$searchTermChange.subscribe((d) => {
|
|
3197
|
+
a(d);
|
|
3198
|
+
}), C.searchstax.dataLayer.$searchResultsMetadata.subscribe((d) => {
|
|
3017
3199
|
c(d);
|
|
3018
3200
|
});
|
|
3019
3201
|
}
|
|
3020
3202
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsx("div", { id: "searchstax-results-container", children: /* @__PURE__ */ o.jsx("div", { className: "searchstax-search-results-container", children: /* @__PURE__ */ o.jsxs("div", { id: "searchstax-result-container", children: [
|
|
3021
|
-
e && e.length === 0 && !
|
|
3203
|
+
e && e.length === 0 && !i.noResultTemplate && /* @__PURE__ */ o.jsxs("div", { children: [
|
|
3022
3204
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-no-results", children: [
|
|
3023
3205
|
" ",
|
|
3024
3206
|
"Showing ",
|
|
@@ -3026,7 +3208,7 @@ function Ca(n) {
|
|
|
3026
3208
|
" for ",
|
|
3027
3209
|
/* @__PURE__ */ o.jsxs("strong", { children: [
|
|
3028
3210
|
'"',
|
|
3029
|
-
|
|
3211
|
+
s,
|
|
3030
3212
|
'"'
|
|
3031
3213
|
] }),
|
|
3032
3214
|
/* @__PURE__ */ o.jsx("br", {}),
|
|
@@ -3046,8 +3228,8 @@ function Ca(n) {
|
|
|
3046
3228
|
/* @__PURE__ */ o.jsx("p", { children: "Lost? Click on the ‘X” in the Search Box to reset your search." })
|
|
3047
3229
|
] })
|
|
3048
3230
|
] }),
|
|
3049
|
-
e && e.length === 0 &&
|
|
3050
|
-
e && e.length > 0 && !
|
|
3231
|
+
e && e.length === 0 && i.noResultTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.noResultTemplate(s, r) }),
|
|
3232
|
+
e && e.length > 0 && !i.resultsTemplate && /* @__PURE__ */ o.jsx("div", { className: "searchstax-search-results", children: e !== null && e.map(function(d) {
|
|
3051
3233
|
return /* @__PURE__ */ o.jsxs(
|
|
3052
3234
|
"div",
|
|
3053
3235
|
{
|
|
@@ -3081,43 +3263,57 @@ function Ca(n) {
|
|
|
3081
3263
|
d.uniqueId
|
|
3082
3264
|
);
|
|
3083
3265
|
}) }),
|
|
3084
|
-
e && e.length > 0 &&
|
|
3266
|
+
e && e.length > 0 && i.resultsTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.resultsTemplate(e, l) })
|
|
3085
3267
|
] }) }) }) });
|
|
3086
3268
|
}
|
|
3087
|
-
function
|
|
3269
|
+
function ka(i) {
|
|
3088
3270
|
let e = !1;
|
|
3089
|
-
const [t,
|
|
3271
|
+
const [t, s] = H(!1), [a, r] = H(
|
|
3272
|
+
null
|
|
3273
|
+
), [c] = H(Math.random());
|
|
3090
3274
|
ee(() => {
|
|
3091
|
-
if (l(),
|
|
3092
|
-
|
|
3275
|
+
if (l(), C.searchstax)
|
|
3276
|
+
C.searchstax.addPaginationWidget(
|
|
3277
|
+
"searchstax-pagination-container" + c,
|
|
3278
|
+
{}
|
|
3279
|
+
);
|
|
3093
3280
|
else
|
|
3094
3281
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3095
3282
|
}, []);
|
|
3096
3283
|
function l() {
|
|
3097
|
-
e || (
|
|
3098
|
-
|
|
3099
|
-
}),
|
|
3100
|
-
|
|
3101
|
-
|
|
3284
|
+
e || (C.searchstax.dataLayer.$searchObject.subscribe(() => {
|
|
3285
|
+
u();
|
|
3286
|
+
}), C.searchstax.dataLayer.$paginationData.subscribe(
|
|
3287
|
+
(v) => {
|
|
3288
|
+
r(v);
|
|
3289
|
+
}
|
|
3290
|
+
), e = !0);
|
|
3102
3291
|
}
|
|
3103
|
-
function
|
|
3104
|
-
!t &&
|
|
3292
|
+
function u() {
|
|
3293
|
+
!t && C.searchstax.routerHelper && (s(!0), C.searchstax.addPaginationWidget(
|
|
3294
|
+
"searchstax-pagination-container" + c,
|
|
3295
|
+
{}
|
|
3296
|
+
));
|
|
3105
3297
|
}
|
|
3106
3298
|
function d(v) {
|
|
3107
|
-
var
|
|
3108
|
-
(
|
|
3299
|
+
var y;
|
|
3300
|
+
(y = C.searchstax.searchPaginationWidget) == null || y.nextPage(
|
|
3301
|
+
v
|
|
3302
|
+
);
|
|
3109
3303
|
}
|
|
3110
3304
|
function p(v) {
|
|
3111
|
-
var
|
|
3112
|
-
(
|
|
3305
|
+
var y;
|
|
3306
|
+
(y = C.searchstax.searchPaginationWidget) == null || y.previousPage(
|
|
3307
|
+
v
|
|
3308
|
+
);
|
|
3113
3309
|
}
|
|
3114
3310
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { id: "searchstax-pagination-container" + c, children: [
|
|
3115
|
-
!
|
|
3311
|
+
!i.paginationTemplate && a && !a.isInfiniteScroll && (a == null ? void 0 : a.totalResults) !== 0 && /* @__PURE__ */ o.jsx("div", { className: "searchstax-pagination-container", children: /* @__PURE__ */ o.jsxs("div", { className: "searchstax-pagination-content", children: [
|
|
3116
3312
|
/* @__PURE__ */ o.jsxs(
|
|
3117
3313
|
"a",
|
|
3118
3314
|
{
|
|
3119
3315
|
className: "searchstax-pagination-previous",
|
|
3120
|
-
style:
|
|
3316
|
+
style: a != null && a.isFirstPage ? { pointerEvents: "none" } : {},
|
|
3121
3317
|
onClick: (v) => {
|
|
3122
3318
|
p(v);
|
|
3123
3319
|
},
|
|
@@ -3131,17 +3327,19 @@ function Sa(n) {
|
|
|
3131
3327
|
),
|
|
3132
3328
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-pagination-details", children: [
|
|
3133
3329
|
" ",
|
|
3134
|
-
|
|
3135
|
-
" -
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3330
|
+
a == null ? void 0 : a.startResultIndex,
|
|
3331
|
+
" -",
|
|
3332
|
+
" ",
|
|
3333
|
+
a == null ? void 0 : a.endResultIndex,
|
|
3334
|
+
" of",
|
|
3335
|
+
" ",
|
|
3336
|
+
a == null ? void 0 : a.totalResults
|
|
3139
3337
|
] }),
|
|
3140
3338
|
/* @__PURE__ */ o.jsx(
|
|
3141
3339
|
"a",
|
|
3142
3340
|
{
|
|
3143
3341
|
className: "searchstax-pagination-next",
|
|
3144
|
-
style:
|
|
3342
|
+
style: a != null && a.isLastPage ? { pointerEvents: "none" } : {},
|
|
3145
3343
|
onClick: (v) => {
|
|
3146
3344
|
d(v);
|
|
3147
3345
|
},
|
|
@@ -3150,40 +3348,51 @@ function Sa(n) {
|
|
|
3150
3348
|
}
|
|
3151
3349
|
)
|
|
3152
3350
|
] }) }),
|
|
3153
|
-
|
|
3351
|
+
i.paginationTemplate && a && !a.isInfiniteScroll && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.paginationTemplate(a, d, p) }),
|
|
3352
|
+
!i.infiniteScrollTemplate && a && a.isInfiniteScroll && (a == null ? void 0 : a.totalResults) !== 0 && !(a != null && a.isLastPage) && /* @__PURE__ */ o.jsx(
|
|
3353
|
+
"a",
|
|
3354
|
+
{
|
|
3355
|
+
className: "searchstax-pagination-load-more",
|
|
3356
|
+
onClick: (v) => {
|
|
3357
|
+
d(v);
|
|
3358
|
+
},
|
|
3359
|
+
children: "Show More >"
|
|
3360
|
+
}
|
|
3361
|
+
),
|
|
3362
|
+
i.infiniteScrollTemplate && a && a.isInfiniteScroll && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.infiniteScrollTemplate(a, d) })
|
|
3154
3363
|
] }) });
|
|
3155
3364
|
}
|
|
3156
|
-
function
|
|
3365
|
+
function Ra(i) {
|
|
3157
3366
|
let e = !1;
|
|
3158
|
-
const [t,
|
|
3367
|
+
const [t, s] = H(null), [a, r] = H(""), [c] = H(Math.random());
|
|
3159
3368
|
ee(() => {
|
|
3160
|
-
if (l(),
|
|
3161
|
-
|
|
3369
|
+
if (l(), C.searchstax)
|
|
3370
|
+
C.searchstax.addSearchSortingWidget("search-sorting-container" + c, {});
|
|
3162
3371
|
else
|
|
3163
3372
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3164
3373
|
}, []);
|
|
3165
3374
|
function l() {
|
|
3166
|
-
e || (
|
|
3167
|
-
|
|
3168
|
-
}),
|
|
3375
|
+
e || (C.searchstax.dataLayer.$searchSortingData.subscribe((d) => {
|
|
3376
|
+
s(d);
|
|
3377
|
+
}), C.searchstax.dataLayer.$searchObject.subscribe((d) => {
|
|
3169
3378
|
r(decodeURIComponent((d == null ? void 0 : d.order) ?? ""));
|
|
3170
3379
|
}), e = !0);
|
|
3171
3380
|
}
|
|
3172
|
-
function
|
|
3381
|
+
function u(d) {
|
|
3173
3382
|
var p;
|
|
3174
|
-
(p =
|
|
3383
|
+
(p = C.searchstax.searchSortingWidget) == null || p.setOrderQuery(d);
|
|
3175
3384
|
}
|
|
3176
3385
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { id: "search-sorting-container" + c, children: [
|
|
3177
|
-
!
|
|
3386
|
+
!i.searchSortingTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.hasResultsOrExternalPromotions) && /* @__PURE__ */ o.jsxs("div", { className: "searchstax-sorting-container", children: [
|
|
3178
3387
|
/* @__PURE__ */ o.jsx("label", { className: "searchstax-sorting-label", htmlFor: "sort-by", children: "Sort By" }),
|
|
3179
3388
|
/* @__PURE__ */ o.jsxs(
|
|
3180
3389
|
"select",
|
|
3181
3390
|
{
|
|
3182
3391
|
id: "searchstax-search-order-select",
|
|
3183
3392
|
className: "searchstax-search-order-select",
|
|
3184
|
-
value:
|
|
3393
|
+
value: a,
|
|
3185
3394
|
onChange: (d) => {
|
|
3186
|
-
|
|
3395
|
+
u(d.target.value);
|
|
3187
3396
|
},
|
|
3188
3397
|
children: [
|
|
3189
3398
|
/* @__PURE__ */ o.jsx("option", { value: "", children: " Relevance " }),
|
|
@@ -3193,31 +3402,31 @@ function Ta(n) {
|
|
|
3193
3402
|
}
|
|
3194
3403
|
)
|
|
3195
3404
|
] }),
|
|
3196
|
-
|
|
3405
|
+
i.searchSortingTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.searchSortingTemplate(t, u, a) })
|
|
3197
3406
|
] }) });
|
|
3198
3407
|
}
|
|
3199
|
-
function
|
|
3408
|
+
function wa(i) {
|
|
3200
3409
|
let e = !1;
|
|
3201
|
-
const [t,
|
|
3410
|
+
const [t, s] = H(null), [a] = H(Math.random());
|
|
3202
3411
|
ee(() => {
|
|
3203
|
-
if (r(),
|
|
3204
|
-
|
|
3412
|
+
if (r(), C.searchstax)
|
|
3413
|
+
C.searchstax.addSearchFeedbackWidget("search-feedback-container" + a, {});
|
|
3205
3414
|
else
|
|
3206
3415
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3207
3416
|
}, []);
|
|
3208
3417
|
function r() {
|
|
3209
|
-
e || (
|
|
3418
|
+
e || (C.searchstax.dataLayer.$searchFeedbackData.subscribe(
|
|
3210
3419
|
(l) => {
|
|
3211
|
-
|
|
3420
|
+
s(l);
|
|
3212
3421
|
}
|
|
3213
3422
|
), e = !0);
|
|
3214
3423
|
}
|
|
3215
3424
|
function c(l) {
|
|
3216
|
-
var
|
|
3217
|
-
(
|
|
3425
|
+
var u;
|
|
3426
|
+
(u = C.searchstax.searchFeedbackWidget) == null || u.onOriginalQueryClick(l);
|
|
3218
3427
|
}
|
|
3219
|
-
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { className: "search-feedback-container", id: "search-feedback-container" +
|
|
3220
|
-
!
|
|
3428
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { className: "search-feedback-container", id: "search-feedback-container" + a, children: [
|
|
3429
|
+
!i.searchOverviewTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.totalResults) > 0 && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3221
3430
|
"Showing",
|
|
3222
3431
|
" ",
|
|
3223
3432
|
/* @__PURE__ */ o.jsxs("b", { children: [
|
|
@@ -3255,108 +3464,108 @@ function La(n) {
|
|
|
3255
3464
|
)
|
|
3256
3465
|
] }) })
|
|
3257
3466
|
] }),
|
|
3258
|
-
|
|
3467
|
+
i.searchOverviewTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.searchOverviewTemplate(t, c) })
|
|
3259
3468
|
] }) });
|
|
3260
3469
|
}
|
|
3261
|
-
function
|
|
3470
|
+
function Ea(i) {
|
|
3262
3471
|
const [e, t] = H(
|
|
3263
3472
|
null
|
|
3264
|
-
), [
|
|
3473
|
+
), [s, a] = H(
|
|
3265
3474
|
null
|
|
3266
3475
|
), [r, c] = H(
|
|
3267
3476
|
[]
|
|
3268
|
-
), [l,
|
|
3477
|
+
), [l, u] = H(
|
|
3269
3478
|
{}
|
|
3270
3479
|
), d = {}, p = Math.random();
|
|
3271
3480
|
let v = !1;
|
|
3272
3481
|
ee(() => {
|
|
3273
|
-
if (
|
|
3274
|
-
|
|
3275
|
-
facetingType:
|
|
3276
|
-
specificFacets:
|
|
3277
|
-
itemsPerPageDesktop:
|
|
3278
|
-
itemsPerPageMobile:
|
|
3482
|
+
if (y(), C.searchstax)
|
|
3483
|
+
C.searchstax.addFacetsWidget("searchstax-facets-container" + p, {
|
|
3484
|
+
facetingType: i.facetingType,
|
|
3485
|
+
specificFacets: i.specificFacets,
|
|
3486
|
+
itemsPerPageDesktop: i.itemsPerPageDesktop,
|
|
3487
|
+
itemsPerPageMobile: i.itemsPerPageMobile
|
|
3279
3488
|
});
|
|
3280
3489
|
else
|
|
3281
3490
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3282
3491
|
}, []);
|
|
3283
|
-
function
|
|
3284
|
-
v || (
|
|
3492
|
+
function y() {
|
|
3493
|
+
v || (C.searchstax.dataLayer.$facetsTemplateData.subscribe(
|
|
3285
3494
|
(m) => {
|
|
3286
|
-
m != null && m.isMobile ?
|
|
3495
|
+
m != null && m.isMobile ? a(m) : t(m);
|
|
3287
3496
|
}
|
|
3288
|
-
),
|
|
3497
|
+
), C.searchstax.dataLayer.$selectedFacetsTemplateData.subscribe(
|
|
3289
3498
|
(m) => {
|
|
3290
3499
|
c(
|
|
3291
|
-
(m ?? []).filter((
|
|
3500
|
+
(m ?? []).filter((F) => F.type === "checkbox")
|
|
3292
3501
|
);
|
|
3293
3502
|
}
|
|
3294
3503
|
), v = !0);
|
|
3295
3504
|
}
|
|
3296
|
-
function
|
|
3297
|
-
var
|
|
3298
|
-
(
|
|
3505
|
+
function R(m) {
|
|
3506
|
+
var b;
|
|
3507
|
+
(b = C.searchstax.searchFacetsWidget) == null || b.unselectFacet(m);
|
|
3299
3508
|
}
|
|
3300
3509
|
function M() {
|
|
3301
3510
|
var m;
|
|
3302
|
-
(m =
|
|
3511
|
+
(m = C.searchstax.searchFacetsWidget) == null || m.removeSelectedFacets();
|
|
3303
3512
|
}
|
|
3304
|
-
function
|
|
3513
|
+
function k(m) {
|
|
3305
3514
|
return !l[m];
|
|
3306
3515
|
}
|
|
3307
|
-
function
|
|
3308
|
-
|
|
3516
|
+
function T(m) {
|
|
3517
|
+
k(m) ? u({ ...l, [m]: !0 }) : u({ ...l, [m]: !1 });
|
|
3309
3518
|
}
|
|
3310
3519
|
function I(m) {
|
|
3311
|
-
var
|
|
3312
|
-
return (
|
|
3313
|
-
}
|
|
3314
|
-
function
|
|
3315
|
-
var
|
|
3316
|
-
const
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3520
|
+
var b;
|
|
3521
|
+
return (b = C.searchstax.searchFacetsWidget) == null ? void 0 : b.isChecked(m);
|
|
3522
|
+
}
|
|
3523
|
+
function L(m, b, F, $) {
|
|
3524
|
+
var K, Y;
|
|
3525
|
+
const G = document.createElement("div"), ne = (K = d[m]) == null ? void 0 : K.current;
|
|
3526
|
+
G.innerHTML = ne.outerHTML, (Y = C.searchstax.searchFacetsWidget) == null || Y.onFacetSelect(
|
|
3527
|
+
b,
|
|
3528
|
+
F,
|
|
3529
|
+
ne,
|
|
3530
|
+
$
|
|
3322
3531
|
);
|
|
3323
3532
|
}
|
|
3324
|
-
function N(m,
|
|
3325
|
-
var
|
|
3326
|
-
(
|
|
3533
|
+
function N(m, b) {
|
|
3534
|
+
var F;
|
|
3535
|
+
(F = C.searchstax.searchFacetsWidget) == null || F.onShowMoreLessClick(
|
|
3327
3536
|
m,
|
|
3328
|
-
|
|
3537
|
+
b,
|
|
3329
3538
|
!1
|
|
3330
3539
|
);
|
|
3331
3540
|
}
|
|
3332
|
-
function W(m,
|
|
3333
|
-
var
|
|
3334
|
-
(
|
|
3541
|
+
function W(m, b) {
|
|
3542
|
+
var F;
|
|
3543
|
+
(F = C.searchstax.searchFacetsWidget) == null || F.onShowMoreLessClick(
|
|
3335
3544
|
m,
|
|
3336
|
-
|
|
3545
|
+
b,
|
|
3337
3546
|
!0
|
|
3338
3547
|
);
|
|
3339
3548
|
}
|
|
3340
3549
|
function A() {
|
|
3341
3550
|
var m;
|
|
3342
|
-
(m =
|
|
3551
|
+
(m = C.searchstax.searchFacetsWidget) == null || m.openOverlay();
|
|
3343
3552
|
}
|
|
3344
|
-
function
|
|
3553
|
+
function Q() {
|
|
3345
3554
|
var m;
|
|
3346
|
-
(m =
|
|
3555
|
+
(m = C.searchstax.searchFacetsWidget) == null || m.closeOverlay();
|
|
3347
3556
|
}
|
|
3348
3557
|
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { id: "searchstax-facets-container" + p, children: [
|
|
3349
|
-
(e == null ? void 0 : e.hasResultsOrExternalPromotions) && !
|
|
3558
|
+
(e == null ? void 0 : e.hasResultsOrExternalPromotions) && !i.facetsTemplateDesktop && /* @__PURE__ */ o.jsx("div", { className: "searchstax-facets-container-desktop", children: e == null ? void 0 : e.facets.map((m) => /* @__PURE__ */ o.jsx(
|
|
3350
3559
|
"div",
|
|
3351
3560
|
{
|
|
3352
|
-
className: `searchstax-facet-container ${
|
|
3561
|
+
className: `searchstax-facet-container ${k(m.name) ? "active" : ""}`,
|
|
3353
3562
|
children: /* @__PURE__ */ o.jsxs("div", { children: [
|
|
3354
3563
|
/* @__PURE__ */ o.jsxs(
|
|
3355
3564
|
"div",
|
|
3356
3565
|
{
|
|
3357
3566
|
className: "searchstax-facet-title-container",
|
|
3358
3567
|
onClick: () => {
|
|
3359
|
-
|
|
3568
|
+
T(m.name);
|
|
3360
3569
|
},
|
|
3361
3570
|
children: [
|
|
3362
3571
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facet-title", children: [
|
|
@@ -3371,25 +3580,25 @@ function Ra(n) {
|
|
|
3371
3580
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facet-values-container", children: [
|
|
3372
3581
|
m.values.map(
|
|
3373
3582
|
//@ts-ignore
|
|
3374
|
-
(
|
|
3583
|
+
(b, F) => (d[F + m.name] = et(), /* @__PURE__ */ o.jsxs(
|
|
3375
3584
|
"div",
|
|
3376
3585
|
{
|
|
3377
|
-
className: `searchstax-facet-value-container ${
|
|
3378
|
-
ref: d[
|
|
3586
|
+
className: `searchstax-facet-value-container ${b.disabled ? "searchstax-facet-value-disabled" : ""}`,
|
|
3587
|
+
ref: d[F + m.name],
|
|
3379
3588
|
children: [
|
|
3380
3589
|
/* @__PURE__ */ o.jsx("div", { className: "searchstax-facet-input", children: /* @__PURE__ */ o.jsx(
|
|
3381
3590
|
"input",
|
|
3382
3591
|
{
|
|
3383
3592
|
type: "checkbox",
|
|
3384
3593
|
className: "searchstax-facet-input-checkbox",
|
|
3385
|
-
checked: I(
|
|
3594
|
+
checked: I(b),
|
|
3386
3595
|
readOnly: !0,
|
|
3387
|
-
disabled:
|
|
3388
|
-
onClick: (
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3596
|
+
disabled: b.disabled,
|
|
3597
|
+
onClick: ($) => {
|
|
3598
|
+
L(
|
|
3599
|
+
F + m.name,
|
|
3600
|
+
$,
|
|
3601
|
+
b,
|
|
3393
3602
|
!0
|
|
3394
3603
|
);
|
|
3395
3604
|
}
|
|
@@ -3399,47 +3608,47 @@ function Ra(n) {
|
|
|
3399
3608
|
"div",
|
|
3400
3609
|
{
|
|
3401
3610
|
className: "searchstax-facet-value-label",
|
|
3402
|
-
onClick: (
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3611
|
+
onClick: ($) => {
|
|
3612
|
+
L(
|
|
3613
|
+
F + m.name,
|
|
3614
|
+
$,
|
|
3615
|
+
b,
|
|
3407
3616
|
!1
|
|
3408
3617
|
);
|
|
3409
3618
|
},
|
|
3410
|
-
children:
|
|
3619
|
+
children: b.value
|
|
3411
3620
|
}
|
|
3412
3621
|
),
|
|
3413
3622
|
/* @__PURE__ */ o.jsxs(
|
|
3414
3623
|
"div",
|
|
3415
3624
|
{
|
|
3416
3625
|
className: "searchstax-facet-value-count",
|
|
3417
|
-
onClick: (
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3626
|
+
onClick: ($) => {
|
|
3627
|
+
L(
|
|
3628
|
+
F + m.name,
|
|
3629
|
+
$,
|
|
3630
|
+
b,
|
|
3422
3631
|
!1
|
|
3423
3632
|
);
|
|
3424
3633
|
},
|
|
3425
3634
|
children: [
|
|
3426
3635
|
"(",
|
|
3427
|
-
|
|
3636
|
+
b.count,
|
|
3428
3637
|
")"
|
|
3429
3638
|
]
|
|
3430
3639
|
}
|
|
3431
3640
|
)
|
|
3432
3641
|
]
|
|
3433
3642
|
},
|
|
3434
|
-
|
|
3643
|
+
b.value + b.parentName
|
|
3435
3644
|
))
|
|
3436
3645
|
),
|
|
3437
3646
|
m.hasMoreFacets && /* @__PURE__ */ o.jsx("div", { className: "searchstax-facet-show-more-container", children: /* @__PURE__ */ o.jsxs(
|
|
3438
3647
|
"div",
|
|
3439
3648
|
{
|
|
3440
3649
|
className: "searchstax-facet-show-more-container",
|
|
3441
|
-
onClick: (
|
|
3442
|
-
N(
|
|
3650
|
+
onClick: (b) => {
|
|
3651
|
+
N(b, m);
|
|
3443
3652
|
},
|
|
3444
3653
|
children: [
|
|
3445
3654
|
m.showingAllFacets && /* @__PURE__ */ o.jsx("div", { className: "searchstax-facet-show-less-button searchstax-facet-show-button", children: "less" }),
|
|
@@ -3452,16 +3661,16 @@ function Ra(n) {
|
|
|
3452
3661
|
},
|
|
3453
3662
|
m.name + "desktop"
|
|
3454
3663
|
)) }),
|
|
3455
|
-
|
|
3664
|
+
i.facetsTemplateDesktop && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.facetsTemplateDesktop(
|
|
3456
3665
|
e,
|
|
3457
3666
|
d,
|
|
3458
|
-
|
|
3459
|
-
L,
|
|
3667
|
+
k,
|
|
3460
3668
|
T,
|
|
3669
|
+
L,
|
|
3461
3670
|
I,
|
|
3462
3671
|
N
|
|
3463
3672
|
) }),
|
|
3464
|
-
(
|
|
3673
|
+
(s == null ? void 0 : s.hasResultsOrExternalPromotions) && !i.facetsTemplateMobile && /* @__PURE__ */ o.jsx("div", { className: "searchstax-facets-container-mobile", children: /* @__PURE__ */ o.jsxs("div", { className: "searchstax-facets-pills-container", children: [
|
|
3465
3674
|
/* @__PURE__ */ o.jsx(
|
|
3466
3675
|
"div",
|
|
3467
3676
|
{
|
|
@@ -3478,7 +3687,7 @@ function Ra(n) {
|
|
|
3478
3687
|
{
|
|
3479
3688
|
className: "searchstax-facets-pill searchstax-facets-pill-facets",
|
|
3480
3689
|
onClick: () => {
|
|
3481
|
-
|
|
3690
|
+
R(m);
|
|
3482
3691
|
},
|
|
3483
3692
|
children: [
|
|
3484
3693
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facets-pill-label", children: [
|
|
@@ -3507,7 +3716,7 @@ function Ra(n) {
|
|
|
3507
3716
|
"div",
|
|
3508
3717
|
{
|
|
3509
3718
|
className: `searchstax-facets-mobile-overlay ${//@ts-ignore
|
|
3510
|
-
|
|
3719
|
+
s.overlayOpened ? "searchstax-show" : ""}`,
|
|
3511
3720
|
children: [
|
|
3512
3721
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facets-mobile-overlay-header", children: [
|
|
3513
3722
|
/* @__PURE__ */ o.jsx("div", { className: "searchstax-facets-mobile-overlay-header-title", children: "Filter By" }),
|
|
@@ -3516,22 +3725,22 @@ function Ra(n) {
|
|
|
3516
3725
|
{
|
|
3517
3726
|
className: "searchstax-search-close",
|
|
3518
3727
|
onClick: () => {
|
|
3519
|
-
|
|
3728
|
+
Q();
|
|
3520
3729
|
}
|
|
3521
3730
|
}
|
|
3522
3731
|
)
|
|
3523
3732
|
] }),
|
|
3524
|
-
/* @__PURE__ */ o.jsx("div", { className: "searchstax-facets-container-mobile", children:
|
|
3733
|
+
/* @__PURE__ */ o.jsx("div", { className: "searchstax-facets-container-mobile", children: s == null ? void 0 : s.facets.map((m) => /* @__PURE__ */ o.jsx(
|
|
3525
3734
|
"div",
|
|
3526
3735
|
{
|
|
3527
|
-
className: `searchstax-facet-container ${
|
|
3736
|
+
className: `searchstax-facet-container ${k(m.name) ? "active" : ""}`,
|
|
3528
3737
|
children: /* @__PURE__ */ o.jsxs("div", { children: [
|
|
3529
3738
|
/* @__PURE__ */ o.jsxs(
|
|
3530
3739
|
"div",
|
|
3531
3740
|
{
|
|
3532
3741
|
className: "searchstax-facet-title-container",
|
|
3533
3742
|
onClick: () => {
|
|
3534
|
-
|
|
3743
|
+
T(m.name);
|
|
3535
3744
|
},
|
|
3536
3745
|
children: [
|
|
3537
3746
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facet-title", children: [
|
|
@@ -3546,25 +3755,25 @@ function Ra(n) {
|
|
|
3546
3755
|
/* @__PURE__ */ o.jsxs("div", { className: "searchstax-facet-values-container", children: [
|
|
3547
3756
|
m.values.map(
|
|
3548
3757
|
//@ts-ignore
|
|
3549
|
-
(
|
|
3758
|
+
(b, F) => (d[F + m.name] = et(), /* @__PURE__ */ o.jsxs(
|
|
3550
3759
|
"div",
|
|
3551
3760
|
{
|
|
3552
|
-
className: `searchstax-facet-value-container ${
|
|
3553
|
-
ref: d[
|
|
3761
|
+
className: `searchstax-facet-value-container ${b.disabled ? "searchstax-facet-value-disabled" : ""}`,
|
|
3762
|
+
ref: d[F + m.name],
|
|
3554
3763
|
children: [
|
|
3555
3764
|
/* @__PURE__ */ o.jsx("div", { className: "searchstax-facet-input", children: /* @__PURE__ */ o.jsx(
|
|
3556
3765
|
"input",
|
|
3557
3766
|
{
|
|
3558
3767
|
type: "checkbox",
|
|
3559
3768
|
className: "searchstax-facet-input-checkbox",
|
|
3560
|
-
checked: I(
|
|
3769
|
+
checked: I(b),
|
|
3561
3770
|
readOnly: !0,
|
|
3562
|
-
disabled:
|
|
3563
|
-
onClick: (
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3771
|
+
disabled: b.disabled,
|
|
3772
|
+
onClick: ($) => {
|
|
3773
|
+
L(
|
|
3774
|
+
F + m.name,
|
|
3775
|
+
$,
|
|
3776
|
+
b,
|
|
3568
3777
|
!0
|
|
3569
3778
|
);
|
|
3570
3779
|
}
|
|
@@ -3574,39 +3783,39 @@ function Ra(n) {
|
|
|
3574
3783
|
"div",
|
|
3575
3784
|
{
|
|
3576
3785
|
className: "searchstax-facet-value-label",
|
|
3577
|
-
onClick: (
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3786
|
+
onClick: ($) => {
|
|
3787
|
+
L(
|
|
3788
|
+
F + m.name,
|
|
3789
|
+
$,
|
|
3790
|
+
b,
|
|
3582
3791
|
!1
|
|
3583
3792
|
);
|
|
3584
3793
|
},
|
|
3585
|
-
children:
|
|
3794
|
+
children: b.value
|
|
3586
3795
|
}
|
|
3587
3796
|
),
|
|
3588
3797
|
/* @__PURE__ */ o.jsxs(
|
|
3589
3798
|
"div",
|
|
3590
3799
|
{
|
|
3591
3800
|
className: "searchstax-facet-value-count",
|
|
3592
|
-
onClick: (
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3801
|
+
onClick: ($) => {
|
|
3802
|
+
L(
|
|
3803
|
+
F + m.name,
|
|
3804
|
+
$,
|
|
3805
|
+
b,
|
|
3597
3806
|
!1
|
|
3598
3807
|
);
|
|
3599
3808
|
},
|
|
3600
3809
|
children: [
|
|
3601
3810
|
"(",
|
|
3602
|
-
|
|
3811
|
+
b.count,
|
|
3603
3812
|
")"
|
|
3604
3813
|
]
|
|
3605
3814
|
}
|
|
3606
3815
|
)
|
|
3607
3816
|
]
|
|
3608
3817
|
},
|
|
3609
|
-
|
|
3818
|
+
b.value + b.parentName
|
|
3610
3819
|
))
|
|
3611
3820
|
),
|
|
3612
3821
|
/* @__PURE__ */ o.jsx(
|
|
@@ -3618,8 +3827,8 @@ function Ra(n) {
|
|
|
3618
3827
|
"div",
|
|
3619
3828
|
{
|
|
3620
3829
|
className: "searchstax-facet-show-more-container",
|
|
3621
|
-
onClick: (
|
|
3622
|
-
W(
|
|
3830
|
+
onClick: (b) => {
|
|
3831
|
+
W(b, m);
|
|
3623
3832
|
},
|
|
3624
3833
|
children: [
|
|
3625
3834
|
m.showingAllFacets && /* @__PURE__ */ o.jsx("div", { className: "searchstax-facet-show-less-button searchstax-facet-show-button", children: "less" }),
|
|
@@ -3639,7 +3848,7 @@ function Ra(n) {
|
|
|
3639
3848
|
{
|
|
3640
3849
|
className: "searchstax-facets-mobile-overlay-done",
|
|
3641
3850
|
onClick: () => {
|
|
3642
|
-
|
|
3851
|
+
Q();
|
|
3643
3852
|
},
|
|
3644
3853
|
children: "Done"
|
|
3645
3854
|
}
|
|
@@ -3648,47 +3857,47 @@ function Ra(n) {
|
|
|
3648
3857
|
}
|
|
3649
3858
|
)
|
|
3650
3859
|
] }) }),
|
|
3651
|
-
|
|
3652
|
-
|
|
3860
|
+
i.facetsTemplateMobile && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.facetsTemplateMobile(
|
|
3861
|
+
s,
|
|
3653
3862
|
r,
|
|
3654
3863
|
d,
|
|
3655
|
-
|
|
3656
|
-
L,
|
|
3864
|
+
k,
|
|
3657
3865
|
T,
|
|
3866
|
+
L,
|
|
3658
3867
|
I,
|
|
3659
|
-
|
|
3868
|
+
R,
|
|
3660
3869
|
W,
|
|
3661
3870
|
A,
|
|
3662
|
-
|
|
3871
|
+
Q,
|
|
3663
3872
|
M
|
|
3664
3873
|
) })
|
|
3665
3874
|
] }) });
|
|
3666
3875
|
}
|
|
3667
|
-
function
|
|
3876
|
+
function Ia(i) {
|
|
3668
3877
|
let e = !1;
|
|
3669
|
-
const [t,
|
|
3878
|
+
const [t, s] = H(null), [a] = H(Math.random());
|
|
3670
3879
|
ee(() => {
|
|
3671
|
-
if (r(),
|
|
3672
|
-
|
|
3673
|
-
relatedSearchesURL:
|
|
3674
|
-
relatedSearchesAPIKey:
|
|
3880
|
+
if (r(), C.searchstax)
|
|
3881
|
+
C.searchstax.addRelatedSearchesWidget("searchstax-related-searches-container" + a, {
|
|
3882
|
+
relatedSearchesURL: i.relatedSearchesURL,
|
|
3883
|
+
relatedSearchesAPIKey: i.relatedSearchesAPIKey
|
|
3675
3884
|
});
|
|
3676
3885
|
else
|
|
3677
3886
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3678
3887
|
}, []);
|
|
3679
3888
|
function r() {
|
|
3680
|
-
e || (
|
|
3889
|
+
e || (C.searchstax.dataLayer.$searchRelatedSearchesData.subscribe(
|
|
3681
3890
|
(l) => {
|
|
3682
|
-
|
|
3891
|
+
s(l);
|
|
3683
3892
|
}
|
|
3684
3893
|
), e = !0);
|
|
3685
3894
|
}
|
|
3686
3895
|
function c(l) {
|
|
3687
|
-
var
|
|
3688
|
-
(
|
|
3896
|
+
var u;
|
|
3897
|
+
(u = C.searchstax.relatedSearchesWidget) == null || u.executeSearch(l);
|
|
3689
3898
|
}
|
|
3690
3899
|
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
3691
|
-
!
|
|
3900
|
+
!i.searchRelatedSearchesTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.hasRelatedSearches) && /* @__PURE__ */ o.jsxs("div", { className: "searchstax-related-searches-container", id: "searchstax-related-searches-container", children: [
|
|
3692
3901
|
" ",
|
|
3693
3902
|
"Related searches: ",
|
|
3694
3903
|
/* @__PURE__ */ o.jsx("span", { id: "searchstax-related-searches" }),
|
|
@@ -3708,40 +3917,40 @@ function ka(n) {
|
|
|
3708
3917
|
l.related_search
|
|
3709
3918
|
)) })
|
|
3710
3919
|
] }),
|
|
3711
|
-
|
|
3920
|
+
i.searchRelatedSearchesTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.searchRelatedSearchesTemplate(t, c) })
|
|
3712
3921
|
] });
|
|
3713
3922
|
}
|
|
3714
|
-
function
|
|
3923
|
+
function Pa(i) {
|
|
3715
3924
|
let e = !1;
|
|
3716
|
-
const [t,
|
|
3925
|
+
const [t, s] = H(
|
|
3717
3926
|
null
|
|
3718
|
-
), [
|
|
3927
|
+
), [a] = H(Math.random());
|
|
3719
3928
|
ee(() => {
|
|
3720
|
-
if (r(),
|
|
3721
|
-
|
|
3929
|
+
if (r(), C.searchstax)
|
|
3930
|
+
C.searchstax.addExternalPromotionsWidget("searchstax-external-promotions-layout-container" + a, {});
|
|
3722
3931
|
else
|
|
3723
3932
|
throw Error("Searchstax instance needs to be passed via props");
|
|
3724
3933
|
}, []);
|
|
3725
3934
|
function r() {
|
|
3726
|
-
e || (
|
|
3935
|
+
e || (C.searchstax.dataLayer.$searchExternalPromotionsData.subscribe(
|
|
3727
3936
|
(l) => {
|
|
3728
|
-
|
|
3937
|
+
s(l);
|
|
3729
3938
|
}
|
|
3730
3939
|
), e = !0);
|
|
3731
3940
|
}
|
|
3732
|
-
function c(l,
|
|
3941
|
+
function c(l, u) {
|
|
3733
3942
|
var d;
|
|
3734
|
-
(d =
|
|
3943
|
+
(d = C.searchstax.externalPromotionsWidget) == null || d.trackClick(l, u);
|
|
3735
3944
|
}
|
|
3736
|
-
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { id: "searchstax-external-promotions-layout-container" +
|
|
3737
|
-
!
|
|
3945
|
+
return /* @__PURE__ */ o.jsx(o.Fragment, { children: /* @__PURE__ */ o.jsxs("div", { id: "searchstax-external-promotions-layout-container" + a, children: [
|
|
3946
|
+
!i.searchExternalPromotionsTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.hasExternalPromotions) && /* @__PURE__ */ o.jsx(o.Fragment, { children: t.externalPromotions.map((l) => /* @__PURE__ */ o.jsxs("div", { className: "searchstax-external-promotion searchstax-search-result", children: [
|
|
3738
3947
|
/* @__PURE__ */ o.jsx("div", { className: "icon-elevated" }),
|
|
3739
3948
|
l.url && /* @__PURE__ */ o.jsx(
|
|
3740
3949
|
"a",
|
|
3741
3950
|
{
|
|
3742
3951
|
href: l.url,
|
|
3743
|
-
onClick: (
|
|
3744
|
-
c(l,
|
|
3952
|
+
onClick: (u) => {
|
|
3953
|
+
c(l, u);
|
|
3745
3954
|
},
|
|
3746
3955
|
className: "searchstax-result-item-link"
|
|
3747
3956
|
}
|
|
@@ -3758,17 +3967,17 @@ function Ea(n) {
|
|
|
3758
3967
|
" "
|
|
3759
3968
|
] })
|
|
3760
3969
|
] }, l.id)) }),
|
|
3761
|
-
|
|
3970
|
+
i.searchExternalPromotionsTemplate && /* @__PURE__ */ o.jsx(o.Fragment, { children: i.searchExternalPromotionsTemplate(t, c) })
|
|
3762
3971
|
] }) });
|
|
3763
3972
|
}
|
|
3764
3973
|
export {
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3974
|
+
Pa as SearchstaxExternalPromotionsWidget,
|
|
3975
|
+
Ea as SearchstaxFacetsWidget,
|
|
3976
|
+
Sa as SearchstaxInputWidget,
|
|
3977
|
+
wa as SearchstaxOverviewWidget,
|
|
3978
|
+
ka as SearchstaxPaginationWidget,
|
|
3979
|
+
Ia as SearchstaxRelatedSearchesWidget,
|
|
3980
|
+
Ta as SearchstaxResultWidget,
|
|
3981
|
+
Ra as SearchstaxSortingWidget,
|
|
3982
|
+
La as SearchstaxWrapper
|
|
3774
3983
|
};
|