@depict-ai/ui 4.8.29 → 4.9.0

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.
@@ -81,7 +81,8 @@ const $0f11d1c8c78bac40$export$434b5d2e9cbbcde1 = {
81
81
  get_showing_pages_for_: (query, number_of_results_element, has_query, number_of_results) => {
82
82
  const page_form = number_of_results === 1 ? "page" : "pages";
83
83
  return has_query ? [`Found `, number_of_results_element, ` ${page_form} for `, query] : [`Found `, number_of_results_element, ` ${page_form}`];
84
- }
84
+ },
85
+ modal_view_all_no_results_: "View alternatives"
85
86
  };
86
87
  const $cc5f333f4d0674e5$var$czech_base_translation = {
87
88
  "of_": "z",
@@ -156,7 +157,8 @@ const $cc5f333f4d0674e5$export$62ef558576ddaf3d = {
156
157
  listing_suggestions_: "Kategorie & Kolekce",
157
158
  previous_: "P\u0159edchoz\xed",
158
159
  popular_: "Popul\xe1rn\xed",
159
- products_: "Produkty"
160
+ products_: "Produkty",
161
+ modal_view_all_no_results_: "Zobrazit alternativy"
160
162
  };
161
163
  const $6d2294054a72fcfe$var$danish_base_translation = {
162
164
  "of_": "af",
@@ -229,7 +231,8 @@ const $6d2294054a72fcfe$export$70578856b2420b5d = {
229
231
  get_showing_pages_for_: (query, number_of_results_element, has_query, number_of_results) => {
230
232
  const page_form = number_of_results === 1 ? "side" : "sider";
231
233
  return has_query ? [`Fandt `, number_of_results_element, ` ${page_form} for `, query] : [`Fandt `, number_of_results_element, ` ${page_form}`];
232
- }
234
+ },
235
+ modal_view_all_no_results_: "Se alternativer"
233
236
  };
234
237
  const $37e37251f83c2043$var$dutch_base_translation = {
235
238
  "of_": "van",
@@ -302,7 +305,8 @@ const $37e37251f83c2043$export$5d14584e27bf4bc5 = {
302
305
  listing_suggestions_: "Categorie\xebn & Collecties",
303
306
  previous_: "Vorige",
304
307
  popular_: "Populair",
305
- products_: "Producten"
308
+ products_: "Producten",
309
+ modal_view_all_no_results_: "Bekijk alternatieven"
306
310
  };
307
311
  const $597bd174c99156c2$var$finnish_base_translation = {
308
312
  "of_": "/",
@@ -375,7 +379,8 @@ const $597bd174c99156c2$export$bb9c5e11b9203620 = {
375
379
  listing_suggestions_: "Kategoriat & Kokoelmat",
376
380
  previous_: "Edellinen",
377
381
  popular_: "Suosittu",
378
- products_: "Tuotteet"
382
+ products_: "Tuotteet",
383
+ modal_view_all_no_results_: "N\xe4yt\xe4 vaihtoehdot"
379
384
  };
380
385
  const $69bc56544b53deda$var$french_base_translation = {
381
386
  "of_": "de",
@@ -448,7 +453,8 @@ const $69bc56544b53deda$export$e608b2bb21ba1862 = {
448
453
  listing_suggestions_: "Cat\xe9gories & Collections",
449
454
  previous_: "Pr\xe9c\xe9dent",
450
455
  popular_: "Populaire",
451
- products_: "Produits"
456
+ products_: "Produits",
457
+ modal_view_all_no_results_: "Voir les alternatives"
452
458
  };
453
459
  const $dc8b0b929b2d7ddb$var$german_base_translation = {
454
460
  "of_": "von",
@@ -521,7 +527,8 @@ const $dc8b0b929b2d7ddb$export$b43a5e72c07b4d2a = {
521
527
  get_showing_pages_for_: (query, number_of_results_element, has_query, number_of_results) => {
522
528
  const page_form = number_of_results === 1 ? "Seite" : "Seiten";
523
529
  return has_query ? [number_of_results_element, ` ${page_form} f\xfcr `, query] : [number_of_results_element, ` ${page_form}`];
524
- }
530
+ },
531
+ modal_view_all_no_results_: "Alternativen anzeigen"
525
532
  };
526
533
  const $e401cebd86a65dd5$var$italian_base_translation = {
527
534
  "of_": "di",
@@ -594,7 +601,8 @@ const $e401cebd86a65dd5$export$c05550c0848a3fe4 = {
594
601
  listing_suggestions_: "Categorie & Collezioni",
595
602
  previous_: "Precedente",
596
603
  popular_: "Popolare",
597
- products_: "Prodotti"
604
+ products_: "Prodotti",
605
+ modal_view_all_no_results_: "Visualizza alternative"
598
606
  };
599
607
  const $2c5d03375c4a5b27$var$norwegian_base_translation = {
600
608
  "of_": "av",
@@ -667,7 +675,8 @@ const $2c5d03375c4a5b27$export$dcb702a89633f297 = {
667
675
  get_showing_pages_for_: (query, number_of_results_element, has_query, number_of_results) => {
668
676
  const page_form = number_of_results === 1 ? "side" : "sider";
669
677
  return has_query ? [`Fant `, number_of_results_element, ` ${page_form} for `, query] : [`Fant `, number_of_results_element, ` ${page_form}`];
670
- }
678
+ },
679
+ modal_view_all_no_results_: "Vis alternativer"
671
680
  };
672
681
  const $7432d62a9527b38a$var$polish_base_translation = {
673
682
  "of_": "z",
@@ -749,7 +758,8 @@ const $7432d62a9527b38a$export$b0eb0dd41442f532 = {
749
758
  listing_suggestions_: "Kategorie & Kolekcje",
750
759
  previous_: "Poprzedni",
751
760
  popular_: "Popularne",
752
- products_: "Produkty"
761
+ products_: "Produkty",
762
+ modal_view_all_no_results_: "Zobacz alternatywy"
753
763
  };
754
764
  const $8c622dc7e9fbf3de$var$portuguese_base_translation = {
755
765
  "of_": "de",
@@ -811,7 +821,8 @@ const $8c622dc7e9fbf3de$export$b3b5aa2c4df8976f = {
811
821
  listing_suggestions_: "Categorias & Cole\xe7\xf5es",
812
822
  previous_: "Anterior",
813
823
  popular_: "Popular",
814
- products_: "Produtos"
824
+ products_: "Produtos",
825
+ modal_view_all_no_results_: "Ver alternativas"
815
826
  };
816
827
  const $32d3bec8717cf616$var$spanish_base_translation = {
817
828
  "of_": "de",
@@ -884,7 +895,8 @@ const $32d3bec8717cf616$export$49b8f20513f0ff25 = {
884
895
  listing_suggestions_: "Categor\xedas & Colecciones",
885
896
  previous_: "Anterior",
886
897
  popular_: "Popular",
887
- products_: "Productos"
898
+ products_: "Productos",
899
+ modal_view_all_no_results_: "Ver alternativas"
888
900
  };
889
901
  const $38de3920ebd2d651$var$swedish_base_translation = {
890
902
  "of_": "av",
@@ -933,6 +945,7 @@ const $38de3920ebd2d651$export$596caee559c76764 = {
933
945
  ...$38de3920ebd2d651$var$swedish_base_translation,
934
946
  "no_results_text_": "Inga resultat",
935
947
  modal_view_all_results_: number_of_results => ["Visa alla ", number_of_results, " resultat"],
948
+ modal_view_all_no_results_: "Visa andra alternativ",
936
949
  "search_recs_title_": "Andra alternativ",
937
950
  "clear_filters_query_sorting_after_submit_": "Rensa f\xf6rfr\xe5ga och filter + sorting efter ny f\xf6rfr\xe5ga",
938
951
  "previous_searches_text_": "Dina tidigare s\xf6kningar",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depict-ai/ui",
3
- "version": "4.8.29",
3
+ "version": "4.9.0",
4
4
  "description": "Base package containing the actual UI of Depict UI along with translations, with a not-simplified API. We recommend using @depict-ai/js-ui or @depict-ai/react-ui instead.",
5
5
  "packageManager": "yarn@3.2.2",
6
6
  "sass": "styles.scss",
@@ -236,9 +236,9 @@
236
236
  "@babel/plugin-transform-typescript": "^7.22.9",
237
237
  "@babel/runtime": "latest",
238
238
  "@babel/runtime-corejs3": "^7.22.6",
239
- "@depict-ai/plp-styling": "^4.4.20",
240
- "@depict-ai/types": "^5.4.5",
241
- "@depict-ai/utilishared": "^2.4.7",
239
+ "@depict-ai/plp-styling": "^4.5.0",
240
+ "@depict-ai/types": "^5.5.0",
241
+ "@depict-ai/utilishared": "^2.5.0",
242
242
  "solid-js": "^1.8.16"
243
243
  },
244
244
  "type": "module",
@@ -115,7 +115,7 @@ $parcel$export(module.exports, "BreadCrumbs", () => $335c02c1241a9ca8$export$5b7
115
115
  $parcel$export(module.exports, "QuickLinks", () => $335c02c1241a9ca8$export$de035477d6fef996);
116
116
  $parcel$export(module.exports, "CategoryPage", () => $c10e33c4681f8c9b$export$e2bf8ce7779e827e);
117
117
  /*! Depict.ai search and product listing SDK */
118
- const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.8.29";
118
+ const $aa1938dec50d6c12$export$83d89fbfd8236492 = "4.9.0";
119
119
  function $3e17e871e9d0911d$export$d9f36cf74e24d595(media_query) {
120
120
  const signal = $3hooq$solidjs.createSignal(false);
121
121
  $3hooq$solidjs.onCleanup($3hooq$depictaiutilishared.javascript_media_query(media_query, _ref => {
@@ -6800,6 +6800,7 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6800
6800
  const first_result_in_viewport_ = $3hooq$solidjs.createSignal();
6801
6801
  const last_result_in_viewport_ = $3hooq$solidjs.createSignal();
6802
6802
  const all_products_loaded_ = $3hooq$solidjs.createSignal(false);
6803
+ const [, setAllProductsLoaded] = all_products_loaded_;
6803
6804
  const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $3hooq$solidjs.createSignal(0);
6804
6805
  const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $3hooq$solidjs.createSignal(false);
6805
6806
  const owner = $3hooq$solidjs.getOwner();
@@ -6829,31 +6830,34 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
6829
6830
  // Make "Get products in listing" request to get products in listing
6830
6831
  const [plp_products_] = $3hooq$solidjs.createResource(products_query_base_,
6831
6832
  // only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
6832
- $3hooq$depictaiutilisharedlatest.catchify(base_query => $fef4890f1f8e0544$export$cc42dd29bf655ab6({
6833
- id_: $3hooq$solidjs.untrack(id_to_query_for_),
6834
- scroll_restoration_data_: scroll_restoration_data_,
6835
- min_products_to_fetch_: min_products_to_fetch_,
6836
- make_request_: (limit, cursor) => depict_api_.get_listing_products({
6837
- ...base_query,
6838
- limit: limit,
6839
- ...(cursor ? {
6840
- cursor: cursor
6841
- } : {}),
6842
- // This gets exposed to the products display transformer and gives it information about the listing the products are in
6843
- // It's very hard to implement tracking that uses the collection title without this information
6844
- currentListingForTransformer_: new Promise(resolve => $3hooq$solidjs.createRoot(dispose => {
6845
- $3hooq$solidjs.createEffect($3hooq$depictaiutilisharedlatest.catchify(() => {
6846
- const key = base_query.id_type_ + base_query.id_to_query_for_;
6847
- const metaResponsePromise = metaRequestsForQuery().get(key);
6848
- if (!metaResponsePromise) return;
6849
- resolve(metaResponsePromise);
6850
- dispose();
6851
- setMetaRequestsForQuery(prev => (prev.delete(key), prev));
6852
- }));
6853
- $3hooq$solidjs.runWithOwner(owner, () => $3hooq$solidjs.onCleanup(dispose));
6854
- }))
6855
- })
6856
- })));
6833
+ $3hooq$depictaiutilisharedlatest.catchify(base_query => {
6834
+ setAllProductsLoaded(false);
6835
+ return $fef4890f1f8e0544$export$cc42dd29bf655ab6({
6836
+ id_: $3hooq$solidjs.untrack(id_to_query_for_),
6837
+ scroll_restoration_data_: scroll_restoration_data_,
6838
+ min_products_to_fetch_: min_products_to_fetch_,
6839
+ make_request_: (limit, cursor) => depict_api_.get_listing_products({
6840
+ ...base_query,
6841
+ limit: limit,
6842
+ ...(cursor ? {
6843
+ cursor: cursor
6844
+ } : {}),
6845
+ // This gets exposed to the products display transformer and gives it information about the listing the products are in
6846
+ // It's very hard to implement tracking that uses the collection title without this information
6847
+ currentListingForTransformer_: new Promise(resolve => $3hooq$solidjs.createRoot(dispose => {
6848
+ $3hooq$solidjs.createEffect($3hooq$depictaiutilisharedlatest.catchify(() => {
6849
+ const key = base_query.id_type_ + base_query.id_to_query_for_;
6850
+ const metaResponsePromise = metaRequestsForQuery().get(key);
6851
+ if (!metaResponsePromise) return;
6852
+ resolve(metaResponsePromise);
6853
+ dispose();
6854
+ setMetaRequestsForQuery(prev => (prev.delete(key), prev));
6855
+ }));
6856
+ $3hooq$solidjs.runWithOwner(owner, () => $3hooq$solidjs.onCleanup(dispose));
6857
+ }))
6858
+ })
6859
+ });
6860
+ }));
6857
6861
  const meta_query_base = $e4bc31358c414b18$export$210f130a61ac1e8d(() => ({
6858
6862
  merchant: merchant_(),
6859
6863
  market: market_(),
@@ -9346,15 +9350,16 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
9346
9350
  if (key === "Escape") close_modal_();
9347
9351
  });
9348
9352
  // total number of results = content results + product results
9349
- const total_number_of_results = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
9350
- number_: $3hooq$solidjs.createMemo(() => {
9351
- var _get_modal_search_res, _results$content_sear;
9352
- const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
9353
- const hits = results === null || results === void 0 ? void 0 : results.n_hits;
9354
- const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
9355
- if (!content_results || !content_search_enabled_()) return hits;
9356
- return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
9357
- }),
9353
+ const totalNumberOfResults = $3hooq$solidjs.createMemo(() => {
9354
+ var _get_modal_search_res, _results$content_sear;
9355
+ const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
9356
+ const hits = results === null || results === void 0 ? void 0 : results.n_hits;
9357
+ const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
9358
+ if (!content_results || !content_search_enabled_()) return hits;
9359
+ return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
9360
+ });
9361
+ const formattedTotalNumberResults = $068bde7fa83ac02c$export$92f2da32c6e7e7ee({
9362
+ number_: totalNumberOfResults,
9358
9363
  i18n_: i18n_
9359
9364
  });
9360
9365
  const selected_index = $3hooq$solidjs.createSignal();
@@ -9362,7 +9367,27 @@ function $9035b24c2dbd3f36$var$RawClassicSearchModal(_ref) {
9362
9367
  equals: false
9363
9368
  });
9364
9369
  const less_than_700_high = $3e17e871e9d0911d$export$d9f36cf74e24d595("(max-height:700px)");
9365
- const DiscoverMoreSection = () => $3hooq$solidjsweb.ssr($9035b24c2dbd3f36$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), get_search_field_value_() ? $3hooq$solidjsweb.escape(i18n_.modal_view_all_results_()($3hooq$solidjsweb.ssr($9035b24c2dbd3f36$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(total_number_of_results())))) : $3hooq$solidjsweb.escape(i18n_.modal_discover_more_()));
9370
+ const DiscoverMoreSection = () => $3hooq$solidjsweb.ssr($9035b24c2dbd3f36$var$_tmpl$, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
9371
+ get when() {
9372
+ return get_search_field_value_();
9373
+ },
9374
+ get fallback() {
9375
+ return i18n_.modal_discover_more_();
9376
+ },
9377
+ get children() {
9378
+ return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
9379
+ get when() {
9380
+ return totalNumberOfResults();
9381
+ },
9382
+ get fallback() {
9383
+ return i18n_.modal_view_all_no_results_();
9384
+ },
9385
+ get children() {
9386
+ return i18n_.modal_view_all_results_()($3hooq$solidjsweb.ssr($9035b24c2dbd3f36$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(formattedTotalNumberResults())));
9387
+ }
9388
+ });
9389
+ }
9390
+ })));
9366
9391
  if (disable_scrolling_) $8c2e68c6d458169b$export$fe334901e8bebd57();
9367
9392
  $4b71b4fabdee5753$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
9368
9393
  window.addEventListener("keydown", close_on_escape_handler);
@@ -10205,7 +10230,27 @@ function $43600b30502feeda$var$RawSearchModalV2(_ref) {
10205
10230
  if (forceUseDiv_) return $3hooq$solidjsweb.ssrElement("div", props, () => $3hooq$solidjsweb.escape(props.children), true);
10206
10231
  return $3hooq$solidjsweb.ssrElement("dialog", props, () => $3hooq$solidjsweb.escape(props.children), true);
10207
10232
  };
10208
- const discoverMoreSection = $3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), get_search_field_value_() ? $3hooq$solidjsweb.escape(i18n_.modal_view_all_results_()($3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(formattedTotalNumberResults())))) : $3hooq$solidjsweb.escape(i18n_.modal_discover_more_()));
10233
+ const discoverMoreSection = $3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$2, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape($3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
10234
+ get when() {
10235
+ return get_search_field_value_();
10236
+ },
10237
+ get fallback() {
10238
+ return i18n_.modal_discover_more_();
10239
+ },
10240
+ get children() {
10241
+ return $3hooq$solidjsweb.createComponent((0, $3hooq$solidjs.Show), {
10242
+ get when() {
10243
+ return totalNumberResults();
10244
+ },
10245
+ get fallback() {
10246
+ return i18n_.modal_view_all_no_results_();
10247
+ },
10248
+ get children() {
10249
+ return i18n_.modal_view_all_results_()($3hooq$solidjsweb.ssr($43600b30502feeda$var$_tmpl$3, $3hooq$solidjsweb.ssrHydrationKey(), $3hooq$solidjsweb.escape(formattedTotalNumberResults())));
10250
+ }
10251
+ });
10252
+ }
10253
+ })));
10209
10254
  const search_field = $29e5dbeb69da7a36$export$b94867ecbd698f21({
10210
10255
  BackIcon_: (0, $50b50df3efaa8776$export$11e9f390c90a537f),
10211
10256
  input_field_ref_: element => set_input_field(element),
@@ -11,7 +11,7 @@ import { GetListingRequest } from "@depict-ai/types/api/GetListingRequest";
11
11
  import { BaseSearchRequestV3 } from "@depict-ai/types/api/BaseSearchRequestV3";
12
12
  import { FeaturedInDisplay } from "@depict-ai/types/api/FeaturedInResponseV3";
13
13
  import { SearchFilter as _SearchFilter3 } from "@depict-ai/types/api/SearchRequestV2";
14
- export const version = "4.8.29";
14
+ export const version = "4.9.0";
15
15
  /**
16
16
  * Use `javascript_media_query` but return a reactive accessor instead of taking a callback function
17
17
  */
@@ -110,6 +110,7 @@ interface search_i18n extends plp_shared_i18n {
110
110
  previous_: string;
111
111
  popular_: string;
112
112
  products_: string;
113
+ modal_view_all_no_results_: string;
113
114
  }
114
115
  /**
115
116
  * Category internationalisation
@@ -1538,7 +1539,7 @@ type OpenModalParams<OriginalDisplay extends Display, OutputDisplay extends Mode
1538
1539
  * Open the modal with support for alignment.
1539
1540
  * @returns {void}
1540
1541
  */
1541
- export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends unknown>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1542
+ export const open_modal_with_alignment: <OriginalDisplay extends Display, OutputDisplay extends ModernDisplay>(openModalParams: OpenModalParams<OriginalDisplay, OutputDisplay>) => void;
1542
1543
  export function open_search_with_shift_slash(open_search: VoidFunction): () => void;
1543
1544
  export interface PageReplacer {
1544
1545
  readonly render_: () => Node_Array;
@@ -1618,5 +1619,5 @@ export function CategoryPage<OriginalDisplay extends Display, OutputDisplay exte
1618
1619
  layout?: PossibleLayout;
1619
1620
  filterModalParent_?: HTMLElement | ShadowRoot;
1620
1621
  showSliderArrow_?: boolean;
1621
- }): import("@depict-ai/utilishared").Node_Array;
1622
+ }): import("@depict-ai/utilishared/latest").Node_Array;
1622
1623
  export type { SearchFilter } from "@depict-ai/types/api/SearchRequestV3";
