@depict-ai/ui 0.0.6 → 0.0.8

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/module.js CHANGED
@@ -1,5 +1,5 @@
1
- import {template as $kyEB6$template, insert as $kyEB6$insert, createComponent as $kyEB6$createComponent, spread as $kyEB6$spread, use as $kyEB6$use, setAttribute as $kyEB6$setAttribute, effect as $kyEB6$effect, addEventListener as $kyEB6$addEventListener, delegateEvents as $kyEB6$delegateEvents, memo as $kyEB6$memo, style as $kyEB6$style, mergeProps as $kyEB6$mergeProps, classList as $kyEB6$classList, className as $kyEB6$className} from "solid-js/web";
2
- import {Placeholder as $kyEB6$Placeholder, catchify as $kyEB6$catchify, base_url as $kyEB6$base_url, get_depict_id as $kyEB6$get_depict_id, get_user_id as $kyEB6$get_user_id, get_session_id as $kyEB6$get_session_id, dlog as $kyEB6$dlog, make_url_with_query_params as $kyEB6$make_url_with_query_params, fetch_retry as $kyEB6$fetch_retry, sort_obj as $kyEB6$sort_obj, observer as $kyEB6$observer, report as $kyEB6$report, ContainedPlaceholderImage as $kyEB6$ContainedPlaceholderImage, javascript_media_query as $kyEB6$javascript_media_query, href_change_ipns as $kyEB6$href_change_ipns, standard_price_format as $kyEB6$standard_price_format, deparallelize as $kyEB6$deparallelize, make_asyncIterable_exiter as $kyEB6$make_asyncIterable_exiter, insert_surfaces as $kyEB6$insert_surfaces, Tenant as $kyEB6$Tenant, deparallelize_no_drop as $kyEB6$deparallelize_no_drop, default_rr as $kyEB6$default_rr, make_random_classname as $kyEB6$make_random_classname, n_col_styling_with_dist as $kyEB6$n_col_styling_with_dist, Lazyfier as $kyEB6$Lazyfier, queueMacroTask as $kyEB6$queueMacroTask, Rec_Renderer as $kyEB6$Rec_Renderer, CrossIcon as $kyEB6$CrossIcon, useExpandingContainer as $kyEB6$useExpandingContainer, Amazing_Slider as $kyEB6$Amazing_Slider, slider_snap_css as $kyEB6$slider_snap_css, slider_fading_factory as $kyEB6$slider_fading_factory, MinusIcon as $kyEB6$MinusIcon, FilterIcon as $kyEB6$FilterIcon, SortIconAsc as $kyEB6$SortIconAsc, SortIconDesc as $kyEB6$SortIconDesc, PlusIcon as $kyEB6$PlusIcon, TickIcon as $kyEB6$TickIcon, ArrowUp as $kyEB6$ArrowUp, normal_get_product_id as $kyEB6$normal_get_product_id, GenericSliderArrowButton as $kyEB6$GenericSliderArrowButton, BackIcon as $kyEB6$BackIcon, SearchIcon as $kyEB6$SearchIcon, depict_click as $kyEB6$depict_click, impression_track_element as $kyEB6$impression_track_element, add_new_tab_listener as $kyEB6$add_new_tab_listener, buildThresholdList as $kyEB6$buildThresholdList, PreviousSearchIcon as $kyEB6$PreviousSearchIcon, Layout as $kyEB6$Layout, make_placeholder_rr as $kyEB6$make_placeholder_rr, async_iterable_ipns as $kyEB6$async_iterable_ipns, ContainedImage as $kyEB6$ContainedImage} from "@depict-ai/utilishared";
1
+ import {template as $kyEB6$template, insert as $kyEB6$insert, createComponent as $kyEB6$createComponent, spread as $kyEB6$spread, effect as $kyEB6$effect, setAttribute as $kyEB6$setAttribute, use as $kyEB6$use, addEventListener as $kyEB6$addEventListener, delegateEvents as $kyEB6$delegateEvents, memo as $kyEB6$memo, style as $kyEB6$style, mergeProps as $kyEB6$mergeProps, classList as $kyEB6$classList, className as $kyEB6$className} from "solid-js/web";
2
+ import {Placeholder as $kyEB6$Placeholder, catchify as $kyEB6$catchify, base_url as $kyEB6$base_url, get_depict_id as $kyEB6$get_depict_id, get_user_id as $kyEB6$get_user_id, get_session_id as $kyEB6$get_session_id, dlog as $kyEB6$dlog, make_url_with_query_params as $kyEB6$make_url_with_query_params, fetch_retry as $kyEB6$fetch_retry, sort_obj as $kyEB6$sort_obj, observer as $kyEB6$observer, report as $kyEB6$report, ContainedPlaceholderImage as $kyEB6$ContainedPlaceholderImage, javascript_media_query as $kyEB6$javascript_media_query, href_change_ipns as $kyEB6$href_change_ipns, standard_price_format as $kyEB6$standard_price_format, deparallelize as $kyEB6$deparallelize, make_asyncIterable_exiter as $kyEB6$make_asyncIterable_exiter, insert_surfaces as $kyEB6$insert_surfaces, Tenant as $kyEB6$Tenant, deparallelize_no_drop as $kyEB6$deparallelize_no_drop, default_rr as $kyEB6$default_rr, make_random_classname as $kyEB6$make_random_classname, n_col_styling_with_dist as $kyEB6$n_col_styling_with_dist, Lazyfier as $kyEB6$Lazyfier, queueMacroTask as $kyEB6$queueMacroTask, Rec_Renderer as $kyEB6$Rec_Renderer, CrossIcon as $kyEB6$CrossIcon, useExpandingContainer as $kyEB6$useExpandingContainer, Amazing_Slider as $kyEB6$Amazing_Slider, slider_snap_css as $kyEB6$slider_snap_css, slider_fading_factory as $kyEB6$slider_fading_factory, MinusIcon as $kyEB6$MinusIcon, FilterIcon as $kyEB6$FilterIcon, SortIconAsc as $kyEB6$SortIconAsc, SortIconDesc as $kyEB6$SortIconDesc, PlusIcon as $kyEB6$PlusIcon, TickIcon as $kyEB6$TickIcon, ArrowUp as $kyEB6$ArrowUp, normal_get_product_id as $kyEB6$normal_get_product_id, GenericSliderArrowButton as $kyEB6$GenericSliderArrowButton, BackIcon as $kyEB6$BackIcon, SearchIcon as $kyEB6$SearchIcon, Layout as $kyEB6$Layout, make_placeholder_rr as $kyEB6$make_placeholder_rr, async_iterable_ipns as $kyEB6$async_iterable_ipns, depict_click as $kyEB6$depict_click, impression_track_element as $kyEB6$impression_track_element, add_new_tab_listener as $kyEB6$add_new_tab_listener, ContainedImage as $kyEB6$ContainedImage, buildThresholdList as $kyEB6$buildThresholdList, PreviousSearchIcon as $kyEB6$PreviousSearchIcon} from "@depict-ai/utilishared";
3
3
  import {createSignal as $kyEB6$createSignal, untrack as $kyEB6$untrack, createMemo as $kyEB6$createMemo, onCleanup as $kyEB6$onCleanup, createEffect as $kyEB6$createEffect, createComputed as $kyEB6$createComputed, createRoot as $kyEB6$createRoot, createResource as $kyEB6$createResource, Show as $kyEB6$Show, createRenderEffect as $kyEB6$createRenderEffect, runWithOwner as $kyEB6$runWithOwner, getOwner as $kyEB6$getOwner, on as $kyEB6$on, Index as $kyEB6$Index, batch as $kyEB6$batch, For as $kyEB6$For, ErrorBoundary as $kyEB6$ErrorBoundary} from "solid-js";
4
4
 
5
5
 
@@ -476,7 +476,7 @@ async function $5c5f95951393e5d1$var$download_categories(tenant, market) {
476
476
 
477
477
 
478
478
 
479
- const $bb15dfb548a7666e$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-card"><div class="img_part"></div><div class="right_part"><div class="title_brand"><span class="title"></span></div></div></div>`, 10);
479
+ const $bb15dfb548a7666e$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="title"></span></div></div></div>`, 10);
480
480
  function $bb15dfb548a7666e$export$ee1733d9a8495996() {
481
481
  return (()=>{
482
482
  const _el$ = $bb15dfb548a7666e$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild;
@@ -535,17 +535,21 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
535
535
  } : {}
536
536
  }));
537
537
  };
538
- const ro = new ResizeObserver((0, $kyEB6$catchify)((records)=>{
539
- records.forEach(({ contentRect: { width: width } })=>{
540
- if (width_transformer) width = width_transformer(width);
541
- modal_body_style[1]((old_value)=>({
542
- ...old_value,
543
- width: `${width}px`
544
- }));
545
- });
546
- align_position();
547
- }));
548
- ro.observe(input_field);
538
+ let ro;
539
+ if (one_axies_only !== "top") {
540
+ ro = new ResizeObserver((0, $kyEB6$catchify)((records)=>{
541
+ records.forEach(({ contentRect: { width: width } })=>{
542
+ if (width_transformer) width = width_transformer(width);
543
+ modal_body_style[1]((old_value)=>({
544
+ ...old_value,
545
+ "max-width": "unset",
546
+ width: `${width}px`
547
+ }));
548
+ });
549
+ align_position();
550
+ }));
551
+ ro.observe(input_field);
552
+ }
549
553
  window.addEventListener("resize", align_position);
550
554
  window.addEventListener("orientationchange", align_position);
551
555
  // "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
@@ -555,7 +559,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
555
559
  resize_resize_observer.observe(document.documentElement);
556
560
  (0, $kyEB6$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
557
561
  (0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(()=>{
558
- ro.disconnect();
562
+ ro?.disconnect();
559
563
  resize_resize_observer.disconnect();
560
564
  window.removeEventListener("resize", align_position);
561
565
  window.removeEventListener("orientationchange", align_position);
@@ -1772,6 +1776,8 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
1772
1776
 
1773
1777
 
1774
1778
 
1779
+
1780
+
1775
1781
  function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value) {
1776
1782
  const signals = {};
1777
1783
  const entries = Object.entries(params_to_default_value);
@@ -1826,6 +1832,8 @@ function $a8fa7302d6f93c0b$export$9862539c89138352(get_default_values) {
1826
1832
 
1827
1833
 
1828
1834
 
1835
+
1836
+
1829
1837
  const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field)=>{
1830
1838
  const maybe_meta = (0, $kyEB6$untrack)(available_filters_)?.find(({ op: op , field: field })=>field === search_for_field && op === "inrange")?.meta;
1831
1839
  if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
@@ -2548,9 +2556,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
2548
2556
  duration: duration_ ?? 250,
2549
2557
  delay: delay_ ?? 0
2550
2558
  });
2551
- const toggle = ()=>props.is_open_[1](!(0, $kyEB6$untrack)(()=>props.is_open_ /* reactive getter */ [0]()));
2552
2559
  const [is_in_dom, set_is_in_dom] = (0, $kyEB6$createSignal)(document.documentElement.contains(details_));
2553
- const is_open_memo = (0, $kyEB6$createMemo)(()=>props.is_open_[0]()); // we want this extra layer for if the props.is_open_ function changes itself but not the value of the signal. If we re-run below effect it flickers sometimes for some reason
2560
+ // we want this extra layer for if the props.is_open_ function changes itself but not the value of the signal. If we re-run below effect it flickers sometimes for some reason
2561
+ const is_open_memo = (0, $kyEB6$createMemo)(()=>props.is_open_[0]());
2562
+ const toggle = ()=>props.is_open_[1](!(0, $kyEB6$untrack)(is_open_memo));
2554
2563
  (0, $kyEB6$insert)(details_, [
2555
2564
  summary_,
2556
2565
  (0, $kyEB6$createComponent)(ExpandingContainer, {
@@ -2571,8 +2580,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
2571
2580
  const do_duration = dont_animate_if_instant_open_ && fresh_component ? $6bb0a0c563dff4bb$var$has_new_animate ? 0 : 1 /* if the zero duration is 1 modern chrome will paint a frame with unexpanded and then one with expanded which doesn't look nice, if you have 0 on older browsers they won't play the animation at all (i.e. iOS 12.5.5) */ : duration_;
2572
2581
  await expand(0, do_duration);
2573
2582
  } else {
2583
+ const closeModal = (0, $kyEB6$catchify)(()=>{
2584
+ /*
2585
+ TODO: we currently should not enable the following line, since it causes the following bug:
2586
+ https://linear.app/depictai/issue/FRO-413/on-estoreno-the-browser-crashes-when-expandingcollapsing-filtre-on
2587
+ It seems to be a chrome issue and a bug has been reported to them:
2588
+ https://bugs.chromium.org/p/chromium/issues/detail?id=1404121#c2 */ // details_.open = false;
2589
+ });
2574
2590
  const animation = await collapse();
2575
- animation.addEventListener("finish", (0, $kyEB6$catchify)(()=>details_.open = false)); // close it after the animation has finished
2591
+ animation.addEventListener("finish", closeModal);
2576
2592
  }
2577
2593
  }));
2578
2594
  details_.addEventListener("toggle", (0, $kyEB6$catchify)(()=>{
@@ -2995,7 +3011,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
2995
3011
 
2996
3012
 
2997
3013
 
2998
- const $87c712b5b33f24f7$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="count"></span>`, 2), $87c712b5b33f24f7$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<label class="input_row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div></label>`, 9);
3014
+ const $87c712b5b33f24f7$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="count"></span>`, 2), $87c712b5b33f24f7$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div></label>`, 9);
2999
3015
  const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
