@getlupa/client 0.10.1 → 0.10.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.
Files changed (61) hide show
  1. package/dist/cjs/components/search-box/SearchBox.vue.d.ts +6 -1
  2. package/dist/cjs/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  3. package/dist/cjs/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
  4. package/dist/cjs/components/search-results/SearchResults.vue.d.ts +3 -0
  5. package/dist/cjs/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  6. package/dist/cjs/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  7. package/dist/cjs/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
  8. package/dist/cjs/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  9. package/dist/cjs/constants/development/searchBoxDev.example.const.d.ts +1 -0
  10. package/dist/cjs/constants/development/searchResultsDev.example.const.d.ts +1 -0
  11. package/dist/cjs/constants/global.const.d.ts +1 -0
  12. package/dist/cjs/index.min.js +366 -147
  13. package/dist/cjs/store/modules/tracking.d.ts +3 -1
  14. package/dist/cjs/types/AnalyticsOptions.d.ts +3 -2
  15. package/dist/cjs/types/search-box/Common.d.ts +1 -0
  16. package/dist/cjs/types/search-box/SearchBoxOptions.d.ts +1 -0
  17. package/dist/cjs/types/search-container/SearchContainerOptions.d.ts +1 -0
  18. package/dist/cjs/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
  19. package/dist/cjs/utils/shadowDom.utils.d.ts +5 -0
  20. package/dist/containerStyle.js +1 -0
  21. package/dist/es/components/search-box/SearchBox.vue.d.ts +6 -1
  22. package/dist/es/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  23. package/dist/es/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
  24. package/dist/es/components/search-results/SearchResults.vue.d.ts +3 -0
  25. package/dist/es/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  26. package/dist/es/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  27. package/dist/es/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
  28. package/dist/es/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  29. package/dist/es/constants/development/searchBoxDev.example.const.d.ts +1 -0
  30. package/dist/es/constants/development/searchResultsDev.example.const.d.ts +1 -0
  31. package/dist/es/constants/global.const.d.ts +1 -0
  32. package/dist/es/index.min.js +366 -147
  33. package/dist/es/store/modules/tracking.d.ts +3 -1
  34. package/dist/es/types/AnalyticsOptions.d.ts +3 -2
  35. package/dist/es/types/search-box/Common.d.ts +1 -0
  36. package/dist/es/types/search-box/SearchBoxOptions.d.ts +1 -0
  37. package/dist/es/types/search-container/SearchContainerOptions.d.ts +1 -0
  38. package/dist/es/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
  39. package/dist/es/utils/shadowDom.utils.d.ts +5 -0
  40. package/dist/iife/components/search-box/SearchBox.vue.d.ts +6 -1
  41. package/dist/iife/components/search-box/SearchBoxInput.vue.d.ts +2 -0
  42. package/dist/iife/components/search-box/products/SearchBoxProduct.vue.d.ts +1 -0
  43. package/dist/iife/components/search-results/SearchResults.vue.d.ts +3 -0
  44. package/dist/iife/components/search-results/SearchResultsTitle.vue.d.ts +2 -0
  45. package/dist/iife/components/search-results/products/SearchResultsToolbar.vue.d.ts +1 -0
  46. package/dist/iife/components/search-results/products/product-card/SearchResultsProductCard.vue.d.ts +1 -0
  47. package/dist/iife/components/search-results/products/product-card/elements/SearchResultsProductCustom.vue.d.ts +2 -0
  48. package/dist/iife/constants/development/searchBoxDev.example.const.d.ts +1 -0
  49. package/dist/iife/constants/development/searchResultsDev.example.const.d.ts +1 -0
  50. package/dist/iife/constants/global.const.d.ts +1 -0
  51. package/dist/iife/index.min.js +1 -1
  52. package/dist/iife/store/modules/tracking.d.ts +3 -1
  53. package/dist/iife/types/AnalyticsOptions.d.ts +3 -2
  54. package/dist/iife/types/search-box/Common.d.ts +1 -0
  55. package/dist/iife/types/search-box/SearchBoxOptions.d.ts +1 -0
  56. package/dist/iife/types/search-container/SearchContainerOptions.d.ts +1 -0
  57. package/dist/iife/types/search-results/SearchResultsProductCardOptions.d.ts +1 -0
  58. package/dist/iife/utils/shadowDom.utils.d.ts +5 -0
  59. package/dist/lupaContainerStyle.css +1 -0
  60. package/dist/style.css +1 -1
  61. package/package.json +3 -2
@@ -10980,7 +10980,7 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10980
10980
  if (target) {
10981
10981
  this.inputValue = target.value;
10982
10982
  }
10983
- this.$emit("input", this.inputValue.replace(/\s+$/, ""));
10983
+ this.$emit("input", this.inputValue);
10984
10984
  }
10985
10985
  handleFocus() {
10986
10986
  this.$emit("focus");
@@ -10988,6 +10988,13 @@ let SearchBoxInput = class SearchBoxInput extends Vue$1 {
10988
10988
  this.handleInput();
10989
10989
  }
10990
10990
  }
10991
+ clear() {
10992
+ this.$emit("input", "");
10993
+ }
10994
+ focus() {
10995
+ var _a, _b;
10996
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.mainInput) === null || _b === void 0 ? void 0 : _b.focus();
10997
+ }
10991
10998
  };
