@getlupa/client 1.8.0-alpha.0 → 1.8.1

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.
@@ -27484,7 +27484,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27484
27484
  redirections,
27485
27485
  placeholderImage
27486
27486
  }) => {
27487
- var _a, _b;
27487
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27488
27488
  const panels = [
27489
27489
  ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
27490
27490
  {
@@ -27493,7 +27493,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27493
27493
  highlight: true,
27494
27494
  limit: 8,
27495
27495
  labels: {
27496
- topResultsTitle: labels.searchBox.topSuggestionsTitle
27496
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
27497
27497
  }
27498
27498
  }
27499
27499
  ] : [],
@@ -27506,22 +27506,25 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27506
27506
  {
27507
27507
  type: "image",
27508
27508
  placeholder: placeholderImage,
27509
- key: searchBoxOptions.fields.imageKey,
27510
- baseUrl: searchBoxOptions.fields.baseImageUrl
27509
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
27510
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
27511
27511
  },
27512
27512
  {
27513
27513
  type: "title",
27514
- key: searchBoxOptions.fields.titleKey,
27514
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
27515
27515
  maxLines: 2
27516
27516
  },
27517
27517
  {
27518
27518
  type: "regularPrice",
27519
- key: searchBoxOptions.fields.regularPriceKey,
27520
- display: (doc2) => searchBoxOptions.fields.regularPriceKey && searchBoxOptions.fields.discountPriceKey && parseFloat(doc2[searchBoxOptions.fields.regularPriceKey]) > parseFloat(doc2[searchBoxOptions.fields.discountPriceKey])
27519
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
27520
+ display: (doc2) => {
27521
+ var _a2, _b2, _c2, _d2;
27522
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
27523
+ }
27521
27524
  },
27522
27525
  {
27523
27526
  type: "price",
27524
- key: searchBoxOptions.fields.discountPriceKey
27527
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
27525
27528
  }
27526
27529
  ]
27527
27530
  }
@@ -27530,7 +27533,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27530
27533
  return {
27531
27534
  inputSelector: searchBoxOptions.inputSelector,
27532
27535
  options: {
27533
- environment: (_a = searchBoxOptions.environment) != null ? _a : "production",
27536
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
27534
27537
  customUrl: searchBoxOptions.customUrl,
27535
27538
  customBaseUrl: searchBoxOptions.customBaseUrl,
27536
27539
  customPayload: searchBoxOptions.customPayload,
@@ -27538,9 +27541,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27538
27541
  },
27539
27542
  showTotalCount: true,
27540
27543
  expandOnSinglePanel: true,
27541
- minInputLength: (_b = searchBoxOptions.fields.minInputLength) != null ? _b : 0,
27544
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
27542
27545
  debounce: 250,
27543
- labels: labels.searchBox,
27546
+ labels: labels == null ? void 0 : labels.searchBox,
27544
27547
  links: {
27545
27548
  searchResults: ""
27546
27549
  },
@@ -27548,7 +27551,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27548
27551
  redirections,
27549
27552
  history: {
27550
27553
  labels: {
27551
- clear: labels.searchBox.clearHistory
27554
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
27552
27555
  }
27553
27556
  }
27554
27557
  };
@@ -27562,7 +27565,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27562
27565
  callbacks,
27563
27566
  additionalFields
