@getlupa/client 1.1.2 → 1.1.4

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.
@@ -6855,6 +6855,20 @@ var DocumentElementType = /* @__PURE__ */ ((DocumentElementType2) => {
6855
6855
  DocumentElementType2["CUSTOM_HTML"] = "customHtml";
6856
6856
  return DocumentElementType2;
6857
6857
  })(DocumentElementType || {});
6858
+ var SearchBoxPanelType = /* @__PURE__ */ ((SearchBoxPanelType2) => {
6859
+ SearchBoxPanelType2["SUGGESTION"] = "suggestion";
6860
+ SearchBoxPanelType2["DOCUMENT"] = "document";
6861
+ return SearchBoxPanelType2;
6862
+ })(SearchBoxPanelType || {});
6863
+ var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
6864
+ BadgeType2["DISCOUNTPERCENTAGE"] = "discountPercentage";
6865
+ BadgeType2["DISCOUNTAMOUNT"] = "discountAmount";
6866
+ BadgeType2["NEWITEM"] = "newItem";
6867
+ BadgeType2["TEXT"] = "text";
6868
+ BadgeType2["IMAGE"] = "image";
6869
+ BadgeType2["CUSTOM_HTML"] = "customHtml";
6870
+ return BadgeType2;
6871
+ })(BadgeType || {});
6858
6872
  const retrieveHistory = () => {
6859
6873
  try {
6860
6874
  const historyString = window.localStorage.getItem(HISTORY_LOCAL_STORAGE_KEY);
@@ -7444,11 +7458,6 @@ const useParamsStore = defineStore("params", () => {
7444
7458
  setSearchResultsLink
7445
7459
  };
7446
7460
  });
7447
- var SearchBoxPanelType = /* @__PURE__ */ ((SearchBoxPanelType2) => {
7448
- SearchBoxPanelType2["SUGGESTION"] = "suggestion";
7449
- SearchBoxPanelType2["DOCUMENT"] = "document";
7450
- return SearchBoxPanelType2;
7451
- })(SearchBoxPanelType || {});
7452
7461
  const flattenFacet = (key, facets, suggestion, inputValue) => {
7453
7462
  return facets.map((f2) => ({
7454
7463
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
@@ -7636,7 +7645,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
7636
7645
  const _hoisted_1$12 = { id: "lupa-search-box-input-container" };
7637
7646
  const _hoisted_2$I = { class: "lupa-input-clear" };
7638
7647
  const _hoisted_3$u = { id: "lupa-search-box-input" };
7639
- const _hoisted_4$m = ["value"];
7648
+ const _hoisted_4$n = ["value"];
7640
7649
  const _hoisted_5$c = ["placeholder"];
7641
7650
  const _hoisted_6$6 = {
7642
7651
  key: 0,
@@ -7731,7 +7740,7 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
7731
7740
  class: "lupa-hint",
7732
7741
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
7733
7742
  disabled: ""
7734
- }, null, 8, _hoisted_4$m),
7743
+ }, null, 8, _hoisted_4$n),
7735
7744
  withDirectives(createBaseVNode("input", mergeProps({
7736
7745
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
7737
7746
  }, inputAttributes.value, {
@@ -7898,7 +7907,7 @@ const _hoisted_3$t = {
7898
7907
  class: "lupa-suggestion-facet",
7899
7908
  "data-cy": "lupa-suggestion-facet"
7900
7909
  };
7901
- const _hoisted_4$l = {
7910
+ const _hoisted_4$m = {
7902
7911
  class: "lupa-suggestion-facet-label",
7903
7912
  "data-cy": "lupa-suggestion-facet-label"
7904
7913
  };
@@ -7944,7 +7953,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
7944
7953
  innerHTML: _ctx.suggestion.displayHighlight
7945
7954
  }, null, 8, _hoisted_1$$)) : (openBlock(), createElementBlock("div", _hoisted_2$G, toDisplayString(_ctx.suggestion.display), 1)),
7946
7955
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$t, [
7947
- createBaseVNode("span", _hoisted_4$l, toDisplayString(facetLabel.value), 1),
7956
+ createBaseVNode("span", _hoisted_4$m, toDisplayString(facetLabel.value), 1),
7948
7957
  createBaseVNode("span", _hoisted_5$b, toDisplayString(_ctx.suggestion.facet.title), 1)
7949
7958
  ])) : createCommentVNode("", true)
7950
7959
  ]);