10992
10999
  __decorate([
10993
11000
  Prop()
@@ -11157,6 +11164,14 @@ var __vue_render__$1b = function () {
11157
11164
  var _h = _vm.$createElement;
11158
11165
  var _c = _vm._self._c || _h;
11159
11166
  return _c("div", { attrs: { id: "lupa-search-box-input-container" } }, [
11167
+ _c("div", { staticClass: "lupa-input-clear" }, [
11168
+ _c("div", {
11169
+ staticClass: "lupa-input-clear-content",
11170
+ class: { "lupa-input-clear-filled": _vm.inputValue },
11171
+ on: { click: _vm.clear },
11172
+ }),
11173
+ ]),
11174
+ _vm._v(" "),
11160
11175
  _c("div", { attrs: { id: "lupa-search-box-input" } }, [
11161
11176
  _c("input", {
11162
11177
  staticClass: "lupa-hint",
@@ -11178,6 +11193,7 @@ var __vue_render__$1b = function () {
11178
11193
  expression: "inputValue",
11179
11194
  },
11180
11195
  ],
11196
+ ref: "mainInput",
11181
11197
  staticClass: "lupa-search-box-input-field",
11182
11198
  attrs: {
11183
11199
  autocomplete: "off",
@@ -11217,7 +11233,13 @@ var __vue_render__$1b = function () {
11217
11233
  },
11218
11234
  },
11219
11235
  },
11220
- [_c("span", { staticClass: "lupa-close-action" }, [_vm._v("×")])]
11236
+ [
11237
+ _vm.labels.close
11238
+ ? _c("span", { staticClass: "lupa-close-label" }, [
11239
+ _vm._v(_vm._s(_vm.labels.close)),
11240
+ ])
11241
+ : _vm._e(),
11242
+ ]
11221
11243
  )
11222
11244
  : _vm._e(),
11223
11245
  ])
@@ -11228,7 +11250,7 @@ __vue_render__$1b._withStripped = true;
11228
11250
  /* style */
11229
11251
  const __vue_inject_styles__$1b = function (inject) {
11230
11252
  if (!inject) return
11231
- inject("data-v-ccec518c_0", { source: "\n.lupa-search-box-input-field,\n.lupa-hint {\n width: 100%;\n}\n.lupa-search-box-input-field {\n position: relative !important;\n background: transparent !important;\n}\n.lupa-hint {\n opacity: 0.5;\n position: absolute !important;\n pointer-events: none;\n}\n", map: undefined, media: undefined });
11253
+ inject("data-v-219ea03b_0", { source: "\n.lupa-search-box-input-field,\n.lupa-hint {\n width: 100%;\n}\n.lupa-search-box-input-field {\n position: relative !important;\n background: transparent !important;\n}\n.lupa-hint {\n opacity: 0.5;\n position: absolute !important;\n pointer-events: none;\n}\n.lupa-input-clear {\n display: none;\n}\n", map: undefined, media: undefined });
11232
11254
 
11233
11255
  };
11234
11256
  /* scoped */
@@ -11962,7 +11984,8 @@ const MAX_FACET_VALUES = 5000;
11962
11984
  const CURRENCY_KEY_INDICATOR = "price";
11963
11985
  const DEFAULT_PAGE_SIZE = 12;
11964
11986
  const DEFAULT_PAGE_SIZE_SELECTION = [12, 24, 36, 60];
11965
- const LUPA_ROUTING_EVENT = "lupaRedirect";
11987
+ const LUPA_ROUTING_EVENT = "lupaRedirect";
11988
+ const DEFAULT_CONTAINER_STYLE = "containerStyle.css";
11966
11989
 
11967
11990
  const formatRange = (filter) => {
11968
11991
  var _a, _b;
@@ -12210,7 +12233,7 @@ const getRelativePath = (link) => {
12210
12233
  }
12211
12234
  catch (_a) {
12212
12235
  // Invalid url, let's return original string
12213
- return link;
12236
+ return (link === null || link === void 0 ? void 0 : link.endsWith("/")) ? link.slice(0, link.length - 1) : link;
12214
12237
  }
12215
12238
  };
12216
12239
  // Checks if url links match absolutely, or if their relative parts are equal
@@ -12268,7 +12291,18 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
12268
12291
  }
12269
12292
  return "";
12270
12293
  }
12294
+ get title() {
12295
+ if (!this.panelOptions.titleKey) {
12296
+ return "";
12297
+ }
12298
+ const title = this.item[this.panelOptions.titleKey] || "";
12299
+ this.addHistory({
12300
+ item: title,
12301
+ });
12302
+ return title;
12303
+ }
12271
12304
  handleClick(event) {
12305
+ var _a;
12272
12306
  if (this.panelOptions.titleKey) {
12273
12307
  this.addHistory({
12274
12308
  item: this.item[this.panelOptions.titleKey] || "",
@@ -12285,7 +12319,7 @@ let SearchBoxProduct = class SearchBoxProduct extends Vue$1 {
12285
12319
  type: "itemClick",
12286
12320
  analytics: {
12287
12321
  type: "autocomplete_product_click",
12288
- label: this.link,
12322
+ label: (_a = this.title) !== null && _a !== void 0 ? _a : this.link,
12289
12323
  },
12290
12324
  },
12291
12325
  });
@@ -13328,8 +13362,9 @@ let SearchBoxMainPanel = class SearchBoxMainPanel extends Vue$1 {
13328
13362
  this.sdkOptions = this.options.options;
13329
13363
  }
13330
13364
  get displayResults() {
13331
- var _a;
13332
- return ((_a = this.inputValue) === null || _a === void 0 ? void 0 : _a.length) >= this.options.minInputLength;
13365
+ var _a, _b;
13366
+ return (((_a = this.inputValue) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
13367
+ ((_b = this.inputValue) === null || _b === void 0 ? void 0 : _b.length) >= this.options.minInputLength);
13333
13368
  }
13334
13369
  get displayHistory() {
13335
13370
  var _a;
@@ -13528,7 +13563,7 @@ __vue_render__$V._withStripped = true;
13528
13563
  /* style */
13529
13564
  const __vue_inject_styles__$V = function (inject) {
13530
13565
  if (!inject) return
13531
- inject("data-v-d48b96f0_0", { source: "#lupa-search-box-panel {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.lupa-more-results {\n text-align: center;\n}", map: undefined, media: undefined });
13566
+ inject("data-v-947d134e_0", { source: "#lupa-search-box-panel {\n display: flex;\n justify-content: space-between;\n flex-direction: column;\n}\n.lupa-more-results {\n text-align: center;\n}", map: undefined, media: undefined });
13532
13567
 
13533
13568
  };
13534
13569
  /* scoped */
@@ -30820,12 +30855,16 @@ let SearchBox = class SearchBox extends Vue$1 {
30820
30855
  return (_a = this.options.searchTriggers) !== null && _a !== void 0 ? _a : [];
30821
30856
  }
30822
30857
  mounted() {
30858
+ var _a, _b;
30823
30859
  window.addEventListener("keydown", this.handleKeyDown);
30824
30860
  window.addEventListener("click", this.handleMouseClick);
30825
30861
  this.setSearchResultsLink(this.options.links.searchResults);
30826
30862
  this.saveOptions({ options: this.options });
30827
30863
  this.setSearchBoxOptions({ options: this.options });
30828
30864
  bindSearchTriggers(this.searchTriggers, this.handleCurrentValueSearch);
30865
+ if (this.isSearchContainer) {
30866
+ (_b = (_a = this.$refs) === null || _a === void 0 ? void 0 : _a.searchBoxInput) === null || _b === void 0 ? void 0 : _b.focus();
30867
+ }
30829
30868
  }
30830
30869
  beforeDestroy() {
30831
30870
  window.removeEventListener("keydown", this.handleKeyDown);
@@ -30863,11 +30902,12 @@ let SearchBox = class SearchBox extends Vue$1 {
30863
30902
  }
30864
30903
  handleInput(value) {
30865
30904
  this.opened = true;
30866
- this.inputValue = value;
30905
+ this.inputValue = value.replace(/\s+$/, "");
30867
30906
  this.suggestedValue = defaultSuggestedValue;
30907
+ this.trackSearchQuery(value);
30868
30908
  if (this.isSearchContainer) {
30869
30909
  this.goToResultsDebounced({
30870
- searchText: this.searchValue,
30910
+ searchText: value,
30871
30911
  });
30872
30912
  }
30873
30913
  }
@@ -30957,11 +30997,22 @@ let SearchBox = class SearchBox extends Vue$1 {
30957
30997
  type: "itemClick",
30958
30998
  analytics: {
30959
30999
  type: "autocomplete_product_click",
30960
- label: doc.doc.url || doc.id,
31000
+ label: doc.title || doc.id,
30961
31001
  },
30962
31002
  },
30963
31003
  });
30964
31004
  }
31005
+ trackSearchQuery(query) {
31006
+ if (!query) {
31007
+ return;
31008
+ }
31009
+ this.trackSearch({
31010
+ queryKey: this.suggestedValue.queryKey,
31011
+ query: {
31012
+ searchText: query,
31013
+ },
31014
+ });
31015
+ }
30965
31016
  trackSuggestionClick(suggestion) {
30966
31017
  var _a;
30967
31018
  if (suggestion ||
@@ -30976,7 +31027,7 @@ let SearchBox = class SearchBox extends Vue$1 {
30976
31027
  searchQuery: this.inputValue,
30977
31028
  type: "suggestionClick",
30978
31029
  analytics: {
30979
- type: "autocomplete_keyword_click",
31030
+ type: "autocomplete_suggestion_click",
30980
31031
  label: suggestion || this.searchValue,
30981
31032
  },
30982
31033
  },
@@ -31008,6 +31059,9 @@ __decorate([
31008
31059
  __decorate([
31009
31060
  tracking$4.Action("track")
31010
31061
  ], SearchBox.prototype, "trackClick", void 0);
31062
+ __decorate([
31063
+ tracking$4.Action("trackSearch")
31064
+ ], SearchBox.prototype, "trackSearch", void 0);
31011
31065
  __decorate([
31012
31066
  params$e.Action("setSearchResultsLink")
31013
31067
  ], SearchBox.prototype, "setSearchResultsLink", void 0);
@@ -31042,6 +31096,7 @@ var __vue_render__$U = function () {
31042
31096
  { staticClass: "lupa-search-box-wrapper" },
31043
31097
  [
31044
31098
  _c("SearchBoxInput", {
31099
+ ref: "searchBoxInput",
31045
31100
  attrs: {
31046
31101
  options: _vm.inputOptions,
31047
31102
  suggestedValue: _vm.suggestedValue,
@@ -31081,7 +31136,7 @@ __vue_render__$U._withStripped = true;
31081
31136
  /* style */
31082
31137
  const __vue_inject_styles__$U = function (inject) {
31083
31138
  if (!inject) return
31084
- inject("data-v-ed058b02_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
31139
+ inject("data-v-49023ab6_0", { source: "\n#lupa-search-box {\n width: 100%;\n}\n.lupa-search-box-wrapper {\n position: relative;\n}\n", map: undefined, media: undefined });
31085
31140
 
31086
31141
  };
31087
31142
  /* scoped */
@@ -33058,6 +33113,7 @@ __vue_render__$L._withStripped = true;
33058
33113
  );
33059
33114
 
33060
33115
  const RESULT_ROOT_ID = "lupa-search-results";
33116
+ const SHADOW_ROOT_ID = "lupa-shadow-id";
33061
33117
  const CONTAINER_ROOT_ID = "lupa-search-container";
33062
33118
  const scrollToSearchResults = (timeout = 500) => {
33063
33119
  if (timeout) {
@@ -33068,12 +33124,19 @@ const scrollToSearchResults = (timeout = 500) => {
33068
33124
  }
33069
33125
  };
33070
33126
  const scrollTo = (elementId) => {
33071
- const el = document.getElementById(elementId);
33127
+ var _a, _b;
33128
+ let el = document.getElementById(elementId);
33129
+ const shadowRoot = (_a = document.getElementById(SHADOW_ROOT_ID)) === null || _a === void 0 ? void 0 : _a.shadowRoot;
33130
+ if (!el) {
33131
+ el = (_b = shadowRoot === null || shadowRoot === void 0 ? void 0 : shadowRoot.getElementById(elementId)) !== null && _b !== void 0 ? _b : null;
33132
+ }
33072
33133
  if (!el) {
33073
33134
  return;
33074
33135
  }
33075
- const serchContainer = document.getElementById(CONTAINER_ROOT_ID);
33076
- const container = serchContainer !== null && serchContainer !== void 0 ? serchContainer : window;
33136
+ const searchContainer = shadowRoot
33137
+ ? shadowRoot.getElementById(CONTAINER_ROOT_ID)
33138
+ : undefined;
33139
+ const container = searchContainer !== null && searchContainer !== void 0 ? searchContainer : window;
33077
33140
  container.scrollTo({
33078
33141
  top: el.offsetTop,
33079
33142
  behavior: "smooth",
@@ -34539,6 +34602,7 @@ var __vue_render__$x = function () {
34539
34602
  {
34540
34603
  staticClass: "lupa-search-results-product-title",
34541
34604
  style: "-webkit-line-clamp: " + _vm.maxLines,
34605
+ attrs: { title: _vm.title },
34542
34606
  },
34543
34607
  [
34544
34608
  !_vm.options.link
@@ -35043,9 +35107,17 @@ __vue_render__$s._withStripped = true;
35043
35107
  );
35044
35108
 
35045
35109
  let SearchResultsProductCustom = class SearchResultsProductCustom extends Vue$1 {
35046
- get text() {
35110
+ get value() {
35047
35111
  return this.item[this.options.key];
35048
35112
  }
35113
+ get text() {
35114
+ return this.isArray
35115
+ ? this.item[this.options.key].join(", ")
35116
+ : this.item[this.options.key];
35117
+ }
35118
+ get isArray() {
35119
+ return Array.isArray(this.value);
35120
+ }
35049
35121
  get className() {
35050
35122
  return this.options.className;
35051
35123
  }
@@ -35363,10 +35435,14 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35363
35435
  });
35364
35436
  }
35365
35437
  get id() {
35366
- if (this.options.idKey) {
35367
- return this.product[this.options.idKey];
35368
- }
35369
- return "";
35438
+ return this.options.idKey
35439
+ ? this.product[this.options.idKey]
35440
+ : "";
35441
+ }
35442
+ get title() {
35443
+ return this.options.titleKey
35444
+ ? this.product[this.options.titleKey]
35445
+ : "";
35370
35446
  }
35371
35447
  handleClick() {
35372
35448
  var _a, _b;
@@ -35376,6 +35452,10 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35376
35452
  itemId: this.id,
35377
35453
  searchQuery: this.query,
35378
35454
  type: "itemClick",
35455
+ analytics: {
35456
+ type: "search_product_click",
35457
+ label: this.title || this.id || this.link,
35458
+ },
35379
35459
  },
35380
35460
  });
35381
35461
  (_b = (_a = this.searchResultOptions.callbacks) === null || _a === void 0 ? void 0 : _a.onProductClick) === null || _b === void 0 ? void 0 : _b.call(_a, {
@@ -35392,8 +35472,8 @@ let SearchResultsProductCard = class SearchResultsProductCard extends Vue$1 {
35392
35472
  type: item.type,
35393
35473
  analytics: item.type === "addToCart"
35394
35474
  ? {
35395
- type: "add_to_cart",
35396
- label: this.link,
35475
+ type: "search_add_to_cart",
35476
+ label: this.title || this.id || this.link,
35397
35477
  }
35398
35478
  : undefined,
35399
35479
  },
@@ -35563,7 +35643,7 @@ __vue_render__$o._withStripped = true;
35563
35643
 
35564
35644
  const initAnalyticsTracking = (analyticsOptions) => {
35565
35645
  try {
35566
- if ((analyticsOptions === null || analyticsOptions === void 0 ? void 0 : analyticsOptions.enabled) && analyticsOptions.type === "ua") {
35646
+ if (analyticsOptions === null || analyticsOptions === void 0 ? void 0 : analyticsOptions.enabled) {
35567
35647
  window.sessionStorage.setItem(TRACKING_ANALYTICS_KEY, JSON.stringify(analyticsOptions));
35568
35648
  }
35569
35649
  else {
@@ -35708,25 +35788,66 @@ const sendGa = (name, ...args) => {
35708
35788
  });
35709
35789
  };
35710
35790
  const trackAnalyticsEvent = (data) => {
35711
- var _a;
35791
+ var _a, _b, _c;
35712
35792
  try {
35713
35793
  const options = JSON.parse((_a = window.sessionStorage.getItem(TRACKING_ANALYTICS_KEY)) !== null && _a !== void 0 ? _a : "{}");
35714
- if (!data.analytics || !options.enabled) {
35794
+ if (!data.analytics ||
35795
+ !options.enabled ||
35796
+ ((_b = options.ignoreEvents) === null || _b === void 0 ? void 0 : _b.includes((_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type))) {
35715
35797
  return;
35716
35798
  }
35717
- const ga = window.ga;
35718
- if (!ga) {
35719
- console.error("Google Analytics object not found");
35720
- return;
35799
+ switch (options.type) {
35800
+ case "ua":
35801
+ sendUaAnalyticsEvent(data, options);
35802
+ break;
35803
+ case "ga4":
35804
+ sendGa4AnalyticsEvent(data, options);
35805
+ break;
35806
+ case "debug":
35807
+ processDebugEvent(data);
35808
+ break;
35809
+ default:
35810
+ sendUaAnalyticsEvent(data, options);
35721
35811
  }
35722
- sendGa("send", "event", options.parentEventName, data.analytics.type, data.analytics.label);
35723
35812
  }
35724
- catch (_b) {
35813
+ catch (_d) {
35725
35814
  console.error("Unable to send an event to google analytics");
35726
35815
  }
35727
35816
  };
35817
+ const sendUaAnalyticsEvent = (data, options) => {
35818
+ var _a, _b, _c, _d;
35819
+ const ga = window.ga;
35820
+ if (!ga) {
35821
+ console.error("Google Analytics object not found");
35822
+ return;
35823
+ }
35824
+ sendGa("send", "event", options.parentEventName, (_b = (_a = data.analytics) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : "", (_d = (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : "");
35825
+ };
35826
+ const sendGa4AnalyticsEvent = (data, options) => {
35827
+ var _a, _b, _c, _d;
35828
+ if (!window || !window.dataLayer) {
35829
+ console.error("dataLayer object not found.");
35830
+ return;
35831
+ }
35832
+ const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
35833
+ const params = {
35834
+ search_text: data.searchQuery,
35835
+ item_title: sendItemTitle ? (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.label : undefined,
35836
+ };
35837
+ window.dataLayer.push(Object.assign({ event: (_d = (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : options.parentEventName }, params));
35838
+ };
35839
+ const processDebugEvent = (data) => {
35840
+ var _a, _b, _c;
35841
+ const sendItemTitle = data.searchQuery !== ((_a = data.analytics) === null || _a === void 0 ? void 0 : _a.label);
35842
+ const params = {
35843
+ event: (_b = data.analytics) === null || _b === void 0 ? void 0 : _b.type,
35844
+ search_text: data.searchQuery,
35845
+ item_title: sendItemTitle ? (_c = data.analytics) === null || _c === void 0 ? void 0 : _c.label : undefined,
35846
+ };
35847
+ console.debug("Analytics debug event:", params);
35848
+ };
35728
35849
  const track = (queryKey, data = {}, options) => {
35729
- if (!isTrackingEnabled()) {
35850
+ if (!isTrackingEnabled() || !data.searchQuery) {
35730
35851
  return;
35731
35852
  }
35732
35853
  trackLupaEvent(queryKey, data, options);
@@ -36852,6 +36973,9 @@ let SearchResultsToolbar = class SearchResultsToolbar extends Vue$1 {
36852
36973
  var _a, _b, _c;
36853
36974
  return Boolean((_c = (_b = (_a = this.options.filters) === null || _a === void 0 ? void 0 : _a.currentFilters) === null || _b === void 0 ? void 0 : _b.mobileSidebar) === null || _c === void 0 ? void 0 : _c.showFilterCount);
36854
36975
  }
36976
+ get hasResults() {
36977
+ return this.searchResult.total > 0;
36978
+ }
36855
36979
  };
36856
36980
  __decorate([
36857
36981
  Prop({ default: () => ({ labels: {} }) })
@@ -36900,65 +37024,72 @@ var __vue_render__$f = function () {
36900
37024
  var _vm = this;
36901
37025
  var _h = _vm.$createElement;
36902
37026
  var _c = _vm._self._c || _h;
36903
- return _c("div", { attrs: { id: "lupa-search-results-toolbar" } }, [
36904
- _c(
36905
- "div",
36906
- { staticClass: "lupa-toolbar-left" },
36907
- [
36908
- _vm.showLayoutSelection
36909
- ? _c("SearchResultsLayoutSelection")
36910
- : _c("div"),
36911
- _vm._v(" "),
36912
- _vm.showItemSummary
36913
- ? _c("SearchResultsSummary", {
36914
- attrs: {
36915
- label: _vm.searchSummaryLabel,
36916
- clearable: _vm.hasAnyFilter && _vm.showFilterClear,
36917
- },
36918
- on: { clear: _vm.handleClearAll },
36919
- })
36920
- : _c("div"),
36921
- _vm._v(" "),
36922
- _vm.displayPageSelect
36923
- ? _c("SearchResultsPageSelect", {
36924
- attrs: {
36925
- options: _vm.paginationOptions.pageSelect,
36926
- "last-page-label": _vm.paginationOptions.labels.showMore,
36927
- "first-page-label": _vm.paginationOptions.labels.showLess,
36928
- },
36929
- })
36930
- : _c("div"),
36931
- ],
36932
- 1
36933
- ),
36934
- _vm._v(" "),
36935
- _c(
36936
- "div",
36937
- { staticClass: "lupa-toolbar-right" },
36938
- [
36939
- _c("SearchResultsMobileToggle", {
36940
- attrs: {
36941
- label: _vm.options.labels.mobileFilterButton,
36942
- "show-filter-count": _vm.showMobileFilterCount,
36943
- },
36944
- }),
36945
- _vm._v(" "),
36946
- _vm.paginationDisplay.pageSize
36947
- ? _c("SearchResultsPageSize", {
36948
- attrs: {
36949
- options: _vm.paginationOptions.pageSize,
36950
- label: _vm.paginationOptions.labels.pageSize,
36951
- },
36952
- })
36953
- : _c("div"),
36954
- _vm._v(" "),
36955
- _vm.sortOptions
36956
- ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
36957
- : _c("div"),
36958
- ],
36959
- 1
36960
- ),
36961
- ])
37027
+ return _c(
37028
+ "div",
37029
+ {
37030
+ class: { "lupa-filter-no-results": !_vm.hasResults },
37031
+ attrs: { id: "lupa-search-results-toolbar" },
37032
+ },
37033
+ [
37034
+ _c(
37035
+ "div",
37036
+ { staticClass: "lupa-toolbar-left" },
37037
+ [
37038
+ _vm.showLayoutSelection
37039
+ ? _c("SearchResultsLayoutSelection")
37040
+ : _c("div"),
37041
+ _vm._v(" "),
37042
+ _vm.showItemSummary
37043
+ ? _c("SearchResultsSummary", {
37044
+ attrs: {
37045
+ label: _vm.searchSummaryLabel,
37046
+ clearable: _vm.hasAnyFilter && _vm.showFilterClear,
37047
+ },
37048
+ on: { clear: _vm.handleClearAll },
37049
+ })
37050
+ : _c("div"),
37051
+ _vm._v(" "),
37052
+ _vm.displayPageSelect
37053
+ ? _c("SearchResultsPageSelect", {
37054
+ attrs: {
37055
+ options: _vm.paginationOptions.pageSelect,
37056
+ "last-page-label": _vm.paginationOptions.labels.showMore,
37057
+ "first-page-label": _vm.paginationOptions.labels.showLess,
37058
+ },
37059
+ })
37060
+ : _c("div"),
37061
+ ],
37062
+ 1
37063
+ ),
37064
+ _vm._v(" "),
37065
+ _c(
37066
+ "div",
37067
+ { staticClass: "lupa-toolbar-right" },
37068
+ [
37069
+ _c("SearchResultsMobileToggle", {
37070
+ attrs: {
37071
+ label: _vm.options.labels.mobileFilterButton,
37072
+ "show-filter-count": _vm.showMobileFilterCount,
37073
+ },
37074
+ }),
37075
+ _vm._v(" "),
37076
+ _vm.paginationDisplay.pageSize
37077
+ ? _c("SearchResultsPageSize", {
37078
+ attrs: {
37079
+ options: _vm.paginationOptions.pageSize,
37080
+ label: _vm.paginationOptions.labels.pageSize,
37081
+ },
37082
+ })
37083
+ : _c("div"),
37084
+ _vm._v(" "),
37085
+ _vm.sortOptions
37086
+ ? _c("SearchResultsSort", { attrs: { options: _vm.sortOptions } })
37087
+ : _c("div"),
37088
+ ],
37089
+ 1
37090
+ ),
37091
+ ]
37092
+ )
36962
37093
  };
36963
37094
  var __vue_staticRenderFns__$f = [];
36964
37095
  __vue_render__$f._withStripped = true;
@@ -37020,7 +37151,7 @@ __vue_render__$e._withStripped = true;
37020
37151
  /* style */
37021
37152
  const __vue_inject_styles__$e = function (inject) {
37022
37153
  if (!inject) return
37023
- inject("data-v-ef12587c_0", { source: ".lupa-spinner {\n color: #555555;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n padding-top: 100px;\n padding-right: 72px;\n}\n.lupa-spinner div {\n transform-origin: 40px 40px;\n animation: lupa-spinner 1.2s linear infinite;\n}\n.lupa-spinner div:after {\n content: \" \";\n display: block;\n position: absolute;\n top: 3px;\n left: 37px;\n width: 6px;\n height: 18px;\n border-radius: 20%;\n background: #555555;\n}\n.lupa-spinner div:nth-child(1) {\n transform: rotate(0deg);\n animation-delay: -1.1s;\n}\n.lupa-spinner div:nth-child(2) {\n transform: rotate(30deg);\n animation-delay: -1s;\n}\n.lupa-spinner div:nth-child(3) {\n transform: rotate(60deg);\n animation-delay: -0.9s;\n}\n.lupa-spinner div:nth-child(4) {\n transform: rotate(90deg);\n animation-delay: -0.8s;\n}\n.lupa-spinner div:nth-child(5) {\n transform: rotate(120deg);\n animation-delay: -0.7s;\n}\n.lupa-spinner div:nth-child(6) {\n transform: rotate(150deg);\n animation-delay: -0.6s;\n}\n.lupa-spinner div:nth-child(7) {\n transform: rotate(180deg);\n animation-delay: -0.5s;\n}\n.lupa-spinner div:nth-child(8) {\n transform: rotate(210deg);\n animation-delay: -0.4s;\n}\n.lupa-spinner div:nth-child(9) {\n transform: rotate(240deg);\n animation-delay: -0.3s;\n}\n.lupa-spinner div:nth-child(10) {\n transform: rotate(270deg);\n animation-delay: -0.2s;\n}\n.lupa-spinner div:nth-child(11) {\n transform: rotate(300deg);\n animation-delay: -0.1s;\n}\n.lupa-spinner div:nth-child(12) {\n transform: rotate(330deg);\n animation-delay: 0s;\n}\n@keyframes lupa-spinner {\n0% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n}\n.lupa-spinner-wrapper {\n width: 100%;\n}", map: undefined, media: undefined });
37154
+ inject("data-v-3353d3a1_0", { source: ".lupa-spinner {\n color: #555555;\n display: flex;\n justify-content: center;\n position: relative;\n width: 100%;\n padding-top: 100px;\n padding-right: 72px;\n}\n.lupa-spinner div {\n transform-origin: 40px 40px;\n animation: lupa-spinner 1.2s linear infinite;\n}\n.lupa-spinner div:after {\n content: \" \";\n display: block;\n position: absolute;\n top: 3px;\n left: 37px;\n width: 6px;\n height: 18px;\n border-radius: 20%;\n background: #555555;\n}\n.lupa-spinner div:nth-child(1) {\n transform: rotate(0deg);\n animation-delay: -1.1s;\n}\n.lupa-spinner div:nth-child(2) {\n transform: rotate(30deg);\n animation-delay: -1s;\n}\n.lupa-spinner div:nth-child(3) {\n transform: rotate(60deg);\n animation-delay: -0.9s;\n}\n.lupa-spinner div:nth-child(4) {\n transform: rotate(90deg);\n animation-delay: -0.8s;\n}\n.lupa-spinner div:nth-child(5) {\n transform: rotate(120deg);\n animation-delay: -0.7s;\n}\n.lupa-spinner div:nth-child(6) {\n transform: rotate(150deg);\n animation-delay: -0.6s;\n}\n.lupa-spinner div:nth-child(7) {\n transform: rotate(180deg);\n animation-delay: -0.5s;\n}\n.lupa-spinner div:nth-child(8) {\n transform: rotate(210deg);\n animation-delay: -0.4s;\n}\n.lupa-spinner div:nth-child(9) {\n transform: rotate(240deg);\n animation-delay: -0.3s;\n}\n.lupa-spinner div:nth-child(10) {\n transform: rotate(270deg);\n animation-delay: -0.2s;\n}\n.lupa-spinner div:nth-child(11) {\n transform: rotate(300deg);\n animation-delay: -0.1s;\n}\n.lupa-spinner div:nth-child(12) {\n transform: rotate(330deg);\n animation-delay: 0s;\n}\n@keyframes lupa-spinner {\n0% {\n opacity: 1;\n}\n100% {\n opacity: 0;\n}\n}\n.lupa-spinner-wrapper {\n width: 100%;\n overflow: hidden;\n}", map: undefined, media: undefined });
37024
37155
 
37025
37156
  };
37026
37157
  /* scoped */
@@ -37393,6 +37524,7 @@ let SearchResultsProducts = class SearchResultsProducts extends Vue$1 {
37393
37524
  "labels",
37394
37525
  "queryKey",
37395
37526
  "idKey",
37527
+ "titleKey",
37396
37528
  "routingBehavior",
37397
37529
  ]);
37398
37530
  }
@@ -37793,6 +37925,10 @@ let SearchResultsTitle = class SearchResultsTitle extends Vue$1 {
37793
37925
  var _a, _b;
37794
37926
  return (_b = (_a = this.options.categories) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.descriptionTop;
37795
37927
  }
37928
+ get summaryLabel() {
37929
+ var _a, _b;
37930
+ return (_b = (_a = this.options.labels) === null || _a === void 0 ? void 0 : _a.itemCount) !== null && _b !== void 0 ? _b : "";
37931
+ }
37796
37932
  getLabel(label) {
37797
37933
  return addParamsToLabel(label, `'${this.currentQueryText}'`);
37798
37934
  }
@@ -37803,6 +37939,9 @@ __decorate([
37803
37939
  __decorate([
37804
37940
  Prop({ default: false })
37805
37941
  ], SearchResultsTitle.prototype, "isProductList", void 0);
37942
+ __decorate([
37943
+ Prop({ default: false })
37944
+ ], SearchResultsTitle.prototype, "showSummary", void 0);
37806
37945
  __decorate([
37807
37946
  searchResult$2.Getter("currentQueryText")
37808
37947
  ], SearchResultsTitle.prototype, "currentQueryText", void 0);
@@ -37815,6 +37954,9 @@ __decorate([
37815
37954
  SearchResultsTitle = __decorate([
37816
37955
  Component({
37817
37956
  name: "SearchResultsTitle",
37957
+ components: {
37958
+ SearchResultsSummary: __vue_component__$h,
37959
+ },
37818
37960
  })
37819
37961
  ], SearchResultsTitle);
37820
37962
  var script$8 = SearchResultsTitle;
@@ -37827,36 +37969,44 @@ var __vue_render__$8 = function () {
37827
37969
  var _vm = this;
37828
37970
  var _h = _vm.$createElement;
37829
37971
  var _c = _vm._self._c || _h;
37830
- return _c("div", [
37831
- _vm.showSearchTitle
37832
- ? _c(
37833
- "h1",
37834
- {
37835
- staticClass: "lupa-result-page-title",
37836
- attrs: { "data-cy": "lupa-result-page-title" },
37837
- },
37838
- [
37839
- _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37840
- _vm.queryText
37841
- ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37842
- : _vm._e(),
37843
- _vm._v(" "),
37844
- _vm.showProductCount
37845
- ? _c("span", { staticClass: "lupa-results-total-count" }, [
37846
- _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37847
- ])
37848
- : _vm._e(),
37849
- ]
37850
- )
37851
- : _vm._e(),
37852
- _vm._v(" "),
37853
- _vm.descriptionTop
37854
- ? _c("div", {
37855
- staticClass: "lupa-result-page-description-top",
37856
- domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
37857
- })
37858
- : _vm._e(),
37859
- ])
37972
+ return _c(
37973
+ "div",
37974
+ [
37975
+ _vm.showSearchTitle
37976
+ ? _c(
37977
+ "h1",
37978
+ {
37979
+ staticClass: "lupa-result-page-title",
37980
+ attrs: { "data-cy": "lupa-result-page-title" },
37981
+ },
37982
+ [
37983
+ _vm._v("\n " + _vm._s(_vm.options.labels.searchResults)),
37984
+ _vm.queryText
37985
+ ? _c("span", [_vm._v("'" + _vm._s(_vm.queryText) + "'")])
37986
+ : _vm._e(),
37987
+ _vm._v(" "),
37988
+ _vm.showProductCount
37989
+ ? _c("span", { staticClass: "lupa-results-total-count" }, [
37990
+ _vm._v("(" + _vm._s(_vm.totalItems) + ")"),
37991
+ ])
37992
+ : _vm._e(),
37993
+ ]
37994
+ )
37995
+ : _vm._e(),
37996
+ _vm._v(" "),
37997
+ _vm.showSummary
37998
+ ? _c("SearchResultsSummary", { attrs: { label: _vm.summaryLabel } })
37999
+ : _vm._e(),
38000
+ _vm._v(" "),
38001
+ _vm.descriptionTop
38002
+ ? _c("div", {
38003
+ staticClass: "lupa-result-page-description-top",
38004
+ domProps: { innerHTML: _vm._s(_vm.descriptionTop) },
38005
+ })
38006
+ : _vm._e(),
38007
+ ],
38008
+ 1
38009
+ )
37860
38010
  };
37861
38011
  var __vue_staticRenderFns__$8 = [];
37862
38012
  __vue_render__$8._withStripped = true;
@@ -38079,7 +38229,11 @@ let SearchResults = class SearchResults extends Vue$1 {
38079
38229
  this.query(getPublicQuery(publicQuery, this.initialFilters, this.isProductList));
38080
38230
  }
38081
38231
  query(publicQuery) {
38082
- this.trackSearch({ queryKey: this.options.queryKey, query: publicQuery });
38232
+ this.trackSearch({
38233
+ queryKey: this.options.queryKey,
38234
+ query: publicQuery,
38235
+ type: "search_form_submit",
38236
+ });
38083
38237
  const context = getLupaTrackingContext();
38084
38238
  const limit = publicQuery.limit || this.defaultSearchResultPageSize;
38085
38239
  const query = Object.assign(Object.assign(Object.assign({}, publicQuery), context), { limit });
@@ -38133,6 +38287,9 @@ __decorate([
38133
38287
  __decorate([
38134
38288
  Prop({ default: false })
38135
38289
  ], SearchResults.prototype, "isProductList", void 0);
38290
+ __decorate([
38291
+ Prop({ default: false })
38292
+ ], SearchResults.prototype, "isContainer", void 0);
38136
38293
  __decorate([
38137
38294
  searchResult$1.Getter("currentQueryText")
38138
38295
  ], SearchResults.prototype, "currentQueryText", void 0);
@@ -38216,6 +38373,29 @@ var __vue_render__$6 = function () {
38216
38373
  "div",
38217
38374
  { staticClass: "lupa-search-result-wrapper" },
38218
38375
  [
38376
+ _vm.isContainer
38377
+ ? [
38378
+ _c(
38379
+ "div",
38380
+ { staticClass: "lupa-container-title-summary-mobile" },
38381
+ [
38382
+ _c("SearchResultsDidYouMean", {
38383
+ attrs: { labels: _vm.didYouMeanLabels },
38384
+ }),
38385
+ _vm._v(" "),
38386
+ _c("SearchResultsTitle", {
38387
+ attrs: {
38388
+ "show-summary": true,
38389
+ options: _vm.options,
38390
+ "is-product-list": _vm.isProductList,
38391
+ },
38392
+ }),
38393
+ ],
38394
+ 1
38395
+ ),
38396
+ ]
38397
+ : _vm._e(),
38398
+ _vm._v(" "),
38219
38399
  _vm.isTitleResultTopPosition
38220
38400
  ? _c("CategoryTopFilters", { attrs: { options: _vm.options } })
38221
38401
  : _vm._e(),
@@ -38751,7 +38931,10 @@ var __vue_render__$1 = function () {
38751
38931
  _vm._v(" "),
38752
38932
  _c("SearchResults", {
38753
38933
  ref: "searchResults",
38754
- attrs: { options: _vm.fullSearchResultsOptions },
38934
+ attrs: {
38935
+ options: _vm.fullSearchResultsOptions,
38936
+ "is-container": true,
38937
+ },
38755
38938
  }),
38756
38939
  ],
38757
38940
  1
@@ -38863,13 +39046,19 @@ var __vue_render__ = function () {
38863
39046
  var _vm = this;
38864
39047
  var _h = _vm.$createElement;
38865
39048
  var _c = _vm._self._c || _h;
38866
- return _vm.isOpen
38867
- ? _c("SearchContainer", {
38868
- ref: "productList",
38869
- attrs: { options: _vm.containerOptions },
38870
- on: { "hook:mounted": _vm.focus, close: _vm.close },
38871
- })
38872
- : _vm._e()
39049
+ return _c(
39050
+ "div",
39051
+ [
39052
+ _vm.isOpen
39053
+ ? _c("SearchContainer", {
39054
+ ref: "productList",
39055
+ attrs: { options: _vm.containerOptions },
39056
+ on: { "hook:mounted": _vm.focus, close: _vm.close },
39057
+ })
39058
+ : _vm._e(),
39059
+ ],
39060
+ 1
39061
+ )
38873
39062
  };
38874
39063
  var __vue_staticRenderFns__ = [];
38875
39064
  __vue_render__._withStripped = true;
@@ -39345,6 +39534,7 @@ let SearchBoxModule = class SearchBoxModule extends VuexModule {
39345
39534
  link: generateLink((_b = panel.links) === null || _b === void 0 ? void 0 : _b.details, doc),
39346
39535
  queryKey: panel.queryKey,
39347
39536
  id: panel.idKey ? doc[panel.idKey] : "",
39537
+ title: panel.titleKey ? doc[panel.titleKey] : "",
39348
39538
  };
39349
39539
  }
39350
39540
  saveSuggestions({ queryKey, suggestions, inputValue, }) {
@@ -39821,11 +40011,6 @@ let ParamsModule = class ParamsModule extends VuexModule {
39821
40011
  const routing = (_a = this.context.rootGetters["options/boxRoutingBehavior"]) !== null && _a !== void 0 ? _a : "direct-link";
39822
40012
  redirectToResultsPage(this.searchResultsLink, searchText, facet, routing);
39823
40013
  }
39824
- this.context.dispatch("tracking/track", {
39825
- data: {
39826
- analytics: { type: "search_form_submit", label: searchText },
39827
- },
39828
- }, { root: true });
39829
40014
  }
39830
40015
  appendParams({ params, paramsToRemove, encode = true, save = true, searchResultsLink, }) {
39831
40016
  if (!(params === null || params === void 0 ? void 0 : params.length)) {
@@ -39976,22 +40161,23 @@ const getSearchTrackingData = (searchText, type) => {
39976
40161
  };
39977
40162
  };
39978
40163
  let TrackingModule = class TrackingModule extends VuexModule {
39979
- trackSearch({ queryKey, query, }) {
40164
+ trackSearch({ queryKey, query, type = "search_query", }) {
39980
40165
  var _a, _b;
39981
40166
  const options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
39982
40167
  const hasFilters = Object.keys((_b = query.filters) !== null && _b !== void 0 ? _b : {}).length > 0;
39983
40168
  if (hasFilters) {
39984
- const data = getSearchTrackingData(query.searchText, "filters");
40169
+ const data = getSearchTrackingData(query.searchText, "search_filters");
39985
40170
  track(queryKey, data, options);
40171
+ return;
39986
40172
  }
39987
- const data = getSearchTrackingData(query.searchText, "search");
40173
+ const data = getSearchTrackingData(query.searchText, type);
39988
40174
  track(queryKey, data, options);
39989
40175
  }
39990
40176
  trackResults({ queryKey, results, }) {
39991
40177
  var _a;
39992
40178
  const options = (_a = this.context.rootGetters["options/envOptions"]) !== null && _a !== void 0 ? _a : {};
39993
40179
  if (results.total < 1) {
39994
- const data = getSearchTrackingData(results.searchText, "zero_results");
40180
+ const data = getSearchTrackingData(results.searchText, "search_zero_results");
39995
40181
  track(queryKey, data, options);
39996
40182
  }
39997
40183
  }
@@ -40028,6 +40214,30 @@ var store = new Vuex.Store({
40028
40214
  },
40029
40215
  });
40030
40216
 
40217
+ const attatchShadowDom = ({ host, manager, styleUrl, }) => {
40218
+ const link = document.createElement("link");
40219
+ link.type = "text/css";
40220
+ link.rel = "stylesheet";
40221
+ link.href = styleUrl;
40222
+ // Fonts only work when added in host document head
40223
+ const linkNode = document.createElement("link");
40224
+ linkNode.type = "text/css";
40225
+ linkNode.rel = "stylesheet";
40226
+ linkNode.href =
40227
+ "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
40228
+ document.head.appendChild(linkNode);
40229
+ // Add font for material icons
40230
+ const linkNode2 = document.createElement("link");
40231
+ linkNode2.type = "text/css";
40232
+ linkNode2.rel = "stylesheet";
40233
+ linkNode2.href =
40234
+ "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
40235
+ document.head.appendChild(linkNode2);
40236
+ const shadow = host.attachShadow({ mode: "open" });
40237
+ shadow.appendChild(manager);
40238
+ shadow.appendChild(link);
40239
+ };
40240
+
40031
40241
  /* eslint-disable @typescript-eslint/no-explicit-any */
40032
40242
  const app = {
40033
40243
  box: {},
@@ -40111,6 +40321,7 @@ const productList = (options, mountOptions) => {
40111
40321
  app.productList[options.containerSelector] = instance;
40112
40322
  };
40113
40323
  const searchContainer = (options, mountOptions) => {
40324
+ var _a;
40114
40325
  const existingInstance = app.productList[options.trigger];
40115
40326
  if (existingInstance) {
40116
40327
  existingInstance.productListOptions = options;
@@ -40123,13 +40334,21 @@ const searchContainer = (options, mountOptions) => {
40123
40334
  return;
40124
40335
  }
40125
40336
  Vue$1.use(Vuex);
40126
- const id = `lupa-search-container-manager`;
40127
- const managerElement = document.createElement("div");
40128
- managerElement.setAttribute("id", id);
40129
- document.body.appendChild(managerElement);
40337
+ const id = "lupa-search-container-manager";
40338
+ const shadowId = "lupa-shadow-id";
40339
+ const host = document.createElement("div");
40340
+ const manager = document.createElement("div");
40341
+ host.setAttribute("id", shadowId);
40342
+ manager.setAttribute("id", id);
40343
+ attatchShadowDom({
40344
+ host,
40345
+ manager,
40346
+ styleUrl: (_a = options.styleLink) !== null && _a !== void 0 ? _a : DEFAULT_CONTAINER_STYLE,
40347
+ });
40348
+ document.body.appendChild(host);
40130
40349
  const SearchContainerEntryComponent = Vue$1.component("SearchContainerEntry", __vue_component__);
40131
40350
  const instance = new SearchContainerEntryComponent({
40132
- el: `#${id}`,
40351
+ el: manager,
40133
40352
  propsData: { searchContainerOptions: options },
40134
40353
  store,
40135
40354
  });