@depict-ai/ui 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,181 @@
1
- import {add_to_version_info as $cV3wj$add_to_version_info, observer as $cV3wj$observer, catchify as $cV3wj$catchify, fetch_recs as $cV3wj$fetch_recs, snakeCasifyObject as $cV3wj$snakeCasifyObject, instant_exec_on_suspect_history_change as $cV3wj$instant_exec_on_suspect_history_change, base_url as $cV3wj$base_url, dlog as $cV3wj$dlog, get_depict_id as $cV3wj$get_depict_id, get_user_id as $cV3wj$get_user_id, get_session_id as $cV3wj$get_session_id, sort_obj as $cV3wj$sort_obj, fetch_retry as $cV3wj$fetch_retry, add_version_query_params as $cV3wj$add_version_query_params, dwarn as $cV3wj$dwarn, make_url_with_query_params as $cV3wj$make_url_with_query_params, report as $cV3wj$report, javascript_media_query as $cV3wj$javascript_media_query, standard_price_format as $cV3wj$standard_price_format, make_random_classname as $cV3wj$make_random_classname, n_col_styling_with_dist as $cV3wj$n_col_styling_with_dist, useExpandingContainer as $cV3wj$useExpandingContainer, Amazing_Slider as $cV3wj$Amazing_Slider, slider_snap_css as $cV3wj$slider_snap_css, slider_fading_factory as $cV3wj$slider_fading_factory, hsl_to_rgb as $cV3wj$hsl_to_rgb, relative_luminance_from_rgb as $cV3wj$relative_luminance_from_rgb, base64_encode_unicode as $cV3wj$base64_encode_unicode, base64_decode_unicode as $cV3wj$base64_decode_unicode, queueMacroTask as $cV3wj$queueMacroTask, Layout as $cV3wj$Layout, async_iterable_ipns as $cV3wj$async_iterable_ipns, make_asyncIterable_exiter as $cV3wj$make_asyncIterable_exiter, href_change_ipns as $cV3wj$href_change_ipns, ContainedImage as $cV3wj$ContainedImage, deparallelize_no_drop as $cV3wj$deparallelize_no_drop, insert_surfaces as $cV3wj$insert_surfaces} from "@depict-ai/utilishared";
2
- import {createRoot as $cV3wj$createRoot, createSignal as $cV3wj$createSignal, getOwner as $cV3wj$getOwner, runWithOwner as $cV3wj$runWithOwner, onCleanup as $cV3wj$onCleanup, createComputed as $cV3wj$createComputed, createRenderEffect as $cV3wj$createRenderEffect, createEffect as $cV3wj$createEffect, untrack as $cV3wj$untrack, batch as $cV3wj$batch, createResource as $cV3wj$createResource, createMemo as $cV3wj$createMemo, Show as $cV3wj$Show, createReaction as $cV3wj$createReaction, Suspense as $cV3wj$Suspense, on as $cV3wj$on, ErrorBoundary as $cV3wj$ErrorBoundary, For as $cV3wj$For, Index as $cV3wj$Index} from "solid-js";
3
- import {ssrElement as $cV3wj$ssrElement, ssr as $cV3wj$ssr, ssrHydrationKey as $cV3wj$ssrHydrationKey, ssrAttribute as $cV3wj$ssrAttribute, escape as $cV3wj$escape, isServer as $cV3wj$isServer, createComponent as $cV3wj$createComponent, ssrClassList as $cV3wj$ssrClassList, insert as $cV3wj$insert, ssrStyle as $cV3wj$ssrStyle, Dynamic as $cV3wj$Dynamic, mergeProps as $cV3wj$mergeProps} from "solid-js/web";
1
+ import {add_to_version_info as $cV3wj$add_to_version_info, make_random_classname as $cV3wj$make_random_classname, n_col_styling_with_dist as $cV3wj$n_col_styling_with_dist, catchify as $cV3wj$catchify, layout_get_visible_recs_without_partial_rows as $cV3wj$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $cV3wj$layout_get_total_rec_amount_for_row, layout_media_query_header as $cV3wj$layout_media_query_header, report as $cV3wj$report, observer as $cV3wj$observer, fetch_recs as $cV3wj$fetch_recs, snakeCasifyObject as $cV3wj$snakeCasifyObject, instant_exec_on_suspect_history_change as $cV3wj$instant_exec_on_suspect_history_change, base_url as $cV3wj$base_url, dlog as $cV3wj$dlog, get_depict_id as $cV3wj$get_depict_id, get_user_id as $cV3wj$get_user_id, get_session_id as $cV3wj$get_session_id, sort_obj as $cV3wj$sort_obj, fetch_retry as $cV3wj$fetch_retry, add_version_query_params as $cV3wj$add_version_query_params, dwarn as $cV3wj$dwarn, make_url_with_query_params as $cV3wj$make_url_with_query_params, javascript_media_query as $cV3wj$javascript_media_query, standard_price_format as $cV3wj$standard_price_format, useExpandingContainer as $cV3wj$useExpandingContainer, Amazing_Slider as $cV3wj$Amazing_Slider, slider_snap_css as $cV3wj$slider_snap_css, slider_fading_factory as $cV3wj$slider_fading_factory, hsl_to_rgb as $cV3wj$hsl_to_rgb, relative_luminance_from_rgb as $cV3wj$relative_luminance_from_rgb, base64_encode_unicode as $cV3wj$base64_encode_unicode, base64_decode_unicode as $cV3wj$base64_decode_unicode, queueMacroTask as $cV3wj$queueMacroTask, make_asyncIterable_exiter as $cV3wj$make_asyncIterable_exiter, href_change_ipns as $cV3wj$href_change_ipns, ContainedImage as $cV3wj$ContainedImage, deparallelize_no_drop as $cV3wj$deparallelize_no_drop, insert_surfaces as $cV3wj$insert_surfaces} from "@depict-ai/utilishared";
2
+ import {createComponent as $cV3wj$createComponent, ssrElement as $cV3wj$ssrElement, escape as $cV3wj$escape, ssr as $cV3wj$ssr, ssrHydrationKey as $cV3wj$ssrHydrationKey, ssrClassList as $cV3wj$ssrClassList, ssrAttribute as $cV3wj$ssrAttribute, isServer as $cV3wj$isServer, insert as $cV3wj$insert, ssrStyle as $cV3wj$ssrStyle, Dynamic as $cV3wj$Dynamic, mergeProps as $cV3wj$mergeProps} from "solid-js/web";
3
+ import {createMemo as $cV3wj$createMemo, createSignal as $cV3wj$createSignal, createComputed as $cV3wj$createComputed, createRenderEffect as $cV3wj$createRenderEffect, untrack as $cV3wj$untrack, onCleanup as $cV3wj$onCleanup, ErrorBoundary as $cV3wj$ErrorBoundary, createRoot as $cV3wj$createRoot, getOwner as $cV3wj$getOwner, runWithOwner as $cV3wj$runWithOwner, createEffect as $cV3wj$createEffect, batch as $cV3wj$batch, createResource as $cV3wj$createResource, Show as $cV3wj$Show, createReaction as $cV3wj$createReaction, on as $cV3wj$on, Suspense as $cV3wj$Suspense, For as $cV3wj$For, Index as $cV3wj$Index} from "solid-js";
4
4
 
