@getlupa/client 1.12.10 → 1.13.3

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,25 +1,45 @@
1
1
  (function(global2, factory) {
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.LupaSearch = {}));
3
- })(this, function(exports2) {
4
- "use strict";var __defProp = Object.defineProperty;
5
- var __defProps = Object.defineProperties;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __spreadValues = (a, b) => {
3
+ })(this, function(exports) {
4
+ "use strict";var __defProp2 = Object.defineProperty;
5
+ var __defProps2 = Object.defineProperties;
6
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues2 = (a, b) => {
12
12
  for (var prop in b || (b = {}))
13
- if (__hasOwnProp.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- if (__getOwnPropSymbols)
16
- for (var prop of __getOwnPropSymbols(b)) {
17
- if (__propIsEnum.call(b, prop))
18
- __defNormalProp(a, prop, b[prop]);
13
+ if (__hasOwnProp2.call(b, prop))
14
+ __defNormalProp2(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols2)
16
+ for (var prop of __getOwnPropSymbols2(b)) {
17
+ if (__propIsEnum2.call(b, prop))
18
+ __defNormalProp2(a, prop, b[prop]);
19
19
  }
20
20
  return a;
21
21
  };
22
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
23
+ var __async2 = (__this, __arguments, generator) => {
24
+ return new Promise((resolve2, reject) => {
25
+ var fulfilled = (value) => {
26
+ try {
27
+ step(generator.next(value));
28
+ } catch (e2) {
29
+ reject(e2);
30
+ }
31
+ };
32
+ var rejected = (value) => {
33
+ try {
34
+ step(generator.throw(value));
35
+ } catch (e2) {
36
+ reject(e2);
37
+ }
38
+ };
39
+ var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
40
+ step((generator = generator.apply(__this, __arguments)).next());
41
+ });
42
+ };
23
43
 
24
44
  function makeMap(str, expectsLowerCase) {
25
45
  const map = /* @__PURE__ */ Object.create(null);
@@ -6305,7 +6325,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6305
6325
  }
6306
6326
  const createApp = (...args) => {
6307
6327
  const app2 = ensureRenderer().createApp(...args);
6308
- const { mount } = app2;
6328
+ const { mount: mount2 } = app2;
6309
6329
  app2.mount = (containerOrSelector) => {
6310
6330
  const container = normalizeContainer(containerOrSelector);
6311
6331
  if (!container)
@@ -6315,7 +6335,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6315
6335
  component.template = container.innerHTML;
6316
6336
  }
6317
6337
  container.innerHTML = "";
6318
- const proxy = mount(container, false, container instanceof SVGElement);
6338
+ const proxy = mount2(container, false, container instanceof SVGElement);
6319
6339
  if (container instanceof Element) {
6320
6340
  container.removeAttribute("v-cloak");
6321
6341
  container.setAttribute("data-v-app", "");
@@ -6331,25 +6351,25 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6331
6351
  }
6332
6352
  return container;
6333
6353
  }
6334
- var __defProp2 = Object.defineProperty;
6335
- var __defProps2 = Object.defineProperties;
6336
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
6337
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
6338
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
6339
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
6340
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6341
- var __spreadValues2 = (a, b) => {
6354
+ var __defProp = Object.defineProperty;
6355
+ var __defProps = Object.defineProperties;
6356
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6357
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6358
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6359
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6360
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6361
+ var __spreadValues = (a, b) => {
6342
6362
  for (var prop in b || (b = {}))
6343
- if (__hasOwnProp2.call(b, prop))
6344
- __defNormalProp2(a, prop, b[prop]);
6345
- if (__getOwnPropSymbols2)
6346
- for (var prop of __getOwnPropSymbols2(b)) {
6347
- if (__propIsEnum2.call(b, prop))
6348
- __defNormalProp2(a, prop, b[prop]);
6363
+ if (__hasOwnProp.call(b, prop))
6364
+ __defNormalProp(a, prop, b[prop]);
6365
+ if (__getOwnPropSymbols)
6366
+ for (var prop of __getOwnPropSymbols(b)) {
6367
+ if (__propIsEnum.call(b, prop))
6368
+ __defNormalProp(a, prop, b[prop]);
6349
6369
  }
6350
6370
  return a;
6351
6371
  };
6352
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
6372
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6353
6373
  var __async = (__this, __arguments, generator) => {
6354
6374
  return new Promise((resolve2, reject) => {
6355
6375
  var fulfilled = (value) => {
@@ -6815,14 +6835,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6815
6835
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6816
6836
  });
6817
6837
  };
6818
- const defaultConfig$1 = {
6838
+ const defaultConfig = {
6819
6839
  method: "POST",
6820
6840
  headers: { "Content-Type": "application/json" }
6821
6841
  };
6822
6842
  const customRequestConfig = ({ customHeaders }) => {
6823
6843
  return {
6824
- method: defaultConfig$1.method,
6825
- headers: Object.assign(Object.assign({}, defaultConfig$1.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6844
+ method: defaultConfig.method,
6845
+ headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6826
6846
  };
6827
6847
  };
6828
6848
  const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, function* () {
@@ -6846,7 +6866,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6846
6866
  return { success: false, errors };
6847
6867
  });
6848
6868
  const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6849
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6869
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6850
6870
  if (res.status < 400) {
6851
6871
  const data = yield res.json();
6852
6872
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6856,7 +6876,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6856
6876
  });
6857
6877
  const queryByIds = (queryKey, ids, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6858
6878
  const idParam = ids.map((id) => `ids=${id}`).join("&");
6859
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6879
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6860
6880
  if (res.status < 400) {
6861
6881
  const data = yield res.json();
6862
6882
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6869,7 +6889,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6869
6889
  if (filters) {
6870
6890
  url += `&${e({ filters })}`;
6871
6891
  }
6872
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6892
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6873
6893
  if (res.status < 400) {
6874
6894
  const data = yield res.json();
6875
6895
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6883,7 +6903,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6883
6903
  if (filters) {
6884
6904
  url += `&${e({ filters })}`;
6885
6905
  }
6886
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6906
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6887
6907
  if (res.status < 400) {
6888
6908
  const data = yield res.json();
6889
6909
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6895,7 +6915,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6895
6915
  return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl);
6896
6916
  });
6897
6917
  const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6898
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6918
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6899
6919
  if (res.status < 400) {
6900
6920
  const items = yield res.json();
6901
6921
  return { items, success: true };
@@ -6905,7 +6925,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6905
6925
  });
6906
6926
  const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6907
6927
  try {
6908
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6928
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6909
6929
  if (res.status < 400) {
6910
6930
  return { success: false };
6911
6931
  }
@@ -6915,7 +6935,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6915
6935
  }
6916
6936
  });
6917
6937
  const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6918
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6938
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6919
6939
  if (res.status < 400) {
6920
6940
  return res.json();
6921
6941
  }
@@ -7247,13 +7267,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7247
7267
  }
7248
7268
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
7249
7269
  const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
7250
- const params = __spreadValues2({
7270
+ const params = __spreadValues({
7251
7271
  search_text: data.searchQuery,
7252
7272
  item_title: title,
7253
7273
  item_id: data.itemId,
7254
7274
  ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
7255
7275
  }, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
7256
- window.dataLayer.push(__spreadValues2({
7276
+ window.dataLayer.push(__spreadValues({
7257
7277
  event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
7258
7278
  }, params));
7259
7279
  };
@@ -7431,15 +7451,21 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7431
7451
  breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
7432
7452
  };
7433
7453
  const useScreenStore = defineStore("screen", () => {
7434
- const screenWidth = ref(1e3);
7454
+ const measuredScreenWidth = ref(1e3);
7435
7455
  const optionsStore = useOptionsStore();
7456
+ const screenWidth = computed(() => {
7457
+ var _a, _b;
7458
+ const { searchResultOptions } = storeToRefs(optionsStore);
7459
+ return (_b = (_a = searchResultOptions.value.grid) == null ? void 0 : _a.forcedScreenWidth) != null ? _b : measuredScreenWidth.value;
7460
+ });
7436
7461
  const configuredGridSizes = computed(() => {
7437
7462
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
7463
+ const { searchResultOptions } = storeToRefs(optionsStore);
7438
7464
  return {
7439
- smMin: (_d = (_c = (_b = (_a = optionsStore.searchResultOptions) == null ? void 0 : _a.grid) == null ? void 0 : _b.sizes) == null ? void 0 : _c.sm) != null ? _d : S_MIN_WIDTH,
7440
- mdMin: (_h = (_g = (_f = (_e = optionsStore.searchResultOptions) == null ? void 0 : _e.grid) == null ? void 0 : _f.sizes) == null ? void 0 : _g.md) != null ? _h : MD_MIN_WIDTH,
7441
- lMin: (_l = (_k = (_j = (_i = optionsStore.searchResultOptions) == null ? void 0 : _i.grid) == null ? void 0 : _j.sizes) == null ? void 0 : _k.l) != null ? _l : L_MIN_WIDTH,
7442
- xlMin: (_p = (_o = (_n = (_m = optionsStore.searchResultOptions) == null ? void 0 : _m.grid) == null ? void 0 : _n.sizes) == null ? void 0 : _o.xl) != null ? _p : XL_MIN_WIDTH
7465
+ smMin: (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.grid) == null ? void 0 : _b.sizes) == null ? void 0 : _c.sm) != null ? _d : S_MIN_WIDTH,
7466
+ mdMin: (_h = (_g = (_f = (_e = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _e.grid) == null ? void 0 : _f.sizes) == null ? void 0 : _g.md) != null ? _h : MD_MIN_WIDTH,
7467
+ lMin: (_l = (_k = (_j = (_i = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _i.grid) == null ? void 0 : _j.sizes) == null ? void 0 : _k.l) != null ? _l : L_MIN_WIDTH,
7468
+ xlMin: (_p = (_o = (_n = (_m = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _m.grid) == null ? void 0 : _n.sizes) == null ? void 0 : _o.xl) != null ? _p : XL_MIN_WIDTH
7443
7469
  };
7444
7470
  });
7445
7471
  const currentScreenWidth = computed(() => {
@@ -7461,7 +7487,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7461
7487
  return (_a = ["xs", "sm"]) == null ? void 0 : _a.includes(currentScreenWidth.value);
7462
7488
  });
7463
7489
  const setScreenWidth = ({ width }) => {
7464
- screenWidth.value = width;
7490
+ measuredScreenWidth.value = width;
7465
7491
  };
7466
7492
  return { screenWidth, currentScreenWidth, isMobileWidth, setScreenWidth };
7467
7493
  });
@@ -7741,7 +7767,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7741
7767
  const getLabeledFilters = (filters, facets) => {
7742
7768
  return filters.map((f2) => {
7743
7769
  var _a, _b;
7744
- return __spreadProps2(__spreadValues2({}, f2), {
7770
+ return __spreadProps(__spreadValues({}, f2), {
7745
7771
  label: (_b = (_a = facets == null ? void 0 : facets.find((ft) => ft.key === f2.key)) == null ? void 0 : _a.label) != null ? _b : capitalize$1(f2.key)
7746
7772
  });
7747
7773
  });
@@ -7769,7 +7795,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7769
7795
  }
7770
7796
  const children = recursiveFilter(item.children, query).filter(Boolean);
7771
7797
  const include = children.length > 0 || filterable;
7772
- return include ? __spreadProps2(__spreadValues2({}, item), {
7798
+ return include ? __spreadProps(__spreadValues({}, item), {
7773
7799
  children
7774
7800
  }) : void 0;
7775
7801
  };
@@ -7851,7 +7877,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7851
7877
  params.filters = {};
7852
7878
  for (const key of facetKeys) {
7853
7879
  const parsedKey = key.slice(key.indexOf(FACET_KEY_SEPARATOR) + 1);
7854
- params.filters = __spreadProps2(__spreadValues2({}, params.filters), {
7880
+ params.filters = __spreadProps(__spreadValues({}, params.filters), {
7855
7881
  [parsedKey]: parseFacetKey(key, searchParams)
7856
7882
  });
7857
7883
  }
@@ -7864,7 +7890,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7864
7890
  const paramKeys = Array.from(searchParams.keys());
7865
7891
  const facetKeys = paramKeys.filter((k) => isFacetKey(k));
7866
7892
  const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
7867
- const r = __spreadValues2(__spreadValues2({
7893
+ const r = __spreadValues(__spreadValues({
7868
7894
  [QUERY_PARAMS_PARSED.QUERY]: ""
7869
7895
  }, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
7870
7896
  return r;
@@ -7914,7 +7940,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7914
7940
  const encoded = encodeURIComponent(param);
7915
7941
  return encoded.replace(/%C4%85/g, "ą").replace(/%C4%8D/g, "č").replace(/%C4%99/g, "ę").replace(/%C4%97/g, "ė").replace(/%C4%AF/g, "į").replace(/%C5%A1/g, "š").replace(/%C5%B3/g, "ų").replace(/%C5%AB/g, "ū").replace(/%C5%BE/g, "ž").replace(/%20/g, " ");
7916
7942
  };
7917
- const getQueryParam = (name) => {
7943
+ const getQueryParam$1 = (name) => {
7918
7944
  try {
7919
7945
  const urlParams = new URLSearchParams(window.location.search);
7920
7946
  return urlParams.get(name);
@@ -8054,7 +8080,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8054
8080
  const useRedirectionStore = defineStore("redirections", () => {
8055
8081
  const redirections = ref({ rules: [] });
8056
8082
  const redirectionOptions = ref({ enabled: false, queryKey: "" });
8057
- const saveToLocalStorage = () => {
8083
+ const saveToLocalStorage2 = () => {
8058
8084
  try {
8059
8085
  localStorage.setItem(
8060
8086
  CACHE_KEY,
@@ -8063,7 +8089,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8063
8089
  } catch (e2) {
8064
8090
  }
8065
8091
  };
8066
- const tryLoadFromLocalStorage = (config) => {
8092
+ const tryLoadFromLocalStorage2 = (config) => {
8067
8093
  var _a;
8068
8094
  if (!config.cacheSeconds)
8069
8095
  return false;
@@ -8086,7 +8112,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8086
8112
  if (!(config == null ? void 0 : config.enabled)) {
8087
8113
  return;
8088
8114
  }
8089
- const loaded = tryLoadFromLocalStorage(config);
8115
+ const loaded = tryLoadFromLocalStorage2(config);
8090
8116
  if (loaded || ((_c = (_b = redirections.value) == null ? void 0 : _b.rules) == null ? void 0 : _c.length) > 0) {
8091
8117
  return;
8092
8118
  }
@@ -8096,7 +8122,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8096
8122
  return;
8097
8123
  }
8098
8124
  redirections.value = result;
8099
- saveToLocalStorage();
8125
+ saveToLocalStorage2();
8100
8126
  } catch (e2) {
8101
8127
  }
8102
8128
  });
@@ -8222,12 +8248,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8222
8248
  return;
8223
8249
  }
8224
8250
  const forceFullReload = (_a = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a.some(
8225
- (p2) => getQueryParam(p2)
8251
+ (p2) => getQueryParam$1(p2)
8226
8252
  );
8227
8253
  if ((!searchResultsLink.value || linksMatch(searchResultsLink.value, window.location.pathname)) && !forceFullReload) {
8228
8254
  const singleFacetParam = facet ? getFacetParam(facet.key, [facet.title]) : void 0;
8229
8255
  const facetParam = singleFacetParam ? [
8230
- __spreadProps2(__spreadValues2({}, singleFacetParam), {
8256
+ __spreadProps(__spreadValues({}, singleFacetParam), {
8231
8257
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
8232
8258
  })
8233
8259
  ] : [];
@@ -8316,7 +8342,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8316
8342
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
8317
8343
  display: suggestion.suggestion,
8318
8344
  suggestion,
8319
- facet: __spreadValues2({
8345
+ facet: __spreadValues({
8320
8346
  key
8321
8347
  }, f2)
8322
8348
  }));
@@ -8423,14 +8449,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8423
8449
  const context = getLupaTrackingContext();
8424
8450
  const result = yield LupaSearchSdk.suggestions(
8425
8451
  queryKey,
8426
- __spreadValues2(__spreadValues2({}, publicQuery), context),
8452
+ __spreadValues(__spreadValues({}, publicQuery), context),
8427
8453
  options2
8428
8454
  );
8429
8455
  if (!result.success) {
8430
8456
  return { suggestions: void 0 };
8431
8457
  }
8432
8458
  highlightChange({ action: "clear" });
8433
- suggestionResults.value = __spreadProps2(__spreadValues2({}, suggestionResults.value), {
8459
+ suggestionResults.value = __spreadProps(__spreadValues({}, suggestionResults.value), {
8434
8460
  [queryKey]: flattenSuggestions(result.items, (_a = publicQuery.searchText) != null ? _a : "")
8435
8461
  });
8436
8462
  inputValue.value = publicQuery.searchText;
@@ -8467,12 +8493,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8467
8493
  }) {
8468
8494
  try {
8469
8495
  const context = getLupaTrackingContext();
8470
- const result = yield LupaSearchSdk.query(queryKey, __spreadValues2(__spreadValues2({}, publicQuery), context), options2);
8496
+ const result = yield LupaSearchSdk.query(queryKey, __spreadValues(__spreadValues({}, publicQuery), context), options2);
8471
8497
  if (!result.success) {
8472
8498
  return { queryKey, result: { items: [] } };
8473
8499
  }
8474
8500
  highlightChange({ action: "clear" });
8475
- docResults.value = __spreadProps2(__spreadValues2({}, docResults.value), { [queryKey]: result });
8501
+ docResults.value = __spreadProps(__spreadValues({}, docResults.value), { [queryKey]: result });
8476
8502
  emitSearchResultsCallback();
8477
8503
  return { queryKey, result };
8478
8504
  } catch (err) {
@@ -8519,7 +8545,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8519
8545
  resetHighlightIndex
8520
8546
  };
8521
8547
  });
8522
- const _hoisted_1$1f = { id: "lupa-search-box-input-container" };
8548
+ const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
8523
8549
  const _hoisted_2$R = { class: "lupa-input-clear" };
8524
8550
  const _hoisted_3$B = { id: "lupa-search-box-input" };
8525
8551
  const _hoisted_4$t = ["value"];
@@ -8574,7 +8600,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8574
8600
  );
8575
8601
  const inputAttributes = computed(() => {
8576
8602
  var _a;
8577
- return __spreadValues2({}, (_a = props.options.inputAttributes) != null ? _a : {});
8603
+ return __spreadValues({}, (_a = props.options.inputAttributes) != null ? _a : {});
8578
8604
  });
8579
8605
  const ariaLabel = computed(() => {
8580
8606
  var _a;
@@ -8616,7 +8642,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8616
8642
  };
8617
8643
  __expose({ focus });
8618
8644
  return (_ctx, _cache) => {
8619
- return openBlock(), createElementBlock("div", _hoisted_1$1f, [
8645
+ return openBlock(), createElementBlock("div", _hoisted_1$1d, [
8620
8646
  createBaseVNode("div", _hoisted_2$R, [
8621
8647
  createBaseVNode("div", {
8622
8648
  class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
@@ -8694,7 +8720,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8694
8720
  };
8695
8721
  }
8696
8722
  });
8697
- const _hoisted_1$1e = { class: "lupa-search-box-history-item" };
8723
+ const _hoisted_1$1c = { class: "lupa-search-box-history-item" };
8698
8724
  const _hoisted_2$Q = { class: "lupa-search-box-history-item-content" };
8699
8725
  const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8700
8726
  __name: "SearchBoxHistoryItem",
@@ -8712,7 +8738,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8712
8738
  emit2("click", { query: props.item });
8713
8739
  };
8714
8740
  return (_ctx, _cache) => {
8715
- return openBlock(), createElementBlock("div", _hoisted_1$1e, [
8741
+ return openBlock(), createElementBlock("div", _hoisted_1$1c, [
8716
8742
  createBaseVNode("div", _hoisted_2$Q, [
8717
8743
  createBaseVNode("div", {
8718
8744
  class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
@@ -8727,7 +8753,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8727
8753
  };
8728
8754
  }
8729
8755
  });
8730
- const _hoisted_1$1d = {
8756
+ const _hoisted_1$1b = {
8731
8757
  key: 0,
8732
8758
  class: "lupa-search-box-history-panel"
8733
8759
  };
@@ -8772,7 +8798,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8772
8798
  }
8773
8799
  };
8774
8800
  return (_ctx, _cache) => {
8775
- return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1d, [
8801
+ return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1b, [
8776
8802
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
8777
8803
  return openBlock(), createBlock(_sfc_main$1l, {
8778
8804
  key: item,
@@ -8790,7 +8816,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8790
8816
  };
8791
8817
  }
8792
8818
  });
8793
- const _hoisted_1$1c = { class: "lupa-search-box-no-results" };
8819
+ const _hoisted_1$1a = { class: "lupa-search-box-no-results" };
8794
8820
  const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8795
8821
  __name: "SearchBoxNoResults",
8796
8822
  props: {
@@ -8798,11 +8824,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8798
8824
  },
8799
8825
  setup(__props) {
8800
8826
  return (_ctx, _cache) => {
8801
- return openBlock(), createElementBlock("p", _hoisted_1$1c, toDisplayString(_ctx.labels.noResults), 1);
8827
+ return openBlock(), createElementBlock("p", _hoisted_1$1a, toDisplayString(_ctx.labels.noResults), 1);
8802
8828
  };
8803
8829
  }
8804
8830
  });
8805
- const _hoisted_1$1b = ["innerHTML"];
8831
+ const _hoisted_1$19 = ["innerHTML"];
8806
8832
  const _hoisted_2$P = {
8807
8833
  key: 1,
8808
8834
  "data-cy": "lupa-suggestion-value",
@@ -8857,7 +8883,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8857
8883
  class: "lupa-suggestion-value",
8858
8884
  "data-cy": "lupa-suggestion-value",
8859
8885
  innerHTML: _ctx.suggestion.displayHighlight
8860
- }, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8886
+ }, null, 8, _hoisted_1$19)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8861
8887
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8862
8888
  createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
8863
8889
  createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
@@ -8866,7 +8892,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8866
8892
  };
8867
8893
  }
8868
8894
  });
8869
- const _hoisted_1$1a = {
8895
+ const _hoisted_1$18 = {
8870
8896
  id: "lupa-search-box-suggestions",
8871
8897
  "data-cy": "lupa-search-box-suggestions"
8872
8898
  };
@@ -8930,7 +8956,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8930
8956
  });
8931
8957
  });
8932
8958
  return (_ctx, _cache) => {
8933
- return openBlock(), createElementBlock("div", _hoisted_1$1a, [
8959
+ return openBlock(), createElementBlock("div", _hoisted_1$18, [
8934
8960
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
8935
8961
  return openBlock(), createBlock(_sfc_main$1i, {
8936
8962
  key: getSuggestionKey(item),
@@ -9062,7 +9088,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9062
9088
  if (!requestedIds.length) {
9063
9089
  return;
9064
9090
  }
9065
- loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2]: true }), {});
9091
+ loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
9066
9092
  loading.value = true;
9067
9093
  try {
9068
9094
  const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
@@ -9072,10 +9098,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9072
9098
  const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
9073
9099
  const seed = {};
9074
9100
  const dynamicDataIdMapValue = dynamicDataResult.reduce(
9075
- (a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
9101
+ (a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
9076
9102
  seed
9077
9103
  );
9078
- dynamicDataIdMap.value = __spreadValues2(__spreadValues2({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9104
+ dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9079
9105
  } finally {
9080
9106
  loading.value = false;
9081
9107
  loadingIds.value = {};
@@ -9105,7 +9131,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9105
9131
  targetImage.src = placeholder;
9106
9132
  }
9107
9133
  };
9108
- const _hoisted_1$19 = ["src"];
9134
+ const _hoisted_1$17 = ["src"];
9109
9135
  const _sfc_main$1f = /* @__PURE__ */ defineComponent({
9110
9136
  __name: "ProductImage",
9111
9137
  props: {
@@ -9224,7 +9250,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9224
9250
  }, { alt: imageAlt.value ? imageAlt.value : void 0 }, {
9225
9251
  onError: replaceWithPlaceholder,
9226
9252
  key: finalUrl.value
9227
- }), null, 16, _hoisted_1$19))
9253
+ }), null, 16, _hoisted_1$17))
9228
9254
  ]),
9229
9255
  _: 1
9230
9256
  })
@@ -9249,7 +9275,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9249
9275
  };
9250
9276
  }
9251
9277
  });
9252
- const _hoisted_1$18 = ["innerHTML"];
9278
+ const _hoisted_1$16 = ["innerHTML"];
9253
9279
  const _hoisted_2$O = {
9254
9280
  key: 1,
9255
9281
  class: "lupa-search-box-product-title"
@@ -9274,13 +9300,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9274
9300
  key: 0,
9275
9301
  class: "lupa-search-box-product-title",
9276
9302
  innerHTML: title.value
9277
- }, null, 8, _hoisted_1$18)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9303
+ }, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9278
9304
  createBaseVNode("strong", null, toDisplayString(title.value), 1)
9279
9305
  ]));
9280
9306
  };
9281
9307
  }
9282
9308
  });
9283
- const _hoisted_1$17 = ["innerHTML"];
9309
+ const _hoisted_1$15 = ["innerHTML"];
9284
9310
  const _hoisted_2$N = {
9285
9311
  key: 1,
9286
9312
  class: "lupa-search-box-product-description"
@@ -9305,11 +9331,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9305
9331
  key: 0,
9306
9332
  class: "lupa-search-box-product-description",
9307
9333
  innerHTML: description.value
9308
- }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9334
+ }, null, 8, _hoisted_1$15)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9309
9335
  };
9310
9336
  }
9311
9337
  });
9312
- const _hoisted_1$16 = { class: "lupa-search-box-product-price" };
9338
+ const _hoisted_1$14 = { class: "lupa-search-box-product-price" };
9313
9339
  const _sfc_main$1b = /* @__PURE__ */ defineComponent({
9314
9340
  __name: "SearchBoxProductPrice",
9315
9341
  props: {
@@ -9328,13 +9354,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9328
9354
  );
9329
9355
  });
9330
9356
  return (_ctx, _cache) => {
9331
- return openBlock(), createElementBlock("div", _hoisted_1$16, [
9357
+ return openBlock(), createElementBlock("div", _hoisted_1$14, [
9332
9358
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
9333
9359
  ]);
9334
9360
  };
9335
9361
  }
9336
9362
  });
9337
- const _hoisted_1$15 = { class: "lupa-search-box-product-regular-price" };
9338
9363
  const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9339
9364
  __name: "SearchBoxProductRegularPrice",
9340
9365
  props: {
@@ -9344,6 +9369,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9344
9369
  },
9345
9370
  setup(__props) {
9346
9371
  const props = __props;
9372
+ const className = computed(() => {
9373
+ return props.options.className;
9374
+ });
9347
9375
  const price = computed(() => {
9348
9376
  var _a, _b;
9349
9377
  return formatPrice(
@@ -9353,11 +9381,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9353
9381
  );
9354
9382
  });
9355
9383
  return (_ctx, _cache) => {
9356
- return openBlock(), createElementBlock("div", _hoisted_1$15, toDisplayString(price.value), 1);
9384
+ return openBlock(), createElementBlock("div", {
9385
+ class: normalizeClass([className.value, "lupa-search-box-product-regular-price"])
9386
+ }, toDisplayString(price.value), 3);
9357
9387
  };
9358
9388
  }
9359
9389
  });