3000
3016
  const id = (0, $kyEB6$make_random_classname)();
3001
3017
  return /* We can't use actual margin because ExpandingContainer gets messed up */ (()=>{
@@ -3038,7 +3054,7 @@ const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
3038
3054
 
3039
3055
 
3040
3056
 
3041
- const $67b173f9db427028$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button type="button" class="expand_filter"><span></span></button>`, 4);
3057
+ const $67b173f9db427028$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button type="button" class="expand-filter"><span></span></button>`, 4);
3042
3058
  function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras] , i18n_: i18n_ }) {
3043
3059
  return (()=>{
3044
3060
  const _el$ = $67b173f9db427028$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
@@ -3172,7 +3188,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
3172
3188
 
3173
3189
 
3174
3190
 
3175
- const $eb8d9bf3b5700c26$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<form class="radios"></form>`, 2), $eb8d9bf3b5700c26$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="count"></span>`, 2), $eb8d9bf3b5700c26$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<label class="input_row"><div class="left"><input type="radio"><span class="custom-indicator"></span></div></label>`, 7);
3191
+ const $eb8d9bf3b5700c26$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<form class="radios"></form>`, 2), $eb8d9bf3b5700c26$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="count"></span>`, 2), $eb8d9bf3b5700c26$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<label class="input-row"><div class="left"><input type="radio"><span class="custom-indicator"></span></div></label>`, 7);
3176
3192
  function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_ , filter_: filter_ }) {
3177
3193
  const radio_name = (0, $kyEB6$make_random_classname)();
3178
3194
  const existing_filter = (0, $kyEB6$createMemo)(()=>{
@@ -3251,7 +3267,7 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
3251
3267
 
3252
3268
 
3253
3269
 
3254
- const $a6b08770e164eced$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="range"><div class="input_group"><div class="field"><input type="number"></div><div class="separator">-</div><div class="field"><input type="number"></div></div><div class="value_text"><span class="min"></span><span class="max"></span></div></div>`, 18), $a6b08770e164eced$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="slider"><div class="progress"></div></div>`, 4), $a6b08770e164eced$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="range_group"><input type="range" step="any"><input type="range" step="any"></div>`, 4);
3270
+ const $a6b08770e164eced$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="range"><div class="input-group"><div class="field"><input type="number"></div><div class="separator">-</div><div class="field"><input type="number"></div></div><div class="value-text"><span class="min"></span><span class="max"></span></div></div>`, 18), $a6b08770e164eced$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="slider"><div class="progress"></div></div>`, 4), $a6b08770e164eced$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="range-group"><input type="range" step="any"><input type="range" step="any"></div>`, 4);
3255
3271
  function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_ , selected_filters_: selected_filters_ , i18n_: i18n_ }) {
3256
3272
  const current_range = (0, $kyEB6$createSignal)((0, $kyEB6$untrack)(()=>filter_().data));
3257
3273
  const selected_filter = (0, $kyEB6$createMemo)(()=>selected_filters_[0]().find(({ field: checking_field , op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
@@ -3579,7 +3595,7 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_ , i18n
3579
3595
 
3580
3596
 
3581
3597
 
3582
- const $1c8cac76cb67e9af$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<form class="checkboxes hierarchical"></form>`, 2), $1c8cac76cb67e9af$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="checkbox_details"></div>`, 2), $1c8cac76cb67e9af$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<details></details>`, 2), $1c8cac76cb67e9af$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="category_parent"><div class="summary"><span class="count"></span></div></summary>`, 6);
3598
+ const $1c8cac76cb67e9af$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<form class="checkboxes hierarchical"></form>`, 2), $1c8cac76cb67e9af$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="checkbox-details"></div>`, 2), $1c8cac76cb67e9af$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<details></details>`, 2), $1c8cac76cb67e9af$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="category-parent"><div class="summary"><span class="count"></span></div></summary>`, 6);
3583
3599
  const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 7;
3584
3600
  const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
3585
3601
  function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected_filters_: selected_filters_ , i18n_: i18n_ , view_more_button_below_group_: view_more_button_below_group_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
@@ -3699,7 +3715,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
3699
3715
  typeof _ref$ === "function" ? (0, $kyEB6$use)(_ref$, _el$) : form = _el$;
3700
3716
  (0, $kyEB6$insert)(_el$, ()=>$1c8cac76cb67e9af$var$render_stuff((0, $kyEB6$createMemo)(()=>some_top_level_are_hidden() ? Object.fromEntries(Object.entries(structured_categories()).slice(0, $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed)) : structured_categories()), existing_filter, i18n_), null);
3701
3717
  (0, $kyEB6$insert)(_el$, expanding_container_els, null);
3702
- (0, $kyEB6$effect)(()=>_el$.classList.toggle("any_expandable", !!Object.values(structured_categories()).some((category)=>Object.keys(category.children_).length)));
3718
+ (0, $kyEB6$effect)(()=>_el$.classList.toggle("any-expandable", !!Object.values(structured_categories()).some((category)=>Object.keys(category.children_).length)));
3703
3719
  return _el$;
3704
3720
  })();
3705
3721
  }
@@ -3755,7 +3771,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
3755
3771
  }
3756
3772
  return are_checked;
3757
3773
  });
3758
- (0, $kyEB6$createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("fake_checked"));
3774
+ (0, $kyEB6$createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("fake-checked"));
3759
3775
  }
3760
3776
  }), null);
3761
3777
  (0, $kyEB6$insert)(_el$2, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
@@ -4339,7 +4355,7 @@ function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
4339
4355
 
4340
4356
 
4341
4357
 
4342
- const $fab07f52c9861732$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter_collapsible"></div>`, 2), $fab07f52c9861732$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear_group"><span></span></button>`, 4), $fab07f52c9861732$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="view_more_clear"></div>`, 2), $fab07f52c9861732$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter_collapsible_body"><div class="filter_part"></div></div>`, 4), $fab07f52c9861732$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="filter_collapsible"></details>`, 2), $fab07f52c9861732$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="filter_group_summary"><div class="summary"><span></span><div class="selected_w_sign"></div></div></summary>`, 8), $fab07f52c9861732$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="ungrouped"></div>`, 2), $fab07f52c9861732$var$_tmpl$8 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear_all_filters major"></button>`, 2);
4358
+ const $fab07f52c9861732$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter-collapsible"></div>`, 2), $fab07f52c9861732$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear-group"><span></span></button>`, 4), $fab07f52c9861732$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="view-more-clear"></div>`, 2), $fab07f52c9861732$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter-collapsible-body"><div class="filter-part"></div></div>`, 4), $fab07f52c9861732$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="filter-collapsible"></details>`, 2), $fab07f52c9861732$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="filter-group-summary"><div class="summary"><span></span><div class="selected-w-sign"></div></div></summary>`, 8), $fab07f52c9861732$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="ungrouped"></div>`, 2), $fab07f52c9861732$var$_tmpl$8 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear-all-filters major"></button>`, 2);
4343
4359
  function $fab07f52c9861732$export$3f1a388cc0d8fed7(props) {
4344
4360
  // Split like this to make placeholder wrapping more visible & this component is exported and used in MobileModal
4345
4361
  return (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
@@ -4568,7 +4584,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
4568
4584
 
4569
4585
 
4570
4586
 
4571
- const $68a258a92b88f02f$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting-attributes"></div>`, 2), $68a258a92b88f02f$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting-direction"></div>`, 2), $68a258a92b88f02f$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><div class="input_row"><input type="radio"><span class="custom-indicator"></span></div></div>`, 7), $68a258a92b88f02f$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><label class="input_row"><input type="radio"><span class="custom-indicator"></span></label></div>`, 7);
4587
+ const $68a258a92b88f02f$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting-attributes"></div>`, 2), $68a258a92b88f02f$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting-direction"></div>`, 2), $68a258a92b88f02f$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><div class="input-row"><input type="radio"><span class="custom-indicator"></span></div></div>`, 7), $68a258a92b88f02f$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><label class="input-row"><input type="radio"><span class="custom-indicator"></span></label></div>`, 7);
4572
4588
  function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_ , current_sorting_: current_sorting_ }) {
4573
4589
  const title_radio_name = (0, $kyEB6$make_random_classname)();
4574
4590
  const order_radio_name = (0, $kyEB6$make_random_classname)();
@@ -4675,8 +4691,8 @@ function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: availa
4675
4691
 
4676
4692
 
4677
4693
 
4678
- const $757dac7f7c6c5241$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear minor"></button>`, 2), $757dac7f7c6c5241$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp depict-filter-sort-mobile-modal-container"><div class="depict-filter-sort-modal-backdrop"></div><button class="dismiss-modal"></button><div class="filter_sort_modal"><div class="body"></div><div class="bottom-row"><button class="show-results major"></button></div></div></div>`, 14), $757dac7f7c6c5241$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="sorting"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="sort_filter_summary"><div class="summary"><div class="left_els"><span></span></div></div></summary>`, 8), $757dac7f7c6c5241$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="body"></div>`, 2), $757dac7f7c6c5241$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="filters"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<b></b>`, 2);
4679
- const $757dac7f7c6c5241$var$no_go_selector = ".range .range_group";
4694
+ const $757dac7f7c6c5241$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="clear minor"></button>`, 2), $757dac7f7c6c5241$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp depict-filter-sort-mobile-modal-container"><div class="depict-filter-sort-modal-backdrop"></div><button class="dismiss-modal"></button><div class="filter-sort-modal"><div class="body"></div><div class="bottom-row"><button class="show-results major"></button></div></div></div>`, 14), $757dac7f7c6c5241$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="sorting"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<summary class="sort-filter-summary"><div class="summary"><div class="left-els"><span></span></div></div></summary>`, 8), $757dac7f7c6c5241$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="body"></div>`, 2), $757dac7f7c6c5241$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<details class="filters"></details>`, 2), $757dac7f7c6c5241$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<b></b>`, 2);
4695
+ const $757dac7f7c6c5241$var$no_go_selector = ".range .range-group";
4680
4696
  function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_ , args_for_filtering_: args_for_filtering_ , search_filters_open_: [get_search_filters_open, set_search_filters_open] , search_sorting_open_: [get_search_sorting_open, set_search_sorting_open] , dismiss_modal_: dismiss_modal_ , register_closing_animation_: register_closing_animation_ , formatted_number_of_results_: formatted_number_of_results_ , i18n_: i18n_ }) {
4681
4697
  (0, $aea1edf92433e81e$export$fe334901e8bebd57)();
4682
4698
  let modal;
@@ -4946,7 +4962,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
4946
4962
 
4947
4963
 
4948
4964
 
4949
- const $cdea4cf8c5c071ef$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filters"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"></div></div></div>`, 6), $cdea4cf8c5c071ef$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="num_filters"></span>`, 2), $cdea4cf8c5c071ef$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="open-filters-button-container"><button class="filter toggle-button major-minor-transition" type="button"><span></span></button></div>`, 6), $cdea4cf8c5c071ef$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span></button>`, 4);
4965
+ const $cdea4cf8c5c071ef$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filters"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sorting"><div class="body"></div></div>`, 4), $cdea4cf8c5c071ef$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"></div></div></div>`, 6), $cdea4cf8c5c071ef$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="num-filters"></span>`, 2), $cdea4cf8c5c071ef$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="open-filters-button-container"><button class="filter toggle-button major-minor-transition" type="button"><span></span></button></div>`, 6), $cdea4cf8c5c071ef$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span></button>`, 4);
4950
4966
  function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({ current_sorting_: current_sorting_ , set_extra_els_in_results_container_: set_extra_els_in_results_container_ , search_filters_open_: search_filters_open_ , search_sorting_open_: search_sorting_open_ , set_sort_or_filter_open_: set_sort_or_filter_open_ , i18n_: i18n_ , available_sortings_: available_sortings_ , available_filters_: available_filters_ , expanded_filters_: expanded_filters_ , middle_elements_: middle_elements_ , input_modal_open_: input_modal_open_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_ , set_sort_and_filter_element_: set_sort_and_filter_element_ , formatted_number_of_results_: formatted_number_of_results_ , filter_button_width_: filter_button_width_ , sort_button_width_: sort_button_width_ , selected_filters_: selected_filters_ , local_filter_cache_: local_filter_cache_ , get_extra_filters_button_: get_extra_filters_button_ , get_extra_sorting_button_: get_extra_sorting_button_ }) {
4951
4967
  return (0, $b7436a6d1fd64e3b$export$b69d0d92862de18b)({
4952
4968
  severity_: "error",
@@ -5178,7 +5194,7 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_ , current_sortin
5178
5194
 
5179
5195
 
5180
5196
 
5181
- const $0b0380f75d729d63$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="floating_buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
5197
+ const $0b0380f75d729d63$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="floating-buttons"><button class="filter"><div></div></button><button class="sort"><div></div></button><button class="up"><div></div></button></div>`, 14);
5182
5198
  function $0b0380f75d729d63$export$b23abd26de154ede(props) {
5183
5199
  const [is_small, set_is_small] = (0, $kyEB6$createSignal)(true);
5184
5200
  (0, $kyEB6$onCleanup)((0, $kyEB6$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
@@ -5293,7 +5309,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
5293
5309
  (0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$ArrowUp), {}));
5294
5310
  (0, $kyEB6$effect)((_p$)=>{
5295
5311
  const _v$ = !!(is_scrolling_upwards() && modal_is_closed() && !regular_buttons_are_in_view() && !get_is_showing_toast()), _v$2 = i18n_.filter_text_(), _v$3 = i18n_.sorting_text_(), _v$4 = i18n_.scroll_to_top_();
5296
- _v$ !== _p$._v$ && _el$.classList.toggle("show_them", _p$._v$ = _v$);
5312
+ _v$ !== _p$._v$ && _el$.classList.toggle("show-them", _p$._v$ = _v$);
5297
5313
  _v$2 !== _p$._v$2 && (0, $kyEB6$setAttribute)(_el$2, "aria-label", _p$._v$2 = _v$2);
5298
5314
  _v$3 !== _p$._v$3 && (0, $kyEB6$setAttribute)(_el$4, "aria-label", _p$._v$3 = _v$3);
5299
5315
  _v$4 !== _p$._v$4 && (0, $kyEB6$setAttribute)(_el$6, "aria-label", _p$._v$4 = _v$4);
@@ -5694,6 +5710,14 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
5694
5710
 
5695
5711
 
5696
5712
 
5713
+ let $f86ba724282f6690$export$44dad306455dddf;
5714
+ (function(DEPICT_ID) {
5715
+ DEPICT_ID["SEARCH_MODAL"] = "depict-search-modal";
5716
+ DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
5717
+ DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
5718
+ })($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
5719
+
5720
+
5697
5721
  const $df5d81d0fe61ff21$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="product-count"> </div>`, 2), $df5d81d0fe61ff21$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter-results-for-one-row"></div>`, 2), $df5d81d0fe61ff21$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp category"><div class="listing-page"></div></div>`, 4);
5698
5722
  function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ , page_replacer_: page_replacer_ , query_id_: query_id_ , current_sorting_: current_sorting_ , min_products_to_fetch_: min_products_to_fetch_ , category_filters_open_: category_filters_open_ , category_sorting_open_: category_sorting_open_ , expanded_filters_: expanded_filters_ , selected_filters_: selected_filters_ , get_quicklinks_accessor_: get_quicklinks_accessor_ , i18n_: incoming_i18n , get_breadcrumb_accessor_: get_breadcrumb_accessor_ , slider_arrow_button_: slider_arrow_button_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , local_filter_cache_: local_filter_cache_ , tenant_: tenant_ , market_: market_ , on_category_link_click_: on_category_link_click_ , show_quicklinks_: show_quicklinks_ , category_title_: category_title_ , show_breadcrumbs_: show_breadcrumbs_ , layout_options_: layout_options_ , scroll_restoration_data_: scroll_restoration_data_ , rr_options_: rr_options_ , get_product_id_: get_product_id_ }) {
5699
5723
  return (0, $kyEB6$createRoot)((dispose)=>{
@@ -5994,6 +6018,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
5994
6018
  });
5995
6019
  }
5996
6020
  }), null);