5
- /*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.3.2";
5
+ /*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.3.4";
6
6
 
7
7
 
8
8
 
9
9
 
10
10
 
11
+
12
+
13
+
14
+
15
+
16
+
17
+ function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
18
+ // FYI this probably doesn't work on hugely deep nestings or large amount of elements
19
+ return (0, $cV3wj$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
20
+ }
21
+ function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
22
+ const result = [];
23
+ if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
24
+ const element = elements[i];
25
+ result.push(...$a52235d12ccf9c88$var$unwrapping_helper(element));
26
+ }
27
+ else if (typeof elements == "function") result.push(...$a52235d12ccf9c88$var$unwrapping_helper(elements()));
28
+ else if (elements != undefined && typeof elements != "boolean") result.push(elements);
29
+ return result;
30
+ }
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+ // Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
40
+ class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
41
+ }
42
+ class $4fd48cb976bf1789$export$aa14a9f43128f61f extends $4fd48cb976bf1789$export$e1d52e4f0c7557a1 {
43
+ constructor(templateError){
44
+ super("Uncaught error in product card template", {
45
+ cause: templateError
46
+ });
47
+ }
48
+ }
49
+
50
+
51
+ const $b7436a6d1fd64e3b$var$_tmpl$ = [
52
+ "<div",
53
+ ' class="',
54
+ '">',
55
+ "</div>"
56
+ ];
57
+ function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
58
+ return (0, $cV3wj$ErrorBoundary)({
59
+ fallback (err, retry) {
60
+ const { message_: message_ , severity_: severity_ } = props;
61
+ let message = message_;
62
+ if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
63
+ console.error(err.cause);
64
+ message = `${message}: ${err.message}`;
65
+ } else (0, $cV3wj$report)([
66
+ err,
67
+ message_
68
+ ], severity_);
69
+ props.on_error_?.(retry);
70
+ return (0, $cV3wj$ssr)($b7436a6d1fd64e3b$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrClassList)(Object.fromEntries(props.class_list_?.map((c)=>[
71
+ c,
72
+ true
73
+ ]) || [])), (0, $cV3wj$escape)(message));
74
+ },
75
+ get children () {
76
+ return props.children;
77
+ }
78
+ });
79
+ }
80
+
81
+
82
+ const $c8d5ff4524619fcd$var$_tmpl$ = [
83
+ "<div",
84
+ ' class="',
85
+ '">',
86
+ "</div>"
87
+ ], $c8d5ff4524619fcd$var$_tmpl$2 = [
88
+ "<style",
89
+ ' type="text/css">',
90
+ "</style>"
91
+ ];
92
+ function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
93
+ return (0, $cV3wj$createComponent)((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
94
+ get message_ () {
95
+ return "Failed calculating " + props.layout + " layout";
96
+ },
97
+ severity_: "error",
98
+ get children () {
99
+ return $c8d5ff4524619fcd$var$ActualSolidLayout(props);
100
+ }
101
+ });
102
+ }
103
+ function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
104
+ // Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
105
+ const show_all_rows = (0, $cV3wj$createMemo)(()=>props.rows === "all");
106
+ const rows_or_empty_object = (0, $cV3wj$createMemo)(()=>show_all_rows() ? {} : props.rows);
107
+ const button_elements = (0, $a52235d12ccf9c88$export$2f0cbfbb4354bb52)((0, $cV3wj$createMemo)(()=>rows_or_empty_object().button));
108
+ const have_a_button = (0, $cV3wj$createMemo)(()=>{
109
+ const button = button_elements();
110
+ return !(!button || Array.isArray(button) && !button.length);
111
+ });
112
+ const [get_styling, set_styling] = (0, $cV3wj$createSignal)();
113
+ const container_class = (0, $cV3wj$make_random_classname)();
114
+ const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
115
+ const container_element = (0, $cV3wj$ssrElement)("div", props.element_attributes, ()=>(0, $cV3wj$escape)(props.children), true);
116
+ const [get_children_count, set_children_count] = (0, $cV3wj$createSignal)(0);
117
+ const update_children_count = ()=>set_children_count(container_element.children.length);
118
+ const col_styling = (0, $cV3wj$createMemo)(()=>(0, $cV3wj$n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
119
+ const default_currently_visible_signal = (0, $cV3wj$createSignal)(0); // Keep this signal here so it doesn't change when rows_or_empty_object and I think it's to be expected that the "internal default signal" stays the same
120
+ const rows_visible_signal = (0, $cV3wj$createMemo)(()=>rows_or_empty_object().currently_visible || default_currently_visible_signal);
121
+ const get_rows_visible = (0, $cV3wj$createMemo)(()=>rows_visible_signal()[0]());
122
+ const set_rows_visible = (0, $cV3wj$createMemo)(()=>rows_visible_signal()[1]);
123
+ const button_class = (0, $cV3wj$make_random_classname)();
124
+ const button_container = (0, $cV3wj$createMemo)(()=>have_a_button() && (0, $cV3wj$ssr)($c8d5ff4524619fcd$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), "load-more-container " + (0, $cV3wj$escape)(button_class, true), (0, $cV3wj$escape)(rows_or_empty_object().button)));
125
+ container_element.classList.add(container_class);
126
+ (0, $cV3wj$createComputed)(()=>{
127
+ // Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
128
+ const rows_visible = get_rows_visible();
129
+ const max_rows = rows_or_empty_object().max_rows;
130
+ if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
131
+ });
132
+ (0, $cV3wj$createRenderEffect)(()=>{
133
+ // Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
134
+ if (show_all_rows()) {
135
+ // no view more functionality requested
136
+ set_styling(()=>col_styling);
137
+ return;
138
+ }
139
+ (0, $cV3wj$untrack)(()=>set_rows_visible()(rows_or_empty_object().start_rows ?? 1));
140
+ update_children_count();
141
+ const mutation_observer = new MutationObserver((0, $cV3wj$catchify)(update_children_count));
142
+ mutation_observer.observe(container_element, {
143
+ childList: true
144
+ });
145
+ (0, $cV3wj$onCleanup)(()=>mutation_observer.disconnect());
146
+ set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
147
+ ()=>(0, $cV3wj$createMemo)(()=>{
148
+ const { rows_per_click: rows_per_click , max_rows: max_rows = -1 } = rows_or_empty_object();
149
+ const rows_visible = get_rows_visible();
150
+ const children_count = get_children_count();
151
+ return col_styling() + props.cols_at_size.map((options)=>{
152
+ const [, min, max] = options;
153
+ let should_hide_button;
154
+ let visible_recs;
155
+ if (props.disable_partial_rows) {
156
+ visible_recs = (0, $cV3wj$layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
157
+ const visible_recs_next_show_more = (0, $cV3wj$layout_get_visible_recs_without_partial_rows)(rows_visible + (rows_per_click || 0), // Should this really be zero when we default rows_per_click to 1?
158
+ children_count, options);
159
+ should_hide_button = visible_recs === visible_recs_next_show_more;
160
+ } else {
161
+ visible_recs = (0, $cV3wj$layout_get_total_rec_amount_for_row)(rows_visible, options);
162
+ should_hide_button = visible_recs >= children_count;
163
+ }
164
+ const should_hide_button_final = button_class && (should_hide_button || max_rows !== -1 && rows_visible >= max_rows);
165
+ return `${(0, $cV3wj$layout_media_query_header)(min, max)}{${selector_beginning}:nth-child(n+${visible_recs + 1}){display:none}${props.layout == "slider" ? `${selector_beginning}:nth-child(n+${visible_recs}){margin-right:0}` : ""}${should_hide_button_final ? `.depict .${button_class}{display:none!important}` : ``}}`;
166
+ }).join("");
167
+ }));
168
+ });
169
+ return [
170
+ container_element,
171
+ button_container(),
172
+ (0, $cV3wj$ssr)($c8d5ff4524619fcd$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), get_styling)
173
+ ];
174
+ }
175
+
176
+
177
+
178
+
11
179
  async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_opts) {
12
180
  const body = await (0, $cV3wj$observer).wait_for_element("body");
13
181
  let dispose_and_remove;
@@ -628,8 +796,6 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
628
796
 
629
797
 
630
798
 
631
-
632
-
633
799
  const $598245ecfe38f34b$var$_tmpl$ = [
634
800
  "<a",
635
801
  ' class="hint" href="javascript:void(0)">',
@@ -666,70 +832,6 @@ function $a458486f22b22f63$export$a2cc176055f8f08() {
666
832
 
667
833
 
668
834
 
669
-
670
-
671
- // Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
672
- class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
673
- }
674
- class $4fd48cb976bf1789$export$aa14a9f43128f61f extends $4fd48cb976bf1789$export$e1d52e4f0c7557a1 {
675
- constructor(templateError){
676
- super("Uncaught error in product card template", {
677
- cause: templateError
678
- });
679
- }
680
- }
681
-
682
-
683
- const $b7436a6d1fd64e3b$var$_tmpl$ = [
684
- "<div",
685
- ' class="',
686
- '">',
687
- "</div>"
688
- ];
689
- function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
690
- return (0, $cV3wj$ErrorBoundary)({
691
- fallback (err, retry) {
692
- const { message_: message_ , severity_: severity_ } = props;
693
- let message = message_;
694
- if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
695
- console.error(err.cause);
696
- message = `${message}: ${err.message}`;
697
- } else (0, $cV3wj$report)([
698
- err,
699
- message_
700
- ], severity_);
701
- props.on_error_?.(retry);
702
- return (0, $cV3wj$ssr)($b7436a6d1fd64e3b$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrClassList)(Object.fromEntries(props.class_list_?.map((c)=>[
703
- c,
704
- true
705
- ]) || [])), (0, $cV3wj$escape)(message));
706
- },
707
- get children () {
708
- return props.children;
709
- }
710
- });
711
- }
712
-
713
-
714
-
715
-
716
- function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
717
- // FYI this probably doesn't work on hugely deep nestings or large amount of elements
718
- return (0, $cV3wj$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
719
- }
720
- function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
721
- const result = [];
722
- if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
723
- const element = elements[i];
724
- result.push(...$a52235d12ccf9c88$var$unwrapping_helper(element));
725
- }
726
- else if (typeof elements == "function") result.push(...$a52235d12ccf9c88$var$unwrapping_helper(elements()));
727
- else if (elements != undefined && typeof elements != "boolean") result.push(elements);
728
- return result;
729
- }
730
-
731
-
732
-
733
835
  let $6e41f1fde994db72$var$cached_placeholder_element;
734
836
  let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
735
837
  function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_ , num_placeholders_: num_placeholders_ }) {
@@ -1043,21 +1145,13 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
1043
1145
  }
1044
1146
 
1045
1147
 
1148
+
1046
1149
  const $2d25e42846eac370$var$_tmpl$ = [
1047
1150
  "<div",
1048
1151
  ' class="',
1049
1152
  '"><!--#-->',
1050
1153
  "<!--/--><!--#-->",
1051
1154
  "<!--/--></div>"
1052
- ], $2d25e42846eac370$var$_tmpl$2 = [
1053
- "<div",
1054
- ' class="cards"',
1055
- ">",
1056
- "</div>"
1057
- ], $2d25e42846eac370$var$_tmpl$3 = [
1058
- "<style",
1059
- ">",
1060
- "</style>"
1061
1155
  ];
1062
1156
  function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_ , depict_api_: depict_api_ , all_products_loaded_: all_products_loaded_ , min_products_to_fetch_: min_products_to_fetch_ , query_base_: query_base_ , first_result_in_viewport_: first_result_in_viewport_ , last_result_in_viewport_: last_result_in_viewport_ , scroll_restoration_data_: [get_scroll_restoration_data] , no_results_options_: no_results_options_ , desktop_filter_elements_: desktop_filter_elements_ , sort_or_filter_open_: sort_or_filter_open_ , product_card_template_: product_card_template_ , layout_options_: layout_options_ , id_currently_querying_for_: id_currently_querying_for_ }) {
1063
1157
  // The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
@@ -1099,9 +1193,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
1099
1193
  let suspense_contents;
1100
1194
  let is_just_after_plp_results_update = false;
1101
1195
  let fallback_is_alive = false;
1102
- const random_id = (0, $cV3wj$make_random_classname)();
1103
- const selector_beginning_ = `.depict.plp #${random_id}>`;
1104
- const [get_styling, set_styling_] = (0, $cV3wj$createSignal)("");
1105
1196
  const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $cV3wj$createSignal)(true);
1106
1197
  const rendered_placeholders = (0, $cV3wj$createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
1107
1198
  product_card_template_: product_card_template_,
@@ -1111,64 +1202,22 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
1111
1202
  })
1112
1203
  }) : undefined);
1113
1204
  const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $cV3wj$createSignal)(false);
1205
+ const modified_cols_at_size = $2d25e42846eac370$var$make_modified_cols_at_size({
1206
+ layout_options_: layout_options_,
1207
+ sort_or_filter_open_: sort_or_filter_open_
1208
+ });
1114
1209
  (0, $cV3wj$createComputed)(()=>{
1115
1210
  if (!is_loading_()) return;
1116
1211
  set_should_have_placeholders_rendered(true);
1117
1212
  set_suspense_is_blocked(false);
1118
1213
  is_just_after_plp_results_update = true;
1119
1214
  });
1120
- $2d25e42846eac370$var$results_grid_styling_generator({
1121
- layout_options_: layout_options_,
1122
- set_styling_: set_styling_,
1123
- sort_or_filter_open_: sort_or_filter_open_,
1124
- selector_beginning_: selector_beginning_
1125
- });
1126
- const has_at_least_one_display = (0, $cV3wj$createMemo)(()=>!!plp_results_()?.displays?.length); // Only de-construct below stuff if we get 0 displays. Important that this returns boolean so that below Suspense only gets re-created if it actually changes
1127
1215
  const block_suspense_if_needed = ()=>{
1128
1216
  if (!is_just_after_plp_results_update) return;
1129
1217
  is_just_after_plp_results_update = false;
1130
1218
  fallback_is_alive = false;
1131
1219
  set_suspense_is_blocked(true);
1132
1220
  };
1133
- const non_placeholder_product_cards = (0, $cV3wj$createMemo)(()=>has_at_least_one_display() && // This suspense ensures that if someone has async templates, we still show placeholders until the product cards actually have finished rendering (automagically since they're createResource's)
1134
- // We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
1135
- // (For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
1136
- // We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
1137
- (0, $cV3wj$createComponent)((0, $cV3wj$Suspense), {
1138
- get fallback () {
1139
- return (()=>{
1140
- fallback_is_alive = true;
1141
- (0, $cV3wj$onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
1142
- return (0, $cV3wj$createMemo)(()=>{
1143
- // We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
1144
- // In future we could have individual suspense's for each product card, but that's too much for now
1145
- if (get_suspense_is_blocked()) return suspense_contents;
1146
- set_should_have_placeholders_rendered(true); // just in case
1147
- (0, $cV3wj$onCleanup)(()=>set_should_have_placeholders_rendered(false));
1148
- return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
1149
- });
1150
- })();
1151
- },
1152
- get children () {
1153
- return (()=>{
1154
- suspense_contents = (0, $0449e7d49398c077$export$a1fd619a4743ca08)({
1155
- product_card_template_: product_card_template_,
1156
- plp_results_: plp_results_,
1157
- last_result_in_viewport_: last_result_in_viewport_,
1158
- first_result_in_viewport_: first_result_in_viewport_,
1159
- market_: market_,
1160
- merchant_: merchant_,
1161
- all_products_loaded_: all_products_loaded_,
1162
- min_products_to_fetch_: min_products_to_fetch_,
1163
- query_base_: query_base_,
1164
- depict_api_: depict_api_,
1165
- is_loading_: is_loading_
1166
- });
1167
- (0, $cV3wj$onCleanup)(()=>suspense_contents = undefined);
1168
- return suspense_contents;
1169
- })();
1170
- }
1171
- }));
1172
1221
  (0, $cV3wj$createEffect)((0, $cV3wj$on)(plp_results_, ()=>{
1173
1222
  if (!fallback_is_alive) {
1174
1223
  // if all product card rendering functions after the initial rendering are synchronous the suspense boundary will never go into the fallback, so we don't know when they have finished rendering, and we can't block the suspense. Therefore, we're just doing it with this effect
@@ -1180,18 +1229,69 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
1180
1229
  }));
1181
1230
  return [
1182
1231
  (0, $a458486f22b22f63$export$a2cc176055f8f08)(),
1183
- (0, $cV3wj$ssr)($2d25e42846eac370$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$ssrAttribute)("id", (0, $cV3wj$escape)(random_id, true), false), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Show), {
1184
- get when () {
1185
- return !is_loading_();
1232
+ (0, $cV3wj$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
1233
+ get cols_at_size () {
1234
+ return modified_cols_at_size();
1186
1235
  },
1187
- get fallback () {
1188
- return rendered_placeholders();
1236
+ get override_vertical_spacing () {
1237
+ return layout_options_().override_vertical_spacing;
1238
+ },
1239
+ get grid_spacing () {
1240
+ return layout_options_().grid_spacing;
1241
+ },
1242
+ rows: "all",
1243
+ layout: "grid",
1244
+ element_attributes: {
1245
+ class: "cards"
1189
1246
  },
1190
1247
  get children () {
1191
- return non_placeholder_product_cards();
1248
+ return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
1249
+ get when () {
1250
+ return !is_loading_();
1251
+ },
1252
+ get fallback () {
1253
+ return rendered_placeholders();
1254
+ },
1255
+ get children () {
1256
+ return (0, $cV3wj$createComponent)((0, $cV3wj$Suspense), {
1257
+ get fallback () {
1258
+ return (()=>{
1259
+ fallback_is_alive = true;
1260
+ (0, $cV3wj$onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
1261
+ return (0, $cV3wj$createMemo)(()=>{
1262
+ // We need to be able to block the suspense since when async product cards are *rendering* we want to show the placeholders on initial load but not when loading more
1263
+ // In future we could have individual suspense's for each product card, but that's too much for now
1264
+ if (get_suspense_is_blocked()) return suspense_contents;
1265
+ set_should_have_placeholders_rendered(true); // just in case
1266
+ (0, $cV3wj$onCleanup)(()=>set_should_have_placeholders_rendered(false));
1267
+ return rendered_placeholders; // I lifted the placeholders into the memo since we don't want to re-render them when switching from <Show> to <Suspense>
1268
+ });
1269
+ })();
1270
+ },
1271
+ get children () {
1272
+ return (()=>{
1273
+ suspense_contents = (0, $0449e7d49398c077$export$a1fd619a4743ca08)({
1274
+ product_card_template_: product_card_template_,
1275
+ plp_results_: plp_results_,
1276
+ last_result_in_viewport_: last_result_in_viewport_,
1277
+ first_result_in_viewport_: first_result_in_viewport_,
1278
+ market_: market_,
1279
+ merchant_: merchant_,
1280
+ all_products_loaded_: all_products_loaded_,
1281
+ min_products_to_fetch_: min_products_to_fetch_,
1282
+ query_base_: query_base_,
1283
+ depict_api_: depict_api_,
1284
+ is_loading_: is_loading_
1285
+ });
1286
+ (0, $cV3wj$onCleanup)(()=>suspense_contents = undefined);
1287
+ return suspense_contents;
1288
+ })();
1289
+ }
1290
+ });
1291
+ }
1292
+ });
1192
1293
  }
1193
- }))),
1194
- (0, $cV3wj$ssr)($2d25e42846eac370$var$_tmpl$3, (0, $cV3wj$ssrHydrationKey)(), get_styling())
1294
+ })
1195
1295
  ];
1196
1296
  }
1197
1297
  });
@@ -1199,13 +1299,14 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
1199
1299
  })), (0, $cV3wj$escape)(desktop_filter_elements_()));
1200
1300
  }
1201
1301
  /**
1202
- * Sets styling to styling generated by "Layout" (n_col_styling_with_dist) depending on if filters are open or not
1302
+ * Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
1203
1303
  * This function is special to the actual PLPResults.
1204
- */ function $2d25e42846eac370$var$results_grid_styling_generator({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ , set_styling_: set_styling_ , selector_beginning_: selector_beginning_ }) {
1205
- (0, $cV3wj$createRenderEffect)(()=>{
1304
+ */ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ }) {
1305
+ return (0, $cV3wj$createMemo)(()=>{
1306
+ const layout_options = layout_options_();
1206
1307
  // Add grid styling that changes when filters get opened/closed
1207
- const when_filters_closed_cols = layout_options_.cols_at_size;
1208
- const cols_at_size = sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
1308
+ const when_filters_closed_cols = layout_options.cols_at_size;
1309
+ return sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
1209
1310
  const [num_cols_default, , , , override_cols] = row;
1210
1311
  const cloned_row = [
1211
1312
  ...row
@@ -1221,8 +1322,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
1221
1322
  };
1222
1323
  return cloned_row;
1223
1324
  }) : when_filters_closed_cols;
1224
- const css = (0, $cV3wj$n_col_styling_with_dist)(selector_beginning_, layout_options_.grid_spacing, cols_at_size, "grid", layout_options_.override_vertical_spacing);
1225
- set_styling_(css);
1226
1325
  });
