@depict-ai/ui 1.3.2 → 1.3.3
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 +293 -182
- package/dist/client/module.js +296 -185
- package/dist/index.d.ts +3 -3
- package/dist/server/main.cjs +265 -169
- package/dist/server/module.js +267 -171
- package/package.json +4 -4
package/dist/client/module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {add_to_version_info as $gco9i$add_to_version_info, observer as $gco9i$observer, catchify as $gco9i$catchify, 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, report as $gco9i$report, javascript_media_query as $gco9i$javascript_media_query, standard_price_format as $gco9i$standard_price_format, make_random_classname as $gco9i$make_random_classname, n_col_styling_with_dist as $gco9i$n_col_styling_with_dist, 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,
|
|
2
|
-
import {createRoot as $gco9i$createRoot, createSignal as $gco9i$createSignal, getOwner as $gco9i$getOwner, runWithOwner as $gco9i$runWithOwner, onCleanup as $gco9i$onCleanup, createComputed as $gco9i$createComputed, createRenderEffect as $gco9i$createRenderEffect, createEffect as $gco9i$createEffect, untrack as $gco9i$untrack, batch as $gco9i$batch, createResource as $gco9i$createResource,
|
|
3
|
-
import {template as $gco9i$template, getNextElement as $gco9i$getNextElement, spread as $gco9i$spread, mergeProps as $gco9i$mergeProps, runHydrationEvents as $gco9i$runHydrationEvents, effect as $gco9i$effect, setAttribute as $gco9i$setAttribute, insert as $gco9i$insert, isServer as $gco9i$isServer, createComponent as $gco9i$createComponent, getNextMarker as $gco9i$getNextMarker, use as $gco9i$use, memo as $gco9i$memo, addEventListener as $gco9i$addEventListener, delegateEvents as $gco9i$delegateEvents, classList as $gco9i$classList,
|
|
1
|
+
import {add_to_version_info as $gco9i$add_to_version_info, observer as $gco9i$observer, catchify as $gco9i$catchify, 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, report as $gco9i$report, javascript_media_query as $gco9i$javascript_media_query, standard_price_format as $gco9i$standard_price_format, make_random_classname as $gco9i$make_random_classname, n_col_styling_with_dist as $gco9i$n_col_styling_with_dist, 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, 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 {createRoot as $gco9i$createRoot, createSignal as $gco9i$createSignal, getOwner as $gco9i$getOwner, runWithOwner as $gco9i$runWithOwner, createMemo as $gco9i$createMemo, onCleanup as $gco9i$onCleanup, createComputed as $gco9i$createComputed, createRenderEffect as $gco9i$createRenderEffect, createEffect as $gco9i$createEffect, untrack as $gco9i$untrack, batch as $gco9i$batch, createResource as $gco9i$createResource, Show as $gco9i$Show, createReaction as $gco9i$createReaction, on as $gco9i$on, Suspense as $gco9i$Suspense, ErrorBoundary as $gco9i$ErrorBoundary, For as $gco9i$For, Index as $gco9i$Index} from "solid-js";
|
|
3
|
+
import {template as $gco9i$template, getNextElement as $gco9i$getNextElement, spread as $gco9i$spread, mergeProps as $gco9i$mergeProps, runHydrationEvents as $gco9i$runHydrationEvents, effect as $gco9i$effect, setAttribute as $gco9i$setAttribute, insert as $gco9i$insert, isServer as $gco9i$isServer, createComponent as $gco9i$createComponent, getNextMarker as $gco9i$getNextMarker, use as $gco9i$use, memo as $gco9i$memo, addEventListener as $gco9i$addEventListener, delegateEvents as $gco9i$delegateEvents, classList as $gco9i$classList, className as $gco9i$className, style as $gco9i$style, Dynamic as $gco9i$Dynamic} from "solid-js/web";
|
|
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.3";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -669,8 +669,6 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
669
669
|
|
|
670
670
|
|
|
671
671
|
|
|
672
|
-
|
|
673
|
-
|
|
674
672
|
|
|
675
673
|
|
|
676
674
|
|
|
@@ -1285,7 +1283,119 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
1285
1283
|
}
|
|
1286
1284
|
|
|
1287
1285
|
|
|
1288
|
-
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
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);
|
|
1302
|
+
function $c8d5ff4524619fcd$export$d21e32dfedac04be(props) {
|
|
1303
|
+
return (0, $gco9i$createComponent)((0, $b7436a6d1fd64e3b$export$b69d0d92862de18b), {
|
|
1304
|
+
get message_ () {
|
|
1305
|
+
return "Failed calculating " + props.layout + " layout";
|
|
1306
|
+
},
|
|
1307
|
+
severity_: "error",
|
|
1308
|
+
get children () {
|
|
1309
|
+
return $c8d5ff4524619fcd$var$ActualSolidLayout(props);
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
function $c8d5ff4524619fcd$var$ActualSolidLayout(props) {
|
|
1314
|
+
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
1315
|
+
const show_all_rows = (0, $gco9i$createMemo)(()=>props.rows === "all");
|
|
1316
|
+
const rows_or_empty_object = (0, $gco9i$createMemo)(()=>show_all_rows() ? {} : props.rows);
|
|
1317
|
+
const button_elements = (0, $a52235d12ccf9c88$export$2f0cbfbb4354bb52)((0, $gco9i$createMemo)(()=>rows_or_empty_object().button));
|
|
1318
|
+
const have_a_button = (0, $gco9i$createMemo)(()=>{
|
|
1319
|
+
const button = button_elements();
|
|
1320
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
1321
|
+
});
|
|
1322
|
+
const [get_styling, set_styling] = (0, $gco9i$createSignal)();
|
|
1323
|
+
const container_class = (0, $gco9i$make_random_classname)();
|
|
1324
|
+
const selector_beginning = `.depict .${container_class}>`; // class so ppl can have id if needed
|
|
1325
|
+
const container_element = (()=>{
|
|
1326
|
+
const _el$ = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
1327
|
+
(0, $gco9i$spread)(_el$, (0, $gco9i$mergeProps)(()=>props.element_attributes), false, true);
|
|
1328
|
+
(0, $gco9i$insert)(_el$, ()=>props.children);
|
|
1329
|
+
(0, $gco9i$runHydrationEvents)();
|
|
1330
|
+
return _el$;
|
|
1331
|
+
})();
|
|
1332
|
+
const [get_children_count, set_children_count] = (0, $gco9i$createSignal)(0);
|
|
1333
|
+
const update_children_count = ()=>set_children_count(container_element.children.length);
|
|
1334
|
+
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));
|
|
1335
|
+
const rows_visible_signal = (0, $gco9i$createMemo)(()=>rows_or_empty_object().currently_visible || (0, $gco9i$createSignal)(0));
|
|
1336
|
+
const get_rows_visible = (0, $gco9i$createMemo)(()=>rows_visible_signal()[0]());
|
|
1337
|
+
const set_rows_visible = (0, $gco9i$createMemo)(()=>rows_visible_signal()[1]);
|
|
1338
|
+
const button_class = (0, $gco9i$make_random_classname)();
|
|
1339
|
+
const button_container = (0, $gco9i$createMemo)(()=>have_a_button() && (()=>{
|
|
1340
|
+
const _el$2 = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$);
|
|
1341
|
+
(0, $gco9i$addEventListener)(_el$2, "click", (0, $gco9i$catchify)(()=>set_rows_visible()((prev)=>prev + (rows_or_empty_object().rows_per_click ?? 1))), true);
|
|
1342
|
+
(0, $gco9i$className)(_el$2, "load-more-container " + button_class);
|
|
1343
|
+
(0, $gco9i$insert)(_el$2, ()=>rows_or_empty_object().button);
|
|
1344
|
+
(0, $gco9i$runHydrationEvents)();
|
|
1345
|
+
return _el$2;
|
|
1346
|
+
})());
|
|
1347
|
+
container_element.classList.add(container_class);
|
|
1348
|
+
(0, $gco9i$createRenderEffect)(()=>{
|
|
1349
|
+
// Be careful to only read show_all_rows in here (ofc doesn't apply to nested effects)
|
|
1350
|
+
if (show_all_rows()) {
|
|
1351
|
+
// no view more functionality requested
|
|
1352
|
+
set_styling(()=>col_styling);
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
(0, $gco9i$untrack)(()=>set_rows_visible()(rows_or_empty_object().start_rows ?? 1));
|
|
1356
|
+
update_children_count();
|
|
1357
|
+
const mutation_observer = new MutationObserver((0, $gco9i$catchify)(update_children_count));
|
|
1358
|
+
mutation_observer.observe(container_element, {
|
|
1359
|
+
childList: true
|
|
1360
|
+
});
|
|
1361
|
+
(0, $gco9i$onCleanup)(()=>mutation_observer.disconnect());
|
|
1362
|
+
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
1363
|
+
()=>(0, $gco9i$createMemo)(()=>{
|
|
1364
|
+
const { rows_per_click: rows_per_click , max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
1365
|
+
return col_styling() + props.cols_at_size.map((options)=>{
|
|
1366
|
+
const [, min, max] = options;
|
|
1367
|
+
let should_hide_button;
|
|
1368
|
+
let visible_recs;
|
|
1369
|
+
if (props.disable_partial_rows) {
|
|
1370
|
+
visible_recs = (0, $gco9i$layout_get_visible_recs_without_partial_rows)(get_rows_visible(), get_children_count(), options);
|
|
1371
|
+
const visible_recs_next_show_more = (0, $gco9i$layout_get_visible_recs_without_partial_rows)(get_rows_visible() + (rows_per_click || 0), // Should this really be zero when we default rows_per_click to 1?
|
|
1372
|
+
get_children_count(), options);
|
|
1373
|
+
should_hide_button = visible_recs === visible_recs_next_show_more;
|
|
1374
|
+
} else {
|
|
1375
|
+
visible_recs = (0, $gco9i$layout_get_total_rec_amount_for_row)(get_rows_visible(), options);
|
|
1376
|
+
should_hide_button = visible_recs >= get_children_count();
|
|
1377
|
+
}
|
|
1378
|
+
const should_hide_button_final = button_class && (should_hide_button || max_rows !== -1 && get_rows_visible() >= max_rows);
|
|
1379
|
+
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}` : ``}}`;
|
|
1380
|
+
}).join("");
|
|
1381
|
+
}));
|
|
1382
|
+
});
|
|
1383
|
+
return [
|
|
1384
|
+
container_element,
|
|
1385
|
+
(0, $gco9i$memo)(button_container),
|
|
1386
|
+
(()=>{
|
|
1387
|
+
const _el$3 = (0, $gco9i$getNextElement)($c8d5ff4524619fcd$var$_tmpl$2);
|
|
1388
|
+
(0, $gco9i$insert)(_el$3, get_styling);
|
|
1389
|
+
return _el$3;
|
|
1390
|
+
})()
|
|
1391
|
+
];
|
|
1392
|
+
}
|
|
1393
|
+
(0, $gco9i$delegateEvents)([
|
|
1394
|
+
"click"
|
|
1395
|
+
]);
|
|
1396
|
+
|
|
1397
|
+
|
|
1398
|
+
const $2d25e42846eac370$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$gco9i$template)(`<div class="PLP-results"><!#><!/><!#><!/></div>`, 6);
|
|
1289
1399
|
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
1400
|
// 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
1401
|
const is_loading_ = (0, $gco9i$createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
@@ -1328,9 +1438,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1328
1438
|
let suspense_contents;
|
|
1329
1439
|
let is_just_after_plp_results_update = false;
|
|
1330
1440
|
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
1441
|
const [get_should_have_placeholders_rendered, set_should_have_placeholders_rendered] = (0, $gco9i$createSignal)(true);
|
|
1335
1442
|
const rendered_placeholders = (0, $gco9i$createMemo)(()=>get_should_have_placeholders_rendered() ? (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
1336
1443
|
product_card_template_: product_card_template_,
|
|
@@ -1340,64 +1447,22 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1340
1447
|
})
|
|
1341
1448
|
}) : undefined);
|
|
1342
1449
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $gco9i$createSignal)(false);
|
|
1450
|
+
const modified_cols_at_size = $2d25e42846eac370$var$make_modified_cols_at_size({
|
|
1451
|
+
layout_options_: layout_options_,
|
|
1452
|
+
sort_or_filter_open_: sort_or_filter_open_
|
|
1453
|
+
});
|
|
1343
1454
|
(0, $gco9i$createComputed)(()=>{
|
|
1344
1455
|
if (!is_loading_()) return;
|
|
1345
1456
|
set_should_have_placeholders_rendered(true);
|
|
1346
1457
|
set_suspense_is_blocked(false);
|
|
1347
1458
|
is_just_after_plp_results_update = true;
|
|
1348
1459
|
});
|
|
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
1460
|
const block_suspense_if_needed = ()=>{
|
|
1357
1461
|
if (!is_just_after_plp_results_update) return;
|
|
1358
1462
|
is_just_after_plp_results_update = false;
|
|
1359
1463
|
fallback_is_alive = false;
|
|
1360
1464
|
set_suspense_is_blocked(true);
|
|
1361
1465
|
};
|
|
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
1466
|
(0, $gco9i$createEffect)((0, $gco9i$on)(plp_results_, ()=>{
|
|
1402
1467
|
if (!fallback_is_alive) {
|
|
1403
1468
|
// 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 +1474,69 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1409
1474
|
}));
|
|
1410
1475
|
return [
|
|
1411
1476
|
(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
|
-
|
|
1477
|
+
(0, $gco9i$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), {
|
|
1478
|
+
get cols_at_size () {
|
|
1479
|
+
return modified_cols_at_size();
|
|
1480
|
+
},
|
|
1481
|
+
get override_vertical_spacing () {
|
|
1482
|
+
return layout_options_().override_vertical_spacing;
|
|
1483
|
+
},
|
|
1484
|
+
get grid_spacing () {
|
|
1485
|
+
return layout_options_().grid_spacing;
|
|
1486
|
+
},
|
|
1487
|
+
rows: "all",
|
|
1488
|
+
layout: "grid",
|
|
1489
|
+
element_attributes: {
|
|
1490
|
+
class: "cards"
|
|
1491
|
+
},
|
|
1492
|
+
get children () {
|
|
1493
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
1494
|
+
get when () {
|
|
1495
|
+
return !is_loading_();
|
|
1496
|
+
},
|
|
1497
|
+
get fallback () {
|
|
1498
|
+
return rendered_placeholders();
|
|
1499
|
+
},
|
|
1500
|
+
get children () {
|
|
1501
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
1502
|
+
get fallback () {
|
|
1503
|
+
return (()=>{
|
|
1504
|
+
fallback_is_alive = true;
|
|
1505
|
+
(0, $gco9i$onCleanup)(block_suspense_if_needed); // Block suspense after initial run every time after we fetch
|
|
1506
|
+
return (0, $gco9i$createMemo)(()=>{
|
|
1507
|
+
// 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
|
|
1508
|
+
// In future we could have individual suspense's for each product card, but that's too much for now
|
|
1509
|
+
if (get_suspense_is_blocked()) return suspense_contents;
|
|
1510
|
+
set_should_have_placeholders_rendered(true); // just in case
|
|
1511
|
+
(0, $gco9i$onCleanup)(()=>set_should_have_placeholders_rendered(false));
|
|
1512
|
+
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>
|
|
1513
|
+
});
|
|
1514
|
+
})();
|
|
1515
|
+
},
|
|
1516
|
+
get children () {
|
|
1517
|
+
return (()=>{
|
|
1518
|
+
suspense_contents = (0, $0449e7d49398c077$export$a1fd619a4743ca08)({
|
|
1519
|
+
product_card_template_: product_card_template_,
|
|
1520
|
+
plp_results_: plp_results_,
|
|
1521
|
+
last_result_in_viewport_: last_result_in_viewport_,
|
|
1522
|
+
first_result_in_viewport_: first_result_in_viewport_,
|
|
1523
|
+
market_: market_,
|
|
1524
|
+
merchant_: merchant_,
|
|
1525
|
+
all_products_loaded_: all_products_loaded_,
|
|
1526
|
+
min_products_to_fetch_: min_products_to_fetch_,
|
|
1527
|
+
query_base_: query_base_,
|
|
1528
|
+
depict_api_: depict_api_,
|
|
1529
|
+
is_loading_: is_loading_
|
|
1530
|
+
});
|
|
1531
|
+
(0, $gco9i$onCleanup)(()=>suspense_contents = undefined);
|
|
1532
|
+
return suspense_contents;
|
|
1533
|
+
})();
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
});
|
|
1538
|
+
}
|
|
1539
|
+
})
|
|
1433
1540
|
];
|
|
1434
1541
|
}
|
|
1435
1542
|
});
|
|
@@ -1441,13 +1548,14 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1441
1548
|
})();
|
|
1442
1549
|
}
|
|
1443
1550
|
/**
|
|
1444
|
-
*
|
|
1551
|
+
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
1445
1552
|
* This function is special to the actual PLPResults.
|
|
1446
|
-
*/ function $2d25e42846eac370$var$
|
|
1447
|
-
(0, $gco9i$
|
|
1553
|
+
*/ function $2d25e42846eac370$var$make_modified_cols_at_size({ layout_options_: layout_options_ , sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
1554
|
+
return (0, $gco9i$createMemo)(()=>{
|
|
1555
|
+
const layout_options = layout_options_();
|
|
1448
1556
|
// Add grid styling that changes when filters get opened/closed
|
|
1449
|
-
const when_filters_closed_cols =
|
|
1450
|
-
|
|
1557
|
+
const when_filters_closed_cols = layout_options.cols_at_size;
|
|
1558
|
+
return sort_or_filter_open_() ? when_filters_closed_cols.map((row)=>{
|
|
1451
1559
|
const [num_cols_default, , , , override_cols] = row;
|
|
1452
1560
|
const cloned_row = [
|
|
1453
1561
|
...row
|
|
@@ -1463,8 +1571,6 @@ function $2d25e42846eac370$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
1463
1571
|
};
|
|
1464
1572
|
return cloned_row;
|
|
1465
1573
|
}) : 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
1574
|
});
|
|
1469
1575
|
}
|
|
1470
1576
|
|
|
@@ -6088,15 +6194,19 @@ class $961b5c64bef4662f$export$f34314aa9505732e {
|
|
|
6088
6194
|
});
|
|
6089
6195
|
}
|
|
6090
6196
|
}
|
|
6091
|
-
function $961b5c64bef4662f$export$e2bf8ce7779e827e(
|
|
6197
|
+
function $961b5c64bef4662f$export$e2bf8ce7779e827e(props) {
|
|
6198
|
+
const { depict_category: depict_category , product_card_template: product_card_template , category_title: category_title } = props;
|
|
6092
6199
|
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
6200
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
6201
|
+
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
6202
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
6203
|
+
return typeof grid_spacing === "string" ? {
|
|
6204
|
+
grid_spacing: grid_spacing
|
|
6205
|
+
} : {
|
|
6206
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
6207
|
+
grid_spacing: grid_spacing.horizontal
|
|
6208
|
+
};
|
|
6209
|
+
});
|
|
6100
6210
|
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
6211
|
(0, $gco9i$onCleanup)(reset_history_state_);
|
|
6102
6212
|
return (0, $df5d81d0fe61ff21$export$f7d2f673fc2f091d)({
|
|
@@ -6108,9 +6218,9 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6108
6218
|
query_id_: ()=>depict_category.category_id,
|
|
6109
6219
|
listing_type_: ()=>depict_category.listing_type,
|
|
6110
6220
|
i18n_: i18n_,
|
|
6111
|
-
show_quicklinks_: show_quicklinks,
|
|
6221
|
+
show_quicklinks_: (0, $gco9i$createMemo)(()=>props.show_quicklinks ?? true),
|
|
6112
6222
|
category_title_: category_title,
|
|
6113
|
-
show_breadcrumbs_: show_breadcrumbs,
|
|
6223
|
+
show_breadcrumbs_: (0, $gco9i$createMemo)(()=>props.show_breadcrumbs ?? true),
|
|
6114
6224
|
current_sorting_: current_sorting_,
|
|
6115
6225
|
router_: router_,
|
|
6116
6226
|
get_breadcrumb_accessor_: (accessor)=>(0, $gco9i$createComputed)(()=>breadcrumb_signal_[1](accessor())),
|
|
@@ -6122,10 +6232,10 @@ function $961b5c64bef4662f$export$e2bf8ce7779e827e({ depict_category: depict_cat
|
|
|
6122
6232
|
selected_filters_: selected_filters_,
|
|
6123
6233
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
6124
6234
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
6125
|
-
layout_options_: {
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6235
|
+
layout_options_: (0, $gco9i$createMemo)(()=>({
|
|
6236
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
6237
|
+
...grid_spacing_override()
|
|
6238
|
+
})),
|
|
6129
6239
|
product_card_template_: product_card_template
|
|
6130
6240
|
});
|
|
6131
6241
|
}, "Entire CategoryPage failed");
|
|
@@ -6620,80 +6730,74 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6620
6730
|
|
|
6621
6731
|
|
|
6622
6732
|
|
|
6623
|
-
|
|
6733
|
+
|
|
6734
|
+
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
6735
|
const $172e1b898d457050$export$1c8c715550dc689d = 2;
|
|
6625
6736
|
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
6737
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6627
6738
|
const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6628
6739
|
const [recommendations_resource] = (0, $gco9i$createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
6629
6740
|
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"));
|
|
6741
|
+
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
6742
|
return (0, $gco9i$createComponent)((0, $gco9i$Show), {
|
|
6673
6743
|
get when () {
|
|
6674
6744
|
return is_showing_something();
|
|
6675
6745
|
},
|
|
6676
|
-
children
|
|
6746
|
+
get children () {
|
|
6747
|
+
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);
|
|
6748
|
+
(0, $gco9i$insert)(_el$2, ()=>i18n_.search_recs_title_());
|
|
6749
|
+
(0, $gco9i$insert)(_el$, (0, $a458486f22b22f63$export$a2cc176055f8f08), _el$4, _co$);
|
|
6750
|
+
(0, $gco9i$insert)(_el$, (0, $gco9i$createComponent)((0, $c8d5ff4524619fcd$export$d21e32dfedac04be), (0, $gco9i$mergeProps)({
|
|
6751
|
+
rows: rows_object,
|
|
6752
|
+
layout: "grid",
|
|
6753
|
+
element_attributes: {
|
|
6754
|
+
class: "cards"
|
|
6755
|
+
}
|
|
6756
|
+
}, layout_options_, {
|
|
6757
|
+
get children () {
|
|
6758
|
+
return (0, $gco9i$createComponent)((0, $gco9i$Suspense), {
|
|
6759
|
+
get fallback () {
|
|
6760
|
+
return (0, $6e41f1fde994db72$export$f33414a4df0afd3f)({
|
|
6761
|
+
num_placeholders_: num_placeholders_,
|
|
6762
|
+
product_card_template_: product_card_template_
|
|
6763
|
+
});
|
|
6764
|
+
},
|
|
6765
|
+
get children () {
|
|
6766
|
+
return (()=>{
|
|
6767
|
+
// IIFE to make sure we access both the recommendations_resource and the resources containing the product card rendering results themselves within the Suspense boundary
|
|
6768
|
+
const displays_by_key_ = (0, $29ec7cddbe1d3484$export$7f8bd308237ab5a5)((0, $gco9i$createMemo)(()=>recommendations_resource() || []));
|
|
6769
|
+
return (0, $29ec7cddbe1d3484$export$43f0fb951fcb0c54)({
|
|
6770
|
+
displays_by_key_: displays_by_key_,
|
|
6771
|
+
merchant_: (0, $gco9i$createMemo)(()=>search_query_base_().tenant),
|
|
6772
|
+
market_: (0, $gco9i$createMemo)(()=>search_query_base_().market),
|
|
6773
|
+
product_card_template_: product_card_template_
|
|
6774
|
+
});
|
|
6775
|
+
})();
|
|
6776
|
+
}
|
|
6777
|
+
});
|
|
6778
|
+
}
|
|
6779
|
+
})), _el$6, _co$2);
|
|
6780
|
+
return _el$;
|
|
6781
|
+
}
|
|
6677
6782
|
});
|
|
6678
6783
|
}
|
|
6679
6784
|
function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
6680
|
-
const
|
|
6785
|
+
const currently_visible = (0, $gco9i$createSignal)(0); // this number shouldn't matter for anything except typing
|
|
6786
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
6681
6787
|
const rows = {
|
|
6682
|
-
|
|
6788
|
+
currently_visible: currently_visible,
|
|
6683
6789
|
start_rows: (0, $gco9i$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
|
|
6684
6790
|
rows_per_click: 3,
|
|
6685
6791
|
button: (()=>{
|
|
6686
|
-
const _el$
|
|
6687
|
-
(0, $gco9i$insert)(_el$
|
|
6688
|
-
return _el$
|
|
6792
|
+
const _el$7 = (0, $gco9i$getNextElement)($172e1b898d457050$var$_tmpl$2);
|
|
6793
|
+
(0, $gco9i$insert)(_el$7, ()=>i18n_.view_more_());
|
|
6794
|
+
return _el$7;
|
|
6689
6795
|
})()
|
|
6690
6796
|
};
|
|
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
|
-
}, {
|
|
6797
|
+
(0, $gco9i$createComputed)((0, $gco9i$on)(get_currently_visible, (new_visible)=>set_showing_recommendation_rows(new_visible), {
|
|
6798
|
+
defer: true
|
|
6799
|
+
}));
|
|
6800
|
+
(0, $gco9i$createComputed)((0, $gco9i$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>set_currently_visible(new_rows), {
|
|
6697
6801
|
defer: true
|
|
6698
6802
|
}));
|
|
6699
6803
|
return rows;
|
|
@@ -8146,7 +8250,7 @@ function $1801dbce7adb3f19$export$41b4894022a3580f({ style_props_: style_props_
|
|
|
8146
8250
|
|
|
8147
8251
|
|
|
8148
8252
|
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_
|
|
8253
|
+
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
8254
|
const [get_sorting] = current_sorting_;
|
|
8151
8255
|
const all_products_loaded_ = (0, $gco9i$createSignal)(false);
|
|
8152
8256
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8394,7 +8498,9 @@ function $7097477c78a89208$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8394
8498
|
depict_api_: depict_api_,
|
|
8395
8499
|
i18n_: i18n_,
|
|
8396
8500
|
search_query_base_: search_query_base_,
|
|
8397
|
-
layout_options_
|
|
8501
|
+
get layout_options_ () {
|
|
8502
|
+
return (0, $gco9i$createMemo)(()=>recommendations_layout_options_?.() ?? layout_options_());
|
|
8503
|
+
},
|
|
8398
8504
|
showing_recommendation_rows_: showing_recommendation_rows_,
|
|
8399
8505
|
view_more_button_: search_recs_view_more_,
|
|
8400
8506
|
product_card_template_: product_card_template_
|
|
@@ -8684,16 +8790,19 @@ function $806c97b931758897$var$get_shared_properties(depict_search) {
|
|
|
8684
8790
|
return shared_properties;
|
|
8685
8791
|
}
|
|
8686
8792
|
function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
8687
|
-
const { depict_search: depict_search ,
|
|
8793
|
+
const { depict_search: depict_search , product_card_template: product_card_template } = props;
|
|
8688
8794
|
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
8795
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8696
8796
|
const { state_: state_ } = shared_properties;
|
|
8797
|
+
const grid_spacing_override = (0, $gco9i$createMemo)(()=>{
|
|
8798
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
8799
|
+
return typeof grid_spacing === "string" ? {
|
|
8800
|
+
grid_spacing: grid_spacing
|
|
8801
|
+
} : {
|
|
8802
|
+
override_vertical_spacing: grid_spacing.vertical,
|
|
8803
|
+
grid_spacing: grid_spacing.horizontal
|
|
8804
|
+
};
|
|
8805
|
+
});
|
|
8697
8806
|
(0, $gco9i$onCleanup)(shared_properties.reset_history_state_);
|
|
8698
8807
|
return (0, $7097477c78a89208$export$a54ec244c8863715)({
|
|
8699
8808
|
input_modal_open_: ()=>!!depict_search.modal_open,
|
|
@@ -8739,19 +8848,23 @@ function $806c97b931758897$export$f2dc7e4e4aa11abb(props) {
|
|
|
8739
8848
|
showing_recommendation_rows_: state_.search_showing_recommendation_rows,
|
|
8740
8849
|
scroll_restoration_data_: state_.search_scroll_restoration_data,
|
|
8741
8850
|
include_input_field_: ()=>props.include_input_field,
|
|
8742
|
-
layout_options_: {
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
recommendations_layout_options_:
|
|
8747
|
-
|
|
8748
|
-
|
|
8749
|
-
|
|
8851
|
+
layout_options_: (0, $gco9i$createMemo)(()=>({
|
|
8852
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
8853
|
+
...grid_spacing_override()
|
|
8854
|
+
})),
|
|
8855
|
+
recommendations_layout_options_: (0, $gco9i$createMemo)(()=>{
|
|
8856
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
8857
|
+
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
8858
|
+
cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
8859
|
+
...grid_spacing_override()
|
|
8860
|
+
} : undefined;
|
|
8861
|
+
}),
|
|
8750
8862
|
product_card_template_: product_card_template
|
|
8751
8863
|
});
|
|
8752
8864
|
}, "Entire SearchPage failed");
|
|
8753
8865
|
}
|
|
8754
|
-
function $806c97b931758897$export$316f6f283ae64765(
|
|
8866
|
+
function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
8867
|
+
const { depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler } = props;
|
|
8755
8868
|
const shared_properties = $806c97b931758897$var$get_shared_properties(depict_search);
|
|
8756
8869
|
return (0, $16b52438165aafe2$export$23fca46f3143581f)(()=>{
|
|
8757
8870
|
let input_element;
|
|
@@ -8780,7 +8893,7 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8780
8893
|
input_element.selectionStart,
|
|
8781
8894
|
input_element.selectionEnd
|
|
8782
8895
|
];
|
|
8783
|
-
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, aligner_ref);
|
|
8896
|
+
const { cleanup: cleanup } = $806c97b931758897$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
8784
8897
|
const complete_modal_dispose_handler = ()=>{
|
|
8785
8898
|
modal_dispose_handler?.();
|
|
8786
8899
|
cleanup();
|
|
@@ -8808,23 +8921,21 @@ function $806c97b931758897$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8808
8921
|
];
|
|
8809
8922
|
}, "SearchField failed");
|
|
8810
8923
|
}
|
|
8811
|
-
function $806c97b931758897$var$align_field_modal(style_props_, input,
|
|
8924
|
+
function $806c97b931758897$var$align_field_modal(style_props_, input, aligner_ref_accessor) {
|
|
8812
8925
|
return (0, $gco9i$createRoot)((dispose)=>{
|
|
8813
|
-
|
|
8926
|
+
(0, $gco9i$createComputed)(()=>{
|
|
8927
|
+
const aligner_ref = aligner_ref_accessor?.();
|
|
8928
|
+
if (!aligner_ref) {
|
|
8929
|
+
(0, $b6d5529b253681aa$export$b3ad617e9036868)(style_props_, input);
|
|
8930
|
+
return;
|
|
8931
|
+
}
|
|
8814
8932
|
const { cleanup: cleanup } = (0, $4ca91518c9a35379$export$828dcdd425fd3231)(aligner_ref);
|
|
8933
|
+
(0, $gco9i$onCleanup)(cleanup);
|
|
8815
8934
|
(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
|
-
}
|
|
8935
|
+
});
|
|
8936
|
+
return {
|
|
8937
|
+
cleanup: dispose
|
|
8938
|
+
};
|
|
8828
8939
|
});
|
|
8829
8940
|
}
|
|
8830
8941
|
|