6021
+ (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$5, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
5997
6022
  return _el$5;
5998
6023
  })()
5999
6024
  ];
@@ -6038,6 +6063,7 @@ function $90980bd87c9960f9$var$proxy_push_state(function_name, thing) {
6038
6063
  }
6039
6064
 
6040
6065
 
6066
+
6041
6067
  const $9653a36120f642b0$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp category"></div>`, 2);
6042
6068
  class $9653a36120f642b0$export$3a8840c5b2ecf003 {
6043
6069
  #locale_signal = (0, $kyEB6$createSignal)();
@@ -6058,7 +6084,11 @@ class $9653a36120f642b0$export$3a8840c5b2ecf003 {
6058
6084
  }
6059
6085
  get #external_area_div() {
6060
6086
  // creates a new node every time this is accessed, doing like this for DRY purposes
6061
- return $9653a36120f642b0$var$_tmpl$.cloneNode(true);
6087
+ return (()=>{
6088
+ const _el$ = $9653a36120f642b0$var$_tmpl$.cloneNode(true);
6089
+ (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
6090
+ return _el$;
6091
+ })();
6062
6092
  }
6063
6093
  get locale_() {
6064
6094
  // allow reactive access
@@ -6188,113 +6218,42 @@ class $9653a36120f642b0$export$3a8840c5b2ecf003 {
6188
6218
 
6189
6219
 
6190
6220
 
6191
- function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_ , search_query_: [get_search_query] , current_sorting_: current_sorting_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , local_filter_cache_: local_filter_cache_ }) {
6192
- const [get_selected_filters, set_selected_filters] = selected_filters_;
6193
- const clear_filters_next_submit_ = (0, $kyEB6$createSignal)(false); // we store this here (and not in history.state) (maybe there's a better place) because it's a very temporary thing. I.e. as soon as anything breaks the "flow of intent" to make a new search we want this reset
6194
- const [get_clear_filters_next_submit, set_clear_filters_next_submit] = clear_filters_next_submit_;
6195
- const clear_filters = ()=>set_clear_filters_next_submit(true);
6196
- (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_selected_filters, ()=>{
6197
- // if the selected filters update, clear the clearing signal
6198
- set_clear_filters_next_submit(false);
6199
- }, {
6200
- defer: true
6201
- }));
6202
- (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_search_query, (0, $kyEB6$catchify)(()=>{
6203
- // when a query was submitted, clear filters if clear was pressed before
6204
- if ((0, $kyEB6$untrack)(get_clear_filters_next_submit)) {
6205
- set_clear_filters_next_submit(false);
6206
- set_selected_filters([]);
6207
- // also collapse expanded filters in hierarchical filter tree again
6208
- expanded_hierarchical_filters_[1]([]);
6209
- // also clear sorting
6210
- current_sorting_[1](undefined);
6211
- (0, $e9342fb3ac73a54a$export$8895d39404bd2bb1)({
6212
- user_triggered_: true,
6213
- selected_filters_: selected_filters_,
6214
- i18n_: i18n_,
6215
- also_clear_sorting_: true,
6216
- current_sorting_: current_sorting_,
6217
- expanded_hierarchical_filters_: expanded_hierarchical_filters_,
6218
- local_filter_cache_: local_filter_cache_
6219
- });
6220
- }
6221
- }), {
6222
- defer: true
6223
- }));
6224
- return clear_filters;
6225
- }
6226
-
6227
-
6228
-
6229
-
6230
-
6231
6221
 
6232
- function $21f51c14cb3f586f$export$84bba84a7b837187(search_query) {
6233
- const ls = localStorage;
6234
- const key = "depict_searches";
6235
- const previous_searches = (0, $kyEB6$createSignal)(JSON.parse(ls[key] || "[]"));
6236
- const [read_previous_searches, write_previous_searches] = previous_searches;
6237
- const [read_search_query] = search_query;
6238
- (0, $kyEB6$createEffect)((0, $kyEB6$catchify)(()=>{
6239
- const json_encoded = JSON.stringify(read_previous_searches());
6240
- if (ls[key] !== json_encoded) ls[key] = json_encoded;
6241
- }));
6242
- (0, $kyEB6$createComputed)((0, $kyEB6$catchify)(()=>{
6243
- const searches = (0, $kyEB6$untrack)((0, $kyEB6$catchify)(()=>read_previous_searches()));
6244
- const current_query = read_search_query();
6245
- if (!current_query) // don't save no query in history
6246
- return;
6247
- const new_value = [
6248
- ...searches.filter((value)=>value !== current_query),
6249
- current_query
6250
- ].slice(-30); // keep max 30 values (one could be deleted later because it's the search query), if value we add already exists remove it first
6251
- write_previous_searches(new_value);
6252
- }));
6253
- return previous_searches;
6254
- }
6255
6222
 
6256
6223
 
6257
6224
 
6258
6225
 
6259
- function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ , search_param_name_: search_param_name_ , search_field_value_: [read_field_value, write_field_value] , search_query_: [read_search_query] , url_transformer_: url_transformer_ , on_submit_: on_submit_ = (0, $d1d4dbcadcf4cb02$export$26df08e242fe83a3) , after_submit_: after_submit_ }) {
6260
- const new_search_query = (0, $kyEB6$untrack)(read_field_value);
6261
- const previous_query = (0, $kyEB6$untrack)(read_search_query);
6262
- if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
6263
- // don't push a history entry / re-search if someone submits a search again
6264
- // do close the modal though
6265
- on_submit_with_unchanged_value_?.();
6266
- return;
6267
- }
6268
- write_field_value(previous_query); // restore the value to the previous query since this one goes to the new history entry
6269
- on_submit_(search_param_name_, new_search_query, url_transformer_);
6270
- write_field_value(new_search_query);
6271
- scrollTo(0, 0);
6272
- after_submit_?.();
6273
- }
6274
6226
 
6275
6227
 
6276
6228
 
6277
6229
 
6278
- function $13e008d5237dbbee$export$2542ffb77b620b02(params_to_default_value) {
6279
- const signals = {};
6280
- const entries = Object.entries(params_to_default_value);
6281
- for (const [param, default_value] of entries)signals[param] = (0, $kyEB6$createSignal)(default_value ?? "");
6282
- const [exit_iterable, exitable_iterable] = (0, $kyEB6$make_asyncIterable_exiter)((0, $kyEB6$href_change_ipns));
6283
- (0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(exit_iterable));
6284
- (0, $kyEB6$catchify)(async ()=>{
6285
- for await (const href of exitable_iterable){
6286
- const { searchParams: searchParams } = new URL(href);
6287
- for (const [param, default_value] of entries){
6288
- const [_get, set] = signals[param];
6289
- if (searchParams.has(param)) {
6290
- const new_val = searchParams.get(param) ?? default_value ?? "";
6291
- set(new_val);
6292
- } else set(default_value ?? "");
6230
+ const $897bd4a76f611b38$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="parent-title"></span>`, 2), $897bd4a76f611b38$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="category-suggestion"><span class="title"></span></a>`, 4);
6231
+ function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
6232
+ return (()=>{
6233
+ const _el$ = $897bd4a76f611b38$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
6234
+ (0, $kyEB6$addEventListener)(_el$, "click", (0, $kyEB6$catchify)((e)=>{
6235
+ if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
6236
+ return;
6237
+ return on_navigation_?.(category_suggestion_().page_url);
6238
+ }), true);
6239
+ (0, $kyEB6$insert)(_el$2, ()=>category_suggestion_().title);
6240
+ (0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
6241
+ get when () {
6242
+ return typeof category_suggestion_().parent_title === "string";
6243
+ },
6244
+ get children () {
6245
+ const _el$3 = $897bd4a76f611b38$var$_tmpl$.cloneNode(true);
6246
+ (0, $kyEB6$insert)(_el$3, ()=>category_suggestion_().parent_title);
6247
+ return _el$3;
6293
6248
  }
6294
- }
6249
+ }), null);
6250
+ (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "href", category_suggestion_().page_url));
6251
+ return _el$;
6295
6252
  })();
6296
- return signals;
6297
6253
  }
6254
+ (0, $kyEB6$delegateEvents)([
6255
+ "click"
6256
+ ]);
6298
6257
 
6299
6258
 
6300
6259
 
