@getlupa/client 1.8.6 → 1.8.7

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.
@@ -6401,6 +6401,37 @@ const inputsAreEqual = (input, possibleValues) => {
6401
6401
  const normalizedInput = getNormalizedString(input);
6402
6402
  return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
6403
6403
  };
6404
+ const levenshteinDistance = (s = "", t = "") => {
6405
+ if (!(s == null ? void 0 : s.length)) {
6406
+ return t.length;
6407
+ }
6408
+ if (!(t == null ? void 0 : t.length)) {
6409
+ return s.length;
6410
+ }
6411
+ const arr = [];
6412
+ for (let i = 0; i <= t.length; i++) {
6413
+ arr[i] = [i];
6414
+ for (let j = 1; j <= s.length; j++) {
6415
+ arr[i][j] = i === 0 ? j : Math.min(
6416
+ arr[i - 1][j] + 1,
6417
+ arr[i][j - 1] + 1,
6418
+ arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)
6419
+ );
6420
+ }
6421
+ }
6422
+ return arr[t.length][s.length];
6423
+ };
6424
+ const findClosestStringValue = (input, possibleValues, key) => {
6425
+ var _a;
6426
+ const directMatch = possibleValues.find((v) => v[key] === input);
6427
+ if (directMatch) {
6428
+ return directMatch;
6429
+ }
6430
+ const distances = possibleValues.map((v) => levenshteinDistance(`${v[key]}`, input));
6431
+ const minDistance = Math.min(...distances);
6432
+ const closestValue = (_a = possibleValues.filter((_, i) => distances[i] === minDistance)) == null ? void 0 : _a[0];
6433
+ return closestValue;
6434
+ };
6404
6435
  const initAnalyticsTracking = (analyticsOptions) => {
6405
6436
  try {
6406
6437
  if (analyticsOptions == null ? void 0 : analyticsOptions.enabled) {
@@ -7810,7 +7841,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
7810
7841
  });
7811
7842
  const _hoisted_1$1c = { id: "lupa-search-box-input-container" };
7812
7843
  const _hoisted_2$P = { class: "lupa-input-clear" };
7813
- const _hoisted_3$B = { id: "lupa-search-box-input" };
7844
+ const _hoisted_3$A = { id: "lupa-search-box-input" };
7814
7845
  const _hoisted_4$s = ["value"];
7815
7846
  const _hoisted_5$g = ["aria-label", "placeholder"];
7816
7847
  const _hoisted_6$9 = {
@@ -7905,7 +7936,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
7905
7936
  onClick: clear2
7906
7937
  }, null, 2)
7907
7938
  ]),
7908
- createBaseVNode("div", _hoisted_3$B, [
7939
+ createBaseVNode("div", _hoisted_3$A, [
7909
7940
  createBaseVNode("input", {
7910
7941
  class: "lupa-hint",
7911
7942
  "aria-hidden": "true",
@@ -8086,7 +8117,7 @@ const _hoisted_2$N = {
8086
8117
  "data-cy": "lupa-suggestion-value",
8087
8118
  class: "lupa-suggestion-value"
8088
8119
  };
8089
- const _hoisted_3$A = {
8120
+ const _hoisted_3$z = {
8090
8121
  key: 2,
8091
8122
  class: "lupa-suggestion-facet",
8092
8123
  "data-cy": "lupa-suggestion-facet"
@@ -8136,7 +8167,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
8136
8167
  "data-cy": "lupa-suggestion-value",
8137
8168
  innerHTML: _ctx.suggestion.displayHighlight
8138
8169
  }, null, 8, _hoisted_1$18)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(_ctx.suggestion.display), 1)),
8139
- _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8170
+ _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
8140
8171
  createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
8141
8172
  createBaseVNode("span", _hoisted_5$f, toDisplayString(_ctx.suggestion.facet.title), 1)
8142
8173
  ])) : createCommentVNode("", true)
@@ -8550,7 +8581,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
8550
8581
  });
8551
8582
  const _hoisted_1$11 = ["innerHTML"];
8552
8583
  const _hoisted_2$K = { key: 0 };
8553
- const _hoisted_3$z = { key: 1 };
8584
+ const _hoisted_3$y = { key: 1 };
8554
8585
  const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
8555
8586
  const _hoisted_5$e = { class: "lupa-search-box-custom-text" };
8556
8587
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
@@ -8583,7 +8614,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
8583
8614
  key: 1,
8584
8615
  class: [className.value, "lupa-search-box-product-custom"]
8585
8616
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
8586
- !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$K, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$z, [
8617
+ !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$K, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
8587
8618
  createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
8588
8619
  createBaseVNode("div", _hoisted_5$e, toDisplayString(text.value), 1)
8589
8620
  ]))
@@ -8808,7 +8839,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
8808
8839
  });
8809
8840
  const _hoisted_1$$ = { class: "lupa-search-box-add-to-cart-wrapper" };
8810
8841
  const _hoisted_2$J = { class: "lupa-search-box-product-addtocart" };
8811
- const _hoisted_3$y = ["onClick", "disabled"];
8842
+ const _hoisted_3$x = ["onClick", "disabled"];
8812
8843
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
8813
8844
  __name: "SearchBoxProductAddToCart",
