@searchstax-inc/searchstudio-ux-react 0.0.11 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,5 @@
1
- import ze, { useEffect as be, useState as pe } from "react";
2
- var d = {}, Rt = {
3
- get exports() {
4
- return d;
5
- },
6
- set exports(r) {
7
- d = r;
8
- }
9
- }, J = {};
1
+ import st, { useState as B, useEffect as se } from "react";
2
+ var Ee = { exports: {} }, ce = {};
10
3
  /**
11
4
  * @license React
12
5
  * react-jsx-runtime.production.min.js
@@ -16,25 +9,25 @@ var d = {}, Rt = {
16
9
  * This source code is licensed under the MIT license found in the
17
10
  * LICENSE file in the root directory of this source tree.
18
11
  */
19
- var qe;
20
- function St() {
21
- if (qe)
22
- return J;
23
- qe = 1;
24
- var r = ze, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
25
- function u(l, h, p) {
26
- var C, I = {}, L = null, D = null;
27
- p !== void 0 && (L = "" + p), h.key !== void 0 && (L = "" + h.key), h.ref !== void 0 && (D = h.ref);
28
- for (C in h)
29
- n.call(h, C) && !i.hasOwnProperty(C) && (I[C] = h[C]);
12
+ var Ge;
13
+ function Pt() {
14
+ if (Ge)
15
+ return ce;
16
+ Ge = 1;
17
+ var n = st, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, a = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, r = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function c(l, h, u) {
19
+ var g, m = {}, y = null, R = null;
20
+ u !== void 0 && (y = "" + u), h.key !== void 0 && (y = "" + h.key), h.ref !== void 0 && (R = h.ref);
21
+ for (g in h)
22
+ s.call(h, g) && !r.hasOwnProperty(g) && (m[g] = h[g]);
30
23
  if (l && l.defaultProps)
31
- for (C in h = l.defaultProps, h)
32
- I[C] === void 0 && (I[C] = h[C]);
33
- return { $$typeof: e, type: l, key: L, ref: D, props: I, _owner: a.current };
24
+ for (g in h = l.defaultProps, h)
25
+ m[g] === void 0 && (m[g] = h[g]);
26
+ return { $$typeof: e, type: l, key: y, ref: R, props: m, _owner: a.current };
34
27
  }
35
- return J.Fragment = s, J.jsx = u, J.jsxs = u, J;
28
+ return ce.Fragment = t, ce.jsx = c, ce.jsxs = c, ce;
36
29
  }
37
- var X = {};
30
+ var le = {};
38
31
  /**
39
32
  * @license React
40
33
  * react-jsx-runtime.development.js
@@ -44,91 +37,91 @@ var X = {};
44
37
  * This source code is licensed under the MIT license found in the
45
38
  * LICENSE file in the root directory of this source tree.
46
39
  */
47
- var $e;
48
- function Et() {
49
- return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
50
- var r = ze, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), C = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), K = Symbol.iterator, E = "@@iterator";
51
- function O(t) {
52
- if (t === null || typeof t != "object")
40
+ var Ze;
41
+ function wt() {
42
+ return Ze || (Ze = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var n = st, 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"), h = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), F = Symbol.iterator, L = "@@iterator";
44
+ function x(i) {
45
+ if (i === null || typeof i != "object")
53
46
  return null;
54
- var o = K && t[K] || t[E];
55
- return typeof o == "function" ? o : null;
47
+ var d = F && i[F] || i[L];
48
+ return typeof d == "function" ? d : null;
56
49
  }
57
- var R = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
- function y(t) {
50
+ var P = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function C(i) {
59
52
  {
60
- for (var o = arguments.length, c = new Array(o > 1 ? o - 1 : 0), f = 1; f < o; f++)
61
- c[f - 1] = arguments[f];
62
- B("error", t, c);
53
+ for (var d = arguments.length, f = new Array(d > 1 ? d - 1 : 0), b = 1; b < d; b++)
54
+ f[b - 1] = arguments[b];
55
+ D("error", i, f);
63
56
  }
64
57
  }
65
- function B(t, o, c) {
58
+ function D(i, d, f) {
66
59
  {
67
- var f = R.ReactDebugCurrentFrame, b = f.getStackAddendum();
68
- b !== "" && (o += "%s", c = c.concat([b]));
69
- var x = c.map(function(m) {
70
- return String(m);
60
+ var b = P.ReactDebugCurrentFrame, k = b.getStackAddendum();
61
+ k !== "" && (d += "%s", f = f.concat([k]));
62
+ var w = f.map(function(T) {
63
+ return String(T);
71
64
  });
72
- x.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, x);
65
+ w.unshift("Warning: " + d), Function.prototype.apply.call(console[i], console, w);
73
66
  }
74
67
  }
75
- var H = !1, P = !1, Y = !1, ie = !1, j = !1, xe;
76
- xe = Symbol.for("react.module.reference");
77
- function Ge(t) {
78
- return !!(typeof t == "string" || typeof t == "function" || t === n || t === i || j || t === a || t === p || t === C || ie || t === D || H || P || Y || typeof t == "object" && t !== null && (t.$$typeof === L || t.$$typeof === I || t.$$typeof === u || t.$$typeof === l || t.$$typeof === h || // This needs to include all possible module reference object
68
+ var q = !1, j = !1, U = !1, G = !1, _ = !1, Z;
69
+ Z = Symbol.for("react.module.reference");
70
+ function J(i) {
71
+ return !!(typeof i == "string" || typeof i == "function" || i === s || i === r || _ || i === a || i === u || i === g || G || i === R || q || j || U || typeof i == "object" && i !== null && (i.$$typeof === y || i.$$typeof === m || i.$$typeof === c || i.$$typeof === l || i.$$typeof === h || // This needs to include all possible module reference object
79
72
  // types supported by any Flight configuration anywhere since
80
73
  // we don't know which Flight build this will end up being used
81
74
  // with.
82
- t.$$typeof === xe || t.getModuleId !== void 0));
75
+ i.$$typeof === Z || i.getModuleId !== void 0));
83
76
  }
84
- function Je(t, o, c) {
85
- var f = t.displayName;
86
- if (f)
87
- return f;
88
- var b = o.displayName || o.name || "";
89
- return b !== "" ? c + "(" + b + ")" : c;
77
+ function Y(i, d, f) {
78
+ var b = i.displayName;
79
+ if (b)
80
+ return b;
81
+ var k = d.displayName || d.name || "";
82
+ return k !== "" ? f + "(" + k + ")" : f;
90
83
  }
91
- function Ce(t) {
92
- return t.displayName || "Context";
84
+ function Pe(i) {
85
+ return i.displayName || "Context";
93
86
  }
94
- function V(t) {
95
- if (t == null)
87
+ function Q(i) {
88
+ if (i == null)
96
89
  return null;
97
- if (typeof t.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
98
- return t.displayName || t.name || null;
99
- if (typeof t == "string")
100
- return t;
101
- switch (t) {
102
- case n:
103
- return "Fragment";
90
+ if (typeof i.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
91
+ return i.displayName || i.name || null;
92
+ if (typeof i == "string")
93
+ return i;
94
+ switch (i) {
104
95
  case s:
96
+ return "Fragment";
97
+ case t:
105
98
  return "Portal";
106
- case i:
99
+ case r:
107
100
  return "Profiler";
108
101
  case a:
109
102
  return "StrictMode";
110
- case p:
103
+ case u:
111
104
  return "Suspense";
112
- case C:
105
+ case g:
113
106
  return "SuspenseList";
114
107
  }
115
- if (typeof t == "object")
116
- switch (t.$$typeof) {
108
+ if (typeof i == "object")
109
+ switch (i.$$typeof) {
117
110
  case l:
118
- var o = t;
119
- return Ce(o) + ".Consumer";
120
- case u:
121
- var c = t;
122
- return Ce(c._context) + ".Provider";
111
+ var d = i;
112
+ return Pe(d) + ".Consumer";
113
+ case c:
114
+ var f = i;
115
+ return Pe(f._context) + ".Provider";
123
116
  case h:
124
- return Je(t, t.render, "ForwardRef");
125
- case I:
126
- var f = t.displayName || null;
127
- return f !== null ? f : V(t.type) || "Memo";
128
- case L: {
129
- var b = t, x = b._payload, m = b._init;
117
+ return Y(i, i.render, "ForwardRef");
118
+ case m:
119
+ var b = i.displayName || null;
120
+ return b !== null ? b : Q(i.type) || "Memo";
121
+ case y: {
122
+ var k = i, w = k._payload, T = k._init;
130
123
  try {
131
- return V(m(x));
124
+ return Q(T(w));
132
125
  } catch {
133
126
  return null;
134
127
  }
@@ -136,515 +129,638 @@ function Et() {
136
129
  }
137
130
  return null;
138
131
  }
139
- var U = Object.assign, z = 0, Re, Se, Ee, ke, Te, Ie, Ae;
140
- function we() {
132
+ var X = Object.assign, ie = 0, we, Fe, je, Oe, Me, Ae, De;
133
+ function $e() {
141
134
  }
142
- we.__reactDisabledLog = !0;
143
- function Xe() {
135
+ $e.__reactDisabledLog = !0;
136
+ function rt() {
144
137
  {
145
- if (z === 0) {
146
- Re = console.log, Se = console.info, Ee = console.warn, ke = console.error, Te = console.group, Ie = console.groupCollapsed, Ae = console.groupEnd;
147
- var t = {
138
+ if (ie === 0) {
139
+ we = console.log, Fe = console.info, je = console.warn, Oe = console.error, Me = console.group, Ae = console.groupCollapsed, De = console.groupEnd;
140
+ var i = {
148
141
  configurable: !0,
149
142
  enumerable: !0,
150
- value: we,
143
+ value: $e,
151
144
  writable: !0
152
145
  };
153
146
  Object.defineProperties(console, {
154
- info: t,
155
- log: t,
156
- warn: t,
157
- error: t,
158
- group: t,
159
- groupCollapsed: t,
160
- groupEnd: t
147
+ info: i,
148
+ log: i,
149
+ warn: i,
150
+ error: i,
151
+ group: i,
152
+ groupCollapsed: i,
153
+ groupEnd: i
161
154
  });
162
155
  }
163
- z++;
156
+ ie++;
164
157
  }
165
158
  }
166
- function Qe() {
159
+ function it() {
167
160
  {
168
- if (z--, z === 0) {
169
- var t = {
161
+ if (ie--, ie === 0) {
162
+ var i = {
170
163
  configurable: !0,
171
164
  enumerable: !0,
172
165
  writable: !0
173
166
  };
174
167
  Object.defineProperties(console, {
175
- log: U({}, t, {
176
- value: Re
177
- }),
178
- info: U({}, t, {
179
- value: Se
168
+ log: X({}, i, {
169
+ value: we
180
170
  }),
181
- warn: U({}, t, {
182
- value: Ee
171
+ info: X({}, i, {
172
+ value: Fe
183
173
  }),
184
- error: U({}, t, {
185
- value: ke
174
+ warn: X({}, i, {
175
+ value: je
186
176
  }),
187
- group: U({}, t, {
188
- value: Te
177
+ error: X({}, i, {
178
+ value: Oe
189
179
  }),
190
- groupCollapsed: U({}, t, {
191
- value: Ie
180
+ group: X({}, i, {
181
+ value: Me
192
182
  }),
193
- groupEnd: U({}, t, {
183
+ groupCollapsed: X({}, i, {
194
184
  value: Ae
185
+ }),
186
+ groupEnd: X({}, i, {
187
+ value: De
195
188
  })
196
189
  });
197
190
  }
198
- z < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ ie < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
192
  }
200
193
  }
201
- var oe = R.ReactCurrentDispatcher, ue;
202
- function te(t, o, c) {
194
+ var ye = P.ReactCurrentDispatcher, be;
195
+ function ge(i, d, f) {
203
196
  {
204
- if (ue === void 0)
197
+ if (be === void 0)
205
198
  try {
206
199
  throw Error();
207
- } catch (b) {
208
- var f = b.stack.trim().match(/\n( *(at )?)/);
209
- ue = f && f[1] || "";
200
+ } catch (k) {
201
+ var b = k.stack.trim().match(/\n( *(at )?)/);
202
+ be = b && b[1] || "";
210
203
  }
211
204
  return `
212
- ` + ue + t;
205
+ ` + be + i;
213
206
  }
214
207
  }
215
- var ce = !1, se;
208
+ var xe = !1, pe;
216
209
  {
217
- var Ze = typeof WeakMap == "function" ? WeakMap : Map;
218
- se = new Ze();
210
+ var nt = typeof WeakMap == "function" ? WeakMap : Map;
211
+ pe = new nt();
219
212
  }
220
- function Le(t, o) {
221
- if (!t || ce)
213
+ function qe(i, d) {
214
+ if (!i || xe)
222
215
  return "";
223
216
  {
224
- var c = se.get(t);
225
- if (c !== void 0)
226
- return c;
217
+ var f = pe.get(i);
218
+ if (f !== void 0)
219
+ return f;
227
220
  }
228
- var f;
229
- ce = !0;
230
- var b = Error.prepareStackTrace;
221
+ var b;
222
+ xe = !0;
223
+ var k = Error.prepareStackTrace;
231
224
  Error.prepareStackTrace = void 0;
232
- var x;
233
- x = oe.current, oe.current = null, Xe();
225
+ var w;
226
+ w = ye.current, ye.current = null, rt();
234
227
  try {
235
- if (o) {
236
- var m = function() {
228
+ if (d) {
229
+ var T = function() {
237
230
  throw Error();
238
231
  };
239
- if (Object.defineProperty(m.prototype, "props", {
232
+ if (Object.defineProperty(T.prototype, "props", {
240
233
  set: function() {
241
234
  throw Error();
242
235
  }
243
236
  }), typeof Reflect == "object" && Reflect.construct) {
244
237
  try {
245
- Reflect.construct(m, []);
246
- } catch (M) {
247
- f = M;
238
+ Reflect.construct(T, []);
239
+ } catch (K) {
240
+ b = K;
248
241
  }
249
- Reflect.construct(t, [], m);
242
+ Reflect.construct(i, [], T);
250
243
  } else {
251
244
  try {
252
- m.call();
253
- } catch (M) {
254
- f = M;
245
+ T.call();
246
+ } catch (K) {
247
+ b = K;
255
248
  }
256
- t.call(m.prototype);
249
+ i.call(T.prototype);
257
250
  }
258
251
  } else {
259
252
  try {
260
253
  throw Error();
261
- } catch (M) {
262
- f = M;
254
+ } catch (K) {
255
+ b = K;
263
256
  }
264
- t();
257
+ i();
265
258
  }
266
- } catch (M) {
267
- if (M && f && typeof M.stack == "string") {
268
- for (var v = M.stack.split(`
269
- `), A = f.stack.split(`
270
- `), S = v.length - 1, k = A.length - 1; S >= 1 && k >= 0 && v[S] !== A[k]; )
271
- k--;
272
- for (; S >= 1 && k >= 0; S--, k--)
273
- if (v[S] !== A[k]) {
274
- if (S !== 1 || k !== 1)
259
+ } catch (K) {
260
+ if (K && b && typeof K.stack == "string") {
261
+ for (var S = K.stack.split(`
262
+ `), N = b.stack.split(`
263
+ `), O = S.length - 1, A = N.length - 1; O >= 1 && A >= 0 && S[O] !== N[A]; )
264
+ A--;
265
+ for (; O >= 1 && A >= 0; O--, A--)
266
+ if (S[O] !== N[A]) {
267
+ if (O !== 1 || A !== 1)
275
268
  do
276
- if (S--, k--, k < 0 || v[S] !== A[k]) {
277
- var _ = `
278
- ` + v[S].replace(" at new ", " at ");
279
- return t.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", t.displayName)), typeof t == "function" && se.set(t, _), _;
269
+ if (O--, A--, A < 0 || S[O] !== N[A]) {
270
+ var H = `
271
+ ` + S[O].replace(" at new ", " at ");
272
+ return i.displayName && H.includes("<anonymous>") && (H = H.replace("<anonymous>", i.displayName)), typeof i == "function" && pe.set(i, H), H;
280
273
  }
281
- while (S >= 1 && k >= 0);
274
+ while (O >= 1 && A >= 0);
282
275
  break;
283
276
  }
284
277
  }
285
278
  } finally {
286
- ce = !1, oe.current = x, Qe(), Error.prepareStackTrace = b;
279
+ xe = !1, ye.current = w, it(), Error.prepareStackTrace = k;
287
280
  }
288
- var W = t ? t.displayName || t.name : "", We = W ? te(W) : "";
289
- return typeof t == "function" && se.set(t, We), We;
281
+ var te = i ? i.displayName || i.name : "", Xe = te ? ge(te) : "";
282
+ return typeof i == "function" && pe.set(i, Xe), Xe;
290
283
  }
291
- function et(t, o, c) {
292
- return Le(t, !1);
284
+ function ct(i, d, f) {
285
+ return qe(i, !1);
293
286
  }
294
- function tt(t) {
295
- var o = t.prototype;
296
- return !!(o && o.isReactComponent);
287
+ function lt(i) {
288
+ var d = i.prototype;
289
+ return !!(d && d.isReactComponent);
297
290
  }
298
- function re(t, o, c) {
299
- if (t == null)
291
+ function fe(i, d, f) {
292
+ if (i == null)
300
293
  return "";
301
- if (typeof t == "function")
302
- return Le(t, tt(t));
303
- if (typeof t == "string")
304
- return te(t);
305
- switch (t) {
306
- case p:
307
- return te("Suspense");
308
- case C:
309
- return te("SuspenseList");
294
+ if (typeof i == "function")
295
+ return qe(i, lt(i));
296
+ if (typeof i == "string")
297
+ return ge(i);
298
+ switch (i) {
299
+ case u:
300
+ return ge("Suspense");
301
+ case g:
302
+ return ge("SuspenseList");
310
303
  }
311
- if (typeof t == "object")
312
- switch (t.$$typeof) {
304
+ if (typeof i == "object")
305
+ switch (i.$$typeof) {
313
306
  case h:
314
- return et(t.render);
315
- case I:
316
- return re(t.type, o, c);
317
- case L: {
318
- var f = t, b = f._payload, x = f._init;
307
+ return ct(i.render);
308
+ case m:
309
+ return fe(i.type, d, f);
310
+ case y: {
311
+ var b = i, k = b._payload, w = b._init;
319
312
  try {
320
- return re(x(b), o, c);
313
+ return fe(w(k), d, f);
321
314
  } catch {
322
315
  }
323
316
  }
324
317
  }
325
318
  return "";
326
319
  }
327
- var ae = Object.prototype.hasOwnProperty, _e = {}, je = R.ReactDebugCurrentFrame;
328
- function ne(t) {
329
- if (t) {
330
- var o = t._owner, c = re(t.type, t._source, o ? o.type : null);
331
- je.setExtraStackFrame(c);
320
+ var me = Object.prototype.hasOwnProperty, _e = {}, Ne = P.ReactDebugCurrentFrame;
321
+ function ve(i) {
322
+ if (i) {
323
+ var d = i._owner, f = fe(i.type, i._source, d ? d.type : null);
324
+ Ne.setExtraStackFrame(f);
332
325
  } else
333
- je.setExtraStackFrame(null);
326
+ Ne.setExtraStackFrame(null);
334
327
  }
335
- function st(t, o, c, f, b) {
328
+ function ot(i, d, f, b, k) {
336
329
  {
337
- var x = Function.call.bind(ae);
338
- for (var m in t)
339
- if (x(t, m)) {
340
- var v = void 0;
330
+ var w = Function.call.bind(me);
331
+ for (var T in i)
332
+ if (w(i, T)) {
333
+ var S = void 0;
341
334
  try {
342
- if (typeof t[m] != "function") {
343
- var A = Error((f || "React class") + ": " + c + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
- throw A.name = "Invariant Violation", A;
335
+ if (typeof i[T] != "function") {
336
+ var N = Error((b || "React class") + ": " + f + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw N.name = "Invariant Violation", N;
345
338
  }
346
- v = t[m](o, m, f, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
- } catch (S) {
348
- v = S;
339
+ S = i[T](d, T, b, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (O) {
341
+ S = O;
349
342
  }
350
- v && !(v instanceof Error) && (ne(b), y("%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).", f || "React class", c, m, typeof v), ne(null)), v instanceof Error && !(v.message in _e) && (_e[v.message] = !0, ne(b), y("Failed %s type: %s", c, v.message), ne(null));
343
+ S && !(S instanceof Error) && (ve(k), C("%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).", b || "React class", f, T, typeof S), ve(null)), S instanceof Error && !(S.message in _e) && (_e[S.message] = !0, ve(k), C("Failed %s type: %s", f, S.message), ve(null));
351
344
  }
352
345
  }
353
346
  }
354
- var rt = Array.isArray;
355
- function le(t) {
356
- return rt(t);
347
+ var ht = Array.isArray;
348
+ function Ce(i) {
349
+ return ht(i);
357
350
  }
358
- function at(t) {
351
+ function ut(i) {
359
352
  {
360
- var o = typeof Symbol == "function" && Symbol.toStringTag, c = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
361
- return c;
353
+ var d = typeof Symbol == "function" && Symbol.toStringTag, f = d && i[Symbol.toStringTag] || i.constructor.name || "Object";
354
+ return f;
362
355
  }
363
356
  }
364
- function nt(t) {
357
+ function dt(i) {
365
358
  try {
366
- return Oe(t), !1;
359
+ return Ve(i), !1;
367
360
  } catch {
368
361
  return !0;
369
362
  }
370
363
  }
371
- function Oe(t) {
372
- return "" + t;
364
+ function Ve(i) {
365
+ return "" + i;
373
366
  }
374
- function Pe(t) {
375
- if (nt(t))
376
- return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", at(t)), Oe(t);
367
+ function He(i) {
368
+ if (dt(i))
369
+ return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ut(i)), Ve(i);
377
370
  }
378
- var G = R.ReactCurrentOwner, it = {
371
+ var ne = P.ReactCurrentOwner, gt = {
379
372
  key: !0,
380
373
  ref: !0,
381
374
  __self: !0,
382
375
  __source: !0
383
- }, Ve, Me, he;
384
- he = {};
385
- function ot(t) {
386
- if (ae.call(t, "ref")) {
387
- var o = Object.getOwnPropertyDescriptor(t, "ref").get;
388
- if (o && o.isReactWarning)
376
+ }, Be, We, Se;
377
+ Se = {};
378
+ function pt(i) {
379
+ if (me.call(i, "ref")) {
380
+ var d = Object.getOwnPropertyDescriptor(i, "ref").get;
381
+ if (d && d.isReactWarning)
389
382
  return !1;
390
383
  }
391
- return t.ref !== void 0;
384
+ return i.ref !== void 0;
392
385
  }
393
- function ut(t) {
394
- if (ae.call(t, "key")) {
395
- var o = Object.getOwnPropertyDescriptor(t, "key").get;
396
- if (o && o.isReactWarning)
386
+ function ft(i) {
387
+ if (me.call(i, "key")) {
388
+ var d = Object.getOwnPropertyDescriptor(i, "key").get;
389
+ if (d && d.isReactWarning)
397
390
  return !1;
398
391
  }
399
- return t.key !== void 0;
392
+ return i.key !== void 0;
400
393
  }
401
- function ct(t, o) {
402
- if (typeof t.ref == "string" && G.current && o && G.current.stateNode !== o) {
403
- var c = V(G.current.type);
404
- he[c] || (y('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', V(G.current.type), t.ref), he[c] = !0);
394
+ function mt(i, d) {
395
+ if (typeof i.ref == "string" && ne.current && d && ne.current.stateNode !== d) {
396
+ var f = Q(ne.current.type);
397
+ Se[f] || (C('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', Q(ne.current.type), i.ref), Se[f] = !0);
405
398
  }
406
399
  }
407
- function lt(t, o) {
400
+ function vt(i, d) {
408
401
  {
409
- var c = function() {
410
- Ve || (Ve = !0, y("%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)", o));
402
+ var f = function() {
403
+ Be || (Be = !0, C("%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)", d));
411
404
  };
412
- c.isReactWarning = !0, Object.defineProperty(t, "key", {
413
- get: c,
405
+ f.isReactWarning = !0, Object.defineProperty(i, "key", {
406
+ get: f,
414
407
  configurable: !0
415
408
  });
416
409
  }
417
410
  }
418
- function ht(t, o) {
411
+ function yt(i, d) {
419
412
  {
420
- var c = function() {
421
- Me || (Me = !0, y("%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)", o));
413
+ var f = function() {
414
+ We || (We = !0, C("%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)", d));
422
415
  };
423
- c.isReactWarning = !0, Object.defineProperty(t, "ref", {
424
- get: c,
416
+ f.isReactWarning = !0, Object.defineProperty(i, "ref", {
417
+ get: f,
425
418
  configurable: !0
426
419
  });
427
420
  }
428
421
  }
429
- var gt = function(t, o, c, f, b, x, m) {
430
- var v = {
422
+ var bt = function(i, d, f, b, k, w, T) {
423
+ var S = {
431
424
  // This tag allows us to uniquely identify this as a React Element
432
425
  $$typeof: e,
433
426
  // Built-in properties that belong on the element
434
- type: t,
435
- key: o,
436
- ref: c,
437
- props: m,
427
+ type: i,
428
+ key: d,
429
+ ref: f,
430
+ props: T,
438
431
  // Record the component responsible for creating this element.
439
- _owner: x
432
+ _owner: w
440
433
  };
441
- return v._store = {}, Object.defineProperty(v._store, "validated", {
434
+ return S._store = {}, Object.defineProperty(S._store, "validated", {
442
435
  configurable: !1,
443
436
  enumerable: !1,
444
437
  writable: !0,
445
438
  value: !1
446
- }), Object.defineProperty(v, "_self", {
439
+ }), Object.defineProperty(S, "_self", {
447
440
  configurable: !1,
448
441
  enumerable: !1,
449
442
  writable: !1,
450
- value: f
451
- }), Object.defineProperty(v, "_source", {
443
+ value: b
444
+ }), Object.defineProperty(S, "_source", {
452
445
  configurable: !1,
453
446
  enumerable: !1,
454
447
  writable: !1,
455
- value: b
456
- }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
448
+ value: k
449
+ }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
457
450
  };
458
- function dt(t, o, c, f, b) {
451
+ function xt(i, d, f, b, k) {
459
452
  {
460
- var x, m = {}, v = null, A = null;
461
- c !== void 0 && (Pe(c), v = "" + c), ut(o) && (Pe(o.key), v = "" + o.key), ot(o) && (A = o.ref, ct(o, b));
462
- for (x in o)
463
- ae.call(o, x) && !it.hasOwnProperty(x) && (m[x] = o[x]);
464
- if (t && t.defaultProps) {
465
- var S = t.defaultProps;
466
- for (x in S)
467
- m[x] === void 0 && (m[x] = S[x]);
453
+ var w, T = {}, S = null, N = null;
454
+ f !== void 0 && (He(f), S = "" + f), ft(d) && (He(d.key), S = "" + d.key), pt(d) && (N = d.ref, mt(d, k));
455
+ for (w in d)
456
+ me.call(d, w) && !gt.hasOwnProperty(w) && (T[w] = d[w]);
457
+ if (i && i.defaultProps) {
458
+ var O = i.defaultProps;
459
+ for (w in O)
460
+ T[w] === void 0 && (T[w] = O[w]);
468
461
  }
469
- if (v || A) {
470
- var k = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
471
- v && lt(m, k), A && ht(m, k);
462
+ if (S || N) {
463
+ var A = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
464
+ S && vt(T, A), N && yt(T, A);
472
465
  }
473
- return gt(t, v, A, b, f, G.current, m);
466
+ return bt(i, S, N, k, b, ne.current, T);
474
467
  }
475
468
  }
476
- var ge = R.ReactCurrentOwner, Fe = R.ReactDebugCurrentFrame;
477
- function N(t) {
478
- if (t) {
479
- var o = t._owner, c = re(t.type, t._source, o ? o.type : null);
480
- Fe.setExtraStackFrame(c);
469
+ var Te = P.ReactCurrentOwner, Ue = P.ReactDebugCurrentFrame;
470
+ function ee(i) {
471
+ if (i) {
472
+ var d = i._owner, f = fe(i.type, i._source, d ? d.type : null);
473
+ Ue.setExtraStackFrame(f);
481
474
  } else
482
- Fe.setExtraStackFrame(null);
475
+ Ue.setExtraStackFrame(null);
483
476
  }
484
- var de;
485
- de = !1;
486
- function fe(t) {
487
- return typeof t == "object" && t !== null && t.$$typeof === e;
477
+ var Le;
478
+ Le = !1;
479
+ function Re(i) {
480
+ return typeof i == "object" && i !== null && i.$$typeof === e;
488
481
  }
489
- function De() {
482
+ function Qe() {
490
483
  {
491
- if (ge.current) {
492
- var t = V(ge.current.type);
493
- if (t)
484
+ if (Te.current) {
485
+ var i = Q(Te.current.type);
486
+ if (i)
494
487
  return `
495
488
 
496
- Check the render method of \`` + t + "`.";
489
+ Check the render method of \`` + i + "`.";
497
490
  }
498
491
  return "";
499
492
  }
500
493
  }
501
- function ft(t) {
494
+ function Ct(i) {
502
495
  {
503
- if (t !== void 0) {
504
- var o = t.fileName.replace(/^.*[\\\/]/, ""), c = t.lineNumber;
496
+ if (i !== void 0) {
497
+ var d = i.fileName.replace(/^.*[\\\/]/, ""), f = i.lineNumber;
505
498
  return `
506
499
 
507
- Check your code at ` + o + ":" + c + ".";
500
+ Check your code at ` + d + ":" + f + ".";
508
501
  }
509
502
  return "";
510
503
  }
511
504
  }
512
- var Be = {};
513
- function pt(t) {
505
+ var Ke = {};
506
+ function St(i) {
514
507
  {
515
- var o = De();
516
- if (!o) {
517
- var c = typeof t == "string" ? t : t.displayName || t.name;
518
- c && (o = `
508
+ var d = Qe();
509
+ if (!d) {
510
+ var f = typeof i == "string" ? i : i.displayName || i.name;
511
+ f && (d = `
519
512
 
520
- Check the top-level render call using <` + c + ">.");
513
+ Check the top-level render call using <` + f + ">.");
521
514
  }
522
- return o;
515
+ return d;
523
516
  }
524
517
  }
525
- function Ue(t, o) {
518
+ function ze(i, d) {
526
519
  {
527
- if (!t._store || t._store.validated || t.key != null)
520
+ if (!i._store || i._store.validated || i.key != null)
528
521
  return;
529
- t._store.validated = !0;
530
- var c = pt(o);
531
- if (Be[c])
522
+ i._store.validated = !0;
523
+ var f = St(d);
524
+ if (Ke[f])
532
525
  return;
533
- Be[c] = !0;
534
- var f = "";
535
- t && t._owner && t._owner !== ge.current && (f = " It was passed a child from " + V(t._owner.type) + "."), N(t), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, f), N(null);
526
+ Ke[f] = !0;
527
+ var b = "";
528
+ i && i._owner && i._owner !== Te.current && (b = " It was passed a child from " + Q(i._owner.type) + "."), ee(i), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, b), ee(null);
536
529
  }
537
530
  }
538
- function He(t, o) {
531
+ function Je(i, d) {
539
532
  {
540
- if (typeof t != "object")
533
+ if (typeof i != "object")
541
534
  return;
542
- if (le(t))
543
- for (var c = 0; c < t.length; c++) {
544
- var f = t[c];
545
- fe(f) && Ue(f, o);
535
+ if (Ce(i))
536
+ for (var f = 0; f < i.length; f++) {
537
+ var b = i[f];
538
+ Re(b) && ze(b, d);
546
539
  }
547
- else if (fe(t))
548
- t._store && (t._store.validated = !0);
549
- else if (t) {
550
- var b = O(t);
551
- if (typeof b == "function" && b !== t.entries)
552
- for (var x = b.call(t), m; !(m = x.next()).done; )
553
- fe(m.value) && Ue(m.value, o);
540
+ else if (Re(i))
541
+ i._store && (i._store.validated = !0);
542
+ else if (i) {
543
+ var k = x(i);
544
+ if (typeof k == "function" && k !== i.entries)
545
+ for (var w = k.call(i), T; !(T = w.next()).done; )
546
+ Re(T.value) && ze(T.value, d);
554
547
  }
555
548
  }
556
549
  }
557
- function vt(t) {
550
+ function Tt(i) {
558
551
  {
559
- var o = t.type;
560
- if (o == null || typeof o == "string")
552
+ var d = i.type;
553
+ if (d == null || typeof d == "string")
561
554
  return;
562
- var c;
563
- if (typeof o == "function")
564
- c = o.propTypes;
565
- else if (typeof o == "object" && (o.$$typeof === h || // Note: Memo only checks outer props here.
555
+ var f;
556
+ if (typeof d == "function")
557
+ f = d.propTypes;
558
+ else if (typeof d == "object" && (d.$$typeof === h || // Note: Memo only checks outer props here.
566
559
  // Inner props are checked in the reconciler.
567
- o.$$typeof === I))
568
- c = o.propTypes;
560
+ d.$$typeof === m))
561
+ f = d.propTypes;
569
562
  else
570
563
  return;
571
- if (c) {
572
- var f = V(o);
573
- st(c, t.props, "prop", f, t);
574
- } else if (o.PropTypes !== void 0 && !de) {
575
- de = !0;
576
- var b = V(o);
577
- y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
564
+ if (f) {
565
+ var b = Q(d);
566
+ ot(f, i.props, "prop", b, i);
567
+ } else if (d.PropTypes !== void 0 && !Le) {
568
+ Le = !0;
569
+ var k = Q(d);
570
+ C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
578
571
  }
579
- typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
572
+ typeof d.getDefaultProps == "function" && !d.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
580
573
  }
581
574
  }
582
- function mt(t) {
575
+ function Lt(i) {
583
576
  {
584
- for (var o = Object.keys(t.props), c = 0; c < o.length; c++) {
585
- var f = o[c];
586
- if (f !== "children" && f !== "key") {
587
- N(t), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), N(null);
577
+ for (var d = Object.keys(i.props), f = 0; f < d.length; f++) {
578
+ var b = d[f];
579
+ if (b !== "children" && b !== "key") {
580
+ ee(i), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", b), ee(null);
588
581
  break;
589
582
  }
590
583
  }
591
- t.ref !== null && (N(t), y("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
584
+ i.ref !== null && (ee(i), C("Invalid attribute `ref` supplied to `React.Fragment`."), ee(null));
592
585
  }
593
586
  }
594
- function Ne(t, o, c, f, b, x) {
587
+ function Ye(i, d, f, b, k, w) {
595
588
  {
596
- var m = Ge(t);
597
- if (!m) {
598
- var v = "";
599
- (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
600
- var A = ft(b);
601
- A ? v += A : v += De();
602
- var S;
603
- t === null ? S = "null" : le(t) ? S = "array" : t !== void 0 && t.$$typeof === e ? (S = "<" + (V(t.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : S = typeof t, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, v);
589
+ var T = J(i);
590
+ if (!T) {
591
+ var S = "";
592
+ (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (S += " 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 N = Ct(k);
594
+ N ? S += N : S += Qe();
595
+ var O;
596
+ i === null ? O = "null" : Ce(i) ? O = "array" : i !== void 0 && i.$$typeof === e ? (O = "<" + (Q(i.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : O = typeof i, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, S);
604
597
  }
605
- var k = dt(t, o, c, b, x);
606
- if (k == null)
607
- return k;
608
- if (m) {
609
- var _ = o.children;
610
- if (_ !== void 0)
611
- if (f)
612
- if (le(_)) {
613
- for (var W = 0; W < _.length; W++)
614
- He(_[W], t);
615
- Object.freeze && Object.freeze(_);
598
+ var A = xt(i, d, f, k, w);
599
+ if (A == null)
600
+ return A;
601
+ if (T) {
602
+ var H = d.children;
603
+ if (H !== void 0)
604
+ if (b)
605
+ if (Ce(H)) {
606
+ for (var te = 0; te < H.length; te++)
607
+ Je(H[te], i);
608
+ Object.freeze && Object.freeze(H);
616
609
  } else
617
- y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
610
+ C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
618
611
  else
619
- He(_, t);
612
+ Je(H, i);
620
613
  }
621
- return t === n ? mt(k) : vt(k), k;
614
+ return i === s ? Lt(A) : Tt(A), A;
622
615
  }
623
616
  }
624
- function bt(t, o, c) {
625
- return Ne(t, o, c, !0);
617
+ function Rt(i, d, f) {
618
+ return Ye(i, d, f, !0);
626
619
  }
627
- function yt(t, o, c) {
628
- return Ne(t, o, c, !1);
620
+ function kt(i, d, f) {
621
+ return Ye(i, d, f, !1);
629
622
  }
630
- var xt = yt, Ct = bt;
631
- X.Fragment = n, X.jsx = xt, X.jsxs = Ct;
632
- }()), X;
623
+ var Et = kt, It = Rt;
624
+ le.Fragment = s, le.jsx = Et, le.jsxs = It;
625
+ }()), le;
633
626
  }
634
- (function(r) {
635
- process.env.NODE_ENV === "production" ? r.exports = St() : r.exports = Et();
636
- })(Rt);
637
- var kt = Object.defineProperty, Tt = (r, e, s) => e in r ? kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s, g = (r, e, s) => (Tt(r, typeof e != "symbol" ? e + "" : e, s), s);
638
- class Q {
627
+ process.env.NODE_ENV === "production" ? Ee.exports = Pt() : Ee.exports = wt();
628
+ var p = Ee.exports, Ft = Object.defineProperty, jt = (n, e, t) => e in n ? Ft(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, o = (n, e, t) => (jt(n, typeof e != "symbol" ? e + "" : e, t), t), $ = /* @__PURE__ */ ((n) => (n[n.mustache = 0] = "mustache", n[n.vue = 1] = "vue", n[n.react = 2] = "react", n[n.angular = 3] = "angular", n))($ || {});
629
+ class Ot {
639
630
  constructor(e) {
640
- g(this, "value"), g(this, "observers", []), this.value = e, this.observers = [];
631
+ o(this, "dataLayer"), this.dataLayer = e;
632
+ }
633
+ get currentPage() {
634
+ var e;
635
+ return (e = this.dataLayer.searchObject) == null ? void 0 : e.page;
636
+ }
637
+ get totalResults() {
638
+ var e;
639
+ return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.totalResultsValue) || 0;
640
+ }
641
+ get resultsPerPage() {
642
+ var e;
643
+ return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.recordsPerPageValue) || 0;
644
+ }
645
+ get startResultIndex() {
646
+ var e;
647
+ return (((e = this.dataLayer.searchObject) == null ? void 0 : e.page) - 1) * this.resultsPerPage + 1;
648
+ }
649
+ get endResultIndex() {
650
+ var e;
651
+ const t = (((e = this.dataLayer.searchObject) == null ? void 0 : e.page) - 1) * this.resultsPerPage + (this.resultsPerPage ?? 0);
652
+ return t > this.totalResults ? this.totalResults : t;
653
+ }
654
+ get isFirstPage() {
655
+ var e;
656
+ return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === 1;
657
+ }
658
+ get isLastPage() {
659
+ var e;
660
+ return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === Math.ceil(this.totalResults / this.resultsPerPage);
661
+ }
662
+ get results() {
663
+ return this.dataLayer.searchResults ?? [];
664
+ }
665
+ get autoCorrectedQuery() {
666
+ var e;
667
+ return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.autoCorrectedQuery) || "";
668
+ }
669
+ get originalQuery() {
670
+ var e;
671
+ return ((e = this.dataLayer.searchObject) == null ? void 0 : e.query) || "";
672
+ }
673
+ get searchTerm() {
674
+ var e, t;
675
+ return ((e = this.dataLayer.searchResultsMetadata) == null ? void 0 : e.autoCorrectedQuery) || ((t = this.dataLayer.searchObject) == null ? void 0 : t.query) || "";
676
+ }
677
+ get searchExecuted() {
678
+ var e, t, s;
679
+ 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
+ }
681
+ get selectedFacets() {
682
+ var e;
683
+ const t = this.dataLayer.searchFacetsCached ?? this.dataLayer.searchFacets;
684
+ return t ? (((e = this.dataLayer.searchObject) == null ? void 0 : e.facets) ?? []).map((s) => {
685
+ const a = s.name, r = s.value, c = t.find((l) => l.name === a);
686
+ if (c) {
687
+ const l = c.values.find((h) => h.type === "range" ? !1 : h.type === "checkbox" ? '"' + h.value + '"' === r : !1);
688
+ if (l)
689
+ return l;
690
+ }
691
+ return null;
692
+ }).filter((s) => s !== null) : [];
693
+ }
694
+ get relatedSearches() {
695
+ const e = this.dataLayer.searchRelatedSearches ?? [];
696
+ return e[e.length - 1] && (e[e.length - 1].last = !0), e;
697
+ }
698
+ get externalPromotions() {
699
+ return this.dataLayer.searchExternalPromotions ?? [];
700
+ }
701
+ get data() {
702
+ return {
703
+ currentPage: this.currentPage,
704
+ totalResults: this.totalResults,
705
+ resultsPerPage: this.resultsPerPage,
706
+ startResultIndex: this.startResultIndex,
707
+ endResultIndex: this.endResultIndex,
708
+ isFirstPage: this.isFirstPage,
709
+ isLastPage: this.isLastPage,
710
+ results: this.results,
711
+ searchTerm: this.searchTerm !== "undefined" ? this.searchTerm : "",
712
+ autoCorrectedQuery: this.autoCorrectedQuery,
713
+ originalQuery: this.originalQuery,
714
+ selectedFacets: this.selectedFacets,
715
+ searchExecuted: this.searchExecuted,
716
+ relatedSearches: this.relatedSearches,
717
+ hasRelatedSearches: this.relatedSearches.length > 0,
718
+ externalPromotions: this.externalPromotions,
719
+ hasExternalPromotions: this.externalPromotions.length > 0,
720
+ hasResults: this.results.length > 0,
721
+ hasResultsOrExternalPromotions: this.results.length > 0 || this.externalPromotions.length > 0
722
+ };
723
+ }
724
+ get trackingData() {
725
+ var e, t, s, a;
726
+ return {
727
+ searchTerm: this.dataLayer.searchTerm !== "undefined" ? this.dataLayer.searchTerm : "",
728
+ trackApiKey: ((e = this.dataLayer.searchstaxConfig) == null ? void 0 : e.trackApiKey) ?? "",
729
+ session: this.dataLayer.sessionId,
730
+ language: this.dataLayer.language,
731
+ recordsPerPage: ((t = this.dataLayer.searchResultsMetadata) == null ? void 0 : t.recordsPerPageValue) ?? 0,
732
+ totalResults: ((s = this.dataLayer.searchResultsMetadata) == null ? void 0 : s.totalResultsValue) ?? 0,
733
+ currentPage: this.dataLayer.currentPage,
734
+ latencyVal: ((a = this.dataLayer.searchResultsMetadata) == null ? void 0 : a.latency) ?? 0
735
+ };
736
+ }
737
+ }
738
+ class W {
739
+ static deepEqual(e, t) {
740
+ const s = Object.keys(e), a = Object.keys(t);
741
+ if (s.length !== a.length)
742
+ return !1;
743
+ for (const r of s) {
744
+ const c = e[r], l = t[r], h = this.isObject(c) && this.isObject(l);
745
+ if (h && !this.deepEqual(c, l) || !h && c !== l)
746
+ return !1;
747
+ }
748
+ return !0;
749
+ }
750
+ static isObject(e) {
751
+ return e != null && typeof e == "object";
752
+ }
753
+ }
754
+ class M {
755
+ constructor(e) {
756
+ o(this, "value"), o(this, "observers", []), this.value = e, this.observers = [];
641
757
  }
642
758
  subscribe(e) {
643
759
  this.observers.push(e), e(this.value);
644
760
  }
645
761
  unsubscribe(e) {
646
- const s = this.observers.indexOf(e);
647
- s !== -1 && this.observers.splice(s, 1);
762
+ const t = this.observers.indexOf(e);
763
+ t !== -1 && this.observers.splice(t, 1);
648
764
  }
649
765
  setValue(e) {
650
766
  this.value = e, this.notify();
@@ -656,221 +772,506 @@ class Q {
656
772
  this.observers.forEach((e) => e(this.value));
657
773
  }
658
774
  }
659
- class It {
660
- constructor() {
661
- g(this, "searchTermChangeObservable", new Q("")), g(this, "loadingChangeObservable", new Q(!1)), g(this, "searchResultsObservable", new Q(null)), g(this, "searchResultsMetadataObservable", new Q(null)), g(this, "searchAutosuggestObservable", new Q(null)), g(this, "currentPage", 1), g(this, "renderingEngine", "mustache");
775
+ class z {
776
+ static removeXSSRiskyTags(e) {
777
+ var t = "script|style|iframe|object|embed|form|input|button", s = new RegExp("</?(" + t + ")(\\s[^>]*)?>", "gi");
778
+ return e ? e.replace(s, "") : "";
779
+ }
780
+ }
781
+ class Mt {
782
+ constructor(e) {
783
+ o(this, "$searchTermChange", new M("")), o(this, "$loadingChange", new M(!1)), o(this, "$searchResults", new M(null)), o(this, "$searchResultsMetadata", new M(null)), o(this, "$searchAutosuggest", new M(null)), o(this, "$searchFacets", new M(null)), o(this, "$searchFacetsCached", new M(null)), o(this, "$searchstaxConfig", new M(null)), o(this, "$autosuggestResults", new M(null)), o(this, "$searchObject", new M({
784
+ query: "",
785
+ page: 99999999,
786
+ order: "",
787
+ facets: [],
788
+ additionalProps: []
789
+ })), o(this, "$searchRelatedSearches", new M(null)), o(this, "$searchInputConfig", new M(null)), o(this, "$searchExternalPromotions", new M(null)), o(this, "$facetsTemplateData", new M(null)), o(this, "$selectedFacetsTemplateData", new M(null)), o(this, "$paginationData", new M(null)), o(this, "$searchFeedbackData", new M(null)), o(this, "$searchSortingData", new M(null)), o(this, "$searchRelatedSearchesData", new M(null)), o(this, "$searchExternalPromotionsData", new M(null)), o(this, "$language", new M("en")), o(this, "currentPageValue", 1), o(this, "renderingEngineValue", $.mustache), o(this, "parsedData", new Ot(this)), o(this, "sessionId"), o(this, "autoCorrect", !0), o(this, "forceNotCorrect", !1), this.sessionId = e;
662
790
  }
663
791
  setSearchTerm(e) {
664
- this.searchTermChangeObservable.setValue(e);
792
+ this.$searchTermChange.setValue(z.removeXSSRiskyTags(e));
665
793
  }
666
794
  setRenderingEngine(e) {
667
- this.renderingEngine = e;
795
+ this.renderingEngineValue = e;
668
796
  }
669
797
  setCurrentPage(e) {
670
- this.currentPage = e;
798
+ this.currentPageValue = e;
671
799
  }
672
800
  setLoading(e) {
673
- this.loadingChangeObservable.setValue(e);
801
+ this.$loadingChange.setValue(e);
674
802
  }
675
803
  setSearchResults(e) {
676
- this.searchResultsObservable.setValue(e);
804
+ W.deepEqual(e, this.searchResults ?? [""]) || this.$searchResults.setValue(e);
677
805
  }
678
806
  setSearchResultsMetadata(e) {
679
- this.searchResultsMetadataObservable.setValue(e);
807
+ W.deepEqual(e, this.searchResultsMetadata ?? {}) || this.$searchResultsMetadata.setValue(e);
680
808
  }
681
809
  setSearchAutosuggest(e) {
682
- this.searchAutosuggestObservable.setValue(e);
810
+ this.$searchAutosuggest.setValue(e);
811
+ }
812
+ setSearchObject(e) {
813
+ var t, s;
814
+ let a = e;
815
+ (s = (t = this.searchstaxConfig) == null ? void 0 : t.hooks) != null && s.beforeSearch && a && (a = this.searchstaxConfig.hooks.beforeSearch(a)), a && (!W.deepEqual(a, this.searchObject ?? {}) || this.forceNotCorrect) && this.$searchObject.setValue(a);
816
+ }
817
+ setSearchFacets(e) {
818
+ W.deepEqual(e, this.searchFacets ?? []) || this.$searchFacets.setValue(e);
683
819
  }
684
- get searchResultsValue() {
685
- return this.searchResultsObservable.getValue();
820
+ setSearchFacetsCached(e) {
821
+ W.deepEqual(e, this.searchFacetsCached ?? []) || this.$searchFacetsCached.setValue(e);
686
822
  }
687
- get searchTermValue() {
688
- return this.searchTermChangeObservable.getValue();
823
+ setSearchRelatedSearches(e) {
824
+ W.deepEqual(e, this.searchRelatedSearches ?? []) || this.$searchRelatedSearches.setValue(e);
689
825
  }
690
- get loadingValue() {
691
- return this.loadingChangeObservable.getValue();
826
+ setSearchExternalPromotions(e) {
827
+ W.deepEqual(e, this.searchExternalPromotions ?? []) || this.$searchExternalPromotions.setValue(e);
692
828
  }
693
- get searchAutosuggestValue() {
694
- return this.searchAutosuggestObservable.getValue();
829
+ setLanguage(e) {
830
+ this.$language.setValue(e);
695
831
  }
696
- get searchResultsMetadataValue() {
697
- return this.searchResultsMetadataObservable.getValue();
832
+ setSearchstaxConfig(e) {
833
+ this.$searchstaxConfig.setValue(e);
698
834
  }
699
- get currentPageValue() {
700
- return this.currentPage;
835
+ setSearchInputConfig(e) {
836
+ this.$searchInputConfig.setValue(e);
701
837
  }
702
- get renderingEngineValue() {
703
- return this.renderingEngine;
838
+ setAutosuggestResults(e) {
839
+ this.$autosuggestResults.setValue(e);
840
+ }
841
+ setFacetsTemplateData(e) {
842
+ this.$facetsTemplateData.setValue(e);
843
+ }
844
+ setSelectedFacetsTemplateData(e) {
845
+ this.$selectedFacetsTemplateData.setValue(e);
846
+ }
847
+ setPaginationData(e) {
848
+ this.$paginationData.setValue(e);
849
+ }
850
+ setSearchFeedbackData(e) {
851
+ this.$searchFeedbackData.setValue(e);
852
+ }
853
+ setSearchSortingData(e) {
854
+ this.$searchSortingData.setValue(e);
855
+ }
856
+ setRelatedSearchesData(e) {
857
+ this.$searchRelatedSearchesData.setValue(e);
858
+ }
859
+ setExternalPromotionsData(e) {
860
+ this.$searchExternalPromotionsData.setValue(e);
861
+ }
862
+ get searchstaxConfig() {
863
+ return this.$searchstaxConfig.getValue();
864
+ }
865
+ get searchFacets() {
866
+ return this.$searchFacets.getValue() ? JSON.parse(JSON.stringify(this.$searchFacets.getValue())) : null;
867
+ }
868
+ get searchFacetsCached() {
869
+ return this.$searchFacetsCached.getValue() ? JSON.parse(JSON.stringify(this.$searchFacetsCached.getValue())) : null;
870
+ }
871
+ get searchResults() {
872
+ return this.$searchResults.getValue() ? JSON.parse(JSON.stringify(this.$searchResults.getValue())) : null;
873
+ }
874
+ get searchTerm() {
875
+ return this.$searchTermChange.getValue();
876
+ }
877
+ get loading() {
878
+ return this.$loadingChange.getValue();
879
+ }
880
+ get searchAutosuggest() {
881
+ return this.$searchAutosuggest.getValue();
882
+ }
883
+ get searchResultsMetadata() {
884
+ return this.$searchResultsMetadata.getValue() ? JSON.parse(JSON.stringify(this.$searchResultsMetadata.getValue())) : null;
885
+ }
886
+ get currentPage() {
887
+ return this.currentPageValue;
888
+ }
889
+ get renderingEngine() {
890
+ return this.renderingEngineValue;
891
+ }
892
+ get searchObject() {
893
+ return JSON.parse(JSON.stringify(this.$searchObject.getValue()));
894
+ }
895
+ get searchRelatedSearches() {
896
+ return this.$searchRelatedSearches.getValue() ? JSON.parse(JSON.stringify(this.$searchRelatedSearches.getValue())) : null;
897
+ }
898
+ get searchExternalPromotions() {
899
+ return this.$searchExternalPromotions.getValue() ? JSON.parse(JSON.stringify(this.$searchExternalPromotions.getValue())) : null;
900
+ }
901
+ get language() {
902
+ return this.$language.getValue();
903
+ }
904
+ get searchInputConfig() {
905
+ return this.$searchInputConfig.getValue();
906
+ }
907
+ get autosuggestResults() {
908
+ return this.$autosuggestResults.getValue();
909
+ }
910
+ get facetsTemplateData() {
911
+ return this.$facetsTemplateData.getValue();
912
+ }
913
+ get selectedFacetsTemplateData() {
914
+ return this.$selectedFacetsTemplateData.getValue();
915
+ }
916
+ get paginationData() {
917
+ return this.$paginationData.getValue();
918
+ }
919
+ get searchFeedbackData() {
920
+ return this.$searchFeedbackData.getValue();
921
+ }
922
+ get searchSortingData() {
923
+ return this.$searchSortingData.getValue();
924
+ }
925
+ get searchRelatedSearchesData() {
926
+ return this.$searchRelatedSearchesData.getValue();
927
+ }
928
+ get searchExternalPromotionsData() {
929
+ return this.$searchExternalPromotionsData.getValue();
704
930
  }
705
931
  }
706
- class ve {
932
+ class oe {
707
933
  static combineResultsWithMetadata(e) {
708
- const s = [], n = parseInt(e.response.start + "");
709
- return e.response.docs.forEach((a, i) => {
710
- const u = {
934
+ const t = [], s = parseInt(e.response.start + "") - 1, a = parseInt(e.responseHeader.params.rows);
935
+ return e.response.docs.forEach((r, c) => {
936
+ const l = {
711
937
  custom: null,
712
938
  uniqueId: this.getValueByKey(
713
939
  e.responseHeader.params.uniqueId,
714
- a,
940
+ r,
715
941
  e
716
942
  ) ?? "",
717
- position: n + i + 1,
718
- ribbon: this.doesMapExist("ribbon", e) ? this.getValueByKey("ribbon", a, e) : null,
719
- paths: this.doesMapExist("paths", e) ? this.getValueByKey("paths", a, e) : null,
720
- url: this.doesMapExist("url", e) ? this.getValueByKey("url", a, e) : null,
721
- title: this.doesMapExist("title", e) ? this.getValueByKey("title", a, e) : null,
722
- promoted: a["[elevated]"] ? a["[elevated]"] : !1,
723
- thumbnail: this.doesMapExist("thumbnail", e) ? this.getValueByKey("thumbnail", a, e) : null,
724
- date: this.doesMapExist("date", e) ? this.getValueByKey("date", a, e) : null,
725
- snippet: this.doesMapExist("snippet", e) ? this.getValueByKey("snippet", a, e) : null,
726
- description: this.doesMapExist("description", e) ? this.getValueByKey("description", a, e) : null,
727
- unmappedFields: this.getUnmappedFields(a, e),
728
- allFields: this.getAllFields(a, e)
943
+ position: s * a + 1 + c,
944
+ ribbon: this.doesMapExist("ribbon", e) ? this.getValueByKey("ribbon", r, e) : null,
945
+ paths: this.doesMapExist("paths", e) ? this.getValueByKey("paths", r, e) : null,
946
+ url: this.doesMapExist("url", e) ? this.getValueByKey("url", r, e) : null,
947
+ title: this.doesMapExist("title", e) ? this.getValueByKey("title", r, e) : null,
948
+ promoted: r["[elevated]"] ? r["[elevated]"] : !1,
949
+ thumbnail: this.doesMapExist("thumbnail", e) ? this.getValueByKey("thumbnail", r, e) : null,
950
+ date: this.doesMapExist("date", e) ? this.getValueByKey("date", r, e) : null,
951
+ snippet: this.doesMapExist("snippet", e) ? this.getValueByKey("snippet", r, e) : null,
952
+ description: this.doesMapExist("description", e) ? this.getValueByKey("description", r, e) : null,
953
+ unmappedFields: this.getUnmappedFields(r, e),
954
+ allFields: this.getAllFields(r, e)
729
955
  };
730
- s.push(u);
731
- }), s;
956
+ t.push(l);
957
+ }), t;
958
+ }
959
+ static extractFacets(e) {
960
+ const t = [];
961
+ for (const s of e.metadata.facets) {
962
+ let a = { values: [] };
963
+ if (a.name = s.name, a.label = s.label, s.name in e.facet_counts.facet_fields) {
964
+ const r = e.facet_counts.facet_fields[s.name];
965
+ for (let c = 0; c < r.length; c += 2) {
966
+ const l = {};
967
+ l.value = r[c], l.parentName = a.name, l.count = r[c + 1], l.type = "checkbox", a.values.push(l);
968
+ }
969
+ }
970
+ a.values.length > 0 && t.push(a);
971
+ }
972
+ return t;
732
973
  }
733
974
  static extractSearchResultsMetadata(e) {
734
- var s, n, a, i;
735
- let u = "";
736
- return u = ((i = (a = (n = (s = e == null ? void 0 : e.spellcheck) == null ? void 0 : s.suggestions) == null ? void 0 : n[0]) == null ? void 0 : a.suggestion) == null ? void 0 : i[0]) ?? "", typeof u != "string" && (u = (u == null ? void 0 : u.word) ?? ""), {
975
+ var t, s, a, r;
976
+ let c = "";
977
+ 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) ?? ""), {
737
978
  recordsPerPageValue: parseInt(e.responseHeader.params.rows),
738
979
  startDocVal: parseInt(e.response.start + ""),
739
980
  totalResultsValue: parseInt(e.response.numFound + ""),
740
981
  latency: parseInt(e.responseHeader.QTime + ""),
741
982
  endDocValue: parseInt(e.responseHeader.params.rows) + parseInt(e.response.start + ""),
742
- spellingSuggestion: u
983
+ spellingSuggestion: c,
984
+ autoCorrectedQuery: e.responseHeader.params.autoCorrectedQ ?? "",
985
+ impressions: this.getImpressions(e)
743
986
  };
744
987
  }
745
- static findResultByUniqueId(e, s) {
746
- return s.find((n) => n.uniqueId === e) ?? null;
988
+ static getImpressions(e) {
989
+ const t = [], s = this.combineResultsWithMetadata(e);
990
+ for (const a in s) {
991
+ const r = s[a], c = {};
992
+ c.cDocId = this.getDataForAnalytics(r.uniqueId), r.title && (c.cDocTitle = this.getDataForAnalytics(r.title)), c.position = r.position, t.push(c);
993
+ }
994
+ return t;
995
+ }
996
+ static getDataForAnalytics(e) {
997
+ return e !== null ? typeof e > "u" ? "" : typeof e == "string" ? e : typeof e.join < "u" ? e[0] : e : "";
998
+ }
999
+ static findResultByUniqueId(e, t) {
1000
+ return t.find((s) => s.uniqueId === e) ?? null;
747
1001
  }
748
- static getUnmappedFields(e, s) {
749
- const n = s.metadata.results.filter((i) => i.result_card === "").map((i) => i.name), a = [];
750
- for (const i of Object.keys(e))
751
- if (n.indexOf(i) !== -1) {
752
- const u = Array.isArray(e[i]) ? e[i].join(", ") : e[i];
1002
+ static getUnmappedFields(e, t) {
1003
+ const s = t.metadata.results.filter((r) => r.result_card === "").map((r) => r.name), a = [];
1004
+ for (const r of Object.keys(e))
1005
+ if (s.indexOf(r) !== -1) {
1006
+ const c = Array.isArray(e[r]) ? e[r].join(", ") : e[r];
753
1007
  a.push({
754
- key: i,
755
- value: u,
756
- isImage: this.checkIfImage(e[i])
1008
+ key: r,
1009
+ value: c,
1010
+ isImage: this.checkIfImage(e[r])
757
1011
  });
758
1012
  }
759
1013
  return a;
760
1014
  }
761
1015
  static checkIfImage(e) {
762
- return e === void 0 || typeof e != "string" ? !1 : /\.(gif|jpe?g|tiff?|png|webp|bmp)$/i.test(e);
763
- }
764
- static getAllFields(e, s) {
765
- const n = s.metadata.results.map((i) => i.name), a = [];
766
- for (const i of Object.keys(e))
767
- n.indexOf(i) !== -1 && a.push({
768
- key: i,
769
- value: e[i],
770
- isImage: this.checkIfImage(e[i])
1016
+ 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
+ }
1018
+ static getAllFields(e, t) {
1019
+ const s = t.metadata.results.map((r) => r.name), a = [];
1020
+ for (const r of Object.keys(e))
1021
+ s.indexOf(r) !== -1 && a.push({
1022
+ key: r,
1023
+ value: e[r],
1024
+ isImage: this.checkIfImage(e[r])
771
1025
  });
772
1026
  return a;
773
1027
  }
774
- static doesMapExist(e, s) {
775
- return s.metadata.results.find((n) => n.result_card === e) !== void 0;
1028
+ static doesMapExist(e, t) {
1029
+ return t.metadata.results.find((s) => s.result_card === e) !== void 0;
776
1030
  }
777
- static getValueByKey(e, s, n) {
778
- const a = n.metadata.results.find(
779
- (u) => u.result_card === e
1031
+ static getValueByKey(e, t, s) {
1032
+ const a = s.metadata.results.find(
1033
+ (c) => c.result_card === e
780
1034
  );
781
1035
  if (a === void 0)
782
1036
  return null;
783
- const i = s[a.name];
784
- return i === void 0 ? null : typeof i == "string" ? i : Array.isArray(i) ? i.join(", ") : null;
1037
+ const r = t[a.name];
1038
+ return r === void 0 ? null : typeof r == "string" ? r : Array.isArray(r) ? r.join(", ") : null;
1039
+ }
1040
+ }
1041
+ class et {
1042
+ constructor(e) {
1043
+ o(this, "routeName", "searchstax"), o(this, "ignoredKeys", []), o(this, "queryStringHelper"), o(this, "titleParser"), e.routeName && (this.routeName = e.routeName), e.ignoredKeys && (this.ignoredKeys = e.ignoredKeys), e.title && (this.titleParser = e.title), this.queryStringHelper = new At(this.routeName);
1044
+ }
1045
+ updateUrl(e) {
1046
+ const t = this.searchObjectToUrl(e);
1047
+ let s = document.title;
1048
+ this.titleParser && (s = this.titleParser(e)), document.title = s, window.location.href !== t && window.history.pushState({}, s, t);
1049
+ }
1050
+ searchObjectToUrl(e) {
1051
+ 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
+ }
1053
+ searchObjectToParams(e) {
1054
+ const t = {}, s = e.page || 1;
1055
+ if (e.query && (t[this.routeName + "[query]"] = encodeURIComponent(e.query)), t[this.routeName + "[page]"] = s + "", e.order && (t[this.routeName + "[order]"] = e.order), e.facets)
1056
+ for (const a in e.facets) {
1057
+ const r = e.facets[a].type + ":" + encodeURIComponent(e.facets[a].name) + ":" + encodeURIComponent(e.facets[a].value);
1058
+ t[this.routeName + `[facets][${a}]`] = r;
1059
+ }
1060
+ if (this.queryStringHelper.urlHasQueryParams(window.location.href)) {
1061
+ const a = this.queryStringHelper.urlToParams(window.location.href);
1062
+ for (const r in a)
1063
+ r.startsWith(this.routeName) && delete a[r];
1064
+ return { ...a, ...t };
1065
+ } else
1066
+ return t;
1067
+ }
1068
+ extractParamsThatDoNotStartWithRouteName(e) {
1069
+ const t = {};
1070
+ for (const s in e)
1071
+ s.startsWith(this.routeName) || (t[s] = e[s]);
1072
+ return t;
1073
+ }
1074
+ extractArrayOfFacetsFromQueryParameters(e) {
1075
+ var t, s, a;
1076
+ const r = [];
1077
+ for (const c in e)
1078
+ if (c.startsWith(this.routeName + "[facets]")) {
1079
+ const l = z.removeXSSRiskyTags((t = e[c].split(":")) == null ? void 0 : t[0]), h = z.removeXSSRiskyTags(decodeURIComponent((s = e[c].split(":")) == null ? void 0 : s[1])), u = z.removeXSSRiskyTags(decodeURIComponent((a = e[c].split(":")) == null ? void 0 : a[2]));
1080
+ r.push({ type: l, name: h, value: u });
1081
+ }
1082
+ return r;
1083
+ }
1084
+ urlToSearchObject(e) {
1085
+ const t = this.queryStringHelper.urlToParams(e), s = z.removeXSSRiskyTags(decodeURIComponent(t[this.routeName + "[page]"])), a = parseInt(s), r = isNaN(a) ? 1 : a;
1086
+ return {
1087
+ query: z.removeXSSRiskyTags(decodeURIComponent(t[this.routeName + "[query]"])) || "",
1088
+ page: r,
1089
+ order: z.removeXSSRiskyTags(t[this.routeName + "[order]"]) || "",
1090
+ facets: this.extractArrayOfFacetsFromQueryParameters(t) || []
1091
+ };
785
1092
  }
786
1093
  }
787
1094
  class At {
788
- constructor(e, s) {
789
- g(this, "url", ""), g(this, "relatedSearches", ""), g(this, "suggester", ""), g(this, "authHeader"), g(this, "authHeaderRelated"), g(this, "language", "en"), g(this, "trackApiKey", ""), g(this, "session", ""), g(this, "searchAuthType"), g(this, "controllerSearch"), g(this, "signalSearch"), g(this, "controllerSuggest"), g(this, "signalSuggest"), g(this, "dataLayer"), this.dataLayer = s, this.url = e.searchURL, this.language = e.language, this.suggester = e.suggesterURL, this.trackApiKey = e.trackApiKey, this.session = e.sessionId, this.searchAuthType = e.authType, this.authHeader = new Headers(), this.authHeader.append("Accept", "application/json");
790
- const n = this.searchAuthType === "token" ? `Token ${e.searchAuth}` : `Basic ${e.searchAuth}`;
791
- this.authHeader.append("Authorization", n), this.authHeaderRelated = new Headers(), this.authHeaderRelated.append("Accept", "application/json"), this.authHeaderRelated.append("Authorization", e.searchAuth);
792
- }
793
- search(e, s, n) {
794
- this.dataLayer.setSearchTerm(e), this.dataLayer.setLoading(!0), this.controllerSearch && this.controllerSearch.abort(), this.controllerSearch = new AbortController(), this.signalSearch = this.controllerSearch.signal;
795
- const a = new Proxy(
796
- new URLSearchParams(window.location.search),
1095
+ constructor(e) {
1096
+ o(this, "routeName", ""), o(this, "stringify", (t, s) => {
1097
+ const a = this.filterOutIgnoredKeys(t, s.ignoredKeys);
1098
+ return Object.keys(a).map((r) => {
1099
+ const c = a[r];
1100
+ return Array.isArray(c) ? c.map((l) => `${r}=${l}`).join("&") : `${r}=${c}`;
1101
+ }).join("&");
1102
+ }), this.routeName = e;
1103
+ }
1104
+ filterOutIgnoredKeys(e, t) {
1105
+ const s = t || [], a = {};
1106
+ return Object.keys(e).forEach((r) => {
1107
+ s.includes(r) || e[r] !== "" && (a[r] = e[r]);
1108
+ }), a;
1109
+ }
1110
+ urlToParams(e) {
1111
+ const t = {}, s = e.split("?")[1];
1112
+ return s && s.split("&").forEach((a) => {
1113
+ const [r, c] = a.split("=");
1114
+ t[r] = c;
1115
+ }), t;
1116
+ }
1117
+ doesParamContainRouteName(e) {
1118
+ return e.indexOf(this.routeName) !== -1;
1119
+ }
1120
+ urlHasQueryParams(e) {
1121
+ return e.indexOf("?") !== -1;
1122
+ }
1123
+ }
1124
+ class Dt {
1125
+ constructor(e, t) {
1126
+ o(this, "cachedQuery", ""), o(this, "url", ""), o(this, "relatedSearches", ""), o(this, "suggester", ""), o(this, "authHeader"), o(this, "authHeaderRelated"), o(this, "trackApiKey", ""), o(this, "session", ""), o(this, "searchAuthType"), o(this, "searchAuth", ""), o(this, "controllerSearch"), o(this, "signalSearch"), o(this, "controllerSuggest"), o(this, "signalSuggest"), o(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");
1127
+ const s = this.searchAuthType === "token" ? `Token ${e.searchAuth}` : `Basic ${e.searchAuth}`;
1128
+ this.authHeader.append("Authorization", s), this.authHeaderRelated = new Headers(), this.authHeaderRelated.append("Accept", "application/json"), this.authHeaderRelated.append("Authorization", e.searchAuth);
1129
+ }
1130
+ generateFacetQuery(e, t) {
1131
+ let s = [];
1132
+ if (!t)
1133
+ e.forEach(function(a) {
1134
+ const r = a.name + ':"' + a.value + '"';
1135
+ s = s.concat("fq=" + decodeURIComponent(r).replace(" ", " "));
1136
+ });
1137
+ else {
1138
+ const a = {};
1139
+ e.forEach(function(r) {
1140
+ const c = r.name + ":" + r.value, l = decodeURIComponent(c).replace(" ", " ").split(":");
1141
+ a[l[0]] ? a[l[0]].push(l[1]) : a[l[0]] = [l[1]];
1142
+ });
1143
+ for (const r in a)
1144
+ if (Object.prototype.hasOwnProperty.call(a, r)) {
1145
+ const c = a[r], l = r;
1146
+ let h = "";
1147
+ for (const u of c)
1148
+ h += ` ${l}:"${u}"`;
1149
+ s = s.concat("fq=" + h.trim());
1150
+ }
1151
+ }
1152
+ return s.length ? "&" + s.join("&") : "";
1153
+ }
1154
+ getRelatedSearches(e, t, s, a) {
1155
+ const r = new Headers();
1156
+ r.append("Accept", "application/json"), r.append("Authorization", s), fetch(
1157
+ t + "?search=" + encodeURIComponent(e.query) + "&language=" + this.dataLayer.language,
797
1158
  {
798
- get: (l, h) => l.get(h) ?? ""
1159
+ method: "GET",
1160
+ headers: r,
1161
+ credentials: "same-origin"
799
1162
  }
800
- ), i = a.languageVariant ? (
801
- //@ts-expect-error - this is a hack to get around the fact that the urlQueryParams is a proxy
802
- "&fq=_language:" + a.languageVariant
803
- ) : "", u = this.url + "?q=" + encodeURIComponent(e.trim()) + this.toQueryString(n) + "&language=" + this.language + i;
804
- fetch(u, {
805
- method: "GET",
806
- headers: this.authHeader,
807
- credentials: "same-origin",
808
- signal: this.signalSearch
809
- }).then((l) => l.json()).then((l) => {
810
- this.dataLayer.setLoading(!1), s(l);
811
- }).catch((l) => {
812
- this.dataLayer.setLoading(!1), console.log(l);
1163
+ ).then((c) => c.json()).then((c) => {
1164
+ a(c);
813
1165
  });
814
1166
  }
815
- suggest(e, s, n) {
1167
+ cacheFacets() {
1168
+ this.dataLayer.searchObject.query !== this.cachedQuery && (this.cachedQuery = this.dataLayer.searchObject.query, this.search(
1169
+ {
1170
+ query: this.dataLayer.searchObject.query ?? "*",
1171
+ page: 1,
1172
+ order: "",
1173
+ facets: [],
1174
+ additionalProps: this.dataLayer.searchObject.additionalProps
1175
+ },
1176
+ this.cacheFacetsCallback.bind(this)
1177
+ ));
1178
+ }
1179
+ cacheFacetsCallback(e) {
1180
+ let t = oe.extractFacets(e);
1181
+ this.dataLayer.setSearchFacetsCached(t);
1182
+ }
1183
+ search(e, t, s = !1, a = !1) {
1184
+ if (e.query && e.query !== "undefined") {
1185
+ this.dataLayer.setSearchTerm(e.query), this.dataLayer.setLoading(!0), this.controllerSearch && this.controllerSearch.abort(), this.controllerSearch = new AbortController(), this.signalSearch = this.controllerSearch.signal;
1186
+ const r = new Proxy(new URLSearchParams(window.location.search), {
1187
+ get: (g, m) => g.get(m) ?? ""
1188
+ }), c = r.languageVariant ? (
1189
+ //@ts-expect-error - this is a hack to get around the fact that the urlQueryParams is a proxy
1190
+ "&fq=_language:" + r.languageVariant
1191
+ ) : "", l = e.order ? `&sort=${e.order}` : "", h = this.url + "?q=" + encodeURIComponent(e.query.trim()) + "&start=" + (e.page - 1) + this.toQueryString(e.additionalProps ?? []) + this.generateFacetQuery(
1192
+ e.facets.filter((g) => g.type === "or" || g.type === "showUnavailable"),
1193
+ !0
1194
+ ) + this.generateFacetQuery(
1195
+ e.facets.filter((g) => g.type === "and" || g.type === "tabs"),
1196
+ !1
1197
+ ) + l + `&spellcheck.correct=${this.dataLayer.autoCorrect && !a}&language=` + this.dataLayer.language + c, u = {
1198
+ method: "GET",
1199
+ headers: this.authHeader,
1200
+ credentials: "same-origin",
1201
+ signal: this.signalSearch
1202
+ };
1203
+ s && delete u.signal, fetch(h, u).then((g) => g.json()).then((g) => {
1204
+ this.dataLayer.setLoading(!1), t(g);
1205
+ }).catch(() => {
1206
+ this.dataLayer.setLoading(!1);
1207
+ });
1208
+ }
1209
+ }
1210
+ suggest(e, t, s) {
816
1211
  this.controllerSuggest && this.controllerSuggest.abort(), this.controllerSuggest = new AbortController(), this.signalSuggest = this.controllerSuggest.signal;
817
- const a = this.suggester + "?q=" + e.trim() + this.toQueryString(n) + "&language=" + this.language;
1212
+ const a = this.suggester + "?q=" + e.trim() + this.toQueryString(s) + "&language=" + this.dataLayer.language;
818
1213
  fetch(a, {
819
1214
  method: "GET",
820
1215
  headers: this.authHeader,
821
1216
  credentials: "same-origin",
822
1217
  signal: this.signalSuggest
823
- }).then((i) => i.json()).then((i) => {
824
- s(i);
825
- }).catch((i) => console.log(i));
1218
+ }).then((r) => r.json()).then((r) => {
1219
+ t(r);
1220
+ }).catch(() => () => {
1221
+ });
826
1222
  }
827
1223
  fields() {
828
1224
  return this.fields;
829
1225
  }
830
1226
  toQueryString(e) {
831
- return "&" + e.join("&");
1227
+ if (e.length === 0)
1228
+ return "";
1229
+ const t = [];
1230
+ for (const s of e)
1231
+ t.push(encodeURIComponent(s.key) + "=" + encodeURIComponent(s.value));
1232
+ return "&" + t.join("&");
832
1233
  }
833
1234
  }
834
- class wt {
1235
+ class $t {
835
1236
  static getOrSetCookie(e) {
836
- let s = this.getCookie(e);
837
- return s == null && (s = this.makeid(25), this.setCookie(e, s, {
1237
+ let t = this.getCookie(e);
1238
+ return t == null && (t = this.makeid(25), this.setCookie(e, t, {
838
1239
  secure: !0,
839
1240
  "max-age": 3600
840
- })), s;
1241
+ })), t;
841
1242
  }
842
1243
  static makeid(e) {
843
- let s = "";
844
- const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", a = n.length;
845
- for (let i = 0; i < e; i++)
846
- s += n.charAt(Math.floor(Math.random() * a));
847
- return s;
1244
+ let t = "";
1245
+ const s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", a = s.length;
1246
+ for (let r = 0; r < e; r++)
1247
+ t += s.charAt(Math.floor(Math.random() * a));
1248
+ return t;
848
1249
  }
849
1250
  static getCookie(e) {
850
- const s = document.cookie.match(
1251
+ const t = document.cookie.match(
851
1252
  new RegExp(
852
1253
  "(?:^|; )" + e.replace(/([.$?*|{}()[\]\\/+^])/g, "\\$1") + "=([^;]*)"
853
1254
  )
854
1255
  );
855
- return s ? decodeURIComponent(s[1]) : void 0;
856
- }
857
- static setCookie(e, s, n) {
858
- const a = { path: "/", ...n };
859
- n.expires instanceof Date && (a.expires = n.expires.toUTCString());
860
- let i = encodeURIComponent(e) + "=" + encodeURIComponent(s);
861
- for (const u in a) {
862
- i += "; " + u;
863
- const l = a[u];
864
- l !== !0 && (i += "=" + l);
1256
+ return t ? decodeURIComponent(t[1]) : void 0;
1257
+ }
1258
+ static setCookie(e, t, s) {
1259
+ const a = { path: "/", ...s };
1260
+ s.expires instanceof Date && (a.expires = s.expires.toUTCString());
1261
+ let r = encodeURIComponent(e) + "=" + encodeURIComponent(t);
1262
+ for (const c in a) {
1263
+ r += "; " + c;
1264
+ const l = a[c];
1265
+ l !== !0 && (r += "=" + l);
865
1266
  }
866
- document.cookie = i;
1267
+ document.cookie = r;
867
1268
  }
868
1269
  }
869
- class Lt {
1270
+ class he {
870
1271
  static trackClick(e) {
871
- const s = {
1272
+ const t = {
872
1273
  key: e.trackApiKey,
873
- query: e.searchTermValue,
1274
+ query: e.searchTerm,
874
1275
  shownHits: e.recordsPerPage,
875
1276
  totalHits: e.totalResults,
876
1277
  pageNo: e.currentPage,
@@ -881,40 +1282,89 @@ class Lt {
881
1282
  position: e.result.position,
882
1283
  language: e.language
883
1284
  };
884
- _msq.push(["trackClick", s]);
1285
+ setTimeout(() => {
1286
+ this.msq.push(["trackClick", t]);
1287
+ }, 0);
1288
+ }
1289
+ static trackSearch(e) {
1290
+ const t = {
1291
+ key: e.trackApiKey,
1292
+ query: e.searchTerm,
1293
+ shownHits: e.recordsPerPage,
1294
+ totalHits: e.totalResults,
1295
+ pageNo: e.currentPage,
1296
+ latency: e.latencyVal,
1297
+ session: e.session,
1298
+ language: e.language,
1299
+ impressions: e.impressions
1300
+ };
1301
+ setTimeout(() => {
1302
+ this.msq.push(["track", t]);
1303
+ }, 0);
1304
+ }
1305
+ static trackRelatedSearchClick(e) {
1306
+ const t = {
1307
+ session: e.session,
1308
+ key: e.trackApiKey,
1309
+ query: e.relatedSearch.search_term,
1310
+ position: e.relatedSearch.position,
1311
+ relatedSearch: e.relatedSearch.related_search,
1312
+ pageNo: e.currentPage,
1313
+ shownHits: e.recordsPerPage,
1314
+ totalHits: e.totalResults,
1315
+ language: e.language
1316
+ };
1317
+ setTimeout(() => {
1318
+ this.msq.push(["trackRelatedSearchClick", t]);
1319
+ }, 0);
1320
+ }
1321
+ static trackRelatedSearches(e) {
1322
+ const t = {
1323
+ session: e.session,
1324
+ key: e.trackApiKey,
1325
+ query: e.searchTerm,
1326
+ shownHits: e.recordsPerPage,
1327
+ latency: e.latencyVal,
1328
+ language: e.language,
1329
+ impressions: e.impressions
1330
+ };
1331
+ setTimeout(() => {
1332
+ this.msq.push(["trackRelatedSearch", t]);
1333
+ }, 0);
885
1334
  }
886
1335
  }
1336
+ o(he, "msq", window._msq || []);
887
1337
  /*!
888
1338
  * mustache.js - Logic-less {{mustache}} templates with JavaScript
889
1339
  * http://github.com/janl/mustache.js
890
1340
  */
891
- var _t = Object.prototype.toString, $ = Array.isArray || function(r) {
892
- return _t.call(r) === "[object Array]";
1341
+ var qt = Object.prototype.toString, re = Array.isArray || function(n) {
1342
+ return qt.call(n) === "[object Array]";
893
1343
  };
894
- function ye(r) {
895
- return typeof r == "function";
1344
+ function Ie(n) {
1345
+ return typeof n == "function";
896
1346
  }
897
- function jt(r) {
898
- return $(r) ? "array" : typeof r;
1347
+ function _t(n) {
1348
+ return re(n) ? "array" : typeof n;
899
1349
  }
900
- function me(r) {
901
- return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
1350
+ function ke(n) {
1351
+ return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
902
1352
  }
903
- function Ke(r, e) {
904
- return r != null && typeof r == "object" && e in r;
1353
+ function tt(n, e) {
1354
+ return n != null && typeof n == "object" && e in n;
905
1355
  }
906
- function Ot(r, e) {
907
- return r != null && typeof r != "object" && r.hasOwnProperty && r.hasOwnProperty(e);
1356
+ function Nt(n, e) {
1357
+ return n != null && typeof n != "object" && n.hasOwnProperty && n.hasOwnProperty(e);
908
1358
  }
909
- var Pt = RegExp.prototype.test;
910
- function Vt(r, e) {
911
- return Pt.call(r, e);
1359
+ var Vt = RegExp.prototype.test;
1360
+ function Ht(n, e) {
1361
+ return Vt.call(n, e);
912
1362
  }
913
- var Mt = /\S/;
914
- function Ft(r) {
915
- return !Vt(Mt, r);
1363
+ var Bt = /\S/;
1364
+ function Wt(n) {
1365
+ return !Ht(Bt, n);
916
1366
  }
917
- var Dt = {
1367
+ var Ut = {
918
1368
  "&": "&amp;",
919
1369
  "<": "&lt;",
920
1370
  ">": "&gt;",
@@ -924,222 +1374,222 @@ var Dt = {
924
1374
  "`": "&#x60;",
925
1375
  "=": "&#x3D;"
926
1376
  };
927
- function Bt(r) {
928
- return String(r).replace(/[&<>"'`=\/]/g, function(e) {
929
- return Dt[e];
1377
+ function Qt(n) {
1378
+ return String(n).replace(/[&<>"'`=\/]/g, function(e) {
1379
+ return Ut[e];
930
1380
  });
931
1381
  }
932
- var Ut = /\s*/, Ht = /\s+/, Ye = /\s*=/, Nt = /\s*\}/, Wt = /#|\^|\/|>|\{|&|=|!/;
933
- function qt(r, e) {
934
- if (!r)
1382
+ var Kt = /\s*/, zt = /\s+/, at = /\s*=/, Jt = /\s*\}/, Yt = /#|\^|\/|>|\{|&|=|!/;
1383
+ function Xt(n, e) {
1384
+ if (!n)
935
1385
  return [];
936
- var s = !1, n = [], a = [], i = [], u = !1, l = !1, h = "", p = 0;
937
- function C() {
938
- if (u && !l)
939
- for (; i.length; )
940
- delete a[i.pop()];
1386
+ var t = !1, s = [], a = [], r = [], c = !1, l = !1, h = "", u = 0;
1387
+ function g() {
1388
+ if (c && !l)
1389
+ for (; r.length; )
1390
+ delete a[r.pop()];
941
1391
  else
942
- i = [];
943
- u = !1, l = !1;
944
- }
945
- var I, L, D;
946
- function K(j) {
947
- if (typeof j == "string" && (j = j.split(Ht, 2)), !$(j) || j.length !== 2)
948
- throw new Error("Invalid tags: " + j);
949
- I = new RegExp(me(j[0]) + "\\s*"), L = new RegExp("\\s*" + me(j[1])), D = new RegExp("\\s*" + me("}" + j[1]));
950
- }
951
- K(e || T.tags);
952
- for (var E = new ee(r), O, R, y, B, H, P; !E.eos(); ) {
953
- if (O = E.pos, y = E.scanUntil(I), y)
954
- for (var Y = 0, ie = y.length; Y < ie; ++Y)
955
- B = y.charAt(Y), Ft(B) ? (i.push(a.length), h += B) : (l = !0, s = !0, h += " "), a.push(["text", B, O, O + 1]), O += 1, B === `
956
- ` && (C(), h = "", p = 0, s = !1);
957
- if (!E.scan(I))
1392
+ r = [];
1393
+ c = !1, l = !1;
1394
+ }
1395
+ var m, y, R;
1396
+ function F(_) {
1397
+ if (typeof _ == "string" && (_ = _.split(zt, 2)), !re(_) || _.length !== 2)
1398
+ throw new Error("Invalid tags: " + _);
1399
+ m = new RegExp(ke(_[0]) + "\\s*"), y = new RegExp("\\s*" + ke(_[1])), R = new RegExp("\\s*" + ke("}" + _[1]));
1400
+ }
1401
+ F(e || E.tags);
1402
+ for (var L = new de(n), x, P, C, D, q, j; !L.eos(); ) {
1403
+ if (x = L.pos, C = L.scanUntil(m), C)
1404
+ for (var U = 0, G = C.length; U < G; ++U)
1405
+ D = C.charAt(U), Wt(D) ? (r.push(a.length), h += D) : (l = !0, t = !0, h += " "), a.push(["text", D, x, x + 1]), x += 1, D === `
1406
+ ` && (g(), h = "", u = 0, t = !1);
1407
+ if (!L.scan(m))
958
1408
  break;
959
- if (u = !0, R = E.scan(Wt) || "name", E.scan(Ut), R === "=" ? (y = E.scanUntil(Ye), E.scan(Ye), E.scanUntil(L)) : R === "{" ? (y = E.scanUntil(D), E.scan(Nt), E.scanUntil(L), R = "&") : y = E.scanUntil(L), !E.scan(L))
960
- throw new Error("Unclosed tag at " + E.pos);
961
- if (R == ">" ? H = [R, y, O, E.pos, h, p, s] : H = [R, y, O, E.pos], p++, a.push(H), R === "#" || R === "^")
962
- n.push(H);
963
- else if (R === "/") {
964
- if (P = n.pop(), !P)
965
- throw new Error('Unopened section "' + y + '" at ' + O);
966
- if (P[1] !== y)
967
- throw new Error('Unclosed section "' + P[1] + '" at ' + O);
1409
+ if (c = !0, P = L.scan(Yt) || "name", L.scan(Kt), P === "=" ? (C = L.scanUntil(at), L.scan(at), L.scanUntil(y)) : P === "{" ? (C = L.scanUntil(R), L.scan(Jt), L.scanUntil(y), P = "&") : C = L.scanUntil(y), !L.scan(y))
1410
+ throw new Error("Unclosed tag at " + L.pos);
1411
+ if (P == ">" ? q = [P, C, x, L.pos, h, u, t] : q = [P, C, x, L.pos], u++, a.push(q), P === "#" || P === "^")
1412
+ s.push(q);
1413
+ else if (P === "/") {
1414
+ if (j = s.pop(), !j)
1415
+ throw new Error('Unopened section "' + C + '" at ' + x);
1416
+ if (j[1] !== C)
1417
+ throw new Error('Unclosed section "' + j[1] + '" at ' + x);
968
1418
  } else
969
- R === "name" || R === "{" || R === "&" ? l = !0 : R === "=" && K(y);
1419
+ P === "name" || P === "{" || P === "&" ? l = !0 : P === "=" && F(C);
970
1420
  }
971
- if (C(), P = n.pop(), P)
972
- throw new Error('Unclosed section "' + P[1] + '" at ' + E.pos);
973
- return Kt($t(a));
1421
+ if (g(), j = s.pop(), j)
1422
+ throw new Error('Unclosed section "' + j[1] + '" at ' + L.pos);
1423
+ return Zt(Gt(a));
974
1424
  }
975
- function $t(r) {
976
- for (var e = [], s, n, a = 0, i = r.length; a < i; ++a)
977
- s = r[a], s && (s[0] === "text" && n && n[0] === "text" ? (n[1] += s[1], n[3] = s[3]) : (e.push(s), n = s));
1425
+ function Gt(n) {
1426
+ for (var e = [], t, s, a = 0, r = n.length; a < r; ++a)
1427
+ t = n[a], t && (t[0] === "text" && s && s[0] === "text" ? (s[1] += t[1], s[3] = t[3]) : (e.push(t), s = t));
978
1428
  return e;
979
1429
  }
980
- function Kt(r) {
981
- for (var e = [], s = e, n = [], a, i, u = 0, l = r.length; u < l; ++u)
982
- switch (a = r[u], a[0]) {
1430
+ function Zt(n) {
1431
+ for (var e = [], t = e, s = [], a, r, c = 0, l = n.length; c < l; ++c)
1432
+ switch (a = n[c], a[0]) {
983
1433
  case "#":
984
1434
  case "^":
985
- s.push(a), n.push(a), s = a[4] = [];
1435
+ t.push(a), s.push(a), t = a[4] = [];
986
1436
  break;
987
1437
  case "/":
988
- i = n.pop(), i[5] = a[2], s = n.length > 0 ? n[n.length - 1][4] : e;
1438
+ r = s.pop(), r[5] = a[2], t = s.length > 0 ? s[s.length - 1][4] : e;
989
1439
  break;
990
1440
  default:
991
- s.push(a);
1441
+ t.push(a);
992
1442
  }
993
1443
  return e;
994
1444
  }
995
- function ee(r) {
996
- this.string = r, this.tail = r, this.pos = 0;
1445
+ function de(n) {
1446
+ this.string = n, this.tail = n, this.pos = 0;
997
1447
  }
998
- ee.prototype.eos = function() {
1448
+ de.prototype.eos = function() {
999
1449
  return this.tail === "";
1000
1450
  };
1001
- ee.prototype.scan = function(r) {
1002
- var e = this.tail.match(r);
1451
+ de.prototype.scan = function(n) {
1452
+ var e = this.tail.match(n);
1003
1453
  if (!e || e.index !== 0)
1004
1454
  return "";
1005
- var s = e[0];
1006
- return this.tail = this.tail.substring(s.length), this.pos += s.length, s;
1455
+ var t = e[0];
1456
+ return this.tail = this.tail.substring(t.length), this.pos += t.length, t;
1007
1457
  };
1008
- ee.prototype.scanUntil = function(r) {
1009
- var e = this.tail.search(r), s;
1458
+ de.prototype.scanUntil = function(n) {
1459
+ var e = this.tail.search(n), t;
1010
1460
  switch (e) {
1011
1461
  case -1:
1012
- s = this.tail, this.tail = "";
1462
+ t = this.tail, this.tail = "";
1013
1463
  break;
1014
1464
  case 0:
1015
- s = "";
1465
+ t = "";
1016
1466
  break;
1017
1467
  default:
1018
- s = this.tail.substring(0, e), this.tail = this.tail.substring(e);
1468
+ t = this.tail.substring(0, e), this.tail = this.tail.substring(e);
1019
1469
  }
1020
- return this.pos += s.length, s;
1470
+ return this.pos += t.length, t;
1021
1471
  };
1022
- function q(r, e) {
1023
- this.view = r, this.cache = { ".": this.view }, this.parent = e;
1472
+ function ae(n, e) {
1473
+ this.view = n, this.cache = { ".": this.view }, this.parent = e;
1024
1474
  }
1025
- q.prototype.push = function(r) {
1026
- return new q(r, this);
1475
+ ae.prototype.push = function(n) {
1476
+ return new ae(n, this);
1027
1477
  };
1028
- q.prototype.lookup = function(r) {
1029
- var e = this.cache, s;
1030
- if (e.hasOwnProperty(r))
1031
- s = e[r];
1478
+ ae.prototype.lookup = function(n) {
1479
+ var e = this.cache, t;
1480
+ if (e.hasOwnProperty(n))
1481
+ t = e[n];
1032
1482
  else {
1033
- for (var n = this, a, i, u, l = !1; n; ) {
1034
- if (r.indexOf(".") > 0)
1035
- for (a = n.view, i = r.split("."), u = 0; a != null && u < i.length; )
1036
- u === i.length - 1 && (l = Ke(a, i[u]) || Ot(a, i[u])), a = a[i[u++]];
1483
+ for (var s = this, a, r, c, l = !1; s; ) {
1484
+ if (n.indexOf(".") > 0)
1485
+ for (a = s.view, r = n.split("."), c = 0; a != null && c < r.length; )
1486
+ c === r.length - 1 && (l = tt(a, r[c]) || Nt(a, r[c])), a = a[r[c++]];
1037
1487
  else
1038
- a = n.view[r], l = Ke(n.view, r);
1488
+ a = s.view[n], l = tt(s.view, n);
1039
1489
  if (l) {
1040
- s = a;
1490
+ t = a;
1041
1491
  break;
1042
1492
  }
1043
- n = n.parent;
1493
+ s = s.parent;
1044
1494
  }
1045
- e[r] = s;
1495
+ e[n] = t;
1046
1496
  }
1047
- return ye(s) && (s = s.call(this.view)), s;
1497
+ return Ie(t) && (t = t.call(this.view)), t;
1048
1498
  };
1049
- function w() {
1499
+ function V() {
1050
1500
  this.templateCache = {
1051
1501
  _cache: {},
1052
- set: function(r, e) {
1053
- this._cache[r] = e;
1502
+ set: function(n, e) {
1503
+ this._cache[n] = e;
1054
1504
  },
1055
- get: function(r) {
1056
- return this._cache[r];
1505
+ get: function(n) {
1506
+ return this._cache[n];
1057
1507
  },
1058
1508
  clear: function() {
1059
1509
  this._cache = {};
1060
1510
  }
1061
1511
  };
1062
1512
  }
1063
- w.prototype.clearCache = function() {
1513
+ V.prototype.clearCache = function() {
1064
1514
  typeof this.templateCache < "u" && this.templateCache.clear();
1065
1515
  };
1066
- w.prototype.parse = function(r, e) {
1067
- var s = this.templateCache, n = r + ":" + (e || T.tags).join(":"), a = typeof s < "u", i = a ? s.get(n) : void 0;
1068
- return i == null && (i = qt(r, e), a && s.set(n, i)), i;
1516
+ V.prototype.parse = function(n, e) {
1517
+ var t = this.templateCache, s = n + ":" + (e || E.tags).join(":"), a = typeof t < "u", r = a ? t.get(s) : void 0;
1518
+ return r == null && (r = Xt(n, e), a && t.set(s, r)), r;
1069
1519
  };
1070
- w.prototype.render = function(r, e, s, n) {
1071
- var a = this.getConfigTags(n), i = this.parse(r, a), u = e instanceof q ? e : new q(e, void 0);
1072
- return this.renderTokens(i, u, s, r, n);
1520
+ V.prototype.render = function(n, e, t, s) {
1521
+ var a = this.getConfigTags(s), r = this.parse(n, a), c = e instanceof ae ? e : new ae(e, void 0);
1522
+ return this.renderTokens(r, c, t, n, s);
1073
1523
  };
1074
- w.prototype.renderTokens = function(r, e, s, n, a) {
1075
- for (var i = "", u, l, h, p = 0, C = r.length; p < C; ++p)
1076
- h = void 0, u = r[p], l = u[0], l === "#" ? h = this.renderSection(u, e, s, n, a) : l === "^" ? h = this.renderInverted(u, e, s, n, a) : l === ">" ? h = this.renderPartial(u, e, s, a) : l === "&" ? h = this.unescapedValue(u, e) : l === "name" ? h = this.escapedValue(u, e, a) : l === "text" && (h = this.rawValue(u)), h !== void 0 && (i += h);
1077
- return i;
1524
+ V.prototype.renderTokens = function(n, e, t, s, a) {
1525
+ for (var r = "", c, l, h, u = 0, g = n.length; u < g; ++u)
1526
+ h = void 0, c = n[u], l = c[0], l === "#" ? h = this.renderSection(c, e, t, s, a) : l === "^" ? h = this.renderInverted(c, e, t, s, a) : l === ">" ? h = this.renderPartial(c, e, t, a) : l === "&" ? h = this.unescapedValue(c, e) : l === "name" ? h = this.escapedValue(c, e, a) : l === "text" && (h = this.rawValue(c)), h !== void 0 && (r += h);
1527
+ return r;
1078
1528
  };
1079
- w.prototype.renderSection = function(r, e, s, n, a) {
1080
- var i = this, u = "", l = e.lookup(r[1]);
1081
- function h(I) {
1082
- return i.render(I, e, s, a);
1529
+ V.prototype.renderSection = function(n, e, t, s, a) {
1530
+ var r = this, c = "", l = e.lookup(n[1]);
1531
+ function h(m) {
1532
+ return r.render(m, e, t, a);
1083
1533
  }
1084
1534
  if (l) {
1085
- if ($(l))
1086
- for (var p = 0, C = l.length; p < C; ++p)
1087
- u += this.renderTokens(r[4], e.push(l[p]), s, n, a);
1535
+ if (re(l))
1536
+ for (var u = 0, g = l.length; u < g; ++u)
1537
+ c += this.renderTokens(n[4], e.push(l[u]), t, s, a);
1088
1538
  else if (typeof l == "object" || typeof l == "string" || typeof l == "number")
1089
- u += this.renderTokens(r[4], e.push(l), s, n, a);
1090
- else if (ye(l)) {
1091
- if (typeof n != "string")
1539
+ c += this.renderTokens(n[4], e.push(l), t, s, a);
1540
+ else if (Ie(l)) {
1541
+ if (typeof s != "string")
1092
1542
  throw new Error("Cannot use higher-order sections without the original template");
1093
- l = l.call(e.view, n.slice(r[3], r[5]), h), l != null && (u += l);
1543
+ l = l.call(e.view, s.slice(n[3], n[5]), h), l != null && (c += l);
1094
1544
  } else
1095
- u += this.renderTokens(r[4], e, s, n, a);
1096
- return u;
1545
+ c += this.renderTokens(n[4], e, t, s, a);
1546
+ return c;
1097
1547
  }
1098
1548
  };
1099
- w.prototype.renderInverted = function(r, e, s, n, a) {
1100
- var i = e.lookup(r[1]);
1101
- if (!i || $(i) && i.length === 0)
1102
- return this.renderTokens(r[4], e, s, n, a);
1549
+ V.prototype.renderInverted = function(n, e, t, s, a) {
1550
+ var r = e.lookup(n[1]);
1551
+ if (!r || re(r) && r.length === 0)
1552
+ return this.renderTokens(n[4], e, t, s, a);
1103
1553
  };
1104
- w.prototype.indentPartial = function(r, e, s) {
1105
- for (var n = e.replace(/[^ \t]/g, ""), a = r.split(`
1106
- `), i = 0; i < a.length; i++)
1107
- a[i].length && (i > 0 || !s) && (a[i] = n + a[i]);
1554
+ V.prototype.indentPartial = function(n, e, t) {
1555
+ for (var s = e.replace(/[^ \t]/g, ""), a = n.split(`
1556
+ `), r = 0; r < a.length; r++)
1557
+ a[r].length && (r > 0 || !t) && (a[r] = s + a[r]);
1108
1558
  return a.join(`
1109
1559
  `);
1110
1560
  };
1111
- w.prototype.renderPartial = function(r, e, s, n) {
1112
- if (s) {
1113
- var a = this.getConfigTags(n), i = ye(s) ? s(r[1]) : s[r[1]];
1114
- if (i != null) {
1115
- var u = r[6], l = r[5], h = r[4], p = i;
1116
- l == 0 && h && (p = this.indentPartial(i, h, u));
1117
- var C = this.parse(p, a);
1118
- return this.renderTokens(C, e, s, p, n);
1561
+ V.prototype.renderPartial = function(n, e, t, s) {
1562
+ if (t) {
1563
+ var a = this.getConfigTags(s), r = Ie(t) ? t(n[1]) : t[n[1]];
1564
+ if (r != null) {
1565
+ var c = n[6], l = n[5], h = n[4], u = r;
1566
+ l == 0 && h && (u = this.indentPartial(r, h, c));
1567
+ var g = this.parse(u, a);
1568
+ return this.renderTokens(g, e, t, u, s);
1119
1569
  }
1120
1570
  }
1121
1571
  };
1122
- w.prototype.unescapedValue = function(r, e) {
1123
- var s = e.lookup(r[1]);
1124
- if (s != null)
1125
- return s;
1572
+ V.prototype.unescapedValue = function(n, e) {
1573
+ var t = e.lookup(n[1]);
1574
+ if (t != null)
1575
+ return t;
1126
1576
  };
1127
- w.prototype.escapedValue = function(r, e, s) {
1128
- var n = this.getConfigEscape(s) || T.escape, a = e.lookup(r[1]);
1577
+ V.prototype.escapedValue = function(n, e, t) {
1578
+ var s = this.getConfigEscape(t) || E.escape, a = e.lookup(n[1]);
1129
1579
  if (a != null)
1130
- return typeof a == "number" && n === T.escape ? String(a) : n(a);
1580
+ return typeof a == "number" && s === E.escape ? String(a) : s(a);
1131
1581
  };
1132
- w.prototype.rawValue = function(r) {
1133
- return r[1];
1582
+ V.prototype.rawValue = function(n) {
1583
+ return n[1];
1134
1584
  };
1135
- w.prototype.getConfigTags = function(r) {
1136
- return $(r) ? r : r && typeof r == "object" ? r.tags : void 0;
1585
+ V.prototype.getConfigTags = function(n) {
1586
+ return re(n) ? n : n && typeof n == "object" ? n.tags : void 0;
1137
1587
  };
1138
- w.prototype.getConfigEscape = function(r) {
1139
- if (r && typeof r == "object" && !$(r))
1140
- return r.escape;
1588
+ V.prototype.getConfigEscape = function(n) {
1589
+ if (n && typeof n == "object" && !re(n))
1590
+ return n.escape;
1141
1591
  };
1142
- var T = {
1592
+ var E = {
1143
1593
  name: "mustache.js",
1144
1594
  version: "4.2.0",
1145
1595
  tags: ["{{", "}}"],
@@ -1155,92 +1605,881 @@ var T = {
1155
1605
  * object with set, get and clear methods. This can also be used to disable
1156
1606
  * the cache by setting it to the literal `undefined`.
1157
1607
  */
1158
- set templateCache(r) {
1159
- Z.templateCache = r;
1608
+ set templateCache(n) {
1609
+ ue.templateCache = n;
1160
1610
  },
1161
1611
  /**
1162
1612
  * Gets the default or overridden caching object from the default writer.
1163
1613
  */
1164
1614
  get templateCache() {
1165
- return Z.templateCache;
1615
+ return ue.templateCache;
1166
1616
  }
1167
- }, Z = new w();
1168
- T.clearCache = function() {
1169
- return Z.clearCache();
1617
+ }, ue = new V();
1618
+ E.clearCache = function() {
1619
+ return ue.clearCache();
1170
1620
  };
1171
- T.parse = function(r, e) {
1172
- return Z.parse(r, e);
1621
+ E.parse = function(n, e) {
1622
+ return ue.parse(n, e);
1173
1623
  };
1174
- T.render = function(r, e, s, n) {
1175
- if (typeof r != "string")
1176
- throw new TypeError('Invalid template! Template should be a "string" but "' + jt(r) + '" was given as the first argument for mustache#render(template, view, partials)');
1177
- return Z.render(r, e, s, n);
1624
+ E.render = function(n, e, t, s) {
1625
+ if (typeof n != "string")
1626
+ throw new TypeError('Invalid template! Template should be a "string" but "' + _t(n) + '" was given as the first argument for mustache#render(template, view, partials)');
1627
+ return ue.render(n, e, t, s);
1178
1628
  };
1179
- T.escape = Bt;
1180
- T.Scanner = ee;
1181
- T.Context = q;
1182
- T.Writer = w;
1183
- class Yt {
1629
+ E.escape = Qt;
1630
+ E.Scanner = de;
1631
+ E.Context = ae;
1632
+ E.Writer = V;
1633
+ const ea = {
1634
+ mainTemplate: {
1635
+ template: `
1636
+ {{#hasExternalPromotions}}
1637
+ <div class="searchstax-external-promotions-container" id="searchstax-external-promotions-container">
1638
+ External promotions go here
1639
+ </div>
1640
+ {{/hasExternalPromotions}}
1641
+ `,
1642
+ externalPromotionsContainerId: "searchstax-external-promotions-container"
1643
+ },
1644
+ externalPromotion: {
1645
+ template: `
1646
+ <div class="searchstax-external-promotion searchstax-search-result">
1647
+ <div class="icon-elevated"></div>
1648
+ {{#url}}
1649
+ <a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" class="searchstax-result-item-link"></a>
1650
+ {{/url}}
1651
+ <div class="searchstax-search-result-title-container">
1652
+ <span class="searchstax-search-result-title">{{name}}</span>
1653
+ </div>
1654
+ {{#description}}
1655
+ <p class="searchstax-search-result-description searchstax-search-result-common">
1656
+ {{description}}
1657
+ </p>
1658
+ {{/description}}
1659
+ {{#url}}
1660
+ <p class="searchstax-search-result-description searchstax-search-result-common">
1661
+ {{url}}
1662
+ </p>
1663
+ {{/url}}
1664
+ </div>
1665
+ `
1666
+ }
1667
+ }, ta = {
1668
+ mainTemplateDesktop: {
1669
+ template: `
1670
+ {{#hasResultsOrExternalPromotions}}
1671
+ <div class="searchstax-facets-container-desktop"></div>
1672
+ {{/hasResultsOrExternalPromotions}}
1673
+ `,
1674
+ facetsContainerClass: "searchstax-facets-container-desktop",
1675
+ selectedFacetsContainerClass: "searchstax-facets-pills-selected"
1676
+ },
1677
+ mainTemplateMobile: {
1678
+ template: `
1679
+ <div class="searchstax-facets-pills-container">
1680
+ <div class="searchstax-facets-pills-selected">
1681
+ </div>
1682
+ </div>
1683
+
1684
+ <div class="searchstax-facets-mobile-overlay {{#overlayOpened}} searchstax-show{{/overlayOpened}}" >
1685
+ <div class="searchstax-facets-mobile-overlay-header">
1686
+ <div class="searchstax-facets-mobile-overlay-header-title">Filter By</div>
1687
+ <div class="searchstax-search-close"></div>
1688
+ </div>
1689
+ <div class="searchstax-facets-container-mobile"></div>
1690
+ <button class="searchstax-facets-mobile-overlay-done">Done</button>
1691
+ </div>
1692
+ `,
1693
+ facetsContainerClass: "searchstax-facets-container-mobile",
1694
+ closeOverlayTriggerClasses: [
1695
+ "searchstax-facets-mobile-overlay-done",
1696
+ "searchstax-search-close"
1697
+ ],
1698
+ filterByContainerClass: "searchstax-facets-pills-container",
1699
+ selectedFacetsContainerClass: "searchstax-facets-pills-selected"
1700
+ },
1701
+ showMoreButtonContainerTemplate: {
1702
+ template: `
1703
+ <div class="searchstax-facet-show-more-container">
1704
+ {{#showingAllFacets}}
1705
+ <div class="searchstax-facet-show-less-button searchstax-facet-show-button">less</div>
1706
+ {{/showingAllFacets}}
1707
+ {{^showingAllFacets}}
1708
+ <div class="searchstax-facet-show-more-button searchstax-facet-show-button">more {{onShowMoreLessClick}}</div>
1709
+ {{/showingAllFacets}}
1710
+ </div>
1711
+ `,
1712
+ showMoreButtonClass: "searchstax-facet-show-more-container"
1713
+ },
1714
+ facetItemContainerTemplate: {
1715
+ template: `
1716
+ <div>
1717
+ <div class="searchstax-facet-title-container">
1718
+ <div class="searchstax-facet-title">
1719
+ {{label}}
1720
+ </div>
1721
+ <div class="searchstax-facet-title-arrow active"></div>
1722
+ </div>
1723
+ <div class="searchstax-facet-values-container"></div>
1724
+ </div>
1725
+ `,
1726
+ facetListTitleContainerClass: "searchstax-facet-title-container",
1727
+ facetListContainerClass: "searchstax-facet-values-container"
1728
+ },
1729
+ clearFacetsTemplate: {
1730
+ template: `
1731
+ {{#shouldShow}}}
1732
+ <div class="searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all">
1733
+ <div class="searchstax-facets-pill-label">Clear Filters</div>
1734
+ </div>
1735
+ {{/shouldShow}}
1736
+ `,
1737
+ containerClass: "searchstax-facets-pill-clear-all"
1738
+ },
1739
+ facetItemTemplate: {
1740
+ template: `
1741
+ <div class="searchstax-facet-input">
1742
+ <input type="checkbox" class="searchstax-facet-input-checkbox" {{#disabled}}disabled{{/disabled}} {{#isChecked}}checked{{/isChecked}}/>
1743
+ </div>
1744
+ <div class="searchstax-facet-value-label">{{value}}</div>
1745
+ <div class="searchstax-facet-value-count">({{count}})</div>
1746
+ `,
1747
+ inputCheckboxClass: "searchstax-facet-input-checkbox",
1748
+ checkTriggerClasses: [
1749
+ "searchstax-facet-value-label",
1750
+ "searchstax-facet-value-count"
1751
+ ]
1752
+ },
1753
+ filterByTemplate: {
1754
+ template: `
1755
+ <div class="searchstax-facets-pill searchstax-facets-pill-filter-by">
1756
+ <div class="searchstax-facets-pill-label">Filter By</div>
1757
+ </div>
1758
+ `,
1759
+ containerClass: "searchstax-facets-pill-filter-by"
1760
+ },
1761
+ selectedFacetsTemplate: {
1762
+ template: `
1763
+ <div class="searchstax-facets-pill searchstax-facets-pill-facets">
1764
+ <div class="searchstax-facets-pill-label">{{value}} ({{count}})</div>
1765
+ <div class="searchstax-facets-pill-icon-close"></div>
1766
+ </div>
1767
+ `,
1768
+ containerClass: "searchstax-facets-pill-facets"
1769
+ }
1770
+ }, aa = {
1771
+ mainTemplate: {
1772
+ template: `
1773
+ {{#results.length}}
1774
+ <div class="searchstax-pagination-container">
1775
+ <div class="searchstax-pagination-content">
1776
+ <a class="searchstax-pagination-previous {{#isFirstPage}}disabled{{/isFirstPage}}" id="searchstax-pagination-previous">< Previous</a>
1777
+ <div class="searchstax-pagination-details">
1778
+ {{startResultIndex}} - {{endResultIndex}} of {{totalResults}}
1779
+ </div>
1780
+ <a class="searchstax-pagination-next {{#isLastPage}}disabled{{/isLastPage}}" id="searchstax-pagination-next">Next ></a>
1781
+ </div>
1782
+ </div>
1783
+ {{/results.length}}
1784
+ `,
1785
+ nextButtonClass: "searchstax-pagination-next",
1786
+ previousButtonClass: "searchstax-pagination-previous"
1787
+ }
1788
+ }, sa = {
1789
+ main: {
1790
+ template: `
1791
+ {{#hasRelatedSearches}}
1792
+ <div class="searchstax-related-searches-container" id="searchstax-related-searches-container">
1793
+ Related searches: <span id="searchstax-related-searches"></span>
1794
+ {{#relatedSearches}}
1795
+ <span class="searchstax-related-search">
1796
+
1797
+ </span>
1798
+ {{/relatedSearches}}
1799
+ </div>
1800
+ {{/hasRelatedSearches}}
1801
+ `,
1802
+ relatedSearchesContainerClass: "searchstax-related-search"
1803
+ },
1804
+ relatedSearch: {
1805
+ template: `
1806
+ <span class="searchstax-related-search searchstax-related-search-item">
1807
+ {{ related_search }}{{^last}}<span>,</span>{{/last}}
1808
+ </span>
1809
+ `,
1810
+ relatedSearchContainerClass: "searchstax-related-search-item"
1811
+ }
1812
+ }, ra = {
1813
+ main: {
1814
+ template: `
1815
+ {{#searchExecuted}}
1816
+ <div class="searchstax-feedback-container">
1817
+ {{#if totalResults}}
1818
+ Showing <b>{{startResultIndex}} - {{endResultIndex}}</b> of <b>{{totalResults}}</b> results {{#searchTerm}} for "<b>{{searchTerm}}</b>" {{/searchTerm}}
1819
+ <div class="searchstax-feedback-container-suggested">
1820
+ {{#autoCorrectedQuery}}
1821
+ Search instead for <a href="#" class="searchstax-feedback-original-query">{{originalQuery}}</a>
1822
+ {{/autoCorrectedQuery}}
1823
+ </div>
1824
+ {{/if}}
1825
+ </div>
1826
+ {{/searchExecuted}}
1827
+ `,
1828
+ originalQueryClass: "searchstax-feedback-original-query"
1829
+ }
1830
+ }, ia = {
1831
+ mainTemplate: {
1832
+ template: `
1833
+ <div class="searchstax-search-input-container">
1834
+ <div class="searchstax-search-input-wrapper">
1835
+ <input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." />
1836
+ <button class="searchstax-spinner-icon" id="searchstax-search-input-action-button"></button>
1837
+ </div>
1838
+ </div>
1839
+ `,
1840
+ searchInputId: "searchstax-search-input"
1841
+ },
1842
+ autosuggestItemTemplate: {
1843
+ template: `
1844
+ <div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>
1845
+ `
1846
+ }
1847
+ }, na = {
1848
+ mainTemplate: {
1849
+ template: `
1850
+ <div class="searchstax-search-results-container">
1851
+ <div class="searchstax-search-results" id="searchstax-search-results"></div>
1852
+ </div>
1853
+ `,
1854
+ searchResultsContainerId: "searchstax-search-results"
1855
+ },
1856
+ searchResultTemplate: {
1857
+ template: `
1858
+ <div class="searchstax-search-result {{#thumbnail}} has-thumbnail {{/thumbnail}}">
1859
+ {{#promoted}}
1860
+ <div class="searchstax-search-result-promoted"></div>
1861
+ {{/promoted}}
1862
+
1863
+ {{#url}}
1864
+ <a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" class="searchstax-result-item-link"></a>
1865
+ {{/url}}
1866
+
1867
+ {{#ribbon}}
1868
+ <div class="searchstax-search-result-ribbon">
1869
+ {{ribbon}}
1870
+ </div>
1871
+ {{/ribbon}}
1872
+
1873
+ {{#thumbnail}}
1874
+ <img src="{{thumbnail}}" class="searchstax-thumbnail">
1875
+ {{/thumbnail}}
1876
+ <div class="searchstax-search-result-title-container">
1877
+ <span class="searchstax-search-result-title">{{title}}</span>
1878
+ </div>
1879
+
1880
+ {{#paths}}
1881
+ <p class="searchstax-search-result-common">
1882
+ {{paths}}
1883
+ </p>
1884
+ {{/paths}}
1885
+
1886
+ {{#description}}
1887
+ <p class="searchstax-search-result-description searchstax-search-result-common">
1888
+ {{description}}
1889
+ </p>
1890
+ {{/description}}
1891
+
1892
+ {{#unmappedFields}}
1893
+ {{#isImage}}
1894
+ <div class="searchstax-search-result-image-container">
1895
+ <img src="{{value}}" class="searchstax-result-image">
1896
+ </div>
1897
+ {{/isImage}}
1898
+ {{^isImage}}
1899
+ <p class="searchstax-search-result-common">
1900
+ {{value}}
1901
+ </p>
1902
+ {{/isImage}}
1903
+ {{/unmappedFields}}
1904
+ </div>
1905
+ `,
1906
+ searchResultUniqueIdAttribute: "data-searchstax-unique-result-id"
1907
+ },
1908
+ noSearchResultTemplate: {
1909
+ template: `
1910
+ <div class="searchstax-no-results">
1911
+ Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
1912
+ <br>
1913
+ {{#spellingSuggestion}}
1914
+ <span>&nbsp;Did you mean <a href="#" class="searchstax-suggestion-term">{{ spellingSuggestion }}</a>?</span>
1915
+ {{/spellingSuggestion}}
1916
+ </div>
1917
+ <div>
1918
+ <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
+ <p>Lost? Click on the ‘X” in the Search Box to reset your search.</p>
1920
+ </div>
1921
+ `
1922
+ }
1923
+ }, ca = {
1924
+ main: {
1925
+ template: `
1926
+ {{#searchExecuted}}
1927
+ {{#hasResultsOrExternalPromotions}}
1928
+ <div class="searchstax-sorting-container">
1929
+ <label class="searchstax-sorting-label" for="sort-by">Sort By</label>
1930
+ <select id="searchstax-search-order-select" class="searchstax-search-order-select">
1931
+ <option value="">
1932
+ Relevance
1933
+ </option>
1934
+ <option value="date desc">
1935
+ Newest Content
1936
+ </option>
1937
+ <option value="date asc">
1938
+ Oldest Content
1939
+ </option>
1940
+ </select>
1941
+ </div>
1942
+ {{/hasResultsOrExternalPromotions}}
1943
+ {{/searchExecuted}}
1944
+ `,
1945
+ selectId: "searchstax-search-order-select"
1946
+ }
1947
+ };
1948
+ class v {
1949
+ }
1950
+ o(v, "externalPromotions", ea), o(v, "facets", ta), o(v, "pagination", aa), o(v, "relatedSearches", sa), o(v, "searchFeedback", ra), o(v, "searchInput", ia), o(v, "searchResults", na), o(v, "sorting", ca);
1951
+ class la {
1952
+ constructor(e) {
1953
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "externalPromotionsContainerId"), o(this, "searchExternalPromotionsMainContainer", null);
1954
+ var t, s;
1955
+ 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) || v.externalPromotions.mainTemplate.externalPromotionsContainerId, this.searchExternalPromotionsMainContainer = document.getElementById(
1956
+ this.containerId
1957
+ ), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
1958
+ }
1959
+ initializeSubscriptions() {
1960
+ this.dataLayer.$searchExternalPromotions.subscribe((e) => {
1961
+ e && this.renderMainTemplate(this.generateTemplateData());
1962
+ });
1963
+ }
1964
+ generateTemplateData() {
1965
+ const e = {
1966
+ ...this.dataLayer.parsedData.data,
1967
+ externalPromotions: this.dataLayer.parsedData.externalPromotions
1968
+ };
1969
+ return this.dataLayer.setExternalPromotionsData(e), e;
1970
+ }
1971
+ addExternalSearch(e) {
1972
+ var t, s, a, r;
1973
+ const c = document.getElementById(this.externalPromotionsContainerId);
1974
+ if (c) {
1975
+ const l = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.externalPromotion) == null ? void 0 : a.template) || ((r = v.externalPromotions.externalPromotion) == null ? void 0 : r.template), h = document.createElement("div");
1976
+ h.classList.add("searchstax-external-promotion"), h.addEventListener("click", (u) => {
1977
+ this.trackClick(e, u);
1978
+ }), h.innerHTML = E.render(l, e), c.appendChild(h);
1979
+ }
1980
+ }
1981
+ trackClick(e, t) {
1982
+ t.stopPropagation(), t.preventDefault(), window.open(e.url, "_blank");
1983
+ }
1984
+ renderMainTemplate(e) {
1985
+ var t, s, a, r;
1986
+ const c = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.mainTemplate) == null ? void 0 : a.template) || ((r = v.externalPromotions.mainTemplate) == null ? void 0 : r.template);
1987
+ if (this.dataLayer.renderingEngine === $.mustache) {
1988
+ this.searchExternalPromotionsMainContainer.innerHTML = //@ts-expect-error - mustache is not a module
1989
+ E.render(c, e);
1990
+ const l = document.getElementById(
1991
+ this.externalPromotionsContainerId
1992
+ );
1993
+ l && (l.innerHTML = "");
1994
+ for (const h of e.externalPromotions)
1995
+ this.addExternalSearch(h);
1996
+ }
1997
+ }
1998
+ }
1999
+ class oa {
2000
+ constructor(e, t) {
2001
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "routerHelper"), o(this, "cachedPhrase", ""), o(this, "isCached", !1), o(this, "overlayOpened", !1), o(this, "facetPaginationStep"), o(this, "facetPaginationStepMobile"), o(this, "searchFacetsMainContainer", null), o(this, "searchFacetsMobileContainer", null), o(this, "searchFacetsDesktopContainer", null), o(this, "facetLimits", {}), o(this, "facetLimitsMobile", {}), o(this, "deactivatedFacets", {}), o(this, "cachedData", null), o(this, "cacheFacets"), o(this, "onFacetSelect", (s, a, r, c) => {
2002
+ if (s.stopPropagation(), !a.disabled) {
2003
+ const l = r.querySelector("input");
2004
+ l.checked = c ? l.checked : !l.checked;
2005
+ const h = this.dataLayer.searchObject;
2006
+ let u = [...h.facets];
2007
+ const g = this.extractFacetValue(a);
2008
+ l.checked ? u.find((m) => W.deepEqual(m, g) ? m : !1) || (this.config.facetingType === "tabs" && (u = u.filter((m) => m.name !== g.name)), u.push(g)) : u = u.filter((m) => !W.deepEqual(m, g)), setTimeout(() => {
2009
+ this.dataLayer.setSearchObject({ ...h, facets: u, page: 1 }), this.config.facetingType === "tabs" && this.renderMainTemplate(this.generateTemplateData(), !0);
2010
+ }, 0);
2011
+ }
2012
+ }), 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();
2013
+ }
2014
+ get needCache() {
2015
+ return this.config.facetingType === "showUnavailable" || this.config.facetingType === "or" || this.config.facetingType === "tabs";
2016
+ }
2017
+ get needDisabling() {
2018
+ return this.config.facetingType === "showUnavailable";
2019
+ }
2020
+ initializeSubscriptions() {
2021
+ this.needCache && this.dataLayer.$searchFacetsCached.subscribe((e) => {
2022
+ e && this.dataLayer.searchFacets && this.renderMainTemplate(this.generateTemplateData());
2023
+ }), this.dataLayer.$searchResults.subscribe((e) => {
2024
+ e && (this.needCache && !this.isCached && (this.dataLayer.searchFacets && !this.dataLayer.searchFacetsCached && this.dataLayer.setSearchFacetsCached(this.dataLayer.searchFacets), this.cacheFacets()), this.renderMainTemplate(this.generateTemplateData()));
2025
+ }), this.dataLayer.$searchObject.subscribe((e) => {
2026
+ this.cachedPhrase !== e.query ? (this.cachedPhrase = e.query, this.isCached = !1) : this.isCached = !0;
2027
+ });
2028
+ }
2029
+ extractFacetValue(e) {
2030
+ return {
2031
+ type: this.config.facetingType,
2032
+ name: e.parentName,
2033
+ value: e.value
2034
+ };
2035
+ }
2036
+ applyFacetLimits(e, t) {
2037
+ const s = t ? this.facetPaginationStepMobile : this.facetPaginationStep, a = t ? this.facetLimits : this.facetLimitsMobile;
2038
+ return e.forEach((r) => {
2039
+ a[r.name] || (a[r.name] = s);
2040
+ }), e.map((r) => ({
2041
+ ...r,
2042
+ values: r.values.slice(0, a[r.name]),
2043
+ showingAllFacets: r.values.length <= a[r.name],
2044
+ hasMoreFacets: r.values.length > s
2045
+ }));
2046
+ }
2047
+ generateTemplateData(e) {
2048
+ if (this.generateSelectedFacetsData(), this.dataLayer.searchFacets) {
2049
+ let t = this.dataLayer.searchFacets;
2050
+ this.needCache && this.dataLayer.searchFacetsCached && (t = this.dataLayer.searchFacetsCached, this.needDisabling && (t = t.map((a) => {
2051
+ var r;
2052
+ const c = (r = this.dataLayer.searchFacets) == null ? void 0 : r.find((l) => l.name === a.name);
2053
+ return c ? {
2054
+ ...a,
2055
+ values: a.values.map((l) => {
2056
+ const h = c.values.find((u) => l.type === "range" ? !1 : l.type === "checkbox" ? u.value === l.value : !1);
2057
+ return {
2058
+ ...l,
2059
+ disabled: !h,
2060
+ isMobile: e
2061
+ };
2062
+ })
2063
+ } : {
2064
+ ...a,
2065
+ values: a.values.map((l) => ({
2066
+ ...l,
2067
+ disabled: !0
2068
+ })),
2069
+ isMobile: e
2070
+ };
2071
+ }))), this.config.specificFacets && (t = t.filter((a) => {
2072
+ var r;
2073
+ return (r = this.config.specificFacets) == null ? void 0 : r.includes(a.name);
2074
+ }));
2075
+ const s = {
2076
+ facets: this.applyFacetLimits(t, e),
2077
+ ...this.dataLayer.parsedData.data,
2078
+ isMobile: e
2079
+ };
2080
+ return this.dataLayer.setFacetsTemplateData(s), s;
2081
+ } else {
2082
+ const t = { facets: [], ...this.dataLayer.parsedData.data, isMobile: e };
2083
+ return this.dataLayer.setFacetsTemplateData(t), t;
2084
+ }
2085
+ }
2086
+ createFacetItem(e, t, s) {
2087
+ var a, r, c, l, h, u, g, m, y, R, F, L;
2088
+ const x = document.createElement("div");
2089
+ x.classList.add("searchstax-facet-container"), this.deactivatedFacets[e.name] || x.classList.add("active");
2090
+ const P = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.facetItemContainerTemplate) == null ? void 0 : c.template) || ((l = v.facets.facetItemContainerTemplate) == null ? void 0 : l.template);
2091
+ x.innerHTML = E.render(P, e), t.appendChild(x);
2092
+ const C = x.querySelector(
2093
+ "." + (((g = (u = (h = this.config) == null ? void 0 : h.templates) == null ? void 0 : u.facetItemContainerTemplate) == null ? void 0 : g.facetListTitleContainerClass) || ((m = v.facets.facetItemContainerTemplate) == null ? void 0 : m.facetListTitleContainerClass))
2094
+ );
2095
+ C == null || C.addEventListener("click", () => {
2096
+ x.classList.toggle("active");
2097
+ });
2098
+ const D = x.querySelector(
2099
+ "." + (((F = (R = (y = this.config) == null ? void 0 : y.templates) == null ? void 0 : R.facetItemContainerTemplate) == null ? void 0 : F.facetListContainerClass) || ((L = v.facets.facetItemContainerTemplate) == null ? void 0 : L.facetListContainerClass))
2100
+ );
2101
+ D && (e.values.forEach((q) => {
2102
+ this.createFacetListItem(q, D);
2103
+ }), e.hasMoreFacets && this.createHasMoreComponent(e, D, s));
2104
+ }
2105
+ isChecked(e) {
2106
+ var t;
2107
+ return !!((t = this.dataLayer.searchObject.facets) != null && t.find((s) => W.deepEqual(s, this.extractFacetValue(e))));
2108
+ }
2109
+ createFacetListItem(e, t) {
2110
+ var s, a, r, c, l, h, u, g, m, y, R, F, L;
2111
+ const x = document.createElement("div");
2112
+ x.classList.add("searchstax-facet-value-container"), e.disabled && x.classList.add("searchstax-facet-value-disabled");
2113
+ const P = this.isChecked(e), C = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.facetItemTemplate) == null ? void 0 : r.template) || ((c = v.facets.facetItemTemplate) == null ? void 0 : c.template);
2114
+ x.innerHTML = E.render(C, { ...e, isChecked: P });
2115
+ let D = (l = v.facets.facetItemTemplate) == null ? void 0 : l.checkTriggerClasses;
2116
+ D = ((g = (u = (h = this.config) == null ? void 0 : h.templates) == null ? void 0 : u.facetItemTemplate) == null ? void 0 : g.checkTriggerClasses) || D, D.forEach((q) => {
2117
+ var j;
2118
+ (j = x.querySelector("." + q)) == null || j.addEventListener("click", (U) => {
2119
+ this.onFacetSelect(U, e, x);
2120
+ });
2121
+ }), (L = x.querySelector(
2122
+ "." + (((R = (y = (m = this.config) == null ? void 0 : m.templates) == null ? void 0 : y.facetItemTemplate) == null ? void 0 : R.inputCheckboxClass) || ((F = v.facets.facetItemTemplate) == null ? void 0 : F.inputCheckboxClass))
2123
+ )) == null || L.addEventListener("click", (q) => {
2124
+ this.onFacetSelect(q, e, x, !0);
2125
+ }), t.appendChild(x);
2126
+ }
2127
+ createHasMoreComponent(e, t, s) {
2128
+ var a, r, c, l, h, u, g, m;
2129
+ const y = document.createElement("div");
2130
+ y.classList.add("searchstax-facet-show-more-container");
2131
+ const R = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.showMoreButtonContainerTemplate) == null ? void 0 : c.template) || ((l = v.facets.showMoreButtonContainerTemplate) == null ? void 0 : l.template);
2132
+ y.innerHTML = E.render(R, e);
2133
+ const F = y.querySelector(
2134
+ "." + (((g = (u = (h = this.config) == null ? void 0 : h.templates) == null ? void 0 : u.showMoreButtonContainerTemplate) == null ? void 0 : g.showMoreButtonClass) || ((m = v.facets.showMoreButtonContainerTemplate) == null ? void 0 : m.showMoreButtonClass))
2135
+ );
2136
+ F && (this.attachOnclickToShowMore(e, F, s), t && t.appendChild(F));
2137
+ }
2138
+ attachOnclickToShowMore(e, t, s) {
2139
+ t.addEventListener("click", (a) => {
2140
+ this.onShowMoreLessClick(a, e, s);
2141
+ });
2142
+ }
2143
+ onShowMoreLessClick(e, t, s) {
2144
+ e.preventDefault();
2145
+ const a = s ? this.facetPaginationStepMobile : this.facetPaginationStep, r = s ? this.facetLimits : this.facetLimitsMobile;
2146
+ 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.renderMainTemplate(this.generateTemplateData());
2147
+ }
2148
+ renderMainTemplate(e, t) {
2149
+ var s, a, r, c, l, h, u, g, m, y, R;
2150
+ if (e && (!W.deepEqual(this.cachedData ?? {}, e) || t)) {
2151
+ this.cachedData = e;
2152
+ const F = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.mainTemplateDesktop) == null ? void 0 : r.template) || ((c = v.facets.mainTemplateDesktop) == null ? void 0 : c.template);
2153
+ if (this.dataLayer.renderingEngine === $.mustache && this.searchFacetsMainContainer) {
2154
+ this.searchFacetsMainContainer.innerHTML = E.render(F, {
2155
+ ...e
2156
+ });
2157
+ const L = (g = this.searchFacetsMainContainer) == null ? void 0 : g.querySelector(
2158
+ "." + (((u = (h = (l = this.config) == null ? void 0 : l.templates) == null ? void 0 : h.mainTemplateDesktop) == null ? void 0 : u.facetsContainerClass) || v.facets.mainTemplateDesktop.facetsContainerClass)
2159
+ );
2160
+ if (L) {
2161
+ L.innerHTML = "";
2162
+ for (const x of e.facets)
2163
+ this.createFacetItem(x, L);
2164
+ if (this.searchFacetsMainContainer) {
2165
+ const x = this.searchFacetsMainContainer.querySelector(
2166
+ "." + (((R = (y = (m = this.config) == null ? void 0 : m.templates) == null ? void 0 : y.mainTemplateDesktop) == null ? void 0 : R.selectedFacetsContainerClass) || v.facets.mainTemplateDesktop.selectedFacetsContainerClass)
2167
+ );
2168
+ x && (this.createSelectedFacetsComponents(x), this.createClearFacetsComponents(x));
2169
+ }
2170
+ }
2171
+ }
2172
+ this.renderMobileTemplate(this.generateTemplateData(!0));
2173
+ } else
2174
+ this.generateSelectedFacetsData();
2175
+ }
2176
+ generateSelectedFacetsData() {
2177
+ const e = [], t = this.dataLayer.searchObject.facets;
2178
+ for (const s of t) {
2179
+ const a = decodeURIComponent(s.name), r = decodeURIComponent(s.value);
2180
+ if (this.dataLayer.searchFacets) {
2181
+ const c = this.needCache ? this.dataLayer.searchFacetsCached : this.dataLayer.searchFacets, l = c == null ? void 0 : c.find((h) => h.name === a);
2182
+ if (l) {
2183
+ const h = l.values.find((u) => u.type === "range" ? !1 : u.type === "checkbox" ? `"${u.value}"` == `"${r}"` : !1);
2184
+ h && e.push(h);
2185
+ }
2186
+ }
2187
+ }
2188
+ this.dataLayer.setSelectedFacetsTemplateData(e);
2189
+ }
2190
+ createSelectedFacetsComponents(e) {
2191
+ var t;
2192
+ this.generateSelectedFacetsData(), (t = this.dataLayer.selectedFacetsTemplateData) == null || t.forEach((s) => {
2193
+ this.createSelectedFacetsComponent(e, s);
2194
+ });
2195
+ }
2196
+ createClearFacetsComponents(e) {
2197
+ var t, s, a, r, c, l, h, u;
2198
+ const g = this.dataLayer.searchObject, m = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.clearFacetsTemplate) == null ? void 0 : a.template) || ((r = v.facets.clearFacetsTemplate) == null ? void 0 : r.template), y = document.createElement("div");
2199
+ y.innerHTML = E.render(m, {
2200
+ shouldShow: g.facets.length > 0
2201
+ });
2202
+ const R = y.querySelector(
2203
+ "." + (((h = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.clearFacetsTemplate) == null ? void 0 : h.containerClass) || ((u = v.facets.clearFacetsTemplate) == null ? void 0 : u.containerClass))
2204
+ );
2205
+ R && (R.addEventListener("click", () => {
2206
+ this.removeSelectedFacets();
2207
+ }), e.appendChild(R));
2208
+ }
2209
+ createSelectedFacetsComponent(e, t) {
2210
+ var s, a, r, c, l, h, u, g;
2211
+ const m = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.selectedFacetsTemplate) == null ? void 0 : r.template) || ((c = v.facets.selectedFacetsTemplate) == null ? void 0 : c.template), y = document.createElement("div");
2212
+ y.innerHTML = E.render(m, t);
2213
+ const R = y.querySelector(
2214
+ "." + (((u = (h = (l = this.config) == null ? void 0 : l.templates) == null ? void 0 : h.selectedFacetsTemplate) == null ? void 0 : u.containerClass) || ((g = v.facets.selectedFacetsTemplate) == null ? void 0 : g.containerClass))
2215
+ );
2216
+ R && (R.addEventListener("click", () => {
2217
+ this.unselectFacet(t);
2218
+ }), e.appendChild(R));
2219
+ }
2220
+ unselectFacet(e) {
2221
+ const t = this.dataLayer.searchObject;
2222
+ let s = [...t.facets];
2223
+ e.type === "checkbox" && (s = s.filter((a) => JSON.stringify(a) !== JSON.stringify(this.extractFacetValue(e)))), setTimeout(() => {
2224
+ this.dataLayer.setSearchObject({ ...t, facets: s }), this.generateSelectedFacetsData();
2225
+ }, 0);
2226
+ }
2227
+ removeSelectedFacets() {
2228
+ const e = this.dataLayer.searchObject;
2229
+ this.dataLayer.setSearchObject({ ...e, facets: [] });
2230
+ }
2231
+ createFilterByComponent(e) {
2232
+ var t, s, a, r, c, l, h, u;
2233
+ const g = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.filterByTemplate) == null ? void 0 : a.template) || ((r = v.facets.filterByTemplate) == null ? void 0 : r.template), m = document.createElement("div");
2234
+ m.innerHTML = E.render(g, {});
2235
+ const y = m.querySelector(
2236
+ "." + (((h = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.filterByTemplate) == null ? void 0 : h.containerClass) || ((u = v.facets.filterByTemplate) == null ? void 0 : u.containerClass))
2237
+ );
2238
+ y && (e.prepend(y), y.addEventListener("click", this.openOverlay.bind(this)));
2239
+ }
2240
+ openOverlay() {
2241
+ var e;
2242
+ this.overlayOpened = !0, this.searchFacetsMainContainer && (document.body.classList.toggle("searchstax-no-scroll"), (e = this.searchFacetsMainContainer.querySelector(".searchstax-facets-mobile-overlay")) == null || e.classList.add("searchstax-show"));
2243
+ }
2244
+ closeOverlay() {
2245
+ var e;
2246
+ 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
+ }
2248
+ renderMobileTemplate(e) {
2249
+ var t, s, a, r, c, l, h, u, g, m, y, R, F, L, x, P, C, D, q;
2250
+ if (e) {
2251
+ const j = document.createElement("div");
2252
+ j.classList.add("searchstax-facets-container-mobile");
2253
+ const U = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.mainTemplateMobile) == null ? void 0 : a.template) || ((r = v.facets.mainTemplateMobile) == null ? void 0 : r.template);
2254
+ if (this.dataLayer.renderingEngine === $.mustache) {
2255
+ if (j.innerHTML = E.render(U, {
2256
+ ...e,
2257
+ overlayOpened: this.overlayOpened
2258
+ }), (c = this.searchFacetsMainContainer) == null || c.appendChild(j), (h = (l = this.config) == null ? void 0 : l.templates) != null && h.mainTemplateMobile)
2259
+ for (const J of ((m = (g = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : g.mainTemplateMobile) == null ? void 0 : m.closeOverlayTriggerClasses) || []) {
2260
+ const Y = j.querySelector("." + J);
2261
+ Y && Y.addEventListener("click", this.closeOverlay.bind(this));
2262
+ }
2263
+ else
2264
+ for (const J of v.facets.mainTemplateMobile.closeOverlayTriggerClasses) {
2265
+ const Y = j.querySelector("." + J);
2266
+ Y && Y.addEventListener("click", this.closeOverlay.bind(this));
2267
+ }
2268
+ const G = j.querySelector(
2269
+ "." + (((F = (R = (y = this.config) == null ? void 0 : y.templates) == null ? void 0 : R.mainTemplateMobile) == null ? void 0 : F.filterByContainerClass) || v.facets.mainTemplateMobile.filterByContainerClass)
2270
+ );
2271
+ G && this.createFilterByComponent(G);
2272
+ const _ = j.querySelector(
2273
+ "." + (((P = (x = (L = this.config) == null ? void 0 : L.templates) == null ? void 0 : x.mainTemplateMobile) == null ? void 0 : P.selectedFacetsContainerClass) || v.facets.mainTemplateMobile.selectedFacetsContainerClass)
2274
+ );
2275
+ _ && (this.createSelectedFacetsComponents(_), this.createClearFacetsComponents(_));
2276
+ const Z = j.querySelector(
2277
+ "." + (((q = (D = (C = this.config) == null ? void 0 : C.templates) == null ? void 0 : D.mainTemplateMobile) == null ? void 0 : q.facetsContainerClass) || v.facets.mainTemplateMobile.facetsContainerClass)
2278
+ );
2279
+ if (Z) {
2280
+ Z.innerHTML = "";
2281
+ for (const J of e.facets)
2282
+ this.createFacetItem(J, Z, !0);
2283
+ }
2284
+ }
2285
+ }
2286
+ }
2287
+ }
2288
+ class ha {
1184
2289
  constructor(e) {
1185
- g(this, "dataLayer"), g(this, "config"), g(this, "suggestAfterMinChars"), g(this, "containerId"), g(this, "currentInputValue", ""), g(this, "autosuggestResults"), g(this, "searchInput"), g(this, "actionButton"), g(this, "autosuggestContainer"), g(this, "buttonState", "search"), g(this, "selectedAutosuggestItem", -1), g(this, "suggestTrigger"), g(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());
2290
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "previousButtonClass"), o(this, "nextButtonClass"), o(this, "routerHelper"), o(this, "searchPaginationMainContainer", null);
2291
+ var t, s, a, r, c, l;
2292
+ 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) ?? v.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) ?? v.pagination.mainTemplate.nextButtonClass, this.searchPaginationMainContainer = document.getElementById(this.containerId), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
2293
+ }
2294
+ get isFirstPage() {
2295
+ var e;
2296
+ return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === 1;
2297
+ }
2298
+ get isLastPage() {
2299
+ var e, t;
2300
+ return ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) === Math.ceil((((t = this.dataLayer.searchResultsMetadata) == null ? void 0 : t.totalResultsValue) ?? 0) / 10);
2301
+ }
2302
+ initializeSubscriptions() {
2303
+ this.dataLayer.$searchResults.subscribe((e) => {
2304
+ e && this.renderMainTemplate(this.generateTemplateData());
2305
+ });
2306
+ }
2307
+ generateTemplateData() {
2308
+ var e, t, s, a;
2309
+ const r = {
2310
+ ...this.dataLayer.parsedData.data,
2311
+ previousPageLink: (t = this.routerHelper) == null ? void 0 : t.searchObjectToUrl({
2312
+ ...this.dataLayer.searchObject,
2313
+ page: ((e = this.dataLayer.searchObject) == null ? void 0 : e.page) - 1
2314
+ }),
2315
+ nextPageLink: (a = this.routerHelper) == null ? void 0 : a.searchObjectToUrl({
2316
+ ...this.dataLayer.searchObject,
2317
+ page: ((s = this.dataLayer.searchObject) == null ? void 0 : s.page) + 1
2318
+ })
2319
+ };
2320
+ return this.dataLayer.setPaginationData(r), r;
2321
+ }
2322
+ goToPage(e) {
2323
+ const t = this.dataLayer.searchObject;
2324
+ t && (t.page = e, this.dataLayer.setSearchObject(t)), window.scrollTo(0, 0);
2325
+ }
2326
+ nextPage(e) {
2327
+ var t;
2328
+ e.preventDefault(), e.stopPropagation(), this.isLastPage || this.goToPage(((t = this.dataLayer.searchObject) == null ? void 0 : t.page) + 1);
2329
+ }
2330
+ previousPage(e) {
2331
+ var t;
2332
+ e.preventDefault(), e.stopPropagation(), this.isFirstPage || this.goToPage(((t = this.dataLayer.searchObject) == null ? void 0 : t.page) - 1);
2333
+ }
2334
+ overridePaginationEvents() {
2335
+ if (this.searchPaginationMainContainer) {
2336
+ const e = this.searchPaginationMainContainer.querySelector("." + this.previousButtonClass), t = this.searchPaginationMainContainer.querySelector("." + this.nextButtonClass);
2337
+ e && e.addEventListener("click", this.previousPage.bind(this)), t && t.addEventListener("click", this.nextPage.bind(this));
2338
+ }
2339
+ }
2340
+ renderMainTemplate(e) {
2341
+ var t, s, a, r, c, l;
2342
+ 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));
2343
+ const h = ((c = (r = (a = this.config) == null ? void 0 : a.templates) == null ? void 0 : r.mainTemplate) == null ? void 0 : c.template) || ((l = v.pagination.mainTemplate) == null ? void 0 : l.template);
2344
+ this.dataLayer.renderingEngine === $.mustache && (this.searchPaginationMainContainer.innerHTML = E.render(h, e), setTimeout(() => {
2345
+ this.overridePaginationEvents();
2346
+ }, 0));
2347
+ }
2348
+ }
2349
+ class ua {
2350
+ constructor(e) {
2351
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "relatedSearchesContainerClass"), o(this, "searchRelatedSearchesMainContainer", null), o(this, "track");
2352
+ var t, s;
2353
+ 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) || v.relatedSearches.main.relatedSearchesContainerClass, this.searchRelatedSearchesMainContainer = document.getElementById(this.containerId), this.track = e.trackRelatedSearchClick, this.initializeSubscriptions();
2354
+ }
2355
+ initializeSubscriptions() {
2356
+ this.dataLayer.$searchRelatedSearches.subscribe((e) => {
2357
+ e && this.renderMainTemplate(this.generateTemplateData());
2358
+ });
2359
+ }
2360
+ generateTemplateData() {
2361
+ const e = {
2362
+ ...this.dataLayer.parsedData.data
2363
+ };
2364
+ return this.dataLayer.setRelatedSearchesData(e), e;
2365
+ }
2366
+ addRelatedSearchComponent(e, t) {
2367
+ var s, a, r, c, l;
2368
+ const h = document.createElement("div"), u = ((r = (a = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : a.relatedSearch) == null ? void 0 : r.template) || v.relatedSearches.relatedSearch.template;
2369
+ if (this.dataLayer.renderingEngine === $.mustache) {
2370
+ h.innerHTML = E.render(u, e);
2371
+ const g = h.querySelector(
2372
+ "." + (((l = (c = this.config.templates) == null ? void 0 : c.relatedSearch) == null ? void 0 : l.relatedSearchContainerClass) || v.relatedSearches.relatedSearch.relatedSearchContainerClass)
2373
+ );
2374
+ g && (t.appendChild(g), g.addEventListener("click", () => {
2375
+ this.executeSearch(e);
2376
+ }));
2377
+ }
2378
+ }
2379
+ executeSearch(e) {
2380
+ const t = this.dataLayer.searchObject;
2381
+ t.query = e.related_search, this.dataLayer.setSearchObject(t), this.track(e);
2382
+ }
2383
+ renderMainTemplate(e) {
2384
+ var t, s, a, r;
2385
+ const c = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || v.relatedSearches.main.template;
2386
+ if (this.dataLayer.renderingEngine === $.mustache && this.searchRelatedSearchesMainContainer) {
2387
+ this.searchRelatedSearchesMainContainer.innerHTML = "", this.searchRelatedSearchesMainContainer.innerHTML = //@ts-expect-error - mustache is not a module
2388
+ E.render(c, e);
2389
+ const l = (r = this.searchRelatedSearchesMainContainer) == null ? void 0 : r.querySelector(
2390
+ `.${this.relatedSearchesContainerClass}`
2391
+ );
2392
+ if (l)
2393
+ for (const h of e.relatedSearches)
2394
+ this.addRelatedSearchComponent(h, l);
2395
+ }
2396
+ }
2397
+ }
2398
+ class da {
2399
+ constructor(e) {
2400
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "searchFeedbackMainContainer", null), o(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
+ }
2402
+ initializeSubscriptions() {
2403
+ this.dataLayer.$searchResults.subscribe((e) => {
2404
+ e && this.renderMainTemplate(this.generateTemplateData());
2405
+ });
2406
+ }
2407
+ generateTemplateData() {
2408
+ const e = {
2409
+ ...this.dataLayer.parsedData.data
2410
+ };
2411
+ return this.dataLayer.setSearchFeedbackData(e), e;
2412
+ }
2413
+ onOriginalQueryClick(e) {
2414
+ var t;
2415
+ e.stopPropagation(), e.preventDefault();
2416
+ const s = (t = e.target) == null ? void 0 : t.innerHTML;
2417
+ this.searchTrigger(s, !0);
2418
+ }
2419
+ attachClick() {
2420
+ var e, t, s, a, r;
2421
+ const c = (r = this.searchFeedbackMainContainer) == null ? void 0 : r.querySelector(
2422
+ "." + (((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.main) == null ? void 0 : s.originalQueryClass) || ((a = v.searchFeedback.main) == null ? void 0 : a.originalQueryClass))
2423
+ );
2424
+ c && c.addEventListener("click", this.onOriginalQueryClick.bind(this));
2425
+ }
2426
+ renderMainTemplate(e) {
2427
+ var t, s, a;
2428
+ const r = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || v.searchFeedback.main.template;
2429
+ this.dataLayer.renderingEngine === $.mustache && (this.searchFeedbackMainContainer.innerHTML = E.render(r, e), setTimeout(() => {
2430
+ this.attachClick();
2431
+ }, 0));
2432
+ }
2433
+ }
2434
+ class ga {
2435
+ constructor(e) {
2436
+ o(this, "dataLayer"), o(this, "config"), o(this, "suggestAfterMinChars"), o(this, "containerId"), o(this, "currentInputValue", ""), o(this, "autosuggestResults"), o(this, "searchInput"), o(this, "actionButton"), o(this, "autosuggestContainer"), o(this, "buttonState", "search"), o(this, "selectedAutosuggestItem", -1), o(this, "suggestTrigger"), o(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());
1186
2437
  }
1187
2438
  renderMainTemplate() {
1188
- var e, s;
1189
- const n = document.getElementById(this.containerId);
1190
- if (!n)
2439
+ var e, t, s, a;
2440
+ const r = document.getElementById(this.containerId);
2441
+ if (!r)
1191
2442
  throw new Error("Search input container not found");
1192
- const a = ((e = this.config.templates) == null ? void 0 : e.mainTemplate) || `
1193
- <div class="searchstax-search-input-container">
1194
- <div class="searchstax-search-input-wrapper">
1195
- <input type="text" id="searchstax-search-input" class="searchstax-search-input" placeholder="SEARCH FOR..." />
1196
- <button class="searchstax-spinner-icon" id="searchstax-search-input-action-button"></button>
1197
- </div>
1198
- </div>
1199
- `;
1200
- if (console.log(
1201
- "this.dataLayer.renderingEngineValue",
1202
- this.dataLayer.renderingEngineValue
1203
- ), this.dataLayer.renderingEngineValue === "mustache") {
1204
- const l = T.render(a, {});
1205
- n.innerHTML = l;
1206
- }
1207
- const i = ((s = this.config.templates) == null ? void 0 : s.searchInputId) || "searchstax-search-input", u = document.querySelector(`#${i}`);
1208
- if (u)
1209
- this.searchInput = u, u.addEventListener("keyup", this.inputKeyupEvent.bind(this)), u.addEventListener("blur", this.hideAutosuggest.bind(this)), u.addEventListener("paste", this.inputPasteEvent.bind(this));
2443
+ const c = ((t = (e = this.config.templates) == null ? void 0 : e.mainTemplate) == null ? void 0 : t.template) || v.searchInput.mainTemplate.template;
2444
+ if (this.dataLayer.renderingEngine === $.mustache) {
2445
+ const u = E.render(c, {});
2446
+ r.innerHTML = u;
2447
+ }
2448
+ const l = ((a = (s = this.config.templates) == null ? void 0 : s.mainTemplate) == null ? void 0 : a.searchInputId) || v.searchInput.mainTemplate.searchInputId, h = document.querySelector(`#${l}`);
2449
+ if (h)
2450
+ this.searchInput = h, h.addEventListener("keyup", this.inputKeyupEvent.bind(this)), h.addEventListener("blur", this.hideAutosuggest.bind(this)), h.addEventListener("paste", this.inputPasteEvent.bind(this));
1210
2451
  else
1211
2452
  throw new Error("Input not found");
1212
2453
  }
1213
2454
  createAutosuggestContainer() {
1214
2455
  var e;
1215
- this.autosuggestContainer = document.createElement("div"), this.autosuggestContainer.classList.add("searchstax-autosuggest-container"), this.autosuggestContainer.addEventListener("mouseleave", () => {
2456
+ this.dataLayer.renderingEngine === $.mustache && (this.autosuggestContainer = document.createElement("div"), this.autosuggestContainer.classList.add("searchstax-autosuggest-container"), this.autosuggestContainer.addEventListener("mouseleave", () => {
1216
2457
  this.resetAutosuggestSelection(), this.markActiveAutosuggestItem();
1217
- }), (e = this.searchInput) == null || e.after(this.autosuggestContainer);
2458
+ }), (e = this.searchInput) == null || e.after(this.autosuggestContainer));
1218
2459
  }
1219
2460
  actionButtonInit() {
1220
- this.actionButton = document.getElementById(
1221
- "searchstax-search-input-action-button"
1222
- ), this.actionButton && this.actionButton.addEventListener("click", () => {
2461
+ this.actionButton = document.getElementById("searchstax-search-input-action-button"), this.actionButton && this.actionButton.addEventListener("click", () => {
1223
2462
  var e;
1224
2463
  this.buttonState === "search" ? this.executeSearch(((e = this.searchInput) == null ? void 0 : e.value) ?? "") : this.buttonState === "close" && this.searchInput && (this.searchInput.value = "", this.executeSearch(""));
1225
2464
  });
1226
2465
  }
1227
2466
  attachSubscriptions() {
1228
- this.dataLayer.searchTermChangeObservable.subscribe(() => {
2467
+ this.dataLayer.$searchTermChange.subscribe(() => {
1229
2468
  this.handleSearchTermChange();
1230
- }), this.dataLayer.loadingChangeObservable.subscribe(() => {
2469
+ }), this.dataLayer.$loadingChange.subscribe(() => {
1231
2470
  this.handleLoadingChange();
1232
- }), this.dataLayer.searchAutosuggestObservable.subscribe(
1233
- (e) => {
1234
- e && this.appendSuggestions(e);
1235
- }
1236
- );
2471
+ }), this.dataLayer.$searchAutosuggest.subscribe((e) => {
2472
+ e && this.appendSuggestions(e);
2473
+ }), this.dataLayer.$searchObject.subscribe((e) => {
2474
+ e.query !== "undefined" && e.query !== void 0 && e.query !== "*" && this.searchInput && (this.searchInput.value = this.cleanSuggestionTerm(e.query ?? ""));
2475
+ });
1237
2476
  }
1238
2477
  handleLoadingChange() {
1239
- this.dataLayer.loadingValue ? this.updateActionButtonState("loading") : this.handleSearchTermChange();
2478
+ this.dataLayer.loading ? this.updateActionButtonState("loading") : this.handleSearchTermChange();
1240
2479
  }
1241
2480
  handleSearchTermChange() {
1242
2481
  var e;
1243
- this.dataLayer.searchTermValue === ((e = this.searchInput) == null ? void 0 : e.value) && this.searchInput.value !== "" ? this.updateActionButtonState("close") : this.updateActionButtonState("search");
2482
+ this.dataLayer.searchTerm === ((e = this.searchInput) == null ? void 0 : e.value) && this.searchInput.value !== "" ? this.updateActionButtonState("close") : this.updateActionButtonState("search");
1244
2483
  }
1245
2484
  updateActionButtonState(e) {
1246
2485
  if (this.buttonState = e, this.actionButton)
@@ -1266,17 +2505,15 @@ class Yt {
1266
2505
  this.selectedAutosuggestItem = -1, this.markActiveAutosuggestItem();
1267
2506
  }
1268
2507
  markActiveAutosuggestItem() {
1269
- const e = document.getElementsByClassName(
1270
- "searchstax-autosuggest-item"
1271
- );
1272
- for (let s = 0; s < e.length; s++) {
1273
- const n = e[s];
1274
- s === this.selectedAutosuggestItem ? n.classList.add("active") : n.classList.remove("active");
2508
+ const e = document.getElementsByClassName("searchstax-autosuggest-item");
2509
+ for (let t = 0; t < e.length; t++) {
2510
+ const s = e[t];
2511
+ t === this.selectedAutosuggestItem ? s.classList.add("active") : s.classList.remove("active");
1275
2512
  }
1276
2513
  }
1277
2514
  inputKeyupEvent(e) {
1278
- const s = e.key;
1279
- this.currentInputValue = e.target.value, s === "Enter" ? this.suggestionChosen() : s === "Escape" ? this.hideAutosuggest() : s === "ArrowUp" ? this.selectPreviousAutosuggestItem() : s === "ArrowDown" ? this.selectNextAutosuggestItem() : this.autosuggestHandling(e), this.handleSearchTermChange();
2515
+ const t = e.key;
2516
+ this.currentInputValue = e.target.value, t === "Enter" ? this.suggestionChosen() : t === "Escape" ? this.hideAutosuggest() : t === "ArrowUp" ? this.selectPreviousAutosuggestItem() : t === "ArrowDown" ? this.selectNextAutosuggestItem() : this.autosuggestHandling(e), this.handleSearchTermChange();
1280
2517
  }
1281
2518
  autosuggestHandling(e) {
1282
2519
  e.target && e.target.value.length >= this.suggestAfterMinChars ? this.executeSuggest(e.target.value) : this.hideAutosuggest();
@@ -1293,56 +2530,55 @@ class Yt {
1293
2530
  this.hideAutosuggest(), this.searchTrigger(e === "" ? "*" : e);
1294
2531
  }
1295
2532
  suggestionChosen() {
1296
- this.selectedAutosuggestItem > -1 ? this.autosuggestItemClicked(
1297
- this.autosuggestResults.suggestions[this.selectedAutosuggestItem]
1298
- ) : this.executeSearch(this.currentInputValue);
2533
+ this.selectedAutosuggestItem > -1 ? this.autosuggestItemClicked(this.autosuggestResults.suggestions[this.selectedAutosuggestItem]) : this.executeSearch(this.currentInputValue);
1299
2534
  }
1300
2535
  hideAutosuggest() {
1301
- this.autosuggestContainer && (this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.add("hidden")), this.resetAutosuggestSelection();
2536
+ setTimeout(() => {
2537
+ this.dataLayer.setAutosuggestResults({ numFound: 0, suggestions: [] }), this.autosuggestContainer && (this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.add("hidden")), this.resetAutosuggestSelection();
2538
+ }, 100);
1302
2539
  }
1303
2540
  cleanSuggestionTerm(e) {
1304
- return e.replace(/(<([^>]+)>)/gi, "").trim();
2541
+ return z.removeXSSRiskyTags(e.replace(/(<([^>]+)>)/gi, "")).trim();
1305
2542
  }
1306
2543
  autosuggestItemClicked(e) {
1307
- this.searchInput.value = this.cleanSuggestionTerm(e.term), this.executeSearch(this.cleanSuggestionTerm(e.term));
2544
+ this.searchInput.value = this.cleanSuggestionTerm(e.term ?? ""), this.executeSearch(this.cleanSuggestionTerm(e.term));
1308
2545
  }
1309
2546
  createAutosuggestItem(e) {
1310
- var s;
1311
- const n = document.createElement("div");
1312
- n.classList.add("searchstax-autosuggest-item"), n.addEventListener("click", () => {
2547
+ var t, s, a;
2548
+ const r = document.createElement("div");
2549
+ r.classList.add("searchstax-autosuggest-item"), r.addEventListener("click", () => {
1313
2550
  this.autosuggestItemClicked(e);
1314
- }), n.addEventListener("mouseenter", () => {
1315
- var i;
1316
- this.selectedAutosuggestItem = ((i = this.autosuggestResults) == null ? void 0 : i.suggestions.indexOf(e)) || 0, this.markActiveAutosuggestItem();
2551
+ }), r.addEventListener("mouseenter", () => {
2552
+ this.onSuggestionEnter(e);
1317
2553
  });
1318
- const a = ((s = this.config.templates) == null ? void 0 : s.autosuggestItemTemplate) || '<div class="searchstax-autosuggest-item-term-container">{{{term}}}</div>';
1319
- return n.innerHTML = T.render(a, e), n;
2554
+ const c = ((s = (t = this.config.templates) == null ? void 0 : t.autosuggestItemTemplate) == null ? void 0 : s.template) || ((a = v.searchInput.autosuggestItemTemplate) == null ? void 0 : a.template);
2555
+ return r.innerHTML = E.render(c, e), r;
2556
+ }
2557
+ onSuggestionEnter(e) {
2558
+ var t;
2559
+ this.selectedAutosuggestItem = ((t = this.autosuggestResults) == null ? void 0 : t.suggestions.indexOf(e)) || 0, this.markActiveAutosuggestItem();
1320
2560
  }
1321
2561
  appendSuggestions(e) {
1322
- if (this.autosuggestContainer) {
1323
- this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.remove("hidden");
1324
- for (const s in e.suggest)
1325
- if (Object.prototype.hasOwnProperty.call(e.suggest, s)) {
1326
- const n = e.suggest[s];
1327
- for (const a in n)
1328
- if (Object.prototype.hasOwnProperty.call(n, a)) {
1329
- const i = n[a];
1330
- this.autosuggestResults = i, i.numFound > 0 ? i.suggestions.forEach((u) => {
1331
- this.autosuggestContainer.appendChild(
1332
- this.createAutosuggestItem(u)
1333
- );
1334
- }) : this.autosuggestContainer.classList.add("hidden");
1335
- }
1336
- }
1337
- }
2562
+ this.autosuggestContainer && (this.autosuggestContainer.innerHTML = "", this.autosuggestContainer.classList.remove("hidden"));
2563
+ for (const t in e.suggest)
2564
+ if (Object.prototype.hasOwnProperty.call(e.suggest, t)) {
2565
+ const s = e.suggest[t];
2566
+ for (const a in s)
2567
+ if (Object.prototype.hasOwnProperty.call(s, a)) {
2568
+ const r = s[a];
2569
+ this.autosuggestResults = r, this.dataLayer.setAutosuggestResults(r), r.numFound > 0 ? r.suggestions.forEach((c) => {
2570
+ this.autosuggestContainer && this.autosuggestContainer.appendChild(this.createAutosuggestItem(c));
2571
+ }) : this.autosuggestContainer && this.autosuggestContainer.classList.add("hidden");
2572
+ }
2573
+ }
1338
2574
  }
1339
2575
  }
1340
- class zt {
2576
+ class pa {
1341
2577
  constructor(e) {
1342
- g(this, "dataLayer"), g(this, "config"), g(this, "linkClickCallback"), g(this, "searchCallback"), g(this, "containerId"), g(this, "searchResultsMainContainer"), g(this, "searchResultsContainer"), g(this, "searchResultLinks", []), this.linkClickCallback = e.linkClickCallback, this.searchCallback = e.searchTrigger, this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId;
1343
- const s = document.getElementById(this.containerId);
1344
- if (console.log("resultsContainer", s), s)
1345
- this.searchResultsMainContainer = s;
2578
+ o(this, "dataLayer"), o(this, "config"), o(this, "linkClickCallback"), o(this, "searchCallback"), o(this, "containerId"), o(this, "searchResultsMainContainer"), o(this, "searchResultsContainer"), o(this, "searchResultLinks", []), this.linkClickCallback = e.linkClickCallback, this.searchCallback = e.searchTrigger, this.dataLayer = e.dataLayer, this.config = e.config, this.containerId = e.containerId;
2579
+ const t = document.getElementById(this.containerId);
2580
+ if (t)
2581
+ this.searchResultsMainContainer = t;
1346
2582
  else
1347
2583
  throw new Error(
1348
2584
  `Search Results Main Container with id ${this.containerId} not found`
@@ -1350,85 +2586,37 @@ class zt {
1350
2586
  this.initializeSubscriptions(), this.renderMainTemplate();
1351
2587
  }
1352
2588
  initializeSubscriptions() {
1353
- this.dataLayer.searchResultsObservable.subscribe((e) => {
2589
+ this.dataLayer.$searchResults.subscribe((e) => {
1354
2590
  e && this.searchResultsContainer && this.renderResults(e);
1355
2591
  });
1356
2592
  }
2593
+ changeTemplate() {
2594
+ this.dataLayer.searchResults && this.renderResults(this.dataLayer.searchResults);
2595
+ }
1357
2596
  renderNoResultsTemplate() {
1358
- var e, s, n;
1359
- const a = ((s = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : s.noSearchResultTemplate) || `
1360
- <div class="searchstax-no-results">
1361
- Showing <strong>no results</strong> for <strong>"{{ searchTerm }}"</strong>
1362
- <br>
1363
- {{#spellingSuggestion}}
1364
- <span>&nbsp;Did you mean <a href="#"
1365
- class="searchstax-suggestion-term">{{ spellingSuggestion }}</a>?</span>
1366
- {{/spellingSuggestion}}
1367
- </div>
1368
- <div>
1369
- <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>
1370
- <p>Lost? Click on the ‘X” in the Search Box to reset your search.</p>
1371
- </div>
1372
- `, i = ((n = this.dataLayer.searchResultsMetadataValue) == null ? void 0 : n.spellingSuggestion) ?? "";
1373
- if (this.dataLayer.renderingEngineValue === "mustache" && this.searchResultsContainer && (this.searchResultsContainer.innerHTML = T.render(
1374
- a,
2597
+ var e, t, s, a, r;
2598
+ const c = ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.noSearchResultTemplate) == null ? void 0 : s.template) || ((a = v.searchResults.noSearchResultTemplate) == null ? void 0 : a.template), l = ((r = this.dataLayer.searchResultsMetadata) == null ? void 0 : r.spellingSuggestion) ?? "";
2599
+ if (this.dataLayer.renderingEngine === $.mustache && this.searchResultsContainer && (this.searchResultsContainer.innerHTML = E.render(
2600
+ c,
1375
2601
  {
1376
- spellingSuggestion: i,
1377
- searchTerm: this.dataLayer.searchTermValue
2602
+ spellingSuggestion: l,
2603
+ searchTerm: this.dataLayer.searchTerm
1378
2604
  }
1379
- )), i && this.searchResultsContainer) {
1380
- const u = this.searchResultsContainer.querySelector("a");
1381
- u && u.addEventListener("click", (l) => {
1382
- l.preventDefault(), l.stopPropagation(), this.searchCallback(i);
2605
+ )), l && this.searchResultsContainer) {
2606
+ const h = this.searchResultsContainer.querySelector("a");
2607
+ h && h.addEventListener("click", (u) => {
2608
+ u.preventDefault(), u.stopPropagation(), this.searchCallback(l);
1383
2609
  });
1384
2610
  }
1385
2611
  }
1386
2612
  renderResults(e) {
1387
- var s, n;
1388
- if (this.dataLayer.renderingEngineValue === "mustache" && this.searchResultsContainer)
2613
+ var t, s, a, r;
2614
+ if (this.dataLayer.renderingEngine === $.mustache && this.searchResultsContainer)
1389
2615
  if (this.removeLinkClickEvents(), e.length === 0)
1390
2616
  this.renderNoResultsTemplate();
1391
2617
  else {
1392
- const a = ((n = (s = this.config) == null ? void 0 : s.templates) == null ? void 0 : n.searchResultTemplate) || `
1393
- <div class="searchstax-search-result">
1394
- {{#url}}
1395
- <a href="{{url}}" data-searchstax-unique-result-id="{{uniqueId}}" class="searchstax-result-item-link"></a>
1396
- {{/url}}
1397
- {{#ribbon}}
1398
- <div class="searchstax-search-result-ribbon">
1399
- {{ribbon}}
1400
- </div>
1401
- {{/ribbon}}
1402
- {{#thumbnail}}
1403
- <img :src="thumbnail" class="searchstax-thumbnail">
1404
- {{/thumbnail}}
1405
- <div class="searchstax-search-result-title-container">
1406
- <span class="searchstax-search-result-title">{{title}}</span>
1407
- </div>
1408
- {{#paths}}
1409
- <p class="searchstax-search-result-common">
1410
- {{paths}}
1411
- </p>
1412
- {{/paths}}
1413
- {{#description}}
1414
- <p class="searchstax-search-result-description searchstax-search-result-common">
1415
- {{description}}
1416
- </p>
1417
- {{/description}}
1418
- {{#unmappedFields}}
1419
- {{#isImage}}
1420
- <div class="searchstax-search-result-image-container">
1421
- <img :src="result[value]" class="searchstax-result-image">
1422
- </div>
1423
- {{/isImage}}
1424
- {{^isImage}}
1425
- <p class="searchstax-search-result-common">
1426
- {{value}}
1427
- </p>
1428
- {{/isImage}}
1429
- {{/unmappedFields}}
1430
- </div>`, i = e.map((u) => T.render(a, u));
1431
- this.searchResultsContainer.innerHTML = i.join(""), this.searchResultLinks = Array.from(
2618
+ const c = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.searchResultTemplate) == null ? void 0 : a.template) || ((r = v.searchResults.searchResultTemplate) == null ? void 0 : r.template), l = e.map((h) => E.render(c, h));
2619
+ this.searchResultsContainer.innerHTML = l.join(""), this.searchResultLinks = Array.from(
1432
2620
  this.searchResultsContainer.querySelectorAll(
1433
2621
  `[${this.uniqueIdAttribute}]`
1434
2622
  )
@@ -1442,151 +2630,321 @@ class zt {
1442
2630
  });
1443
2631
  }
1444
2632
  get uniqueIdAttribute() {
1445
- return this.config.searchResultUniqueIdAttribute || "data-searchstax-unique-result-id";
2633
+ var e, t, s, a;
2634
+ return ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.searchResultTemplate) == null ? void 0 : s.searchResultUniqueIdAttribute) || ((a = v.searchResults.searchResultTemplate) == null ? void 0 : a.searchResultUniqueIdAttribute);
1446
2635
  }
1447
2636
  attachLinkClickEvents() {
1448
2637
  this.searchResultLinks.forEach((e) => {
1449
- e.addEventListener("click", (s) => {
1450
- s.preventDefault(), s.stopPropagation();
1451
- const n = e.getAttribute(this.uniqueIdAttribute) ?? "";
1452
- n && this.linkClickCallback(n);
2638
+ e.addEventListener("click", (t) => {
2639
+ t.preventDefault(), t.stopPropagation();
2640
+ const s = e.getAttribute(this.uniqueIdAttribute) ?? "";
2641
+ s && this.linkClickCallback(s);
1453
2642
  });
1454
2643
  });
1455
2644
  }
1456
2645
  renderMainTemplate() {
1457
- var e, s;
1458
- const n = ((s = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : s.mainTemplate) || `
1459
- <div class="searchstax-search-results-container">
1460
- <div class="searchstax-search-results"></div>
1461
- </div>
1462
- `;
1463
- this.dataLayer.renderingEngineValue === "mustache" && (this.searchResultsMainContainer.innerHTML = T.render(
1464
- n,
2646
+ var e, t, s, a;
2647
+ const r = ((s = (t = (e = this.config) == null ? void 0 : e.templates) == null ? void 0 : t.mainTemplate) == null ? void 0 : s.template) || ((a = v.searchResults.mainTemplate) == null ? void 0 : a.template);
2648
+ this.dataLayer.renderingEngine === $.mustache && (this.searchResultsMainContainer.innerHTML = E.render(
2649
+ r,
1465
2650
  {}
1466
- )), setTimeout(() => {
1467
- var a, i;
1468
- const u = (a = this.config) != null && a.searchResultsContainerId ? (i = this.config) == null ? void 0 : i.searchResultsContainerId : "searchstax-search-results", l = document.getElementById(u);
1469
- if (l)
1470
- this.searchResultsContainer = l;
2651
+ ), setTimeout(() => {
2652
+ var c, l, h, u, g, m, y;
2653
+ const R = (h = (l = (c = this.config) == null ? void 0 : c.templates) == null ? void 0 : l.mainTemplate) != null && h.searchResultsContainerId ? (m = (g = (u = this.config) == null ? void 0 : u.templates) == null ? void 0 : g.mainTemplate) == null ? void 0 : m.searchResultsContainerId : (y = v.searchResults.mainTemplate) == null ? void 0 : y.searchResultsContainerId, F = document.getElementById(R);
2654
+ if (F)
2655
+ this.searchResultsContainer = F;
1471
2656
  else
1472
- throw new Error(`Search Results Container with id ${u} not found`);
1473
- }, 0);
2657
+ throw new Error(`Search Results Container with id ${R} not found`);
2658
+ }, 0));
1474
2659
  }
1475
2660
  }
1476
- class Gt {
1477
- constructor(e = "mustache") {
1478
- g(this, "sessionId"), g(this, "searchstaxConfig"), g(this, "searchHelper"), g(this, "searchInputConfig"), g(this, "searchResultsConfig"), g(this, "searchInputWidget"), g(this, "searchResultsWidget"), g(this, "dataLayer", new It()), e && this.dataLayer.setRenderingEngine(e), this.sessionId = wt.getOrSetCookie("searchstax_session_id"), this.handleHooks();
2661
+ class fa {
2662
+ constructor(e) {
2663
+ o(this, "dataLayer"), o(this, "config"), o(this, "containerId"), o(this, "selectId"), o(this, "searchSortingMainContainer", null);
2664
+ var t, s;
2665
+ 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) || v.sorting.main.selectId, this.searchSortingMainContainer = document.getElementById(this.containerId), this.initializeSubscriptions(), this.renderMainTemplate(this.generateTemplateData());
1479
2666
  }
1480
- setRenderingEngine(e = "mustache") {
2667
+ initializeSubscriptions() {
2668
+ this.dataLayer.$searchResults.subscribe((e) => {
2669
+ e && this.renderMainTemplate(this.generateTemplateData());
2670
+ });
2671
+ }
2672
+ generateTemplateData() {
2673
+ const e = {
2674
+ ...this.dataLayer.parsedData.data
2675
+ };
2676
+ return this.dataLayer.setSearchSortingData(e), e;
2677
+ }
2678
+ setOrderQuery(e) {
2679
+ const t = this.dataLayer.searchObject;
2680
+ t && (t.order = e, this.dataLayer.setSearchObject(t));
2681
+ }
2682
+ markOptionSelected() {
2683
+ const e = document.getElementById(
2684
+ this.selectId
2685
+ );
2686
+ if (e) {
2687
+ const t = e.querySelector(
2688
+ `option[value="${decodeURIComponent(
2689
+ this.dataLayer.searchObject.order
2690
+ )}"]`
2691
+ );
2692
+ t && (t.selected = !0);
2693
+ }
2694
+ }
2695
+ renderMainTemplate(e) {
2696
+ var t, s, a;
2697
+ const r = ((a = (s = (t = this.config) == null ? void 0 : t.templates) == null ? void 0 : s.main) == null ? void 0 : a.template) || v.sorting.main.template;
2698
+ if (this.dataLayer.renderingEngine === $.mustache) {
2699
+ this.searchSortingMainContainer.innerHTML = E.render(
2700
+ r,
2701
+ e
2702
+ ), this.markOptionSelected();
2703
+ const c = document.getElementById(
2704
+ this.selectId
2705
+ );
2706
+ c && c.addEventListener("change", (l) => {
2707
+ this.setOrderQuery(l.target.value);
2708
+ });
2709
+ }
2710
+ }
2711
+ }
2712
+ class ma {
2713
+ constructor(e = $.mustache) {
2714
+ o(this, "routerEnabled", !1), o(this, "cachedQuery", ""), o(this, "routerHelper"), o(this, "searchHelper"), o(this, "searchResultsConfig"), o(this, "searchPaginationConfig"), o(this, "searchFeedbackConfig"), o(this, "searchSortingConfig"), o(this, "searchFacetsConfig"), o(this, "relatedSearchesConfig"), o(this, "externalPromotionsConfig"), o(this, "searchInputWidget"), o(this, "searchResultsWidget"), o(this, "searchFacetsWidget"), o(this, "searchPaginationWidget"), o(this, "searchFeedbackWidget"), o(this, "searchSortingWidget"), o(this, "relatedSearchesWidget"), o(this, "externalPromotionsWidget"), o(this, "dataLayer", new Mt($t.getOrSetCookie("searchstax_session_id"))), o(this, "firstRequest", !0), e && this.dataLayer.setRenderingEngine(e), this.handleHooks();
2715
+ }
2716
+ setRenderingEngine(e = $.mustache) {
1481
2717
  this.dataLayer.setRenderingEngine(e);
1482
2718
  }
1483
2719
  handleHooks() {
1484
- var e, s;
1485
- (s = (e = this.searchInputConfig) == null ? void 0 : e.hooks) != null && s.afterSearch && this.dataLayer.searchResultsObservable.subscribe((n) => {
1486
- this.searchInputConfig.hooks.afterSearch(n);
2720
+ var e, t;
2721
+ (t = (e = this.dataLayer.searchstaxConfig) == null ? void 0 : e.hooks) != null && t.afterSearch && this.dataLayer.$searchResults.subscribe((s) => {
2722
+ this.dataLayer.searchstaxConfig.hooks.afterSearch(s);
2723
+ }), this.dataLayer.$searchObject.subscribe((s) => {
2724
+ s.query !== "" && this.search(s);
2725
+ }), this.dataLayer.$searchResults.subscribe((s) => {
2726
+ s && this.dataLayer.searchResultsMetadata && he.trackSearch({
2727
+ ...this.dataLayer.parsedData.trackingData,
2728
+ impressions: this.dataLayer.searchResultsMetadata.impressions
2729
+ });
1487
2730
  });
1488
2731
  }
1489
2732
  initialize(e) {
1490
- this.searchstaxConfig || (this.searchstaxConfig = e, this.searchHelper = new At(
1491
- { ...e, sessionId: this.sessionId },
2733
+ var t, s;
2734
+ e.autoCorrect === !1 && (this.dataLayer.autoCorrect = !1), this.dataLayer.searchstaxConfig || (this.dataLayer.setSearchstaxConfig(e), this.searchHelper = new Dt(
2735
+ { ...e, sessionId: this.dataLayer.sessionId },
1492
2736
  this.dataLayer
1493
- ));
2737
+ )), ((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 et(e.router ? e.router : { enabled: !0 }), this.dataLayer.setSearchObject(this.routerHelper.urlToSearchObject(window.location.href)), addEventListener("popstate", () => {
2738
+ this.routerHelper && this.dataLayer.setSearchObject(this.routerHelper.urlToSearchObject(window.location.href));
2739
+ })) : this.routerHelper = new et({});
2740
+ }
2741
+ search(e) {
2742
+ if (this.searchHelper && e.query !== "" && e.query !== void 0 && e.query !== "undefined") {
2743
+ const t = this.dataLayer.forceNotCorrect;
2744
+ this.searchHelper.search(
2745
+ e,
2746
+ this.parseSearchResultsResponse.bind(this),
2747
+ this.firstRequest,
2748
+ t
2749
+ ), this.firstRequest = !1, this.getRelatedSearches();
2750
+ }
1494
2751
  }
1495
- search(e, s) {
1496
- this.searchHelper && this.searchHelper.search(
1497
- e,
1498
- this.parseSearchResultsResponse.bind(this),
1499
- s
2752
+ getRelatedSearches() {
2753
+ this.searchHelper && this.relatedSearchesConfig && this.searchHelper.getRelatedSearches(
2754
+ this.dataLayer.searchObject,
2755
+ this.relatedSearchesConfig.relatedSearchesURL,
2756
+ this.relatedSearchesConfig.relatedSearchesAPIKey,
2757
+ this.parseRelatedSearchesResponse.bind(this)
1500
2758
  );
1501
2759
  }
2760
+ parseRelatedSearchesResponse(e) {
2761
+ var t;
2762
+ const s = (((t = e.response) == null ? void 0 : t.docs) ?? []).map((r, c) => ({ ...r, position: c + 1 })), a = [];
2763
+ for (const r of s)
2764
+ a.push({
2765
+ relatedSearch: r.related_search,
2766
+ position: r.position
2767
+ });
2768
+ this.dataLayer.searchResultsMetadata && he.trackRelatedSearches({
2769
+ ...this.dataLayer.parsedData.trackingData,
2770
+ impressions: a
2771
+ }), this.dataLayer.setSearchRelatedSearches(s);
2772
+ }
2773
+ handleRouter() {
2774
+ this.routerEnabled && this.routerHelper.updateUrl(this.dataLayer.searchObject);
2775
+ }
1502
2776
  parseSearchResultsResponse(e) {
1503
- var s, n;
1504
- let a = ve.combineResultsWithMetadata(e);
1505
- (n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.afterSearch && (a = this.searchInputConfig.hooks.afterSearch(a)), this.dataLayer.setSearchResults(a), this.dataLayer.setSearchResultsMetadata(
1506
- ve.extractSearchResultsMetadata(e)
1507
- );
2777
+ var t, s;
2778
+ this.handleRouter();
2779
+ let a = oe.combineResultsWithMetadata(e), r = oe.extractFacets(e);
2780
+ 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 ?? []);
2781
+ const c = oe.extractSearchResultsMetadata(e);
2782
+ this.dataLayer.setSearchResultsMetadata(c), this.dataLayer.setSearchResults(a);
2783
+ }
2784
+ cacheFacets() {
2785
+ var e;
2786
+ (e = this.searchHelper) == null || e.cacheFacets();
1508
2787
  }
1509
2788
  parseSuggestSuggestResponse(e) {
1510
- var s, n;
2789
+ var t, s;
1511
2790
  let a = e;
1512
- (n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.afterAutosuggest && (a = this.searchInputConfig.hooks.afterAutosuggest(e)), this.dataLayer.setSearchAutosuggest(a);
2791
+ (s = (t = this.dataLayer.searchInputConfig) == null ? void 0 : t.hooks) != null && s.afterAutosuggest && (a = this.dataLayer.searchInputConfig.hooks.afterAutosuggest(e)), this.dataLayer.setSearchAutosuggest(a);
1513
2792
  }
1514
- suggest(e, s) {
1515
- this.searchHelper && this.searchHelper.suggest(
1516
- e,
1517
- this.parseSuggestSuggestResponse.bind(this),
1518
- s
1519
- );
2793
+ suggest(e, t) {
2794
+ this.searchHelper && this.searchHelper.suggest(e, this.parseSuggestSuggestResponse.bind(this), t);
1520
2795
  }
1521
2796
  changeLanguage(e) {
1522
- this.searchHelper && (this.searchHelper.language = e);
2797
+ this.searchHelper && this.dataLayer.setLanguage(e);
1523
2798
  }
1524
- addSearchInputWidget(e, s) {
1525
- this.searchInputConfig || (this.searchInputConfig = s, this.searchInputWidget = new Yt({
2799
+ addSearchInputWidget(e, t) {
2800
+ this.dataLayer.searchInputConfig || (this.dataLayer.setSearchInputConfig(t), this.searchInputWidget = new ga({
1526
2801
  containerId: e,
1527
- config: s,
2802
+ config: t,
1528
2803
  searchTrigger: this.executeSearch.bind(this),
1529
2804
  suggestTrigger: this.executeSuggest.bind(this),
1530
2805
  dataLayer: this.dataLayer
1531
2806
  }));
1532
2807
  }
1533
- addSearchResultsWidget(e, s) {
1534
- this.searchResultsConfig || (this.searchResultsConfig = s, this.searchResultsWidget = new zt({
2808
+ addSearchResultsWidget(e, t) {
2809
+ this.searchResultsConfig || (this.searchResultsConfig = t, this.searchResultsWidget = new pa({
1535
2810
  containerId: e,
1536
2811
  linkClickCallback: this.executeLinkClick.bind(this),
1537
2812
  searchTrigger: this.executeSearch.bind(this),
1538
- config: s,
2813
+ config: t,
1539
2814
  dataLayer: this.dataLayer
1540
2815
  }));
1541
2816
  }
1542
- executeSearch(e) {
1543
- var s, n;
1544
- let a = { term: e, queryParams: [] };
1545
- (n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.beforeSearch && (a = this.searchInputConfig.hooks.beforeSearch(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.search(a.term, a.queryParams);
2817
+ addPaginationWidget(e, t) {
2818
+ this.searchPaginationConfig = t, this.searchPaginationWidget = new ha({
2819
+ containerId: e,
2820
+ config: t,
2821
+ dataLayer: this.dataLayer,
2822
+ routerHelper: this.routerHelper
2823
+ });
2824
+ }
2825
+ addSearchFeedbackWidget(e, t) {
2826
+ this.searchFeedbackConfig || (this.searchFeedbackConfig = t, this.searchFeedbackWidget = new da({
2827
+ containerId: e,
2828
+ config: t,
2829
+ dataLayer: this.dataLayer,
2830
+ searchTrigger: this.executeSearch.bind(this)
2831
+ }));
2832
+ }
2833
+ addSearchSortingWidget(e, t) {
2834
+ this.searchSortingConfig || (this.searchSortingConfig = t, this.searchSortingWidget = new fa({
2835
+ containerId: e,
2836
+ config: t,
2837
+ dataLayer: this.dataLayer
2838
+ }));
2839
+ }
2840
+ addRelatedSearchesWidget(e, t) {
2841
+ this.relatedSearchesConfig || (this.relatedSearchesConfig = t, this.relatedSearchesWidget = new ua({
2842
+ containerId: e,
2843
+ config: t,
2844
+ dataLayer: this.dataLayer,
2845
+ trackRelatedSearchClick: this.trackRelatedSearchClick.bind(this)
2846
+ }), setTimeout(() => {
2847
+ this.getRelatedSearches();
2848
+ }, 0));
2849
+ }
2850
+ addExternalPromotionsWidget(e, t) {
2851
+ this.externalPromotionsConfig || (this.externalPromotionsConfig = t, this.externalPromotionsWidget = new la({
2852
+ containerId: e,
2853
+ config: t,
2854
+ dataLayer: this.dataLayer
2855
+ }));
2856
+ }
2857
+ addFacetsWidget(e, t) {
2858
+ this.searchFacetsConfig = t, this.searchFacetsWidget = new oa(
2859
+ {
2860
+ containerId: e,
2861
+ config: t,
2862
+ dataLayer: this.dataLayer,
2863
+ routerHelper: this.routerHelper
2864
+ },
2865
+ this.cacheFacets.bind(this)
2866
+ );
2867
+ }
2868
+ executeSearch(e, t) {
2869
+ var s, a;
2870
+ const r = { ...this.dataLayer.searchObject };
2871
+ r.query = z.removeXSSRiskyTags(e), r.page = 1, r.facets = [], this.dataLayer.forceNotCorrect = !!t;
2872
+ let c = (s = this.routerHelper) == null ? void 0 : s.searchObjectToParams(r);
2873
+ 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);
1546
2874
  }
1547
2875
  executeSuggest(e) {
1548
- var s, n;
2876
+ var t, s;
1549
2877
  let a = { term: e, queryParams: [] };
1550
- (n = (s = this.searchInputConfig) == null ? void 0 : s.hooks) != null && n.beforeAutosuggest && (a = this.searchInputConfig.hooks.beforeAutosuggest(a)), a && a.term !== void 0 && a.queryParams !== void 0 && this.suggest(a.term, a.queryParams);
2878
+ (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
+ }
2880
+ trackRelatedSearchClick(e) {
2881
+ this.dataLayer.searchResultsMetadata && this.dataLayer.searchRelatedSearches && he.trackRelatedSearchClick({
2882
+ ...this.dataLayer.parsedData.trackingData,
2883
+ relatedSearch: e
2884
+ });
1551
2885
  }
1552
2886
  executeLinkClick(e) {
1553
- var s, n, a, i;
1554
- let u = ve.findResultByUniqueId(
1555
- e,
1556
- this.dataLayer.searchResultsValue ?? []
1557
- );
1558
- u && ((n = (s = this.searchResultsConfig) == null ? void 0 : s.hooks) != null && n.afterLinkClick && (u = this.searchResultsConfig.hooks.afterLinkClick(u)), u && (console.log("foundResult", u), this.dataLayer.searchResultsMetadataValue && Lt.trackClick({
1559
- result: u,
1560
- searchTermValue: this.dataLayer.searchTermValue,
1561
- trackApiKey: ((a = this.searchstaxConfig) == null ? void 0 : a.trackApiKey) ?? "",
1562
- session: this.sessionId,
1563
- language: ((i = this.searchHelper) == null ? void 0 : i.language) ?? "",
1564
- recordsPerPage: this.dataLayer.searchResultsMetadataValue.recordsPerPageValue,
1565
- totalResults: this.dataLayer.searchResultsMetadataValue.totalResultsValue,
1566
- currentPage: this.dataLayer.currentPageValue,
1567
- latencyVal: this.dataLayer.searchResultsMetadataValue.latency
1568
- })));
2887
+ var t, s;
2888
+ let a = oe.findResultByUniqueId(e, this.dataLayer.searchResults ?? []);
2889
+ a && ((s = (t = this.searchResultsConfig) == null ? void 0 : t.hooks) != null && s.afterLinkClick && (a = this.searchResultsConfig.hooks.afterLinkClick(a)), a && this.dataLayer.searchResultsMetadata && (he.trackClick({
2890
+ result: a,
2891
+ ...this.dataLayer.parsedData.trackingData
2892
+ }), setTimeout(() => {
2893
+ window.location.href = (a == null ? void 0 : a.url) ?? "";
2894
+ }, 0)));
2895
+ }
2896
+ setPage(e) {
2897
+ var t;
2898
+ (t = this.searchPaginationWidget) == null || t.goToPage(e);
2899
+ }
2900
+ changeResultTemplate(e) {
2901
+ var t, s, a;
2902
+ 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());
1569
2903
  }
1570
2904
  }
1571
- const F = {
1572
- searchstax: new Gt("react")
2905
+ const I = {
2906
+ //@ts-ignore
2907
+ searchstax: new ma("react")
1573
2908
  };
1574
- function Xt(r) {
1575
- return be(() => {
1576
- if (F.searchstax) {
1577
- const e = {};
1578
- r.beforeSearch && (e.beforeSearch = r.beforeSearch), r.afterSearch && (e.afterSearch = r.afterSearch), r.afterAutosuggest && (e.afterAutosuggest = r.afterAutosuggest), r.beforeAutosuggest && (e.beforeAutosuggest = r.beforeAutosuggest), F.searchstax.addSearchInputWidget("searchstax-input-container", {
1579
- suggestAfterMinChars: r.suggestAfterMinChars ?? 3,
1580
- hooks: e,
2909
+ function ya(n) {
2910
+ let e = !1;
2911
+ const [t, s] = B([]);
2912
+ se(() => {
2913
+ if (a(), I.searchstax) {
2914
+ const h = {};
2915
+ n.afterAutosuggest && (h.afterAutosuggest = n.afterAutosuggest), n.beforeAutosuggest && (h.beforeAutosuggest = n.beforeAutosuggest), I.searchstax.addSearchInputWidget("searchstax-input-container", {
2916
+ suggestAfterMinChars: n.suggestAfterMinChars ?? 3,
2917
+ hooks: h,
1581
2918
  templates: {
1582
- searchInputId: r.searchInputId ?? "searchstax-search-input"
2919
+ mainTemplate: {
2920
+ template: "",
2921
+ searchInputId: n.searchInputId ?? "searchstax-search-input"
2922
+ }
1583
2923
  }
1584
2924
  });
1585
2925
  } else
1586
2926
  throw Error("Searchstax instance needs to be passed via props");
1587
- }, []), /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx("div", { id: "searchstax-input-container", children: /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-input-container", children: [
1588
- !r.inputTemplate && /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-input-wrapper", children: [
1589
- /* @__PURE__ */ d.jsx(
2927
+ }, []);
2928
+ function a() {
2929
+ console.log(e), e || (I.searchstax.dataLayer.$autosuggestResults.subscribe((h) => {
2930
+ s((h == null ? void 0 : h.suggestions) ?? []);
2931
+ }), e = !0);
2932
+ }
2933
+ function r() {
2934
+ var h, u;
2935
+ (h = I.searchstax.searchInputWidget) == null || h.resetAutosuggestSelection(), (u = I.searchstax.searchInputWidget) == null || u.markActiveAutosuggestItem();
2936
+ }
2937
+ function c(h) {
2938
+ var u;
2939
+ (u = I.searchstax.searchInputWidget) == null || u.onSuggestionEnter(h);
2940
+ }
2941
+ function l() {
2942
+ var h;
2943
+ (h = I.searchstax.searchInputWidget) == null || h.suggestionChosen();
2944
+ }
2945
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsx("div", { id: "searchstax-input-container", children: /* @__PURE__ */ p.jsxs("div", { className: "searchstax-search-input-container", children: [
2946
+ !n.inputTemplate && /* @__PURE__ */ p.jsxs("div", { className: "searchstax-search-input-wrapper", children: [
2947
+ /* @__PURE__ */ p.jsx(
1590
2948
  "input",
1591
2949
  {
1592
2950
  type: "text",
@@ -1595,132 +2953,316 @@ function Xt(r) {
1595
2953
  placeholder: "SEARCH FOR..."
1596
2954
  }
1597
2955
  ),
1598
- /* @__PURE__ */ d.jsx(
1599
- "button",
2956
+ /* @__PURE__ */ p.jsx(
2957
+ "div",
1600
2958
  {
1601
- className: "searchstax-spinner-icon",
1602
- id: "searchstax-search-input-action-button"
2959
+ className: `searchstax-autosuggest-container ${t.length === 0 ? "hidden" : ""}`,
2960
+ onMouseLeave: r,
2961
+ children: t.map(function(h) {
2962
+ return /* @__PURE__ */ p.jsx("div", { className: "searchstax-autosuggest-item", children: /* @__PURE__ */ p.jsx(
2963
+ "div",
2964
+ {
2965
+ className: "searchstax-autosuggest-item-term-container",
2966
+ dangerouslySetInnerHTML: { __html: h.term },
2967
+ onMouseOver: () => {
2968
+ c(h);
2969
+ },
2970
+ onClick: () => {
2971
+ l();
2972
+ }
2973
+ }
2974
+ ) }, h.term);
2975
+ })
1603
2976
  }
1604
- )
2977
+ ),
2978
+ /* @__PURE__ */ p.jsx("button", { className: "searchstax-spinner-icon", id: "searchstax-search-input-action-button" })
1605
2979
  ] }),
1606
- r.inputTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.inputTemplate() })
2980
+ n.inputTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.inputTemplate(t, r, c, l) })
1607
2981
  ] }) }) });
1608
2982
  }
1609
- function Qt(r) {
1610
- return be(() => {
1611
- F.searchstax.initialize({
1612
- language: r.language ?? "en",
1613
- searchURL: r.searchURL,
1614
- suggesterURL: r.suggesterURL,
1615
- trackApiKey: r.trackApiKey,
1616
- searchAuth: r.searchAuth,
1617
- authType: r.authType ?? "basic"
1618
- }), r.initialized(F.searchstax);
1619
- }, [r.initialized]), /* @__PURE__ */ d.jsx(d.Fragment, { children: r.children });
2983
+ function ba(n) {
2984
+ return se(() => {
2985
+ const e = {};
2986
+ n.beforeSearch && (e.beforeSearch = n.beforeSearch), n != null && n.afterSearch && (e.afterSearch = n.afterSearch), I.searchstax.initialize({
2987
+ language: n.language ?? "en",
2988
+ searchURL: n.searchURL,
2989
+ suggesterURL: n.suggesterURL,
2990
+ trackApiKey: n.trackApiKey,
2991
+ searchAuth: n.searchAuth,
2992
+ authType: n.authType ?? "basic",
2993
+ autoCorrect: n.autoCorrect,
2994
+ router: n.router,
2995
+ hooks: e
2996
+ }), n.initialized(I.searchstax);
2997
+ }, [n.initialized]), /* @__PURE__ */ p.jsx(p.Fragment, { children: n.children });
1620
2998
  }
1621
- function Zt(r) {
1622
- const [e, s] = pe(
1623
- null
1624
- ), [n, a] = pe(""), [i, u] = pe(""), l = (h, p) => {
1625
- p.preventDefault(), p.stopPropagation(), F.searchstax.executeLinkClick(h.uniqueId);
2999
+ function xa(n) {
3000
+ const [e, t] = B(null), [s, a] = B(""), [r, c] = B(null), l = (u, g) => {
3001
+ g.preventDefault(), g.stopPropagation(), I.searchstax.executeLinkClick(u.uniqueId);
1626
3002
  };
1627
- return be(() => {
1628
- const h = {};
1629
- r.afterLinkClick && (h.afterLinkClick = r.afterLinkClick), F.searchstax.dataLayer.searchResultsObservable.subscribe(
1630
- (p) => {
1631
- s(p);
1632
- }
1633
- ), F.searchstax.dataLayer.searchResultsMetadataObservable.subscribe(
1634
- (p) => {
1635
- u((p == null ? void 0 : p.spellingSuggestion) ?? "");
1636
- }
1637
- ), F.searchstax.dataLayer.searchTermChangeObservable.subscribe(
1638
- (p) => {
1639
- a(p);
1640
- }
1641
- ), F.searchstax.addSearchResultsWidget("searchstax-results-container", {
1642
- searchResultsContainerId: "searchstax-result-container",
1643
- // if main template is over ridden this points to an
3003
+ se(() => {
3004
+ h();
3005
+ const u = {};
3006
+ n.afterLinkClick && (u.afterLinkClick = n.afterLinkClick), I.searchstax.addSearchResultsWidget("searchstax-results-container", {
1644
3007
  templates: {},
1645
- hooks: h
3008
+ hooks: u
1646
3009
  });
1647
- }, []), /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx("div", { id: "searchstax-results-container", children: /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-results-container", children: /* @__PURE__ */ d.jsxs("div", { id: "searchstax-result-container", children: [
1648
- e && e.length === 0 && !r.noResultTemplate && /* @__PURE__ */ d.jsxs("div", { children: [
1649
- /* @__PURE__ */ d.jsxs("div", { className: "searchstax-no-results", children: [
3010
+ }, []);
3011
+ function h() {
3012
+ I.searchstax.dataLayer.$searchResults.subscribe((u) => {
3013
+ t(u);
3014
+ }), I.searchstax.dataLayer.$searchTermChange.subscribe((u) => {
3015
+ a(u);
3016
+ }), I.searchstax.dataLayer.$searchResultsMetadata.subscribe((u) => {
3017
+ c(u);
3018
+ });
3019
+ }
3020
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsx("div", { id: "searchstax-results-container", children: /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-results-container", children: /* @__PURE__ */ p.jsxs("div", { id: "searchstax-result-container", children: [
3021
+ e && e.length === 0 && !n.noResultTemplate && /* @__PURE__ */ p.jsxs("div", { children: [
3022
+ /* @__PURE__ */ p.jsxs("div", { className: "searchstax-no-results", children: [
3023
+ " ",
1650
3024
  "Showing ",
1651
- /* @__PURE__ */ d.jsx("strong", { children: "no results" }),
1652
- " for",
1653
- /* @__PURE__ */ d.jsxs("strong", { children: [
3025
+ /* @__PURE__ */ p.jsx("strong", { children: "no results" }),
3026
+ " for ",
3027
+ /* @__PURE__ */ p.jsxs("strong", { children: [
1654
3028
  '"',
1655
- n,
3029
+ s,
1656
3030
  '"'
1657
3031
  ] }),
1658
- /* @__PURE__ */ d.jsx("br", {}),
1659
- i && /* @__PURE__ */ d.jsxs("span", { children: [
3032
+ /* @__PURE__ */ p.jsx("br", {}),
3033
+ (r == null ? void 0 : r.spellingSuggestion) && /* @__PURE__ */ p.jsxs("span", { children: [
1660
3034
  " Did you mean",
1661
- /* @__PURE__ */ d.jsx("a", { href: "#", className: "searchstax-suggestion-term", children: i }),
3035
+ " ",
3036
+ /* @__PURE__ */ p.jsx("a", { href: "#", className: "searchstax-suggestion-term", children: r == null ? void 0 : r.spellingSuggestion }),
1662
3037
  "?"
1663
3038
  ] })
1664
3039
  ] }),
1665
- /* @__PURE__ */ d.jsxs("div", { children: [
1666
- /* @__PURE__ */ d.jsx("p", { children: "Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need." }),
1667
- /* @__PURE__ */ d.jsx("p", { children: "Lost? Click on the ‘X” in the Search Box to reset your search." })
3040
+ /* @__PURE__ */ p.jsxs("div", { children: [
3041
+ /* @__PURE__ */ p.jsxs("p", { children: [
3042
+ " ",
3043
+ "Try searching for search related terms or topics. We offer a wide variety of content to help you get the information you need.",
3044
+ " "
3045
+ ] }),
3046
+ /* @__PURE__ */ p.jsx("p", { children: "Lost? Click on the ‘X” in the Search Box to reset your search." })
1668
3047
  ] })
1669
3048
  ] }),
1670
- e && e.length === 0 && r.noResultTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.noResultTemplate(n, i) }),
1671
- e && e.length && !r.resultsTemplate && /* @__PURE__ */ d.jsxs("div", { className: "searchstax-search-results", children: [
1672
- e !== null && e.map(function(h) {
1673
- return /* @__PURE__ */ d.jsxs(
1674
- "div",
1675
- {
1676
- className: "searchstax-search-result",
1677
- children: [
1678
- h.url && /* @__PURE__ */ d.jsx(
1679
- "a",
1680
- {
1681
- href: h.url,
1682
- "data-searchstax-unique-result-id": h.uniqueId,
1683
- onClick: (p) => {
1684
- l(h, p);
1685
- },
1686
- className: "searchstax-result-item-link"
1687
- }
1688
- ),
1689
- h.ribbon && /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-ribbon", children: h.ribbon }),
1690
- h.thumbnail && /* @__PURE__ */ d.jsx(
1691
- "img",
1692
- {
1693
- src: h.thumbnail,
1694
- className: "searchstax-thumbnail"
1695
- }
1696
- ),
1697
- /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-title-container", children: /* @__PURE__ */ d.jsx("span", { className: "searchstax-search-result-title", children: h.title }) }),
1698
- h.paths && /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-common", children: h.paths }),
1699
- h.description && /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-description searchstax-search-result-common", children: h.description }),
1700
- h.unmappedFields.map(function(p) {
1701
- return /* @__PURE__ */ d.jsxs("div", { children: [
1702
- p.isImage && /* @__PURE__ */ d.jsx("div", { className: "searchstax-search-result-image-container", children: /* @__PURE__ */ d.jsx(
1703
- "img",
1704
- {
1705
- src: p.value,
1706
- className: "searchstax-result-image"
1707
- }
1708
- ) }),
1709
- !p.isImage && /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx("p", { className: "searchstax-search-result-common", children: p.value }) })
1710
- ] }, p.value);
1711
- })
1712
- ]
3049
+ e && e.length === 0 && n.noResultTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.noResultTemplate(s, r) }),
3050
+ e && e.length && !n.resultsTemplate && /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-results", children: e !== null && e.map(function(u) {
3051
+ return /* @__PURE__ */ p.jsxs(
3052
+ "div",
3053
+ {
3054
+ className: `searchstax-search-result ${u.thumbnail ? "has-thumbnail" : ""}`,
3055
+ children: [
3056
+ u.promoted && /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-result-promoted" }),
3057
+ u.url && /* @__PURE__ */ p.jsx(
3058
+ "a",
3059
+ {
3060
+ href: u.url,
3061
+ "data-searchstax-unique-result-id": u.uniqueId,
3062
+ onClick: (g) => {
3063
+ l(u, g);
3064
+ },
3065
+ className: "searchstax-result-item-link"
3066
+ }
3067
+ ),
3068
+ u.ribbon && /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-result-ribbon", children: u.ribbon }),
3069
+ u.thumbnail && /* @__PURE__ */ p.jsx("img", { src: u.thumbnail, className: "searchstax-thumbnail" }),
3070
+ /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-result-title-container", children: /* @__PURE__ */ p.jsx("span", { className: "searchstax-search-result-title", children: u.title }) }),
3071
+ u.paths && /* @__PURE__ */ p.jsx("p", { className: "searchstax-search-result-common", children: u.paths }),
3072
+ u.description && /* @__PURE__ */ p.jsx("p", { className: "searchstax-search-result-description searchstax-search-result-common", children: u.description }),
3073
+ u.unmappedFields.map(function(g) {
3074
+ return /* @__PURE__ */ p.jsxs("div", { children: [
3075
+ g.isImage && typeof g.value == "string" && /* @__PURE__ */ p.jsx("div", { className: "searchstax-search-result-image-container", children: /* @__PURE__ */ p.jsx("img", { src: g.value, className: "searchstax-result-image" }) }),
3076
+ !g.isImage && /* @__PURE__ */ p.jsx("div", { children: /* @__PURE__ */ p.jsx("p", { className: "searchstax-search-result-common", children: g.value }) })
3077
+ ] }, g.key);
3078
+ })
3079
+ ]
3080
+ },
3081
+ u.uniqueId
3082
+ );
3083
+ }) }),
3084
+ e && e.length && n.resultsTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.resultsTemplate(e, l) })
3085
+ ] }) }) }) });
3086
+ }
3087
+ function Ca(n) {
3088
+ let e = !1;
3089
+ const [t, s] = B(!1), [a, r] = B(null), [c] = B(Math.random());
3090
+ se(() => {
3091
+ if (l(), I.searchstax)
3092
+ I.searchstax.addPaginationWidget("searchstax-pagination-container" + c, {});
3093
+ else
3094
+ throw Error("Searchstax instance needs to be passed via props");
3095
+ }, []);
3096
+ function l() {
3097
+ e || (I.searchstax.dataLayer.$searchObject.subscribe(() => {
3098
+ h();
3099
+ }), I.searchstax.dataLayer.$paginationData.subscribe((m) => {
3100
+ r(m);
3101
+ }), e = !0);
3102
+ }
3103
+ function h() {
3104
+ !t && I.searchstax.routerHelper && (s(!0), I.searchstax.addPaginationWidget("searchstax-pagination-container" + c, {}));
3105
+ }
3106
+ function u(m) {
3107
+ var y;
3108
+ (y = I.searchstax.searchPaginationWidget) == null || y.nextPage(m);
3109
+ }
3110
+ function g(m) {
3111
+ var y;
3112
+ (y = I.searchstax.searchPaginationWidget) == null || y.previousPage(m);
3113
+ }
3114
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsxs("div", { id: "searchstax-pagination-container" + c, children: [
3115
+ !n.paginationTemplate && a && (a == null ? void 0 : a.totalResults) !== 0 && /* @__PURE__ */ p.jsx("div", { className: "searchstax-pagination-container", children: /* @__PURE__ */ p.jsxs("div", { className: "searchstax-pagination-content", children: [
3116
+ /* @__PURE__ */ p.jsxs(
3117
+ "a",
3118
+ {
3119
+ className: "searchstax-pagination-previous",
3120
+ style: a != null && a.isFirstPage ? { pointerEvents: "none" } : {},
3121
+ onClick: (m) => {
3122
+ g(m);
1713
3123
  },
1714
- h.uniqueId
1715
- );
1716
- }),
1717
- e !== null && e.length && /* @__PURE__ */ d.jsx("div", { "v-if": "searchResults && searchResults.length && hasResultSlot" })
3124
+ id: "searchstax-pagination-previous",
3125
+ children: [
3126
+ " ",
3127
+ "< Previous",
3128
+ " "
3129
+ ]
3130
+ }
3131
+ ),
3132
+ /* @__PURE__ */ p.jsxs("div", { className: "searchstax-pagination-details", children: [
3133
+ " ",
3134
+ a == null ? void 0 : a.startResultIndex,
3135
+ " - ",
3136
+ a == null ? void 0 : a.endResultIndex,
3137
+ " of ",
3138
+ a == null ? void 0 : a.totalResults
3139
+ ] }),
3140
+ /* @__PURE__ */ p.jsx(
3141
+ "a",
3142
+ {
3143
+ className: "searchstax-pagination-next",
3144
+ style: a != null && a.isLastPage ? { pointerEvents: "none" } : {},
3145
+ onClick: (m) => {
3146
+ u(m);
3147
+ },
3148
+ id: "searchstax-pagination-next",
3149
+ children: "Next >"
3150
+ }
3151
+ )
3152
+ ] }) }),
3153
+ n.paginationTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.paginationTemplate(a, u, g) })
3154
+ ] }) });
3155
+ }
3156
+ function Sa(n) {
3157
+ let e = !1;
3158
+ const [t, s] = B(null), [a, r] = B(""), [c] = B(Math.random());
3159
+ se(() => {
3160
+ if (l(), I.searchstax)
3161
+ I.searchstax.addSearchSortingWidget("search-sorting-container" + c, {});
3162
+ else
3163
+ throw Error("Searchstax instance needs to be passed via props");
3164
+ }, []);
3165
+ function l() {
3166
+ e || (I.searchstax.dataLayer.$searchSortingData.subscribe((u) => {
3167
+ s(u);
3168
+ }), I.searchstax.dataLayer.$searchObject.subscribe((u) => {
3169
+ r(decodeURIComponent((u == null ? void 0 : u.order) ?? ""));
3170
+ }), e = !0);
3171
+ }
3172
+ function h(u) {
3173
+ var g;
3174
+ (g = I.searchstax.searchSortingWidget) == null || g.setOrderQuery(u);
3175
+ }
3176
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsxs("div", { id: "search-sorting-container" + c, children: [
3177
+ !n.searchSortingTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.hasResultsOrExternalPromotions) && /* @__PURE__ */ p.jsxs("div", { className: "searchstax-sorting-container", children: [
3178
+ /* @__PURE__ */ p.jsx("label", { className: "searchstax-sorting-label", htmlFor: "sort-by", children: "Sort By" }),
3179
+ /* @__PURE__ */ p.jsxs(
3180
+ "select",
3181
+ {
3182
+ id: "searchstax-search-order-select",
3183
+ className: "searchstax-search-order-select",
3184
+ value: a,
3185
+ onChange: (u) => {
3186
+ h(u.target.value);
3187
+ },
3188
+ children: [
3189
+ /* @__PURE__ */ p.jsx("option", { value: "", children: " Relevance " }),
3190
+ /* @__PURE__ */ p.jsx("option", { value: "date desc", children: " Newest Content " }),
3191
+ /* @__PURE__ */ p.jsx("option", { value: "date asc", children: " Oldest Content " })
3192
+ ]
3193
+ }
3194
+ )
1718
3195
  ] }),
1719
- e && e.length && r.resultsTemplate && /* @__PURE__ */ d.jsx(d.Fragment, { children: r.resultsTemplate(e, l) })
1720
- ] }) }) }) });
3196
+ n.searchSortingTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.searchSortingTemplate(t, h, a) })
3197
+ ] }) });
3198
+ }
3199
+ function Ta(n) {
3200
+ let e = !1;
3201
+ const [t, s] = B(null), [a] = B(Math.random());
3202
+ se(() => {
3203
+ if (r(), I.searchstax)
3204
+ I.searchstax.addSearchFeedbackWidget("search-feedback-container" + a, {});
3205
+ else
3206
+ throw Error("Searchstax instance needs to be passed via props");
3207
+ }, []);
3208
+ function r() {
3209
+ e || (I.searchstax.dataLayer.$searchFeedbackData.subscribe(
3210
+ (l) => {
3211
+ s(l);
3212
+ }
3213
+ ), e = !0);
3214
+ }
3215
+ function c(l) {
3216
+ var h;
3217
+ (h = I.searchstax.searchFeedbackWidget) == null || h.onOriginalQueryClick(l);
3218
+ }
3219
+ return /* @__PURE__ */ p.jsx(p.Fragment, { children: /* @__PURE__ */ p.jsxs("div", { className: "search-feedback-container", id: "search-feedback-container" + a, children: [
3220
+ !n.searchOverviewTemplate && t && (t == null ? void 0 : t.searchExecuted) && (t == null ? void 0 : t.totalResults) && /* @__PURE__ */ p.jsxs(p.Fragment, { children: [
3221
+ "Showing",
3222
+ " ",
3223
+ /* @__PURE__ */ p.jsxs("b", { children: [
3224
+ t.startResultIndex,
3225
+ " - ",
3226
+ t.endResultIndex
3227
+ ] }),
3228
+ " ",
3229
+ "of",
3230
+ /* @__PURE__ */ p.jsxs("b", { children: [
3231
+ " ",
3232
+ t.totalResults
3233
+ ] }),
3234
+ " results",
3235
+ t.searchTerm && /* @__PURE__ */ p.jsxs("span", { children: [
3236
+ ' for "',
3237
+ /* @__PURE__ */ p.jsx("b", { children: t.searchTerm }),
3238
+ '"',
3239
+ " "
3240
+ ] }),
3241
+ /* @__PURE__ */ p.jsx("div", { className: "searchstax-feedback-container-suggested", children: t.autoCorrectedQuery && /* @__PURE__ */ p.jsxs("div", { children: [
3242
+ " ",
3243
+ "Search instead for",
3244
+ " ",
3245
+ /* @__PURE__ */ p.jsx(
3246
+ "a",
3247
+ {
3248
+ href: "#",
3249
+ onClick: (l) => {
3250
+ c(l);
3251
+ },
3252
+ className: "searchstax-feedback-original-query",
3253
+ children: t.originalQuery
3254
+ }
3255
+ )
3256
+ ] }) })
3257
+ ] }),
3258
+ n.searchOverviewTemplate && /* @__PURE__ */ p.jsx(p.Fragment, { children: n.searchOverviewTemplate(t, c) })
3259
+ ] }) });
1721
3260
  }
1722
3261
  export {
1723
- Xt as SearchstaxInputWidget,
1724
- Zt as SearchstaxResultWidget,
1725
- Qt as SearchstaxWrapper
3262
+ ya as SearchstaxInputWidget,
3263
+ Ta as SearchstaxOverviewWidget,
3264
+ Ca as SearchstaxPaginationWidget,
3265
+ xa as SearchstaxResultWidget,
3266
+ Sa as SearchstaxSortingWidget,
3267
+ ba as SearchstaxWrapper
1726
3268
  };