@@ -8346,7 +8355,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
8346
8355
  const _hoisted_1$U = ["innerHTML"];
8347
8356
  const _hoisted_2$D = { key: 0 };
8348
8357
  const _hoisted_3$s = { key: 1 };
8349
- const _hoisted_4$k = { class: "lupa-search-box-custom-label" };
8358
+ const _hoisted_4$l = { class: "lupa-search-box-custom-label" };
8350
8359
  const _hoisted_5$a = { class: "lupa-search-box-custom-text" };
8351
8360
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
8352
8361
  __name: "SearchBoxProductCustom",
@@ -8379,7 +8388,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
8379
8388
  class: [className.value, "lupa-search-box-product-custom"]
8380
8389
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
8381
8390
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$D, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$s, [
8382
- createBaseVNode("div", _hoisted_4$k, toDisplayString(label.value), 1),
8391
+ createBaseVNode("div", _hoisted_4$l, toDisplayString(label.value), 1),
8383
8392
  createBaseVNode("div", _hoisted_5$a, toDisplayString(text.value), 1)
8384
8393
  ]))
8385
8394
  ], 16));
@@ -8775,7 +8784,7 @@ const useTrackingStore = defineStore("tracking", () => {
8775
8784
  const _hoisted_1$R = ["href"];
8776
8785
  const _hoisted_2$B = { class: "lupa-search-box-product-image-section" };
8777
8786
  const _hoisted_3$q = { class: "lupa-search-box-product-details-section" };
8778
- const _hoisted_4$j = {
8787
+ const _hoisted_4$k = {
8779
8788
  key: 0,
8780
8789
  class: "lupa-search-box-product-add-to-cart-section"
8781
8790
  };
@@ -8896,7 +8905,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
8896
8905
  }, null, 8, ["item", "element", "labels", "link"]);
8897
8906
  }), 128))
8898
8907
  ]),
8899
- addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
8908
+ addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$k, [
8900
8909
  createVNode(_sfc_main$W, {
8901
8910
  class: "lupa-search-box-product-element",
8902
8911
  item: _ctx.item,
@@ -9028,14 +9037,17 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
9028
9037
  }
9029
9038
  });
9030
9039
  const _hoisted_1$P = {
9040
+ key: 0,
9041
+ id: "lupa-search-box-panel"
9042
+ };
9043
+ const _hoisted_2$A = {
9031
9044
  class: "lupa-main-panel",
9032
9045
  "data-cy": "lupa-main-panel"
9033
9046
  };