1227
1326
  }
1228
1327
 
@@ -5351,15 +5450,19 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
5351
5450
  });
5352
5451
  }
5353
5452
  }
5354
- function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_category , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , show_breadcrumbs: show_breadcrumbs = true , show_quicklinks: show_quicklinks = true , category_title: category_title }) {
5453
+ function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
5454
+ const { depict_category: depict_category , product_card_template: product_card_template , category_title: category_title } = props;
5355
5455
  const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
5356
- const grid_spacing_override = typeof grid_spacing === "string" ? {
5357
- grid_spacing: grid_spacing
5358
- } : {
5359
- override_vertical_spacing: grid_spacing.vertical,
5360
- grid_spacing: grid_spacing.horizontal
5361
- };
5362
5456
  return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
5457
+ const grid_spacing_override = (0, $cV3wj$createMemo)(()=>{
5458
+ const { grid_spacing: grid_spacing } = props; // can be reactive
5459
+ return typeof grid_spacing === "string" ? {
5460
+ grid_spacing: grid_spacing
5461
+ } : {
5462
+ override_vertical_spacing: grid_spacing.vertical,
5463
+ grid_spacing: grid_spacing.horizontal
5464
+ };
5465
+ });
5363
5466
  const { state_: { category_local_filter_cache: local_filter_cache_ , category_filters_open: category_filters_open_ , category_sorting_open: category_sorting_open_ , category_expanded_filters: expanded_filters_ , category_expanded_hierarchical_filters: expanded_hierarchical_filters_ , category_scroll_restoration_data: scroll_restoration_data_ } , current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , reset_history_state_: reset_history_state_ , depict_api_: depict_api_ , i18n_: i18n_ , router_: router_ , breadcrumb_signal_: breadcrumb_signal_ , quicklinks_signal_: quicklinks_signal_ , sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = shared_properties;
5364
5467
  (0, $cV3wj$onCleanup)(reset_history_state_);
5365
5468
  return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
@@ -5371,9 +5474,9 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
5371
5474
  query_id_: ()=>depict_category.category_id,
5372
5475
  listing_type_: ()=>depict_category.listing_type,
5373
5476
  i18n_: i18n_,
5374
- show_quicklinks_: show_quicklinks,
5477
+ show_quicklinks_: (0, $cV3wj$createMemo)(()=>props.show_quicklinks ?? true),
5375
5478
  category_title_: category_title,
5376
- show_breadcrumbs_: show_breadcrumbs,
5479
+ show_breadcrumbs_: (0, $cV3wj$createMemo)(()=>props.show_breadcrumbs ?? true),
5377
5480
  current_sorting_: current_sorting_,
5378
5481
  router_: router_,
5379
5482
  get_breadcrumb_accessor_: (accessor)=>(0, $cV3wj$createComputed)(()=>breadcrumb_signal_[1](accessor())),
@@ -5385,10 +5488,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
5385
5488
  selected_filters_: selected_filters_,
5386
5489
  sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
5387
5490
  scroll_restoration_data_: scroll_restoration_data_,
5388
- layout_options_: {
5389
- cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(cols_at_size),
5390
- ...grid_spacing_override
5391
- },
5491
+ layout_options_: (0, $cV3wj$createMemo)(()=>({
5492
+ cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
5493
+ ...grid_spacing_override()
5494
+ })),
5392
5495
  product_card_template_: product_card_template
5393
5496
  });