27564
27567
  }) => {
27565
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27568
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
27566
27569
  const filters = searchResultOptions.showFacets ? {
27567
27570
  currentFilters: {
27568
27571
  visibility: {
@@ -27571,15 +27574,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27571
27574
  },
27572
27575
  labels: {
27573
27576
  title: "",
27574
- clearAll: (_a = labels.facets) == null ? void 0 : _a.clearAll
27577
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
27575
27578
  }
27576
27579
  },
27577
27580
  facets: {
27578
27581
  labels: {
27579
- title: labels.facets.facetTitle,
27580
- showAll: labels.facets.showAll,
27581
- facetFilter: labels.facets.facetFilter,
27582
- facetClear: labels.facets.facetClear
27582
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
27583
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
27584
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
27585
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
27583
27586
  },
27584
27587
  filterable: {
27585
27588
  minValues: 5
@@ -27604,12 +27607,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27604
27607
  }
27605
27608
  }
27606
27609
  } : {};
27607
- const columns = (_g = searchResultOptions.gridConfiguration) != null ? _g : {
27608
- xl: (_b = searchResultOptions.maxColumns) != null ? _b : 4,
27609
- l: (_c = searchResultOptions.maxColumns) != null ? _c : 3,
27610
- md: (_d = searchResultOptions.maxColumns) != null ? _d : 3,
27611
- sm: (_e = searchResultOptions.maxColumns) != null ? _e : 2,
27612
- xs: (_f = searchResultOptions.maxColumns) != null ? _f : 1
27610
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
27611
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
27612
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
27613
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
27614
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
27615
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
27613
27616
  };
27614
27617
  const badges = searchResultOptions.showRelevance ? {
27615
27618
  badges: {
@@ -27627,7 +27630,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27627
27630
  } : {};
27628
27631
  return __spreadValues(__spreadProps(__spreadValues({
27629
27632
  options: {
27630
- environment: (_h = searchResultOptions.environment) != null ? _h : "production",
27633
+ environment: (_l = searchResultOptions.environment) != null ? _l : "production",
27631
27634
  customUrl: searchResultOptions.customUrl,
27632
27635
  customBaseUrl: searchResultOptions.customBaseUrl,
27633
27636
  customPayload: searchResultOptions.customPayload,
@@ -27637,8 +27640,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27637
27640
  queryKey: searchResultOptions.queryKey,
27638
27641
  containerSelector: searchResultOptions.containerSelector,
27639
27642
  searchTitlePosition: "search-results-top",
27640
- titleKey: searchResultOptions.fields.titleKey,
27641
- labels: labels.searchResults,
27643
+ titleKey: (_m = searchResultOptions.fields) == null ? void 0 : _m.titleKey,
27644
+ labels: labels == null ? void 0 : labels.searchResults,
27642
27645
  grid: {
27643
27646
  columns
27644
27647
  },
@@ -27670,7 +27673,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27670
27673
  }
27671
27674
  }, badges), {
27672
27675
  links: {
27673
- details: searchResultOptions.fields.productUrl ? `{${searchResultOptions.fields.productUrl}}` : void 0
27676
+ details: ((_n = searchResultOptions.fields) == null ? void 0 : _n.productUrl) ? `{${(_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl}}` : void 0
27674
27677
  },
27675
27678
  callbacks,
27676
27679
  routingBehavior: callbacks ? "event" : "direct-link",
@@ -27679,37 +27682,43 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27679
27682
  {
27680
27683
  type: "image",
27681
27684
  placeholder: placeholderImage,
27682
- key: searchResultOptions.fields.imageKey,
27683
- baseUrl: searchResultOptions.fields.baseImageUrl,
27684
- display: () => searchResultOptions.fields.imageKey
27685
+ key: (_p = searchResultOptions.fields) == null ? void 0 : _p.imageKey,
27686
+ baseUrl: (_q = searchResultOptions.fields) == null ? void 0 : _q.baseImageUrl,
27687
+ display: () => {
27688
+ var _a2;
27689
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
27690
+ }
27685
27691
  },
27686
- addFieldIfKeyExists("_emphasis", (_i = searchResultOptions.fields) == null ? void 0 : _i.emphasizedField, {
27692
+ addFieldIfKeyExists("_emphasis", (_r = searchResultOptions.fields) == null ? void 0 : _r.emphasizedField, {
27687
27693
  type: "custom",
27688
27694
  className: "lupa-custom-emphasis",
27689
- key: searchResultOptions.fields.emphasizedField,
27695
+ key: (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField,
27690
27696
  display: () => true
27691
27697
  }),
27692
27698
  {
27693
27699
  type: "title",
27694
- key: searchResultOptions.fields.titleKey,
27695
- maxLines: (_j = searchResultOptions.maxLines) != null ? _j : 2,
27696
- display: (doc2) => searchResultOptions.fields.titleKey && Boolean(doc2[searchResultOptions.fields.titleKey])
27700
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.titleKey,
27701
+ maxLines: (_u = searchResultOptions.maxLines) != null ? _u : 2,
27702
+ display: (doc2) => {
27703
+ var _a2, _b2;
27704
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
27705
+ }
27697
27706
  },
27698
27707
  ...getAdditionalElements(additionalFields),
27699
- addFieldIfKeyExists("_discountPrice", searchResultOptions.fields.discountPriceKey, {
27700
- key: searchResultOptions.fields.discountPriceKey,
27708
+ addFieldIfKeyExists("_discountPrice", (_v = searchResultOptions.fields) == null ? void 0 : _v.discountPriceKey, {
27709
+ key: (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey,
27701
27710
  type: "customHtml",
27702
27711
  className: "lupa-price lupa-price-discounted",
27703
27712
  display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
27704
27713
  html: (doc2) => {
27705
- var _a2, _b2, _c2, _d2;
27706
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27707
- const discountPrice = (_b2 = parseFloat(
27708
- doc2[(_a2 = searchResultOptions.fields.discountPriceKey) != null ? _a2 : ""]
27709
- )) == null ? void 0 : _b2.toFixed(2);
27710
- const regularPrice = (_d2 = parseFloat(
27711
- doc2[(_c2 = searchResultOptions.fields.regularPriceKey) != null ? _c2 : ""]
27714
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27715
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27716
+ const discountPrice = (_d2 = parseFloat(
27717
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
27712
27718
  )) == null ? void 0 : _d2.toFixed(2);
27719
+ const regularPrice = (_g2 = parseFloat(
27720
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
27721
+ )) == null ? void 0 : _g2.toFixed(2);
27713
27722
  const discount = `<span class="lupa-discount">${escapeHtml(
27714
27723
  discountPrice
27715
27724
  )} ${currency}</span>`;
@@ -27719,17 +27728,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27719
27728
  return discount + regular;
27720
27729
  }
27721
27730
  }),
27722
- addFieldIfKeyExists("_regularPrice", searchResultOptions.fields.regularPriceKey, {
27723
- key: searchResultOptions.fields.regularPriceKey,
27731
+ addFieldIfKeyExists("_regularPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.regularPriceKey, {
27732
+ key: (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey,
27724
27733
  type: "customHtml",
27725
27734
  className: "lupa-price lupa-price-single",
27726
27735
  display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
27727
27736
  html: (doc2) => {
27728
- var _a2, _b2, _c2, _d2;
27729
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27730
- const price = (_d2 = parseFloat(
27731
- (_c2 = doc2[(_a2 = searchResultOptions.fields.regularPriceKey) != null ? _a2 : ""]) != null ? _c2 : doc2[(_b2 = searchResultOptions.fields.discountPriceKey) != null ? _b2 : ""]
27732
- )) == null ? void 0 : _d2.toFixed(2);
27737
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27738
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27739
+ const price = (_g2 = parseFloat(
27740
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
27741
+ )) == null ? void 0 : _g2.toFixed(2);
27733
27742
  return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
27734
27743
  }
27735
27744
  })
@@ -27484,7 +27484,7 @@ const getSearchBoxComponent = ({
27484
27484
  redirections,
27485
27485
  placeholderImage
27486
27486
  }) => {
27487
- var _a, _b;
27487
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27488
27488
  const panels = [
27489
27489
  ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
27490
27490
  {
@@ -27493,7 +27493,7 @@ const getSearchBoxComponent = ({
27493
27493
  highlight: true,
27494
27494
  limit: 8,
27495
27495
  labels: {
27496
- topResultsTitle: labels.searchBox.topSuggestionsTitle
27496
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
27497
27497
  }
27498
27498
  }
27499
27499
  ] : [],
@@ -27506,22 +27506,25 @@ const getSearchBoxComponent = ({
27506
27506
  {
27507
27507
  type: "image",
27508
27508
  placeholder: placeholderImage,
27509
- key: searchBoxOptions.fields.imageKey,
27510
- baseUrl: searchBoxOptions.fields.baseImageUrl
27509
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
27510
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
27511
27511
  },
27512
27512
  {
27513
27513
  type: "title",
27514
- key: searchBoxOptions.fields.titleKey,
27514
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
27515
27515
  maxLines: 2
27516
27516
  },
27517
27517
  {
27518
27518
  type: "regularPrice",
27519
- key: searchBoxOptions.fields.regularPriceKey,
27520
- display: (doc2) => searchBoxOptions.fields.regularPriceKey && searchBoxOptions.fields.discountPriceKey && parseFloat(doc2[searchBoxOptions.fields.regularPriceKey]) > parseFloat(doc2[searchBoxOptions.fields.discountPriceKey])
27519
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
27520
+ display: (doc2) => {
27521
+ var _a2, _b2, _c2, _d2;
27522
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
27523
+ }
27521
27524
  },
27522
27525
  {
27523
27526
  type: "price",
27524
- key: searchBoxOptions.fields.discountPriceKey
27527
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
27525
27528
  }
27526
27529
  ]
27527
27530
  }
@@ -27530,7 +27533,7 @@ const getSearchBoxComponent = ({
27530
27533
  return {
27531
27534
  inputSelector: searchBoxOptions.inputSelector,
27532
27535
  options: {
27533
- environment: (_a = searchBoxOptions.environment) != null ? _a : "production",
27536
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
27534
27537
  customUrl: searchBoxOptions.customUrl,
27535
27538
  customBaseUrl: searchBoxOptions.customBaseUrl,
27536
27539
  customPayload: searchBoxOptions.customPayload,
@@ -27538,9 +27541,9 @@ const getSearchBoxComponent = ({
27538
27541
  },
27539
27542
  showTotalCount: true,
27540
27543
  expandOnSinglePanel: true,
27541
- minInputLength: (_b = searchBoxOptions.fields.minInputLength) != null ? _b : 0,
27544
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
27542
27545
  debounce: 250,
27543
- labels: labels.searchBox,
27546
+ labels: labels == null ? void 0 : labels.searchBox,
27544
27547
  links: {
27545
27548
  searchResults: ""
27546
27549
  },
@@ -27548,7 +27551,7 @@ const getSearchBoxComponent = ({
27548
27551
  redirections,
27549
27552
  history: {
27550
27553
  labels: {
27551
- clear: labels.searchBox.clearHistory
27554
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
27552
27555
  }
27553
27556
  }
27554
27557
  };
@@ -27562,7 +27565,7 @@ const getSearchResultsComponent = ({
27562
27565
  callbacks,
27563
27566
  additionalFields
27564
27567
  }) => {
27565
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27568
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
27566
27569
  const filters = searchResultOptions.showFacets ? {
27567
27570
  currentFilters: {
27568
27571
  visibility: {
@@ -27571,15 +27574,15 @@ const getSearchResultsComponent = ({
27571
27574
  },
27572
27575
  labels: {
27573
27576
  title: "",
27574
- clearAll: (_a = labels.facets) == null ? void 0 : _a.clearAll
27577
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
27575
27578
  }
27576
27579
  },
27577
27580
  facets: {
27578
27581
  labels: {
27579
- title: labels.facets.facetTitle,
27580
- showAll: labels.facets.showAll,
27581
- facetFilter: labels.facets.facetFilter,
27582
- facetClear: labels.facets.facetClear
27582
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
27583
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
27584
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
27585
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
27583
27586
  },
27584
27587
  filterable: {
27585
27588
  minValues: 5
@@ -27604,12 +27607,12 @@ const getSearchResultsComponent = ({
27604
27607
  }
27605
27608
  }
27606
27609
  } : {};
27607
- const columns = (_g = searchResultOptions.gridConfiguration) != null ? _g : {
27608
- xl: (_b = searchResultOptions.maxColumns) != null ? _b : 4,
27609
- l: (_c = searchResultOptions.maxColumns) != null ? _c : 3,
27610
- md: (_d = searchResultOptions.maxColumns) != null ? _d : 3,
27611
- sm: (_e = searchResultOptions.maxColumns) != null ? _e : 2,
27612
- xs: (_f = searchResultOptions.maxColumns) != null ? _f : 1
27610
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
27611
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
27612
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
27613
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
27614
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
27615
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
27613
27616
  };
27614
27617
  const badges = searchResultOptions.showRelevance ? {
27615
27618
  badges: {
@@ -27627,7 +27630,7 @@ const getSearchResultsComponent = ({
27627
27630
  } : {};
27628
27631
  return __spreadValues(__spreadProps(__spreadValues({
27629
27632
  options: {
27630
- environment: (_h = searchResultOptions.environment) != null ? _h : "production",
27633
+ environment: (_l = searchResultOptions.environment) != null ? _l : "production",
27631
27634
  customUrl: searchResultOptions.customUrl,
27632
27635
  customBaseUrl: searchResultOptions.customBaseUrl,
27633
27636
  customPayload: searchResultOptions.customPayload,
@@ -27637,8 +27640,8 @@ const getSearchResultsComponent = ({
27637
27640
  queryKey: searchResultOptions.queryKey,
27638
27641
  containerSelector: searchResultOptions.containerSelector,
27639
27642
  searchTitlePosition: "search-results-top",
27640
- titleKey: searchResultOptions.fields.titleKey,
27641
- labels: labels.searchResults,
27643
+ titleKey: (_m = searchResultOptions.fields) == null ? void 0 : _m.titleKey,
27644
+ labels: labels == null ? void 0 : labels.searchResults,
27642
27645
  grid: {
27643
27646
  columns
27644
27647
  },
@@ -27670,7 +27673,7 @@ const getSearchResultsComponent = ({
27670
27673
  }
27671
27674
  }, badges), {
27672
27675
  links: {
27673
- details: searchResultOptions.fields.productUrl ? `{${searchResultOptions.fields.productUrl}}` : void 0
27676
+ details: ((_n = searchResultOptions.fields) == null ? void 0 : _n.productUrl) ? `{${(_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl}}` : void 0
27674
27677
  },
27675
27678
  callbacks,
27676
27679
  routingBehavior: callbacks ? "event" : "direct-link",
@@ -27679,37 +27682,43 @@ const getSearchResultsComponent = ({
27679
27682
  {
27680
27683
  type: "image",
27681
27684
  placeholder: placeholderImage,
27682
- key: searchResultOptions.fields.imageKey,
27683
- baseUrl: searchResultOptions.fields.baseImageUrl,
27684
- display: () => searchResultOptions.fields.imageKey
27685
+ key: (_p = searchResultOptions.fields) == null ? void 0 : _p.imageKey,
27686
+ baseUrl: (_q = searchResultOptions.fields) == null ? void 0 : _q.baseImageUrl,
27687
+ display: () => {
27688
+ var _a2;
27689
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
27690
+ }
27685
27691
  },
27686
- addFieldIfKeyExists("_emphasis", (_i = searchResultOptions.fields) == null ? void 0 : _i.emphasizedField, {
27692
+ addFieldIfKeyExists("_emphasis", (_r = searchResultOptions.fields) == null ? void 0 : _r.emphasizedField, {
27687
27693
  type: "custom",
27688
27694
  className: "lupa-custom-emphasis",
27689
- key: searchResultOptions.fields.emphasizedField,
27695
+ key: (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField,
27690
27696
  display: () => true
27691
27697
  }),
27692
27698
  {
27693
27699
  type: "title",
27694
- key: searchResultOptions.fields.titleKey,
27695
- maxLines: (_j = searchResultOptions.maxLines) != null ? _j : 2,
27696
- display: (doc2) => searchResultOptions.fields.titleKey && Boolean(doc2[searchResultOptions.fields.titleKey])
27700
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.titleKey,
27701
+ maxLines: (_u = searchResultOptions.maxLines) != null ? _u : 2,
27702
+ display: (doc2) => {
27703
+ var _a2, _b2;
27704
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
27705
+ }
27697
27706
  },
27698
27707
  ...getAdditionalElements(additionalFields),
27699
- addFieldIfKeyExists("_discountPrice", searchResultOptions.fields.discountPriceKey, {
27700
- key: searchResultOptions.fields.discountPriceKey,
27708
+ addFieldIfKeyExists("_discountPrice", (_v = searchResultOptions.fields) == null ? void 0 : _v.discountPriceKey, {
27709
+ key: (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey,
27701
27710
  type: "customHtml",
27702
27711
  className: "lupa-price lupa-price-discounted",
27703
27712
  display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
27704
27713
  html: (doc2) => {
27705
- var _a2, _b2, _c2, _d2;
27706
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27707
- const discountPrice = (_b2 = parseFloat(
27708
- doc2[(_a2 = searchResultOptions.fields.discountPriceKey) != null ? _a2 : ""]
27709
- )) == null ? void 0 : _b2.toFixed(2);
27710
- const regularPrice = (_d2 = parseFloat(
27711
- doc2[(_c2 = searchResultOptions.fields.regularPriceKey) != null ? _c2 : ""]
27714
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27715
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27716
+ const discountPrice = (_d2 = parseFloat(
27717
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
27712
27718
  )) == null ? void 0 : _d2.toFixed(2);
27719
+ const regularPrice = (_g2 = parseFloat(
27720
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
27721
+ )) == null ? void 0 : _g2.toFixed(2);
27713
27722
  const discount = `<span class="lupa-discount">${escapeHtml(
27714
27723
  discountPrice
27715
27724
  )} ${currency}</span>`;
@@ -27719,17 +27728,17 @@ const getSearchResultsComponent = ({
27719
27728
  return discount + regular;
27720
27729
  }
27721
27730
  }),
27722
- addFieldIfKeyExists("_regularPrice", searchResultOptions.fields.regularPriceKey, {
27723
- key: searchResultOptions.fields.regularPriceKey,
27731
+ addFieldIfKeyExists("_regularPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.regularPriceKey, {
27732
+ key: (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey,
27724
27733
  type: "customHtml",
27725
27734
  className: "lupa-price lupa-price-single",
27726
27735
  display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
27727
27736
  html: (doc2) => {
27728
- var _a2, _b2, _c2, _d2;
27729
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27730
- const price = (_d2 = parseFloat(
27731
- (_c2 = doc2[(_a2 = searchResultOptions.fields.regularPriceKey) != null ? _a2 : ""]) != null ? _c2 : doc2[(_b2 = searchResultOptions.fields.discountPriceKey) != null ? _b2 : ""]
27732
- )) == null ? void 0 : _d2.toFixed(2);
27737
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27738
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27739
+ const price = (_g2 = parseFloat(
27740
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
27741
+ )) == null ? void 0 : _g2.toFixed(2);
27733
27742
  return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
27734
27743
  }
27735
27744
  })
@@ -27482,7 +27482,7 @@ const getSearchBoxComponent = ({
27482
27482
  redirections,
27483
27483
  placeholderImage
27484
27484
  }) => {
27485
- var _a, _b;
27485
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27486
27486
  const panels = [
27487
27487
  ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
27488
27488
  {
@@ -27491,7 +27491,7 @@ const getSearchBoxComponent = ({
27491
27491
  highlight: true,
27492
27492
  limit: 8,
27493
27493
  labels: {
27494
- topResultsTitle: labels.searchBox.topSuggestionsTitle
27494
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
27495
27495
  }
27496
27496
  }
27497
27497
  ] : [],
@@ -27504,22 +27504,25 @@ const getSearchBoxComponent = ({
27504
27504
  {
27505
27505
  type: "image",
27506
27506
  placeholder: placeholderImage,
27507
- key: searchBoxOptions.fields.imageKey,
27508
- baseUrl: searchBoxOptions.fields.baseImageUrl
27507
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
27508
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
27509
27509
  },
27510
27510
  {
27511
27511
  type: "title",
27512
- key: searchBoxOptions.fields.titleKey,
27512
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
27513
27513
  maxLines: 2
27514
27514
  },
27515
27515
  {
27516
27516
  type: "regularPrice",
27517
- key: searchBoxOptions.fields.regularPriceKey,
27518
- display: (doc2) => searchBoxOptions.fields.regularPriceKey && searchBoxOptions.fields.discountPriceKey && parseFloat(doc2[searchBoxOptions.fields.regularPriceKey]) > parseFloat(doc2[searchBoxOptions.fields.discountPriceKey])
27517
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
27518
+ display: (doc2) => {
27519
+ var _a2, _b2, _c2, _d2;
27520
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
27521
+ }
27519
27522
  },
27520
27523
  {
27521
27524
  type: "price",
27522
- key: searchBoxOptions.fields.discountPriceKey
27525
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
27523
27526
  }
27524
27527
  ]
27525
27528
  }
@@ -27528,7 +27531,7 @@ const getSearchBoxComponent = ({
27528
27531
  return {
27529
27532
  inputSelector: searchBoxOptions.inputSelector,
27530
27533
  options: {
27531
- environment: (_a = searchBoxOptions.environment) != null ? _a : "production",
27534
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
27532
27535
  customUrl: searchBoxOptions.customUrl,
27533
27536
  customBaseUrl: searchBoxOptions.customBaseUrl,
27534
27537
  customPayload: searchBoxOptions.customPayload,
@@ -27536,9 +27539,9 @@ const getSearchBoxComponent = ({
27536
27539
  },
27537
27540
  showTotalCount: true,
27538
27541
  expandOnSinglePanel: true,
27539
- minInputLength: (_b = searchBoxOptions.fields.minInputLength) != null ? _b : 0,
27542
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
27540
27543
  debounce: 250,
27541
- labels: labels.searchBox,
27544
+ labels: labels == null ? void 0 : labels.searchBox,
27542
27545
  links: {
27543
27546
  searchResults: ""
27544
27547
  },
@@ -27546,7 +27549,7 @@ const getSearchBoxComponent = ({
27546
27549
  redirections,
27547
27550
  history: {
27548
27551
  labels: {
27549
- clear: labels.searchBox.clearHistory
27552
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
27550
27553
  }
27551
27554
  }
27552
27555
  };
@@ -27560,7 +27563,7 @@ const getSearchResultsComponent = ({
27560
27563
  callbacks,
27561
27564
  additionalFields
27562
27565
  }) => {
27563
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27566
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
27564
27567
  const filters = searchResultOptions.showFacets ? {
27565
27568
  currentFilters: {
27566
27569
  visibility: {
@@ -27569,15 +27572,15 @@ const getSearchResultsComponent = ({
27569
27572
  },
27570
27573
  labels: {
27571
27574
  title: "",
27572
- clearAll: (_a = labels.facets) == null ? void 0 : _a.clearAll
27575
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
27573
27576
  }
27574
27577
  },
27575
27578
  facets: {
27576
27579
  labels: {
27577
- title: labels.facets.facetTitle,
27578
- showAll: labels.facets.showAll,
27579
- facetFilter: labels.facets.facetFilter,
27580
- facetClear: labels.facets.facetClear
27580
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
27581
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
27582
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
27583
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
27581
27584
  },
27582
27585
  filterable: {
27583
27586
  minValues: 5
@@ -27602,12 +27605,12 @@ const getSearchResultsComponent = ({
27602
27605
  }
27603
27606
  }
27604
27607
  } : {};
27605
- const columns = (_g = searchResultOptions.gridConfiguration) != null ? _g : {
27606
- xl: (_b = searchResultOptions.maxColumns) != null ? _b : 4,
27607
- l: (_c = searchResultOptions.maxColumns) != null ? _c : 3,
27608
- md: (_d = searchResultOptions.maxColumns) != null ? _d : 3,
27609
- sm: (_e = searchResultOptions.maxColumns) != null ? _e : 2,
27610
- xs: (_f = searchResultOptions.maxColumns) != null ? _f : 1
27608
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
27609
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
27610
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
27611
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
27612
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
27613
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
27611
27614
  };
27612
27615
  const badges = searchResultOptions.showRelevance ? {
27613
27616
  badges: {
@@ -27625,7 +27628,7 @@ const getSearchResultsComponent = ({
27625
27628
  } : {};
27626
27629
  return __spreadValues(__spreadProps(__spreadValues({
27627
27630
  options: {
27628
- environment: (_h = searchResultOptions.environment) != null ? _h : "production",
27631
+ environment: (_l = searchResultOptions.environment) != null ? _l : "production",
27629
27632
  customUrl: searchResultOptions.customUrl,
27630
27633
  customBaseUrl: searchResultOptions.customBaseUrl,
27631
27634
  customPayload: searchResultOptions.customPayload,
@@ -27635,8 +27638,8 @@ const getSearchResultsComponent = ({
27635
27638
  queryKey: searchResultOptions.queryKey,
27636
27639
  containerSelector: searchResultOptions.containerSelector,
27637
27640
  searchTitlePosition: "search-results-top",
27638
- titleKey: searchResultOptions.fields.titleKey,
27639
- labels: labels.searchResults,
27641
+ titleKey: (_m = searchResultOptions.fields) == null ? void 0 : _m.titleKey,
27642
+ labels: labels == null ? void 0 : labels.searchResults,
27640
27643
  grid: {
27641
27644
  columns
27642
27645
  },
@@ -27668,7 +27671,7 @@ const getSearchResultsComponent = ({
27668
27671
  }
27669
27672
  }, badges), {
27670
27673
  links: {
27671
- details: searchResultOptions.fields.productUrl ? `{${searchResultOptions.fields.productUrl}}` : void 0
27674
+ details: ((_n = searchResultOptions.fields) == null ? void 0 : _n.productUrl) ? `{${(_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl}}` : void 0
27672
27675
  },
27673
27676
  callbacks,
27674
27677
  routingBehavior: callbacks ? "event" : "direct-link",
@@ -27677,37 +27680,43 @@ const getSearchResultsComponent = ({
27677
27680
  {
27678
27681
  type: "image",
27679
27682
  placeholder: placeholderImage,
27680
- key: searchResultOptions.fields.imageKey,
27681
- baseUrl: searchResultOptions.fields.baseImageUrl,
27682
- display: () => searchResultOptions.fields.imageKey
27683
+ key: (_p = searchResultOptions.fields) == null ? void 0 : _p.imageKey,
27684
+ baseUrl: (_q = searchResultOptions.fields) == null ? void 0 : _q.baseImageUrl,
27685
+ display: () => {
27686
+ var _a2;
27687
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
27688
+ }
27683
27689
  },
27684
- addFieldIfKeyExists("_emphasis", (_i = searchResultOptions.fields) == null ? void 0 : _i.emphasizedField, {
27690
+ addFieldIfKeyExists("_emphasis", (_r = searchResultOptions.fields) == null ? void 0 : _r.emphasizedField, {
27685
27691
  type: "custom",
27686
27692
  className: "lupa-custom-emphasis",
27687
- key: searchResultOptions.fields.emphasizedField,
27693
+ key: (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField,
27688
27694
  display: () => true
27689
27695
  }),
27690
27696
  {
27691
27697
  type: "title",
27692
- key: searchResultOptions.fields.titleKey,
27693
- maxLines: (_j = searchResultOptions.maxLines) != null ? _j : 2,
27694
- display: (doc2) => searchResultOptions.fields.titleKey && Boolean(doc2[searchResultOptions.fields.titleKey])
27698
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.titleKey,
27699
+ maxLines: (_u = searchResultOptions.maxLines) != null ? _u : 2,
27700
+ display: (doc2) => {
27701
+ var _a2, _b2;
27702
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
27703
+ }
27695
27704
  },
27696
27705
  ...getAdditionalElements(additionalFields),
27697
- addFieldIfKeyExists("_discountPrice", searchResultOptions.fields.discountPriceKey, {
27698
- key: searchResultOptions.fields.discountPriceKey,
27706
+ addFieldIfKeyExists("_discountPrice", (_v = searchResultOptions.fields) == null ? void 0 : _v.discountPriceKey, {
27707
+ key: (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey,
27699
27708
  type: "customHtml",
27700
27709
  className: "lupa-price lupa-price-discounted",
27701
27710
  display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
27702
27711
  html: (doc2) => {
27703
- var _a2, _b2, _c2, _d2;
27704
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27705
- const discountPrice = (_b2 = parseFloat(
27706
- doc2[(_a2 = searchResultOptions.fields.discountPriceKey) != null ? _a2 : ""]
27707
- )) == null ? void 0 : _b2.toFixed(2);
27708
- const regularPrice = (_d2 = parseFloat(
27709
- doc2[(_c2 = searchResultOptions.fields.regularPriceKey) != null ? _c2 : ""]
27712
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27713
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27714
+ const discountPrice = (_d2 = parseFloat(
27715
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
27710
27716
  )) == null ? void 0 : _d2.toFixed(2);
27717
+ const regularPrice = (_g2 = parseFloat(
27718
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
27719
+ )) == null ? void 0 : _g2.toFixed(2);
27711
27720
  const discount = `<span class="lupa-discount">${escapeHtml(
27712
27721
  discountPrice
27713
27722
  )} ${currency}</span>`;
@@ -27717,17 +27726,17 @@ const getSearchResultsComponent = ({
27717
27726
  return discount + regular;
27718
27727
  }
27719
27728
  }),
27720
- addFieldIfKeyExists("_regularPrice", searchResultOptions.fields.regularPriceKey, {
27721
- key: searchResultOptions.fields.regularPriceKey,
27729
+ addFieldIfKeyExists("_regularPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.regularPriceKey, {
27730
+ key: (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey,
27722
27731
  type: "customHtml",
27723
27732
  className: "lupa-price lupa-price-single",
27724
27733
  display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
27725
27734
  html: (doc2) => {
27726
- var _a2, _b2, _c2, _d2;
27727
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27728
- const price = (_d2 = parseFloat(
27729
- (_c2 = doc2[(_a2 = searchResultOptions.fields.regularPriceKey) != null ? _a2 : ""]) != null ? _c2 : doc2[(_b2 = searchResultOptions.fields.discountPriceKey) != null ? _b2 : ""]
27730
- )) == null ? void 0 : _d2.toFixed(2);
27735
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27736
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27737
+ const price = (_g2 = parseFloat(
27738
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
27739
+ )) == null ? void 0 : _g2.toFixed(2);
27731
27740
  return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
27732
27741
  }
27733
27742
  })
@@ -27486,7 +27486,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27486
27486
  redirections,
27487
27487
  placeholderImage
27488
27488
  }) => {
27489
- var _a, _b;
27489
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27490
27490
  const panels = [
27491
27491
  ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
27492
27492
  {
@@ -27495,7 +27495,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27495
27495
  highlight: true,
27496
27496
  limit: 8,
27497
27497
  labels: {
27498
- topResultsTitle: labels.searchBox.topSuggestionsTitle
27498
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
27499
27499
  }
27500
27500
  }
27501
27501
  ] : [],
@@ -27508,22 +27508,25 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27508
27508
  {
27509
27509
  type: "image",
27510
27510
  placeholder: placeholderImage,
27511
- key: searchBoxOptions.fields.imageKey,
27512
- baseUrl: searchBoxOptions.fields.baseImageUrl
27511
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
27512
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
27513
27513
  },
27514
27514
  {
27515
27515
  type: "title",
27516
- key: searchBoxOptions.fields.titleKey,
27516
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
27517
27517
  maxLines: 2
27518
27518
  },
27519
27519
  {
27520
27520
  type: "regularPrice",
27521
- key: searchBoxOptions.fields.regularPriceKey,
27522
- display: (doc2) => searchBoxOptions.fields.regularPriceKey && searchBoxOptions.fields.discountPriceKey && parseFloat(doc2[searchBoxOptions.fields.regularPriceKey]) > parseFloat(doc2[searchBoxOptions.fields.discountPriceKey])
27521
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
27522
+ display: (doc2) => {
27523
+ var _a2, _b2, _c2, _d2;
27524
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
27525
+ }
27523
27526
  },
27524
27527
  {
27525
27528
  type: "price",
27526
- key: searchBoxOptions.fields.discountPriceKey
27529
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
27527
27530
  }
27528
27531
  ]
27529
27532
  }
@@ -27532,7 +27535,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27532
27535
  return {
27533
27536
  inputSelector: searchBoxOptions.inputSelector,
27534
27537
  options: {
27535
- environment: (_a = searchBoxOptions.environment) != null ? _a : "production",
27538
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
27536
27539
  customUrl: searchBoxOptions.customUrl,
27537
27540
  customBaseUrl: searchBoxOptions.customBaseUrl,
27538
27541
  customPayload: searchBoxOptions.customPayload,
@@ -27540,9 +27543,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27540
27543
  },
27541
27544
  showTotalCount: true,
27542
27545
  expandOnSinglePanel: true,
27543
- minInputLength: (_b = searchBoxOptions.fields.minInputLength) != null ? _b : 0,
27546
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
27544
27547
  debounce: 250,
27545
- labels: labels.searchBox,
27548
+ labels: labels == null ? void 0 : labels.searchBox,
27546
27549
  links: {
27547
27550
  searchResults: ""
27548
27551
  },
@@ -27550,7 +27553,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27550
27553
  redirections,
27551
27554
  history: {
27552
27555
  labels: {
27553
- clear: labels.searchBox.clearHistory
27556
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
27554
27557
  }
27555
27558
  }
27556
27559
  };
@@ -27564,7 +27567,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27564
27567
  callbacks,
27565
27568
  additionalFields
27566
27569
  }) => {
27567
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
27570
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
27568
27571
  const filters = searchResultOptions.showFacets ? {
27569
27572
  currentFilters: {
27570
27573
  visibility: {
@@ -27573,15 +27576,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27573
27576
  },
27574
27577
  labels: {
27575
27578
  title: "",
27576
- clearAll: (_a = labels.facets) == null ? void 0 : _a.clearAll
27579
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
27577
27580
  }
27578
27581
  },
27579
27582
  facets: {
27580
27583
  labels: {
27581
- title: labels.facets.facetTitle,
27582
- showAll: labels.facets.showAll,
27583
- facetFilter: labels.facets.facetFilter,
27584
- facetClear: labels.facets.facetClear
27584
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
27585
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
27586
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
27587
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
27585
27588
  },
27586
27589
  filterable: {
27587
27590
  minValues: 5
@@ -27606,12 +27609,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27606
27609
  }
27607
27610
  }
27608
27611
  } : {};
27609
- const columns = (_g = searchResultOptions.gridConfiguration) != null ? _g : {
27610
- xl: (_b = searchResultOptions.maxColumns) != null ? _b : 4,
27611
- l: (_c = searchResultOptions.maxColumns) != null ? _c : 3,
27612
- md: (_d = searchResultOptions.maxColumns) != null ? _d : 3,
27613
- sm: (_e = searchResultOptions.maxColumns) != null ? _e : 2,
27614
- xs: (_f = searchResultOptions.maxColumns) != null ? _f : 1
27612
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
27613
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
27614
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
27615
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
27616
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
27617
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
27615
27618
  };
27616
27619
  const badges = searchResultOptions.showRelevance ? {
27617
27620
  badges: {
@@ -27629,7 +27632,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27629
27632
  } : {};
27630
27633
  return __spreadValues(__spreadProps(__spreadValues({
27631
27634
  options: {
27632
- environment: (_h = searchResultOptions.environment) != null ? _h : "production",
27635
+ environment: (_l = searchResultOptions.environment) != null ? _l : "production",
27633
27636
  customUrl: searchResultOptions.customUrl,
27634
27637
  customBaseUrl: searchResultOptions.customBaseUrl,
27635
27638
  customPayload: searchResultOptions.customPayload,
@@ -27639,8 +27642,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27639
27642
  queryKey: searchResultOptions.queryKey,
27640
27643
  containerSelector: searchResultOptions.containerSelector,
27641
27644
  searchTitlePosition: "search-results-top",
27642
- titleKey: searchResultOptions.fields.titleKey,
27643
- labels: labels.searchResults,
27645
+ titleKey: (_m = searchResultOptions.fields) == null ? void 0 : _m.titleKey,
27646
+ labels: labels == null ? void 0 : labels.searchResults,
27644
27647
  grid: {
27645
27648
  columns
27646
27649
  },
@@ -27672,7 +27675,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27672
27675
  }
27673
27676
  }, badges), {
27674
27677
  links: {
27675
- details: searchResultOptions.fields.productUrl ? `{${searchResultOptions.fields.productUrl}}` : void 0
27678
+ details: ((_n = searchResultOptions.fields) == null ? void 0 : _n.productUrl) ? `{${(_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl}}` : void 0
27676
27679
  },
27677
27680
  callbacks,
27678
27681
  routingBehavior: callbacks ? "event" : "direct-link",
@@ -27681,37 +27684,43 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27681
27684
  {
27682
27685
  type: "image",
27683
27686
  placeholder: placeholderImage,
27684
- key: searchResultOptions.fields.imageKey,
27685
- baseUrl: searchResultOptions.fields.baseImageUrl,
27686
- display: () => searchResultOptions.fields.imageKey
27687
+ key: (_p = searchResultOptions.fields) == null ? void 0 : _p.imageKey,
27688
+ baseUrl: (_q = searchResultOptions.fields) == null ? void 0 : _q.baseImageUrl,
27689
+ display: () => {
27690
+ var _a2;
27691
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
27692
+ }
27687
27693
  },
27688
- addFieldIfKeyExists("_emphasis", (_i = searchResultOptions.fields) == null ? void 0 : _i.emphasizedField, {
27694
+ addFieldIfKeyExists("_emphasis", (_r = searchResultOptions.fields) == null ? void 0 : _r.emphasizedField, {
27689
27695
  type: "custom",
27690
27696
  className: "lupa-custom-emphasis",
27691
- key: searchResultOptions.fields.emphasizedField,
27697
+ key: (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField,
27692
27698
  display: () => true
27693
27699
  }),
27694
27700
  {
27695
27701
  type: "title",
27696
- key: searchResultOptions.fields.titleKey,
27697
- maxLines: (_j = searchResultOptions.maxLines) != null ? _j : 2,
27698
- display: (doc2) => searchResultOptions.fields.titleKey && Boolean(doc2[searchResultOptions.fields.titleKey])
27702
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.titleKey,
27703
+ maxLines: (_u = searchResultOptions.maxLines) != null ? _u : 2,
27704
+ display: (doc2) => {
27705
+ var _a2, _b2;
27706
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
27707
+ }
27699
27708
  },
27700
27709
  ...getAdditionalElements(additionalFields),
27701
- addFieldIfKeyExists("_discountPrice", searchResultOptions.fields.discountPriceKey, {
27702
- key: searchResultOptions.fields.discountPriceKey,
27710
+ addFieldIfKeyExists("_discountPrice", (_v = searchResultOptions.fields) == null ? void 0 : _v.discountPriceKey, {
27711
+ key: (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey,
27703
27712
  type: "customHtml",
27704
27713
  className: "lupa-price lupa-price-discounted",
27705
27714
  display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
27706
27715
  html: (doc2) => {
27707
- var _a2, _b2, _c2, _d2;
27708
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27709
- const discountPrice = (_b2 = parseFloat(
27710
- doc2[(_a2 = searchResultOptions.fields.discountPriceKey) != null ? _a2 : ""]
27711
- )) == null ? void 0 : _b2.toFixed(2);
27712
- const regularPrice = (_d2 = parseFloat(
27713
- doc2[(_c2 = searchResultOptions.fields.regularPriceKey) != null ? _c2 : ""]
27716
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27717
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27718
+ const discountPrice = (_d2 = parseFloat(
27719
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
27714
27720
  )) == null ? void 0 : _d2.toFixed(2);
27721
+ const regularPrice = (_g2 = parseFloat(
27722
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
27723
+ )) == null ? void 0 : _g2.toFixed(2);
27715
27724
  const discount = `<span class="lupa-discount">${escapeHtml(
27716
27725
  discountPrice
27717
27726
  )} ${currency}</span>`;
@@ -27721,17 +27730,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
27721
27730
  return discount + regular;
27722
27731
  }
27723
27732
  }),
27724
- addFieldIfKeyExists("_regularPrice", searchResultOptions.fields.regularPriceKey, {
27725
- key: searchResultOptions.fields.regularPriceKey,
27733
+ addFieldIfKeyExists("_regularPrice", (_x = searchResultOptions.fields) == null ? void 0 : _x.regularPriceKey, {
27734
+ key: (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey,
27726
27735
  type: "customHtml",
27727
27736
  className: "lupa-price lupa-price-single",
27728
27737
  display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
27729
27738
  html: (doc2) => {
27730
- var _a2, _b2, _c2, _d2;
27731
- const currency = escapeHtml(searchResultOptions.fields.currency || "€");
27732
- const price = (_d2 = parseFloat(
27733
- (_c2 = doc2[(_a2 = searchResultOptions.fields.regularPriceKey) != null ? _a2 : ""]) != null ? _c2 : doc2[(_b2 = searchResultOptions.fields.discountPriceKey) != null ? _b2 : ""]
27734
- )) == null ? void 0 : _d2.toFixed(2);
27739
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
27740
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
27741
+ const price = (_g2 = parseFloat(
27742
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
27743
+ )) == null ? void 0 : _g2.toFixed(2);
27735
27744
  return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
27736
27745
  }
27737
27746
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.8.0-alpha.0",
3
+ "version": "1.8.1",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -51,4 +51,4 @@
51
51
  "vue": "^3.3.4",
52
52
  "vue-tsc": "^1.6.5"
53
53
  }
54
- }
54
+ }