@getlupa/client 1.14.0 → 1.14.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.
@@ -8559,11 +8559,11 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8559
8559
  const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
8560
8560
  const _hoisted_2$S = { class: "lupa-input-clear" };
8561
8561
  const _hoisted_3$B = { id: "lupa-search-box-input" };
8562
- const _hoisted_4$t = ["value"];
8563
- const _hoisted_5$j = ["aria-label", "placeholder"];
8564
- const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
8562
+ const _hoisted_4$s = ["value"];
8563
+ const _hoisted_5$k = ["aria-label", "placeholder"];
8564
+ const _hoisted_6$a = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
8565
8565
  const _hoisted_7$7 = [
8566
- _hoisted_6$9
8566
+ _hoisted_6$a
8567
8567
  ];
8568
8568
  const _hoisted_8$3 = {
8569
8569
  key: 0,
@@ -8666,7 +8666,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8666
8666
  "aria-hidden": "true",
8667
8667
  value: showHint.value ? suggestedValue.value.item.suggestion : "",
8668
8668
  disabled: ""
8669
- }, null, 8, _hoisted_4$t),
8669
+ }, null, 8, _hoisted_4$s),
8670
8670
  withDirectives(createBaseVNode("input", mergeProps({
8671
8671
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
8672
8672
  }, inputAttributes.value, {
@@ -8680,7 +8680,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8680
8680
  placeholder: labels.value.placeholder,
8681
8681
  onInput: handleInput,
8682
8682
  onFocus: handleFocus
8683
- }), null, 16, _hoisted_5$j), [
8683
+ }), null, 16, _hoisted_5$k), [
8684
8684
  [vModelText, inputValue.value]
8685
8685
  ]),
8686
8686
  _ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
@@ -8839,6 +8839,34 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8839
8839
  };
8840
8840
  }
8841
8841
  });
8842
+ const generateGridTemplate = (elements) => {
8843
+ const indexedElements = elements.map((el, index) => __spreadProps2(__spreadValues2({}, el), { index }));
8844
+ if (!indexedElements.length || !indexedElements.every((el) => el.gridArea === "left" || el.gridArea === "right")) {
8845
+ return void 0;
8846
+ }
8847
+ let leftElements = indexedElements.filter((el) => el.gridArea === "left");
8848
+ let rightElements = indexedElements.filter((el) => el.gridArea === "right");
8849
+ if (!leftElements.length && !rightElements.length) {
8850
+ return "";
8851
+ } else if (!leftElements.length) {
8852
+ leftElements = rightElements;
8853
+ } else if (!rightElements.length) {
8854
+ rightElements = leftElements;
8855
+ }
8856
+ const totalRows = Math.max(leftElements.length, rightElements.length);
8857
+ const gridTemplate = [];
8858
+ for (let row = 0; row < totalRows; row++) {
8859
+ const leftIndex = row < leftElements.length ? row : leftElements.length - 1;
8860
+ const rightIndex = row < rightElements.length ? row : rightElements.length - 1;
8861
+ const leftElement = leftElements[leftIndex];
8862
+ const rightElement = rightElements[rightIndex];
8863
+ const leftColumn = `${leftElement.gridArea}${leftElement.index}`;
8864
+ const rightColumn = `${rightElement.gridArea}${rightElement.index}`;
8865
+ const gridRow = `${leftColumn} ${rightColumn}`;
8866
+ gridTemplate.push(`"${gridRow}"`);
8867
+ }
8868
+ return gridTemplate.join(" ");
8869
+ };
8842
8870
  const _hoisted_1$19 = ["innerHTML"];
8843
8871
  const _hoisted_2$Q = {
8844
8872
  key: 1,
@@ -8850,11 +8878,11 @@ const _hoisted_3$A = {
8850
8878
  class: "lupa-suggestion-facet",
8851
8879
  "data-cy": "lupa-suggestion-facet"
8852
8880
  };
8853
- const _hoisted_4$s = {
8881
+ const _hoisted_4$r = {
8854
8882
  class: "lupa-suggestion-facet-label",
8855
8883
  "data-cy": "lupa-suggestion-facet-label"
8856
8884
  };
8857
- const _hoisted_5$i = {
8885
+ const _hoisted_5$j = {
8858
8886
  class: "lupa-suggestion-facet-value",
8859
8887
  "data-cy": "lupa-suggestion-facet-value"
8860
8888
  };
@@ -8896,8 +8924,8 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
8896
8924
  innerHTML: _ctx.suggestion.displayHighlight
8897
8925
  }, null, 8, _hoisted_1$19)) : (openBlock(), createElementBlock("div", _hoisted_2$Q, toDisplayString(_ctx.suggestion.display), 1)),