@@ -6308,20 +6267,7 @@ function $13e008d5237dbbee$export$2542ffb77b620b02(params_to_default_value) {
6308
6267
 
6309
6268
 
6310
6269
 
6311
-
6312
-
6313
-
6314
-
6315
-
6316
-
6317
-
6318
-
6319
-
6320
-
6321
-
6322
-
6323
-
6324
- const $857105c41ea47bee$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="back" type="button"></button>`, 2), $857105c41ea47bee$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="query_input"><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 9);
6270
+ const $857105c41ea47bee$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="back" type="button"></button>`, 2), $857105c41ea47bee$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="query-input"><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 9);
6325
6271
  function $857105c41ea47bee$export$ff21851bb5d30e15({ search_field_value_: search_field_value_ , input_field_ref_: input_field_ref_ , field_element_ref_: field_element_ref_ , submit_query_: submit_query_ , override_on_enter_: override_on_enter_ , clear_filters_: clear_filters_ , disabled_: disabled_ = false , on_back_: on_back_ , i18n_: i18n_ }) {
6326
6272
  let input_field;
6327
6273
  (0, $kyEB6$createEffect)((0, $kyEB6$catchify)(async ()=>{
@@ -6420,76 +6366,417 @@ function $857105c41ea47bee$export$ff21851bb5d30e15({ search_field_value_: search
6420
6366
 
6421
6367
 
6422
6368
 
6423
- const $eea41f703612261b$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-results"></div>`, 2);
6424
- function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_ , search_field_value_: [get_search_field_value] , tenant_: tenant_ , market_: market_ , render_instant_card_: render_instant_card_ , render_instant_card_placeholder_: render_instant_card_placeholder_ , min_products_to_fetch_: min_products_to_fetch_ , has_sort_or_filters_: has_sort_or_filters_ , set_num_results_accessor_: set_num_results_accessor_ , i18n_: i18n_ }) {
6425
- const max_cards = 4;
6426
- const [read_current_instant_query, write_current_instant_query] = (0, $kyEB6$createSignal)("");
6427
- let timeout;
6428
- (0, $kyEB6$createComputed)(()=>{
6429
- const value = get_search_field_value();
6430
- if (timeout == null) // don't wait if it's the first request
6431
- write_current_instant_query(value);
6432
- clearTimeout(timeout);
6433
- timeout = setTimeout((0, $kyEB6$catchify)(()=>write_current_instant_query(value)), 250);
6434
- });
6435
- const [search_results] = (0, $kyEB6$createResource)((0, $kyEB6$createMemo)(()=>({
6436
- tenant: tenant_(),
6437
- market: market_(),
6438
- query: read_current_instant_query()
6439
- })), (0, $kyEB6$catchify)((variable_data)=>{
6440
- return depict_api_.query({
6441
- // here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
6442
- limit: (0, $kyEB6$untrack)(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
6443
- // if there's no sorting or filters we can fetch min_products_to_fetch_ many since then the cached request can be re-used by the search page, otherwise, no reason to waste bytes
6444
- ...variable_data
6369
+ const $172e1b898d457050$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="cards"></div>`, 2), $172e1b898d457050$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="search-recs"><h3 class="search-recs-title"></h3></div>`, 4), $172e1b898d457050$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="show-more major" type="button"></button>`, 2);
6370
+ const $172e1b898d457050$export$1c8c715550dc689d = 2;
6371
+ function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
6372
+ const [is_showing_something, set_is_showing_something] = (0, $kyEB6$createSignal)(false);
6373
+ const cards = $172e1b898d457050$var$_tmpl$.cloneNode(true);
6374
+ const on_next_render = [];
6375
+ const main_element = (()=>{
6376
+ const _el$2 = $172e1b898d457050$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
6377
+ (0, $kyEB6$insert)(_el$3, ()=>i18n_.search_recs_title_());
6378
+ (0, $kyEB6$insert)(_el$2, cards, null);
6379
+ return _el$2;
6380
+ })();
6381
+ const [get_showing_recommendation_rows] = showing_recommendation_rows_;
6382
+ const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
6383
+ const cleanup_old_cards = [];
6384
+ (0, $kyEB6$Layout)({
6385
+ container_element: cards,
6386
+ layout: "grid",
6387
+ rows: rows_object,
6388
+ ...layout_options_
6389
+ }).catch((e)=>(0, $kyEB6$report)([
6390
+ e,
6391
+ "Layout failed"
6392
+ ], "error"));
6393
+ // copied from RecommendationGrid
6394
+ // convoluted lazy loading that
6395
+ // when the elements are in the DOM starts IntersectionObserver on whole grid
6396
+ // when grid intersects starts Lazyfier
6397
+ // this is because Lazyfier is fucking stupid
6398
+ (0, $kyEB6$observer).wait_for_element(cards).then((0, $kyEB6$catchify)((element)=>{
6399
+ let start_lazy_loading;
6400
+ const lazy_loading_promise = new Promise((r)=>start_lazy_loading = r);
6401
+ const lf = new (0, $kyEB6$Lazyfier)({
6402
+ only_load_intersecting: true,
6403
+ wait_for_dominsertion: lazy_loading_promise,
6404
+ ignore_data_urls: true,
6405
+ lazyfinder: {
6406
+ unload () {}
6407
+ }
6445
6408
  });
6446
- }));
6447
- set_num_results_accessor_(()=>(0, $511cc0abd9a64ce8$export$92f2da32c6e7e7ee)({
6448
- search_results_: search_results,
6449
- i18n_: i18n_
6450
- }));
6451
- const rendering_options = (0, $kyEB6$createMemo)(()=>{
6452
- search_results();
6453
- return {};
6454
- });
6455
- const sliced_displays = (0, $kyEB6$createMemo)(()=>search_results()?.displays?.slice(0, max_cards));
6456
- let placeholder;
6457
- const container = (()=>{
6458
- const _el$ = $eea41f703612261b$var$_tmpl$.cloneNode(true);
6459
- (0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
6460
- get when () {
6461
- return sliced_displays()?.length;
6462
- },
6463
- get fallback () {
6464
- return (0, $kyEB6$createMemo)(()=>{
6465
- if (Array.isArray(search_results()?.displays)) // remove placeholders if we have a response but no results
6466
- return undefined;
6467
- return new Array(max_cards).fill(1).map(()=>(placeholder ||= render_instant_card_placeholder_()).cloneNode(true));
6468
- })();
6469
- },
6470
- get children () {
6471
- return (0, $kyEB6$createComponent)((0, $kyEB6$Index), {
6472
- get each () {
6473
- return sliced_displays();
6474
- },
6475
- children: (d, i)=>$eea41f703612261b$var$track_elements(d, i, render_instant_card_(d, i, rendering_options, i18n_), tenant_, market_)
6476
- });
6409
+ lf.start_observing_for_new_children_(element);
6410
+ const i_o = new IntersectionObserver((0, $kyEB6$catchify)((records)=>{
6411
+ for (const record of records)if (record.intersectionRatio > 0) {
6412
+ start_lazy_loading();
6413
+ i_o.disconnect();
6414
+ return;
6477
6415
  }
6478
6416
  }));
6479
- return _el$;
6480
- })();
6481
- new (0, $kyEB6$Lazyfier)({
6482
- container: container,
6483
- lazyfinder: {
6484
- unload () {}
6485
- },
6486
- ignore_data_urls: true
6487
- });
6488
- return container;
6489
- }
6490
- function $eea41f703612261b$var$track_elements(display, index, elements, tenant, market) {
6491
- const type = "instant_result";
6492
- const unwrapped_elements = $eea41f703612261b$var$unwrap_solid_jsx_element(elements);
6417
+ i_o.observe(cards);
6418
+ }));
6419
+ const deparallelized_recs_fetcher = (0, $kyEB6$deparallelize_no_drop)((0, $kyEB6$catchify)(async (base_query)=>{
6420
+ const recs_promise = depict_api_.get_recommended(base_query).then((r)=>r.displays);
6421
+ // create owner to run product cards with an Owner, so they know when they've gotten removed
6422
+ const [owner_for_cards, dispose_our_cards] = (0, $kyEB6$createRoot)((dispose)=>[
6423
+ (0, $kyEB6$getOwner)(),
6424
+ dispose
6425
+ ]);
6426
+ const rendering_result = await (await (0, $kyEB6$make_placeholder_rr)({
6427
+ // render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
6428
+ num_items: (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (0, $kyEB6$untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
6429
+ }))(tenant_object_, {
6430
+ type: "search_recs",
6431
+ recs: recs_promise,
6432
+ ...rr_options_,
6433
+ ...typeof rr_options_.template === "function" ? {
6434
+ template: (...args)=>(0, $kyEB6$runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
6435
+ rr_options_.template(...args))
6436
+ } : {}
6437
+ });
6438
+ const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
6439
+ let dead = false;
6440
+ while(on_next_render.length)on_next_render.pop()();
6441
+ on_next_render.push(()=>dead = true);
6442
+ if (!elements) {
6443
+ set_is_showing_something(false);
6444
+ return;
6445
+ }
6446
+ cards.replaceChildren(...elements);
6447
+ // Dispose the old cards just after the cards have been removed from the DOM
6448
+ cleanup_old_cards.forEach((cleanup_function)=>cleanup_function());
6449
+ cleanup_old_cards.push(dispose_our_cards); // push after calling, so that we don't instantly demolish ourselves lol
6450
+ set_is_showing_something(true);
6451
+ should_stay_inserted?.then((should)=>{
6452
+ if (!should && !dead /* just in case */ ) set_is_showing_something(false);
6453
+ });
6454
+ }));
6455
+ (0, $kyEB6$createRenderEffect)(()=>deparallelized_recs_fetcher(search_query_base_()));
6456
+ (0, $kyEB6$onCleanup)(()=>cleanup_old_cards.forEach((fn)=>fn())); // if everything gets cleaned up without new cards replacing the old ones, clean up the last cards
6457
+ return (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
6458
+ get when () {
6459
+ return is_showing_something();
6460
+ },
6461
+ children: main_element
6462
+ });
6463
+ }
6464
+ function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
6465
+ const ipns = (0, $kyEB6$async_iterable_ipns)();
6466
+ const rows = {
6467
+ ipns: ipns,
6468
+ start_rows: (0, $kyEB6$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
6469
+ rows_per_click: 3,
6470
+ button: (()=>{
6471
+ const _el$4 = $172e1b898d457050$var$_tmpl$3.cloneNode(true);
6472
+ (0, $kyEB6$insert)(_el$4, ()=>i18n_.view_more_());
6473
+ return _el$4;
6474
+ })()
6475
+ };
6476
+ (0, $kyEB6$catchify)(async ()=>{
6477
+ for await (const number of ipns)set_showing_recommendation_rows(number);
6478
+ })();
6479
+ (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>{
6480
+ if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
6481
+ }, {
6482
+ defer: true
6483
+ }));
6484
+ return rows;
6485
+ }
6486
+
6487
+
6488
+
6489
+
6490
+
6491
+
6492
+ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_ , search_query_: [get_search_query] , current_sorting_: current_sorting_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , i18n_: i18n_ , local_filter_cache_: local_filter_cache_ }) {
6493
+ const [get_selected_filters, set_selected_filters] = selected_filters_;
6494
+ const clear_filters_next_submit_ = (0, $kyEB6$createSignal)(false); // we store this here (and not in history.state) (maybe there's a better place) because it's a very temporary thing. I.e. as soon as anything breaks the "flow of intent" to make a new search we want this reset
6495
+ const [get_clear_filters_next_submit, set_clear_filters_next_submit] = clear_filters_next_submit_;
6496
+ const clear_filters = ()=>set_clear_filters_next_submit(true);
6497
+ (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_selected_filters, ()=>{
6498
+ // if the selected filters update, clear the clearing signal
6499
+ set_clear_filters_next_submit(false);
6500
+ }, {
6501
+ defer: true
6502
+ }));
6503
+ (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_search_query, (0, $kyEB6$catchify)(()=>{
6504
+ // when a query was submitted, clear filters if clear was pressed before
6505
+ if ((0, $kyEB6$untrack)(get_clear_filters_next_submit)) {
6506
+ set_clear_filters_next_submit(false);
6507
+ set_selected_filters([]);
6508
+ // also collapse expanded filters in hierarchical filter tree again
6509
+ expanded_hierarchical_filters_[1]([]);
6510
+ // also clear sorting
6511
+ current_sorting_[1](undefined);
6512
+ (0, $e9342fb3ac73a54a$export$8895d39404bd2bb1)({
6513
+ user_triggered_: true,
6514
+ selected_filters_: selected_filters_,
6515
+ i18n_: i18n_,
6516
+ also_clear_sorting_: true,
6517
+ current_sorting_: current_sorting_,
6518
+ expanded_hierarchical_filters_: expanded_hierarchical_filters_,
6519
+ local_filter_cache_: local_filter_cache_
6520
+ });
6521
+ }
6522
+ }), {
6523
+ defer: true
6524
+ }));
6525
+ return clear_filters;
6526
+ }
6527
+
6528
+
6529
+
6530
+
6531
+
6532
+ function $21f51c14cb3f586f$export$84bba84a7b837187(search_query) {
6533
+ const ls = localStorage;
6534
+ const key = "depict_searches";
6535
+ const previous_searches = (0, $kyEB6$createSignal)(JSON.parse(ls[key] || "[]"));
6536
+ const [read_previous_searches, write_previous_searches] = previous_searches;
6537
+ const [read_search_query] = search_query;
6538
+ (0, $kyEB6$createEffect)((0, $kyEB6$catchify)(()=>{
6539
+ const json_encoded = JSON.stringify(read_previous_searches());
6540
+ if (ls[key] !== json_encoded) ls[key] = json_encoded;
6541
+ }));
6542
+ (0, $kyEB6$createComputed)((0, $kyEB6$catchify)(()=>{
6543
+ const searches = (0, $kyEB6$untrack)((0, $kyEB6$catchify)(()=>read_previous_searches()));
6544
+ const current_query = read_search_query();
6545
+ if (!current_query) // don't save no query in history
6546
+ return;
6547
+ const new_value = [
6548
+ ...searches.filter((value)=>value !== current_query),
6549
+ current_query
6550
+ ].slice(-30); // keep max 30 values (one could be deleted later because it's the search query), if value we add already exists remove it first
6551
+ write_previous_searches(new_value);
6552
+ }));
6553
+ return previous_searches;
6554
+ }
6555
+
6556
+
6557
+
6558
+
6559
+ function $bfd908d13d90934c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ , search_param_name_: search_param_name_ , search_field_value_: [read_field_value, write_field_value] , search_query_: [read_search_query] , url_transformer_: url_transformer_ , on_submit_: on_submit_ = (0, $d1d4dbcadcf4cb02$export$26df08e242fe83a3) , after_submit_: after_submit_ }) {
6560
+ const new_search_query = (0, $kyEB6$untrack)(read_field_value);
6561
+ const previous_query = (0, $kyEB6$untrack)(read_search_query);
6562
+ if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
6563
+ // don't push a history entry / re-search if someone submits a search again
6564
+ // do close the modal though
6565
+ on_submit_with_unchanged_value_?.();
6566
+ return;
6567
+ }
6568
+ write_field_value(previous_query); // restore the value to the previous query since this one goes to the new history entry
6569
+ on_submit_(search_param_name_, new_search_query, url_transformer_);
6570
+ write_field_value(new_search_query);
6571
+ scrollTo(0, 0);
6572
+ after_submit_?.();
6573
+ }
6574
+
6575
+
6576
+
6577
+
6578
+ function $13e008d5237dbbee$export$2542ffb77b620b02(params_to_default_value) {
6579
+ const signals = {};
6580
+ const entries = Object.entries(params_to_default_value);
6581
+ for (const [param, default_value] of entries)signals[param] = (0, $kyEB6$createSignal)(default_value ?? "");
6582
+ const [exit_iterable, exitable_iterable] = (0, $kyEB6$make_asyncIterable_exiter)((0, $kyEB6$href_change_ipns));
6583
+ (0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(exit_iterable));
6584
+ (0, $kyEB6$catchify)(async ()=>{
6585
+ for await (const href of exitable_iterable){
6586
+ const { searchParams: searchParams } = new URL(href);
6587
+ for (const [param, default_value] of entries){
6588
+ const [_get, set] = signals[param];
6589
+ if (searchParams.has(param)) {
6590
+ const new_val = searchParams.get(param) ?? default_value ?? "";
6591
+ set(new_val);
6592
+ } else set(default_value ?? "");
6593
+ }
6594
+ }
6595
+ })();
6596
+ return signals;
6597
+ }
6598
+
6599
+
6600
+
6601
+
6602
+
6603
+
6604
+
6605
+
6606
+
6607
+
6608
+
6609
+
6610
+
6611
+
6612
+
6613
+
6614
+
6615
+
6616
+
6617
+
6618
+
6619
+
6620
+
6621
+
6622
+
6623
+
6624
+
6625
+
6626
+
6627
+
6628
+
6629
+ const $e003be2a50d9e5bc$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="orig price"></span>`, 2), $e003be2a50d9e5bc$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="brand"></span><span class="title"></span></div><div class="price-container"><span class="price"></span></div></div></a>`, 16), $e003be2a50d9e5bc$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="tagline"></div>`, 2);
6630
+ const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n })=>{
6631
+ // Support for Spendrups displays, should probably be in the Spendrups script
6632
+ const display = (0, $kyEB6$createMemo)(()=>{
6633
+ const display = display_or_variant_container();
6634
+ if (display.page_url) return display;
6635
+ if (!display?.variants?.length) return;
6636
+ return display.variants.filter((v)=>v.product_id == display.product_id)[0];
6637
+ });
6638
+ const image_url = (0, $kyEB6$createMemo)(()=>display().image_url);
6639
+ const contained_image = (0, $kyEB6$createMemo)(()=>(0, $kyEB6$ContainedImage)({
6640
+ aspect_ratio: 1,
6641
+ alt: "",
6642
+ // @ts-ignore
6643
+ "data-src": image_url(),
6644
+ srcset_opts: {
6645
+ set_dataset: true
6646
+ },
6647
+ init_with_placeholder: true
6648
+ }));
6649
+ const is_sale = (0, $kyEB6$createMemo)(()=>display().sale_price !== display().original_price);
6650
+ const returnVal = (()=>{
6651
+ const _el$ = $e003be2a50d9e5bc$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$9 = _el$7.firstChild;
6652
+ (0, $kyEB6$insert)(_el$2, contained_image);
6653
+ (0, $kyEB6$insert)(_el$5, ()=>display().brand);
6654
+ (0, $kyEB6$insert)(_el$6, ()=>display().title);
6655
+ (0, $kyEB6$insert)(_el$4, (()=>{
6656
+ const _c$ = (0, $kyEB6$memo)(()=>!!(display().sub_heading_1 || display().sub_heading_2));
6657
+ return ()=>_c$() && (()=>{
6658
+ const _el$10 = $e003be2a50d9e5bc$var$_tmpl$3.cloneNode(true);
6659
+ (0, $kyEB6$insert)(_el$10, ()=>[
6660
+ display().sub_heading_1,
6661
+ display().sub_heading_2
6662
+ ].filter((v)=>v).join(" | "));
6663
+ return _el$10;
6664
+ })();
6665
+ })(), null);
6666
+ (0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
6667
+ get when () {
6668
+ return is_sale();
6669
+ },
6670
+ get children () {
6671
+ const _el$8 = $e003be2a50d9e5bc$var$_tmpl$.cloneNode(true);
6672
+ (0, $kyEB6$insert)(_el$8, ()=>i18n.price_formatting_().pre_, null);
6673
+ (0, $kyEB6$insert)(_el$8, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
6674
+ price_: (0, $kyEB6$createMemo)(()=>display().original_price),
6675
+ price_formatting_: i18n.price_formatting_
6676
+ }), null);
6677
+ (0, $kyEB6$insert)(_el$8, ()=>i18n.price_formatting_().post_, null);
6678
+ return _el$8;
6679
+ }
6680
+ }), _el$9);
6681
+ (0, $kyEB6$insert)(_el$9, ()=>i18n.price_formatting_().pre_, null);
6682
+ (0, $kyEB6$insert)(_el$9, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
6683
+ price_: (0, $kyEB6$createMemo)(()=>display().sale_price),
6684
+ price_formatting_: i18n.price_formatting_
6685
+ }), null);
6686
+ (0, $kyEB6$insert)(_el$9, ()=>i18n.price_formatting_().post_, null);
6687
+ (0, $kyEB6$effect)((_p$)=>{
6688
+ const _v$ = display().page_url, _v$2 = !!is_sale();
6689
+ _v$ !== _p$._v$ && (0, $kyEB6$setAttribute)(_el$, "href", _p$._v$ = _v$);
6690
+ _v$2 !== _p$._v$2 && _el$9.classList.toggle("sales-price", _p$._v$2 = _v$2);
6691
+ return _p$;
6692
+ }, {
6693
+ _v$: undefined,
6694
+ _v$2: undefined
6695
+ });
6696
+ return _el$;
6697
+ })();
6698
+ // This solves a JSX type issue where the return value does not match with the explicit JSX.Element type for some reason
6699
+ return returnVal;
6700
+ };
6701
+
6702
+
6703
+ const $eea41f703612261b$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-results"></div>`, 2);
6704
+ function $eea41f703612261b$export$62f101a8aa597bf8({ depict_api_: depict_api_ , search_field_value_: [get_search_field_value] , tenant_: tenant_ , market_: market_ , render_instant_card_: render_instant_card_ , render_instant_card_placeholder_: render_instant_card_placeholder_ , min_products_to_fetch_: min_products_to_fetch_ , has_sort_or_filters_: has_sort_or_filters_ , set_num_results_accessor_: set_num_results_accessor_ , i18n_: i18n_ }) {
6705
+ const max_cards = 4;
6706
+ const [read_current_instant_query, write_current_instant_query] = (0, $kyEB6$createSignal)("");
6707
+ let timeout;
6708
+ (0, $kyEB6$createComputed)(()=>{
6709
+ const value = get_search_field_value();
6710
+ if (timeout == null) // don't wait if it's the first request
6711
+ write_current_instant_query(value);
6712
+ clearTimeout(timeout);
6713
+ timeout = setTimeout((0, $kyEB6$catchify)(()=>write_current_instant_query(value)), 250);
6714
+ });
6715
+ const [search_results] = (0, $kyEB6$createResource)((0, $kyEB6$createMemo)(()=>({
6716
+ tenant: tenant_(),
6717
+ market: market_(),
6718
+ query: read_current_instant_query()
6719
+ })), (0, $kyEB6$catchify)((variable_data)=>{
6720
+ return depict_api_.query({
6721
+ // here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
6722
+ limit: (0, $kyEB6$untrack)(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
6723
+ // if there's no sorting or filters we can fetch min_products_to_fetch_ many since then the cached request can be re-used by the search page, otherwise, no reason to waste bytes
6724
+ ...variable_data
6725
+ });
6726
+ }));
6727
+ set_num_results_accessor_(()=>(0, $511cc0abd9a64ce8$export$92f2da32c6e7e7ee)({
6728
+ search_results_: search_results,
6729
+ i18n_: i18n_
6730
+ }));
6731
+ const sliced_displays = (0, $kyEB6$createMemo)(()=>search_results()?.displays?.slice(0, max_cards));
6732
+ let placeholder;
6733
+ const container = (()=>{
6734
+ const _el$ = $eea41f703612261b$var$_tmpl$.cloneNode(true);
6735
+ (0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
6736
+ get when () {
6737
+ return sliced_displays()?.length;
6738
+ },
6739
+ get fallback () {
6740
+ return (0, $kyEB6$createMemo)(()=>{
6741
+ if (Array.isArray(search_results()?.displays)) // remove placeholders if we have a response but no results
6742
+ return undefined;
6743
+ return new Array(max_cards).fill(1).map(()=>(placeholder ||= render_instant_card_placeholder_()).cloneNode(true));
6744
+ })();
6745
+ },
6746
+ get children () {
6747
+ return (0, $kyEB6$createComponent)((0, $kyEB6$Index), {
6748
+ get each () {
6749
+ return sliced_displays();
6750
+ },
6751
+ children: (d, i)=>$eea41f703612261b$var$track_elements(d, i, // Custom instant card requires a re-render on every display update
6752
+ render_instant_card_ ? (0, $kyEB6$createMemo)(()=>render_instant_card_(d(), {
6753
+ index: i,
6754
+ i18n: i18n_,
6755
+ merchant: tenant_(),
6756
+ market: market_()
6757
+ })) : (0, $e003be2a50d9e5bc$export$b05c0ae390cf3e06)(d, {
6758
+ index: i,
6759
+ i18n: i18n_,
6760
+ merchant: tenant_(),
6761
+ market: market_()
6762
+ }), tenant_, market_)
6763
+ });
6764
+ }
6765
+ }));
6766
+ return _el$;
6767
+ })();
6768
+ new (0, $kyEB6$Lazyfier)({
6769
+ container: container,
6770
+ lazyfinder: {
6771
+ unload () {}
6772
+ },
6773
+ ignore_data_urls: true
6774
+ });
6775
+ return container;
6776
+ }
6777
+ function $eea41f703612261b$var$track_elements(display, index, elements, tenant, market) {
6778
+ const type = "instant_result";
6779
+ const unwrapped_elements = $eea41f703612261b$var$unwrap_solid_jsx_element(elements);
6493
6780
  const disconnectors = [];
6494
6781
  (0, $kyEB6$createComputed)(()=>{
6495
6782
  let stop = false;
@@ -6595,7 +6882,7 @@ function $4ceabea39c9a56ac$export$50b90be27d8502d9(el, [get_style_props, set_sty
6595
6882
 
6596
6883
 
6597
6884
 
6598
- function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , set_search_field_value_: set_search_field_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
6885
+ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , set_search_field_value_: set_search_field_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
6599
6886
  const [read_link, write_link] = (0, $kyEB6$createSignal)();
6600
6887
  const [exit_iterable, exitable_iterable] = (0, $kyEB6$make_asyncIterable_exiter)((0, $kyEB6$href_change_ipns));
6601
6888
  (0, $kyEB6$onCleanup)(exit_iterable);
@@ -6612,8 +6899,11 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
6612
6899
  if (e.button || e.metaKey || e.ctrlKey) // not button 0 or cmd/ctrl click
6613
6900
  return;
6614
6901
  e.preventDefault();
6615
- if (new URLSearchParams(location.search).get(param_) === value_) // don't do anything if we're already searching for this
6616
- return;
6902
+ if (new URLSearchParams(location.search).get(param_) === value_) {
6903
+ // don't do anything if we're already searching for this
6904
+ on_submit_with_unchanged_value_?.();
6905
+ return;
6906
+ }
6617
6907
  set_search_field_value_((0, $kyEB6$untrack)(get_search_query_)); // fill in old query in previous history entry before making new one, like we do in submit_query
6618
6908
  if (typeof alternative_query_submitter_for_spas_ === "function") alternative_query_submitter_for_spas_(param_, value_, url_transformer_);
6619
6909
  else {
@@ -6632,7 +6922,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
6632
6922
 
6633
6923
 
6634
6924
  const $7ad3a93cbe6fa208$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="previous-searches"><h2 class="text"></h2><div class="list"></div></div>`, 6), $7ad3a93cbe6fa208$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="item"><div class="left"><span></span></div><button class="delete"></button></a>`, 8);
6635
- function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_searches_: previous_searches_ , search_query_param_name_: search_query_param_name_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_unfiltered_previous_searches_: set_unfiltered_previous_searches_ , search_field_value_: search_field_value_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
6925
+ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_searches_: previous_searches_ , search_query_param_name_: search_query_param_name_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_unfiltered_previous_searches_: set_unfiltered_previous_searches_ , search_field_value_: search_field_value_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
6636
6926
  const has_entries = (0, $kyEB6$createMemo)(()=>previous_searches_().length >= 1);
6637
6927
  currently_showing_suggestions_[1]((value)=>{
6638
6928
  value[0] = (0, $kyEB6$createMemo)(()=>previous_searches_().map((result)=>({
@@ -6665,7 +6955,8 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_sea
6665
6955
  alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
6666
6956
  set_search_field_value_: search_field_value_[1],
6667
6957
  get_search_query_: get_search_query_,
6668
- after_submit_: after_submit_
6958
+ after_submit_: after_submit_,
6959
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
6669
6960
  }));
6670
6961
  return (()=>{
6671
6962
  const _el$4 = $7ad3a93cbe6fa208$var$_tmpl$2.cloneNode(true), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling;
@@ -6793,8 +7084,8 @@ function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
6793
7084
  }
6794
7085
 
6795
7086
 
6796
- const $cea52f6b24092f05$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="suggestion"></a>`, 2), $cea52f6b24092f05$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="search-icon"></div>`, 2), $cea52f6b24092f05$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="type"></span>`, 2), $cea52f6b24092f05$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><span class="value"></span></div>`, 4), $cea52f6b24092f05$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<h2 class="text"></h2>`, 2), $cea52f6b24092f05$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestion_container query"></div>`, 2), $cea52f6b24092f05$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestion_container page"></div>`, 2), $cea52f6b24092f05$var$_tmpl$8 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestions"></div>`, 2);
6797
- function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_ , search_field_value_: search_field_value_ , search_page_url_param_name_: search_page_url_param_name_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , filtered_previous_searches_: filtered_previous_searches_ , currently_showing_suggestions_: currently_showing_suggestions_ , on_previous_searches_page_: on_previous_searches_page_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , searching_for_value_: searching_for_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ }) {
7087
+ const $cea52f6b24092f05$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="suggestion"></a>`, 2), $cea52f6b24092f05$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="search-icon"></div>`, 2), $cea52f6b24092f05$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="type"></span>`, 2), $cea52f6b24092f05$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div><span class="value"></span></div>`, 4), $cea52f6b24092f05$var$_tmpl$5 = /*#__PURE__*/ (0, $kyEB6$template)(`<h2 class="text"></h2>`, 2), $cea52f6b24092f05$var$_tmpl$6 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestion-container query"></div>`, 2), $cea52f6b24092f05$var$_tmpl$7 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestion-container page"></div>`, 2), $cea52f6b24092f05$var$_tmpl$8 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="suggestions"></div>`, 2);
7088
+ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_ , search_field_value_: search_field_value_ , search_page_url_param_name_: search_page_url_param_name_ , selected_index_: [read_selected_index_, write_selected_index_] , url_transformer_: url_transformer_ , filtered_previous_searches_: filtered_previous_searches_ , currently_showing_suggestions_: currently_showing_suggestions_ , on_previous_searches_page_: on_previous_searches_page_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , searching_for_value_: searching_for_value_ , get_search_query_: get_search_query_ , after_submit_: after_submit_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
6798
7089
  const queries_memo = (0, $kyEB6$createMemo)(()=>suggestion_memo_().filter(({ type: type , title: title })=>type === (0, $a0eb8b431ec1f87b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
6799
7090
  ));
6800
7091
  const not_queries_memo = (0, $kyEB6$createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $a0eb8b431ec1f87b$export$3cf9497e790da491)));
@@ -6807,7 +7098,8 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
6807
7098
  alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
6808
7099
  get_search_query_: get_search_query_,
6809
7100
  set_search_field_value_: search_field_value_[1],
6810
- after_submit_: after_submit_
7101
+ after_submit_: after_submit_,
7102
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
6811
7103
  }) : undefined);