9360
- const _hoisted_1$14 = ["innerHTML"];
9390
+ const _hoisted_1$13 = ["innerHTML"];
9361
9391
  const _hoisted_2$M = { key: 0 };
9362
9392
  const _hoisted_3$z = { key: 1 };
9363
9393
  const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
@@ -9388,7 +9418,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9388
9418
  key: 0,
9389
9419
  class: [className.value, "lupa-search-box-product-custom"],
9390
9420
  innerHTML: text.value
9391
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$14)) : (openBlock(), createElementBlock("div", mergeProps({
9421
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13)) : (openBlock(), createElementBlock("div", mergeProps({
9392
9422
  key: 1,
9393
9423
  class: [className.value, "lupa-search-box-product-custom"]
9394
9424
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
@@ -9400,7 +9430,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9400
9430
  };
9401
9431
  }
9402
9432
  });
9403
- const _hoisted_1$13 = ["innerHTML"];
9433
+ const _hoisted_1$12 = ["innerHTML"];
9404
9434
  const _sfc_main$18 = /* @__PURE__ */ defineComponent({
9405
9435
  __name: "SearchBoxProductCustomHtml",
9406
9436
  props: {
@@ -9421,7 +9451,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9421
9451
  return openBlock(), createElementBlock("div", mergeProps({
9422
9452
  class: className.value,
9423
9453
  innerHTML: text.value
9424
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13);
9454
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$12);
9425
9455
  };
9426
9456
  }
9427
9457
  });
@@ -9541,17 +9571,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9541
9571
  return hasResults.value && ((_a = searchResult.value.offset) != null ? _a : 0) >= totalItems.value;
9542
9572
  }
9543
9573
  );
9544
- const setSidebarState = ({ visible }) => {
9545
- if (visible) {
9574
+ const setSidebarState = ({ visible: visible2 }) => {
9575
+ if (visible2) {
9546
9576
  disableBodyScroll();
9547
9577
  } else {
9548
9578
  enableBodyScroll();
9549
9579
  }
9550
- isMobileSidebarVisible.value = visible;
9580
+ isMobileSidebarVisible.value = visible2;
9551
9581
  };
9552
9582
  const queryFacet = (_0) => __async(void 0, [_0], function* ({ queryKey, facetKey }) {
9553
9583
  var _a, _b, _c, _d;
9554
- const query = { searchText: "", filters: __spreadValues2({}, filters.value) };
9584
+ const query = { searchText: "", filters: __spreadValues({}, filters.value) };
9555
9585
  const options = (_a = optionsStore.envOptions) != null ? _a : { environment: "production" };
9556
9586
  const result = yield LupaSearchSdk.query(queryKey, query, options);
9557
9587
  if (!result.success) {
@@ -9559,8 +9589,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9559
9589
  }
9560
9590
  const facet = (_b = result.facets) == null ? void 0 : _b.find((f2) => f2.key === facetKey);
9561
9591
  const facetItems = (_c = facet == null ? void 0 : facet.items) != null ? _c : [];
9562
- const updatedResult = __spreadProps2(__spreadValues2({}, searchResult.value), {
9563
- facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps2(__spreadValues2({}, f2), { items: facetItems }) : f2)
9592
+ const updatedResult = __spreadProps(__spreadValues({}, searchResult.value), {
9593
+ facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps(__spreadValues({}, f2), { items: facetItems }) : f2)
9564
9594
  });
9565
9595
  searchResult.value = updatedResult;
9566
9596
  });
@@ -9649,7 +9679,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9649
9679
  filterVisibleFilterValues
9650
9680
  };
9651
9681
  });
9652
- const _hoisted_1$12 = { class: "lupa-search-box-add-to-cart-wrapper" };
9682
+ const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
9653
9683
  const _hoisted_2$L = { class: "lupa-search-box-product-addtocart" };
9654
9684
  const _hoisted_3$y = ["onClick", "disabled"];
9655
9685
  const _sfc_main$17 = /* @__PURE__ */ defineComponent({
@@ -9679,7 +9709,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9679
9709
  loading.value = false;
9680
9710
  });
9681
9711
  return (_ctx, _cache) => {
9682
- return openBlock(), createElementBlock("div", _hoisted_1$12, [
9712
+ return openBlock(), createElementBlock("div", _hoisted_1$11, [
9683
9713
  createBaseVNode("div", _hoisted_2$L, [
9684
9714
  createBaseVNode("button", {
9685
9715
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
@@ -9693,7 +9723,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9693
9723
  };
9694
9724
  }
9695
9725
  });
9696
- const _hoisted_1$11 = {
9726
+ const _hoisted_1$10 = {
9697
9727
  key: 1,
9698
9728
  class: "lupa-search-box-element-badge-wrapper"
9699
9729
  };
@@ -9709,7 +9739,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9709
9739
  SearchBoxProductAddToCart: _sfc_main$17
9710
9740
  }
9711
9741
  };
9712
- const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$4), {
9742
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
9713
9743
  __name: "SearchBoxProductElement",
9714
9744
  props: {
9715
9745
  item: {},
@@ -9751,7 +9781,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9751
9781
  return props.item;
9752
9782
  }
9753
9783
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
9754
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
9784
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
9755
9785
  });
9756
9786
  const isLoadingDynamicData = (id) => {
9757
9787
  return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
@@ -9767,7 +9797,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9767
9797
  class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
9768
9798
  inStock: _ctx.isInStock
9769
9799
  }, null, 8, ["item", "options", "labels", "class", "inStock"])) : createCommentVNode("", true)
9770
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$11, [
9800
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$10, [
9771
9801
  displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
9772
9802
  key: 0,
9773
9803
  item: enhancedItem.value,
@@ -9781,7 +9811,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9781
9811
  };
9782
9812
  }
9783
9813
  }));
9784
- const _hoisted_1$10 = { class: "lupa-badge-title" };
9814
+ const _hoisted_1$$ = { class: "lupa-badge-title" };
9785
9815
  const _hoisted_2$K = ["src"];
9786
9816
  const _hoisted_3$x = { key: 1 };
9787
9817
  const _hoisted_4$q = {
@@ -9821,7 +9851,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9821
9851
  class: normalizeClass(["lupa-dynamic-badge", customClassName.value]),
9822
9852
  style: normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
9823
9853
  }, [
9824
- createBaseVNode("span", _hoisted_1$10, [
9854
+ createBaseVNode("span", _hoisted_1$$, [
9825
9855
  image.value ? (openBlock(), createElementBlock("img", {
9826
9856
  key: 0,
9827
9857
  src: image.value
@@ -9833,7 +9863,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9833
9863
  };
9834
9864
  }
9835
9865
  });
9836
- const _hoisted_1$$ = { class: "lupa-generated-badges" };
9866
+ const _hoisted_1$_ = { class: "lupa-generated-badges" };
9837
9867
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9838
9868
  __name: "SearchResultGeneratedBadges",
9839
9869
  props: {
@@ -9860,7 +9890,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9860
9890
  })).filter((b) => Boolean(b.id));
9861
9891
  });
9862
9892
  return (_ctx, _cache) => {
9863
- return openBlock(), createElementBlock("div", _hoisted_1$$, [
9893
+ return openBlock(), createElementBlock("div", _hoisted_1$_, [
9864
9894
  (openBlock(true), createElementBlock(Fragment, null, renderList(badges.value, (badge) => {
9865
9895
  return openBlock(), createBlock(_sfc_main$15, {
9866
9896
  key: badge.id,
@@ -9872,7 +9902,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9872
9902
  };
9873
9903
  }
9874
9904
  });
9875
- const _hoisted_1$_ = ["innerHTML"];
9905
+ const _hoisted_1$Z = ["innerHTML"];
9876
9906
  const _sfc_main$13 = /* @__PURE__ */ defineComponent({
9877
9907
  __name: "CustomBadge",
9878
9908
  props: {
@@ -9892,11 +9922,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9892
9922
  return openBlock(), createElementBlock("div", {
9893
9923
  class: normalizeClass(className.value),
9894
9924
  innerHTML: text.value
9895
- }, null, 10, _hoisted_1$_);
9925
+ }, null, 10, _hoisted_1$Z);
9896
9926
  };
9897
9927
  }
9898
9928
  });
9899
- const _hoisted_1$Z = { class: "lupa-text-badges" };
9929
+ const _hoisted_1$Y = { class: "lupa-text-badges" };
9900
9930
  const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9901
9931
  __name: "TextBadge",
9902
9932
  props: {
@@ -9912,7 +9942,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9912
9942
  return badges.value.slice(0, props.badge.maxItems);
9913
9943
  });
9914
9944
  return (_ctx, _cache) => {
9915
- return openBlock(), createElementBlock("div", _hoisted_1$Z, [
9945
+ return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9916
9946
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9917
9947
  return openBlock(), createElementBlock("div", {
9918
9948
  class: "lupa-badge lupa-text-badge",
@@ -9923,7 +9953,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9923
9953
  };
9924
9954
  }
9925
9955
  });
9926
- const _hoisted_1$Y = { class: "lupa-image-badges" };
9956
+ const _hoisted_1$X = { class: "lupa-image-badges" };
9927
9957
  const _hoisted_2$J = ["src"];
9928
9958
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9929
9959
  __name: "ImageBadge",
@@ -9945,7 +9975,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9945
9975
  return `${props.badge.rootImageUrl}${src}`;
9946
9976
  };
9947
9977
  return (_ctx, _cache) => {
9948
- return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9978
+ return openBlock(), createElementBlock("div", _hoisted_1$X, [
9949
9979
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9950
9980
  return openBlock(), createElementBlock("div", {
9951
9981
  class: "lupa-badge lupa-image-badge",
@@ -9960,7 +9990,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9960
9990
  };
9961
9991
  }
9962
9992
  });
9963
- const _hoisted_1$X = { id: "lupa-search-results-badges" };
9993
+ const _hoisted_1$W = { id: "lupa-search-results-badges" };
9964
9994
  const __default__$3 = {
9965
9995
  components: {
9966
9996
  CustomBadge: _sfc_main$13,
@@ -9968,7 +9998,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9968
9998
  ImageBadge: _sfc_main$11
9969
9999
  }
9970
10000
  };
9971
- const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$3), {
10001
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
9972
10002
  __name: "SearchResultsBadgeWrapper",
9973
10003
  props: {
9974
10004
  position: {},
@@ -9991,7 +10021,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9991
10021
  return props.options.product;
9992
10022
  }
9993
10023
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.options.product) == null ? void 0 : _b.id]) != null ? _d : {};
9994
- return __spreadValues2(__spreadValues2({}, props.options.product), enhancementData);
10024
+ return __spreadValues(__spreadValues({}, props.options.product), enhancementData);
9995
10025
  });