8898
8926
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8899
- createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
8900
- createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
8927
+ createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
8928
+ createBaseVNode("span", _hoisted_5$j, toDisplayString(_ctx.suggestion.facet.title), 1)
8901
8929
  ])) : createCommentVNode("", true)
8902
8930
  ]);
8903
8931
  };
@@ -9037,6 +9065,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent({
9037
9065
  });
9038
9066
  };
9039
9067
  const getSuggestionsDebounced = debounce$1(getSuggestions, props.debounce);
9068
+ watch(() => props.panel.limit, getSuggestionsDebounced);
9040
9069
  return (_ctx, _cache) => {
9041
9070
  return openBlock(), createBlock(_sfc_main$1h, {
9042
9071
  items: searchResult.value,
@@ -18157,6 +18186,25 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
18157
18186
  var _a;
18158
18187
  return Boolean((_a = hoverImages.value) == null ? void 0 : _a.length);
18159
18188
  });
18189
+ const widthOverride = computed(() => {
18190
+ var _a, _b;
18191
+ return (_b = (_a = props.options.dimensions) == null ? void 0 : _a.width) != null ? _b : void 0;
18192
+ });
18193
+ const heightOverride = computed(() => {
18194
+ var _a, _b;
18195
+ return (_b = (_a = props.options.dimensions) == null ? void 0 : _a.height) != null ? _b : void 0;
18196
+ });
18197
+ const objectFitOverride = computed(() => {
18198
+ var _a, _b;
18199
+ return (_b = (_a = props.options.dimensions) == null ? void 0 : _a.objectFit) != null ? _b : void 0;
18200
+ });
18201
+ const styleOverride = computed(() => {
18202
+ return {
18203
+ width: widthOverride.value ? `${widthOverride.value}px` : void 0,
18204
+ height: heightOverride.value ? `${heightOverride.value}px` : void 0,
18205
+ objectFit: objectFitOverride.value ? objectFitOverride.value : void 0
18206
+ };
18207
+ });
18160
18208
  const replaceWithPlaceholder = (e2) => {
18161
18209
  replaceImageWithPlaceholder(e2, placeholder.value);
18162
18210
  };
@@ -18221,6 +18269,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
18221
18269
  return (_ctx, _cache) => {
18222
18270
  return openBlock(), createElementBlock("div", {
18223
18271
  class: normalizeClass({ [_ctx.wrapperClass]: Boolean(_ctx.wrapperClass), "lupa-images-hover": isHover.value }),
18272
+ style: normalizeStyle(styleOverride.value),
18224
18273
  onMouseenter: handleMouseEnter,
18225
18274
  onMouseleave: handleMouseLeave
18226
18275
  }, [
@@ -18231,6 +18280,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
18231
18280
  default: withCtx(() => [
18232
18281
  (openBlock(), createElementBlock("img", mergeProps({
18233
18282
  class: ["lupa-images-hover-image", { [_ctx.imageClass]: true, "lupa-images-hover-image": isHover.value }],
18283
+ style: styleOverride.value,
18234
18284
  src: finalUrl.value
18235
18285
  }, { alt: imageAlt.value ? imageAlt.value : void 0 }, {
18236
18286
  onError: replaceWithPlaceholder,
@@ -18241,9 +18291,10 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
18241
18291
  })) : (openBlock(), createElementBlock("img", mergeProps({
18242
18292
  key: 1,
18243
18293
  class: ["lupa-images-main-image", { [_ctx.imageClass]: true }],
18294
+ style: styleOverride.value,
18244
18295
  src: finalMainImageUrl.value
18245
18296
  }, { alt: imageAlt.value ? imageAlt.value : void 0 }, { onError: replaceWithPlaceholder }), null, 16, _hoisted_2$P))
18246
- ], 34);
18297
+ ], 38);
18247
18298
  };
18248
18299
  }
18249
18300
  });
@@ -18385,8 +18436,8 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
18385
18436
  const _hoisted_1$13 = ["innerHTML"];
18386
18437
  const _hoisted_2$M = { key: 0 };
18387
18438
  const _hoisted_3$z = { key: 1 };