@@ -10,7 +10,7 @@ import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpe
10
10
  /*! Depict.ai search and product listing SDK */
11
11
  import { register_es_version } from "../../multi_import_deduplicator.mjs";
12
12
  register_es_version("ui", "ES10");
13
- const $8db9a15135765c11$export$83d89fbfd8236492 = "4.8.29";
13
+ const $8db9a15135765c11$export$83d89fbfd8236492 = "4.9.0";
14
14
  function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
15
15
  const signal = $b8hua$createSignal(false);
16
16
  $b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
@@ -6695,6 +6695,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6695
6695
  const first_result_in_viewport_ = $b8hua$createSignal();
6696
6696
  const last_result_in_viewport_ = $b8hua$createSignal();
6697
6697
  const all_products_loaded_ = $b8hua$createSignal(false);
6698
+ const [, setAllProductsLoaded] = all_products_loaded_;
6698
6699
  const [currentlyLoadedDisplays, setCurrentlyLoadedDisplays_] = $b8hua$createSignal(0);
6699
6700
  const [can_write_scroll_restoration_, set_can_write_scroll_restoration] = $b8hua$createSignal(false);
6700
6701
  const owner = $b8hua$getOwner();
@@ -6724,31 +6725,34 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
6724
6725
  // Make "Get products in listing" request to get products in listing