6812
7104
  const [href, set_href] = (0, $kyEB6$createSignal)();
6813
7105
  (0, $kyEB6$createComputed)(()=>{
@@ -6820,6 +7112,14 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
6820
7112
  (0, $kyEB6$use)((element)=>element.addEventListener("click", (0, $kyEB6$catchify)((ev)=>{
6821
7113
  // Viskan's Oscar Jacobson site requires us to add the event listener normally here. They do too much when this element is clicked. We work around it by blocking the event and just dispatching it non-bubbling on this element.
6822
7114
  if (is_query()) return param_change_obj().on_click_handler_(ev);
7115
+ else if (navigate_page_to_href_) {
7116
+ // single page navigate to category suggestions if enabled
7117
+ // object should have a href where we want to go
7118
+ if (ev.button || ev.metaKey || ev.ctrlKey) // not button 0 or cmd/ctrl click
7119
+ return;
7120
+ ev.preventDefault();
7121
+ navigate_page_to_href_(input_obj().page_url);
7122
+ }
6823
7123
  })), _el$);
6824
7124
  (0, $kyEB6$addEventListener)(_el$, "mouseleave", (0, $kyEB6$catchify)(()=>write_selected_index_(undefined)));
6825
7125
  (0, $kyEB6$addEventListener)(_el$, "mouseenter", (0, $kyEB6$catchify)(()=>write_selected_index_([
@@ -6994,6 +7294,9 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
6994
7294
 
6995
7295
 
6996
7296
 
7297
+
7298
+
7299
+ const $15f380f0ce2812cc$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<a target="_blank"></a>`, 2);
6997
7300
  function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index] , currently_showing_suggestions_: [read_currently_showing_suggestions] , ...rest_of_props }) {
6998
7301
  const last_suggestion_index_ = (0, $kyEB6$createMemo)(()=>{
6999
7302
  const currently_showing_suggestions = read_currently_showing_suggestions();
@@ -7048,7 +7351,7 @@ function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_sele
7048
7351
  write_selected_fake_index_: write_selected_fake_index_
7049
7352
  });
7050
7353
  }
7051
- function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_: element_ , search_field_value_: [get_search_field_value, set_search_field_value] , updating_blocked_: [read_updating_blocked, write_updating_blocked] , last_suggestion_index_: last_suggestion_index_ , read_selected_fake_index_: read_selected_fake_index_ , write_selected_fake_index_: write_selected_fake_index_ , set_override_on_enter_fn_: set_override_on_enter_fn_ }) {
7354
+ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_: element_ , search_field_value_: [get_search_field_value, set_search_field_value] , updating_blocked_: [read_updating_blocked, write_updating_blocked] , last_suggestion_index_: last_suggestion_index_ , read_selected_fake_index_: read_selected_fake_index_ , write_selected_fake_index_: write_selected_fake_index_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , navigate_page_to_href_: navigate_page_to_href_ , url_transformer_: url_transformer_ , search_query_param_name_: search_query_param_name_ }) {
7052
7355
  let previous_value;
7053
7356
  (0, $kyEB6$createEffect)(()=>{
7054
7357
  const sfv = get_search_field_value();
@@ -7070,21 +7373,37 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
7070
7373
  calls++;
7071
7374
  });
7072
7375
  };
7073
- // update text field value if needed
7074
- if (selected_entry?.type == "query") {
7075
- block_updating_for_one_change();
7076
- set_search_field_value(selected_entry.title);
7077
- } else if (selected_entry?.type == "category") {
7078
- set_override_on_enter_fn_(()=>{
7079
- location.href = selected_entry.page_url;
7080
- return true;
7081
- });
7376
+ const override_on_enter_for_this_entry = (new_fn)=>{
7377
+ set_override_on_enter_fn_(new_fn);
7378
+ // Only override while this item has been selected with the keyboard
7082
7379
  (0, $kyEB6$createComputed)((run)=>{
7083
7380
  if (!run) read_selected_fake_index_();
7084
7381
  else set_override_on_enter_fn_(()=>false);
7085
7382
  return run + 1;
7086
7383
  }, 0);
7087
- } else {
7384
+ };
7385
+ // update text field value if needed
7386
+ if (selected_entry?.type == "query") {
7387
+ const { title: title } = selected_entry;
7388
+ block_updating_for_one_change();
7389
+ set_search_field_value(title);
7390
+ override_on_enter_for_this_entry((e)=>{
7391
+ // Open search query in new tab on cmd+enter
7392
+ const url = new URL(location);
7393
+ url_transformer_?.(url);
7394
+ url.searchParams.set(search_query_param_name_, title);
7395
+ return $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, url.href);
7396
+ });
7397
+ } else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
7398
+ const { page_url: page_url } = selected_entry;
7399
+ if (!$15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, page_url)) {
7400
+ // Above fn will return true if it opened a new tab, and we won't make these checks anymore
7401
+ if (navigate_page_to_href_) navigate_page_to_href_(page_url);
7402
+ else location.href = page_url;
7403
+ }
7404
+ return true;
7405
+ });
7406
+ else if (!selected_entry) {
7088
7407
  block_updating_for_one_change();
7089
7408
  set_search_field_value(previous_value);
7090
7409
  }
@@ -7096,10 +7415,25 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
7096
7415
  (0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(()=>el.removeEventListener("keyup", handler)));
7097
7416
  });
7098
7417
  }
7418
+ function $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, href) {
7419
+ if (e.metaKey || e.ctrlKey) {
7420
+ // Open link in a new tab with cmd/ctrl + enter.
7421
+ const link = (()=>{
7422
+ const _el$ = $15f380f0ce2812cc$var$_tmpl$.cloneNode(true);
7423
+ (0, $kyEB6$setAttribute)(_el$, "href", href);
7424
+ return _el$;
7425
+ })();
7426
+ document.body.append(link);
7427
+ link.click();
7428
+ link.remove();
7429
+ return true;
7430
+ }
7431
+ return false;
7432
+ }
7099
7433
 
7100
7434
 
7101
7435
  const $a0eb8b431ec1f87b$export$3cf9497e790da491 = "query";
7102
- function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_ , search_query_: [get_search_query_] , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: unfiltered_previous_searches , previous_searches_text_: previous_searches_text_ , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , input_field_: input_field_ , url_transformer_: url_transformer_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , selected_index_: selected_index_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , after_submit_: after_submit_ }) {
7436
+ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_ , search_query_: [get_search_query_] , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: unfiltered_previous_searches , previous_searches_text_: previous_searches_text_ , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , input_field_: input_field_ , url_transformer_: url_transformer_ , currently_showing_suggestions_: currently_showing_suggestions_ , set_override_on_enter_fn_: set_override_on_enter_fn_ , selected_index_: selected_index_ , i18n_: i18n_ , include_category_suggestions_: include_category_suggestions_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , after_submit_: after_submit_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
7103
7437
  const [searching_for_value, set_searching_for_value] = (0, $kyEB6$createSignal)();
7104
7438
  const [read_search_field_value] = search_field_value_;
7105
7439
  const updating_blocked = (0, $kyEB6$createSignal)(false);
@@ -7139,7 +7473,10 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
7139
7473
  search_field_value_: search_field_value_,
7140
7474
  updating_blocked_: updating_blocked,
7141
7475
  currently_showing_suggestions_: currently_showing_suggestions_,
7142
- set_override_on_enter_fn_: set_override_on_enter_fn_
7476
+ set_override_on_enter_fn_: set_override_on_enter_fn_,
7477
+ search_query_param_name_: search_page_url_param_name_,
7478
+ url_transformer_: url_transformer_,
7479
+ navigate_page_to_href_: navigate_page_to_href_
7143
7480
  });
7144
7481
  return [
7145
7482
  (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
@@ -7163,7 +7500,8 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
7163
7500
  url_transformer_: url_transformer_,
7164
7501
  get_search_query_: get_search_query_,
7165
7502
  alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
7166
- after_submit_: after_submit_
7503
+ after_submit_: after_submit_,
7504
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
7167
7505
  });
7168
7506
  }
7169
7507
  }),
@@ -7190,7 +7528,9 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
7190
7528
  currently_showing_suggestions_: currently_showing_suggestions_,
7191
7529
  get_search_query_: get_search_query_,
7192
7530
  include_category_suggestions_: include_category_suggestions_,
7193
- after_submit_: after_submit_
7531
+ after_submit_: after_submit_,
7532
+ navigate_page_to_href_: navigate_page_to_href_,
7533
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
7194
7534
  })
7195
7535
  ];
7196
7536
  }
@@ -7252,8 +7592,9 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: ge
7252
7592
  }
7253
7593
 
7254
7594
 
7595
+
7255
7596
  const $fabfda1230351b1a$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="discover-more"><button class="major" type="button"></button></div>`, 4), $fabfda1230351b1a$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<b></b>`, 2), $fabfda1230351b1a$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict-search-modal"><div class="body"><div class="padded"></div></div></div>`, 6), $fabfda1230351b1a$var$_tmpl$4 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp search"><div class="depict-search-modal-backdrop"></div></div>`, 4);
7256
- function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search_field_value_ , search_query_: search_query_ , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: previous_searches_ , close_modal_: close_modal_ , style_props_: style_props_ = (0, $kyEB6$createSignal)({}) , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , submit_query_: submit_query_ , instant_results_options_: instant_results_options_ , register_closing_animation_: register_closing_animation_ , url_transformer_: url_transformer_ , closing_animation_: closing_animation_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , clear_filters_: clear_filters_ , i18n_: i18n_ , disable_scrolling_: disable_scrolling_ = true , enable_category_suggestions_: enable_category_suggestions_ , class_list_: class_list_ , after_submit_: after_submit_ , bottom_distance_under_modal_: bottom_distance_under_modal_ }) {
7597
+ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search_field_value_ , search_query_: search_query_ , search_page_url_param_name_: search_page_url_param_name_ , previous_searches_: previous_searches_ , close_modal_: close_modal_ , style_props_: style_props_ = (0, $kyEB6$createSignal)({}) , depict_api_: depict_api_ , tenant_: tenant_ , market_: market_ , submit_query_: submit_query_ , instant_results_options_: instant_results_options_ , register_closing_animation_: register_closing_animation_ , url_transformer_: url_transformer_ , closing_animation_: closing_animation_ , alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_ , clear_filters_: clear_filters_ , i18n_: i18n_ , disable_scrolling_: disable_scrolling_ = true , enable_category_suggestions_: enable_category_suggestions_ , class_list_: class_list_ , after_submit_: after_submit_ , bottom_distance_under_modal_: bottom_distance_under_modal_ , navigate_page_to_href_: navigate_page_to_href_ , on_submit_with_unchanged_value_: on_submit_with_unchanged_value_ }) {
7257
7598
  let on_enter_in_query_input_function;
7258
7599
  const [input_field, set_input_field] = (0, $kyEB6$createSignal)();
7259
7600
  const [get_search_field_value_] = search_field_value_;
@@ -7333,7 +7674,9 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
7333
7674
  url_transformer_: url_transformer_,
7334
7675
  i18n_: i18n_,
7335
7676
  include_category_suggestions_: enable_category_suggestions_ ?? true,
7336
- after_submit_: after_submit_
7677
+ after_submit_: after_submit_,
7678
+ navigate_page_to_href_: navigate_page_to_href_,
7679
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
7337
7680
  });