18388
- const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
18389
- const _hoisted_5$h = { class: "lupa-search-box-custom-text" };
18439
+ const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
18440
+ const _hoisted_5$i = { class: "lupa-search-box-custom-text" };
18390
18441
  const _sfc_main$19 = /* @__PURE__ */ defineComponent({
18391
18442
  __name: "SearchBoxProductCustom",
18392
18443
  props: {
@@ -18418,8 +18469,8 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
18418
18469
  class: [className.value, "lupa-search-box-product-custom"]
18419
18470
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
18420
18471
  !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$M, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$z, [
18421
- createBaseVNode("div", _hoisted_4$r, toDisplayString(label.value), 1),
18422
- createBaseVNode("div", _hoisted_5$h, toDisplayString(text.value), 1)
18472
+ createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
18473
+ createBaseVNode("div", _hoisted_5$i, toDisplayString(text.value), 1)
18423
18474
  ]))
18424
18475
  ], 16));
18425
18476
  };
@@ -18825,7 +18876,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
18825
18876
  const _hoisted_1$$ = { class: "lupa-badge-title" };
18826
18877
  const _hoisted_2$K = ["src"];
18827
18878
  const _hoisted_3$x = { key: 1 };
18828
- const _hoisted_4$q = {
18879
+ const _hoisted_4$p = {
18829
18880
  key: 0,
18830
18881
  class: "lupa-badge-full-text"
18831
18882
  };
@@ -18869,7 +18920,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
18869
18920
  }, null, 8, _hoisted_2$K)) : createCommentVNode("", true),
18870
18921
  hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$x, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
18871
18922
  ]),
18872
- hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
18923
+ hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$p, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
18873
18924
  ], 6);
18874
18925
  };
18875
18926
  }
@@ -19093,9 +19144,8 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
19093
19144
  }
19094
19145
  }));
19095
19146
  const _hoisted_1$V = ["href"];
19096
- const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
19097
- const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
19098
- const _hoisted_4$p = {
19147
+ const _hoisted_2$I = { class: "lupa-search-box-product-details-section" };
19148
+ const _hoisted_3$w = {
19099
19149
  key: 0,
19100
19150
  class: "lupa-search-box-product-add-to-cart-section"
19101
19151
  };
@@ -19123,6 +19173,25 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
19123
19173
  var _a, _b;
19124
19174
  return (_b = (_a = props.panelOptions.elements) == null ? void 0 : _a.filter((e2) => e2.type === DocumentElementType.IMAGE)) != null ? _b : [];
19125
19175
  });
19176
+ const mainImageElement = computed(() => {
19177
+ return imageElements.value[0];
19178
+ });
19179
+ const widthOverride = computed(() => {
19180
+ var _a, _b, _c;
19181
+ return (_c = (_b = (_a = mainImageElement.value) == null ? void 0 : _a.dimensions) == null ? void 0 : _b.width) != null ? _c : void 0;
19182
+ });
19183
+ const heightOverride = computed(() => {
19184
+ var _a, _b, _c;
19185
+ return (_c = (_b = (_a = mainImageElement.value) == null ? void 0 : _a.dimensions) == null ? void 0 : _b.height) != null ? _c : void 0;
19186
+ });
19187
+ const imageStyleOverride = computed(() => {
19188
+ var _a;
19189
+ return ((_a = mainImageElement.value) == null ? void 0 : _a.dimensions) ? {
19190
+ width: widthOverride.value ? `${widthOverride.value}px` : void 0,
19191
+ height: heightOverride.value ? `${heightOverride.value}px` : void 0,
19192
+ minWidth: widthOverride.value ? `${widthOverride.value + 10}px` : void 0
19193
+ } : {};
19194
+ });
19126
19195
  const detailElements = computed(() => {
19127
19196
  var _a, _b;
19128
19197
  return (_b = (_a = props.panelOptions.elements) == null ? void 0 : _a.filter(
@@ -19161,7 +19230,10 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
19161
19230
  "data-cy": "lupa-search-box-product",
19162
19231
  onClick: handleClick
19163
19232
  }), [
19164
- createBaseVNode("div", _hoisted_2$I, [
19233
+ createBaseVNode("div", {
19234
+ class: "lupa-search-box-product-image-section",
19235
+ style: normalizeStyle(imageStyleOverride.value)
19236
+ }, [
19165
19237
  (openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
19166
19238
  return openBlock(), createBlock(_sfc_main$16, {
19167
19239
  class: "lupa-search-box-product-element",
@@ -19172,8 +19244,8 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
19172
19244
  link: link.value
19173
19245
  }, null, 8, ["item", "element", "labels", "link"]);
19174
19246
  }), 128))
19175
- ]),
19176
- createBaseVNode("div", _hoisted_3$w, [
19247
+ ], 4),
19248
+ createBaseVNode("div", _hoisted_2$I, [
19177
19249
  (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
19178
19250
  var _a;
19179
19251
  return openBlock(), createBlock(_sfc_main$16, {
@@ -19197,7 +19269,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
19197
19269
  ]), 1032, ["item", "element", "labels", "link"]);
19198
19270
  }), 128))