8814
8845
  props: {
@@ -8844,7 +8875,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
8844
8875
  "data-cy": "lupa-add-to-cart",
8845
8876
  type: "button",
8846
8877
  disabled: !inStockValue.value || loading.value
8847
- }, toDisplayString(label.value), 11, _hoisted_3$y)
8878
+ }, toDisplayString(label.value), 11, _hoisted_3$x)
8848
8879
  ])
8849
8880
  ]);
8850
8881
  };
@@ -8923,7 +8954,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
8923
8954
  }));
8924
8955
  const _hoisted_1$_ = ["href"];
8925
8956
  const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
8926
- const _hoisted_3$x = { class: "lupa-search-box-product-details-section" };
8957
+ const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
8927
8958
  const _hoisted_4$p = {
8928
8959
  key: 0,
8929
8960
  class: "lupa-search-box-product-add-to-cart-section"
@@ -8996,7 +9027,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
8996
9027
  }, null, 8, ["item", "element", "labels", "link"]);
8997
9028
  }), 128))
8998
9029
  ]),
8999
- createBaseVNode("div", _hoisted_3$x, [
9030
+ createBaseVNode("div", _hoisted_3$w, [
9000
9031
  (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
9001
9032
  return openBlock(), createBlock(_sfc_main$13, {
9002
9033
  class: "lupa-search-box-product-element",
@@ -9240,7 +9271,7 @@ const _hoisted_1$Y = {
9240
9271
  id: "lupa-search-box-panel"
9241
9272
  };
9242
9273
  const _hoisted_2$H = ["data-cy"];
9243
- const _hoisted_3$w = {
9274
+ const _hoisted_3$v = {
9244
9275
  key: 0,
9245
9276
  class: "lupa-panel-title"
9246
9277
  };
@@ -9392,7 +9423,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9392
9423
  ]),
9393
9424
  "data-cy": "lupa-panel-" + panel.type + "-index"
9394
9425
  }, [
9395
- ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$w, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9426
+ ((_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),
9396
9427
  panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9397
9428
  key: 1,
9398
9429
  panel,
@@ -9799,7 +9830,7 @@ const _hoisted_2$F = {
9799
9830
  key: 0,
9800
9831
  "data-cy": "suggested-search-text-label"
9801
9832
  };
9802
- const _hoisted_3$v = {
9833
+ const _hoisted_3$u = {
9803
9834
  key: 1,
9804
9835
  "data-cy": "did-you-mean-label"
9805
9836
  };
@@ -9846,7 +9877,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
9846
9877
  ]);
9847
9878
  }), 128))
9848
9879
  ])) : createCommentVNode("", true),
9849
- didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
9880
+ didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
9850
9881
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.didYouMean.split(" "), (label, index) => {
9851
9882
  return openBlock(), createElementBlock("span", { key: index }, [
9852
9883
  label.includes("{1}") ? (openBlock(), createElementBlock("span", {
@@ -9900,7 +9931,7 @@ const _hoisted_1$U = {
9900
9931
  "data-cy": "lupa-result-page-title"
9901
9932
  };
9902
9933
  const _hoisted_2$D = { key: 0 };
9903
- const _hoisted_3$u = {
9934
+ const _hoisted_3$t = {
9904
9935
  key: 1,
9905
9936
  class: "lupa-results-total-count"
9906
9937
  };
@@ -9943,7 +9974,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
9943
9974
  showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$U, [
9944
9975
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
9945
9976
  queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$D, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
9946
- showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$u, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
9977
+ showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$t, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
9947
9978
  ])) : createCommentVNode("", true),
9948
9979
  _ctx.showSummary ? (openBlock(), createBlock(_sfc_main$Y, {
9949
9980
  key: 1,
@@ -9963,7 +9994,7 @@ const _hoisted_2$C = {
9963
9994
  class: "lupa-current-filter-label",
9964
9995
  "data-cy": "lupa-current-filter-label"
9965
9996
  };
9966
- const _hoisted_3$t = {
9997
+ const _hoisted_3$s = {
9967
9998
  class: "lupa-current-filter-value",
9968
9999
  "data-cy": "lupa-current-filter-value"
9969
10000
  };
@@ -9985,7 +10016,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
9985
10016
  onClick: handleClick
9986
10017
  }, "⨉"),
9987
10018
  createBaseVNode("div", _hoisted_2$C, toDisplayString(_ctx.filter.label) + ": ", 1),
9988
- createBaseVNode("div", _hoisted_3$t, toDisplayString(_ctx.filter.value), 1)
10019
+ createBaseVNode("div", _hoisted_3$s, toDisplayString(_ctx.filter.value), 1)
9989
10020
  ]);
9990
10021
  };
9991
10022
  }
@@ -9995,7 +10026,7 @@ const _hoisted_2$B = {
9995
10026
  key: 0,
9996
10027
  class: "lupa-filter-count"
9997
10028
  };
9998
- const _hoisted_3$s = {
10029
+ const _hoisted_3$r = {
9999
10030
  key: 0,
10000
10031
  class: "filter-values"
10001
10032
  };
@@ -10064,7 +10095,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10064
10095
  class: normalizeClass(["lupa-filter-title-caret", isOpen.value && "open"])
10065
10096
  }, null, 2)) : createCommentVNode("", true)
10066
10097
  ]),