6725
6726
  const [plp_products_] = $b8hua$createResource(products_query_base_,
6726
6727
  // only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
6727
- $b8hua$catchify(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
6728
- id_: $b8hua$untrack(id_to_query_for_),
6729
- scroll_restoration_data_: scroll_restoration_data_,
6730
- min_products_to_fetch_: min_products_to_fetch_,
6731
- make_request_: (limit, cursor) => depict_api_.get_listing_products({
6732
- ...base_query,
6733
- limit: limit,
6734
- ...(cursor ? {
6735
- cursor: cursor
6736
- } : {}),
6737
- // This gets exposed to the products display transformer and gives it information about the listing the products are in
6738
- // It's very hard to implement tracking that uses the collection title without this information
6739
- currentListingForTransformer_: new Promise(resolve => $b8hua$createRoot(dispose => {
6740
- $b8hua$createEffect($b8hua$catchify(() => {
6741
- const key = base_query.id_type_ + base_query.id_to_query_for_;
6742
- const metaResponsePromise = metaRequestsForQuery().get(key);
6743
- if (!metaResponsePromise) return;
6744
- resolve(metaResponsePromise);
6745
- dispose();
6746
- setMetaRequestsForQuery(prev => (prev.delete(key), prev));
6747
- }));
6748
- $b8hua$runWithOwner(owner, () => $b8hua$onCleanup(dispose));
6749
- }))
6750
- })
6751
- })));
6728
+ $b8hua$catchify(base_query => {
6729
+ setAllProductsLoaded(false);
6730
+ return $5e6abec0dab4e610$export$cc42dd29bf655ab6({
6731
+ id_: $b8hua$untrack(id_to_query_for_),
6732
+ scroll_restoration_data_: scroll_restoration_data_,
6733
+ min_products_to_fetch_: min_products_to_fetch_,
6734
+ make_request_: (limit, cursor) => depict_api_.get_listing_products({
6735
+ ...base_query,
6736
+ limit: limit,
6737
+ ...(cursor ? {
6738
+ cursor: cursor
6739
+ } : {}),
6740
+ // This gets exposed to the products display transformer and gives it information about the listing the products are in
6741
+ // It's very hard to implement tracking that uses the collection title without this information
6742
+ currentListingForTransformer_: new Promise(resolve => $b8hua$createRoot(dispose => {
6743
+ $b8hua$createEffect($b8hua$catchify(() => {
6744
+ const key = base_query.id_type_ + base_query.id_to_query_for_;
6745
+ const metaResponsePromise = metaRequestsForQuery().get(key);
6746
+ if (!metaResponsePromise) return;
6747
+ resolve(metaResponsePromise);
6748
+ dispose();
6749
+ setMetaRequestsForQuery(prev => (prev.delete(key), prev));
6750
+ }));
6751
+ $b8hua$runWithOwner(owner, () => $b8hua$onCleanup(dispose));
6752
+ }))
6753
+ })
6754
+ });
6755
+ }));
6752
6756
  const meta_query_base = $ec225bf1f1627ea8$export$210f130a61ac1e8d(() => ({
6753
6757
  merchant: merchant_(),
6754
6758
  market: market_(),
@@ -9241,15 +9245,16 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
9241
9245
  if (key === "Escape") close_modal_();
9242
9246
  });
9243
9247
  // total number of results = content results + product results
9244
- const total_number_of_results = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
9245
- number_: $b8hua$createMemo(() => {
9246
- var _get_modal_search_res, _results$content_sear;
9247
- const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
9248
- const hits = results === null || results === void 0 ? void 0 : results.n_hits;
9249
- const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
9250
- if (!content_results || !content_search_enabled_()) return hits;
9251
- return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
9252
- }),
9248
+ const totalNumberOfResults = $b8hua$createMemo(() => {
9249
+ var _get_modal_search_res, _results$content_sear;
9250
+ const results = (_get_modal_search_res = get_modal_search_results()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
9251
+ const hits = results === null || results === void 0 ? void 0 : results.n_hits;
9252
+ const content_results = results === null || results === void 0 ? void 0 : (_results$content_sear = results.content_search_links) === null || _results$content_sear === void 0 ? void 0 : _results$content_sear.length;
9253
+ if (!content_results || !content_search_enabled_()) return hits;
9254
+ return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
9255
+ });
9256
+ const formattedTotalNumberResults = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
9257
+ number_: totalNumberOfResults,
9253
9258
  i18n_: i18n_
9254
9259
  });