19199
19271
  ]),
19200
- addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_4$p, [
19272
+ addToCartElement.value ? (openBlock(), createElementBlock("div", _hoisted_3$w, [
19201
19273
  createVNode(_sfc_main$16, {
19202
19274
  class: "lupa-search-box-product-element",
19203
19275
  item: _ctx.item,
@@ -19455,6 +19527,7 @@ const _sfc_main$Y = /* @__PURE__ */ defineComponent({
19455
19527
  });
19456
19528
  };
19457
19529
  const getItemsDebounced = debounce$1(getItems, props.debounce);
19530
+ watch(() => props.panel.limit, getItemsDebounced);
19458
19531
  return (_ctx, _cache) => {
19459
19532
  var _a, _b;
19460
19533
  return openBlock(), createBlock(_sfc_main$_, {
@@ -19591,7 +19664,7 @@ const _hoisted_4$o = {
19591
19664
  key: 1,
19592
19665
  class: "lupa-panel-title"
19593
19666
  };
19594
- const _hoisted_5$g = {
19667
+ const _hoisted_5$h = {
19595
19668
  key: 1,
19596
19669
  id: "lupa-search-box-panel"
19597
19670
  };
@@ -19643,6 +19716,13 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19643
19716
  const displayPanels = computed(
19644
19717
  () => props.isSearchContainer ? panels.value.filter((p2) => p2.type === SearchBoxPanelType.SUGGESTION) : panels.value
19645
19718
  );
19719
+ const gridTemplate = computed(() => generateGridTemplate(panels.value));
19720
+ const styleOverrides = computed(() => {
19721
+ return {
19722
+ display: expandOnSinglePanel.value ? "block" : "grid",
19723
+ gridTemplateAreas: gridTemplate.value ? gridTemplate.value : "left right"
19724
+ };
19725
+ });
19646
19726
  const getInput = (panel) => {
19647
19727
  var _a, _b;
19648
19728
  if (panel.type === SearchBoxPanelType.SUGGESTION || !panel.searchBySuggestion) {
@@ -19669,6 +19749,9 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19669
19749
  searchBoxStore.resetHighlightIndex();
19670
19750
  });
19671
19751
  const handleNavigation = (e2) => {
19752
+ if (!props.focused) {
19753
+ return;
19754
+ }
19672
19755
  switch (e2.key) {
19673
19756
  case "ArrowDown":
19674
19757
  e2.preventDefault();
@@ -19756,7 +19839,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19756
19839
  }, toDisplayString(labels.value.closePanel), 1)) : createCommentVNode("", true),
19757
19840
  createBaseVNode("div", {
19758
19841
  class: "lupa-main-panel",
19759
- style: normalizeStyle(expandOnSinglePanel.value ? { display: "block" } : {}),
19842
+ style: normalizeStyle(styleOverrides.value),
19760
19843
  "data-cy": "lupa-main-panel"
19761
19844
  }, [
19762
19845
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayPanels.value, (panel, index) => {
@@ -19767,6 +19850,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19767
19850
  "lupa-panel-" + panel.type + "-index",
19768
19851
  panel.customClassName ? panel.customClassName : ""
19769
19852
  ]),
19853
+ style: normalizeStyle(panel.gridArea ? { gridArea: `${panel.gridArea}${index}` } : {}),
19770
19854
  "data-cy": "lupa-panel-" + panel.type + "-index"
19771
19855
  }, [
19772
19856
  ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
@@ -19792,7 +19876,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19792
19876
  key: "0"
19793
19877
  } : void 0
19794
19878
  ]), 1064, ["panel", "search-box-options", "options", "debounce", "inputValue", "labels"])) : createCommentVNode("", true)
19795
- ], 10, _hoisted_2$G);
19879
+ ], 14, _hoisted_2$G);
19796
19880
  }), 128))
19797
19881
  ], 4),
19798
19882
  !unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (openBlock(), createBlock(_sfc_main$1j, {
@@ -19805,7 +19889,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
19805
19889
  showTotalCount: (_a = _ctx.options.showTotalCount) != null ? _a : false,
19806
19890
  onGoToResults: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("go-to-results"))
19807
19891
  }, null, 8, ["labels", "showTotalCount"])) : createCommentVNode("", true)