5394
5497
  }, "Entire CategoryPage failed");
@@ -5785,17 +5888,14 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
5785
5888
 
5786
5889
 
5787
5890
 
5891
+
5788
5892
  const $172e1b898d457050$var$_tmpl$ = [
5789
- "<div",
5790
- ' class="cards">',
5791
- "</div>"
5792
- ], $172e1b898d457050$var$_tmpl$2 = [
5793
5893
  "<div",
5794
5894
  ' class="search-recs"><h3 class="search-recs-title">',
5795
5895
  "</h3><!--#-->",
5796
5896
  "<!--/--><!--#-->",
5797
5897
  "<!--/--></div>"
5798
- ], $172e1b898d457050$var$_tmpl$3 = [
5898
+ ], $172e1b898d457050$var$_tmpl$2 = [
5799
5899
  "<button",
5800
5900
  ' class="show-more major" type="button">',
5801
5901
  "</button>"
@@ -5806,59 +5906,58 @@ function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_ ,
5806
5906
  const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
5807
5907
  const [recommendations_resource] = (0, $cV3wj$createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
5808
5908
  const is_showing_something = (0, $cV3wj$createMemo)(()=>recommendations_resource.loading || recommendations_resource()?.length);
5809
- const num_placeholders_ = (0, $cV3wj$createMemo)(()=>(0, $7747fe1a8c5652e3$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column)));
5810
- const cards = (0, $cV3wj$ssr)($172e1b898d457050$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $cV3wj$Suspense), {
5811
- get fallback () {
5812
- return (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
5813
- num_placeholders_: num_placeholders_,
5814
- product_card_template_: product_card_template_
5815
- });
5816
- },
5817
- get children () {
5818
- return (()=>{
5819
- // IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
5820
- const displays_by_key_ = (0, $29ec7cddbe1d3484$export$7f8bd308237ab5a5)((0, $cV3wj$createMemo)(()=>recommendations_resource() || []));
5821
- return (0, $29ec7cddbe1d3484$export$43f0fb951fcb0c54)({
5822
- displays_by_key_: displays_by_key_,
5823
- merchant_: (0, $cV3wj$createMemo)(()=>search_query_base_().tenant),
5824
- market_: (0, $cV3wj$createMemo)(()=>search_query_base_().market),
5825
- product_card_template_: product_card_template_
5826
- });
5827
- })();
5828
- }
5829
- })));
5830
- const search_recs_elements = (0, $cV3wj$ssr)($172e1b898d457050$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.search_recs_title_()), (0, $cV3wj$escape)((0, $a458486f22b22f63$export$a2cc176055f8f08)()), (0, $cV3wj$escape)(cards));
5831
- // the cards element must have a parent for Layout to work, therefore we're inserting it into a div above
5832
- (0, $cV3wj$Layout)({
5833
- container_element: cards,
5834
- layout: "grid",
5835
- rows: rows_object,
5836
- ...layout_options_
5837
- }).catch((e)=>(0, $cV3wj$report)([
5838
- e,
5839
- "Layout failed"
5840
- ], "error"));
5909
+ const num_placeholders_ = (0, $cV3wj$createMemo)(()=>(0, $7747fe1a8c5652e3$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column])=>per_column)));
5841
5910
  return (0, $cV3wj$createComponent)((0, $cV3wj$Show), {
5842
5911
  get when () {
5843
5912
  return is_showing_something();
5844
5913
  },
5845
- children: search_recs_elements
5914
+ get children () {
5915
+ return (0, $cV3wj$ssr)($172e1b898d457050$var$_tmpl$, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.search_recs_title_()), (0, $cV3wj$escape)((0, $a458486f22b22f63$export$a2cc176055f8f08)()), (0, $cV3wj$escape)((0, $cV3wj$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), (0, $cV3wj$mergeProps)({
5916
+ rows: rows_object,
5917
+ layout: "grid",
5918
+ element_attributes: {
5919
+ class: "cards"
5920
+ }
5921
+ }, layout_options_, {
5922
+ get children () {
5923
+ return (0, $cV3wj$createComponent)((0, $cV3wj$Suspense), {
5924
+ get fallback () {
5925
+ return (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
5926
+ num_placeholders_: num_placeholders_,
5927
+ product_card_template_: product_card_template_
5928
+ });
5929
+ },
5930
+ get children () {
5931
+ return (()=>{
5932
+ // IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
5933
+ const displays_by_key_ = (0, $29ec7cddbe1d3484$export$7f8bd308237ab5a5)((0, $cV3wj$createMemo)(()=>recommendations_resource() || []));
5934
+ return (0, $29ec7cddbe1d3484$export$43f0fb951fcb0c54)({
5935
+ displays_by_key_: displays_by_key_,
5936
+ merchant_: (0, $cV3wj$createMemo)(()=>search_query_base_().tenant),
5937
+ market_: (0, $cV3wj$createMemo)(()=>search_query_base_().market),
5938
+ product_card_template_: product_card_template_
5939
+ });
5940
+ })();
5941
+ }
5942
+ });
5943
+ }
5944
+ }))));
5945
+ }
5846
5946
  });