7338
7681
  }
7339
7682
  }), null);
@@ -7362,7 +7705,15 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
7362
7705
  const _el$7 = $fabfda1230351b1a$var$_tmpl$4.cloneNode(true), _el$8 = _el$7.firstChild;
7363
7706
  (0, $kyEB6$addEventListener)(_el$8, "click", close_modal_, true);
7364
7707
  (0, $kyEB6$insert)(_el$7, modal_element, null);
7365
- (0, $kyEB6$effect)((_$p)=>(0, $kyEB6$classList)(_el$7, class_list_?.(), _$p));
7708
+ (0, $kyEB6$effect)((_p$)=>{
7709
+ const _v$ = (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_MODAL, _v$2 = class_list_?.();
7710
+ _v$ !== _p$._v$ && (0, $kyEB6$setAttribute)(_el$7, "id", _p$._v$ = _v$);
7711
+ _p$._v$2 = (0, $kyEB6$classList)(_el$7, _v$2, _p$._v$2);
7712
+ return _p$;
7713
+ }, {
7714
+ _v$: undefined,
7715
+ _v$2: undefined
7716
+ });
7366
7717
  return _el$7;
7367
7718
  })()
7368
7719
  ];
@@ -7409,6 +7760,8 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
7409
7760
 
7410
7761
 