9034
- const _hoisted_2$A = ["data-cy"];
9035
- const _hoisted_3$p = {
9047
+ const _hoisted_3$p = ["data-cy"];
9048
+ const _hoisted_4$j = {
9036
9049
  key: 1,
9037
- id: "lupa-search-box-panel",
9038
- ref: "panel"
9050
+ id: "lupa-search-box-panel"
9039
9051
  };
9040
9052
  const __default__$3 = {
9041
9053
  components: {
@@ -9101,7 +9113,9 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9101
9113
  onMounted(() => {
9102
9114
  window.addEventListener("resize", appHeight);
9103
9115
  window.addEventListener("keydown", handleNavigation);
9104
- appHeight();
9116
+ setTimeout(() => {
9117
+ appHeight();
9118
+ });
9105
9119
  });
9106
9120
  onBeforeUnmount(() => {
9107
9121
  highlightChange({ action: "clear" });
@@ -9151,59 +9165,58 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9151
9165
  };
9152
9166
  return (_ctx, _cache) => {
9153
9167
  var _a;
9154
- return displayResults.value ? (openBlock(), createElementBlock("div", {
9155
- key: 0,
9156
- id: "lupa-search-box-panel",
9168
+ return openBlock(), createElementBlock("div", {
9157
9169
  ref_key: "panelContainer",
9158
9170
  ref: panelContainer
9159
9171
  }, [
9160
- createBaseVNode("div", _hoisted_1$P, [
9161
- (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
9162
- return openBlock(), createElementBlock("div", {
9163
- key: index,
9164
- class: normalizeClass([
9165
- "lupa-panel-" + panel.type + "-index",
9166
- panel.customClassName ? panel.customClassName : ""
9167
- ]),
9168
- "data-cy": "lupa-panel-" + panel.type + "-index"
9169
- }, [
9170
- panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9171
- key: 0,
9172
- panel,
9173
- options: sdkOptions.value,
9174
- debounce: _ctx.options.debounce,
9175
- inputValue: getInput(panel),
9176
- labels: labels.value,
9177
- onFetched: _cache[0] || (_cache[0] = (data) => _ctx.$emit("fetched", data)),
9178
- onItemSelect: _cache[1] || (_cache[1] = (item) => _ctx.$emit("itemSelect", item)),
9179
- onProductClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("product-click"))
9180
- }, createSlots({ _: 2 }, [
9181
- _ctx.$slots.productCard ? {
9182
- name: "productCard",
9183
- fn: withCtx((props2) => [
9184
- renderSlot(_ctx.$slots, "productCard", normalizeProps(guardReactiveProps(props2)))
9185
- ]),
9186
- key: "0"
9187
- } : void 0
9188
- ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
9189
- ], 10, _hoisted_2$A);
9190
- }), 128))
9191
- ]),
9192
- createVNode(_sfc_main$19, {
9193
- labels: labels.value,
9194
- showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
9195
- onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
9196
- }, null, 8, ["labels", "showTotalCount"])
9197
- ], 512)) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_3$p, [
9198
- createVNode(_sfc_main$17, {
9199
- ref: "panel",
9200
- options: _ctx.options.history,
9201
- history: history.value,
9202
- onGoToResults: handleGoToResults,
9203
- onRemove: remove2,
9204
- onRemoveAll: removeAll
9205
- }, null, 8, ["options", "history"])
9206
- ], 512)) : createCommentVNode("", true);
9172
+ displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
9173
+ createBaseVNode("div", _hoisted_2$A, [
9174
+ (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
9175
+ return openBlock(), createElementBlock("div", {
9176
+ key: index,
9177
+ class: normalizeClass([
9178
+ "lupa-panel-" + panel.type + "-index",
9179
+ panel.customClassName ? panel.customClassName : ""
9180
+ ]),
9181
+ "data-cy": "lupa-panel-" + panel.type + "-index"
9182
+ }, [
9183
+ panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9184
+ key: 0,
9185
+ panel,
9186
+ options: sdkOptions.value,
9187
+ debounce: _ctx.options.debounce,
9188
+ inputValue: getInput(panel),
9189
+ labels: labels.value,
9190
+ onFetched: _cache[0] || (_cache[0] = (data) => _ctx.$emit("fetched", data)),
9191
+ onItemSelect: _cache[1] || (_cache[1] = (item) => _ctx.$emit("itemSelect", item)),
9192
+ onProductClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("product-click"))
9193
+ }, createSlots({ _: 2 }, [
9194
+ _ctx.$slots.productCard ? {
9195
+ name: "productCard",
9196
+ fn: withCtx((props2) => [
9197
+ renderSlot(_ctx.$slots, "productCard", normalizeProps(guardReactiveProps(props2)))
9198
+ ]),
9199
+ key: "0"
9200
+ } : void 0
9201
+ ]), 1064, ["panel", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
9202
+ ], 10, _hoisted_3$p);
9203
+ }), 128))
9204
+ ]),
9205
+ createVNode(_sfc_main$19, {
9206
+ labels: labels.value,
9207
+ showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
9208
+ onGoToResults: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("go-to-results"))
9209
+ }, null, 8, ["labels", "showTotalCount"])
9210
+ ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
9211
+ createVNode(_sfc_main$17, {
9212
+ options: _ctx.options.history,
9213
+ history: history.value,
9214
+ onGoToResults: handleGoToResults,
9215
+ onRemove: remove2,
9216
+ onRemoveAll: removeAll
9217
+ }, null, 8, ["options", "history"])
9218
+ ])) : createCommentVNode("", true)
9219
+ ], 512);
9207
9220
  };