19808
- ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_5$g, [
19892
+ ])) : displayHistory.value ? (openBlock(), createElementBlock("div", _hoisted_5$h, [
19809
19893
  createVNode(_sfc_main$1k, {
19810
19894
  options: _ctx.options.history,
19811
19895
  history: history.value,
@@ -19856,6 +19940,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
19856
19940
  const inputValue = ref("");
19857
19941
  const suggestedValue = ref(defaultSuggestedValue);
19858
19942
  const opened = ref(props.isSearchContainer);
19943
+ const focused = ref(false);
19859
19944
  const searchBoxInput = ref(null);
19860
19945
  const { highlightedDocument } = storeToRefs(searchBoxStore);
19861
19946
  const searchValue = computed(() => {
@@ -19914,6 +19999,9 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
19914
19999
  const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
19915
20000
  const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
19916
20001
  const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
20002
+ if (isOutsideElement && props.options.keepOpen) {
20003
+ focused.value = false;
20004
+ }
19917
20005
  if (!isOutsideElement || props.options.keepOpen) {
19918
20006
  return;
19919
20007
  }
@@ -19922,11 +20010,12 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
19922
20010
  };
19923
20011
  const close = () => {
19924
20012
  opened.value = false;
20013
+ focused.value = false;
19925
20014
  suggestedValue.value = defaultSuggestedValue;
19926
20015
  };
19927
20016
  const handleKeyDown = (e2) => {
19928
20017
  var _a2, _b;
19929
- if (!opened.value) {
20018
+ if (!focused.value) {
19930
20019
  return;
19931
20020
  }
19932
20021
  switch (e2.key) {
@@ -19946,6 +20035,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
19946
20035
  const handleInput = (value) => {
19947
20036
  var _a2;
19948
20037
  opened.value = true;
20038
+ focused.value = true;
19949
20039
  inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
19950
20040
  suggestedValue.value = defaultSuggestedValue;
19951
20041
  searchBoxStore.resetHighlightIndex();
@@ -20073,12 +20163,14 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
20073
20163
  }
20074
20164
  });
20075
20165
  };
20166
+ watch(() => props.options.debounce, handleCurrentValueSearch);
20076
20167
  const resetValues = () => {
20077
20168
  inputValue.value = "";
20078
20169
  suggestedValue.value = defaultSuggestedValue;
20079
20170
  };
20080
20171
  const handleProductClick = () => {
20081
20172
  opened.value = false;
20173
+ focused.value = false;
20082
20174
  };
20083
20175
  const slotProps = (props2) => {
20084
20176
  return __spreadValues2({}, props2);
@@ -20095,15 +20187,17 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
20095
20187
  ref_key: "searchBoxInput",
20096
20188
  ref: searchBoxInput,
20097
20189
  onInput: handleInput,
20098
- onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
20190
+ onBlur: _cache[0] || (_cache[0] = ($event) => focused.value = false),
20191
+ onFocus: _cache[1] || (_cache[1] = ($event) => opened.value = true),
20099
20192
  onSearch: handleSearch,
20100
- onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
20193
+ onClose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("close"))
20101
20194
  }, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
20102
20195
  opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
20103
20196
  key: 0,
20104
20197
  options: panelOptions.value,
20105
20198
  inputValue: inputValue.value,
20106
20199
  isSearchContainer: _ctx.isSearchContainer,
20200
+ focused: focused.value,
20107
20201
  onFetched: handleItemsFetch,
20108
20202
  onItemSelect: handleItemSelect,
20109
20203
  onGoToResults: handleSearch,
@@ -20117,7 +20211,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
20117
20211
  ]),
20118
20212
  key: "0"
20119
20213
  } : void 0
20120
- ]), 1032, ["options", "inputValue", "isSearchContainer"])) : createCommentVNode("", true)
20214
+ ]), 1032, ["options", "inputValue", "isSearchContainer", "focused"])) : createCommentVNode("", true)
20121
20215
  ])
20122
20216
  ]);
20123
20217
  };
@@ -20301,7 +20395,7 @@ const _hoisted_3$t = {
20301
20395
  class: "lupa-results-total-count"
20302
20396
  };
20303
20397
  const _hoisted_4$m = { class: "lupa-results-total-count-number" };