7411
7762
 
7763
+
7764
+
7412
7765
  const $793905995512612d$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="category-suggestions"></div>`, 2), $793905995512612d$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="category-suggestion"></div>`, 2);
7413
7766
  function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_ , children: children , selected_filters_: selected_filters_ , slider_arrow_button_: slider_arrow_button_ }) {
7414
7767
  const category_suggestions_ = (0, $kyEB6$createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
@@ -7461,130 +7814,6 @@ function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
7461
7814
 
7462
7815
 
7463
7816
 
7464
- const $172e1b898d457050$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="cards"></div>`, 2), $172e1b898d457050$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="search-recs"><h3 class="search-recs-title"></h3></div>`, 4), $172e1b898d457050$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<button class="show_more major" type="button"></button>`, 2);
7465
- const $172e1b898d457050$export$1c8c715550dc689d = 2;
7466
- function $172e1b898d457050$export$7de92c4c2205ebf3({ depict_api_: depict_api_ , i18n_: i18n_ , tenant_object_: tenant_object_ , search_query_base_: search_query_base_ , rr_options_: rr_options_ , showing_recommendation_rows_: showing_recommendation_rows_ , view_more_button_: view_more_button_ = true , layout_options_: layout_options_ }) {
7467
- const [is_showing_something, set_is_showing_something] = (0, $kyEB6$createSignal)(false);
7468
- const cards = $172e1b898d457050$var$_tmpl$.cloneNode(true);
7469
- const on_next_render = [];
7470
- const main_element = (()=>{
7471
- const _el$2 = $172e1b898d457050$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
7472
- (0, $kyEB6$insert)(_el$3, ()=>i18n_.search_recs_title_());
7473
- (0, $kyEB6$insert)(_el$2, cards, null);
7474
- return _el$2;
7475
- })();
7476
- const [get_showing_recommendation_rows] = showing_recommendation_rows_;
7477
- const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
7478
- const cleanup_old_cards = [];
7479
- (0, $kyEB6$Layout)({
7480
- container_element: cards,
7481
- layout: "grid",
7482
- rows: rows_object,
7483
- ...layout_options_
7484
- }).catch((e)=>(0, $kyEB6$report)([
7485
- e,
7486
- "Layout failed"
7487
- ], "error"));
7488
- // copied from RecommendationGrid
7489
- // convoluted lazy loading that
7490
- // when the elements are in the DOM starts IntersectionObserver on whole grid
7491
- // when grid intersects starts Lazyfier
7492
- // this is because Lazyfier is fucking stupid
7493
- (0, $kyEB6$observer).wait_for_element(cards).then((0, $kyEB6$catchify)((element)=>{
7494
- let start_lazy_loading;
7495
- const lazy_loading_promise = new Promise((r)=>start_lazy_loading = r);
7496
- const lf = new (0, $kyEB6$Lazyfier)({
7497
- only_load_intersecting: true,
7498
- wait_for_dominsertion: lazy_loading_promise,
7499
- ignore_data_urls: true,
7500
- lazyfinder: {
7501
- unload () {}
7502
- }
7503
- });
7504
- lf.start_observing_for_new_children_(element);
7505
- const i_o = new IntersectionObserver((0, $kyEB6$catchify)((records)=>{
7506
- for (const record of records)if (record.intersectionRatio > 0) {
7507
- start_lazy_loading();
7508
- i_o.disconnect();
7509
- return;
7510
- }
7511
- }));
7512
- i_o.observe(cards);
7513
- }));
7514
- const deparallelized_recs_fetcher = (0, $kyEB6$deparallelize_no_drop)((0, $kyEB6$catchify)(async (base_query)=>{
7515
- const recs_promise = depict_api_.get_recommended(base_query).then((r)=>r.displays);
7516
- // create owner to run product cards with an Owner, so they know when they've gotten removed
7517
- const [owner_for_cards, dispose_our_cards] = (0, $kyEB6$createRoot)((dispose)=>[
7518
- (0, $kyEB6$getOwner)(),
7519
- dispose
7520
- ]);
7521
- const rendering_result = await (await (0, $kyEB6$make_placeholder_rr)({
7522
- // render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
7523
- num_items: (0, $7747fe1a8c5652e3$export$6c9030e511152266) + (0, $kyEB6$untrack)(get_showing_recommendation_rows) * Math.max(...layout_options_.cols_at_size.map(([per_column])=>per_column))
7524
- }))(tenant_object_, {
7525
- type: "search_recs",
7526
- recs: recs_promise,
7527
- ...rr_options_,
7528
- ...typeof rr_options_.template === "function" ? {
7529
- template: (...args)=>(0, $kyEB6$runWithOwner)(owner_for_cards, ()=>// give template the possibility to know when it gets removed from the DOM by using solid-js onCleanup
7530
- rr_options_.template(...args))
7531
- } : {}
7532
- });
7533
- const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
7534
- let dead = false;
7535
- while(on_next_render.length)on_next_render.pop()();
7536
- on_next_render.push(()=>dead = true);
7537
- if (!elements) {
7538
- set_is_showing_something(false);
7539
- return;
7540
- }
7541
- cards.replaceChildren(...elements);
7542
- // Dispose the old cards just after the cards have been removed from the DOM
7543
- cleanup_old_cards.forEach((cleanup_function)=>cleanup_function());
7544
- cleanup_old_cards.push(dispose_our_cards); // push after calling, so that we don't instantly demolish ourselves lol
7545
- set_is_showing_something(true);
7546
- should_stay_inserted?.then((should)=>{
7547
- if (!should && !dead /* just in case */ ) set_is_showing_something(false);
7548
- });
7549
- }));
7550
- (0, $kyEB6$createRenderEffect)(()=>deparallelized_recs_fetcher(search_query_base_()));
7551
- (0, $kyEB6$onCleanup)(()=>cleanup_old_cards.forEach((fn)=>fn())); // if everything gets cleaned up without new cards replacing the old ones, clean up the last cards
7552
- return (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
7553
- get when () {
7554
- return is_showing_something();
7555
- },
7556
- children: main_element
7557
- });
7558
- }
7559
- function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
7560
- const ipns = (0, $kyEB6$async_iterable_ipns)();
7561
- const rows = {
7562
- ipns: ipns,
7563
- start_rows: (0, $kyEB6$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
7564
- rows_per_click: 3,
7565
- button: (()=>{
7566
- const _el$4 = $172e1b898d457050$var$_tmpl$3.cloneNode(true);
7567
- (0, $kyEB6$insert)(_el$4, ()=>i18n_.view_more_());
7568
- return _el$4;
7569
- })()
7570
- };
7571
- (0, $kyEB6$catchify)(async ()=>{
7572
- for await (const number of ipns)set_showing_recommendation_rows(number);
7573
- })();
7574
- (0, $kyEB6$createComputed)((0, $kyEB6$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>{
7575
- if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
7576
- }, {
7577
- defer: true
7578
- }));
7579
- return rows;
7580
- }
7581
-
7582
-
7583
-
7584
-
7585
-
7586
-
7587
-
7588
7817
 
7589
7818
 
7590
7819
  const $f8c929beb82c512b$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<b></b>`, 2), $f8c929beb82c512b$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="results-for"></div>`, 2);
@@ -7614,6 +7843,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ search_query_: search_query
7614
7843
 
7615
7844
 
7616
7845
 
7846
+
7617
7847
  const $7097477c78a89208$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="filter-results-for-one-row"></div>`, 2), $7097477c78a89208$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp search"><div class="listing-page"></div></div>`, 4);
7618
7848
  function $7097477c78a89208$export$a54ec244c8863715(opts) {
7619
7849
  const { depict_api_: depict_api_ , search_field_value_: search_field_value_ , search_query_: 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_ , slider_arrow_button_: slider_arrow_button_ , 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_ , rr_options_: rr_options_ , recommendations_rr_options_: recommendations_rr_options_ = rr_options_ , search_recs_view_more_: search_recs_view_more_ , get_product_id_: get_product_id_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ } = opts;
@@ -7891,6 +8121,7 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
7891
8121
  });
7892
8122
  }
7893
8123
  }), null);
8124
+ (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$2, "id", (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_PAGE));
7894
8125
  return _el$2;
7895
8126
  })()
7896
8127
  ];
@@ -7899,102 +8130,6 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
7899
8130
 
7900
8131
 
7901
8132
 