5847
5947
  }
5848
5948
  function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
5849
- const ipns = (0, $cV3wj$async_iterable_ipns)();
5949
+ const currently_visible = (0, $cV3wj$createSignal)(0); // this number shouldn't matter for anything except typing
5950
+ const [get_currently_visible, set_currently_visible] = currently_visible;
5850
5951
  const rows = {
5851
- ipns: ipns,
5952
+ currently_visible: currently_visible,
5852
5953
  start_rows: (0, $cV3wj$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
5853
5954
  rows_per_click: 3,
5854
- button: (0, $cV3wj$ssr)($172e1b898d457050$var$_tmpl$3, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.view_more_()))
5955
+ button: (0, $cV3wj$ssr)($172e1b898d457050$var$_tmpl$2, (0, $cV3wj$ssrHydrationKey)(), (0, $cV3wj$escape)(i18n_.view_more_()))
5855
5956
  };
5856
- (0, $cV3wj$catchify)(async ()=>{
5857
- for await (const number of ipns)set_showing_recommendation_rows(number);
5858
- })();
5859
- (0, $cV3wj$createComputed)((0, $cV3wj$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>{
5860
- if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
5861
- }, {
5957
+ (0, $cV3wj$createComputed)((0, $cV3wj$on)(get_currently_visible, (new_visible)=>set_showing_recommendation_rows(new_visible), {
5958
+ defer: true
5959
+ }));
5960
+ (0, $cV3wj$createComputed)((0, $cV3wj$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>set_currently_visible(new_rows), {
5862
5961
  defer: true
5863
5962
  }));
5864
5963
  return rows;
@@ -7158,7 +7257,7 @@ const $7097477c78a89208$var$_tmpl$ = [
7158
7257
  "<!--/--><!--#-->",
7159
7258
  "<!--/--></div>"
7160
7259
  ];
7161
- function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , search_recs_view_more_: search_recs_view_more_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , modal_body_style_ref_: modal_body_style_ref_ }) {
7260
+ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ , search_field_value_: search_field_value_ , get_search_query_: get_search_query_ , open_modal_: open_modal_ , submit_query_: submit_query_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , expanded_filters_: expanded_filters_ , input_modal_open_: input_modal_open_ , selected_filters_: selected_filters_ , i18n_: i18n_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , search_recs_view_more_: search_recs_view_more_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , product_card_template_: product_card_template_ , modal_body_style_ref_: modal_body_style_ref_ }) {
7162
7261
  const [get_sorting] = current_sorting_;
7163
7262
  const all_products_loaded_ = (0, $cV3wj$createSignal)(false);
7164
7263
  const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
@@ -7394,7 +7493,9 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
7394
7493
  depict_api_: depict_api_,
7395
7494
  i18n_: i18n_,
7396
7495
  search_query_base_: search_query_base_,
7397
- layout_options_: recommendations_layout_options_,
7496
+ get layout_options_ () {
7497
+ return (0, $cV3wj$createMemo)(()=>recommendations_layout_options_?.() ?? layout_options_());
7498
+ },
7398
7499
  showing_recommendation_rows_: showing_recommendation_rows_,
7399
7500
  view_more_button_: search_recs_view_more_,
7400
7501
  product_card_template_: product_card_template_
@@ -7683,16 +7784,19 @@ function $806c97b931758897$var$get_shared_properties(depict_search) {
7683
7784
  return shared_properties;
7684
7785
  }
7685
7786
  function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
7686
- const { depict_search: depict_search , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , extra_depict_options: extra_depict_options } = props;
7787
+ const { depict_search: depict_search , product_card_template: product_card_template } = props;
7687
7788
  const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
7688
- const grid_spacing_override = typeof grid_spacing === "string" ? {
7689
- grid_spacing: grid_spacing
7690
- } : {
7691
- override_vertical_spacing: grid_spacing.vertical,
7692
- grid_spacing: grid_spacing.horizontal
7693
- };
7694
7789
  return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
7695
7790
  const { state_: state_ } = shared_properties;
7791
+ const grid_spacing_override = (0, $cV3wj$createMemo)(()=>{
7792
+ const { grid_spacing: grid_spacing } = props; // can be reactive
7793
+ return typeof grid_spacing === "string" ? {
7794
+ grid_spacing: grid_spacing
7795
+ } : {
7796
+ override_vertical_spacing: grid_spacing.vertical,
7797
+ grid_spacing: grid_spacing.horizontal
7798
+ };
7799
+ });
7696
7800
  (0, $cV3wj$onCleanup)(shared_properties.reset_history_state_);
7697
7801
  return (0, $7097477c78a89208$export$a54ec244c8863715)({
7698
7802
  input_modal_open_: ()=>!!depict_search.modal_open,
@@ -7738,19 +7842,23 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
7738
7842
  showing_recommendation_rows_: state_.search_showing_recommendation_rows,
7739
7843
  scroll_restoration_data_: state_.search_scroll_restoration_data,
7740
7844
  include_input_field_: ()=>props.include_input_field,
7741
- layout_options_: {
7742
- cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(cols_at_size),
7743
- ...grid_spacing_override
7744
- },
7745
- recommendations_layout_options_: extra_depict_options?.recommendations_cols_at_size ? {
7746
- cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
7747
- ...grid_spacing_override
7748
- } : undefined,
7845
+ layout_options_: (0, $cV3wj$createMemo)(()=>({
7846
+ cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
7847
+ ...grid_spacing_override()
7848
+ })),
7849
+ recommendations_layout_options_: (0, $cV3wj$createMemo)(()=>{
7850
+ const { extra_depict_options: extra_depict_options } = props;
7851
+ return extra_depict_options?.recommendations_cols_at_size ? {
7852
+ cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
7853
+ ...grid_spacing_override()
7854
+ } : undefined;
7855
+ }),
7749
7856
  product_card_template_: product_card_template
7750
7857
  });
7751
7858
  }, "Entire SearchPage failed");