9996
10026
  const badges = computed(() => {
9997
10027
  if (!props.options.elements) {
@@ -10002,7 +10032,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10002
10032
  return !e2.display || e2.display((_a = props.options.product) != null ? _a : {});
10003
10033
  }).map((x) => {
10004
10034
  var _a;
10005
- return __spreadProps2(__spreadValues2({}, x), {
10035
+ return __spreadProps(__spreadValues({}, x), {
10006
10036
  value: ((_a = enhancedProduct.value) == null ? void 0 : _a[x.key]) || "badge",
10007
10037
  product: enhancedProduct.value
10008
10038
  });
@@ -10024,7 +10054,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10024
10054
  }
10025
10055
  };
10026
10056
  return (_ctx, _cache) => {
10027
- return openBlock(), createElementBlock("div", _hoisted_1$X, [
10057
+ return openBlock(), createElementBlock("div", _hoisted_1$W, [
10028
10058
  createBaseVNode("div", {
10029
10059
  id: "lupa-badges",
10030
10060
  class: normalizeClass(anchorPosition.value)
@@ -10044,7 +10074,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10044
10074
  };
10045
10075
  }
10046
10076
  }));
10047
- const _hoisted_1$W = ["href"];
10077
+ const _hoisted_1$V = ["href"];
10048
10078
  const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
10049
10079
  const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
10050
10080
  const _hoisted_4$p = {
@@ -10069,7 +10099,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10069
10099
  return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
10070
10100
  });
10071
10101
  const badgeOptions = computed(() => {
10072
- return __spreadProps2(__spreadValues2({}, props.panelOptions.badges), { product: props.item });
10102
+ return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
10073
10103
  });
10074
10104
  const imageElements = computed(() => {
10075
10105
  var _a, _b;
@@ -10156,7 +10186,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10156
10186
  isInStock: isInStock.value
10157
10187
  }, null, 8, ["item", "element", "labels", "link", "isInStock"])
10158
10188
  ])) : createCommentVNode("", true)
10159
- ], 16, _hoisted_1$W);
10189
+ ], 16, _hoisted_1$V);
10160
10190
  };
10161
10191
  }
10162
10192
  });
@@ -10208,8 +10238,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10208
10238
  const mappedItems = ((_e = trackingOptions.analytics) == null ? void 0 : _e.itemMap) ? items.map(trackingOptions.analytics.itemMap) : items;
10209
10239
  track(
10210
10240
  queryKey,
10211
- __spreadProps2(__spreadValues2({}, data), {
10212
- analytics: data.analytics ? __spreadProps2(__spreadValues2({}, data.analytics), { items: mappedItems }) : void 0,
10241
+ __spreadProps(__spreadValues({}, data), {
10242
+ analytics: data.analytics ? __spreadProps(__spreadValues({}, data.analytics), { items: mappedItems }) : void 0,
10213
10243
  filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
10214
10244
  }),
10215
10245
  options
@@ -10217,7 +10247,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10217
10247
  };
10218
10248
  return { trackSearch, trackResults, trackEvent };
10219
10249
  });
10220
- const _hoisted_1$V = { id: "lupa-search-box-products" };
10250
+ const _hoisted_1$U = { id: "lupa-search-box-products" };
10221
10251
  const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10222
10252
  __name: "SearchBoxProducts",
10223
10253
  props: {
@@ -10279,7 +10309,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10279
10309
  handleRoutingEvent(link, event, boxRoutingBehavior.value === "event");
10280
10310
  };