10067
- !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$s, [
10098
+ !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$r, [
10068
10099
  createBaseVNode("div", _hoisted_4$l, [
10069
10100
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayFilters), (filter) => {
10070
10101
  return openBlock(), createBlock(_sfc_main$W, {
@@ -10132,7 +10163,7 @@ const _hoisted_1$Q = {
10132
10163
  "data-cy": "lupa-category-filter"
10133
10164
  };
10134
10165
  const _hoisted_2$A = { class: "lupa-category-back" };
10135
- const _hoisted_3$r = ["href"];
10166
+ const _hoisted_3$q = ["href"];
10136
10167
  const _hoisted_4$k = ["href"];
10137
10168
  const _hoisted_5$d = { class: "lupa-child-category-list" };
10138
10169
  const _sfc_main$T = /* @__PURE__ */ defineComponent({
@@ -10228,7 +10259,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
10228
10259
  "data-cy": "lupa-category-back",
10229
10260
  href: backUrlLink.value,
10230
10261
  onClick: handleNavigationBack
10231
- }, toDisplayString(backTitle.value), 9, _hoisted_3$r)) : createCommentVNode("", true)
10262
+ }, toDisplayString(backTitle.value), 9, _hoisted_3$q)) : createCommentVNode("", true)
10232
10263
  ]),
10233
10264
  createBaseVNode("div", {
10234
10265
  class: normalizeClass(["lupa-current-category", { "lupa-current-category-active": isActive }])
@@ -10258,7 +10289,7 @@ const _hoisted_1$P = {
10258
10289
  "data-cy": "lupa-search-result-facet-term-values"
10259
10290
  };
10260
10291
  const _hoisted_2$z = ["placeholder"];
10261
- const _hoisted_3$q = { class: "lupa-terms-list" };
10292
+ const _hoisted_3$p = { class: "lupa-terms-list" };
10262
10293
  const _hoisted_4$j = ["onClick"];
10263
10294
  const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
10264
10295
  const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
@@ -10348,7 +10379,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
10348
10379
  }, null, 8, _hoisted_2$z)), [
10349
10380
  [vModelText, termFilter.value]
10350
10381
  ]) : createCommentVNode("", true),
10351
- createBaseVNode("div", _hoisted_3$q, [
10382
+ createBaseVNode("div", _hoisted_3$p, [
10352
10383
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayValues.value, (item) => {
10353
10384
  return openBlock(), createElementBlock("div", {
10354
10385
  class: normalizeClass(["lupa-facet-term", { checked: isChecked(item) }]),
@@ -11361,7 +11392,7 @@ const _hoisted_2$y = {
11361
11392
  key: 0,
11362
11393
  class: "lupa-stats-facet-summary"
11363
11394
  };
11364
- const _hoisted_3$p = {
11395
+ const _hoisted_3$o = {
11365
11396
  key: 1,
11366
11397
  class: "lupa-stats-facet-summary-input"
11367
11398
  };
@@ -11547,7 +11578,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11547
11578
  };
11548
11579
  return (_ctx, _cache) => {
11549
11580
  return openBlock(), createElementBlock("div", _hoisted_1$O, [
11550
- !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$y, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$p, [
11581
+ !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$y, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
11551
11582
  createBaseVNode("div", null, [
11552
11583
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
11553
11584
  createBaseVNode("div", _hoisted_5$b, [
@@ -11615,7 +11646,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11615
11646
  });
11616
11647
  const _hoisted_1$N = { class: "lupa-term-checkbox-wrapper" };
11617
11648
  const _hoisted_2$x = { class: "lupa-term-checkbox-label" };
11618
- const _hoisted_3$o = { class: "lupa-term-label" };
11649
+ const _hoisted_3$n = { class: "lupa-term-label" };
11619
11650
  const _hoisted_4$h = {
11620
11651
  key: 0,
11621
11652
  class: "lupa-term-count"
@@ -11676,7 +11707,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11676
11707
  }, null, 2)
11677
11708
  ]),
11678
11709
  createBaseVNode("div", _hoisted_2$x, [
11679
- createBaseVNode("span", _hoisted_3$o, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
11710
+ createBaseVNode("span", _hoisted_3$n, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
11680
11711
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$h, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
11681
11712
  ])
11682
11713
  ]),
@@ -11701,7 +11732,7 @@ const _hoisted_1$M = {
11701
11732
  "data-cy": "lupa-search-result-facet-term-values"
11702
11733
  };
11703
11734
  const _hoisted_2$w = { key: 0 };
11704
- const _hoisted_3$n = ["placeholder"];
11735
+ const _hoisted_3$m = ["placeholder"];
11705
11736
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
11706
11737
  __name: "HierarchyFacet",
11707
11738
  props: {
@@ -11759,7 +11790,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
11759
11790
  "data-cy": "lupa-term-filter",
11760
11791
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
11761
11792
  placeholder: _ctx.options.labels.facetFilter
11762
- }, null, 8, _hoisted_3$n), [
11793
+ }, null, 8, _hoisted_3$m), [
11763
11794
  [vModelText, termFilter.value]
11764
11795
  ])
11765
11796
  ])) : createCommentVNode("", true),
@@ -12127,7 +12158,7 @@ const _hoisted_1$H = {
12127
12158
  class: "lupa-mobile-filter-sidebar"
12128
12159
  };
12129
12160
  const _hoisted_2$t = ["onClick"];
12130
- const _hoisted_3$m = { class: "lupa-mobile-sidebar-content" };
12161
+ const _hoisted_3$l = { class: "lupa-mobile-sidebar-content" };
12131
12162
  const _hoisted_4$g = { class: "lupa-sidebar-top" };
12132
12163
  const _hoisted_5$9 = { class: "lupa-sidebar-title" };
12133
12164
  const _hoisted_6$6 = {
@@ -12166,7 +12197,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
12166
12197
  class: "lupa-sidebar-close",
12167
12198
  onClick: withModifiers(handleMobileToggle, ["stop"])
12168
12199
  }, null, 8, _hoisted_2$t),
12169
- createBaseVNode("div", _hoisted_3$m, [
12200
+ createBaseVNode("div", _hoisted_3$l, [
12170
12201
  createBaseVNode("div", _hoisted_4$g, [
12171
12202
  createBaseVNode("div", _hoisted_5$9, [
12172
12203
  createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
@@ -12190,7 +12221,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
12190
12221
  });
12191
12222
  const _hoisted_1$G = { id: "lupa-search-results-breadcrumbs" };
12192
12223
  const _hoisted_2$s = ["href", "onClick"];
12193
- const _hoisted_3$l = {
12224
+ const _hoisted_3$k = {
12194
12225
  key: 1,
12195
12226
  class: "lupa-search-results-breadcrumb-text"
12196
12227
  };
@@ -12234,7 +12265,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12234
12265
  var _a;
12235
12266
  return handleNavigation(e, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
12236
12267
  }
12237
- }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (openBlock(), createElementBlock("span", _hoisted_3$l, toDisplayString(getLabel(breadcrumb.label)), 1)),
12268
+ }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (openBlock(), createElementBlock("span", _hoisted_3$k, toDisplayString(getLabel(breadcrumb.label)), 1)),
12238
12269
  index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$f, " / ")) : createCommentVNode("", true)
12239
12270
  ]);
12240
12271
  }), 128))