20304
- const _hoisted_5$f = ["innerHTML"];
20398
+ const _hoisted_5$g = ["innerHTML"];
20305
20399
  const _sfc_main$S = /* @__PURE__ */ defineComponent({
20306
20400
  __name: "SearchResultsTitle",
20307
20401
  props: {
@@ -20358,7 +20452,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
20358
20452
  key: 2,
20359
20453
  class: "lupa-result-page-description-top",
20360
20454
  innerHTML: descriptionTop.value
20361
- }, null, 8, _hoisted_5$f)) : createCommentVNode("", true)
20455
+ }, null, 8, _hoisted_5$g)) : createCommentVNode("", true)
20362
20456
  ]);
20363
20457
  };
20364
20458
  }
@@ -20557,7 +20651,7 @@ const _hoisted_1$K = {
20557
20651
  const _hoisted_2$z = { class: "lupa-category-back" };
20558
20652
  const _hoisted_3$q = ["href"];
20559
20653
  const _hoisted_4$k = ["href"];
20560
- const _hoisted_5$e = { class: "lupa-child-category-list" };
20654
+ const _hoisted_5$f = { class: "lupa-child-category-list" };
20561
20655
  const _sfc_main$O = /* @__PURE__ */ defineComponent({
20562
20656
  __name: "CategoryFilter",
20563
20657
  props: {
@@ -20663,7 +20757,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
20663
20757
  onClick: handleNavigationParent
20664
20758
  }, toDisplayString(parentTitle.value), 11, _hoisted_4$k)
20665
20759
  ], 2),