10281
10311
  return (_ctx, _cache) => {
10282
- return openBlock(), createElementBlock("div", _hoisted_1$V, [
10312
+ return openBlock(), createElementBlock("div", _hoisted_1$U, [
10283
10313
  _ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.items, (item, index) => {
10284
10314
  return renderSlot(_ctx.$slots, "productCard", {
10285
10315
  key: index,
@@ -10306,7 +10336,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10306
10336
  };
10307
10337
  }
10308
10338
  });
10309
- const _hoisted_1$U = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10339
+ const _hoisted_1$T = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10310
10340
  const _hoisted_2$H = { key: 0 };
10311
10341
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10312
10342
  __name: "SearchBoxProductsGoToResultsButton",
@@ -10338,7 +10368,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10338
10368
  emit2("goToResults");
10339
10369
  };
10340
10370
  return (_ctx, _cache) => {
10341
- return openBlock(), createElementBlock("div", _hoisted_1$U, [
10371
+ return openBlock(), createElementBlock("div", _hoisted_1$T, [
10342
10372
  createBaseVNode("button", {
10343
10373
  class: "lupa-search-box-documents-go-to-results-button",
10344
10374
  onClick: goToResults
@@ -10503,7 +10533,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10503
10533
  });
10504
10534
  const getItemsDebounced = debounce$1(getItems, props.debounce);
10505
10535
  const documentPanelOptions = computed(() => {
10506
- return __spreadProps2(__spreadValues2({}, props.panel), {
10536
+ return __spreadProps(__spreadValues({}, props.panel), {
10507
10537
  type: SearchBoxPanelType.DOCUMENT
10508
10538
  });
10509
10539
  });
@@ -10527,7 +10557,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10527
10557
  };
10528
10558
  }
10529
10559
  });
10530
- const _hoisted_1$T = {
10560
+ const _hoisted_1$S = {
10531
10561
  key: 0,
10532
10562
  id: "lupa-search-box-panel"
10533
10563
  };
@@ -10551,7 +10581,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10551
10581
  SearchBoxRelatedSourceWrapper: _sfc_main$X
10552
10582
  }
10553
10583
  };
10554
- const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$2), {
10584
+ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
10555
10585
  __name: "SearchBoxMainPanel",
10556
10586
  props: {
10557
10587
  options: {},
@@ -10697,7 +10727,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10697
10727
  ref_key: "panelContainer",
10698
10728
  ref: panelContainer
10699
10729
  }, [
10700
- displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$T, [
10730
+ displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$S, [
10701
10731
  labels.value.closePanel ? (openBlock(), createElementBlock("a", {
10702
10732
  key: 0,
10703
10733
  class: "lupa-search-box-close-panel",
@@ -10780,7 +10810,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10780
10810
  const elements = getElements(triggers);
10781
10811
  elements.forEach((e2) => e2 == null ? void 0 : e2.removeEventListener(BIND_EVENT, event));
10782
10812
  };
10783
- const _hoisted_1$S = { id: "lupa-search-box" };
10813
+ const _hoisted_1$R = { id: "lupa-search-box" };
10784
10814
  const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
10785
10815
  const _sfc_main$V = /* @__PURE__ */ defineComponent({
10786
10816
  __name: "SearchBox",
@@ -10863,7 +10893,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10863
10893
  const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
10864
10894
  const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
10865
10895
  const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
10866
- if (!isOutsideElement) {
10896
+ if (!isOutsideElement || props.options.keepOpen) {
10867
10897
  return;
10868
10898
  }
10869
10899
  opened.value = false;
@@ -10882,7 +10912,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10882
10912
  case "Tab":
10883
10913
  if ((_b = (_a2 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a2.item) == null ? void 0 : _b.suggestion) {
10884
10914
  e2.preventDefault();
10885
- selectSuggestion(__spreadProps2(__spreadValues2({}, suggestedValue.value), { override: true }));
10915
+ selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
10886
10916
  }
10887
10917
  break;
10888
10918
  case "Enter":
@@ -10897,6 +10927,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10897
10927
  opened.value = true;
10898
10928
  inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
10899
10929
  suggestedValue.value = defaultSuggestedValue;
10930
+ searchBoxStore.resetHighlightIndex();
10900
10931
  trackSearchQuery(value);
10901
10932
  if (props.isSearchContainer) {
10902
10933
  goToResultsDebounced({
@@ -10931,7 +10962,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10931
10962
  };
10932
10963
  const selectSuggestion = (inputSuggestion, shouldSearch = false) => {
10933
10964
  if (inputSuggestion.item.suggestion) {
10934
- suggestedValue.value = __spreadProps2(__spreadValues2({}, inputSuggestion), {
10965
+ suggestedValue.value = __spreadProps(__spreadValues({}, inputSuggestion), {
10935
10966
  override: true
10936
10967
  });
10937
10968
  if (inputSuggestion.override) {
@@ -11029,11 +11060,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11029
11060
  opened.value = false;
11030
11061
  };
11031
11062
  const slotProps = (props2) => {
11032
- return __spreadValues2({}, props2);
11063
+ return __spreadValues({}, props2);
11033
11064
  };
11034
11065
  return (_ctx, _cache) => {
11035
11066
  var _a2;
11036
- return openBlock(), createElementBlock("div", _hoisted_1$S, [
11067
+ return openBlock(), createElementBlock("div", _hoisted_1$R, [
11037
11068
  createBaseVNode("div", _hoisted_2$F, [
11038
11069
  createVNode(_sfc_main$1n, {
11039
11070
  options: inputOptions.value,
@@ -11117,8 +11148,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11117
11148
  return (page - 1) * limit;
11118
11149
  };
11119
11150
  const getPublicQuery = (publicQuery, initialFilters, isProductList) => {
11120
- return __spreadProps2(__spreadValues2({}, publicQuery), {
11121
- filters: __spreadValues2(__spreadValues2({}, initialFilters), publicQuery.filters),
11151
+ return __spreadProps(__spreadValues({}, publicQuery), {
11152
+ filters: __spreadValues(__spreadValues({}, initialFilters), publicQuery.filters),
11122
11153
  searchText: isProductList ? "" : publicQuery.searchText
11123
11154
  });
11124
11155
  };
@@ -11135,7 +11166,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11135
11166
  }
11136
11167
  return searchParams;
11137
11168
  };
11138
- const _hoisted_1$R = {
11169
+ const _hoisted_1$Q = {
11139
11170
  key: 0,
11140
11171
  id: "lupa-search-results-did-you-mean"
11141
11172
  };
@@ -11180,7 +11211,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11180
11211
  paramStore.goToResults({ searchText, facet });
11181
11212
  };
11182
11213
  return (_ctx, _cache) => {
11183
- return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
11214
+ return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11184
11215
  unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
11185
11216
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
11186
11217
  return openBlock(), createElementBlock("span", { key: index }, [
@@ -11206,7 +11237,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11206
11237
  };
11207
11238
  }
11208
11239
  });
11209
- const _hoisted_1$Q = {
11240
+ const _hoisted_1$P = {
11210
11241
  key: 0,
11211
11242
  class: "lupa-search-results-summary"
11212
11243
  };
@@ -11226,7 +11257,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11226
11257
  return addParamsToLabel(props.label, range, `<span>${totalItems.value}</span>`);
11227
11258
  });
11228
11259
  return (_ctx, _cache) => {
11229
- return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11260
+ return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
11230
11261
  createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
11231
11262
  _ctx.clearable ? (openBlock(), createElementBlock("span", {
11232
11263
  key: 0,
@@ -11238,7 +11269,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11238
11269
  };
11239
11270
  }
11240
11271
  });
11241
- const _hoisted_1$P = {
11272
+ const _hoisted_1$O = {
11242
11273
  key: 0,
11243
11274
  class: "lupa-result-page-title",
11244
11275
  "data-cy": "lupa-result-page-title"
@@ -11289,7 +11320,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11289
11320
  });
11290
11321
  return (_ctx, _cache) => {
11291
11322
  return openBlock(), createElementBlock("div", null, [
11292
- showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
11323
+ showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$O, [
11293
11324
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
11294
11325
  queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
11295
11326
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
@@ -11311,7 +11342,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11311
11342
  };
11312
11343
  }
11313
11344
  });
11314
- const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
11345
+ const _hoisted_1$N = { class: "lupa-search-result-filter-value" };
11315
11346
  const _hoisted_2$B = {
11316
11347
  class: "lupa-current-filter-label",
11317
11348
  "data-cy": "lupa-current-filter-label"
@@ -11332,7 +11363,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11332
11363
  emit2("remove", { filter: props.filter });
11333
11364
  };
11334
11365
  return (_ctx, _cache) => {
11335
- return openBlock(), createElementBlock("div", _hoisted_1$O, [
11366
+ return openBlock(), createElementBlock("div", _hoisted_1$N, [
11336
11367
  createBaseVNode("div", {
11337
11368
  class: "lupa-current-filter-action",
11338
11369
  onClick: handleClick
@@ -11343,7 +11374,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11343
11374
  };
11344
11375
  }
11345
11376
  });
11346
- const _hoisted_1$N = { class: "lupa-filter-title-text" };
11377
+ const _hoisted_1$M = { class: "lupa-filter-title-text" };
11347
11378
  const _hoisted_2$A = {
11348
11379
  key: 0,
11349
11380
  class: "lupa-filter-count"
@@ -11426,7 +11457,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11426
11457
  class: "lupa-current-filter-title",
11427
11458
  onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
11428
11459
  }, [
11429
- createBaseVNode("div", _hoisted_1$N, [
11460
+ createBaseVNode("div", _hoisted_1$M, [
11430
11461
  createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
11431
11462
  _ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
11432
11463
  ]),
@@ -11455,7 +11486,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11455
11486
  };
11456
11487
  }
11457
11488
  });
11458
- const _hoisted_1$M = ["href"];
11489
+ const _hoisted_1$L = ["href"];
11459
11490
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
11460
11491
  __name: "CategoryFilterItem",
11461
11492
  props: {
@@ -11493,12 +11524,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11493
11524
  "data-cy": "lupa-child-category-item",
11494
11525
  href: urlLink.value,
11495
11526
  onClick: handleNavigation
11496
- }, toDisplayString(title.value), 9, _hoisted_1$M)
11527
+ }, toDisplayString(title.value), 9, _hoisted_1$L)
11497
11528
  ], 2);
11498
11529
  };
11499
11530
  }
11500
11531
  });
11501
- const _hoisted_1$L = {
11532
+ const _hoisted_1$K = {
11502
11533
  class: "lupa-category-filter",
11503
11534
  "data-cy": "lupa-category-filter"
11504
11535
  };
@@ -11592,7 +11623,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11592
11623
  };
11593
11624
  __expose({ fetch: fetch2 });
11594
11625
  return (_ctx, _cache) => {
11595
- return openBlock(), createElementBlock("div", _hoisted_1$L, [
11626
+ return openBlock(), createElementBlock("div", _hoisted_1$K, [
11596
11627
  createBaseVNode("div", _hoisted_2$z, [
11597
11628
  hasBackButton.value ? (openBlock(), createElementBlock("a", {
11598
11629
  key: 0,
@@ -11624,7 +11655,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11624
11655
  };
11625
11656
  }
11626
11657
  });
11627
- const _hoisted_1$K = {
11658
+ const _hoisted_1$J = {
11628
11659
  class: "lupa-search-result-facet-term-values",
11629
11660
  "data-cy": "lupa-search-result-facet-term-values"
11630
11661
  };
@@ -11669,7 +11700,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11669
11700
  return searchResultStore.filterVisibleFilterValues(facet.value.key, (_b = (_a = facet.value) == null ? void 0 : _a.items) != null ? _b : []);
11670
11701
  });
11671
11702
  const displayValues = computed(() => {
11672
- return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps2(__spreadValues2({}, v), { title: getDisplayValue(v.title) }));
11703
+ return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps(__spreadValues({}, v), { title: getDisplayValue(v.title) }));
11673
11704
  });
11674
11705
  const filteredValues = computed(() => {
11675
11706
  var _a, _b;
@@ -11711,7 +11742,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11711
11742
  return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
11712
11743
  };
11713
11744
  return (_ctx, _cache) => {
11714
- return openBlock(), createElementBlock("div", _hoisted_1$K, [
11745
+ return openBlock(), createElementBlock("div", _hoisted_1$J, [
11715
11746
  isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
11716
11747
  key: 0,
11717
11748
  class: "lupa-term-filter",
@@ -12610,7 +12641,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12610
12641
  return e3 === r[t2];
12611
12642
  });
12612
12643
  }
12613
- var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps2(__spreadValues2({}, { value: { validator: function(e2) {
12644
+ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps(__spreadValues({}, { value: { validator: function(e2) {
12614
12645
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
12615
12646
  }, required: false }, modelValue: { validator: function(e2) {
12616
12647
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
@@ -12623,15 +12654,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12623
12654
  throw new Error("Slider v-model must not be an empty array");
12624
12655
  return { value: l2, initialValue: c3 };
12625
12656
  }(a), c2 = function(t, i, n) {
12626
- const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() => __spreadValues2({ target: "slider-target", focused: "slider-focused", tooltipFocus: "slider-tooltip-focus", tooltipDrag: "slider-tooltip-drag", ltr: "slider-ltr", rtl: "slider-rtl", horizontal: "slider-horizontal", vertical: "slider-vertical", textDirectionRtl: "slider-txt-dir-rtl", textDirectionLtr: "slider-txt-dir-ltr", base: "slider-base", connects: "slider-connects", connect: "slider-connect", origin: "slider-origin", handle: "slider-handle", handleLower: "slider-handle-lower", handleUpper: "slider-handle-upper", touchArea: "slider-touch-area", tooltip: "slider-tooltip", tooltipTop: "slider-tooltip-top", tooltipBottom: "slider-tooltip-bottom", tooltipLeft: "slider-tooltip-left", tooltipRight: "slider-tooltip-right", tooltipHidden: "slider-tooltip-hidden", active: "slider-active", draggable: "slider-draggable", tap: "slider-state-tap", drag: "slider-state-drag", pips: "slider-pips", pipsHorizontal: "slider-pips-horizontal", pipsVertical: "slider-pips-vertical", marker: "slider-marker", markerHorizontal: "slider-marker-horizontal", markerVertical: "slider-marker-vertical", markerNormal: "slider-marker-normal", markerLarge: "slider-marker-large", markerSub: "slider-marker-sub", value: "slider-value", valueHorizontal: "slider-value-horizontal", valueVertical: "slider-value-vertical", valueNormal: "slider-value-normal", valueLarge: "slider-value-large", valueSub: "slider-value-sub" }, o.value));
12657
+ const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() => __spreadValues({ target: "slider-target", focused: "slider-focused", tooltipFocus: "slider-tooltip-focus", tooltipDrag: "slider-tooltip-drag", ltr: "slider-ltr", rtl: "slider-rtl", horizontal: "slider-horizontal", vertical: "slider-vertical", textDirectionRtl: "slider-txt-dir-rtl", textDirectionLtr: "slider-txt-dir-ltr", base: "slider-base", connects: "slider-connects", connect: "slider-connect", origin: "slider-origin", handle: "slider-handle", handleLower: "slider-handle-lower", handleUpper: "slider-handle-upper", touchArea: "slider-touch-area", tooltip: "slider-tooltip", tooltipTop: "slider-tooltip-top", tooltipBottom: "slider-tooltip-bottom", tooltipLeft: "slider-tooltip-left", tooltipRight: "slider-tooltip-right", tooltipHidden: "slider-tooltip-hidden", active: "slider-active", draggable: "slider-draggable", tap: "slider-state-tap", drag: "slider-state-drag", pips: "slider-pips", pipsHorizontal: "slider-pips-horizontal", pipsVertical: "slider-pips-vertical", marker: "slider-marker", markerHorizontal: "slider-marker-horizontal", markerVertical: "slider-marker-vertical", markerNormal: "slider-marker-normal", markerLarge: "slider-marker-large", markerSub: "slider-marker-sub", value: "slider-value", valueHorizontal: "slider-value-horizontal", valueVertical: "slider-value-vertical", valueNormal: "slider-value-normal", valueLarge: "slider-value-large", valueSub: "slider-value-sub" }, o.value));
12627
12658
  return { classList: computed(() => {
12628
- const e2 = __spreadValues2({}, u2.value);
12659
+ const e2 = __spreadValues({}, u2.value);
12629
12660
  return Object.keys(e2).forEach((t2) => {
12630
12661
  e2[t2] = Array.isArray(e2[t2]) ? e2[t2].filter((e3) => null !== e3).join(" ") : e2[t2];
12631
12662
  }), "always" !== a2.value && (e2.target += ` ${"drag" === a2.value ? e2.tooltipDrag : e2.tooltipFocus}`), "horizontal" === l2.value && (e2.tooltip += "bottom" === s2.value ? ` ${e2.tooltipBottom}` : ` ${e2.tooltipTop}`), "vertical" === l2.value && (e2.tooltip += "right" === s2.value ? ` ${e2.tooltipRight}` : ` ${e2.tooltipLeft}`), e2;
12632
12663
  }) };
12633
12664
  }(a), p2 = function(t, i, n) {
12634
- const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(__spreadValues2({}, o.value)) : d({ decimals: a2.value >= 0 ? 0 : 2 })), c3 = computed(() => Array.isArray(s2.value) ? s2.value.map((e2) => u2.value) : u2.value);
12665
+ const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(__spreadValues({}, o.value)) : d({ decimals: a2.value >= 0 ? 0 : 2 })), c3 = computed(() => Array.isArray(s2.value) ? s2.value.map((e2) => u2.value) : u2.value);
12635
12666
  return { tooltipFormat: u2, tooltipsFormat: c3, tooltipsMerge: (e2, t2, r) => {
12636
12667
  var i2 = "rtl" === getComputedStyle(e2).direction, n2 = "rtl" === e2.noUiSlider.options.direction, o2 = "vertical" === e2.noUiSlider.options.orientation, a3 = e2.noUiSlider.getTooltips(), s3 = e2.noUiSlider.getOrigins();
12637
12668
  a3.forEach(function(e3, t3) {
@@ -12724,12 +12755,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12724
12755
  R(V.value);
12725
12756
  } };
12726
12757
  }(a, s, { value: l.value, initialValue: l.initialValue, tooltipFormat: p2.tooltipFormat, tooltipsFormat: p2.tooltipsFormat, tooltipsMerge: p2.tooltipsMerge, classList: c2.classList });
12727
- return __spreadValues2(__spreadValues2(__spreadValues2({}, c2), p2), m2);
12758
+ return __spreadValues(__spreadValues(__spreadValues({}, c2), p2), m2);
12728
12759
  } };
12729
12760
  m.render = function(e2, t, r, i, n, o) {
12730
12761
  return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
12731
12762
  }, m.__file = "src/Slider.vue";
12732
- const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
12763
+ const _hoisted_1$I = { class: "lupa-search-result-facet-stats-values" };
12733
12764
  const _hoisted_2$x = {
12734
12765
  key: 0,
12735
12766
  class: "lupa-stats-facet-summary"
@@ -12930,7 +12961,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12930
12961
  innerSliderRange.value = value;
12931
12962
  };
12932
12963
  return (_ctx, _cache) => {
12933
- return openBlock(), createElementBlock("div", _hoisted_1$J, [
12964
+ return openBlock(), createElementBlock("div", _hoisted_1$I, [
12934
12965
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
12935
12966
  createBaseVNode("div", null, [
12936
12967
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
@@ -12997,7 +13028,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12997
13028
  };
12998
13029
  }
12999
13030
  });
13000
- const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
13031
+ const _hoisted_1$H = { class: "lupa-term-checkbox-wrapper" };
13001
13032
  const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
13002
13033
  const _hoisted_3$n = { class: "lupa-term-label" };
13003
13034
  const _hoisted_4$h = {
@@ -13054,7 +13085,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13054
13085
  "data-cy": "lupa-facet-term",
13055
13086
  onClick: _cache[0] || (_cache[0] = ($event) => handleFacetClick(_ctx.item))
13056
13087
  }, [
13057
- createBaseVNode("div", _hoisted_1$I, [
13088
+ createBaseVNode("div", _hoisted_1$H, [
13058
13089
  createBaseVNode("span", {
13059
13090
  class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
13060
13091
  }, null, 2)
@@ -13080,7 +13111,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13080
13111
  };
13081
13112
  }
13082
13113
  });
13083
- const _hoisted_1$H = {
13114
+ const _hoisted_1$G = {
13084
13115
  class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
13085
13116
  "data-cy": "lupa-search-result-facet-term-values"
13086
13117
  };
@@ -13136,7 +13167,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13136
13167
  showAll.value = true;
13137
13168
  };
13138
13169
  return (_ctx, _cache) => {
13139
- return openBlock(), createElementBlock("div", _hoisted_1$H, [
13170
+ return openBlock(), createElementBlock("div", _hoisted_1$G, [
13140
13171
  isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
13141
13172
  withDirectives(createBaseVNode("input", {
13142
13173
  class: "lupa-term-filter",
@@ -13168,7 +13199,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13168
13199
  };
13169
13200
  }
13170
13201
  });
13171
- const _hoisted_1$G = { class: "lupa-facet-label-text" };
13202
+ const _hoisted_1$F = { class: "lupa-facet-label-text" };
13172
13203
  const _hoisted_2$u = {
13173
13204
  key: 0,
13174
13205
  class: "lupa-facet-content",
@@ -13181,7 +13212,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13181
13212
  HierarchyFacet: _sfc_main$K
13182
13213
  }
13183
13214
  };
13184
- const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
13215
+ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
13185
13216
  __name: "FacetDisplay",
13186
13217
  props: {
13187
13218
  options: {},
@@ -13293,7 +13324,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13293
13324
  "data-cy": "lupa-search-result-facet-label",
13294
13325
  onClick: toggleFacet
13295
13326
  }, [
13296
- createBaseVNode("div", _hoisted_1$G, toDisplayString(facet.value.label), 1),
13327
+ createBaseVNode("div", _hoisted_1$F, toDisplayString(facet.value.label), 1),
13297
13328
  createBaseVNode("div", {
13298
13329
  class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
13299
13330
  }, null, 2)
@@ -13316,7 +13347,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13316
13347
  };
13317
13348
  }
13318
13349
  }));
13319
- const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
13350
+ const _hoisted_1$E = { class: "lupa-search-result-facet-section" };
13320
13351
  const _hoisted_2$t = {
13321
13352
  key: 0,
13322
13353
  class: "lupa-facets-title"
@@ -13355,7 +13386,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13355
13386
  };
13356
13387
  return (_ctx, _cache) => {
13357
13388
  var _a;
13358
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
13389
+ return openBlock(), createElementBlock("div", _hoisted_1$E, [
13359
13390
  _ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
13360
13391
  createBaseVNode("div", {
13361
13392
  class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
@@ -13377,7 +13408,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13377
13408
  };
13378
13409
  }
13379
13410
  });
13380
- const _hoisted_1$E = ["onClick"];
13411
+ const _hoisted_1$D = ["onClick"];
13381
13412
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
13382
13413
  __name: "FacetsButton",
13383
13414
  props: {
@@ -13398,11 +13429,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13398
13429
  key: 0,
13399
13430
  class: "lupa-facets-button-filter",
13400
13431
  onClick: withModifiers(handleClick, ["stop"])
13401
- }, toDisplayString(label.value), 9, _hoisted_1$E)) : createCommentVNode("", true);
13432
+ }, toDisplayString(label.value), 9, _hoisted_1$D)) : createCommentVNode("", true);
13402
13433
  };
13403
13434
  }
13404
13435
  });
13405
- const _hoisted_1$D = { class: "lupa-search-result-facets" };
13436
+ const _hoisted_1$C = { class: "lupa-search-result-facets" };
13406
13437
  const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
13407
13438
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
13408
13439
  __name: "Facets",
@@ -13487,7 +13518,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13487
13518
  emit2("filter");
13488
13519
  };
13489
13520
  return (_ctx, _cache) => {
13490
- return openBlock(), createElementBlock("div", _hoisted_1$D, [
13521
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
13491
13522
  regularFacets.value ? (openBlock(), createBlock(_sfc_main$I, {
13492
13523
  key: 0,
13493
13524
  options: _ctx.options,
@@ -13509,7 +13540,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13509
13540
  };
13510
13541
  }
13511
13542
  });
13512
- const _hoisted_1$C = {
13543
+ const _hoisted_1$B = {
13513
13544
  id: "lupa-search-result-filters",
13514
13545
  class: "lupa-search-result-filters"
13515
13546
  };
@@ -13546,7 +13577,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13546
13577
  __expose({ fetch: fetch2 });
13547
13578
  return (_ctx, _cache) => {
13548
13579
  var _a;
13549
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
13580
+ return openBlock(), createElementBlock("div", _hoisted_1$B, [
13550
13581
  showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$Q, {
13551
13582
  key: 0,
13552
13583
  options: _ctx.options.currentFilters,
@@ -13567,7 +13598,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13567
13598
  };
13568
13599
  }
13569
13600
  });
13570
- const _hoisted_1$B = {
13601
+ const _hoisted_1$A = {
13571
13602
  key: 0,
13572
13603
  class: "lupa-mobile-filter-sidebar"
13573
13604
  };
@@ -13611,7 +13642,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13611
13642
  handleMobileToggle();
13612
13643
  };
13613
13644
  return (_ctx, _cache) => {
13614
- return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
13645
+ return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
13615
13646
  createBaseVNode("div", {
13616
13647
  class: "lupa-sidebar-close",
13617
13648
  onClick: withModifiers(handleMobileToggle, ["stop"])
@@ -13639,7 +13670,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13639
13670
  };
13640
13671
  }
13641
13672
  });
13642
- const _hoisted_1$A = { id: "lupa-search-results-breadcrumbs" };
13673
+ const _hoisted_1$z = { id: "lupa-search-results-breadcrumbs" };
13643
13674
  const _hoisted_2$q = ["href", "onClick"];
13644
13675
  const _hoisted_3$k = {
13645
13676
  key: 1,
@@ -13671,7 +13702,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13671
13702
  handleRoutingEvent(link, event, hasEventRouting.value);
13672
13703
  };
13673
13704
  return (_ctx, _cache) => {
13674
- return openBlock(), createElementBlock("div", _hoisted_1$A, [
13705
+ return openBlock(), createElementBlock("div", _hoisted_1$z, [
13675
13706
  (openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbsValue.value, (breadcrumb, index) => {
13676
13707
  return openBlock(), createElementBlock("span", {
13677
13708
  class: "lupa-search-results-breadcrumb",
@@ -13693,9 +13724,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13693
13724
  };
13694
13725
  }
13695
13726
  });
13696
- const _hoisted_1$z = {
13727
+ const _hoisted_1$y = {
13697
13728
  id: "lupa-search-result-filters",
13698
- class: "lupa-search-result-filters"
13729
+ class: "lupa-search-result-filters lupa-search-result-top-filters"
13699
13730
  };
13700
13731
  const _sfc_main$C = /* @__PURE__ */ defineComponent({
13701
13732
  __name: "FiltersTopDropdown",
@@ -13709,7 +13740,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13709
13740
  };
13710
13741
  return (_ctx, _cache) => {
13711
13742
  var _a;
13712
- return openBlock(), createElementBlock("div", _hoisted_1$z, [
13743
+ return openBlock(), createElementBlock("div", _hoisted_1$y, [
13713
13744
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$G, {
13714
13745
  key: 0,
13715
13746
  options: _ctx.options.facets,
@@ -13721,7 +13752,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13721
13752
  };
13722
13753
  }
13723
13754
  });
13724
- const _hoisted_1$y = { id: "lupa-search-results-layout-selection" };
13755
+ const _hoisted_1$x = { id: "lupa-search-results-layout-selection" };
13725
13756
  const _sfc_main$B = /* @__PURE__ */ defineComponent({
13726
13757
  __name: "SearchResultsLayoutSelection",
13727
13758
  setup(__props) {
@@ -13733,7 +13764,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13733
13764
  searchResultStore.setLayout(layout2);
13734
13765
  };
13735
13766
  return (_ctx, _cache) => {
13736
- return openBlock(), createElementBlock("div", _hoisted_1$y, [
13767
+ return openBlock(), createElementBlock("div", _hoisted_1$x, [
13737
13768
  createBaseVNode("div", {
13738
13769
  class: normalizeClass([
13739
13770
  "lupa-layout-selection-grid",
@@ -13755,7 +13786,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13755
13786
  };
13756
13787
  }
13757
13788
  });
13758
- const _hoisted_1$x = {
13789
+ const _hoisted_1$w = {
13759
13790
  key: 0,
13760
13791
  class: "lupa-mobile-toggle-filter-count"
13761
13792
  };
@@ -13777,12 +13808,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13777
13808
  onClick: handleMobileToggle
13778
13809
  }, [
13779
13810
  createTextVNode(toDisplayString(_ctx.label) + " ", 1),
13780
- _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$x, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13811
+ _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$w, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13781
13812
  ], 2);
13782
13813
  };
13783
13814
  }
13784
13815
  });
13785
- const _hoisted_1$w = {
13816
+ const _hoisted_1$v = {
13786
13817
  key: 0,
13787
13818
  id: "lupa-search-results-page-select",
13788
13819
  "data-cy": "lupa-search-results-page-select"
@@ -13873,7 +13904,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13873
13904
  }
13874
13905
  };
13875
13906
  return (_ctx, _cache) => {
13876
- return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
13907
+ return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
13877
13908
  showBack.value ? (openBlock(), createElementBlock("div", {
13878
13909
  key: 0,
13879
13910
  class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
@@ -13917,7 +13948,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13917
13948
  };
13918
13949
  }
13919
13950
  });
13920
- const _hoisted_1$v = {
13951
+ const _hoisted_1$u = {
13921
13952
  id: "lupa-search-results-page-size",
13922
13953
  "data-cy": "lupa-search-results-page-size"
13923
13954
  };
@@ -13944,6 +13975,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13944
13975
  var _a, _b;
13945
13976
  return (_b = (_a = props.labels) == null ? void 0 : _a.pageSize) != null ? _b : "";
13946
13977
  });
13978
+ const sizes = computed(() => props.options.sizes);
13947
13979
  const handleSelect = (e2) => {
13948
13980
  const value = e2.target.value;
13949
13981
  paramsStore.appendParams({
@@ -13952,7 +13984,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13952
13984
  });
13953
13985
  };
13954
13986
  return (_ctx, _cache) => {
13955
- return openBlock(), createElementBlock("div", _hoisted_1$v, [
13987
+ return openBlock(), createElementBlock("div", _hoisted_1$u, [
13956
13988
  createBaseVNode("div", _hoisted_2$o, [
13957
13989
  createBaseVNode("label", _hoisted_3$i, toDisplayString(label.value), 1),
13958
13990
  createBaseVNode("select", {
@@ -13963,7 +13995,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13963
13995
  ref_key: "select",
13964
13996
  ref: select
13965
13997
  }, [
13966
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options.sizes, (option) => {
13998
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sizes.value, (option) => {
13967
13999
  return openBlock(), createElementBlock("option", {
13968
14000
  key: option,
13969
14001
  value: option
@@ -13975,7 +14007,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13975
14007
  };
13976
14008
  }
13977
14009
  });
13978
- const _hoisted_1$u = {
14010
+ const _hoisted_1$t = {
13979
14011
  id: "lupa-search-results-sort",
13980
14012
  class: "lupa-search-results-sort"
13981
14013
  };
@@ -14032,7 +14064,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14032
14064
  previousKey.value = selectedKey.value;
14033
14065
  };
14034
14066
  return (_ctx, _cache) => {
14035
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
14067
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
14036
14068
  createBaseVNode("div", _hoisted_2$n, [
14037
14069
  createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.options.label), 1),
14038
14070
  withDirectives(createBaseVNode("select", {
@@ -14057,7 +14089,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14057
14089
  };
14058
14090
  }
14059
14091
  });
14060
- const _hoisted_1$t = { class: "lupa-toolbar-left" };
14092
+ const _hoisted_1$s = { class: "lupa-toolbar-left" };
14061
14093
  const _hoisted_2$m = {
14062
14094
  key: 0,
14063
14095
  class: "lupa-toolbar-right-title"
@@ -14179,7 +14211,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14179
14211
  id: "lupa-search-results-toolbar",
14180
14212
  class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
14181
14213
  }, [
14182
- createBaseVNode("div", _hoisted_1$t, [
14214
+ createBaseVNode("div", _hoisted_1$s, [
14183
14215
  toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
14184
14216
  showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$g)),
14185
14217
  showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
@@ -14233,7 +14265,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14233
14265
  };
14234
14266
  }
14235
14267
  });
14236
- const _hoisted_1$s = ["innerHTML"];
14268
+ const _hoisted_1$r = ["innerHTML"];
14237
14269
  const _hoisted_2$l = ["title"];
14238
14270
  const _hoisted_3$f = {
14239
14271
  key: 0,
@@ -14273,7 +14305,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14273
14305
  class: "lupa-search-results-product-title",
14274
14306
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14275
14307
  innerHTML: title.value
14276
- }, null, 12, _hoisted_1$s)) : (openBlock(), createElementBlock("div", {
14308
+ }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14277
14309
  key: 1,
14278
14310
  class: "lupa-search-results-product-title",
14279
14311
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
@@ -14290,7 +14322,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14290
14322
  };
14291
14323
  }
14292
14324
  });
14293
- const _hoisted_1$r = ["innerHTML"];
14325
+ const _hoisted_1$q = ["innerHTML"];
14294
14326
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
14295
14327
  __name: "SearchResultsProductDescription",
14296
14328
  props: {
@@ -14315,7 +14347,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14315
14347
  class: "lupa-search-results-product-description",
14316
14348
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14317
14349
  innerHTML: description.value
14318
- }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14350
+ }, null, 12, _hoisted_1$q)) : (openBlock(), createElementBlock("div", {
14319
14351
  key: 1,
14320
14352
  class: "lupa-search-results-product-description",
14321
14353
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`)
@@ -14323,7 +14355,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14323
14355
  };
14324
14356
  }
14325
14357
  });
14326
- const _hoisted_1$q = { id: "lupa-search-results-rating" };
14358
+ const _hoisted_1$p = { id: "lupa-search-results-rating" };
14327
14359
  const _hoisted_2$k = { class: "lupa-ratings" };
14328
14360
  const _hoisted_3$e = { class: "lupa-ratings-base" };
14329
14361
  const _hoisted_4$9 = ["innerHTML"];
@@ -14362,7 +14394,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14362
14394
  return generateLink(props.options.links.ratingDetails, props.item);
14363
14395
  });
14364
14396
  return (_ctx, _cache) => {
14365
- return openBlock(), createElementBlock("div", _hoisted_1$q, [
14397
+ return openBlock(), createElementBlock("div", _hoisted_1$p, [
14366
14398
  createBaseVNode("div", _hoisted_2$k, [
14367
14399
  createBaseVNode("div", _hoisted_3$e, [
14368
14400
  (openBlock(true), createElementBlock(Fragment, null, renderList(baseStars.value, (star, index) => {
@@ -14396,7 +14428,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14396
14428
  };
14397
14429
  }
14398
14430
  });
14399
- const _hoisted_1$p = {
14431
+ const _hoisted_1$o = {
14400
14432
  class: "lupa-search-results-product-regular-price",
14401
14433
  "data-cy": "lupa-search-results-product-regular-price"
14402
14434
  };
@@ -14418,14 +14450,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14418
14450
  );
14419
14451
  });
14420
14452
  return (_ctx, _cache) => {
14421
- return openBlock(), createElementBlock("div", _hoisted_1$p, toDisplayString(price.value), 1);
14453
+ return openBlock(), createElementBlock("div", _hoisted_1$o, toDisplayString(price.value), 1);
14422
14454
  };
14423
14455
  }
14424
14456
  });
14425
- const _hoisted_1$o = {
14426
- class: "lupa-search-results-product-price",
14427
- "data-cy": "lupa-search-results-product-price"
14428
- };
14429
14457
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
14430
14458
  __name: "SearchResultsProductPrice",
14431
14459
  props: {
@@ -14435,6 +14463,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14435
14463
  },
14436
14464
  setup(__props) {
14437
14465
  const props = __props;
14466
+ const className = computed(() => {
14467
+ return props.options.className;
14468
+ });
14438
14469
  const price = computed(() => {
14439
14470
  var _a, _b;
14440
14471
  return formatPrice(
@@ -14444,9 +14475,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14444
14475
  );
14445
14476
  });
14446
14477
  return (_ctx, _cache) => {
14447
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
14478
+ return openBlock(), createElementBlock("div", {
14479
+ class: normalizeClass([className.value, "lupa-search-results-product-price"]),
14480
+ "data-cy": "lupa-search-results-product-price"
14481
+ }, [
14448
14482
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
14449
- ]);
14483
+ ], 2);
14450
14484
  };
14451
14485
  }
14452
14486
  });
@@ -14641,7 +14675,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14641
14675
  SearchResultsProductSingleStarRating: _sfc_main$m
14642
14676
  }
14643
14677
  };
14644
- const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__), {
14678
+ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
14645
14679
  __name: "SearchResultsProductCardElement",
14646
14680
  props: {
14647
14681
  item: {},
@@ -14686,7 +14720,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14686
14720
  return props.item;
14687
14721
  }
14688
14722
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
14689
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
14723
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
14690
14724
  });
14691
14725
  const displayElement = computed(() => {
14692
14726
  return props.element.display ? props.element.display(enhancedItem.value) : true;
@@ -14745,7 +14779,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14745
14779
  return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
14746
14780
  });
14747
14781
  const badgesOptions = computed(() => {
14748
- return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
14782
+ return __spreadProps(__spreadValues({}, props.options.badges), { product: props.product });
14749
14783
  });
14750
14784
  const imageElements = computed(() => {
14751
14785
  var _a, _b;
@@ -15068,7 +15102,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15068
15102
  };
15069
15103
  const handleQueryChange = () => {
15070
15104
  const context = getLupaTrackingContext();
15071
- const queryBody = __spreadProps2(__spreadValues2({}, context), {
15105
+ const queryBody = __spreadProps(__spreadValues({}, context), {
15072
15106
  limit: props.panel.totalCountLimit,
15073
15107
  searchText: query.value
15074
15108
  });
@@ -15549,7 +15583,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15549
15583
  window.addEventListener("resize", handleResize);
15550
15584
  yield redirectionStore.initiate(props.options.redirections, props.options.options);
15551
15585
  if (props.initialData) {
15552
- searchResultStore.add(__spreadValues2({}, props.initialData));
15586
+ searchResultStore.add(__spreadValues({}, props.initialData));
15553
15587
  }
15554
15588
  handleMounted();
15555
15589
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
@@ -15602,7 +15636,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15602
15636
  });
15603
15637
  const context = getLupaTrackingContext();
15604
15638
  const limit = publicQuery.limit || defaultSearchResultPageSize.value;
15605
- const query2 = __spreadProps2(__spreadValues2(__spreadValues2({}, publicQuery), context), { limit });
15639
+ const query2 = __spreadProps(__spreadValues(__spreadValues({}, publicQuery), context), { limit });
15606
15640
  const redirectionApplied = redirectionStore.redirectOnKeywordIfConfigured(
15607
15641
  publicQuery.searchText,
15608
15642
  optionStore.searchResultsRoutingBehavior
@@ -15617,7 +15651,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15617
15651
  var _a, _b;
15618
15652
  if (res.success) {
15619
15653
  handleResults({ queryKey: props.options.queryKey, results: res });
15620
- searchResultStore.add(__spreadValues2({}, res));
15654
+ searchResultStore.add(__spreadValues({}, res));
15621
15655
  } else if ((_b = (_a = props.options) == null ? void 0 : _a.options) == null ? void 0 : _b.onError) {
15622
15656
  props.options.options.onError(res);
15623
15657
  }
@@ -15686,7 +15720,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15686
15720
  if (typeof window !== "undefined") {
15687
15721
  optionStore.setSearchResultOptions({ options: props.options });
15688
15722
  if (props.initialData) {
15689
- searchResultStore.add(__spreadValues2({}, props.initialData));
15723
+ searchResultStore.add(__spreadValues({}, props.initialData));
15690
15724
  }
15691
15725
  handleMounted();
15692
15726
  return;
@@ -15697,7 +15731,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15697
15731
  (_b = props.options.ssr) == null ? void 0 : _b.baseUrl
15698
15732
  );
15699
15733
  optionStore.setSearchResultOptions({ options: props.options });
15700
- searchResultStore.add(__spreadValues2({}, initialData));
15734
+ searchResultStore.add(__spreadValues({}, initialData));
15701
15735
  paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
15702
15736
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
15703
15737
  handleResults({ queryKey: props.options.queryKey, results: initialData });
@@ -15835,8 +15869,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15835
15869
  const props = __props;
15836
15870
  const searchResults2 = ref(null);
15837
15871
  const componentOptions = computed(() => {
15838
- return __spreadProps2(__spreadValues2({}, props.options), {
15839
- filters: __spreadProps2(__spreadValues2({}, props.options.filters), {
15872
+ return __spreadProps(__spreadValues({}, props.options), {
15873
+ filters: __spreadProps(__spreadValues({}, props.options.filters), {
15840
15874
  categories: props.options.categories
15841
15875
  })
15842
15876
  });
@@ -15875,7 +15909,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15875
15909
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15876
15910
  */
15877
15911
  lodash$1.exports;
15878
- (function(module2, exports3) {
15912
+ (function(module2, exports2) {
15879
15913
  (function() {
15880
15914
  var undefined$1;
15881
15915
  var VERSION = "4.17.21";
@@ -16203,7 +16237,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
16203
16237
  var freeGlobal = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
16204
16238
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
16205
16239
  var root = freeGlobal || freeSelf || Function("return this")();
16206
- var freeExports = exports3 && !exports3.nodeType && exports3;
16240
+ var freeExports = exports2 && !exports2.nodeType && exports2;
16207
16241
  var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
16208
16242
  var moduleExports = freeModule && freeModule.exports === freeExports;
16209
16243
  var freeProcess = moduleExports && freeGlobal.process;
@@ -22363,11 +22397,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22363
22397
  production: "https://api.lupasearch.com/v1/",
22364
22398
  staging: "https://api.staging.lupasearch.com/v1/"
22365
22399
  };
22366
- const defaultConfig = {
22400
+ const DEFAULT_REQUEST_CONFIG = {
22367
22401
  method: "POST",
22368
22402
  headers: { "Content-Type": "application/json" }
22369
22403
  };
22370
- const headers = defaultConfig.headers;
22404
+ const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
22371
22405
  const getApiUrl = (environment, customBaseUrl) => {
22372
22406
  if (customBaseUrl) {
22373
22407
  return customBaseUrl;
@@ -22379,13 +22413,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22379
22413
  const { environment, customBaseUrl } = options;
22380
22414
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22381
22415
  try {
22382
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22416
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22383
22417
  body: JSON.stringify(request),
22384
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22418
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22385
22419
  }));
22386
22420
  if (res.status < 400) {
22387
22421
  const data = yield res.json();
22388
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22422
+ return __spreadProps(__spreadValues({}, data), { success: true });
22389
22423
  }
22390
22424
  const errors = yield res.json();
22391
22425
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22402,14 +22436,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22402
22436
  try {
22403
22437
  const res = yield fetch(
22404
22438
  `${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives${model}`,
22405
- __spreadProps2(__spreadValues2({}, defaultConfig), {
22439
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22406
22440
  body: JSON.stringify(request),
22407
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22441
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22408
22442
  })
22409
22443
  );
22410
22444
  if (res.status < 400) {
22411
22445
  const data = yield res.json();
22412
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22446
+ return __spreadProps(__spreadValues({}, data), { success: true });
22413
22447
  }
22414
22448
  const errors = yield res.json();
22415
22449
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22424,13 +22458,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22424
22458
  const { environment, customBaseUrl } = options;
22425
22459
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22426
22460
  try {
22427
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22461
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22428
22462
  body: JSON.stringify(request),
22429
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22463
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22430
22464
  }));
22431
22465
  if (res.status < 400) {
22432
22466
  const data = yield res.json();
22433
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22467
+ return __spreadProps(__spreadValues({}, data), { success: true });
22434
22468
  }
22435
22469
  const errors = yield res.json();
22436
22470
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22464,9 +22498,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22464
22498
  const getTextResponseChunkStream = (options, request, onChunkReceived, chatSettings) => {
22465
22499
  var _a;
22466
22500
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22467
- fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22501
+ fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22468
22502
  body: JSON.stringify(request),
22469
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22503
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22470
22504
  })).then((response) => {
22471
22505
  const reader = response.body.getReader();
22472
22506
  return reader.read().then(function processStream({ done, value }) {
@@ -22858,7 +22892,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22858
22892
  }
22859
22893
  const validPhrases = phrases.filter((p2) => (p2 == null ? void 0 : p2.trim().length) > 0);
22860
22894
  chatContent.value = chatContent.value.map(
22861
- (c2) => c2.key === key ? __spreadProps2(__spreadValues2({}, c2), {
22895
+ (c2) => c2.key === key ? __spreadProps(__spreadValues({}, c2), {
22862
22896
  allPhrases: [...validPhrases],
22863
22897
  suggestedPhrases: phrases
22864
22898
  }) : c2
@@ -22895,6 +22929,29 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22895
22929
  };
22896
22930
  }
22897
22931
  });
22932
+ const fetchPluginConfiguration = (options, configurationKey) => __async(void 0, null, function* () {
22933
+ var _a, _b, _c;
22934
+ const { environment, customBaseUrl } = options;
22935
+ try {
22936
+ const res = yield fetch(
22937
+ `${getApiUrl(environment, customBaseUrl)}plugin/configurations/${configurationKey}`,
22938
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22939
+ method: "GET",
22940
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22941
+ })
22942
+ );
22943
+ if (res.status < 400) {
22944
+ const data = yield res.json();
22945
+ return __spreadValues({}, data);
22946
+ }
22947
+ const errors = yield res.json();
22948
+ (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
22949
+ return null;
22950
+ } catch (e2) {
22951
+ (_c = options == null ? void 0 : options.onError) == null ? void 0 : _c.call(options, e2);
22952
+ return null;
22953
+ }
22954
+ });
22898
22955
  let piniaInstance = null;
22899
22956
  const initPinia = () => {
22900
22957
  if (piniaInstance) {
@@ -22910,171 +22967,516 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22910
22967
  initTracking(options);
22911
22968
  store.setTrackingOptions({ options });
22912
22969
  };
22913
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
22914
- var lodash = { exports: {} };
22915
- /**
22916
- * @license
22917
- * Lodash <https://lodash.com/>
22918
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
22919
- * Released under MIT license <https://lodash.com/license>
22920
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
22921
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
22922
- */
22923
- lodash.exports;
22924
- (function(module2, exports3) {
22925
- (function() {
22926
- var undefined$1;
22927
- var VERSION = "4.17.21";
22928
- var LARGE_ARRAY_SIZE = 200;
22929
- var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
22930
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
22931
- var MAX_MEMOIZE_SIZE = 500;
22932
- var PLACEHOLDER = "__lodash_placeholder__";
22933
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
22934
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
22935
- var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
22936
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
22937
- var HOT_COUNT = 800, HOT_SPAN = 16;
22938
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
22939
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
22940
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
22941
- var wrapFlags = [
22942
- ["ary", WRAP_ARY_FLAG],
22943
- ["bind", WRAP_BIND_FLAG],
22944
- ["bindKey", WRAP_BIND_KEY_FLAG],
22945
- ["curry", WRAP_CURRY_FLAG],
22946
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
22947
- ["flip", WRAP_FLIP_FLAG],
22948
- ["partial", WRAP_PARTIAL_FLAG],
22949
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
22950
- ["rearg", WRAP_REARG_FLAG]
22951
- ];
22952
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
22953
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
22954
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
22955
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
22956
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
22957
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
22958
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
22959
- var reTrimStart = /^\s+/;
22960
- var reWhitespace = /\s/;
22961
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
22962
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
22963
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
22964
- var reEscapeChar = /\\(\\)?/g;
22965
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
22966
- var reFlags = /\w*$/;
22967
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
22968
- var reIsBinary = /^0b[01]+$/i;
22969
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
22970
- var reIsOctal = /^0o[0-7]+$/i;
22971
- var reIsUint = /^(?:0|[1-9]\d*)$/;
22972
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
22973
- var reNoMatch = /($^)/;
22974
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
22975
- var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
22976
- var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
22977
- var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
22978
- var reApos = RegExp(rsApos, "g");
22979
- var reComboMark = RegExp(rsCombo, "g");
22980
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
22981
- var reUnicodeWord = RegExp([
22982
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
22983
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
22984
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
22985
- rsUpper + "+" + rsOptContrUpper,
22986
- rsOrdUpper,
22987
- rsOrdLower,
22988
- rsDigits,
22989
- rsEmoji
22990
- ].join("|"), "g");
22991
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
22992
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
22993
- var contextProps = [
22994
- "Array",
22995
- "Buffer",
22996
- "DataView",
22997
- "Date",
22998
- "Error",
22999
- "Float32Array",
23000
- "Float64Array",
23001
- "Function",
23002
- "Int8Array",
23003
- "Int16Array",
23004
- "Int32Array",
23005
- "Map",
23006
- "Math",
23007
- "Object",
23008
- "Promise",
23009
- "RegExp",
23010
- "Set",
23011
- "String",
23012
- "Symbol",
23013
- "TypeError",
23014
- "Uint8Array",
23015
- "Uint8ClampedArray",
23016
- "Uint16Array",
23017
- "Uint32Array",
23018
- "WeakMap",
23019
- "_",
23020
- "clearTimeout",
23021
- "isFinite",
23022
- "parseInt",
23023
- "setTimeout"
23024
- ];
23025
- var templateCounter = -1;
23026
- var typedArrayTags = {};
23027
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
23028
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
23029
- var cloneableTags = {};
23030
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
23031
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
23032
- var deburredLetters = {
23033
- // Latin-1 Supplement block.
23034
- "À": "A",
23035
- "Á": "A",
23036
- "Â": "A",
23037
- "Ã": "A",
23038
- "Ä": "A",
23039
- "Å": "A",
23040
- "à": "a",
23041
- "á": "a",
23042
- "â": "a",
23043
- "ã": "a",
23044
- "ä": "a",
23045
- "å": "a",
23046
- "Ç": "C",
23047
- "ç": "c",
23048
- "Ð": "D",
23049
- "ð": "d",
23050
- "È": "E",
23051
- "É": "E",
23052
- "Ê": "E",
23053
- "Ë": "E",
23054
- "è": "e",
23055
- "é": "e",
23056
- "ê": "e",
23057
- "ë": "e",
23058
- "Ì": "I",
23059
- "Í": "I",
23060
- "Î": "I",
23061
- "Ï": "I",
23062
- "ì": "i",
23063
- "í": "i",
23064
- "î": "i",
23065
- "ï": "i",
23066
- "Ñ": "N",
23067
- "ñ": "n",
23068
- "Ò": "O",
23069
- "Ó": "O",
23070
- "Ô": "O",
23071
- "Õ": "O",
23072
- "Ö": "O",
23073
- "Ø": "O",
23074
- "ò": "o",
23075
- "ó": "o",
23076
- "ô": "o",
23077
- "õ": "o",
22970
+ const displayDiscountedPriceSection = (doc2, options) => {
22971
+ var _a, _b;
22972
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22973
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22974
+ return discountPrice && regularPrice && discountPrice < regularPrice;
22975
+ };
22976
+ const displayRegularPriceSection = (doc2, options) => {
22977
+ var _a, _b;
22978
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22979
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22980
+ const anyPrice = discountPrice || regularPrice;
22981
+ return anyPrice && !displayDiscountedPriceSection(doc2, options);
22982
+ };
22983
+ const escapeHtml = (source) => {
22984
+ if (!source) {
22985
+ return source;
22986
+ }
22987
+ return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
22988
+ };
22989
+ const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
22990
+ if (!value) {
22991
+ return 0;
22992
+ }
22993
+ try {
22994
+ return +parseFloat(`${value}`).toFixed(maxDecimal);
22995
+ } catch (e2) {
22996
+ return `${value}`;
22997
+ }
22998
+ };
22999
+ const capitalize = (value) => {
23000
+ if (!value) {
23001
+ return "";
23002
+ }
23003
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1);
23004
+ };
23005
+ const getAlphanumeric = (value) => {
23006
+ if (!value) {
23007
+ return "";
23008
+ }
23009
+ return value.replace(/[\W_]/g, " ");
23010
+ };
23011
+ const getAdditionalElements = (fields) => {
23012
+ return fields.map((key) => ({
23013
+ type: "custom",
23014
+ key,
23015
+ label: capitalize(getAlphanumeric(key)),
23016
+ className: "lupa-custom",
23017
+ display: (doc2) => Boolean(doc2[key])
23018
+ }));
23019
+ };
23020
+ const addFieldIfKeyExists = (field, key, config) => {
23021
+ if (key) {
23022
+ return config;
23023
+ }
23024
+ return { key: field, type: "customHtml", display: () => false };
23025
+ };
23026
+ const getSearchBoxComponent = ({
23027
+ searchBoxOptions,
23028
+ labels,
23029
+ panelOptions,
23030
+ redirections,
23031
+ placeholderImage
23032
+ }) => {
23033
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
23034
+ const panels = [
23035
+ ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
23036
+ {
23037
+ type: SearchBoxPanelType.SUGGESTION,
23038
+ queryKey: searchBoxOptions.suggestionQueryKey,
23039
+ highlight: true,
23040
+ limit: 8,
23041
+ labels: {
23042
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
23043
+ }
23044
+ }
23045
+ ] : [],
23046
+ ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
23047
+ {
23048
+ type: SearchBoxPanelType.DOCUMENT,
23049
+ queryKey: searchBoxOptions.documentQueryKey,
23050
+ limit: 5,
23051
+ elements: [
23052
+ {
23053
+ type: "image",
23054
+ placeholder: placeholderImage,
23055
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
23056
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
23057
+ },
23058
+ {
23059
+ type: "title",
23060
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
23061
+ maxLines: 2
23062
+ },
23063
+ {
23064
+ type: "regularPrice",
23065
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
23066
+ display: (doc2) => {
23067
+ var _a2, _b2, _c2, _d2;
23068
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
23069
+ }
23070
+ },
23071
+ {
23072
+ type: "price",
23073
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
23074
+ }
23075
+ ]
23076
+ }
23077
+ ] : []
23078
+ ];
23079
+ return {
23080
+ inputSelector: searchBoxOptions.inputSelector,
23081
+ options: {
23082
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
23083
+ customUrl: searchBoxOptions.customUrl,
23084
+ customBaseUrl: searchBoxOptions.customBaseUrl,
23085
+ customPayload: searchBoxOptions.customPayload,
23086
+ customHeaders: searchBoxOptions.customHeaders
23087
+ },
23088
+ showTotalCount: true,
23089
+ expandOnSinglePanel: true,
23090
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
23091
+ debounce: 250,
23092
+ labels: labels == null ? void 0 : labels.searchBox,
23093
+ links: {
23094
+ searchResults: ""
23095
+ },
23096
+ panels,
23097
+ redirections,
23098
+ history: {
23099
+ labels: {
23100
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
23101
+ }
23102
+ }
23103
+ };
23104
+ };
23105
+ const getSearchResultsComponent = ({
23106
+ searchResultOptions,
23107
+ labels,
23108
+ redirections,
23109
+ placeholderImage,
23110
+ configuratorOverrides,
23111
+ callbacks,
23112
+ additionalFields
23113
+ }) => {
23114
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
23115
+ const filters = searchResultOptions.showFacets ? {
23116
+ currentFilters: {
23117
+ visibility: {
23118
+ mobileSidebar: true,
23119
+ mobileToolbar: true
23120
+ },
23121
+ labels: {
23122
+ title: "",
23123
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
23124
+ }
23125
+ },
23126
+ facets: {
23127
+ labels: {
23128
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
23129
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
23130
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
23131
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
23132
+ },
23133
+ filterable: {
23134
+ minValues: 5
23135
+ },
23136
+ hierarchy: {
23137
+ maxInitialLevel: 2,
23138
+ topLevelValueCountLimit: 5,
23139
+ filterable: true
23140
+ },
23141
+ stats: {
23142
+ slider: true,
23143
+ inputs: true,
23144
+ labels: {
23145
+ from: "",
23146
+ to: ""
23147
+ }
23148
+ },
23149
+ facetValueCountLimit: 8,
23150
+ showDocumentCount: true,
23151
+ style: {
23152
+ type: "sidebar"
23153
+ }
23154
+ }
23155
+ } : {};
23156
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
23157
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
23158
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
23159
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
23160
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
23161
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
23162
+ };
23163
+ const badges = {
23164
+ badges: {
23165
+ anchor: "tr",
23166
+ elements: [
23167
+ ...searchResultOptions.showRelevance ? [
23168
+ {
23169
+ key: "",
23170
+ type: "customHtml",
23171
+ className: "relevance",
23172
+ html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
23173
+ display: (doc2) => Boolean(doc2._relevance !== void 0)
23174
+ }
23175
+ ] : [],
23176
+ ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
23177
+ {
23178
+ key: "",
23179
+ type: "customHtml",
23180
+ className: "boosted-marker",
23181
+ html: () => {
23182
+ var _a2;
23183
+ return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
23184
+ },
23185
+ display: (doc2) => doc2._boosted === true
23186
+ }
23187
+ ] : []
23188
+ ]
23189
+ }
23190
+ };
23191
+ return __spreadValues2(__spreadProps2(__spreadValues2({
23192
+ options: {
23193
+ environment: (_m = searchResultOptions.environment) != null ? _m : "production",
23194
+ customUrl: searchResultOptions.customUrl,
23195
+ customBaseUrl: searchResultOptions.customBaseUrl,
23196
+ customPayload: searchResultOptions.customPayload,
23197
+ customHeaders: searchResultOptions.customHeaders,
23198
+ onError: searchResultOptions.errorHandler
23199
+ },
23200
+ queryKey: searchResultOptions.queryKey,
23201
+ containerSelector: searchResultOptions.containerSelector,
23202
+ searchTitlePosition: "search-results-top",
23203
+ titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
23204
+ labels: labels == null ? void 0 : labels.searchResults,
23205
+ grid: {
23206
+ columns
23207
+ },
23208
+ pagination: {
23209
+ sizeSelection: {
23210
+ position: {
23211
+ top: true,
23212
+ bottom: false
23213
+ },
23214
+ sizes: [12, 24, 36, 48]
23215
+ },
23216
+ pageSelection: {
23217
+ position: {
23218
+ top: false,
23219
+ bottom: true
23220
+ },
23221
+ displayMobile: 3,
23222
+ display: 5
23223
+ }
23224
+ },
23225
+ filters,
23226
+ toolbar: {
23227
+ layoutSelector: false,
23228
+ itemSummary: true,
23229
+ clearFilters: false
23230
+ },
23231
+ isInStock: () => {
23232
+ return true;
23233
+ }
23234
+ }, badges), {
23235
+ links: {
23236
+ details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
23237
+ },
23238
+ callbacks,
23239
+ routingBehavior: callbacks ? "event" : "direct-link",
23240
+ idKey: "id",
23241
+ elements: [
23242
+ {
23243
+ type: "image",
23244
+ placeholder: placeholderImage,
23245
+ key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
23246
+ baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
23247
+ display: () => {
23248
+ var _a2;
23249
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
23250
+ }
23251
+ },
23252
+ addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
23253
+ type: "custom",
23254
+ className: "lupa-custom-emphasis",
23255
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
23256
+ display: () => true
23257
+ }),
23258
+ {
23259
+ type: "title",
23260
+ key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
23261
+ maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
23262
+ display: (doc2) => {
23263
+ var _a2, _b2;
23264
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
23265
+ }
23266
+ },
23267
+ ...getAdditionalElements(additionalFields),
23268
+ addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
23269
+ key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
23270
+ type: "customHtml",
23271
+ className: "lupa-price lupa-price-discounted",
23272
+ display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
23273
+ html: (doc2) => {
23274
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23275
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23276
+ const discountPrice = (_d2 = parseFloat(
23277
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
23278
+ )) == null ? void 0 : _d2.toFixed(2);
23279
+ const regularPrice = (_g2 = parseFloat(
23280
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
23281
+ )) == null ? void 0 : _g2.toFixed(2);
23282
+ const discount = `<span class="lupa-discount">${escapeHtml(
23283
+ discountPrice
23284
+ )} ${currency}</span>`;
23285
+ const regular = `<span class="lupa-regular">${escapeHtml(
23286
+ regularPrice
23287
+ )} ${currency}</span>`;
23288
+ return discount + regular;
23289
+ }
23290
+ }),
23291
+ addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
23292
+ key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
23293
+ type: "customHtml",
23294
+ className: "lupa-price lupa-price-single",
23295
+ display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
23296
+ html: (doc2) => {
23297
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23298
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23299
+ const price = (_g2 = parseFloat(
23300
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
23301
+ )) == null ? void 0 : _g2.toFixed(2);
23302
+ return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
23303
+ }
23304
+ })
23305
+ ],
23306
+ breadcrumbs: [],
23307
+ sort: [],
23308
+ redirections
23309
+ }), configuratorOverrides);
23310
+ };
23311
+ const SearchContainerConfigurationService = {
23312
+ getSearchBoxComponent,
23313
+ getSearchResultsComponent
23314
+ };
23315
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
23316
+ var lodash = { exports: {} };
23317
+ /**
23318
+ * @license
23319
+ * Lodash <https://lodash.com/>
23320
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
23321
+ * Released under MIT license <https://lodash.com/license>
23322
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23323
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
23324
+ */
23325
+ lodash.exports;
23326
+ (function(module2, exports2) {
23327
+ (function() {
23328
+ var undefined$1;
23329
+ var VERSION = "4.17.21";
23330
+ var LARGE_ARRAY_SIZE = 200;
23331
+ var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
23332
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
23333
+ var MAX_MEMOIZE_SIZE = 500;
23334
+ var PLACEHOLDER = "__lodash_placeholder__";
23335
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
23336
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
23337
+ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
23338
+ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
23339
+ var HOT_COUNT = 800, HOT_SPAN = 16;
23340
+ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
23341
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
23342
+ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
23343
+ var wrapFlags = [
23344
+ ["ary", WRAP_ARY_FLAG],
23345
+ ["bind", WRAP_BIND_FLAG],
23346
+ ["bindKey", WRAP_BIND_KEY_FLAG],
23347
+ ["curry", WRAP_CURRY_FLAG],
23348
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG],
23349
+ ["flip", WRAP_FLIP_FLAG],
23350
+ ["partial", WRAP_PARTIAL_FLAG],
23351
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
23352
+ ["rearg", WRAP_REARG_FLAG]
23353
+ ];
23354
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
23355
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
23356
+ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
23357
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
23358
+ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
23359
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
23360
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
23361
+ var reTrimStart = /^\s+/;
23362
+ var reWhitespace = /\s/;
23363
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
23364
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
23365
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
23366
+ var reEscapeChar = /\\(\\)?/g;
23367
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
23368
+ var reFlags = /\w*$/;
23369
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
23370
+ var reIsBinary = /^0b[01]+$/i;
23371
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23372
+ var reIsOctal = /^0o[0-7]+$/i;
23373
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
23374
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
23375
+ var reNoMatch = /($^)/;
23376
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
23377
+ var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
23378
+ var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
23379
+ var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
23380
+ var reApos = RegExp(rsApos, "g");
23381
+ var reComboMark = RegExp(rsCombo, "g");
23382
+ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
23383
+ var reUnicodeWord = RegExp([
23384
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
23385
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
23386
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
23387
+ rsUpper + "+" + rsOptContrUpper,
23388
+ rsOrdUpper,
23389
+ rsOrdLower,
23390
+ rsDigits,
23391
+ rsEmoji
23392
+ ].join("|"), "g");
23393
+ var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
23394
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
23395
+ var contextProps = [
23396
+ "Array",
23397
+ "Buffer",
23398
+ "DataView",
23399
+ "Date",
23400
+ "Error",
23401
+ "Float32Array",
23402
+ "Float64Array",
23403
+ "Function",
23404
+ "Int8Array",
23405
+ "Int16Array",
23406
+ "Int32Array",
23407
+ "Map",
23408
+ "Math",
23409
+ "Object",
23410
+ "Promise",
23411
+ "RegExp",
23412
+ "Set",
23413
+ "String",
23414
+ "Symbol",
23415
+ "TypeError",
23416
+ "Uint8Array",
23417
+ "Uint8ClampedArray",
23418
+ "Uint16Array",
23419
+ "Uint32Array",
23420
+ "WeakMap",
23421
+ "_",
23422
+ "clearTimeout",
23423
+ "isFinite",
23424
+ "parseInt",
23425
+ "setTimeout"
23426
+ ];
23427
+ var templateCounter = -1;
23428
+ var typedArrayTags = {};
23429
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
23430
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
23431
+ var cloneableTags = {};
23432
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
23433
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
23434
+ var deburredLetters = {
23435
+ // Latin-1 Supplement block.
23436
+ "À": "A",
23437
+ "Á": "A",
23438
+ "Â": "A",
23439
+ "Ã": "A",
23440
+ "Ä": "A",
23441
+ "Å": "A",
23442
+ "à": "a",
23443
+ "á": "a",
23444
+ "â": "a",
23445
+ "ã": "a",
23446
+ "ä": "a",
23447
+ "å": "a",
23448
+ "Ç": "C",
23449
+ "ç": "c",
23450
+ "Ð": "D",
23451
+ "ð": "d",
23452
+ "È": "E",
23453
+ "É": "E",
23454
+ "Ê": "E",
23455
+ "Ë": "E",
23456
+ "è": "e",
23457
+ "é": "e",
23458
+ "ê": "e",
23459
+ "ë": "e",
23460
+ "Ì": "I",
23461
+ "Í": "I",
23462
+ "Î": "I",
23463
+ "Ï": "I",
23464
+ "ì": "i",
23465
+ "í": "i",
23466
+ "î": "i",
23467
+ "ï": "i",
23468
+ "Ñ": "N",
23469
+ "ñ": "n",
23470
+ "Ò": "O",
23471
+ "Ó": "O",
23472
+ "Ô": "O",
23473
+ "Õ": "O",
23474
+ "Ö": "O",
23475
+ "Ø": "O",
23476
+ "ò": "o",
23477
+ "ó": "o",
23478
+ "ô": "o",
23479
+ "õ": "o",
23078
23480
  "ö": "o",
23079
23481
  "ø": "o",
23080
23482
  "Ù": "U",
@@ -23249,7 +23651,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23249
23651
  var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
23250
23652
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
23251
23653
  var root = freeGlobal || freeSelf || Function("return this")();
23252
- var freeExports = exports3 && !exports3.nodeType && exports3;
23654
+ var freeExports = exports2 && !exports2.nodeType && exports2;
23253
23655
  var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
23254
23656
  var moduleExports = freeModule && freeModule.exports === freeExports;
23255
23657
  var freeProcess = moduleExports && freeGlobal.process;
@@ -28388,546 +28790,150 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28388
28790
  (freeModule.exports = _)._ = _;
28389
28791
  freeExports._ = _;
28390
28792
  } else {
28391
- root._ = _;
28392
- }
28393
- }).call(commonjsGlobal);
28394
- })(lodash, lodash.exports);
28395
- var lodashExports = lodash.exports;
28396
- const DEFAULT_SEARCH_BOX_OPTIONS = {
28397
- inputSelector: "#searchBox",
28398
- options: {
28399
- environment: "production"
28400
- },
28401
- showTotalCount: false,
28402
- minInputLength: 1,
28403
- inputAttributes: {
28404
- name: "q"
28405
- },
28406
- debounce: 0,
28407
- labels: {
28408
- placeholder: "Search for products...",
28409
- noResults: "There are no results found.",
28410
- moreResults: "Show more results",
28411
- currency: "€",
28412
- defaultFacetLabel: "Category:"
28413
- },
28414
- links: {
28415
- searchResults: "/search"
28416
- },
28417
- panels: [
28418
- {
28419
- type: "suggestion",
28420
- queryKey: "",
28421
- highlight: true,
28422
- limit: 5
28423
- },
28424
- {
28425
- type: "document",
28426
- queryKey: "",
28427
- limit: 5,
28428
- searchBySuggestion: false,
28429
- links: {
28430
- details: "{url}"
28431
- },
28432
- titleKey: "name",
28433
- elements: []
28434
- }
28435
- ],
28436
- history: {
28437
- labels: {
28438
- clear: "Clear History"
28439
- }
28440
- }
28441
- };
28442
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28443
- __name: "SearchBoxEntry",
28444
- props: {
28445
- searchBoxOptions: {}
28446
- },
28447
- setup(__props, { expose: __expose }) {
28448
- const props = __props;
28449
- const searchBox2 = ref(null);
28450
- const fullSearchBoxOptions = computed(() => {
28451
- const options = lodashExports.cloneDeep(props.searchBoxOptions);
28452
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28453
- });
28454
- const fetch2 = () => {
28455
- var _a;
28456
- (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28457
- };
28458
- __expose({ fetch: fetch2 });
28459
- return (_ctx, _cache) => {
28460
- return openBlock(), createBlock(unref(_sfc_main$V), {
28461
- options: fullSearchBoxOptions.value,
28462
- ref_key: "searchBox",
28463
- ref: searchBox2
28464
- }, null, 8, ["options"]);
28465
- };
28466
- }
28467
- });
28468
- const DEFAULT_OPTIONS_RESULTS = {
28793
+ root._ = _;
28794
+ }
28795
+ }).call(commonjsGlobal);
28796
+ })(lodash, lodash.exports);
28797
+ var lodashExports = lodash.exports;
28798
+ const DEFAULT_SEARCH_BOX_OPTIONS = {
28799
+ inputSelector: "#searchBox",
28469
28800
  options: {
28470
28801
  environment: "production"
28471
28802
  },
28472
- queryKey: "",
28473
- containerSelector: "#searchResultsContainer",
28474
- searchTitlePosition: "page-top",
28803
+ showTotalCount: false,
28804
+ minInputLength: 1,
28805
+ inputAttributes: {
28806
+ name: "q"
28807
+ },
28808
+ debounce: 0,
28475
28809
  labels: {
28476
- pageSize: "Page size:",
28477
- sortBy: "Sort by:",
28478
- itemCount: "Items {1} of {2}",
28479
- filteredItemCount: "",
28810
+ placeholder: "Search for products...",
28811
+ noResults: "There are no results found.",
28812
+ moreResults: "Show more results",
28480
28813
  currency: "€",
28481
- showMore: "Show more",
28482
- searchResults: "Search Query: ",
28483
- emptyResults: "There are no results for the query:",
28484
- mobileFilterButton: "Filter",
28485
- htmlTitleTemplate: "Search Query: '{1}'",
28486
- noResultsSuggestion: "No results found for this query: {1}",
28487
- didYouMean: "Did you mean to search: {1}",
28488
- similarQuery: "Search results for phrase {1}",
28489
- similarQueries: "Similar queries:"
28490
- },
28491
- grid: {
28492
- columns: {
28493
- xl: 4,
28494
- l: 3,
28495
- md: 2,
28496
- sm: 2,
28497
- xs: 1
28498
- }
28814
+ defaultFacetLabel: "Category:"
28499
28815
  },
28500
- pagination: {
28501
- sizeSelection: {
28502
- position: {
28503
- top: false,
28504
- bottom: true
28505
- },
28506
- sizes: [12, 24, 36]
28507
- },
28508
- pageSelection: {
28509
- position: {
28510
- top: false,
28511
- bottom: true
28512
- },
28513
- display: 5,
28514
- displayMobile: 3
28515
- }
28816
+ links: {
28817
+ searchResults: "/search"
28516
28818
  },
28517
- sort: [],
28518
- filters: {
28519
- currentFilters: {
28520
- visibility: {
28521
- mobileSidebar: true,
28522
- mobileToolbar: true
28523
- },
28524
- labels: {
28525
- title: "Current filters:",
28526
- clearAll: "Clear all"
28527
- }
28819
+ panels: [
28820
+ {
28821
+ type: "suggestion",
28822
+ queryKey: "",
28823
+ highlight: true,
28824
+ limit: 5
28528
28825
  },
28529
- facets: {
28530
- labels: {
28531
- title: "Filters:",
28532
- showAll: "Show more",
28533
- facetFilter: "Filter...",
28534
- facetClear: "Clear"
28535
- },
28536
- filterable: {
28537
- minValues: 5
28538
- },
28539
- hierarchy: {
28540
- maxInitialLevel: 2,
28541
- topLevelValueCountLimit: 5,
28542
- filterable: true
28826
+ {
28827
+ type: "document",
28828
+ queryKey: "",
28829
+ limit: 5,
28830
+ searchBySuggestion: false,
28831
+ links: {
28832
+ details: "{url}"
28543
28833
  },
28544
- facetValueCountLimit: 20,
28545
- showDocumentCount: true,
28546
- style: {
28547
- type: "sidebar"
28548
- }
28549
- }
28550
- },
28551
- toolbar: {
28552
- layoutSelector: true,
28553
- itemSummary: true,
28554
- clearFilters: false
28555
- },
28556
- isInStock: () => {
28557
- return true;
28558
- },
28559
- badges: {
28560
- anchor: "tr",
28561
- elements: []
28562
- },
28563
- links: {
28564
- details: "/{id}"
28565
- },
28566
- elements: [],
28567
- breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28568
- };
28569
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28570
- __name: "SearchResultsEntry",
28571
- props: {
28572
- searchResultsOptions: {}
28573
- },
28574
- setup(__props, { expose: __expose }) {
28575
- const props = __props;
28576
- const searchResults2 = ref(null);
28577
- const fullSearchResultsOptions = computed(() => {
28578
- const options = lodashExports.cloneDeep(props.searchResultsOptions);
28579
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28580
- });
28581
- const fetch2 = () => {
28582
- var _a;
28583
- (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28584
- };
28585
- __expose({ fetch: fetch2 });
28586
- return (_ctx, _cache) => {
28587
- return openBlock(), createBlock(unref(_sfc_main$c), {
28588
- options: fullSearchResultsOptions.value,
28589
- ref_key: "searchResults",
28590
- ref: searchResults2
28591
- }, null, 8, ["options"]);
28592
- };
28593
- }
28594
- });
28595
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28596
- __name: "ProductListEntry",
28597
- props: {
28598
- productListOptions: {}
28599
- },
28600
- setup(__props, { expose: __expose }) {
28601
- const props = __props;
28602
- const productList2 = ref(null);
28603
- const fullProductListOptions = computed(() => {
28604
- return lodashExports.cloneDeep(props.productListOptions);
28605
- });
28606
- const fetch2 = () => {
28607
- var _a;
28608
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28609
- };
28610
- __expose({ fetch: fetch2 });
28611
- return (_ctx, _cache) => {
28612
- return openBlock(), createBlock(unref(_sfc_main$a), {
28613
- options: fullProductListOptions.value,
28614
- ref_key: "productList",
28615
- ref: productList2
28616
- }, null, 8, ["options"]);
28617
- };
28618
- }
28619
- });
28620
- const QUERY_PARAMS = {
28621
- QUERY: "q",
28622
- PAGE: "p",
28623
- LIMIT: "l",
28624
- SORT: "s"
28625
- };
28626
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28627
- __name: "SearchContainerEntry",
28628
- props: {
28629
- searchContainerOptions: {}
28630
- },
28631
- setup(__props, { expose: __expose }) {
28632
- const props = __props;
28633
- const isOpen = ref(false);
28634
- const triggerElement = ref(null);
28635
- const productList2 = ref(null);
28636
- const containerOptions = computed(() => {
28637
- return lodashExports.cloneDeep(props.searchContainerOptions);
28638
- });
28639
- const focus = () => {
28640
- const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
28641
- el == null ? void 0 : el.focus();
28642
- };
28643
- const close = () => {
28644
- isOpen.value = false;
28645
- };
28646
- const openSearchContainer = () => {
28647
- isOpen.value = true;
28648
- };
28649
- const checkCloseOnEscape = (e2) => {
28650
- var _a;
28651
- if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
28652
- return;
28653
- }
28654
- isOpen.value = false;
28655
- };
28656
- const checkExistingQuery = () => {
28657
- const url = new URL(window.location.href);
28658
- const param = url.searchParams.get(QUERY_PARAMS.QUERY);
28659
- if (!param) {
28660
- return;
28661
- }
28662
- isOpen.value = true;
28663
- };
28664
- const mountOpenListeners = () => {
28665
- var _a, _b;
28666
- triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
28667
- (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
28668
- window.addEventListener("keydown", checkCloseOnEscape);
28669
- };
28670
- onMounted(() => {
28671
- var _a, _b;
28672
- mountOpenListeners();
28673
- checkExistingQuery();
28674
- isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
28675
- });
28676
- onBeforeUnmount(() => {
28677
- var _a;
28678
- (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
28679
- window.removeEventListener("keydown", checkCloseOnEscape);
28680
- });
28681
- const fetch2 = () => {
28682
- var _a;
28683
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28684
- };
28685
- const reloadOptions = () => {
28686
- var _a;
28687
- (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
28688
- };
28689
- __expose({ fetch: fetch2, reloadOptions });
28690
- return (_ctx, _cache) => {
28691
- return openBlock(), createElementBlock("div", null, [
28692
- containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
28693
- key: 0,
28694
- options: containerOptions.value,
28695
- ref_key: "productList",
28696
- ref: productList2,
28697
- "onHook:mounted": focus,
28698
- onClose: close
28699
- }, null, 8, ["options"])) : createCommentVNode("", true)
28700
- ]);
28701
- };
28834
+ titleKey: "name",
28835
+ elements: []
28836
+ }
28837
+ ],
28838
+ history: {
28839
+ labels: {
28840
+ clear: "Clear History"
28841
+ }
28702
28842
  }
28703
- });
28704
- const _sfc_main = /* @__PURE__ */ defineComponent({
28705
- __name: "RecommendationsEntry",
28843
+ };
28844
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28845
+ __name: "SearchBoxEntry",
28706
28846
  props: {
28707
- recommendationOptions: {}
28847
+ searchBoxOptions: {}
28708
28848
  },
28709
28849
  setup(__props, { expose: __expose }) {
28710
- const productRecommendations = ref(null);
28850
+ const props = __props;
28851
+ const searchBox2 = ref(null);
28852
+ const fullSearchBoxOptions = computed(() => {
28853
+ const options = lodashExports.cloneDeep(props.searchBoxOptions);
28854
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28855
+ });
28711
28856
  const fetch2 = () => {
28712
- productRecommendations == null ? void 0 : productRecommendations.fetch();
28857
+ var _a;
28858
+ (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28713
28859
  };
28714
28860
  __expose({ fetch: fetch2 });
28715
28861
  return (_ctx, _cache) => {
28716
- return openBlock(), createBlock(unref(_sfc_main$8), {
28717
- options: _ctx.recommendationOptions,
28718
- ref_key: "productRecommendations",
28719
- ref: productRecommendations
28862
+ return openBlock(), createBlock(unref(_sfc_main$V), {
28863
+ options: fullSearchBoxOptions.value,
28864
+ ref_key: "searchBox",
28865
+ ref: searchBox2
28720
28866
  }, null, 8, ["options"]);
28721
28867
  };
28722
28868
  }
28723
28869
  });
28724
- const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
28725
- const createShadowDom = (shadowId, managerId) => {
28726
- let host = document.getElementById(shadowId);
28727
- if (host) {
28728
- host.remove();
28729
- }
28730
- host = document.createElement("div");
28731
- const manager = document.createElement("div");
28732
- host.setAttribute("id", shadowId);
28733
- manager == null ? void 0 : manager.setAttribute("id", managerId);
28734
- return { host, manager };
28735
- };
28736
- const attatchShadowDom = ({
28737
- host,
28738
- manager,
28739
- styleUrl,
28740
- options
28741
- }) => {
28742
- var _a;
28743
- if (host.shadowRoot) {
28744
- return;
28745
- }
28746
- const link = document.createElement("link");
28747
- link.type = "text/css";
28748
- link.rel = "stylesheet";
28749
- link.href = styleUrl;
28750
- const fontLink = document.createElement("link");
28751
- fontLink.type = "text/css";
28752
- fontLink.rel = "stylesheet";
28753
- fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
28754
- document.head.appendChild(fontLink);
28755
- const materialIconLink = document.createElement("link");
28756
- materialIconLink.type = "text/css";
28757
- materialIconLink.rel = "stylesheet";
28758
- materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
28759
- document.head.appendChild(materialIconLink);
28760
- const shadow = host.attachShadow({ mode: "open" });
28761
- shadow.appendChild(manager);
28762
- shadow.appendChild(link);
28763
- if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
28764
- const style = document.createElement("style");
28765
- style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
28766
- shadow.appendChild(style);
28767
- }
28768
- };
28769
- const displayDiscountedPriceSection = (doc2, options) => {
28770
- var _a, _b;
28771
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28772
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28773
- return discountPrice && regularPrice && discountPrice < regularPrice;
28774
- };
28775
- const displayRegularPriceSection = (doc2, options) => {
28776
- var _a, _b;
28777
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28778
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28779
- const anyPrice = discountPrice || regularPrice;
28780
- return anyPrice && !displayDiscountedPriceSection(doc2, options);
28781
- };
28782
- const escapeHtml = (source) => {
28783
- if (!source) {
28784
- return source;
28785
- }
28786
- return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
28787
- };
28788
- const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
28789
- if (!value) {
28790
- return 0;
28791
- }
28792
- try {
28793
- return +parseFloat(`${value}`).toFixed(maxDecimal);
28794
- } catch (e2) {
28795
- return `${value}`;
28796
- }
28797
- };
28798
- const capitalize = (value) => {
28799
- if (!value) {
28800
- return "";
28801
- }
28802
- return value.charAt(0).toLocaleUpperCase() + value.slice(1);
28803
- };
28804
- const getAlphanumeric = (value) => {
28805
- if (!value) {
28806
- return "";
28807
- }
28808
- return value.replace(/[\W_]/g, " ");
28809
- };
28810
- const getAdditionalElements = (fields) => {
28811
- return fields.map((key) => ({
28812
- type: "custom",
28813
- key,
28814
- label: capitalize(getAlphanumeric(key)),
28815
- className: "lupa-custom",
28816
- display: (doc2) => Boolean(doc2[key])
28817
- }));
28818
- };
28819
- const addFieldIfKeyExists = (field, key, config) => {
28820
- if (key) {
28821
- return config;
28822
- }
28823
- return { key: field, type: "customHtml", display: () => false };
28824
- };
28825
- const getSearchBoxComponent = ({
28826
- searchBoxOptions,
28827
- labels,
28828
- panelOptions,
28829
- redirections,
28830
- placeholderImage
28831
- }) => {
28832
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
28833
- const panels = [
28834
- ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
28835
- {
28836
- type: SearchBoxPanelType.SUGGESTION,
28837
- queryKey: searchBoxOptions.suggestionQueryKey,
28838
- highlight: true,
28839
- limit: 8,
28840
- labels: {
28841
- topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
28842
- }
28843
- }
28844
- ] : [],
28845
- ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
28846
- {
28847
- type: SearchBoxPanelType.DOCUMENT,
28848
- queryKey: searchBoxOptions.documentQueryKey,
28849
- limit: 5,
28850
- elements: [
28851
- {
28852
- type: "image",
28853
- placeholder: placeholderImage,
28854
- key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
28855
- baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
28856
- },
28857
- {
28858
- type: "title",
28859
- key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
28860
- maxLines: 2
28861
- },
28862
- {
28863
- type: "regularPrice",
28864
- key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
28865
- display: (doc2) => {
28866
- var _a2, _b2, _c2, _d2;
28867
- return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
28868
- }
28869
- },
28870
- {
28871
- type: "price",
28872
- key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
28873
- }
28874
- ]
28875
- }
28876
- ] : []
28877
- ];
28878
- return {
28879
- inputSelector: searchBoxOptions.inputSelector,
28880
- options: {
28881
- environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
28882
- customUrl: searchBoxOptions.customUrl,
28883
- customBaseUrl: searchBoxOptions.customBaseUrl,
28884
- customPayload: searchBoxOptions.customPayload,
28885
- customHeaders: searchBoxOptions.customHeaders
28886
- },
28887
- showTotalCount: true,
28888
- expandOnSinglePanel: true,
28889
- minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
28890
- debounce: 250,
28891
- labels: labels == null ? void 0 : labels.searchBox,
28892
- links: {
28893
- searchResults: ""
28870
+ const DEFAULT_OPTIONS_RESULTS = {
28871
+ options: {
28872
+ environment: "production"
28873
+ },
28874
+ queryKey: "",
28875
+ containerSelector: "#searchResultsContainer",
28876
+ searchTitlePosition: "page-top",
28877
+ labels: {
28878
+ pageSize: "Page size:",
28879
+ sortBy: "Sort by:",
28880
+ itemCount: "Items {1} of {2}",
28881
+ filteredItemCount: "",
28882
+ currency: "€",
28883
+ showMore: "Show more",
28884
+ searchResults: "Search Query: ",
28885
+ emptyResults: "There are no results for the query:",
28886
+ mobileFilterButton: "Filter",
28887
+ htmlTitleTemplate: "Search Query: '{1}'",
28888
+ noResultsSuggestion: "No results found for this query: {1}",
28889
+ didYouMean: "Did you mean to search: {1}",
28890
+ similarQuery: "Search results for phrase {1}",
28891
+ similarQueries: "Similar queries:"
28892
+ },
28893
+ grid: {
28894
+ columns: {
28895
+ xl: 4,
28896
+ l: 3,
28897
+ md: 2,
28898
+ sm: 2,
28899
+ xs: 1
28900
+ }
28901
+ },
28902
+ pagination: {
28903
+ sizeSelection: {
28904
+ position: {
28905
+ top: false,
28906
+ bottom: true
28907
+ },
28908
+ sizes: [12, 24, 36]
28894
28909
  },
28895
- panels,
28896
- redirections,
28897
- history: {
28898
- labels: {
28899
- clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
28900
- }
28910
+ pageSelection: {
28911
+ position: {
28912
+ top: false,
28913
+ bottom: true
28914
+ },
28915
+ display: 5,
28916
+ displayMobile: 3
28901
28917
  }
28902
- };
28903
- };
28904
- const getSearchResultsComponent = ({
28905
- searchResultOptions,
28906
- labels,
28907
- redirections,
28908
- placeholderImage,
28909
- configuratorOverrides,
28910
- callbacks,
28911
- additionalFields
28912
- }) => {
28913
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
28914
- const filters = searchResultOptions.showFacets ? {
28918
+ },
28919
+ sort: [],
28920
+ filters: {
28915
28921
  currentFilters: {
28916
28922
  visibility: {
28917
28923
  mobileSidebar: true,
28918
28924
  mobileToolbar: true
28919
28925
  },
28920
28926
  labels: {
28921
- title: "",
28922
- clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
28927
+ title: "Current filters:",
28928
+ clearAll: "Clear all"
28923
28929
  }
28924
28930
  },
28925
28931
  facets: {
28926
28932
  labels: {
28927
- title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
28928
- showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
28929
- facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
28930
- facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
28933
+ title: "Filters:",
28934
+ showAll: "Show more",
28935
+ facetFilter: "Filter...",
28936
+ facetClear: "Clear"
28931
28937
  },
28932
28938
  filterable: {
28933
28939
  minValues: 5
@@ -28937,179 +28943,230 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28937
28943
  topLevelValueCountLimit: 5,
28938
28944
  filterable: true
28939
28945
  },
28940
- stats: {
28941
- slider: true,
28942
- inputs: true,
28943
- labels: {
28944
- from: "",
28945
- to: ""
28946
- }
28947
- },
28948
- facetValueCountLimit: 8,
28946
+ facetValueCountLimit: 20,
28949
28947
  showDocumentCount: true,
28950
28948
  style: {
28951
28949
  type: "sidebar"
28952
28950
  }
28953
28951
  }
28954
- } : {};
28955
- const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
28956
- xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
28957
- l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
28958
- md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
28959
- sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
28960
- xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
28961
- };
28962
- const badges = {
28963
- badges: {
28964
- anchor: "tr",
28965
- elements: [
28966
- ...searchResultOptions.showRelevance ? [
28967
- {
28968
- key: "",
28969
- type: "customHtml",
28970
- className: "relevance",
28971
- html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
28972
- display: (doc2) => Boolean(doc2._relevance !== void 0)
28973
- }
28974
- ] : [],
28975
- ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
28976
- {
28977
- key: "",
28978
- type: "customHtml",
28979
- className: "boosted-marker",
28980
- html: () => {
28981
- var _a2;
28982
- return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
28983
- },
28984
- display: (doc2) => doc2._boosted === true
28985
- }
28986
- ] : []
28987
- ]
28988
- }
28989
- };
28990
- return __spreadValues(__spreadProps(__spreadValues({
28991
- options: {
28992
- environment: (_m = searchResultOptions.environment) != null ? _m : "production",
28993
- customUrl: searchResultOptions.customUrl,
28994
- customBaseUrl: searchResultOptions.customBaseUrl,
28995
- customPayload: searchResultOptions.customPayload,
28996
- customHeaders: searchResultOptions.customHeaders,
28997
- onError: searchResultOptions.errorHandler
28998
- },
28999
- queryKey: searchResultOptions.queryKey,
29000
- containerSelector: searchResultOptions.containerSelector,
29001
- searchTitlePosition: "search-results-top",
29002
- titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
29003
- labels: labels == null ? void 0 : labels.searchResults,
29004
- grid: {
29005
- columns
29006
- },
29007
- pagination: {
29008
- sizeSelection: {
29009
- position: {
29010
- top: true,
29011
- bottom: false
29012
- },
29013
- sizes: [12, 24, 36, 48]
29014
- },
29015
- pageSelection: {
29016
- position: {
29017
- top: false,
29018
- bottom: true
29019
- },
29020
- displayMobile: 3,
29021
- display: 5
29022
- }
29023
- },
29024
- filters,
29025
- toolbar: {
29026
- layoutSelector: false,
29027
- itemSummary: true,
29028
- clearFilters: false
29029
- },
29030
- isInStock: () => {
29031
- return true;
29032
- }
29033
- }, badges), {
29034
- links: {
29035
- details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
29036
- },
29037
- callbacks,
29038
- routingBehavior: callbacks ? "event" : "direct-link",
29039
- idKey: "id",
29040
- elements: [
29041
- {
29042
- type: "image",
29043
- placeholder: placeholderImage,
29044
- key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
29045
- baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
29046
- display: () => {
29047
- var _a2;
29048
- return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
29049
- }
29050
- },
29051
- addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
29052
- type: "custom",
29053
- className: "lupa-custom-emphasis",
29054
- key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
29055
- display: () => true
29056
- }),
29057
- {
29058
- type: "title",
29059
- key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
29060
- maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
29061
- display: (doc2) => {
29062
- var _a2, _b2;
29063
- return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
29064
- }
29065
- },
29066
- ...getAdditionalElements(additionalFields),
29067
- addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
29068
- key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
29069
- type: "customHtml",
29070
- className: "lupa-price lupa-price-discounted",
29071
- display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
29072
- html: (doc2) => {
29073
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29074
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29075
- const discountPrice = (_d2 = parseFloat(
29076
- doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
29077
- )) == null ? void 0 : _d2.toFixed(2);
29078
- const regularPrice = (_g2 = parseFloat(
29079
- doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
29080
- )) == null ? void 0 : _g2.toFixed(2);
29081
- const discount = `<span class="lupa-discount">${escapeHtml(
29082
- discountPrice
29083
- )} ${currency}</span>`;
29084
- const regular = `<span class="lupa-regular">${escapeHtml(
29085
- regularPrice
29086
- )} ${currency}</span>`;
29087
- return discount + regular;
29088
- }
29089
- }),
29090
- addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
29091
- key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
29092
- type: "customHtml",
29093
- className: "lupa-price lupa-price-single",
29094
- display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
29095
- html: (doc2) => {
29096
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29097
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29098
- const price = (_g2 = parseFloat(
29099
- (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
29100
- )) == null ? void 0 : _g2.toFixed(2);
29101
- return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
29102
- }
29103
- })
29104
- ],
29105
- breadcrumbs: [],
29106
- sort: [],
29107
- redirections
29108
- }), configuratorOverrides);
28952
+ },
28953
+ toolbar: {
28954
+ layoutSelector: true,
28955
+ itemSummary: true,
28956
+ clearFilters: false
28957
+ },
28958
+ isInStock: () => {
28959
+ return true;
28960
+ },
28961
+ badges: {
28962
+ anchor: "tr",
28963
+ elements: []
28964
+ },
28965
+ links: {
28966
+ details: "/{id}"
28967
+ },
28968
+ elements: [],
28969
+ breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28970
+ };
28971
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28972
+ __name: "SearchResultsEntry",
28973
+ props: {
28974
+ searchResultsOptions: {}
28975
+ },
28976
+ setup(__props, { expose: __expose }) {
28977
+ const props = __props;
28978
+ const searchResults2 = ref(null);
28979
+ const fullSearchResultsOptions = computed(() => {
28980
+ const options = lodashExports.cloneDeep(props.searchResultsOptions);
28981
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28982
+ });
28983
+ const fetch2 = () => {
28984
+ var _a;
28985
+ (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28986
+ };
28987
+ __expose({ fetch: fetch2 });
28988
+ return (_ctx, _cache) => {
28989
+ return openBlock(), createBlock(unref(_sfc_main$c), {
28990
+ options: fullSearchResultsOptions.value,
28991
+ ref_key: "searchResults",
28992
+ ref: searchResults2
28993
+ }, null, 8, ["options"]);
28994
+ };
28995
+ }
28996
+ });
28997
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28998
+ __name: "ProductListEntry",
28999
+ props: {
29000
+ productListOptions: {}
29001
+ },
29002
+ setup(__props, { expose: __expose }) {
29003
+ const props = __props;
29004
+ const productList2 = ref(null);
29005
+ const fullProductListOptions = computed(() => {
29006
+ return lodashExports.cloneDeep(props.productListOptions);
29007
+ });
29008
+ const fetch2 = () => {
29009
+ var _a;
29010
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29011
+ };
29012
+ __expose({ fetch: fetch2 });
29013
+ return (_ctx, _cache) => {
29014
+ return openBlock(), createBlock(unref(_sfc_main$a), {
29015
+ options: fullProductListOptions.value,
29016
+ ref_key: "productList",
29017
+ ref: productList2
29018
+ }, null, 8, ["options"]);
29019
+ };
29020
+ }
29021
+ });
29022
+ const QUERY_PARAMS = {
29023
+ QUERY: "q",
29024
+ PAGE: "p",
29025
+ LIMIT: "l",
29026
+ SORT: "s"
29109
29027
  };
29110
- const SearchContainerConfigurationService = {
29111
- getSearchBoxComponent,
29112
- getSearchResultsComponent
29028
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
29029
+ __name: "SearchContainerEntry",
29030
+ props: {
29031
+ searchContainerOptions: {}
29032
+ },
29033
+ setup(__props, { expose: __expose }) {
29034
+ const props = __props;
29035
+ const isOpen = ref(false);
29036
+ const triggerElement = ref(null);
29037
+ const productList2 = ref(null);
29038
+ const containerOptions = computed(() => {
29039
+ return lodashExports.cloneDeep(props.searchContainerOptions);
29040
+ });
29041
+ const focus = () => {
29042
+ const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
29043
+ el == null ? void 0 : el.focus();
29044
+ };
29045
+ const close = () => {
29046
+ isOpen.value = false;
29047
+ };
29048
+ const openSearchContainer = () => {
29049
+ isOpen.value = true;
29050
+ };
29051
+ const checkCloseOnEscape = (e2) => {
29052
+ var _a;
29053
+ if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
29054
+ return;
29055
+ }
29056
+ isOpen.value = false;
29057
+ };
29058
+ const checkExistingQuery = () => {
29059
+ const url = new URL(window.location.href);
29060
+ const param = url.searchParams.get(QUERY_PARAMS.QUERY);
29061
+ if (!param) {
29062
+ return;
29063
+ }
29064
+ isOpen.value = true;
29065
+ };
29066
+ const mountOpenListeners = () => {
29067
+ var _a, _b;
29068
+ triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
29069
+ (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
29070
+ window.addEventListener("keydown", checkCloseOnEscape);
29071
+ };
29072
+ onMounted(() => {
29073
+ var _a, _b;
29074
+ mountOpenListeners();
29075
+ checkExistingQuery();
29076
+ isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
29077
+ });
29078
+ onBeforeUnmount(() => {
29079
+ var _a;
29080
+ (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
29081
+ window.removeEventListener("keydown", checkCloseOnEscape);
29082
+ });
29083
+ const fetch2 = () => {
29084
+ var _a;
29085
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29086
+ };
29087
+ const reloadOptions = () => {
29088
+ var _a;
29089
+ (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
29090
+ };
29091
+ __expose({ fetch: fetch2, reloadOptions });
29092
+ return (_ctx, _cache) => {
29093
+ return openBlock(), createElementBlock("div", null, [
29094
+ containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
29095
+ key: 0,
29096
+ options: containerOptions.value,
29097
+ ref_key: "productList",
29098
+ ref: productList2,
29099
+ "onHook:mounted": focus,
29100
+ onClose: close
29101
+ }, null, 8, ["options"])) : createCommentVNode("", true)
29102
+ ]);
29103
+ };
29104
+ }
29105
+ });
29106
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29107
+ __name: "RecommendationsEntry",
29108
+ props: {
29109
+ recommendationOptions: {}
29110
+ },
29111
+ setup(__props, { expose: __expose }) {
29112
+ const productRecommendations = ref(null);
29113
+ const fetch2 = () => {
29114
+ productRecommendations == null ? void 0 : productRecommendations.fetch();
29115
+ };
29116
+ __expose({ fetch: fetch2 });
29117
+ return (_ctx, _cache) => {
29118
+ return openBlock(), createBlock(unref(_sfc_main$8), {
29119
+ options: _ctx.recommendationOptions,
29120
+ ref_key: "productRecommendations",
29121
+ ref: productRecommendations
29122
+ }, null, 8, ["options"]);
29123
+ };
29124
+ }
29125
+ });
29126
+ const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
29127
+ const createShadowDom = (shadowId, managerId) => {
29128
+ let host = document.getElementById(shadowId);
29129
+ if (host) {
29130
+ host.remove();
29131
+ }
29132
+ host = document.createElement("div");
29133
+ const manager = document.createElement("div");
29134
+ host.setAttribute("id", shadowId);
29135
+ manager == null ? void 0 : manager.setAttribute("id", managerId);
29136
+ return { host, manager };
29137
+ };
29138
+ const attatchShadowDom = ({
29139
+ host,
29140
+ manager,
29141
+ styleUrl,
29142
+ options
29143
+ }) => {
29144
+ var _a;
29145
+ if (host.shadowRoot) {
29146
+ return;
29147
+ }
29148
+ const link = document.createElement("link");
29149
+ link.type = "text/css";
29150
+ link.rel = "stylesheet";
29151
+ link.href = styleUrl;
29152
+ const fontLink = document.createElement("link");
29153
+ fontLink.type = "text/css";
29154
+ fontLink.rel = "stylesheet";
29155
+ fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
29156
+ document.head.appendChild(fontLink);
29157
+ const materialIconLink = document.createElement("link");
29158
+ materialIconLink.type = "text/css";
29159
+ materialIconLink.rel = "stylesheet";
29160
+ materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
29161
+ document.head.appendChild(materialIconLink);
29162
+ const shadow = host.attachShadow({ mode: "open" });
29163
+ shadow.appendChild(manager);
29164
+ shadow.appendChild(link);
29165
+ if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
29166
+ const style = document.createElement("style");
29167
+ style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
29168
+ shadow.appendChild(style);
29169
+ }
29113
29170
  };
29114
29171
  const getMountElement = (element, mountingBehavior = "replace", mountToParent) => {
29115
29172
  const parent = element == null ? void 0 : element.parentElement;
@@ -29140,7 +29197,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29140
29197
  return;
29141
29198
  }
29142
29199
  let mountedComponent = null;
29143
- const props = reactive(__spreadValues({}, options));
29200
+ const props = reactive(__spreadValues2({}, options));
29144
29201
  const app2 = createApp({
29145
29202
  render: () => mountedComponent = h$1(rootComponent, props)
29146
29203
  });
@@ -29159,9 +29216,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29159
29216
  recommendations: {},
29160
29217
  chat: {}
29161
29218
  };
29162
- const tracking = (options) => {
29163
- setupTracking(options);
29164
- };
29165
29219
  const applySearchBox = (options, mountOptions) => {
29166
29220
  const existingInstance = app.box[options.inputSelector];
29167
29221
  if (existingInstance) {
@@ -29190,7 +29244,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29190
29244
  var _a;
29191
29245
  const inputs = (_a = options.inputSelector) == null ? void 0 : _a.split(",");
29192
29246
  for (const input of inputs) {
29193
- applySearchBox(__spreadProps(__spreadValues({}, options), { inputSelector: input.trim() }), mountOptions);
29247
+ applySearchBox(__spreadProps2(__spreadValues2({}, options), { inputSelector: input.trim() }), mountOptions);
29194
29248
  }
29195
29249
  };
29196
29250
  const searchResults = (options, mountOptions) => {
@@ -29426,7 +29480,238 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29426
29480
  } catch (e2) {
29427
29481
  }
29428
29482
  };
29483
+ const saveToLocalStorage = (key, value) => {
29484
+ try {
29485
+ localStorage.setItem(key, JSON.stringify(value));
29486
+ } catch (e2) {
29487
+ }
29488
+ };
29489
+ const tryLoadFromLocalStorage = (key) => {
29490
+ try {
29491
+ const item = localStorage.getItem(key);
29492
+ return item ? JSON.parse(item) : null;
29493
+ } catch (e2) {
29494
+ return null;
29495
+ }
29496
+ };
29497
+ const saveToSessionStorage = (key, value) => {
29498
+ try {
29499
+ sessionStorage.setItem(key, JSON.stringify(value));
29500
+ } catch (e2) {
29501
+ }
29502
+ };
29503
+ const tryLoadFromSessionStorage = (key) => {
29504
+ try {
29505
+ const item = sessionStorage.getItem(key);
29506
+ return item ? JSON.parse(item) : null;
29507
+ } catch (e2) {
29508
+ return null;
29509
+ }
29510
+ };
29511
+ const getQueryParam = (name) => {
29512
+ try {
29513
+ const urlParams = new URLSearchParams(window.location.search);
29514
+ return urlParams.get(name);
29515
+ } catch (e2) {
29516
+ return null;
29517
+ }
29518
+ };
29519
+ const PREVIEW_PARAMETER = "lupaSearchPreview";
29520
+ let styleElement = null;
29521
+ const waitForElementToBeVisible = (element, retries = 0, maxRetries = 10, interval = 10) => __async2(this, null, function* () {
29522
+ if (retries > maxRetries) {
29523
+ return false;
29524
+ }
29525
+ if (typeof element === "string") {
29526
+ element = document.querySelector(element);
29527
+ }
29528
+ if (element) {
29529
+ return true;
29530
+ } else {
29531
+ setTimeout(() => {
29532
+ waitForElementToBeVisible(element, retries + 1, maxRetries, interval + 10);
29533
+ }, interval);
29534
+ }
29535
+ });
29536
+ const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async2(this, null, function* () {
29537
+ const configuration2 = yield fetchPluginConfiguration(
29538
+ options,
29539
+ configurationKey
29540
+ );
29541
+ if (!configuration2) {
29542
+ console.error(`Failed to fetch LupaSearch plugin configuration for key ${configurationKey}`);
29543
+ return null;
29544
+ }
29545
+ saveToLocalStorage(configurationKey, configuration2);
29546
+ return configuration2;
29547
+ });
29548
+ const checkIsPreviewMode = () => {
29549
+ const isPreviewModeSaved = tryLoadFromSessionStorage(PREVIEW_PARAMETER);
29550
+ if (isPreviewModeSaved) {
29551
+ return isPreviewModeSaved;
29552
+ }
29553
+ const isPreviewMode = getQueryParam(PREVIEW_PARAMETER) === "true";
29554
+ if (isPreviewMode) {
29555
+ saveToSessionStorage(PREVIEW_PARAMETER, isPreviewMode);
29556
+ } else {
29557
+ saveToSessionStorage(PREVIEW_PARAMETER, false);
29558
+ }
29559
+ return isPreviewMode;
29560
+ };
29561
+ const loadConfigurations = (configurationKey, isPreviewMode, options) => __async2(this, null, function* () {
29562
+ if (isPreviewMode) {
29563
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29564
+ }
29565
+ const existingConfiguration = tryLoadFromLocalStorage(configurationKey);
29566
+ if (existingConfiguration) {
29567
+ setTimeout(() => __async2(this, null, function* () {
29568
+ var _a;
29569
+ const newestConfiguration = yield loadAndSaveConfigurationFromServer(
29570
+ configurationKey,
29571
+ options
29572
+ );
29573
+ if (existingConfiguration.updatedAt === newestConfiguration.updatedAt) {
29574
+ return;
29575
+ }
29576
+ const isPreviewMode2 = checkIsPreviewMode();
29577
+ const configuration2 = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
29578
+ yield mount(configuration2, false);
29579
+ }), 5e3);
29580
+ return existingConfiguration;
29581
+ }
29582
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29583
+ });
29584
+ const applyStyles = (configuration2) => __async2(this, null, function* () {
29585
+ var _a;
29586
+ const visible2 = yield waitForElementToBeVisible(document.head);
29587
+ if (!visible2) {
29588
+ console.error("Failed to apply custom LupaSearch styles, head element not found");
29589
+ return;
29590
+ }
29591
+ const baseStyleLink = configuration2.baseStyleLink;
29592
+ if (styleElement) {
29593
+ styleElement.remove();
29594
+ }
29595
+ styleElement = document.createElement("style");
29596
+ if (baseStyleLink) {
29597
+ styleElement.innerHTML = `
29598
+ @import url('${baseStyleLink}');
29599
+ @import url('https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css')
29600
+ ${(_a = configuration2.customStyles) != null ? _a : ""}
29601
+ `;
29602
+ }
29603
+ document.head.appendChild(styleElement);
29604
+ });
29605
+ const mountSearchBox = (configuration, fetch = true) => __async2(this, null, function* () {
29606
+ if (!configuration.searchBox) {
29607
+ return;
29608
+ }
29609
+ const resolvedConfiguration = eval(`(${configuration.searchBox})`);
29610
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.inputSelector);
29611
+ if (!visible) {
29612
+ console.error(
29613
+ `Failed to mount LupaSearch search box, input element ${resolvedConfiguration.inputSelector} not found`
29614
+ );
29615
+ return;
29616
+ }
29617
+ searchBox(resolvedConfiguration, { fetch });
29618
+ });
29619
+ const mountSearchResults = (configuration, fetch = true) => __async2(this, null, function* () {
29620
+ if (!configuration.searchResults) {
29621
+ return;
29622
+ }
29623
+ const resolvedConfiguration = eval(`(${configuration.searchResults})`);
29624
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29625
+ if (!visible) {
29626
+ console.error(
29627
+ `Failed to mount LupaSearch search results, element ${resolvedConfiguration.containerSelector} not found`
29628
+ );
29629
+ return;
29630
+ }
29631
+ searchResults(resolvedConfiguration, { fetch });
29632
+ });
29633
+ const mountProductList = (configuration, fetch = true) => __async2(this, null, function* () {
29634
+ if (!configuration.productList) {
29635
+ return;
29636
+ }
29637
+ const resolvedSearchResultsConfiguration = eval(
29638
+ `(${configuration.searchResults})`
29639
+ );
29640
+ const resolvedConfiguration = eval(`(${configuration.productList})`);
29641
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29642
+ if (!visible) {
29643
+ console.error(
29644
+ `Failed to mount LupaSearch product list, element ${resolvedConfiguration.containerSelector} not found`
29645
+ );
29646
+ return;
29647
+ }
29648
+ productList(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29649
+ });
29650
+ const mountRecommendations = (configuration, fetch = true) => __async2(this, null, function* () {
29651
+ if (!configuration.recommendations) {
29652
+ return;
29653
+ }
29654
+ const resolvedSearchResultsConfiguration = eval(
29655
+ `(${configuration.searchResults})`
29656
+ );
29657
+ const resolvedConfiguration = eval(
29658
+ `(${configuration.recommendations})`
29659
+ );
29660
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29661
+ if (!visible) {
29662
+ console.error(
29663
+ `Failed to mount LupaSearch recommendations, element ${resolvedConfiguration.containerSelector} not found`
29664
+ );
29665
+ return;
29666
+ }
29667
+ recommendations(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29668
+ });
29669
+ const mountChat = (configuration, fetch = true) => __async2(this, null, function* () {
29670
+ if (!configuration.genAiChat) {
29671
+ return;
29672
+ }
29673
+ const resolvedSearchResultsConfiguration = eval(
29674
+ `(${configuration.searchResults})`
29675
+ );
29676
+ const resolvedConfiguration = eval(`(${configuration.genAiChat})`);
29677
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29678
+ if (!visible) {
29679
+ console.error(
29680
+ `Failed to mount LupaSearch chat, element ${resolvedConfiguration.containerSelector} not found`
29681
+ );
29682
+ return;
29683
+ }
29684
+ chat(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29685
+ });
29686
+ const mount = (configuration2, fetch2 = true) => __async2(this, null, function* () {
29687
+ yield applyStyles(configuration2);
29688
+ const mountPromises = [
29689
+ mountSearchBox(configuration2, fetch2),
29690
+ mountSearchResults(configuration2, fetch2),
29691
+ mountProductList(configuration2, fetch2),
29692
+ mountRecommendations(configuration2, fetch2),
29693
+ mountChat(configuration2, fetch2)
29694
+ ];
29695
+ yield Promise.all(mountPromises);
29696
+ });
29697
+ const init$1 = (configurationKey, options) => __async2(this, null, function* () {
29698
+ var _a;
29699
+ const isPreviewMode = checkIsPreviewMode();
29700
+ const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
29701
+ const configuration2 = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
29702
+ yield mount(configuration2);
29703
+ });
29704
+ const PluginConfigurationManager = {
29705
+ init: init$1
29706
+ };
29707
+ const tracking = (options) => {
29708
+ setupTracking(options);
29709
+ };
29710
+ const init = (configurationKey, options) => {
29711
+ return PluginConfigurationManager.init(configurationKey, options);
29712
+ };
29429
29713
  const lupaSearch = {
29714
+ init,
29430
29715
  searchBox,
29431
29716
  searchResults,
29432
29717
  tracking,
@@ -29448,9 +29733,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29448
29733
  window.getLupa = lupaSearch;
29449
29734
  window.lupaSearch = lupaSearch;
29450
29735
  }
29451
- exports2.BadgeType = BadgeType;
29452
- exports2.DocumentElementType = DocumentElementType;
29453
- exports2.SearchBoxPanelType = SearchBoxPanelType;
29454
- exports2.default = lupaSearch;
29455
- Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
29736
+ exports.BadgeType = BadgeType;
29737
+ exports.DocumentElementType = DocumentElementType;
29738
+ exports.SearchBoxPanelType = SearchBoxPanelType;
29739
+ exports.default = lupaSearch;
29740
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
29456
29741
  });