@@ -12335,7 +12366,7 @@ const _hoisted_2$r = {
12335
12366
  key: 0,
12336
12367
  class: "lupa-page-number-separator"
12337
12368
  };
12338
- const _hoisted_3$k = ["onClick"];
12369
+ const _hoisted_3$j = ["onClick"];
12339
12370
  const _hoisted_4$e = {
12340
12371
  key: 0,
12341
12372
  class: "lupa-page-number-separator"
@@ -12439,7 +12470,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
12439
12470
  page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
12440
12471
  ]),
12441
12472
  "data-cy": "lupa-page-number"
12442
- }, toDisplayString(page), 11, _hoisted_3$k);
12473
+ }, toDisplayString(page), 11, _hoisted_3$j);
12443
12474
  }), 128)),
12444
12475
  showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
12445
12476
  showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$e, "...")) : createCommentVNode("", true),
@@ -12466,7 +12497,7 @@ const _hoisted_1$B = {
12466
12497
  "data-cy": "lupa-search-results-page-size"
12467
12498
  };
12468
12499
  const _hoisted_2$q = { id: "lupa-select" };
12469
- const _hoisted_3$j = { class: "lupa-select-label" };
12500
+ const _hoisted_3$i = { class: "lupa-select-label" };
12470
12501
  const _hoisted_4$d = ["aria-label"];
12471
12502
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
12472
12503
  __name: "SearchResultsPageSize",