9208
9221
  }
9209
9222
  }));
@@ -9903,7 +9916,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
9903
9916
  props: {
9904
9917
  options: {}
9905
9918
  },
9906
- setup(__props) {
9919
+ setup(__props, { expose: __expose }) {
9907
9920
  const props = __props;
9908
9921
  const categoryChildren = ref([]);
9909
9922
  const optionStore = useOptionsStore();
@@ -9982,6 +9995,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
9982
9995
  }
9983
9996
  handleRoutingEvent(backUrlLink.value, event, hasEventRouting.value);
9984
9997
  };
9998
+ __expose({ fetch: fetch2 });
9985
9999
  return (_ctx, _cache) => {
9986
10000
  return openBlock(), createElementBlock("div", _hoisted_1$H, [
9987
10001
  createBaseVNode("div", _hoisted_2$t, [
@@ -11809,8 +11823,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11809
11823
  options: {},
11810
11824
  expandable: { type: Boolean }
11811
11825
  },
11812
- setup(__props) {
11826
+ setup(__props, { expose: __expose }) {
11813
11827
  const props = __props;
11828
+ const categoryFilters = ref(null);
11814
11829
  const desktopFiltersVisible = computed(() => {
11815
11830
  var _a, _b, _c;
11816
11831
  return (_c = (_b = (_a = props.options.currentFilters) == null ? void 0 : _a.visibility) == null ? void 0 : _b.desktopSidebar) != null ? _c : true;
@@ -11822,6 +11837,13 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11822
11837
  const showCurrentFilters = computed(() => {
11823
11838
  return currentFiltersVisible.value ? Boolean(props.options.facets) : false;
11824
11839
  });
11840
+ const fetch2 = () => {
11841
+ var _a;
11842
+ if (categoryFilters.value) {
11843
+ (_a = categoryFilters.value) == null ? void 0 : _a.fetch();
11844
+ }
11845
+ };
11846
+ __expose({ fetch: fetch2 });
11825
11847
  return (_ctx, _cache) => {
11826
11848
  var _a;
11827
11849
  return openBlock(), createElementBlock("div", _hoisted_1$z, [
@@ -11833,7 +11855,8 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
11833
11855
  _ctx.options.categories ? (openBlock(), createBlock(_sfc_main$K, {
11834
11856
  key: 1,
11835
11857
  options: _ctx.options.categories,
11836
- ref: "categoryFilters"
11858
+ ref_key: "categoryFilters",
11859
+ ref: categoryFilters
11837
11860
  }, null, 8, ["options"])) : createCommentVNode("", true),
11838
11861
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$D, {
11839
11862
  key: 2,
@@ -12420,15 +12443,6 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
12420
12443
  };
12421
12444
  }
12422
12445
  });
12423
- var BadgeType = /* @__PURE__ */ ((BadgeType2) => {
12424
- BadgeType2["DISCOUNTPERCENTAGE"] = "discountPercentage";
12425
- BadgeType2["DISCOUNTAMOUNT"] = "discountAmount";
12426
- BadgeType2["NEWITEM"] = "newItem";
12427
- BadgeType2["TEXT"] = "text";
12428
- BadgeType2["IMAGE"] = "image";
12429
- BadgeType2["CUSTOM_HTML"] = "customHtml";
12430
- return BadgeType2;
12431
- })(BadgeType || {});
12432
12446
  const _hoisted_1$p = { class: "lupa-generated-badges" };
12433
12447
  const _sfc_main$s = /* @__PURE__ */ defineComponent({
12434
12448
  __name: "SearchResultGeneratedBadges",
@@ -13876,7 +13890,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13876
13890
  isContainer: { type: Boolean },
13877
13891
  initialData: {}
13878
13892
  },
13879
- setup(__props) {
13893
+ setup(__props, { expose: __expose }) {
13880
13894
  const props = __props;
13881
13895
  const searchResultStore = useSearchResultStore();
13882
13896
  const optionStore = useOptionsStore();
@@ -13907,12 +13921,10 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13907
13921
  onMounted(() => {
13908
13922
  var _a, _b;
13909
13923
  window.addEventListener("resize", handleResize);
13910
- optionStore.setSearchResultOptions({ options: props.options });
13911
13924
  if (props.initialData) {
13912
13925
  searchResultStore.add(__spreadValues2({}, props.initialData));
13913
13926
  }
13914
13927
  handleMounted();
13915
- optionStore.setInitialFilters({ initialFilters: initialFilters.value });
13916
13928
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
13917
13929
  mounted.value = true;
13918
13930
  });
@@ -13998,6 +14010,8 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
13998
14010
  };
13999
14011
  const handleMounted = () => {
14000
14012
  var _a;
14013
+ optionStore.setSearchResultOptions({ options: props.options });
14014
+ optionStore.setInitialFilters({ initialFilters: initialFilters.value });
14001
14015
  handleResize();
14002
14016
  if (props.isProductList) {
14003
14017
  const pageTitle = props.options.labels.htmlTitleTemplate;
@@ -14051,6 +14065,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
14051
14065
  }
14052
14066
  };
14053
14067
  handleCreated();
14068
+ __expose({ handleMounted, handleUrlChange });
14054
14069
  return (_ctx, _cache) => {
14055
14070
  var _a, _b, _c, _d, _e;
14056
14071
  return openBlock(), createElementBlock("div", {
@@ -26459,26 +26474,29 @@ const createVue = (selector, rootComponent, options, mountToParent = false) => {
26459
26474
  const parent = element == null ? void 0 : element.parentElement;
26460
26475
  const mountElement = mountToParent ? parent : element;
26461
26476
  if (!mountElement) {
26462
- console.error(`Cannot mount LupaSearch componbent. Element "${selector}" not found`);
26477
+ console.error(`Cannot mount LupaSearch component. Element "${selector}" not found`);
26463
26478
  return;
26464
26479
  }
26480
+ let mountedComponent = null;
26465
26481
  const props = reactive(__spreadValues({}, options));
26466
- const app2 = createApp(rootComponent, props);
26482
+ const app2 = createApp({
26483
+ render: () => mountedComponent = h$1(rootComponent, props)
26484
+ });
26467
26485
  app2.use(pinia);
26468
26486
  const mountedApp = app2.mount(mountElement);
26469
26487
  if (mountToParent) {
26470
26488
  element == null ? void 0 : element.remove();
26471
26489
  }
26472
- return mountedApp;
26490
+ return { mountedApp, mountedComponent, props, app: app2, mountElement };
26473
26491
  };
26474
26492
  const applySearchBox = (options, mountOptions) => {
26475
26493
  const existingInstance = app.box[options.inputSelector];
26476
26494
  if (existingInstance) {
26477
- existingInstance.searchBoxOptions = options;
26495
+ existingInstance.props.searchBoxOptions = options;
26478
26496
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26479
26497
  setTimeout(() => {
26480
- var _a;
26481
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26498
+ var _a, _b, _c, _d;
26499
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26482
26500
  });
26483
26501
  }
26484
26502
  return;
@@ -26504,11 +26522,11 @@ const searchBox = (options, mountOptions) => {
26504
26522
  const searchResults = (options, mountOptions) => {
26505
26523
  const existingInstance = app.results[options.containerSelector];
26506
26524
  if (existingInstance) {
26507
- existingInstance.searchResultsOptions = options;
26525
+ existingInstance.props.searchResultsOptions = options;
26508
26526
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26509
26527
  setTimeout(() => {
26510
- var _a;
26511
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26528
+ var _a, _b, _c, _d;
26529
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26512
26530
  });
26513
26531
  }
26514
26532
  return;
@@ -26524,11 +26542,11 @@ const searchResults = (options, mountOptions) => {
26524
26542
  const productList = (options, mountOptions) => {
26525
26543
  const existingInstance = app.productList[options.containerSelector];
26526
26544
  if (existingInstance) {
26527
- existingInstance.productListOptions = options;
26545
+ existingInstance.props.productListOptions = options;
26528
26546
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26529
26547
  setTimeout(() => {
26530
- var _a;
26531
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26548
+ var _a, _b, _c, _d;
26549
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26532
26550
  });
26533
26551
  }
26534
26552
  return;
@@ -26542,16 +26560,15 @@ const productList = (options, mountOptions) => {
26542
26560
  app.productList[options.containerSelector] = instance;
26543
26561
  };
26544
26562
  const searchContainer = (options, mountOptions) => {
26545
- var _a, _b;
26563
+ var _a, _b, _c, _d, _e, _f;
26546
26564
  const existingInstance = app.searchContainer[options.trigger];
26547
26565
  if (existingInstance) {
26548
- existingInstance.searchContainerOptions.value = options;
26549
- existingInstance.reloadOptions();
26550
- console.log(existingInstance);
26566
+ existingInstance.props.searchContainerOptions = options;
26567
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.reloadOptions) == null ? void 0 : _d.call(_c);
26551
26568
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26552
26569
  setTimeout(() => {
26553
- var _a2;
26554
- (_a2 = existingInstance.fetch) == null ? void 0 : _a2.call(existingInstance);
26570
+ var _a2, _b2, _c2, _d2;
26571
+ (_d2 = (_c2 = (_b2 = (_a2 = existingInstance.mountedComponent) == null ? void 0 : _a2.component) == null ? void 0 : _b2.exposed) == null ? void 0 : _c2.fetch) == null ? void 0 : _d2.call(_c2);
26555
26572
  });
26556
26573
  }
26557
26574
  return;
@@ -26562,7 +26579,7 @@ const searchContainer = (options, mountOptions) => {
26562
26579
  attatchShadowDom({
26563
26580
  host,
26564
26581
  manager,
26565
- styleUrl: (_b = (_a = options.options) == null ? void 0 : _a.styleLink) != null ? _b : DEFAULT_CONTAINER_STYLE,
26582
+ styleUrl: (_f = (_e = options.options) == null ? void 0 : _e.styleLink) != null ? _f : DEFAULT_CONTAINER_STYLE,
26566
26583
  options: options.options
26567
26584
  });
26568
26585
  document.body.appendChild(host);
@@ -26577,11 +26594,11 @@ const searchContainer = (options, mountOptions) => {
26577
26594
  const recommendations = (options, mountOptions) => {
26578
26595
  const existingInstance = app.recommendations[options.containerSelector];
26579
26596
  if (existingInstance) {
26580
- existingInstance.recommendationOptions = options;
26597
+ existingInstance.props.recommendationOptions = options;
26581
26598
  if (mountOptions == null ? void 0 : mountOptions.fetch) {
26582
26599
  setTimeout(() => {
26583
- var _a;
26584
- (_a = existingInstance.fetch) == null ? void 0 : _a.call(existingInstance);
26600
+ var _a, _b, _c, _d;
26601
+ (_d = (_c = (_b = (_a = existingInstance.mountedComponent) == null ? void 0 : _a.component) == null ? void 0 : _b.exposed) == null ? void 0 : _c.fetch) == null ? void 0 : _d.call(_c);
26585
26602
  });
26586
26603
  }
26587
26604
  return;
@@ -26594,21 +26611,20 @@ const recommendations = (options, mountOptions) => {
26594
26611
  }
26595
26612
  app.recommendations[options.containerSelector] = instance;
26596
26613
  };
26597
- const clearInstance = (selector) => {
26598
- const element = document.querySelector(selector);
26599
- if (!element) {
26600
- return;
26601
- }
26602
- document.body.removeChild(element);
26614
+ const clearInstance = (element, app2) => {
26615
+ var _a;
26616
+ const content = element.innerHTML;
26617
+ (_a = app2 == null ? void 0 : app2.unmount) == null ? void 0 : _a.call(app2);
26618
+ element.innerHTML = content;
26603
26619
  };
26604
26620
  const clearSearchBox = (selector) => {
26605
26621
  try {
26606
26622
  if (selector) {
26607
26623
  app.box[selector] = null;
26608
- clearInstance(selector);
26624
+ clearInstance(app.box[selector].mountElement, app.box[selector].app);
26609
26625
  }
26610
26626
  for (const key in app.box) {
26611
- clearInstance(key);
26627
+ clearInstance(app.box[key].mountElement, app.box[key].app);
26612
26628
  }
26613
26629
  app.box = {};
26614
26630
  } catch (e) {
@@ -26618,10 +26634,10 @@ const clearSearchResults = (selector) => {
26618
26634
  try {
26619
26635
  if (selector) {
26620
26636
  app.results[selector] = null;
26621
- clearInstance(selector);
26637
+ clearInstance(app.results[selector].mountElement, app.results[selector].app);
26622
26638
  }
26623
26639
  for (const key in app.results) {
26624
- clearInstance(key);
26640
+ clearInstance(app.results[key].mountElement, app.results[key].app);
26625
26641
  }
26626
26642
  app.results = {};
26627
26643
  } catch (e) {
@@ -26631,10 +26647,10 @@ const clearProductList = (selector) => {
26631
26647
  try {
26632
26648
  if (selector) {
26633
26649
  app.productList[selector] = null;
26634
- clearInstance(selector);
26650
+ clearInstance(app.productList[selector].mountElement, app.productList[selector].app);
26635
26651
  }
26636
26652
  for (const key in app.productList) {
26637
- clearInstance(key);
26653
+ clearInstance(app.productList[key].mountElement, app.productList[key].app);
26638
26654
  }
26639
26655
  app.productList = {};
26640
26656
  } catch (e) {
@@ -26644,10 +26660,10 @@ const clearSearchContainer = (selector) => {
26644
26660
  try {
26645
26661
  if (selector) {
26646
26662
  app.searchContainer[selector] = null;
26647
- clearInstance(selector);
26663
+ clearInstance(app.searchContainer[selector].mountElement, app.searchContainer[selector].app);
26648
26664
  }
26649
26665
  for (const key in app.searchContainer) {
26650
- clearInstance(key);
26666
+ clearInstance(app.searchContainer[key].mountElement, app.searchContainer[key].app);
26651
26667
  }
26652
26668
  app.searchContainer = {};
26653
26669
  } catch (e) {
@@ -26657,10 +26673,10 @@ const clearRecommendations = (selector) => {
26657
26673
  try {
26658
26674
  if (selector) {
26659
26675
  app.recommendations[selector] = null;
26660
- clearInstance(selector);
26676
+ clearInstance(app.recommendations[selector].mountElement, app.recommendations[selector].app);
26661
26677
  }
26662
26678
  for (const key in app.recommendations) {
26663
- clearInstance(key);
26679
+ clearInstance(app.recommendations[key].mountElement, app.recommendations[key].app);
26664
26680
  }
26665
26681
  app.recommendations = {};
26666
26682
  } catch (e) {
@@ -26683,5 +26699,7 @@ if (window) {
26683
26699
  window.getLupa = lupaSearch;
26684
26700
  window.lupaSearch = lupaSearch;
26685
26701
  }
26702
+ exports.BadgeType = BadgeType;
26686
26703
  exports.DocumentElementType = DocumentElementType;
26704
+ exports.SearchBoxPanelType = SearchBoxPanelType;
26687
26705
  exports.default = lupaSearch;