7902
-
7903
-
7904
-
7905
-
7906
-
7907
-
7908
-
7909
-
7910
-
7911
- const $ba4105f38be0a8e0$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="orig price"></span>`, 2), $ba4105f38be0a8e0$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="instant-card"><div class="img_part"></div><div class="right_part"><div class="title_brand"><span class="brand"></span><span class="title"></span></div><div class="price_container"><span class="price"></span></div></div></a>`, 16);
7912
- function $ba4105f38be0a8e0$export$3b5becc25bbaed73(display, _index, get_fake_rendering_options, i18n_) {
7913
- const image_url = (0, $kyEB6$createMemo)(()=>display().image_url);
7914
- const contained_image = (0, $kyEB6$createMemo)(()=>(0, $kyEB6$ContainedImage)({
7915
- aspect_ratio: 1,
7916
- alt: "",
7917
- // @ts-ignore
7918
- "data-src": image_url(),
7919
- rendering_options: (0, $kyEB6$untrack)(()=>get_fake_rendering_options()),
7920
- srcset_opts: {
7921
- set_dataset: true
7922
- },
7923
- init_with_placeholder: true
7924
- }));
7925
- const is_sale = (0, $kyEB6$createMemo)(()=>display().sale_price !== display().original_price);
7926
- return (()=>{
7927
- const _el$ = $ba4105f38be0a8e0$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling, _el$7 = _el$4.nextSibling, _el$9 = _el$7.firstChild;
7928
- (0, $kyEB6$insert)(_el$2, contained_image);
7929
- (0, $kyEB6$insert)(_el$5, ()=>display().brand);
7930
- (0, $kyEB6$insert)(_el$6, ()=>display().title);
7931
- (0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
7932
- get when () {
7933
- return is_sale();
7934
- },
7935
- get children () {
7936
- const _el$8 = $ba4105f38be0a8e0$var$_tmpl$.cloneNode(true);
7937
- (0, $kyEB6$insert)(_el$8, ()=>i18n_.price_formatting_().pre_, null);
7938
- (0, $kyEB6$insert)(_el$8, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
7939
- price_: (0, $kyEB6$createMemo)(()=>display().original_price),
7940
- price_formatting_: i18n_.price_formatting_
7941
- }), null);
7942
- (0, $kyEB6$insert)(_el$8, ()=>i18n_.price_formatting_().post_, null);
7943
- return _el$8;
7944
- }
7945
- }), _el$9);
7946
- (0, $kyEB6$insert)(_el$9, ()=>i18n_.price_formatting_().pre_, null);
7947
- (0, $kyEB6$insert)(_el$9, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
7948
- price_: (0, $kyEB6$createMemo)(()=>display().sale_price),
7949
- price_formatting_: i18n_.price_formatting_
7950
- }), null);
7951
- (0, $kyEB6$insert)(_el$9, ()=>i18n_.price_formatting_().post_, null);
7952
- (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "href", display().page_url));
7953
- return _el$;
7954
- })();
7955
- }
7956
-
7957
-
7958
-
7959
-
7960
-
7961
-
7962
-
7963
-
7964
-
7965
-
7966
-
7967
-
7968
-
7969
- const $897bd4a76f611b38$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="parent_title"></span>`, 2), $897bd4a76f611b38$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<a class="category-suggestion"><span class="title"></span></a>`, 4);
7970
- function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
7971
- return (()=>{
7972
- const _el$ = $897bd4a76f611b38$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
7973
- (0, $kyEB6$addEventListener)(_el$, "click", (0, $kyEB6$catchify)((e)=>{
7974
- if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
7975
- return;
7976
- return on_navigation_?.(category_suggestion_().page_url);
7977
- }), true);
7978
- (0, $kyEB6$insert)(_el$2, ()=>category_suggestion_().title);
7979
- (0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
7980
- get when () {
7981
- return typeof category_suggestion_().parent_title === "string";
7982
- },
7983
- get children () {
7984
- const _el$3 = $897bd4a76f611b38$var$_tmpl$.cloneNode(true);
7985
- (0, $kyEB6$insert)(_el$3, ()=>category_suggestion_().parent_title);
7986
- return _el$3;
7987
- }
7988
- }), null);
7989
- (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "href", category_suggestion_().page_url));
7990
- return _el$;
7991
- })();
7992
- }
7993
- (0, $kyEB6$delegateEvents)([
7994
- "click"
7995
- ]);
7996
-
7997
-
7998
8133
  const $b5cccc8ee7d24677$var$transform_elements = (sorted_cols_at_size)=>{
7999
8134
  const cols_at_size = [];
8000
8135
  for(let i = 0; i < sorted_cols_at_size.length; i++){
@@ -8041,6 +8176,8 @@ const $b5cccc8ee7d24677$export$6daf8749b65a1b77 = (cols_at_size)=>{
8041
8176
 
8042
8177
 
8043
8178
 
8179
+
8180
+
8044
8181
  const $59f48be661ca9195$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp search"></div>`, 2);
8045
8182
  /**
8046
8183
  * Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
@@ -8053,7 +8190,8 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
8053
8190
  #market_signal = (0, $kyEB6$createSignal)();
8054
8191
  #modal_open_signal = (0, $kyEB6$createSignal)(false);
8055
8192
  static #has_been_constructed = false;
8056
- constructor({ search_query_url_param_name: search_query_url_param_name = "search_query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , ...props_on_class }){
8193
+ constructor({ search_query_url_param_name: search_query_url_param_name = "search_query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
8194
+ disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , render_instant_card: render_instant_card , ...props_on_class }){
8057
8195
  if ($59f48be661ca9195$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
8058
8196
  Object.assign(this, props_on_class);
8059
8197
  const alternative_query_submitter_for_spas_ = on_navigation && ((search_param_name, new_search_query, url_transformer)=>{
@@ -8080,12 +8218,13 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
8080
8218
  [search_query_url_param_name]: ""
8081
8219
  });
8082
8220
  const search_query_signal_ = (0, $kyEB6$createSignal)((0, $kyEB6$untrack)(raw_search_query_signal[0]));
8083
- const depict_api_ = new (0, $7fa23e2a0079eca4$export$e015ed2f2950f2e3)();
8221
+ const depict_api_ = api ?? new (0, $7fa23e2a0079eca4$export$e015ed2f2950f2e3)();
8084
8222
  const previous_searches = (0, $21f51c14cb3f586f$export$84bba84a7b837187)(search_query_signal_);
8085
8223
  const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
8086
8224
  const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $172e1b898d457050$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
8225
+ const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
8087
8226
  const configured_submit_query_ = ()=>(0, $bfd908d13d90934c$export$e16630ecb9644a1c)({
8088
- on_submit_with_unchanged_value_: ()=>this.modal_open = false,
8227
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
8089
8228
  search_field_value_: state_.search_field_value,
8090
8229
  search_query_: search_query_signal_,
8091
8230
  search_param_name_: search_query_url_param_name,
@@ -8143,14 +8282,18 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
8143
8282
  submit_query_: configured_submit_query_,
8144
8283
  alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
8145
8284
  url_transformer_: url_transformer,
8285
+ navigate_page_to_href_: on_navigation,
8286
+ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
8146
8287
  instant_results_options_: {
8147
8288
  min_products_to_fetch_: $59f48be661ca9195$var$min_products_to_fetch_,
8148
- render_instant_card_: (0, $ba4105f38be0a8e0$export$3b5becc25bbaed73),
8289
+ render_instant_card_: render_instant_card,
8149
8290
  render_instant_card_placeholder_: (0, $bb15dfb548a7666e$export$ee1733d9a8495996),
8150
8291
  has_sort_or_filters_: (0, $kyEB6$createMemo)(()=>!!(Object.keys(state_.search_selected_filters[0]())?.length || state_.search_sorting[0]()))
8151
8292
  },
8152
8293
  i18n_: i18n_,
8153
- enable_category_suggestions_: enable_category_suggestions
8294
+ enable_category_suggestions_: enable_category_suggestions,
8295
+ disable_scrolling_: disable_scrolling_during_modal,
8296
+ bottom_distance_under_modal_: bottom_distance_under_modal_
8154
8297
  });
8155
8298
  // This will add some default behaviour to open_modal_ if no style_props_ are supplied
8156
8299
  // The default behaviour is to align the modal with the input field if possible
@@ -8186,21 +8329,16 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
8186
8329
  }
8187
8330
  // Open centered modal
8188
8331
  const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
8189
- const slim = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-width: 600px)");
8190
8332
  const desktop_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 790px)");
8191
8333
  const mobile_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 1000px)");
8192
- const transform_x = (0, $kyEB6$createSignal)(false);
8193
- const transform_y = (0, $kyEB6$createSignal)(false);
8334
+ const transform_y = (0, $kyEB6$createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
8194
8335
  const style_props_ = (0, $kyEB6$createSignal)({
8195
8336
  position: "fixed",
8196
- top: "50%",
8197
- left: "50%"
8337
+ top: "50%"
8198
8338
  });
8199
- (0, $kyEB6$createComputed)(()=>transform_y[1](supports_hover() ? !desktop_short() : !mobile_short()));
8200
- (0, $kyEB6$createComputed)(()=>transform_x[1](transform_y[0]() || !slim()));
8201
8339
  (0, $kyEB6$createComputed)(()=>style_props_[1]((old_value)=>({
8202
8340
  ...old_value,
8203
- transform: transform_x[0]() && transform_y[0]() ? "translate(-50%,-50%)" : transform_x[0]() ? "translateX(-50%)" : transform_y[0]() ? "translateY(-50%)" : "unset"
8341
+ transform: transform_y() ? "translateY(-50%)" : "unset"
8204
8342
  })));
8205
8343
  if (signal_value_is_options) {
8206
8344
  const [options_arg1, ...rest1] = open_signal_value;
@@ -8248,8 +8386,14 @@ function $59f48be661ca9195$var$get_shared_properties(depict_search) {
8248
8386
  if (!shared_properties) throw new Error("Can't connect to provided DepictSearch instance");
8249
8387
  return shared_properties;
8250
8388
  }
8251
- function $59f48be661ca9195$export$f2dc7e4e4aa11abb({ depict_search: depict_search , include_input_field: include_input_field , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id = (0, $kyEB6$normal_get_product_id) }) {
8389
+ function $59f48be661ca9195$export$f2dc7e4e4aa11abb({ depict_search: depict_search , include_input_field: include_input_field , grid_spacing: grid_spacing , cols_at_size: cols_at_size , product_card_template: product_card_template , get_product_id: get_product_id = (0, $kyEB6$normal_get_product_id) , extra_depict_options: extra_depict_options }) {
8252
8390
  const shared_properties = $59f48be661ca9195$var$get_shared_properties(depict_search);
8391
+ const grid_spacing_override = typeof grid_spacing === "string" ? {
8392
+ grid_spacing: grid_spacing
8393
+ } : {
8394
+ override_vertical_spacing: grid_spacing.vertical,
8395
+ grid_spacing: grid_spacing.horizontal
8396
+ };
8253
8397
  return $59f48be661ca9195$var$run_in_root_or_auto_cleanup(()=>{
8254
8398
  const { state_: state_ } = shared_properties;
8255
8399
  (0, $kyEB6$onCleanup)(shared_properties.reset_history_state_);
@@ -8299,25 +8443,26 @@ function $59f48be661ca9195$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
8299
8443
  include_input_field_: include_input_field,
8300
8444
  layout_options_: {
8301
8445
  cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(cols_at_size),
8302
- ...typeof grid_spacing === "string" ? {
8303
- grid_spacing: grid_spacing
8304
- } : {
8305
- override_vertical_spacing: grid_spacing.vertical,
8306
- grid_spacing: grid_spacing.horizontal
8307
- }
8446
+ ...grid_spacing_override
8308
8447
  },
8448
+ recommendations_layout_options_: extra_depict_options?.recommendations_cols_at_size ? {
8449
+ cols_at_size: (0, $b5cccc8ee7d24677$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
8450
+ ...grid_spacing_override
8451
+ } : undefined,
8309
8452
  slider_arrow_button_: (0, $kyEB6$GenericSliderArrowButton)({
8310
8453
  height_: 12,
8311
8454
  width_: 6.46
8312
8455
  }),
8313
8456
  rr_options_: {
8314
- template: product_card_template
8457
+ template: product_card_template,
8458
+ pre_processors: extra_depict_options?.pre_processors,
8459
+ post_processors: extra_depict_options?.post_processors
8315
8460
  },
8316
8461
  get_product_id_: get_product_id
8317
8462
  });
8318
8463
  }, "Entire SearchPage failed");
8319
8464
  }
8320
- function $59f48be661ca9195$export$b94867ecbd698f21({ depict_search: depict_search , modal_dispose_handler: modal_dispose_handler }) {
8465
+ function $59f48be661ca9195$export$b94867ecbd698f21({ depict_search: depict_search , modal_dispose_handler: modal_dispose_handler , click_handler: click_handler }) {
8321
8466
  const shared_properties = $59f48be661ca9195$var$get_shared_properties(depict_search);
8322
8467
  return $59f48be661ca9195$var$run_in_root_or_auto_cleanup(()=>{
8323
8468
  const input = (0, $kyEB6$createComponent)((0, $857105c41ea47bee$export$ff21851bb5d30e15), {
@@ -8338,7 +8483,7 @@ function $59f48be661ca9195$export$b94867ecbd698f21({ depict_search: depict_searc
8338
8483
  },
8339
8484
  disabled_: true,
8340
8485
  field_element_ref_: (field)=>{
8341
- const handler = (0, $kyEB6$catchify)(()=>{
8486
+ const handler = click_handler ?? (0, $kyEB6$catchify)(()=>{
8342
8487
  depict_search.modal_open = [
8343
8488
  {
8344
8489
  style_props_: style_props_
@@ -8358,6 +8503,7 @@ function $59f48be661ca9195$export$b94867ecbd698f21({ depict_search: depict_searc
8358
8503
  (()=>{
8359
8504
  const _el$ = $59f48be661ca9195$var$_tmpl$.cloneNode(true);
8360
8505
  (0, $kyEB6$insert)(_el$, input);
8506
+ (0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "id", (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_MODAL));
8361
8507
  return _el$;
8362
8508
  })()
8363
8509
  ];