9255
9260
  const selected_index = $b8hua$createSignal();
@@ -9257,7 +9262,27 @@ function $40411f2ec772c376$var$RawClassicSearchModal(_ref) {
9257
9262
  equals: false
9258
9263
  });
9259
9264
  const less_than_700_high = $00a5b94f0c11efbb$export$d9f36cf74e24d595("(max-height:700px)");
9260
- const DiscoverMoreSection = () => $b8hua$ssr($40411f2ec772c376$var$_tmpl$, $b8hua$ssrHydrationKey(), get_search_field_value_() ? $b8hua$escape(i18n_.modal_view_all_results_()($b8hua$ssr($40411f2ec772c376$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(total_number_of_results())))) : $b8hua$escape(i18n_.modal_discover_more_()));
9265
+ const DiscoverMoreSection = () => $b8hua$ssr($40411f2ec772c376$var$_tmpl$, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
9266
+ get when() {
9267
+ return get_search_field_value_();
9268
+ },
9269
+ get fallback() {
9270
+ return i18n_.modal_discover_more_();
9271
+ },
9272
+ get children() {
9273
+ return $b8hua$createComponent((0, $b8hua$Show), {
9274
+ get when() {
9275
+ return totalNumberOfResults();
9276
+ },
9277
+ get fallback() {
9278
+ return i18n_.modal_view_all_no_results_();
9279
+ },
9280
+ get children() {
9281
+ return i18n_.modal_view_all_results_()($b8hua$ssr($40411f2ec772c376$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape(formattedTotalNumberResults())));
9282
+ }
9283
+ });
9284
+ }
9285
+ })));
9261
9286
  if (disable_scrolling_) $e56d241d0f33d459$export$fe334901e8bebd57();