@@ -12487,7 +12518,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
12487
12518
  return (_ctx, _cache) => {
12488
12519
  return openBlock(), createElementBlock("div", _hoisted_1$B, [
12489
12520
  createBaseVNode("div", _hoisted_2$q, [
12490
- createBaseVNode("label", _hoisted_3$j, toDisplayString(_ctx.label), 1),
12521
+ createBaseVNode("label", _hoisted_3$i, toDisplayString(_ctx.label), 1),
12491
12522
  createBaseVNode("select", {
12492
12523
  class: "lupa-select-dropdown",
12493
12524
  "aria-label": _ctx.label,
@@ -12510,7 +12541,7 @@ const _hoisted_1$A = {
12510
12541
  class: "lupa-search-results-sort"
12511
12542
  };
12512
12543
  const _hoisted_2$p = { id: "lupa-select" };
12513
- const _hoisted_3$i = { class: "lupa-select-label" };
12544
+ const _hoisted_3$h = { class: "lupa-select-label" };
12514
12545
  const _hoisted_4$c = ["aria-label"];
12515
12546
  const _hoisted_5$8 = ["value"];
12516
12547
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
@@ -12563,7 +12594,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
12563
12594
  return (_ctx, _cache) => {
12564
12595
  return openBlock(), createElementBlock("div", _hoisted_1$A, [
12565
12596
  createBaseVNode("div", _hoisted_2$p, [
12566
- createBaseVNode("label", _hoisted_3$i, toDisplayString(_ctx.options.label), 1),
12597
+ createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.options.label), 1),
12567
12598
  withDirectives(createBaseVNode("select", {
12568
12599
  class: "lupa-select-dropdown",
12569
12600
  "aria-label": _ctx.options.label,
@@ -12588,7 +12619,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
12588
12619
  });
12589
12620
  const _hoisted_1$z = { class: "lupa-toolbar-left" };
12590
12621
  const _hoisted_2$o = { key: 1 };
12591
- const _hoisted_3$h = { key: 3 };
12622
+ const _hoisted_3$g = { key: 3 };
12592
12623
  const _hoisted_4$b = { key: 5 };
12593
12624
  const _hoisted_5$7 = { class: "lupa-toolbar-right" };
12594
12625
  const _hoisted_6$5 = { key: 1 };
@@ -12699,7 +12730,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12699
12730
  label: searchSummaryLabel.value,
12700
12731
  clearable: unref(hasAnyFilter) && showFilterClear.value,
12701
12732
  onClear: handleClearAll
12702
- }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$h)),
12733
+ }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$g)),
12703
12734
  displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$F, {
12704
12735
  key: 4,
12705
12736
  options: paginationOptions.value.pageSelect,
@@ -12729,7 +12760,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12729
12760
  });
12730
12761
  const _hoisted_1$y = { class: "lupa-badge-title" };
12731
12762
  const _hoisted_2$n = ["src"];
12732
- const _hoisted_3$g = { key: 1 };
12763
+ const _hoisted_3$f = { key: 1 };
12733
12764
  const _hoisted_4$a = {
12734
12765
  key: 0,
12735
12766
  class: "lupa-badge-full-text"
@@ -12772,7 +12803,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
12772
12803
  key: 0,
12773
12804
  src: image.value
12774
12805
  }, null, 8, _hoisted_2$n)) : createCommentVNode("", true),
12775
- hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$g, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
12806
+ hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
12776
12807
  ]),
12777
12808
  hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$a, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
12778
12809
  ], 6);
@@ -12999,7 +13030,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
12999
13030
  });
13000
13031
  const _hoisted_1$s = ["innerHTML"];
13001
13032
  const _hoisted_2$l = ["title"];
13002
- const _hoisted_3$f = {
13033
+ const _hoisted_3$e = {
13003
13034
  key: 0,
13004
13035
  class: "lupa-search-results-product-title-text"
13005
13036
  };
@@ -13043,7 +13074,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
13043
13074
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
13044
13075
  title: title.value
13045
13076
  }, [
13046
- !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(title.value), 1)) : createCommentVNode("", true),
13077
+ !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_3$e, toDisplayString(title.value), 1)) : createCommentVNode("", true),
13047
13078
  _ctx.options.link ? (openBlock(), createElementBlock("a", {
13048
13079
  key: 1,
13049
13080
  href: _ctx.link,
@@ -13089,7 +13120,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
13089
13120
  });
13090
13121
  const _hoisted_1$q = { id: "lupa-search-results-rating" };
13091
13122
  const _hoisted_2$k = { class: "lupa-ratings" };
13092
- const _hoisted_3$e = { class: "lupa-ratings-base" };
13123
+ const _hoisted_3$d = { class: "lupa-ratings-base" };
13093
13124
  const _hoisted_4$8 = ["innerHTML"];
13094
13125
  const _hoisted_5$6 = { class: "lupa-rating-wrapper" };
13095
13126
  const _hoisted_6$4 = ["innerHTML"];
@@ -13128,7 +13159,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
13128
13159
  return (_ctx, _cache) => {
13129
13160
  return openBlock(), createElementBlock("div", _hoisted_1$q, [
13130
13161
  createBaseVNode("div", _hoisted_2$k, [
13131
- createBaseVNode("div", _hoisted_3$e, [
13162
+ createBaseVNode("div", _hoisted_3$d, [
13132
13163
  (openBlock(true), createElementBlock(Fragment, null, renderList(baseStars.value, (star, index) => {
13133
13164
  return openBlock(), createElementBlock("div", {
13134
13165
  key: index,
@@ -13216,7 +13247,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
13216
13247
  });
13217
13248
  const _hoisted_1$n = { class: "lupa-search-results-add-to-cart-wrapper" };
13218
13249
  const _hoisted_2$j = { class: "lupa-search-results-product-addtocart" };
13219
- const _hoisted_3$d = ["onClick", "disabled"];
13250
+ const _hoisted_3$c = ["onClick", "disabled"];
13220
13251
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
13221
13252
  __name: "SearchResultsProductAddToCart",
13222
13253
  props: {
@@ -13251,7 +13282,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
13251
13282
  class: normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
13252
13283
  "data-cy": "lupa-add-to-cart",
13253
13284
  disabled: !inStockValue.value || loading.value
13254
- }, toDisplayString(label.value), 11, _hoisted_3$d)
13285
+ }, toDisplayString(label.value), 11, _hoisted_3$c)
13255
13286
  ])
13256
13287
  ]);
13257
13288
  };
@@ -13259,7 +13290,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
13259
13290
  });
13260
13291
  const _hoisted_1$m = ["innerHTML"];
13261
13292
  const _hoisted_2$i = { key: 0 };
13262
- const _hoisted_3$c = { key: 1 };
13293
+ const _hoisted_3$b = { key: 1 };
13263
13294
  const _hoisted_4$7 = { class: "lupa-search-box-custom-label" };
13264
13295
  const _hoisted_5$5 = { class: "lupa-search-box-custom-text" };
13265
13296
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
@@ -13304,7 +13335,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
13304
13335
  key: 1,
13305
13336
  class: className.value
13306
13337
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
13307
- !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$i, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$c, [
13338
+ !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$i, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$b, [
13308
13339
  createBaseVNode("div", _hoisted_4$7, toDisplayString(label.value), 1),
13309
13340
  createBaseVNode("div", _hoisted_5$5, toDisplayString(text.value), 1)
13310
13341
  ]))
@@ -13343,7 +13374,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
13343
13374
  });
13344
13375
  const _hoisted_1$k = { id: "lupa-search-results-rating" };
13345
13376
  const _hoisted_2$h = ["innerHTML"];
13346
- const _hoisted_3$b = { class: "lupa-ratings" };
13377
+ const _hoisted_3$a = { class: "lupa-ratings" };
13347
13378
  const _hoisted_4$6 = ["href"];
13348
13379
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
13349
13380
  __name: "SearchResultsProductSingleStarRating",
@@ -13378,7 +13409,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
13378
13409
  innerHTML: star.value,
13379
13410
  class: "lupa-rating lupa-rating-highlighted"
13380
13411
  }, null, 8, _hoisted_2$h),
