@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.
- package/dist/client/main.cjs +370 -248
- package/dist/client/module.js +372 -251
- package/dist/index.d.ts +36 -10
- package/dist/server/main.cjs +341 -234
- package/dist/server/module.js +343 -237
- package/package.json +4 -4
package/dist/client/module.js
CHANGED
|
@@ -1,13 +1,199 @@
|
|
|
1
|
-
import {add_to_version_info as $gco9i$add_to_version_info,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {add_to_version_info as $gco9i$add_to_version_info, make_random_classname as $gco9i$make_random_classname, n_col_styling_with_dist as $gco9i$n_col_styling_with_dist, catchify as $gco9i$catchify, layout_get_visible_recs_without_partial_rows as $gco9i$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $gco9i$layout_get_total_rec_amount_for_row, layout_media_query_header as $gco9i$layout_media_query_header, report as $gco9i$report, observer as $gco9i$observer, fetch_recs as $gco9i$fetch_recs, snakeCasifyObject as $gco9i$snakeCasifyObject, instant_exec_on_suspect_history_change as $gco9i$instant_exec_on_suspect_history_change, base_url as $gco9i$base_url, dlog as $gco9i$dlog, get_depict_id as $gco9i$get_depict_id, get_user_id as $gco9i$get_user_id, get_session_id as $gco9i$get_session_id, sort_obj as $gco9i$sort_obj, fetch_retry as $gco9i$fetch_retry, add_version_query_params as $gco9i$add_version_query_params, dwarn as $gco9i$dwarn, make_url_with_query_params as $gco9i$make_url_with_query_params, javascript_media_query as $gco9i$javascript_media_query, standard_price_format as $gco9i$standard_price_format, useExpandingContainer as $gco9i$useExpandingContainer, Amazing_Slider as $gco9i$Amazing_Slider, slider_snap_css as $gco9i$slider_snap_css, slider_fading_factory as $gco9i$slider_fading_factory, hsl_to_rgb as $gco9i$hsl_to_rgb, relative_luminance_from_rgb as $gco9i$relative_luminance_from_rgb, base64_encode_unicode as $gco9i$base64_encode_unicode, base64_decode_unicode as $gco9i$base64_decode_unicode, queueMacroTask as $gco9i$queueMacroTask, is_debug as $gco9i$is_debug, make_asyncIterable_exiter as $gco9i$make_asyncIterable_exiter, href_change_ipns as $gco9i$href_change_ipns, ContainedImage as $gco9i$ContainedImage, buildThresholdList as $gco9i$buildThresholdList, deparallelize_no_drop as $gco9i$deparallelize_no_drop, insert_surfaces as $gco9i$insert_surfaces} from "@depict-ai/utilishared";
|
|
2
|
+
import {template as $gco9i$template, createComponent as $gco9i$createComponent, getNextElement as $gco9i$getNextElement, spread as $gco9i$spread, mergeProps as $gco9i$mergeProps, insert as $gco9i$insert, runHydrationEvents as $gco9i$runHydrationEvents, addEventListener as $gco9i$addEventListener, className as $gco9i$className, memo as $gco9i$memo, delegateEvents as $gco9i$delegateEvents, effect as $gco9i$effect, classList as $gco9i$classList, setAttribute as $gco9i$setAttribute, isServer as $gco9i$isServer, getNextMarker as $gco9i$getNextMarker, use as $gco9i$use, style as $gco9i$style, Dynamic as $gco9i$Dynamic} from "solid-js/web";
|
|
3
|
+
import {createMemo as $gco9i$createMemo, createSignal as $gco9i$createSignal, createComputed as $gco9i$createComputed, createRenderEffect as $gco9i$createRenderEffect, untrack as $gco9i$untrack, onCleanup as $gco9i$onCleanup, ErrorBoundary as $gco9i$ErrorBoundary, createRoot as $gco9i$createRoot, getOwner as $gco9i$getOwner, runWithOwner as $gco9i$runWithOwner, createEffect as $gco9i$createEffect, batch as $gco9i$batch, createResource as $gco9i$createResource, Show as $gco9i$Show, createReaction as $gco9i$createReaction, on as $gco9i$on, Suspense as $gco9i$Suspense, For as $gco9i$For, Index as $gco9i$Index} from "solid-js";
|
|
4
4
|
|
|
5
|
-
/*! Depict.ai search and product listing SDK */ const $ec291e0010116877$export$83d89fbfd8236492 = "1.3.
|
|
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
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
|
|
24
|
+
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
25
|
+
return (0, $gco9i$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
|
|
26
|
+
}
|
|
27
|
+
function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
|
|
28
|
+
const result = [];
|
|
29
|
+
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
30
|
+
const element = elements[i];
|
|
31
|
+
result.push(...$a52235d12ccf9c88$var$unwrapping_helper(element));
|
|
32
|
+
}
|
|
33
|
+
else if (typeof elements == "function") result.push(...$a52235d12ccf9c88$var$unwrapping_helper(elements()));
|
|
34
|
+
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
47
|
+
class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
|
|
48
|
+
}
|
|
49
|
+
class $4fd48cb976bf1789$export$aa14a9f43128f61f extends $4fd48cb976bf1789$export$e1d52e4f0c7557a1 {
|
|
50
|
+
constructor(templateError){
|
|
51
|
+
super("Uncaught error in product card template", {
|
|
52
|
+
cause: templateError
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const $b7436a6d1fd64e3b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2);
|
|
59
|
+
function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
60
|
+
return (0, $gco9i$ErrorBoundary)({
|
|
61
|
+
fallback (err, retry) {
|
|
62
|
+
const { message_: message_ , severity_: severity_ } = props;
|
|
63
|
+
let message = message_;
|
|
64
|
+
if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
|
|
65
|
+
console.error(err.cause);
|
|
66
|
+
message = `${message}: ${err.message}`;
|
|
67
|
+
} else (0, $gco9i$report)([
|
|
68
|
+
err,
|
|
69
|
+
message_
|
|
70
|
+
], severity_);
|
|
71
|
+
props.on_error_?.(retry);
|
|
72
|
+
return (()=>{
|
|
73
|
+
const _el$ = (0, $gco9i$getNextElement)($b7436a6d1fd64e3b$var$_tmpl$);
|
|
74
|
+
(0, $gco9i$insert)(_el$, message);
|
|
75
|
+
(0, $gco9i$effect)((_$p)=>(0, $gco9i$classList)(_el$, Object.fromEntries(props.class_list_?.map((c)=>[
|
|
76
|
+
c,
|
|
77
|
+
true
|
|
78
|
+
]) || []), _$p));
|
|
79
|
+
return _el$;
|
|
80
|
+
})();
|
|
81
|
+
},
|
|
82
|
+
get children () {
|
|
83
|
+
return props.children;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
const $c8d5ff4524619fcd$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2), $c8d5ff4524619fcd$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<style type="text/css"></style>`, 2);
|
|
90
|
+
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
91
|
+
return (0, $gco9i$createComponent)((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
92
|
+
get message_ () {
|
|
93
|
+
return "Failed calculating " + props.layout + " layout";
|
|
94
|
+
},
|
|
95
|
+
severity_: "error",
|
|
96
|
+
get children () {
|
|
97
|
+
return $c8d5ff4524619fcd$var$ActualSolidLayout(props);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
102
|
+
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
103
|
+
const show_all_rows = (0, $gco9i$createMemo)(()=>props.rows === "all");
|
|
104
|
+
const rows_or_empty_object = (0, $gco9i$createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
105
|
+
const button_elements = (0, $a52235d12ccf9c88$export$2f0cbfbb4354bb52)((0, $gco9i$createMemo)(()=>rows_or_empty_object().button));
|
|
106
|
+
const have_a_button = (0, $gco9i$createMemo)(()=>{
|
|
107
|
+
const button = button_elements();
|
|
108
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
109
|
+
});
|
|
110
|
+
const [get_styling, set_styling] = (0, $gco9i$createSignal)();
|
|
111
|
+
const container_class = (0, $gco9i$make_random_classname)();
|
|
112
|
+
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
113
|
+
const container_element = (()=>{
|
|
114
|
+
const _el$ = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
115
|
+
(0, $gco9i$spread)(_el$, (0, $gco9i$mergeProps)(()=>props.element_attributes), false, true);
|
|
116
|
+
(0, $gco9i$insert)(_el$, ()=>props.children);
|
|
117
|
+
(0, $gco9i$runHydrationEvents)();
|
|
118
|
+
return _el$;
|
|
119
|
+
})();
|
|
120
|
+
const [get_children_count, set_children_count] = (0, $gco9i$createSignal)(0);
|
|
121
|
+
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
122
|
+
const col_styling = (0, $gco9i$createMemo)(()=>(0, $gco9i$n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
123
|
+
const default_currently_visible_signal = (0, $gco9i$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
|
|
124
|
+
const rows_visible_signal = (0, $gco9i$createMemo)(()=>rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
125
|
+
const get_rows_visible = (0, $gco9i$createMemo)(()=>rows_visible_signal()[0]());
|
|
126
|
+
const set_rows_visible = (0, $gco9i$createMemo)(()=>rows_visible_signal()[1]);
|
|
127
|
+
const button_class = (0, $gco9i$make_random_classname)();
|
|
128
|
+
const button_container = (0, $gco9i$createMemo)(()=>have_a_button() && (()=>{
|
|
129
|
+
const _el$2 = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
130
|
+
(0, $gco9i$addEventListener)(_el$2, "click", (0, $gco9i$catchify)(()=>set_rows_visible()((prev)=>prev + (rows_or_empty_object().rows_per_click ?? 1))), true);
|
|
131
|
+
(0, $gco9i$className)(_el$2, "load-more-container " + button_class);
|
|
132
|
+
(0, $gco9i$insert)(_el$2, ()=>rows_or_empty_object().button);
|
|
133
|
+
(0, $gco9i$runHydrationEvents)();
|
|
134
|
+
return _el$2;
|
|
135
|
+
})());
|
|
136
|
+
container_element.classList.add(container_class);
|
|
137
|
+
(0, $gco9i$createComputed)(()=>{
|
|
138
|
+
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
139
|
+
const rows_visible = get_rows_visible();
|
|
140
|
+
const max_rows = rows_or_empty_object().max_rows;
|
|
141
|
+
if (!isNaN(max_rows) && max_rows >= 0 && rows_visible > max_rows) set_rows_visible()(max_rows);
|
|
142
|
+
});
|
|
143
|
+
(0, $gco9i$createRenderEffect)(()=>{
|
|
144
|
+
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
145
|
+
if (show_all_rows()) {
|
|
146
|
+
// no view more functionality requested
|
|
147
|
+
set_styling(()=>col_styling);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
(0, $gco9i$untrack)(()=>set_rows_visible()(rows_or_empty_object().start_rows ?? 1));
|
|
151
|
+
update_children_count();
|
|
152
|
+
const mutation_observer = new MutationObserver((0, $gco9i$catchify)(update_children_count));
|
|
153
|
+
mutation_observer.observe(container_element, {
|
|
154
|
+
childList: true
|
|
155
|
+
});
|
|
156
|
+
(0, $gco9i$onCleanup)(()=>mutation_observer.disconnect());
|
|
157
|
+
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
158
|
+
()=>(0, $gco9i$createMemo)(()=>{
|
|
159
|
+
const { rows_per_click: rows_per_click , max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
160
|
+
const rows_visible = get_rows_visible();
|
|
161
|
+
const children_count = get_children_count();
|
|
162
|
+
return col_styling() + props.cols_at_size.map((options)=>{
|
|
163
|
+
const [, min, max] = options;
|
|
164
|
+
let should_hide_button;
|
|
165
|
+
let visible_recs;
|
|
166
|
+
if (props.disable_partial_rows) {
|
|
167
|
+
visible_recs = (0, $gco9i$layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
|
|
168
|
+
const visible_recs_next_show_more = (0, $gco9i$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?
|
|
169
|
+
children_count, options);
|
|
170
|
+
should_hide_button = visible_recs === visible_recs_next_show_more;
|
|
171
|
+
} else {
|
|
172
|
+
visible_recs = (0, $gco9i$layout_get_total_rec_amount_for_row)(rows_visible, options);
|
|
173
|
+
should_hide_button = visible_recs >= children_count;
|
|
174
|
+
}
|
|
175
|
+
const should_hide_button_final = button_class && (should_hide_button || max_rows !== -1 && rows_visible >= max_rows);
|
|
176
|
+
return `${(0, $gco9i$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}` : ``}}`;
|
|
177
|
+
}).join("");
|
|
178
|
+
}));
|
|
179
|
+
});
|
|
180
|
+
return [
|
|
181
|
+
container_element,
|
|
182
|
+
(0, $gco9i$memo)(button_container),
|
|
183
|
+
(()=>{
|
|
184
|
+
const _el$3 = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$2);
|
|
185
|
+
(0, $gco9i$insert)(_el$3, get_styling);
|
|
186
|
+
return _el$3;
|
|
187
|
+
})()
|
|
188
|
+
];
|
|
189
|
+
}
|
|
190
|
+
(0, $gco9i$delegateEvents)([
|
|
191
|
+
"click"
|
|
192
|
+
]);
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
11
197
|
async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_opts) {
|
|
12
198
|
const body = await (0, $gco9i$observer).wait_for_element("body");
|
|
13
199
|
let dispose_and_remove;
|
|
@@ -669,8 +855,6 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
669
855
|
|
|
670
856
|
|
|
671
857
|
|
|
672
|
-
|
|
673
|
-
|
|
674
858
|
|
|
675
859
|
|
|
676
860
|
|
|
@@ -907,71 +1091,6 @@ function $a458486f22b22f63$export$a2cc176055f8f08() {
|
|
|
907
1091
|
|
|
908
1092
|
|
|
909
1093
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
914
|
-
class $4fd48cb976bf1789$export$e1d52e4f0c7557a1 extends Error {
|
|
915
|
-
}
|
|
916
|
-
class $4fd48cb976bf1789$export$aa14a9f43128f61f extends $4fd48cb976bf1789$export$e1d52e4f0c7557a1 {
|
|
917
|
-
constructor(templateError){
|
|
918
|
-
super("Uncaught error in product card template", {
|
|
919
|
-
cause: templateError
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
const $b7436a6d1fd64e3b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div></div>`, 2);
|
|
926
|
-
function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
927
|
-
return (0, $gco9i$ErrorBoundary)({
|
|
928
|
-
fallback (err, retry) {
|
|
929
|
-
const { message_: message_ , severity_: severity_ } = props;
|
|
930
|
-
let message = message_;
|
|
931
|
-
if (err instanceof (0, $4fd48cb976bf1789$export$aa14a9f43128f61f)) {
|
|
932
|
-
console.error(err.cause);
|
|
933
|
-
message = `${message}: ${err.message}`;
|
|
934
|
-
} else (0, $gco9i$report)([
|
|
935
|
-
err,
|
|
936
|
-
message_
|
|
937
|
-
], severity_);
|
|
938
|
-
props.on_error_?.(retry);
|
|
939
|
-
return (()=>{
|
|
940
|
-
const _el$ = (0, $gco9i$getNextElement)($b7436a6d1fd64e3b$var$_tmpl$);
|
|
941
|
-
(0, $gco9i$insert)(_el$, message);
|
|
942
|
-
(0, $gco9i$effect)((_$p)=>(0, $gco9i$classList)(_el$, Object.fromEntries(props.class_list_?.map((c)=>[
|
|
943
|
-
c,
|
|
944
|
-
true
|
|
945
|
-
]) || []), _$p));
|
|
946
|
-
return _el$;
|
|
947
|
-
})();
|
|
948
|
-
},
|
|
949
|
-
get children () {
|
|
950
|
-
return props.children;
|
|
951
|
-
}
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
function $a52235d12ccf9c88$export$2f0cbfbb4354bb52(elements) {
|
|
959
|
-
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
960
|
-
return (0, $gco9i$createMemo)(()=>$a52235d12ccf9c88$var$unwrapping_helper(elements));
|
|
961
|
-
}
|
|
962
|
-
function $a52235d12ccf9c88$var$unwrapping_helper(elements) {
|
|
963
|
-
const result = [];
|
|
964
|
-
if (Array.isArray(elements)) for(let i = 0; i < elements.length; i++){
|
|
965
|
-
const element = elements[i];
|
|
966
|
-
result.push(...$a52235d12ccf9c88$var$unwrapping_helper(element));
|
|
967
|
-
}
|
|
968
|
-
else if (typeof elements == "function") result.push(...$a52235d12ccf9c88$var$unwrapping_helper(elements()));
|
|
969
|
-
else if (elements != undefined && typeof elements != "boolean") result.push(elements);
|
|
970
|
-
return result;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
1094
|
let $6e41f1fde994db72$var$cached_placeholder_element;
|
|
976
1095
|
let $6e41f1fde994db72$var$rendering_cached_placeholder_element;
|
|
977
1096
|
function $6e41f1fde994db72$export$f33414a4df0afd3f({ product_card_template_: product_card_template_ , num_placeholders_: num_placeholders_ }) {
|
|
@@ -1285,7 +1404,8 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
1285
1404
|
}
|
|
1286
1405
|
|
|
1287
1406
|
|
|
1288
|
-
|
|
1407
|
+
|
|
1408
|
+
const $2d25e42846eac370$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="PLP-results"><!#><!/><!#><!/></div>`, 6);
|
|
1289
1409
|
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_ }) {
|
|
1290
1410
|
// 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
|
|
1291
1411
|
const is_loading_ = (0, $gco9i$createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
@@ -1328,9 +1448,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1328
1448
|
let suspense_contents;
|
|
1329
1449
|
let is_just_after_plp_results_update = false;
|
|
1330
1450
|
let fallback_is_alive = false;
|
|
1331
|
-
const random_id = (0, $gco9i$make_random_classname)();
|
|
1332
|
-
const selector_beginning_ = `.depict.plp #${random_id}>`;
|
|
1333
|
-
const [get_styling, set_styling_] = (0, $gco9i$createSignal)("");
|
|
1334
1451
|
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $gco9i$createSignal)(true);
|
|
1335
1452
|
const rendered_placeholders = (0, $gco9i$createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
1336
1453
|
product_card_template_: product_card_template_,
|
|
@@ -1340,64 +1457,22 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1340
1457
|
})
|
|
1341
1458
|
}) : undefined);
|
|
1342
1459
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $gco9i$createSignal)(false);
|
|
1460
|
+
const modified_cols_at_size = $2d25e42846eac370$var$make_modified_cols_at_size({
|
|
1461
|
+
layout_options_: layout_options_,
|
|
1462
|
+
sort_or_filter_open_: sort_or_filter_open_
|
|
1463
|
+
});
|
|
1343
1464
|
(0, $gco9i$createComputed)(()=>{
|
|
1344
1465
|
if (!is_loading_()) return;
|
|
1345
1466
|
set_should_have_placeholders_rendered(true);
|
|
1346
1467
|
set_suspense_is_blocked(false);
|
|
1347
1468
|
is_just_after_plp_results_update = true;
|
|
1348
1469
|
});
|
|
1349
|
-
$2d25e42846eac370$var$results_grid_styling_generator({
|
|
1350
|
-
layout_options_: layout_options_,
|
|
1351
|
-
set_styling_: set_styling_,
|
|
1352
|
-
sort_or_filter_open_: sort_or_filter_open_,
|
|
1353
|
-
selector_beginning_: selector_beginning_
|
|
1354
|
-
});
|
|
1355
|
-
const has_at_least_one_display = (0, $gco9i$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
|
|
1356
1470
|
const block_suspense_if_needed = ()=>{
|
|
1357
1471
|
if (!is_just_after_plp_results_update) return;
|
|
1358
1472
|
is_just_after_plp_results_update = false;
|
|
1359
1473
|
fallback_is_alive = false;
|
|
1360
1474
|
set_suspense_is_blocked(true);
|
|
1361
1475
|
};
|
|
1362
|
-
const non_placeholder_product_cards = (0, $gco9i$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)
|
|
1363
|
-
// We're creating it outside the <Show> so that we can benefit from <For>'s optimisation between changing results
|
|
1364
|
-
// (For the whole idea of the displays being cached to work we can't tear down and re-run ProductCards for every new result.
|
|
1365
|
-
// We have to keep ProductCards alive, but hidden, and feed them new data as soon as we had it)
|
|
1366
|
-
(0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
1367
|
-
get fallback () {
|
|
1368
|
-
return (()=>{
|
|
1369
|
-
fallback_is_alive = true;
|
|
1370
|
-
(0, $gco9i$onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1371
|
-
return (0, $gco9i$createMemo)(()=>{
|
|
1372
|
-
// 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
|
|
1373
|
-
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1374
|
-
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1375
|
-
set_should_have_placeholders_rendered(true); // just in case
|
|
1376
|
-
(0, $gco9i$onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1377
|
-
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>
|
|
1378
|
-
});
|
|
1379
|
-
})();
|
|
1380
|
-
},
|
|
1381
|
-
get children () {
|
|
1382
|
-
return (()=>{
|
|
1383
|
-
suspense_contents = (0, $0449e7d49398c077$export$a1fd619a4743ca08)({
|
|
1384
|
-
product_card_template_: product_card_template_,
|
|
1385
|
-
plp_results_: plp_results_,
|
|
1386
|
-
last_result_in_viewport_: last_result_in_viewport_,
|
|
1387
|
-
first_result_in_viewport_: first_result_in_viewport_,
|
|
1388
|
-
market_: market_,
|
|
1389
|
-
merchant_: merchant_,
|
|
1390
|
-
all_products_loaded_: all_products_loaded_,
|
|
1391
|
-
min_products_to_fetch_: min_products_to_fetch_,
|
|
1392
|
-
query_base_: query_base_,
|
|
1393
|
-
depict_api_: depict_api_,
|
|
1394
|
-
is_loading_: is_loading_
|
|
1395
|
-
});
|
|
1396
|
-
(0, $gco9i$onCleanup)(()=>suspense_contents = undefined);
|
|
1397
|
-
return suspense_contents;
|
|
1398
|
-
})();
|
|
1399
|
-
}
|
|
1400
|
-
}));
|
|
1401
1476
|
(0, $gco9i$createEffect)((0, $gco9i$on)(plp_results_, ()=>{
|
|
1402
1477
|
if (!fallback_is_alive) {
|
|
1403
1478
|
// 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
|
|
@@ -1409,27 +1484,69 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1409
1484
|
}));
|
|
1410
1485
|
return [
|
|
1411
1486
|
(0, $gco9i$memo)((0, $a458486f22b22f63$export$a2cc176055f8f08)),
|
|
1412
|
-
(()
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1487
|
+
(0, $gco9i$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
|
|
1488
|
+
get cols_at_size () {
|
|
1489
|
+
return modified_cols_at_size();
|
|
1490
|
+
},
|
|
1491
|
+
get override_vertical_spacing () {
|
|
1492
|
+
return layout_options_().override_vertical_spacing;
|
|
1493
|
+
},
|
|
1494
|
+
get grid_spacing () {
|
|
1495
|
+
return layout_options_().grid_spacing;
|
|
1496
|
+
},
|
|
1497
|
+
rows: "all",
|
|
1498
|
+
layout: "grid",
|
|
1499
|
+
element_attributes: {
|
|
1500
|
+
class: "cards"
|
|
1501
|
+
},
|
|
1502
|
+
get children () {
|
|
1503
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
1504
|
+
get when () {
|
|
1505
|
+
return !is_loading_();
|
|
1506
|
+
},
|
|
1507
|
+
get fallback () {
|
|
1508
|
+
return rendered_placeholders();
|
|
1509
|
+
},
|
|
1510
|
+
get children () {
|
|
1511
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
1512
|
+
get fallback () {
|
|
1513
|
+
return (()=>{
|
|
1514
|
+
fallback_is_alive = true;
|
|
1515
|
+
(0, $gco9i$onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1516
|
+
return (0, $gco9i$createMemo)(()=>{
|
|
1517
|
+
// 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
|
|
1518
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1519
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1520
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
1521
|
+
(0, $gco9i$onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1522
|
+
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>
|
|
1523
|
+
});
|
|
1524
|
+
})();
|
|
1525
|
+
},
|
|
1526
|
+
get children () {
|
|
1527
|
+
return (()=>{
|
|
1528
|
+
suspense_contents = (0, $0449e7d49398c077$export$a1fd619a4743ca08)({
|
|
1529
|
+
product_card_template_: product_card_template_,
|
|
1530
|
+
plp_results_: plp_results_,
|
|
1531
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
1532
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
1533
|
+
market_: market_,
|
|
1534
|
+
merchant_: merchant_,
|
|
1535
|
+
all_products_loaded_: all_products_loaded_,
|
|
1536
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
1537
|
+
query_base_: query_base_,
|
|
1538
|
+
depict_api_: depict_api_,
|
|
1539
|
+
is_loading_: is_loading_
|
|
1540
|
+
});
|
|
1541
|
+
(0, $gco9i$onCleanup)(()=>suspense_contents = undefined);
|
|
1542
|
+
return suspense_contents;
|
|
1543
|
+
})();
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
})
|
|
1433
1550
|
];
|
|
1434
1551
|
}
|
|
1435
1552
|
});
|
|
@@ -1441,13 +1558,14 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1441
1558
|
})();
|
|
1442
1559
|
}
|
|
1443
1560
|
/**
|
|
1444
|
-
*
|
|
1561
|
+
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
1445
1562
|
* This function is special to the actual PLPResults.
|
|
1446
|
-
*/ function $2d25e42846eac370$var$
|
|
1447
|
-
(0, $gco9i$
|
|
1563
|
+
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
1564
|
+
return (0, $gco9i$createMemo)(()=>{
|
|
1565
|
+
const layout_options = layout_options_();
|
|
1448
1566
|
// Add grid styling that changes when filters get opened/closed
|
|
1449
|
-
const when_filters_closed_cols =
|
|
1450
|
-
|
|
1567
|
+
const when_filters_closed_cols = layout_options.cols_at_size;
|
|
1568
|
+
return sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
|
|
1451
1569
|
const [num_cols_default, , , , override_cols] = row;
|
|
1452
1570
|
const cloned_row = [
|
|
1453
1571
|
...row
|
|
@@ -1463,8 +1581,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1463
1581
|
};
|
|
1464
1582
|
return cloned_row;
|
|
1465
1583
|
}) : when_filters_closed_cols;
|
|
1466
|
-
const css = (0, $gco9i$n_col_styling_with_dist)(selector_beginning_, layout_options_.grid_spacing, cols_at_size, "grid", layout_options_.override_vertical_spacing);
|
|
1467
|
-
set_styling_(css);
|
|
1468
1584
|
});
|
|
1469
1585
|
}
|
|
1470
1586
|
|
|
@@ -6088,15 +6204,19 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
6088
6204
|
});
|
|
6089
6205
|
}
|
|
6090
6206
|
}
|
|
6091
|
-
function $961b5c64bef4662f$export$e2bf8ce7779e827e(
|
|
6207
|
+
function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
6208
|
+
const { depict_category: depict_category , product_card_template: product_card_template , category_title: category_title } = props;
|
|
6092
6209
|
const shared_properties = $961b5c64bef4662f$var$get_shared_properties(depict_category);
|
|
6093
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
6094
|
-
grid_spacing: grid_spacing
|
|
6095
|
-
} : {
|
|
6096
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
6097
|
-
grid_spacing: grid_spacing.horizontal
|
|
6098
|
-
};
|
|
6099
6210
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
6211
|
+
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
6212
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
6213
|
+
return typeof grid_spacing === "string" ? {
|
|
6214
|
+
grid_spacing: grid_spacing
|
|
6215
|
+
} : {
|
|
6216
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
6217
|
+
grid_spacing: grid_spacing.horizontal
|
|
6218
|
+
};
|
|
6219
|
+
});
|
|
6100
6220
|
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;
|
|
6101
6221
|
(0, $gco9i$onCleanup)(reset_history_state_);
|
|
6102
6222
|
return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
|
|
@@ -6108,9 +6228,9 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6108
6228
|
query_id_: ()=>depict_category.category_id,
|
|
6109
6229
|
listing_type_: ()=>depict_category.listing_type,
|
|
6110
6230
|
i18n_: i18n_,
|
|
6111
|
-
show_quicklinks_: show_quicklinks,
|
|
6231
|
+
show_quicklinks_: (0, $gco9i$createMemo)(()=>props.show_quicklinks ?? true),
|
|
6112
6232
|
category_title_: category_title,
|
|
6113
|
-
show_breadcrumbs_: show_breadcrumbs,
|
|
6233
|
+
show_breadcrumbs_: (0, $gco9i$createMemo)(()=>props.show_breadcrumbs ?? true),
|
|
6114
6234
|
current_sorting_: current_sorting_,
|
|
6115
6235
|
router_: router_,
|
|
6116
6236
|
get_breadcrumb_accessor_: (accessor)=>(0, $gco9i$createComputed)(()=>breadcrumb_signal_[1](accessor())),
|
|
@@ -6122,10 +6242,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6122
6242
|
selected_filters_: selected_filters_,
|
|
6123
6243
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
6124
6244
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
6125
|
-
layout_options_: {
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6245
|
+
layout_options_: (0, $gco9i$createMemo)(()=>({
|
|
6246
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
6247
|
+
...grid_spacing_override()
|
|
6248
|
+
})),
|
|
6129
6249
|
product_card_template_: product_card_template
|
|
6130
6250
|
});
|
|
6131
6251
|
}, "Entire CategoryPage failed");
|
|
@@ -6620,80 +6740,74 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6620
6740
|
|
|
6621
6741
|
|
|
6622
6742
|
|
|
6623
|
-
|
|
6743
|
+
|
|
6744
|
+
const $172e1b898d457050$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="search-recs"><h3 class="search-recs-title"></h3><!#><!/><!#><!/></div>`, 8), $172e1b898d457050$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
6624
6745
|
const $172e1b898d457050$export$1c8c715550dc689d = 2;
|
|
6625
6746
|
function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , search_query_base_: search_query_base_ , product_card_template_: product_card_template_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
|
|
6626
6747
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6627
6748
|
const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6628
6749
|
const [recommendations_resource] = (0, $gco9i$createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
6629
6750
|
const is_showing_something = (0, $gco9i$createMemo)(()=>recommendations_resource.loading || recommendations_resource()?.length);
|
|
6630
|
-
const num_placeholders_ = (0, $gco9i$createMemo)(()=>(0, $7747fe1a8c5652e3$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column)));
|
|
6631
|
-
const cards = (()=>{
|
|
6632
|
-
const _el$ = (0, $gco9i$getNextElement)($172e1b898d457050$var$_tmpl$);
|
|
6633
|
-
(0, $gco9i$insert)(_el$, (0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
6634
|
-
get fallback () {
|
|
6635
|
-
return (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
6636
|
-
num_placeholders_: num_placeholders_,
|
|
6637
|
-
product_card_template_: product_card_template_
|
|
6638
|
-
});
|
|
6639
|
-
},
|
|
6640
|
-
get children () {
|
|
6641
|
-
return (()=>{
|
|
6642
|
-
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6643
|
-
const displays_by_key_ = (0, $29ec7cddbe1d3484$export$7f8bd308237ab5a5)((0, $gco9i$createMemo)(()=>recommendations_resource() || []));
|
|
6644
|
-
return (0, $29ec7cddbe1d3484$export$43f0fb951fcb0c54)({
|
|
6645
|
-
displays_by_key_: displays_by_key_,
|
|
6646
|
-
merchant_: (0, $gco9i$createMemo)(()=>search_query_base_().tenant),
|
|
6647
|
-
market_: (0, $gco9i$createMemo)(()=>search_query_base_().market),
|
|
6648
|
-
product_card_template_: product_card_template_
|
|
6649
|
-
});
|
|
6650
|
-
})();
|
|
6651
|
-
}
|
|
6652
|
-
}));
|
|
6653
|
-
return _el$;
|
|
6654
|
-
})();
|
|
6655
|
-
const search_recs_elements = (()=>{
|
|
6656
|
-
const _el$2 = (0, $gco9i$getNextElement)($172e1b898d457050$var$_tmpl$2), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, [_el$5, _co$] = (0, $gco9i$getNextMarker)(_el$4.nextSibling), _el$6 = _el$5.nextSibling, [_el$7, _co$2] = (0, $gco9i$getNextMarker)(_el$6.nextSibling);
|
|
6657
|
-
(0, $gco9i$insert)(_el$3, ()=>i18n_.search_recs_title_());
|
|
6658
|
-
(0, $gco9i$insert)(_el$2, (0, $a458486f22b22f63$export$a2cc176055f8f08), _el$5, _co$);
|
|
6659
|
-
(0, $gco9i$insert)(_el$2, cards, _el$7, _co$2);
|
|
6660
|
-
return _el$2;
|
|
6661
|
-
})();
|
|
6662
|
-
// the cards element must have a parent for Layout to work, therefore we're inserting it into a div above
|
|
6663
|
-
(0, $gco9i$Layout)({
|
|
6664
|
-
container_element: cards,
|
|
6665
|
-
layout: "grid",
|
|
6666
|
-
rows: rows_object,
|
|
6667
|
-
...layout_options_
|
|
6668
|
-
}).catch((e)=>(0, $gco9i$report)([
|
|
6669
|
-
e,
|
|
6670
|
-
"Layout failed"
|
|
6671
|
-
], "error"));
|
|
6751
|
+
const num_placeholders_ = (0, $gco9i$createMemo)(()=>(0, $7747fe1a8c5652e3$export$6c9030e511152266) + get_showing_recommendation_rows() * Math.max(...layout_options_().cols_at_size.map(([per_column])=>per_column)));
|
|
6672
6752
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
6673
6753
|
get when () {
|
|
6674
6754
|
return is_showing_something();
|
|
6675
6755
|
},
|
|
6676
|
-
children
|
|
6756
|
+
get children () {
|
|
6757
|
+
const _el$ = (0, $gco9i$getNextElement)($172e1b898d457050$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, [_el$4, _co$] = (0, $gco9i$getNextMarker)(_el$3.nextSibling), _el$5 = _el$4.nextSibling, [_el$6, _co$2] = (0, $gco9i$getNextMarker)(_el$5.nextSibling);
|
|
6758
|
+
(0, $gco9i$insert)(_el$2, ()=>i18n_.search_recs_title_());
|
|
6759
|
+
(0, $gco9i$insert)(_el$, (0, $a458486f22b22f63$export$a2cc176055f8f08), _el$4, _co$);
|
|
6760
|
+
(0, $gco9i$insert)(_el$, (0, $gco9i$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), (0, $gco9i$mergeProps)({
|
|
6761
|
+
rows: rows_object,
|
|
6762
|
+
layout: "grid",
|
|
6763
|
+
element_attributes: {
|
|
6764
|
+
class: "cards"
|
|
6765
|
+
}
|
|
6766
|
+
}, layout_options_, {
|
|
6767
|
+
get children () {
|
|
6768
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
6769
|
+
get fallback () {
|
|
6770
|
+
return (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
6771
|
+
num_placeholders_: num_placeholders_,
|
|
6772
|
+
product_card_template_: product_card_template_
|
|
6773
|
+
});
|
|
6774
|
+
},
|
|
6775
|
+
get children () {
|
|
6776
|
+
return (()=>{
|
|
6777
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6778
|
+
const displays_by_key_ = (0, $29ec7cddbe1d3484$export$7f8bd308237ab5a5)((0, $gco9i$createMemo)(()=>recommendations_resource() || []));
|
|
6779
|
+
return (0, $29ec7cddbe1d3484$export$43f0fb951fcb0c54)({
|
|
6780
|
+
displays_by_key_: displays_by_key_,
|
|
6781
|
+
merchant_: (0, $gco9i$createMemo)(()=>search_query_base_().tenant),
|
|
6782
|
+
market_: (0, $gco9i$createMemo)(()=>search_query_base_().market),
|
|
6783
|
+
product_card_template_: product_card_template_
|
|
6784
|
+
});
|
|
6785
|
+
})();
|
|
6786
|
+
}
|
|
6787
|
+
});
|
|
6788
|
+
}
|
|
6789
|
+
})), _el$6, _co$2);
|
|
6790
|
+
return _el$;
|
|
6791
|
+
}
|
|
6677
6792
|
});
|
|
6678
6793
|
}
|
|
6679
6794
|
function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
6680
|
-
const
|
|
6795
|
+
const currently_visible = (0, $gco9i$createSignal)(0); // this number shouldn't matter for anything except typing
|
|
6796
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
6681
6797
|
const rows = {
|
|
6682
|
-
|
|
6798
|
+
currently_visible: currently_visible,
|
|
6683
6799
|
start_rows: (0, $gco9i$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
|
|
6684
6800
|
rows_per_click: 3,
|
|
6685
6801
|
button: (()=>{
|
|
6686
|
-
const _el$
|
|
6687
|
-
(0, $gco9i$insert)(_el$
|
|
6688
|
-
return _el$
|
|
6802
|
+
const _el$7 = (0, $gco9i$getNextElement)($172e1b898d457050$var$_tmpl$2);
|
|
6803
|
+
(0, $gco9i$insert)(_el$7, ()=>i18n_.view_more_());
|
|
6804
|
+
return _el$7;
|
|
6689
6805
|
})()
|
|
6690
6806
|
};
|
|
6691
|
-
(0, $gco9i$
|
|
6692
|
-
|
|
6693
|
-
})
|
|
6694
|
-
(0, $gco9i$createComputed)((0, $gco9i$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>{
|
|
6695
|
-
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
6696
|
-
}, {
|
|
6807
|
+
(0, $gco9i$createComputed)((0, $gco9i$on)(get_currently_visible, (new_visible)=>set_showing_recommendation_rows(new_visible), {
|
|
6808
|
+
defer: true
|
|
6809
|
+
}));
|
|
6810
|
+
(0, $gco9i$createComputed)((0, $gco9i$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>set_currently_visible(new_rows), {
|
|
6697
6811
|
defer: true
|
|
6698
6812
|
}));
|
|
6699
6813
|
return rows;
|
|
@@ -8146,7 +8260,7 @@ function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_
|
|
|
8146
8260
|
|
|
8147
8261
|
|
|
8148
8262
|
const $7097477c78a89208$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $7097477c78a89208$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
8149
|
-
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_
|
|
8263
|
+
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_ }) {
|
|
8150
8264
|
const [get_sorting] = current_sorting_;
|
|
8151
8265
|
const all_products_loaded_ = (0, $gco9i$createSignal)(false);
|
|
8152
8266
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8394,7 +8508,9 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8394
8508
|
depict_api_: depict_api_,
|
|
8395
8509
|
i18n_: i18n_,
|
|
8396
8510
|
search_query_base_: search_query_base_,
|
|
8397
|
-
layout_options_
|
|
8511
|
+
get layout_options_ () {
|
|
8512
|
+
return (0, $gco9i$createMemo)(()=>recommendations_layout_options_?.() ?? layout_options_());
|
|
8513
|
+
},
|
|
8398
8514
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8399
8515
|
view_more_button_: search_recs_view_more_,
|
|
8400
8516
|
product_card_template_: product_card_template_
|
|
@@ -8684,16 +8800,19 @@ function $806c97b931758897$var$get_shared_properties(depict_search) {
|
|
|
8684
8800
|
return shared_properties;
|
|
8685
8801
|
}
|
|
8686
8802
|
function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
8687
|
-
const { depict_search: depict_search ,
|
|
8803
|
+
const { depict_search: depict_search , product_card_template: product_card_template } = props;
|
|
8688
8804
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
8689
|
-
const grid_spacing_override = typeof grid_spacing === "string" ? {
|
|
8690
|
-
grid_spacing: grid_spacing
|
|
8691
|
-
} : {
|
|
8692
|
-
override_vertical_spacing: grid_spacing.vertical,
|
|
8693
|
-
grid_spacing: grid_spacing.horizontal
|
|
8694
|
-
};
|
|
8695
8805
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8696
8806
|
const { state_: state_ } = shared_properties;
|
|
8807
|
+
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
8808
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
8809
|
+
return typeof grid_spacing === "string" ? {
|
|
8810
|
+
grid_spacing: grid_spacing
|
|
8811
|
+
} : {
|
|
8812
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
8813
|
+
grid_spacing: grid_spacing.horizontal
|
|
8814
|
+
};
|
|
8815
|
+
});
|
|
8697
8816
|
(0, $gco9i$onCleanup)(shared_properties.reset_history_state_);
|
|
8698
8817
|
return (0, $7097477c78a89208$export$a54ec244c8863715)({
|
|
8699
8818
|
input_modal_open_: ()=>!!depict_search.modal_open,
|
|
@@ -8739,19 +8858,23 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
8739
8858
|
showing_recommendation_rows_: state_.search_showing_recommendation_rows,
|
|
8740
8859
|
scroll_restoration_data_: state_.search_scroll_restoration_data,
|
|
8741
8860
|
include_input_field_: ()=>props.include_input_field,
|
|
8742
|
-
layout_options_: {
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
recommendations_layout_options_:
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8861
|
+
layout_options_: (0, $gco9i$createMemo)(()=>({
|
|
8862
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
8863
|
+
...grid_spacing_override()
|
|
8864
|
+
})),
|
|
8865
|
+
recommendations_layout_options_: (0, $gco9i$createMemo)(()=>{
|
|
8866
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
8867
|
+
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
8868
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
8869
|
+
...grid_spacing_override()
|
|
8870
|
+
} : undefined;
|
|
8871
|
+
}),
|
|
8750
8872
|
product_card_template_: product_card_template
|
|
8751
8873
|
});
|
|
8752
8874
|
}, "Entire SearchPage failed");
|
|
8753
8875
|
}
|
|
8754
|
-
function $806c97b931758897$export$316f6f283ae64765(
|
|
8876
|
+
function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
8877
|
+
const { depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler } = props;
|
|
8755
8878
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
8756
8879
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8757
8880
|
let input_element;
|
|
@@ -8780,7 +8903,7 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8780
8903
|
input_element.selectionStart,
|
|
8781
8904
|
input_element.selectionEnd
|
|
8782
8905
|
];
|
|
8783
|
-
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, aligner_ref);
|
|
8906
|
+
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
8784
8907
|
const complete_modal_dispose_handler = ()=>{
|
|
8785
8908
|
modal_dispose_handler?.();
|
|
8786
8909
|
cleanup();
|
|
@@ -8808,23 +8931,21 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8808
8931
|
];
|
|
8809
8932
|
}, "SearchField failed");
|
|
8810
8933
|
}
|
|
8811
|
-
function $806c97b931758897$var$align_field_modal(style_props_, input,
|
|
8934
|
+
function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_ref_accessor) {
|
|
8812
8935
|
return (0, $gco9i$createRoot)((dispose)=>{
|
|
8813
|
-
|
|
8936
|
+
(0, $gco9i$createComputed)(()=>{
|
|
8937
|
+
const aligner_ref = aligner_ref_accessor?.();
|
|
8938
|
+
if (!aligner_ref) {
|
|
8939
|
+
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
|
|
8940
|
+
return;
|
|
8941
|
+
}
|
|
8814
8942
|
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(aligner_ref);
|
|
8943
|
+
(0, $gco9i$onCleanup)(cleanup);
|
|
8815
8944
|
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
}
|
|
8821
|
-
};
|
|
8822
|
-
} else {
|
|
8823
|
-
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
|
|
8824
|
-
return {
|
|
8825
|
-
cleanup: dispose
|
|
8826
|
-
};
|
|
8827
|
-
}
|
|
8945
|
+
});
|
|
8946
|
+
return {
|
|
8947
|
+
cleanup: dispose
|
|
8948
|
+
};
|
|
8828
8949
|
});
|
|
8829
8950
|
}
|
|
8830
8951
|
|
|
@@ -9120,4 +9241,4 @@ const $4690a06c8489dcd0$export$7bf543b9d9be2c22 = (0, $e4615ecd1849548f$export$b
|
|
|
9120
9241
|
(0, $gco9i$add_to_version_info)("ui", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
9121
9242
|
|
|
9122
9243
|
|
|
9123
|
-
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};
|
|
9244
|
+
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};
|