7752
7859
  }
7753
- function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler , aligner_ref: aligner_ref }) {
7860
+ function $806c97b931758897$export$316f6f283ae64765(props) {
7861
+ const { depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler } = props;
7754
7862
  const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
7755
7863
  return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
7756
7864
  let input_element;
@@ -7779,7 +7887,7 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
7779
7887
  input_element.selectionStart,
7780
7888
  input_element.selectionEnd
7781
7889
  ];
7782
- const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, aligner_ref);
7890
+ const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
7783
7891
  const complete_modal_dispose_handler = ()=>{
7784
7892
  modal_dispose_handler?.();
7785
7893
  cleanup();
@@ -7803,23 +7911,21 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
7803
7911
  ];
7804
7912
  }, "SearchField failed");
7805
7913
  }
7806
- function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_ref) {
7914
+ function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_ref_accessor) {
7807
7915
  return (0, $cV3wj$createRoot)((dispose)=>{
7808
- if (aligner_ref) {
7916
+ (0, $cV3wj$createComputed)(()=>{
7917
+ const aligner_ref = aligner_ref_accessor?.();
7918
+ if (!aligner_ref) {
7919
+ (0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
7920
+ return;
7921
+ }
7809
7922
  const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(aligner_ref);
7923
+ (0, $cV3wj$onCleanup)(cleanup);
7810
7924
  (0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
7811
- return {
7812
- cleanup: ()=>{
7813
- cleanup();
7814
- dispose();
7815
- }
7816
- };
7817
- } else {
7818
- (0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
7819
- return {
7820
- cleanup: dispose
7821
- };
7822
- }
7925
+ });
7926
+ return {
7927
+ cleanup: dispose
7928
+ };
7823
7929
  });
7824
7930
  }
7825
7931
 
@@ -8115,4 +8221,4 @@ const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b
8115
8221
  (0, $cV3wj$add_to_version_info)("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
8116
8222
 
8117
8223
 
8118
- export {$194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $c9312089e8983364$export$643598a327b5833e as get_categories, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $806c97b931758897$export$316f6f283ae64765 as SearchField, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version};
8224
+ export {$c8d5ff4524619fcd$export$d21e32dfedac04be as SolidLayout, $194bd6b8e4c59830$export$79b1565500412d9b as general_modal_abstraction, $19976a74d273070d$export$3b621d86b1566b2 as CrossIcon, $fbbadcb080ad1d4a$export$8be2714ec7f169ee as GenericSliderArrowButton, $c58717f39bf51647$export$58e808b1db15d3bc as fetchDepictRecommendations, $961b5c64bef4662f$export$de035477d6fef996 as QuickLinks, $961b5c64bef4662f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a6e23a834336fc19$export$824dde41348efed1 as embedded_num_products, $c9312089e8983364$export$643598a327b5833e as get_categories, $961b5c64bef4662f$export$f34314aa9505732e as DepictCategory, $961b5c64bef4662f$export$e2bf8ce7779e827e as CategoryPage, $806c97b931758897$export$ac6237957a15b3f0 as DepictSearch, $806c97b931758897$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $806c97b931758897$export$f2dc7e4e4aa11abb as SearchPage, $806c97b931758897$export$316f6f283ae64765 as SearchField, $4fd48cb976bf1789$export$aa14a9f43128f61f as ProductCardError, $6891c018a834cfdd$export$d86a33413558014e as open_modal_with_alignment, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $b5cccc8ee7d24677$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $926b1b5ba2239356$export$1233ca167bf71f9a as styles_to_valid_css_string, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $8c0f86cb3e266eeb$export$a71e92cfbb498adc as SolidFormatPrice, $4ca91518c9a35379$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $d20eff0aadc28983$export$acb3eaade4b23afd as BasePlaceholder, $d134eae24341b4a1$export$89c6019e4baa40b1 as TextPlaceholder, $7f60f09116a3fe61$export$3f37af283f8fb843 as ImagePlaceholder, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $4690a06c8489dcd0$export$864d304a0bc46829 as defaultGridSpacing, $4690a06c8489dcd0$export$c3834fa86c616831 as defaultColsAtSize, $4690a06c8489dcd0$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $ec291e0010116877$export$83d89fbfd8236492 as version};