13381
- createBaseVNode("div", _hoisted_3$b, toDisplayString(rating.value), 1),
13412
+ createBaseVNode("div", _hoisted_3$a, toDisplayString(rating.value), 1),
13382
13413
  createBaseVNode("a", {
13383
13414
  href: ratingLink.value,
13384
13415
  class: "lupa-total-ratings"
@@ -13476,7 +13507,7 @@ const _hoisted_2$g = {
13476
13507
  key: 0,
13477
13508
  class: "lupa-out-of-stock"
13478
13509
  };
13479
- const _hoisted_3$a = { class: "lupa-search-result-product-details-section" };
13510
+ const _hoisted_3$9 = { class: "lupa-search-result-product-details-section" };
13480
13511
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
13481
13512
  __name: "SearchResultsProductCard",
13482
13513
  props: {
@@ -13652,7 +13683,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
13652
13683
  }, null, 8, ["options"]),
13653
13684
  ((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_2$g, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
13654
13685
  ], 8, _hoisted_1$j),
13655
- createBaseVNode("div", _hoisted_3$a, [
13686
+ createBaseVNode("div", _hoisted_3$9, [
13656
13687
  (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
13657
13688
  return openBlock(), createBlock(_sfc_main$l, {
13658
13689
  class: "lupa-search-results-product-element",
@@ -13695,7 +13726,7 @@ const _hoisted_1$i = {
13695
13726
  "data-cy": "lupa-search-results-similar-queries"
13696
13727
  };
13697
13728
  const _hoisted_2$f = { class: "lupa-similar-queries-label" };
13698
- const _hoisted_3$9 = {
13729
+ const _hoisted_3$8 = {
13699
13730
  class: "lupa-similar-query-label",
13700
13731
  "data-cy": "lupa-similar-query-label"
13701
13732
  };
@@ -13740,7 +13771,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
13740
13771
  createBaseVNode("div", _hoisted_2$f, toDisplayString(_ctx.labels.similarQueries), 1),
13741
13772
  (openBlock(true), createElementBlock(Fragment, null, renderList(similarQueries.value, (similarQuery, index) => {
13742
13773
  return openBlock(), createElementBlock("div", { key: index }, [
13743
- createBaseVNode("div", _hoisted_3$9, [
13774
+ createBaseVNode("div", _hoisted_3$8, [
13744
13775
  createBaseVNode("span", null, toDisplayString(similarQueryLabel.value), 1),
13745
13776
  createBaseVNode("span", {
13746
13777
  id: "lupa-similar-query-text-component",
@@ -13929,7 +13960,7 @@ const _hoisted_1$e = {
13929
13960
  "data-cy": "lupa-search-results-similar-results"
13930
13961
  };
13931
13962
  const _hoisted_2$c = { class: "lupa-similar-results-label" };
13932
- const _hoisted_3$8 = {
13963
+ const _hoisted_3$7 = {
13933
13964
  class: "lupa-products",
13934
13965
  "data-cy": "lupa-products"
13935
13966
  };
@@ -13951,7 +13982,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
13951
13982
  return (_ctx, _cache) => {
13952
13983
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
13953
13984
  createBaseVNode("div", _hoisted_2$c, toDisplayString(_ctx.labels.similarResultsLabel), 1),
13954
- createBaseVNode("div", _hoisted_3$8, [
13985
+ createBaseVNode("div", _hoisted_3$7, [
13955
13986
  (openBlock(true), createElementBlock(Fragment, null, renderList(similarResults.value.items, (product, index) => {
13956
13987
  return openBlock(), createBlock(_sfc_main$k, {
13957
13988
  style: normalizeStyle(_ctx.columnSize),
@@ -13970,7 +14001,7 @@ const _hoisted_2$b = {
13970
14001
  class: "lupa-products",
13971
14002
  "data-cy": "lupa-products"
13972
14003
  };
13973
- const _hoisted_3$7 = {
14004
+ const _hoisted_3$6 = {
13974
14005
  key: 0,
13975
14006
  class: "lupa-empty-results",
13976
14007
  "data-cy": "lupa-no-results-in-page"
@@ -14133,7 +14164,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
14133
14164
  }, null, 8, ["style", "product", "options"]);
14134
14165
  }), 128))
14135
14166
  ]),
14136
- unref(isPageEmpty) && _ctx.options.labels.noItemsInPage ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
14167
+ unref(isPageEmpty) && _ctx.options.labels.noItemsInPage ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
14137
14168
  createTextVNode(toDisplayString(_ctx.options.labels.noItemsInPage) + " ", 1),
14138
14169
  _ctx.options.labels.backToFirstPage ? (openBlock(), createElementBlock("span", {
14139
14170
  key: 0,
@@ -14179,7 +14210,7 @@ const _hoisted_2$a = {
14179
14210
  key: 0,
14180
14211
  class: "lupa-category-back"
14181
14212
  };
14182
- const _hoisted_3$6 = ["href"];
14213
+ const _hoisted_3$5 = ["href"];
14183
14214
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
14184
14215
  __name: "CategoryTopFilters",
14185
14216
  props: {
@@ -14218,7 +14249,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14218
14249
  "data-cy": "lupa-category-back",
14219
14250
  href: backUrlLink.value,
14220
14251
  onClick: handleNavigationBack
14221
- }, toDisplayString(backTitle.value), 9, _hoisted_3$6)
14252
+ }, toDisplayString(backTitle.value), 9, _hoisted_3$5)
14222
14253
  ])) : createCommentVNode("", true),
14223
14254
  createVNode(_sfc_main$C, {
14224
14255
  class: "lupa-toolbar-mobile",
@@ -14239,7 +14270,7 @@ const _hoisted_2$9 = {
14239
14270
  id: "lupa-search-results",
14240
14271
  class: "top-layout-wrapper"
14241
14272
  };
14242
- const _hoisted_3$5 = { class: "search-content" };
14273
+ const _hoisted_3$4 = { class: "search-content" };
14243
14274
  const _hoisted_4$3 = { id: "lupa-search-results" };
14244
14275
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
14245
14276
  __name: "SearchResults",
@@ -14478,7 +14509,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14478
14509
  ref_key: "searchResultsFilters",
14479
14510
  ref: searchResultsFilters
14480
14511
  }, null, 8, ["options"])) : createCommentVNode("", true),
14481
- createBaseVNode("div", _hoisted_3$5, [
14512
+ createBaseVNode("div", _hoisted_3$4, [
14482
14513
  createVNode(_sfc_main$Z, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
14483
14514
  createVNode(_sfc_main$X, {
14484
14515
  options: _ctx.options,
@@ -20969,12 +21000,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
20969
21000
  });
20970
21001
  const _hoisted_1$7 = { class: "lupa-chat-spinner" };
20971
21002
  const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20972
- const _hoisted_3$4 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
21003
+ const _hoisted_3$3 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20973
21004
  const _hoisted_4$2 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20974
21005
  const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20975
21006
  const _hoisted_6$1 = [
20976
21007
  _hoisted_2$5,
20977
- _hoisted_3$4,
21008
+ _hoisted_3$3,
20978
21009
  _hoisted_4$2,
20979
21010
  _hoisted_5$2
20980
21011
  ];
@@ -20998,7 +21029,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
20998
21029
  });
20999
21030
  const _hoisted_1$6 = { class: "lupa-chat-input-container" };
21000
21031
  const _hoisted_2$4 = { id: "lupa-search-box-input" };
21001
- const _hoisted_3$3 = {
21032
+ const _hoisted_3$2 = {
21002
21033
  key: 0,
21003
21034
  class: "lupa-chat-form-submit"
21004
21035
  };
@@ -21034,7 +21065,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
21034
21065
  [vModelText, inputValue.value]
21035
21066
  ])
21036
21067
  ]),
21037
- !_ctx.disabled ? (openBlock(), createElementBlock("button", _hoisted_3$3, "Ask LupaChat")) : (openBlock(), createBlock(_sfc_main$7, {
21068
+ !_ctx.disabled ? (openBlock(), createElementBlock("button", _hoisted_3$2, "Ask LupaChat")) : (openBlock(), createBlock(_sfc_main$7, {
21038
21069
  key: 1,
21039
21070
  small: true
21040
21071
  }))
@@ -21201,7 +21232,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
21201
21232
  });
21202
21233
  const _hoisted_1$4 = { class: "lupa-chat-content-entry-phrase" };
21203
21234
  const _hoisted_2$3 = { class: "lupa-chat-phrase-title" };
21204
- const _hoisted_3$2 = {
21235
+ const _hoisted_3$1 = {
21205
21236
  key: 0,
21206
21237
  class: "alert"
21207
21238
  };
@@ -21302,7 +21333,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
21302
21333
  createBaseVNode("div", _hoisted_2$3, [
21303
21334
  createBaseVNode("h3", null, toDisplayString(displayPhrase.value), 1),
21304
21335
  createBaseVNode("sub", null, toDisplayString(usedAlternativePhrases.value.join(", ")), 1),
21305
- usedPartialResults.value ? (openBlock(), createElementBlock("sub", _hoisted_3$2, "Including partial matches - which might not be what you are looking for")) : createCommentVNode("", true)
21336
+ usedPartialResults.value ? (openBlock(), createElementBlock("sub", _hoisted_3$1, "Including partial matches - which might not be what you are looking for")) : createCommentVNode("", true)
21306
21337
  ]),
21307
21338
  createBaseVNode("div", null, [
21308
21339
  createVNode(_sfc_main$5, {
@@ -21321,7 +21352,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
21321
21352
  });
21322
21353
  const _hoisted_1$3 = { class: "lupa-chat-best-matches lupa-chat-content-entry" };
21323
21354
  const _hoisted_2$2 = /* @__PURE__ */ createBaseVNode("h3", null, "Best matches", -1);
21324
- const _hoisted_3$1 = { key: 0 };
21355
+ const MAX_SOURCES_FOR_BEST_ITEM_MATCHING = 250;
21325
21356
  const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21326
21357
  __name: "ChatContentEntry",
21327
21358
  props: {
@@ -21351,20 +21382,18 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21351
21382
  return (_a = props.options.displayOptions.titleKey) != null ? _a : "title";
21352
21383
  });
21353
21384
  const loadFinalRecommendations = () => __async(this, null, function* () {
21354
- var _a;
21385
+ var _a, _b;
21355
21386
  try {
21356
- const productResultStrings = loadedResults.value.map(
21357
- (result) => {
21358
- var _a2, _b;
21359
- return (_b = (_a2 = result[titleKey.value]) == null ? void 0 : _a2.toString()) != null ? _b : "";
21360
- }
21361
- );
21387
+ const productResultStrings = (_a = loadedResults.value.map((result) => {
21388
+ var _a2, _b2;
21389
+ return (_b2 = (_a2 = result[titleKey.value]) == null ? void 0 : _a2.toString()) != null ? _b2 : "";
21390
+ })) == null ? void 0 : _a.slice(0, MAX_SOURCES_FOR_BEST_ITEM_MATCHING);
21362
21391
  const { products } = yield ChatService.suggestBestProductMatches(
21363
21392
  props.options.sdkOptions,
21364
21393
  {
21365
21394
  initialQuery: props.entry.userInput,
21366
21395
  productStrings: productResultStrings,
21367
- messageHistory: (_a = props.history) != null ? _a : [],
21396
+ messageHistory: (_b = props.history) != null ? _b : [],
21368
21397
  queryKey: props.options.displayOptions.queryKey
21369
21398
  },
21370
21399
  props.options.chatSettings
@@ -21377,13 +21406,9 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21377
21406
  });
21378
21407
  const bestMatchProducts = computed(() => {
21379
21408
  return bestMatches.value.map((productName) => {
21380
- return loadedResults.value.find((r) => r[titleKey.value] === productName);
21409
+ return findClosestStringValue(productName, loadedResults.value, titleKey.value);
21381
21410
  }).filter(Boolean);
21382
21411
  });
21383
- const explanation = computed(() => {
21384
- var _a, _b;
21385
- return ((_a = bestMatches.value) == null ? void 0 : _a.length) > 0 && !bestMatchProducts.value.length ? (_b = bestMatches == null ? void 0 : bestMatches.value) == null ? void 0 : _b[0] : "";
21386
- });
21387
21412
  return (_ctx, _cache) => {
21388
21413
  return openBlock(), createElementBlock("div", null, [
21389
21414
  createBaseVNode("ul", null, [
@@ -21403,13 +21428,12 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21403
21428
  ]),
21404
21429
  createBaseVNode("section", _hoisted_1$3, [
21405
21430
  _hoisted_2$2,
21406
- explanation.value ? (openBlock(), createElementBlock("p", _hoisted_3$1, toDisplayString(explanation.value), 1)) : createCommentVNode("", true),
21407
21431
  loading.value ? (openBlock(), createBlock(_sfc_main$7, {
21408
- key: 1,
21432
+ key: 0,
21409
21433
  message: "Selecting the best matches for you. This might take a few seconds."
21410
21434
  })) : createCommentVNode("", true),
21411
21435
  bestMatches.value.length ? (openBlock(), createBlock(_sfc_main$5, {
21412
- key: 2,
21436
+ key: 1,
21413
21437
  "search-results": bestMatchProducts.value,
21414
21438
  options: _ctx.options.displayOptions
21415
21439
  }, null, 8, ["search-results", "options"])) : createCommentVNode("", true)