9262
9287
  $a82a41ab7188eda2$export$93d9bfd0c9c1a5b8(close_modal_, search_query_url_param_name_);
9263
9288
  window.addEventListener("keydown", close_on_escape_handler);
@@ -10100,7 +10125,27 @@ function $06fcd2a345efd24d$var$RawSearchModalV2(_ref) {
10100
10125
  if (forceUseDiv_) return $b8hua$ssrElement("div", props, () => $b8hua$escape(props.children), true);
10101
10126
  return $b8hua$ssrElement("dialog", props, () => $b8hua$escape(props.children), true);
10102
10127
  };
10103
- const discoverMoreSection = $b8hua$ssr($06fcd2a345efd24d$var$_tmpl$2, $b8hua$ssrHydrationKey(), get_search_field_value_() ? $b8hua$escape(i18n_.modal_view_all_results_()($b8hua$ssr($06fcd2a345efd24d$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape(formattedTotalNumberResults())))) : $b8hua$escape(i18n_.modal_discover_more_()));
10128
+ const discoverMoreSection = $b8hua$ssr($06fcd2a345efd24d$var$_tmpl$2, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createComponent((0, $b8hua$Show), {
10129
+ get when() {
10130
+ return get_search_field_value_();
10131
+ },
10132
+ get fallback() {
10133
+ return i18n_.modal_discover_more_();
10134
+ },
10135
+ get children() {
10136
+ return $b8hua$createComponent((0, $b8hua$Show), {
10137
+ get when() {
10138
+ return totalNumberResults();
10139
+ },
10140
+ get fallback() {
10141
+ return i18n_.modal_view_all_no_results_();
10142
+ },
10143
+ get children() {
10144
+ return i18n_.modal_view_all_results_()($b8hua$ssr($06fcd2a345efd24d$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape(formattedTotalNumberResults())));
10145
+ }
10146
+ });
10147
+ }
10148
+ })));
10104
10149
  const search_field = $584c06c09cf4609d$export$b94867ecbd698f21({
10105
10150
  BackIcon_: (0, $c2fe922d21c40514$export$11e9f390c90a537f),
10106
10151
  input_field_ref_: element => set_input_field(element),