20666
- createBaseVNode("div", _hoisted_5$e, [
20760
+ createBaseVNode("div", _hoisted_5$f, [
20667
20761
  (openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
20668
20762
  return openBlock(), createBlock(_sfc_main$P, {
20669
20763
  key: getCategoryKey(child),
@@ -20683,8 +20777,8 @@ const _hoisted_1$J = {
20683
20777
  const _hoisted_2$y = ["placeholder"];
20684
20778
  const _hoisted_3$p = { class: "lupa-terms-list" };
20685
20779
  const _hoisted_4$j = ["onClick"];
20686
- const _hoisted_5$d = { class: "lupa-term-checkbox-wrapper" };
20687
- const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
20780
+ const _hoisted_5$e = { class: "lupa-term-checkbox-wrapper" };
20781
+ const _hoisted_6$9 = { class: "lupa-term-checkbox-label" };
20688
20782
  const _hoisted_7$6 = { class: "lupa-term-label" };
20689
20783
  const _hoisted_8$2 = {
20690
20784
  key: 0,
@@ -20781,12 +20875,12 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
20781
20875
  key: item.title,
20782
20876
  onClick: ($event) => handleFacetClick(item)
20783
20877
  }, [
20784
- createBaseVNode("div", _hoisted_5$d, [
20878
+ createBaseVNode("div", _hoisted_5$e, [
20785
20879
  createBaseVNode("span", {
20786
20880
  class: normalizeClass(["lupa-term-checkbox", { checked: isChecked(item) }])
20787
20881
  }, null, 2)
20788
20882
  ]),
20789
- createBaseVNode("div", _hoisted_6$8, [
20883
+ createBaseVNode("div", _hoisted_6$9, [
20790
20884
  createBaseVNode("span", _hoisted_7$6, toDisplayString(item.title), 1),
20791
20885
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_8$2, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
20792
20886
  ])
@@ -21794,8 +21888,8 @@ const _hoisted_4$i = {
21794
21888
  key: 0,
21795
21889
  class: "lupa-stats-range-label"
21796
21890
  };
21797
- const _hoisted_5$c = { class: "lupa-stats-from" };
21798
- const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
21891
+ const _hoisted_5$d = { class: "lupa-stats-from" };
21892
+ const _hoisted_6$8 = ["max", "min", "pattern", "aria-label"];
21799
21893
  const _hoisted_7$5 = { key: 0 };
21800
21894
  const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
21801
21895
  const _hoisted_9$1 = {
@@ -21986,7 +22080,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
21986
22080
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
21987
22081
  createBaseVNode("div", null, [
21988
22082
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
21989
- createBaseVNode("div", _hoisted_5$c, [
22083
+ createBaseVNode("div", _hoisted_5$d, [
21990
22084
  withDirectives(createBaseVNode("input", {
21991
22085
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
21992
22086
  type: "text",
@@ -21995,7 +22089,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
21995
22089
  min: facetMin.value,
21996
22090
  pattern: sliderInputFormat.value,
21997
22091
  "aria-label": ariaLabelFrom.value
21998
- }, null, 8, _hoisted_6$7), [
22092
+ }, null, 8, _hoisted_6$8), [
21999
22093
  [
22000
22094
  vModelText,
22001
22095
  fromValue.value,
@@ -22056,7 +22150,7 @@ const _hoisted_4$h = {
22056
22150
  key: 0,
22057
22151
  class: "lupa-term-count"
22058
22152
  };
22059
- const _hoisted_5$b = {
22153
+ const _hoisted_5$c = {
22060
22154
  key: 0,
22061
22155
  class: "lupa-facet-level"
22062
22156
  };
@@ -22116,7 +22210,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
22116
22210
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$h, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
22117
22211
  ])
22118
22212
  ]),
22119
- showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_5$b, [
22213
+ showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_5$c, [
22120
22214
  (openBlock(true), createElementBlock(Fragment, null, renderList(treeItem.value.children, (itemChild) => {
22121
22215
  return openBlock(), createBlock(_component_HierarchyFacetLevel, {
22122
22216
  key: itemChild.title,
@@ -22626,8 +22720,8 @@ const _hoisted_1$A = {
22626
22720
  const _hoisted_2$r = ["onClick"];
22627
22721
  const _hoisted_3$l = { class: "lupa-mobile-sidebar-content" };
22628
22722
  const _hoisted_4$g = { class: "lupa-sidebar-top" };
22629
- const _hoisted_5$a = { class: "lupa-sidebar-title" };
22630
- const _hoisted_6$6 = {
22723
+ const _hoisted_5$b = { class: "lupa-sidebar-title" };
22724
+ const _hoisted_6$7 = {
22631
22725
  key: 0,
22632
22726
  class: "lupa-sidebar-filter-count"
22633
22727
  };
@@ -22670,9 +22764,9 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
22670
22764
  }, null, 8, _hoisted_2$r),
22671
22765
  createBaseVNode("div", _hoisted_3$l, [
22672
22766
  createBaseVNode("div", _hoisted_4$g, [
22673
- createBaseVNode("div", _hoisted_5$a, [
22767
+ createBaseVNode("div", _hoisted_5$b, [
22674
22768
  createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
22675
- isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
22769
+ isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$7, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
22676
22770
  ]),
22677
22771
  createBaseVNode("div", {
22678
22772
  class: "lupa-filter-toggle-mobile",
@@ -22976,7 +23070,7 @@ const _hoisted_1$u = {
22976
23070
  const _hoisted_2$o = { id: "lupa-select" };
22977
23071
  const _hoisted_3$i = { class: "lupa-select-label" };
22978
23072
  const _hoisted_4$d = ["aria-label"];
22979
- const _hoisted_5$9 = ["value"];
23073
+ const _hoisted_5$a = ["value"];
22980
23074
  const _sfc_main$y = /* @__PURE__ */ defineComponent({
22981
23075
  __name: "SearchResultsPageSize",
22982
23076
  props: {
@@ -23020,7 +23114,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23020
23114
  return openBlock(), createElementBlock("option", {
23021
23115
  key: option,
23022
23116
  value: option
23023
- }, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$9);
23117
+ }, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$a);
23024
23118
  }), 128))
23025
23119
  ], 40, _hoisted_4$d)
23026
23120
  ])
@@ -23035,7 +23129,7 @@ const _hoisted_1$t = {
23035
23129
  const _hoisted_2$n = { id: "lupa-select" };
23036
23130
  const _hoisted_3$h = { class: "lupa-select-label" };
23037
23131
  const _hoisted_4$c = ["aria-label"];
23038
- const _hoisted_5$8 = ["value"];
23132
+ const _hoisted_5$9 = ["value"];
23039
23133
  const _sfc_main$x = /* @__PURE__ */ defineComponent({
23040
23134
  __name: "SearchResultsSort",
23041
23135
  props: {
@@ -23100,7 +23194,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
23100
23194
  return openBlock(), createElementBlock("option", {
23101
23195
  key: option.key,
23102
23196
  value: option.key
23103
- }, toDisplayString(option.label), 9, _hoisted_5$8);
23197
+ }, toDisplayString(option.label), 9, _hoisted_5$9);
23104
23198
  }), 128))
23105
23199
  ], 40, _hoisted_4$c), [
23106
23200
  [vModelSelect, selectedKey.value]
@@ -23117,8 +23211,8 @@ const _hoisted_2$m = {
23117
23211
  };
23118
23212
  const _hoisted_3$g = { key: 2 };
23119
23213
  const _hoisted_4$b = { key: 4 };
23120
- const _hoisted_5$7 = { key: 6 };
23121
- const _hoisted_6$5 = { class: "lupa-toolbar-right" };
23214
+ const _hoisted_5$8 = { key: 6 };
23215
+ const _hoisted_6$6 = { class: "lupa-toolbar-right" };
23122
23216
  const _hoisted_7$3 = {
23123
23217
  key: 0,
23124
23218
  class: "lupa-toolbar-right-title"
@@ -23246,9 +23340,9 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
23246
23340
  options: paginationOptions.value.pageSelect,
23247
23341
  "last-page-label": paginationOptions.value.labels.showMore,
23248
23342
  "first-page-label": paginationOptions.value.labels.showLess
23249
- }, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$7))
23343
+ }, null, 8, ["options", "last-page-label", "first-page-label"])) : (openBlock(), createElementBlock("div", _hoisted_5$8))
23250
23344
  ]),
23251
- createBaseVNode("div", _hoisted_6$5, [
23345
+ createBaseVNode("div", _hoisted_6$6, [
23252
23346
  toolbarRightLabel.value ? (openBlock(), createElementBlock("div", _hoisted_7$3, toDisplayString(toolbarRightLabel.value), 1)) : createCommentVNode("", true),
23253
23347
  createVNode(_sfc_main$A, {
23254
23348
  label: optionsValue.value.labels.mobileFilterButton,
@@ -23286,13 +23380,15 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
23286
23380
  };
23287
23381
  }
23288
23382
  });
23289
- const _hoisted_1$r = ["innerHTML"];
23383
+ const _hoisted_1$r = ["title", "innerHTML"];
23290
23384
  const _hoisted_2$l = ["title"];
23291
- const _hoisted_3$f = {
23385
+ const _hoisted_3$f = ["href", "innerHTML"];
23386
+ const _hoisted_4$a = ["title"];
23387
+ const _hoisted_5$7 = {
23292
23388
  key: 0,
23293
23389
  class: "lupa-search-results-product-title-text"
23294
23390
  };
23295
- const _hoisted_4$a = ["href"];
23391
+ const _hoisted_6$5 = ["href"];
23296
23392
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
23297
23393
  __name: "SearchResultsProductTitle",
23298
23394
  props: {
@@ -23324,25 +23420,38 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
23324
23420
  handleRoutingEvent(props.link, event, hasEventRouting.value);
23325
23421
  };
23326
23422
  return (_ctx, _cache) => {
23327
- return isHtml.value ? (openBlock(), createElementBlock("div", {
23423
+ return isHtml.value && !_ctx.options.link ? (openBlock(), createElementBlock("div", {
23328
23424
  key: 0,
23329
23425
  class: "lupa-search-results-product-title",
23330
23426
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
23427
+ title: sanitizedTitle.value,
23331
23428
  innerHTML: sanitizedTitle.value
23332
- }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
23429
+ }, null, 12, _hoisted_1$r)) : isHtml.value && _ctx.options.link ? (openBlock(), createElementBlock("div", {
23333
23430
  key: 1,
23334
23431
  class: "lupa-search-results-product-title",
23335
23432
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
23433
+ title: sanitizedTitle.value
23434
+ }, [
23435
+ createBaseVNode("a", {
23436
+ href: _ctx.link,
23437
+ class: "lupa-search-results-product-title-text lupa-title-link",
23438
+ innerHTML: sanitizedTitle.value,
23439
+ onClick: handleNavigation
23440
+ }, null, 8, _hoisted_3$f)
23441
+ ], 12, _hoisted_2$l)) : (openBlock(), createElementBlock("div", {
23442
+ key: 2,
23443
+ class: "lupa-search-results-product-title",
23444
+ style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
23336
23445
  title: title.value
23337
23446
  }, [
23338
- !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(title.value), 1)) : createCommentVNode("", true),
23447
+ !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_5$7, toDisplayString(title.value), 1)) : createCommentVNode("", true),
23339
23448
  _ctx.options.link ? (openBlock(), createElementBlock("a", {
23340
23449
  key: 1,
23341
23450
  href: _ctx.link,
23342
23451
  class: "lupa-search-results-product-title-text lupa-title-link",
23343
23452
  onClick: handleNavigation
23344
- }, toDisplayString(title.value), 9, _hoisted_4$a)) : createCommentVNode("", true)
23345
- ], 12, _hoisted_2$l));
23453
+ }, toDisplayString(title.value), 9, _hoisted_6$5)) : createCommentVNode("", true)
23454
+ ], 12, _hoisted_4$a));
23346
23455
  };
23347
23456
  }
23348
23457
  });