@depict-ai/ui 0.0.7 → 0.0.9
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/index.d.ts +12 -1
- package/dist/main.js +656 -485
- package/dist/module.js +658 -489
- package/package.json +2 -2
package/dist/module.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {dlog as $kyEB6$dlog, 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, make_url_with_query_params as $kyEB6$make_url_with_query_params, fetch_retry as $kyEB6$fetch_retry, sort_obj as $kyEB6$sort_obj, version as $kyEB6$version, 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";
|
|
2
|
+
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";
|
|
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
|
+
/*! Depict.ai search and product listing SDK */
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -116,6 +117,17 @@ const $a79d86d64fb64e8e$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
|
116
117
|
|
|
117
118
|
|
|
118
119
|
|
|
120
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "0.0.9";
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Adds things to the object we send to backend as a header to report the package versions used
|
|
125
|
+
*/ const $8d80d8d4afb6dcd3$export$89a2f5e6eb5005b6 = {};
|
|
126
|
+
function $8d80d8d4afb6dcd3$export$2cefb7e61fcbae00(stuff_to_add) {
|
|
127
|
+
Object.assign($8d80d8d4afb6dcd3$export$89a2f5e6eb5005b6, stuff_to_add);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
119
131
|
const $7fa23e2a0079eca4$var$v2_base_url = (0, $kyEB6$base_url) + "/v2/";
|
|
120
132
|
const $7fa23e2a0079eca4$var$search_base_url = $7fa23e2a0079eca4$var$v2_base_url + "search/";
|
|
121
133
|
const $7fa23e2a0079eca4$var$add_ids_to_request = (input_req)=>{
|
|
@@ -151,9 +163,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
151
163
|
const results = await (0, $kyEB6$fetch_retry)(url, {
|
|
152
164
|
headers: {
|
|
153
165
|
"Content-Type": "text/plain",
|
|
154
|
-
|
|
155
|
-
"X-DEBUG": "true"
|
|
156
|
-
} : {}
|
|
166
|
+
...$7fa23e2a0079eca4$var$get_version_headers()
|
|
157
167
|
}
|
|
158
168
|
});
|
|
159
169
|
attempt_to_return_api_response: {
|
|
@@ -184,7 +194,8 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
184
194
|
try {
|
|
185
195
|
const search_results = await (0, $kyEB6$fetch_retry)(endpoint1, {
|
|
186
196
|
headers: {
|
|
187
|
-
"Content-Type": "text/plain"
|
|
197
|
+
"Content-Type": "text/plain",
|
|
198
|
+
...$7fa23e2a0079eca4$var$get_version_headers()
|
|
188
199
|
},
|
|
189
200
|
method: "POST",
|
|
190
201
|
body: body
|
|
@@ -199,7 +210,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
199
210
|
resolve_in_progress(result);
|
|
200
211
|
setTimeout((0, $kyEB6$catchify)(()=>{
|
|
201
212
|
if (this.#supports_finalization_registry) cache_obj.finalization_registry_.register(result, body); // delete key from cache when value (WeakRefs) are collected
|
|
202
|
-
else // delete things from cache after 5 minutes so it doesn't get too heavy
|
|
213
|
+
else // delete things from cache after 5 minutes, so it doesn't get too heavy
|
|
203
214
|
setTimeout((0, $kyEB6$catchify)(()=>delete cache_obj.cache_[body]), 300000);
|
|
204
215
|
}), 30000 // cache values for at least 30 seconds
|
|
205
216
|
);
|
|
@@ -236,6 +247,15 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
236
247
|
}));
|
|
237
248
|
}
|
|
238
249
|
}
|
|
250
|
+
function $7fa23e2a0079eca4$var$get_version_headers() {
|
|
251
|
+
return {
|
|
252
|
+
Versions: JSON.stringify({
|
|
253
|
+
...(0, $8d80d8d4afb6dcd3$export$89a2f5e6eb5005b6),
|
|
254
|
+
"@depict-ai/utilishared": (0, $kyEB6$version),
|
|
255
|
+
"@depict-ai/ui": (0, $ec291e0010116877$export$83d89fbfd8236492)
|
|
256
|
+
})
|
|
257
|
+
};
|
|
258
|
+
}
|
|
239
259
|
|
|
240
260
|
|
|
241
261
|
|
|
@@ -476,7 +496,7 @@ async function $5c5f95951393e5d1$var$download_categories(tenant, market) {
|
|
|
476
496
|
|
|
477
497
|
|
|
478
498
|
|
|
479
|
-
const $bb15dfb548a7666e$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-card"><div class="
|
|
499
|
+
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
500
|
function $bb15dfb548a7666e$export$ee1733d9a8495996() {
|
|
481
501
|
return (()=>{
|
|
482
502
|
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 +555,21 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
535
555
|
} : {}
|
|
536
556
|
}));
|
|
537
557
|
};
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
558
|
+
let ro;
|
|
559
|
+
if (one_axies_only !== "top") {
|
|
560
|
+
ro = new ResizeObserver((0, $kyEB6$catchify)((records)=>{
|
|
561
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
562
|
+
if (width_transformer) width = width_transformer(width);
|
|
563
|
+
modal_body_style[1]((old_value)=>({
|
|
564
|
+
...old_value,
|
|
565
|
+
"max-width": "unset",
|
|
566
|
+
width: `${width}px`
|
|
567
|
+
}));
|
|
568
|
+
});
|
|
569
|
+
align_position();
|
|
570
|
+
}));
|
|
571
|
+
ro.observe(input_field);
|
|
572
|
+
}
|
|
549
573
|
window.addEventListener("resize", align_position);
|
|
550
574
|
window.addEventListener("orientationchange", align_position);
|
|
551
575
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
@@ -555,7 +579,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
555
579
|
resize_resize_observer.observe(document.documentElement);
|
|
556
580
|
(0, $kyEB6$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
557
581
|
(0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(()=>{
|
|
558
|
-
ro
|
|
582
|
+
ro?.disconnect();
|
|
559
583
|
resize_resize_observer.disconnect();
|
|
560
584
|
window.removeEventListener("resize", align_position);
|
|
561
585
|
window.removeEventListener("orientationchange", align_position);
|
|
@@ -1772,6 +1796,8 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
1772
1796
|
|
|
1773
1797
|
|
|
1774
1798
|
|
|
1799
|
+
|
|
1800
|
+
|
|
1775
1801
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value) {
|
|
1776
1802
|
const signals = {};
|
|
1777
1803
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -1826,6 +1852,8 @@ function $a8fa7302d6f93c0b$export$9862539c89138352(get_default_values) {
|
|
|
1826
1852
|
|
|
1827
1853
|
|
|
1828
1854
|
|
|
1855
|
+
|
|
1856
|
+
|
|
1829
1857
|
const $fc5a12f3a857ca30$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
1830
1858
|
const maybe_meta = (0, $kyEB6$untrack)(available_filters_)?.find(({ op: op , field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
1831
1859
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
@@ -2548,9 +2576,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
2548
2576
|
duration: duration_ ?? 250,
|
|
2549
2577
|
delay: delay_ ?? 0
|
|
2550
2578
|
});
|
|
2551
|
-
const toggle = ()=>props.is_open_[1](!(0, $kyEB6$untrack)(()=>props.is_open_ /* reactive getter */ [0]()));
|
|
2552
2579
|
const [is_in_dom, set_is_in_dom] = (0, $kyEB6$createSignal)(document.documentElement.contains(details_));
|
|
2553
|
-
|
|
2580
|
+
// 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
|
|
2581
|
+
const is_open_memo = (0, $kyEB6$createMemo)(()=>props.is_open_[0]());
|
|
2582
|
+
const toggle = ()=>props.is_open_[1](!(0, $kyEB6$untrack)(is_open_memo));
|
|
2554
2583
|
(0, $kyEB6$insert)(details_, [
|
|
2555
2584
|
summary_,
|
|
2556
2585
|
(0, $kyEB6$createComponent)(ExpandingContainer, {
|
|
@@ -2571,8 +2600,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
2571
2600
|
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
2601
|
await expand(0, do_duration);
|
|
2573
2602
|
} else {
|
|
2603
|
+
const closeModal = (0, $kyEB6$catchify)(()=>{
|
|
2604
|
+
/*
|
|
2605
|
+
TODO: we currently should not enable the following line, since it causes the following bug:
|
|
2606
|
+
https://linear.app/depictai/issue/FRO-413/on-estoreno-the-browser-crashes-when-expandingcollapsing-filtre-on
|
|
2607
|
+
It seems to be a chrome issue and a bug has been reported to them:
|
|
2608
|
+
https://bugs.chromium.org/p/chromium/issues/detail?id=1404121#c2 */ // details_.open = false;
|
|
2609
|
+
});
|
|
2574
2610
|
const animation = await collapse();
|
|
2575
|
-
animation.addEventListener("finish",
|
|
2611
|
+
animation.addEventListener("finish", closeModal);
|
|
2576
2612
|
}
|
|
2577
2613
|
}));
|
|
2578
2614
|
details_.addEventListener("toggle", (0, $kyEB6$catchify)(()=>{
|
|
@@ -2995,7 +3031,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2995
3031
|
|
|
2996
3032
|
|
|
2997
3033
|
|
|
2998
|
-
const $87c712b5b33f24f7$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<span class="count"></span>`, 2), $87c712b5b33f24f7$var$_tmpl$2 = /*#__PURE__*/ (0, $kyEB6$template)(`<label class="
|
|
3034
|
+
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
3035
|
const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
|
|
3000
3036
|
const id = (0, $kyEB6$make_random_classname)();
|
|
3001
3037
|
return /* We can't use actual margin because ExpandingContainer gets messed up */ (()=>{
|
|
@@ -3038,7 +3074,7 @@ const $87c712b5b33f24f7$export$48513f6b9f8ce62d = (props)=>{
|
|
|
3038
3074
|
|
|
3039
3075
|
|
|
3040
3076
|
|
|
3041
|
-
const $67b173f9db427028$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button type="button" class="
|
|
3077
|
+
const $67b173f9db427028$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<button type="button" class="expand-filter"><span></span></button>`, 4);
|
|
3042
3078
|
function $67b173f9db427028$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras] , i18n_: i18n_ }) {
|
|
3043
3079
|
return (()=>{
|
|
3044
3080
|
const _el$ = $67b173f9db427028$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
|
|
@@ -3172,7 +3208,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
3172
3208
|
|
|
3173
3209
|
|
|
3174
3210
|
|
|
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="
|
|
3211
|
+
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
3212
|
function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected_filters_ , filter_: filter_ }) {
|
|
3177
3213
|
const radio_name = (0, $kyEB6$make_random_classname)();
|
|
3178
3214
|
const existing_filter = (0, $kyEB6$createMemo)(()=>{
|
|
@@ -3251,7 +3287,7 @@ function $eb8d9bf3b5700c26$export$430444115f70a734({ selected_filters_: selected
|
|
|
3251
3287
|
|
|
3252
3288
|
|
|
3253
3289
|
|
|
3254
|
-
const $a6b08770e164eced$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="range"><div class="
|
|
3290
|
+
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
3291
|
function $a6b08770e164eced$export$e0d834a0ad870cda({ filter_: filter_ , selected_filters_: selected_filters_ , i18n_: i18n_ }) {
|
|
3256
3292
|
const current_range = (0, $kyEB6$createSignal)((0, $kyEB6$untrack)(()=>filter_().data));
|
|
3257
3293
|
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 +3615,7 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({ expanded_: expanded_ , i18n
|
|
|
3579
3615
|
|
|
3580
3616
|
|
|
3581
3617
|
|
|
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="
|
|
3618
|
+
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
3619
|
const $1c8cac76cb67e9af$var$max_visible_without_collapsing = 7;
|
|
3584
3620
|
const $1c8cac76cb67e9af$var$show_non_collapsible_when_collapsed = 4;
|
|
3585
3621
|
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 +3735,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
3699
3735
|
typeof _ref$ === "function" ? (0, $kyEB6$use)(_ref$, _el$) : form = _el$;
|
|
3700
3736
|
(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
3737
|
(0, $kyEB6$insert)(_el$, expanding_container_els, null);
|
|
3702
|
-
(0, $kyEB6$effect)(()=>_el$.classList.toggle("
|
|
3738
|
+
(0, $kyEB6$effect)(()=>_el$.classList.toggle("any-expandable", !!Object.values(structured_categories()).some((category)=>Object.keys(category.children_).length)));
|
|
3703
3739
|
return _el$;
|
|
3704
3740
|
})();
|
|
3705
3741
|
}
|
|
@@ -3755,7 +3791,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
3755
3791
|
}
|
|
3756
3792
|
return are_checked;
|
|
3757
3793
|
});
|
|
3758
|
-
(0, $kyEB6$createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("
|
|
3794
|
+
(0, $kyEB6$createEffect)(()=>input.classList[any_kids_checked() ? "add" : "remove"]("fake-checked"));
|
|
3759
3795
|
}
|
|
3760
3796
|
}), null);
|
|
3761
3797
|
(0, $kyEB6$insert)(_el$2, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
@@ -4339,7 +4375,7 @@ function $b7436a6d1fd64e3b$export$b69d0d92862de18b(props) {
|
|
|
4339
4375
|
|
|
4340
4376
|
|
|
4341
4377
|
|
|
4342
|
-
const $fab07f52c9861732$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="
|
|
4378
|
+
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
4379
|
function $fab07f52c9861732$export$3f1a388cc0d8fed7(props) {
|
|
4344
4380
|
// Split like this to make placeholder wrapping more visible & this component is exported and used in MobileModal
|
|
4345
4381
|
return (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
@@ -4568,7 +4604,7 @@ function $fab07f52c9861732$var$ActualFilterBody(props) {
|
|
|
4568
4604
|
|
|
4569
4605
|
|
|
4570
4606
|
|
|
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="
|
|
4607
|
+
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
4608
|
function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: available_sortings_ , current_sorting_: current_sorting_ }) {
|
|
4573
4609
|
const title_radio_name = (0, $kyEB6$make_random_classname)();
|
|
4574
4610
|
const order_radio_name = (0, $kyEB6$make_random_classname)();
|
|
@@ -4675,8 +4711,8 @@ function $68a258a92b88f02f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
4675
4711
|
|
|
4676
4712
|
|
|
4677
4713
|
|
|
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="
|
|
4679
|
-
const $757dac7f7c6c5241$var$no_go_selector = ".range .
|
|
4714
|
+
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);
|
|
4715
|
+
const $757dac7f7c6c5241$var$no_go_selector = ".range .range-group";
|
|
4680
4716
|
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
4717
|
(0, $aea1edf92433e81e$export$fe334901e8bebd57)();
|
|
4682
4718
|
let modal;
|
|
@@ -4946,7 +4982,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4946
4982
|
|
|
4947
4983
|
|
|
4948
4984
|
|
|
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="
|
|
4985
|
+
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
4986
|
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
4987
|
return (0, $b7436a6d1fd64e3b$export$b69d0d92862de18b)({
|
|
4952
4988
|
severity_: "error",
|
|
@@ -5178,7 +5214,7 @@ function $cdea4cf8c5c071ef$var$OpenSortingButton({ i18n_: i18n_ , current_sortin
|
|
|
5178
5214
|
|
|
5179
5215
|
|
|
5180
5216
|
|
|
5181
|
-
const $0b0380f75d729d63$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="
|
|
5217
|
+
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
5218
|
function $0b0380f75d729d63$export$b23abd26de154ede(props) {
|
|
5183
5219
|
const [is_small, set_is_small] = (0, $kyEB6$createSignal)(true);
|
|
5184
5220
|
(0, $kyEB6$onCleanup)((0, $kyEB6$javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
@@ -5293,7 +5329,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
5293
5329
|
(0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$ArrowUp), {}));
|
|
5294
5330
|
(0, $kyEB6$effect)((_p$)=>{
|
|
5295
5331
|
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("
|
|
5332
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("show-them", _p$._v$ = _v$);
|
|
5297
5333
|
_v$2 !== _p$._v$2 && (0, $kyEB6$setAttribute)(_el$2, "aria-label", _p$._v$2 = _v$2);
|
|
5298
5334
|
_v$3 !== _p$._v$3 && (0, $kyEB6$setAttribute)(_el$4, "aria-label", _p$._v$3 = _v$3);
|
|
5299
5335
|
_v$4 !== _p$._v$4 && (0, $kyEB6$setAttribute)(_el$6, "aria-label", _p$._v$4 = _v$4);
|
|
@@ -5694,6 +5730,14 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
|
|
|
5694
5730
|
|
|
5695
5731
|
|
|
5696
5732
|
|
|
5733
|
+
let $f86ba724282f6690$export$44dad306455dddf;
|
|
5734
|
+
(function(DEPICT_ID) {
|
|
5735
|
+
DEPICT_ID["SEARCH_MODAL"] = "depict-search-modal";
|
|
5736
|
+
DEPICT_ID["SEARCH_PAGE"] = "depict-search-page";
|
|
5737
|
+
DEPICT_ID["PLP_CATEGORY"] = "depict-plp-category";
|
|
5738
|
+
})($f86ba724282f6690$export$44dad306455dddf || ($f86ba724282f6690$export$44dad306455dddf = {}));
|
|
5739
|
+
|
|
5740
|
+
|
|
5697
5741
|
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
5742
|
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
5743
|
return (0, $kyEB6$createRoot)((dispose)=>{
|
|
@@ -5888,7 +5932,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5888
5932
|
get_breadcrumb_accessor_?.(crumb_data_);
|
|
5889
5933
|
get_quicklinks_accessor_?.(quicklinks_data_);
|
|
5890
5934
|
return [
|
|
5891
|
-
document.createComment("
|
|
5935
|
+
document.createComment("Category page based on Depict SDK"),
|
|
5892
5936
|
(()=>{
|
|
5893
5937
|
const _el$5 = $df5d81d0fe61ff21$var$_tmpl$4.cloneNode(true), _el$6 = _el$5.firstChild;
|
|
5894
5938
|
(0, $kyEB6$insert)(_el$6, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
@@ -5994,6 +6038,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5994
6038
|
});
|
|
5995
6039
|
}
|
|
5996
6040
|
}), null);
|
|
6041
|
+
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$5, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
|
|
5997
6042
|
return _el$5;
|
|
5998
6043
|
})()
|
|
5999
6044
|
];
|
|
@@ -6038,6 +6083,7 @@ function $90980bd87c9960f9$var$proxy_push_state(function_name, thing) {
|
|
|
6038
6083
|
}
|
|
6039
6084
|
|
|
6040
6085
|
|
|
6086
|
+
|
|
6041
6087
|
const $9653a36120f642b0$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp category"></div>`, 2);
|
|
6042
6088
|
class $9653a36120f642b0$export$3a8840c5b2ecf003 {
|
|
6043
6089
|
#locale_signal = (0, $kyEB6$createSignal)();
|
|
@@ -6058,7 +6104,11 @@ class $9653a36120f642b0$export$3a8840c5b2ecf003 {
|
|
|
6058
6104
|
}
|
|
6059
6105
|
get #external_area_div() {
|
|
6060
6106
|
// creates a new node every time this is accessed, doing like this for DRY purposes
|
|
6061
|
-
return
|
|
6107
|
+
return (()=>{
|
|
6108
|
+
const _el$ = $9653a36120f642b0$var$_tmpl$.cloneNode(true);
|
|
6109
|
+
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "id", (0, $f86ba724282f6690$export$44dad306455dddf).PLP_CATEGORY));
|
|
6110
|
+
return _el$;
|
|
6111
|
+
})();
|
|
6062
6112
|
}
|
|
6063
6113
|
get locale_() {
|
|
6064
6114
|
// allow reactive access
|
|
@@ -6188,113 +6238,42 @@ class $9653a36120f642b0$export$3a8840c5b2ecf003 {
|
|
|
6188
6238
|
|
|
6189
6239
|
|
|
6190
6240
|
|
|
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
6241
|
|
|
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
6242
|
|
|
6256
6243
|
|
|
6257
6244
|
|
|
6258
6245
|
|
|
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
6246
|
|
|
6275
6247
|
|
|
6276
6248
|
|
|
6277
6249
|
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6250
|
+
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);
|
|
6251
|
+
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
|
|
6252
|
+
return (()=>{
|
|
6253
|
+
const _el$ = $897bd4a76f611b38$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
6254
|
+
(0, $kyEB6$addEventListener)(_el$, "click", (0, $kyEB6$catchify)((e)=>{
|
|
6255
|
+
if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
|
|
6256
|
+
return;
|
|
6257
|
+
return on_navigation_?.(category_suggestion_().page_url);
|
|
6258
|
+
}), true);
|
|
6259
|
+
(0, $kyEB6$insert)(_el$2, ()=>category_suggestion_().title);
|
|
6260
|
+
(0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
6261
|
+
get when () {
|
|
6262
|
+
return typeof category_suggestion_().parent_title === "string";
|
|
6263
|
+
},
|
|
6264
|
+
get children () {
|
|
6265
|
+
const _el$3 = $897bd4a76f611b38$var$_tmpl$.cloneNode(true);
|
|
6266
|
+
(0, $kyEB6$insert)(_el$3, ()=>category_suggestion_().parent_title);
|
|
6267
|
+
return _el$3;
|
|
6293
6268
|
}
|
|
6294
|
-
}
|
|
6269
|
+
}), null);
|
|
6270
|
+
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "href", category_suggestion_().page_url));
|
|
6271
|
+
return _el$;
|
|
6295
6272
|
})();
|
|
6296
|
-
return signals;
|
|
6297
6273
|
}
|
|
6274
|
+
(0, $kyEB6$delegateEvents)([
|
|
6275
|
+
"click"
|
|
6276
|
+
]);
|
|
6298
6277
|
|
|
6299
6278
|
|
|
6300
6279
|
|
|
@@ -6308,20 +6287,7 @@ function $13e008d5237dbbee$export$2542ffb77b620b02(params_to_default_value) {
|
|
|
6308
6287
|
|
|
6309
6288
|
|
|
6310
6289
|
|
|
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);
|
|
6290
|
+
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
6291
|
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
6292
|
let input_field;
|
|
6327
6293
|
(0, $kyEB6$createEffect)((0, $kyEB6$catchify)(async ()=>{
|
|
@@ -6351,7 +6317,6 @@ function $857105c41ea47bee$export$ff21851bb5d30e15({ search_field_value_: search
|
|
|
6351
6317
|
once: true
|
|
6352
6318
|
});
|
|
6353
6319
|
}
|
|
6354
|
-
(0, $kyEB6$dlog)("select", e);
|
|
6355
6320
|
}));
|
|
6356
6321
|
(0, $kyEB6$addEventListener)(_el$4, "input", (0, $kyEB6$catchify)(()=>{
|
|
6357
6322
|
const { value: value } = input_field;
|
|
@@ -6420,65 +6385,405 @@ function $857105c41ea47bee$export$ff21851bb5d30e15({ search_field_value_: search
|
|
|
6420
6385
|
|
|
6421
6386
|
|
|
6422
6387
|
|
|
6423
|
-
const $
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
const [
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
});
|
|
6435
|
-
const [
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6388
|
+
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);
|
|
6389
|
+
const $172e1b898d457050$export$1c8c715550dc689d = 2;
|
|
6390
|
+
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_ }) {
|
|
6391
|
+
const [is_showing_something, set_is_showing_something] = (0, $kyEB6$createSignal)(false);
|
|
6392
|
+
const cards = $172e1b898d457050$var$_tmpl$.cloneNode(true);
|
|
6393
|
+
const on_next_render = [];
|
|
6394
|
+
const main_element = (()=>{
|
|
6395
|
+
const _el$2 = $172e1b898d457050$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
6396
|
+
(0, $kyEB6$insert)(_el$3, ()=>i18n_.search_recs_title_());
|
|
6397
|
+
(0, $kyEB6$insert)(_el$2, cards, null);
|
|
6398
|
+
return _el$2;
|
|
6399
|
+
})();
|
|
6400
|
+
const [get_showing_recommendation_rows] = showing_recommendation_rows_;
|
|
6401
|
+
const rows_object = view_more_button_ ? $172e1b898d457050$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6402
|
+
const cleanup_old_cards = [];
|
|
6403
|
+
(0, $kyEB6$Layout)({
|
|
6404
|
+
container_element: cards,
|
|
6405
|
+
layout: "grid",
|
|
6406
|
+
rows: rows_object,
|
|
6407
|
+
...layout_options_
|
|
6408
|
+
}).catch((e)=>(0, $kyEB6$report)([
|
|
6409
|
+
e,
|
|
6410
|
+
"Layout failed"
|
|
6411
|
+
], "error"));
|
|
6412
|
+
// copied from RecommendationGrid
|
|
6413
|
+
// convoluted lazy loading that
|
|
6414
|
+
// when the elements are in the DOM starts IntersectionObserver on whole grid
|
|
6415
|
+
// when grid intersects starts Lazyfier
|
|
6416
|
+
// this is because Lazyfier is fucking stupid
|
|
6417
|
+
(0, $kyEB6$observer).wait_for_element(cards).then((0, $kyEB6$catchify)((element)=>{
|
|
6418
|
+
let start_lazy_loading;
|
|
6419
|
+
const lazy_loading_promise = new Promise((r)=>start_lazy_loading = r);
|
|
6420
|
+
const lf = new (0, $kyEB6$Lazyfier)({
|
|
6421
|
+
only_load_intersecting: true,
|
|
6422
|
+
wait_for_dominsertion: lazy_loading_promise,
|
|
6423
|
+
ignore_data_urls: true,
|
|
6424
|
+
lazyfinder: {
|
|
6425
|
+
unload () {}
|
|
6426
|
+
}
|
|
6445
6427
|
});
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
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
|
-
});
|
|
6428
|
+
lf.start_observing_for_new_children_(element);
|
|
6429
|
+
const i_o = new IntersectionObserver((0, $kyEB6$catchify)((records)=>{
|
|
6430
|
+
for (const record of records)if (record.intersectionRatio > 0) {
|
|
6431
|
+
start_lazy_loading();
|
|
6432
|
+
i_o.disconnect();
|
|
6433
|
+
return;
|
|
6477
6434
|
}
|
|
6478
6435
|
}));
|
|
6479
|
-
|
|
6480
|
-
})
|
|
6481
|
-
|
|
6436
|
+
i_o.observe(cards);
|
|
6437
|
+
}));
|
|
6438
|
+
const deparallelized_recs_fetcher = (0, $kyEB6$deparallelize_no_drop)((0, $kyEB6$catchify)(async (base_query)=>{
|
|
6439
|
+
const recs_promise = depict_api_.get_recommended(base_query).then((r)=>r.displays);
|
|
6440
|
+
// create owner to run product cards with an Owner, so they know when they've gotten removed
|
|
6441
|
+
const [owner_for_cards, dispose_our_cards] = (0, $kyEB6$createRoot)((dispose)=>[
|
|
6442
|
+
(0, $kyEB6$getOwner)(),
|
|
6443
|
+
dispose
|
|
6444
|
+
]);
|
|
6445
|
+
const rendering_result = await (await (0, $kyEB6$make_placeholder_rr)({
|
|
6446
|
+
// render the max amount of elements that there could be, to make sure scroll restoration works (placeholders can't be shorter than actual content)
|
|
6447
|
+
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))
|
|
6448
|
+
}))(tenant_object_, {
|
|
6449
|
+
type: "search_recs",
|
|
6450
|
+
recs: recs_promise,
|
|
6451
|
+
...rr_options_,
|
|
6452
|
+
...typeof rr_options_.template === "function" ? {
|
|
6453
|
+
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
|
|
6454
|
+
rr_options_.template(...args))
|
|
6455
|
+
} : {}
|
|
6456
|
+
});
|
|
6457
|
+
const { elements: elements , should_stay_inserted: should_stay_inserted } = rendering_result;
|
|
6458
|
+
let dead = false;
|
|
6459
|
+
while(on_next_render.length)on_next_render.pop()();
|
|
6460
|
+
on_next_render.push(()=>dead = true);
|
|
6461
|
+
if (!elements) {
|
|
6462
|
+
set_is_showing_something(false);
|
|
6463
|
+
return;
|
|
6464
|
+
}
|
|
6465
|
+
cards.replaceChildren(...elements);
|
|
6466
|
+
// Dispose the old cards just after the cards have been removed from the DOM
|
|
6467
|
+
cleanup_old_cards.forEach((cleanup_function)=>cleanup_function());
|
|
6468
|
+
cleanup_old_cards.push(dispose_our_cards); // push after calling, so that we don't instantly demolish ourselves lol
|
|
6469
|
+
set_is_showing_something(true);
|
|
6470
|
+
should_stay_inserted?.then((should)=>{
|
|
6471
|
+
if (!should && !dead /* just in case */ ) set_is_showing_something(false);
|
|
6472
|
+
});
|
|
6473
|
+
}));
|
|
6474
|
+
(0, $kyEB6$createRenderEffect)(()=>deparallelized_recs_fetcher(search_query_base_()));
|
|
6475
|
+
(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
|
|
6476
|
+
return (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
6477
|
+
get when () {
|
|
6478
|
+
return is_showing_something();
|
|
6479
|
+
},
|
|
6480
|
+
children: main_element
|
|
6481
|
+
});
|
|
6482
|
+
}
|
|
6483
|
+
function $172e1b898d457050$var$make_state_saved_rows([get_showing_recommendation_rows, set_showing_recommendation_rows], i18n_) {
|
|
6484
|
+
const ipns = (0, $kyEB6$async_iterable_ipns)();
|
|
6485
|
+
const rows = {
|
|
6486
|
+
ipns: ipns,
|
|
6487
|
+
start_rows: (0, $kyEB6$untrack)(get_showing_recommendation_rows) ?? $172e1b898d457050$export$1c8c715550dc689d,
|
|
6488
|
+
rows_per_click: 3,
|
|
6489
|
+
button: (()=>{
|
|
6490
|
+
const _el$4 = $172e1b898d457050$var$_tmpl$3.cloneNode(true);
|
|
6491
|
+
(0, $kyEB6$insert)(_el$4, ()=>i18n_.view_more_());
|
|
6492
|
+
return _el$4;
|
|
6493
|
+
})()
|
|
6494
|
+
};
|
|
6495
|
+
(0, $kyEB6$catchify)(async ()=>{
|
|
6496
|
+
for await (const number of ipns)set_showing_recommendation_rows(number);
|
|
6497
|
+
})();
|
|
6498
|
+
(0, $kyEB6$createComputed)((0, $kyEB6$on)(get_showing_recommendation_rows, (new_rows = $172e1b898d457050$export$1c8c715550dc689d)=>{
|
|
6499
|
+
if (ipns.latest_call_value !== new_rows && ipns.state !== new_rows) ipns(new_rows);
|
|
6500
|
+
}, {
|
|
6501
|
+
defer: true
|
|
6502
|
+
}));
|
|
6503
|
+
return rows;
|
|
6504
|
+
}
|
|
6505
|
+
|
|
6506
|
+
|
|
6507
|
+
|
|
6508
|
+
|
|
6509
|
+
|
|
6510
|
+
|
|
6511
|
+
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_ }) {
|
|
6512
|
+
const [get_selected_filters, set_selected_filters] = selected_filters_;
|
|
6513
|
+
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
|
|
6514
|
+
const [get_clear_filters_next_submit, set_clear_filters_next_submit] = clear_filters_next_submit_;
|
|
6515
|
+
const clear_filters = ()=>set_clear_filters_next_submit(true);
|
|
6516
|
+
(0, $kyEB6$createComputed)((0, $kyEB6$on)(get_selected_filters, ()=>{
|
|
6517
|
+
// if the selected filters update, clear the clearing signal
|
|
6518
|
+
set_clear_filters_next_submit(false);
|
|
6519
|
+
}, {
|
|
6520
|
+
defer: true
|
|
6521
|
+
}));
|
|
6522
|
+
(0, $kyEB6$createComputed)((0, $kyEB6$on)(get_search_query, (0, $kyEB6$catchify)(()=>{
|
|
6523
|
+
// when a query was submitted, clear filters if clear was pressed before
|
|
6524
|
+
if ((0, $kyEB6$untrack)(get_clear_filters_next_submit)) {
|
|
6525
|
+
set_clear_filters_next_submit(false);
|
|
6526
|
+
set_selected_filters([]);
|
|
6527
|
+
// also collapse expanded filters in hierarchical filter tree again
|
|
6528
|
+
expanded_hierarchical_filters_[1]([]);
|
|
6529
|
+
// also clear sorting
|
|
6530
|
+
current_sorting_[1](undefined);
|
|
6531
|
+
(0, $e9342fb3ac73a54a$export$8895d39404bd2bb1)({
|
|
6532
|
+
user_triggered_: true,
|
|
6533
|
+
selected_filters_: selected_filters_,
|
|
6534
|
+
i18n_: i18n_,
|
|
6535
|
+
also_clear_sorting_: true,
|
|
6536
|
+
current_sorting_: current_sorting_,
|
|
6537
|
+
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
6538
|
+
local_filter_cache_: local_filter_cache_
|
|
6539
|
+
});
|
|
6540
|
+
}
|
|
6541
|
+
}), {
|
|
6542
|
+
defer: true
|
|
6543
|
+
}));
|
|
6544
|
+
return clear_filters;
|
|
6545
|
+
}
|
|
6546
|
+
|
|
6547
|
+
|
|
6548
|
+
|
|
6549
|
+
|
|
6550
|
+
|
|
6551
|
+
function $21f51c14cb3f586f$export$84bba84a7b837187(search_query) {
|
|
6552
|
+
const ls = localStorage;
|
|
6553
|
+
const key = "depict_searches";
|
|
6554
|
+
const previous_searches = (0, $kyEB6$createSignal)(JSON.parse(ls[key] || "[]"));
|
|
6555
|
+
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
6556
|
+
const [read_search_query] = search_query;
|
|
6557
|
+
(0, $kyEB6$createEffect)((0, $kyEB6$catchify)(()=>{
|
|
6558
|
+
const json_encoded = JSON.stringify(read_previous_searches());
|
|
6559
|
+
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
6560
|
+
}));
|
|
6561
|
+
(0, $kyEB6$createComputed)((0, $kyEB6$catchify)(()=>{
|
|
6562
|
+
const searches = (0, $kyEB6$untrack)((0, $kyEB6$catchify)(()=>read_previous_searches()));
|
|
6563
|
+
const current_query = read_search_query();
|
|
6564
|
+
if (!current_query) // don't save no query in history
|
|
6565
|
+
return;
|
|
6566
|
+
const new_value = [
|
|
6567
|
+
...searches.filter((value)=>value !== current_query),
|
|
6568
|
+
current_query
|
|
6569
|
+
].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
|
|
6570
|
+
write_previous_searches(new_value);
|
|
6571
|
+
}));
|
|
6572
|
+
return previous_searches;
|
|
6573
|
+
}
|
|
6574
|
+
|
|
6575
|
+
|
|
6576
|
+
|
|
6577
|
+
|
|
6578
|
+
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_ }) {
|
|
6579
|
+
const new_search_query = (0, $kyEB6$untrack)(read_field_value);
|
|
6580
|
+
const previous_query = (0, $kyEB6$untrack)(read_search_query);
|
|
6581
|
+
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
6582
|
+
// don't push a history entry / re-search if someone submits a search again
|
|
6583
|
+
// do close the modal though
|
|
6584
|
+
on_submit_with_unchanged_value_?.();
|
|
6585
|
+
return;
|
|
6586
|
+
}
|
|
6587
|
+
write_field_value(previous_query); // restore the value to the previous query since this one goes to the new history entry
|
|
6588
|
+
on_submit_(search_param_name_, new_search_query, url_transformer_);
|
|
6589
|
+
write_field_value(new_search_query);
|
|
6590
|
+
scrollTo(0, 0);
|
|
6591
|
+
after_submit_?.();
|
|
6592
|
+
}
|
|
6593
|
+
|
|
6594
|
+
|
|
6595
|
+
|
|
6596
|
+
|
|
6597
|
+
function $13e008d5237dbbee$export$2542ffb77b620b02(params_to_default_value) {
|
|
6598
|
+
const signals = {};
|
|
6599
|
+
const entries = Object.entries(params_to_default_value);
|
|
6600
|
+
for (const [param, default_value] of entries)signals[param] = (0, $kyEB6$createSignal)(default_value ?? "");
|
|
6601
|
+
const [exit_iterable, exitable_iterable] = (0, $kyEB6$make_asyncIterable_exiter)((0, $kyEB6$href_change_ipns));
|
|
6602
|
+
(0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(exit_iterable));
|
|
6603
|
+
(0, $kyEB6$catchify)(async ()=>{
|
|
6604
|
+
for await (const href of exitable_iterable){
|
|
6605
|
+
const { searchParams: searchParams } = new URL(href);
|
|
6606
|
+
for (const [param, default_value] of entries){
|
|
6607
|
+
const [_get, set] = signals[param];
|
|
6608
|
+
if (searchParams.has(param)) {
|
|
6609
|
+
const new_val = searchParams.get(param) ?? default_value ?? "";
|
|
6610
|
+
set(new_val);
|
|
6611
|
+
} else set(default_value ?? "");
|
|
6612
|
+
}
|
|
6613
|
+
}
|
|
6614
|
+
})();
|
|
6615
|
+
return signals;
|
|
6616
|
+
}
|
|
6617
|
+
|
|
6618
|
+
|
|
6619
|
+
|
|
6620
|
+
|
|
6621
|
+
|
|
6622
|
+
|
|
6623
|
+
|
|
6624
|
+
|
|
6625
|
+
|
|
6626
|
+
|
|
6627
|
+
|
|
6628
|
+
|
|
6629
|
+
|
|
6630
|
+
|
|
6631
|
+
|
|
6632
|
+
|
|
6633
|
+
|
|
6634
|
+
|
|
6635
|
+
|
|
6636
|
+
|
|
6637
|
+
|
|
6638
|
+
|
|
6639
|
+
|
|
6640
|
+
|
|
6641
|
+
|
|
6642
|
+
|
|
6643
|
+
|
|
6644
|
+
|
|
6645
|
+
|
|
6646
|
+
|
|
6647
|
+
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);
|
|
6648
|
+
const $e003be2a50d9e5bc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n })=>{
|
|
6649
|
+
// Support for Spendrups displays, should probably be in the Spendrups script
|
|
6650
|
+
const display = (0, $kyEB6$createMemo)(()=>{
|
|
6651
|
+
const display = display_or_variant_container();
|
|
6652
|
+
if (display.page_url) return display;
|
|
6653
|
+
if (!display?.variants?.length) return;
|
|
6654
|
+
return display.variants.filter((v)=>v.product_id == display.product_id)[0];
|
|
6655
|
+
});
|
|
6656
|
+
const image_url = (0, $kyEB6$createMemo)(()=>display().image_url);
|
|
6657
|
+
const contained_image = (0, $kyEB6$createMemo)(()=>(0, $kyEB6$ContainedImage)({
|
|
6658
|
+
aspect_ratio: 1,
|
|
6659
|
+
alt: "",
|
|
6660
|
+
// @ts-ignore
|
|
6661
|
+
"data-src": image_url(),
|
|
6662
|
+
srcset_opts: {
|
|
6663
|
+
set_dataset: true
|
|
6664
|
+
},
|
|
6665
|
+
init_with_placeholder: true
|
|
6666
|
+
}));
|
|
6667
|
+
const is_sale = (0, $kyEB6$createMemo)(()=>display().sale_price !== display().original_price);
|
|
6668
|
+
const returnVal = (()=>{
|
|
6669
|
+
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;
|
|
6670
|
+
(0, $kyEB6$insert)(_el$2, contained_image);
|
|
6671
|
+
(0, $kyEB6$insert)(_el$5, ()=>display().brand);
|
|
6672
|
+
(0, $kyEB6$insert)(_el$6, ()=>display().title);
|
|
6673
|
+
(0, $kyEB6$insert)(_el$4, (()=>{
|
|
6674
|
+
const _c$ = (0, $kyEB6$memo)(()=>!!(display().sub_heading_1 || display().sub_heading_2));
|
|
6675
|
+
return ()=>_c$() && (()=>{
|
|
6676
|
+
const _el$10 = $e003be2a50d9e5bc$var$_tmpl$3.cloneNode(true);
|
|
6677
|
+
(0, $kyEB6$insert)(_el$10, ()=>[
|
|
6678
|
+
display().sub_heading_1,
|
|
6679
|
+
display().sub_heading_2
|
|
6680
|
+
].filter((v)=>v).join(" | "));
|
|
6681
|
+
return _el$10;
|
|
6682
|
+
})();
|
|
6683
|
+
})(), null);
|
|
6684
|
+
(0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
6685
|
+
get when () {
|
|
6686
|
+
return is_sale();
|
|
6687
|
+
},
|
|
6688
|
+
get children () {
|
|
6689
|
+
const _el$8 = $e003be2a50d9e5bc$var$_tmpl$.cloneNode(true);
|
|
6690
|
+
(0, $kyEB6$insert)(_el$8, ()=>i18n.price_formatting_().pre_, null);
|
|
6691
|
+
(0, $kyEB6$insert)(_el$8, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
|
|
6692
|
+
price_: (0, $kyEB6$createMemo)(()=>display().original_price),
|
|
6693
|
+
price_formatting_: i18n.price_formatting_
|
|
6694
|
+
}), null);
|
|
6695
|
+
(0, $kyEB6$insert)(_el$8, ()=>i18n.price_formatting_().post_, null);
|
|
6696
|
+
return _el$8;
|
|
6697
|
+
}
|
|
6698
|
+
}), _el$9);
|
|
6699
|
+
(0, $kyEB6$insert)(_el$9, ()=>i18n.price_formatting_().pre_, null);
|
|
6700
|
+
(0, $kyEB6$insert)(_el$9, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
|
|
6701
|
+
price_: (0, $kyEB6$createMemo)(()=>display().sale_price),
|
|
6702
|
+
price_formatting_: i18n.price_formatting_
|
|
6703
|
+
}), null);
|
|
6704
|
+
(0, $kyEB6$insert)(_el$9, ()=>i18n.price_formatting_().post_, null);
|
|
6705
|
+
(0, $kyEB6$effect)((_p$)=>{
|
|
6706
|
+
const _v$ = display().page_url, _v$2 = !!is_sale();
|
|
6707
|
+
_v$ !== _p$._v$ && (0, $kyEB6$setAttribute)(_el$, "href", _p$._v$ = _v$);
|
|
6708
|
+
_v$2 !== _p$._v$2 && _el$9.classList.toggle("sales-price", _p$._v$2 = _v$2);
|
|
6709
|
+
return _p$;
|
|
6710
|
+
}, {
|
|
6711
|
+
_v$: undefined,
|
|
6712
|
+
_v$2: undefined
|
|
6713
|
+
});
|
|
6714
|
+
return _el$;
|
|
6715
|
+
})();
|
|
6716
|
+
// This solves a JSX type issue where the return value does not match with the explicit JSX.Element type for some reason
|
|
6717
|
+
return returnVal;
|
|
6718
|
+
};
|
|
6719
|
+
|
|
6720
|
+
|
|
6721
|
+
const $eea41f703612261b$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="instant-results"></div>`, 2);
|
|
6722
|
+
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_ }) {
|
|
6723
|
+
const max_cards = 4;
|
|
6724
|
+
const [read_current_instant_query, write_current_instant_query] = (0, $kyEB6$createSignal)("");
|
|
6725
|
+
let timeout;
|
|
6726
|
+
(0, $kyEB6$createComputed)(()=>{
|
|
6727
|
+
const value = get_search_field_value();
|
|
6728
|
+
if (timeout == null) // don't wait if it's the first request
|
|
6729
|
+
write_current_instant_query(value);
|
|
6730
|
+
clearTimeout(timeout);
|
|
6731
|
+
timeout = setTimeout((0, $kyEB6$catchify)(()=>write_current_instant_query(value)), 250);
|
|
6732
|
+
});
|
|
6733
|
+
const [search_results] = (0, $kyEB6$createResource)((0, $kyEB6$createMemo)(()=>({
|
|
6734
|
+
tenant: tenant_(),
|
|
6735
|
+
market: market_(),
|
|
6736
|
+
query: read_current_instant_query()
|
|
6737
|
+
})), (0, $kyEB6$catchify)((variable_data)=>{
|
|
6738
|
+
return depict_api_.query({
|
|
6739
|
+
// 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
|
|
6740
|
+
limit: (0, $kyEB6$untrack)(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
6741
|
+
// 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
|
|
6742
|
+
...variable_data
|
|
6743
|
+
});
|
|
6744
|
+
}));
|
|
6745
|
+
set_num_results_accessor_(()=>(0, $511cc0abd9a64ce8$export$92f2da32c6e7e7ee)({
|
|
6746
|
+
search_results_: search_results,
|
|
6747
|
+
i18n_: i18n_
|
|
6748
|
+
}));
|
|
6749
|
+
const sliced_displays = (0, $kyEB6$createMemo)(()=>search_results()?.displays?.slice(0, max_cards));
|
|
6750
|
+
let placeholder;
|
|
6751
|
+
const container = (()=>{
|
|
6752
|
+
const _el$ = $eea41f703612261b$var$_tmpl$.cloneNode(true);
|
|
6753
|
+
(0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
6754
|
+
get when () {
|
|
6755
|
+
return sliced_displays()?.length;
|
|
6756
|
+
},
|
|
6757
|
+
get fallback () {
|
|
6758
|
+
return (0, $kyEB6$createMemo)(()=>{
|
|
6759
|
+
if (Array.isArray(search_results()?.displays)) // remove placeholders if we have a response but no results
|
|
6760
|
+
return undefined;
|
|
6761
|
+
return new Array(max_cards).fill(1).map(()=>(placeholder ||= render_instant_card_placeholder_()).cloneNode(true));
|
|
6762
|
+
})();
|
|
6763
|
+
},
|
|
6764
|
+
get children () {
|
|
6765
|
+
return (0, $kyEB6$createComponent)((0, $kyEB6$Index), {
|
|
6766
|
+
get each () {
|
|
6767
|
+
return sliced_displays();
|
|
6768
|
+
},
|
|
6769
|
+
children: (d, i)=>$eea41f703612261b$var$track_elements(d, i, // Custom instant card requires a re-render on every display update
|
|
6770
|
+
render_instant_card_ ? (0, $kyEB6$createMemo)(()=>render_instant_card_(d(), {
|
|
6771
|
+
index: i,
|
|
6772
|
+
i18n: i18n_,
|
|
6773
|
+
merchant: tenant_(),
|
|
6774
|
+
market: market_()
|
|
6775
|
+
})) : (0, $e003be2a50d9e5bc$export$b05c0ae390cf3e06)(d, {
|
|
6776
|
+
index: i,
|
|
6777
|
+
i18n: i18n_,
|
|
6778
|
+
merchant: tenant_(),
|
|
6779
|
+
market: market_()
|
|
6780
|
+
}), tenant_, market_)
|
|
6781
|
+
});
|
|
6782
|
+
}
|
|
6783
|
+
}));
|
|
6784
|
+
return _el$;
|
|
6785
|
+
})();
|
|
6786
|
+
new (0, $kyEB6$Lazyfier)({
|
|
6482
6787
|
container: container,
|
|
6483
6788
|
lazyfinder: {
|
|
6484
6789
|
unload () {}
|
|
@@ -6595,7 +6900,7 @@ function $4ceabea39c9a56ac$export$50b90be27d8502d9(el, [get_style_props, set_sty
|
|
|
6595
6900
|
|
|
6596
6901
|
|
|
6597
6902
|
|
|
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_ }) {
|
|
6903
|
+
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
6904
|
const [read_link, write_link] = (0, $kyEB6$createSignal)();
|
|
6600
6905
|
const [exit_iterable, exitable_iterable] = (0, $kyEB6$make_asyncIterable_exiter)((0, $kyEB6$href_change_ipns));
|
|
6601
6906
|
(0, $kyEB6$onCleanup)(exit_iterable);
|
|
@@ -6612,8 +6917,11 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6612
6917
|
if (e.button || e.metaKey || e.ctrlKey) // not button 0 or cmd/ctrl click
|
|
6613
6918
|
return;
|
|
6614
6919
|
e.preventDefault();
|
|
6615
|
-
if (new URLSearchParams(location.search).get(param_) === value_)
|
|
6616
|
-
|
|
6920
|
+
if (new URLSearchParams(location.search).get(param_) === value_) {
|
|
6921
|
+
// don't do anything if we're already searching for this
|
|
6922
|
+
on_submit_with_unchanged_value_?.();
|
|
6923
|
+
return;
|
|
6924
|
+
}
|
|
6617
6925
|
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
6926
|
if (typeof alternative_query_submitter_for_spas_ === "function") alternative_query_submitter_for_spas_(param_, value_, url_transformer_);
|
|
6619
6927
|
else {
|
|
@@ -6632,7 +6940,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
6632
6940
|
|
|
6633
6941
|
|
|
6634
6942
|
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_ }) {
|
|
6943
|
+
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
6944
|
const has_entries = (0, $kyEB6$createMemo)(()=>previous_searches_().length >= 1);
|
|
6637
6945
|
currently_showing_suggestions_[1]((value)=>{
|
|
6638
6946
|
value[0] = (0, $kyEB6$createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -6665,7 +6973,8 @@ function $7ad3a93cbe6fa208$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
6665
6973
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
6666
6974
|
set_search_field_value_: search_field_value_[1],
|
|
6667
6975
|
get_search_query_: get_search_query_,
|
|
6668
|
-
after_submit_: after_submit_
|
|
6976
|
+
after_submit_: after_submit_,
|
|
6977
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6669
6978
|
}));
|
|
6670
6979
|
return (()=>{
|
|
6671
6980
|
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 +7102,8 @@ function $f3213c0640246d58$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
|
|
|
6793
7102
|
}
|
|
6794
7103
|
|
|
6795
7104
|
|
|
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="
|
|
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_ }) {
|
|
7105
|
+
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);
|
|
7106
|
+
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
7107
|
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
7108
|
));
|
|
6800
7109
|
const not_queries_memo = (0, $kyEB6$createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $a0eb8b431ec1f87b$export$3cf9497e790da491)));
|
|
@@ -6807,7 +7116,8 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6807
7116
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
6808
7117
|
get_search_query_: get_search_query_,
|
|
6809
7118
|
set_search_field_value_: search_field_value_[1],
|
|
6810
|
-
after_submit_: after_submit_
|
|
7119
|
+
after_submit_: after_submit_,
|
|
7120
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6811
7121
|
}) : undefined);
|
|
6812
7122
|
const [href, set_href] = (0, $kyEB6$createSignal)();
|
|
6813
7123
|
(0, $kyEB6$createComputed)(()=>{
|
|
@@ -6820,6 +7130,14 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6820
7130
|
(0, $kyEB6$use)((element)=>element.addEventListener("click", (0, $kyEB6$catchify)((ev)=>{
|
|
6821
7131
|
// 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
7132
|
if (is_query()) return param_change_obj().on_click_handler_(ev);
|
|
7133
|
+
else if (navigate_page_to_href_) {
|
|
7134
|
+
// single page navigate to category suggestions if enabled
|
|
7135
|
+
// object should have a href where we want to go
|
|
7136
|
+
if (ev.button || ev.metaKey || ev.ctrlKey) // not button 0 or cmd/ctrl click
|
|
7137
|
+
return;
|
|
7138
|
+
ev.preventDefault();
|
|
7139
|
+
navigate_page_to_href_(input_obj().page_url);
|
|
7140
|
+
}
|
|
6823
7141
|
})), _el$);
|
|
6824
7142
|
(0, $kyEB6$addEventListener)(_el$, "mouseleave", (0, $kyEB6$catchify)(()=>write_selected_index_(undefined)));
|
|
6825
7143
|
(0, $kyEB6$addEventListener)(_el$, "mouseenter", (0, $kyEB6$catchify)(()=>write_selected_index_([
|
|
@@ -6994,6 +7312,9 @@ function $cea52f6b24092f05$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
6994
7312
|
|
|
6995
7313
|
|
|
6996
7314
|
|
|
7315
|
+
|
|
7316
|
+
|
|
7317
|
+
const $15f380f0ce2812cc$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<a target="_blank"></a>`, 2);
|
|
6997
7318
|
function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index] , currently_showing_suggestions_: [read_currently_showing_suggestions] , ...rest_of_props }) {
|
|
6998
7319
|
const last_suggestion_index_ = (0, $kyEB6$createMemo)(()=>{
|
|
6999
7320
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
@@ -7048,7 +7369,7 @@ function $15f380f0ce2812cc$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
7048
7369
|
write_selected_fake_index_: write_selected_fake_index_
|
|
7049
7370
|
});
|
|
7050
7371
|
}
|
|
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_ }) {
|
|
7372
|
+
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
7373
|
let previous_value;
|
|
7053
7374
|
(0, $kyEB6$createEffect)(()=>{
|
|
7054
7375
|
const sfv = get_search_field_value();
|
|
@@ -7070,21 +7391,37 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7070
7391
|
calls++;
|
|
7071
7392
|
});
|
|
7072
7393
|
};
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
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
|
-
});
|
|
7394
|
+
const override_on_enter_for_this_entry = (new_fn)=>{
|
|
7395
|
+
set_override_on_enter_fn_(new_fn);
|
|
7396
|
+
// Only override while this item has been selected with the keyboard
|
|
7082
7397
|
(0, $kyEB6$createComputed)((run)=>{
|
|
7083
7398
|
if (!run) read_selected_fake_index_();
|
|
7084
7399
|
else set_override_on_enter_fn_(()=>false);
|
|
7085
7400
|
return run + 1;
|
|
7086
7401
|
}, 0);
|
|
7087
|
-
}
|
|
7402
|
+
};
|
|
7403
|
+
// update text field value if needed
|
|
7404
|
+
if (selected_entry?.type == "query") {
|
|
7405
|
+
const { title: title } = selected_entry;
|
|
7406
|
+
block_updating_for_one_change();
|
|
7407
|
+
set_search_field_value(title);
|
|
7408
|
+
override_on_enter_for_this_entry((e)=>{
|
|
7409
|
+
// Open search query in new tab on cmd+enter
|
|
7410
|
+
const url = new URL(location);
|
|
7411
|
+
url_transformer_?.(url);
|
|
7412
|
+
url.searchParams.set(search_query_param_name_, title);
|
|
7413
|
+
return $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, url.href);
|
|
7414
|
+
});
|
|
7415
|
+
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
7416
|
+
const { page_url: page_url } = selected_entry;
|
|
7417
|
+
if (!$15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, page_url)) {
|
|
7418
|
+
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
7419
|
+
if (navigate_page_to_href_) navigate_page_to_href_(page_url);
|
|
7420
|
+
else location.href = page_url;
|
|
7421
|
+
}
|
|
7422
|
+
return true;
|
|
7423
|
+
});
|
|
7424
|
+
else if (!selected_entry) {
|
|
7088
7425
|
block_updating_for_one_change();
|
|
7089
7426
|
set_search_field_value(previous_value);
|
|
7090
7427
|
}
|
|
@@ -7096,10 +7433,25 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7096
7433
|
(0, $kyEB6$onCleanup)((0, $kyEB6$catchify)(()=>el.removeEventListener("keyup", handler)));
|
|
7097
7434
|
});
|
|
7098
7435
|
}
|
|
7436
|
+
function $15f380f0ce2812cc$var$open_link_on_cmd_pressed(e, href) {
|
|
7437
|
+
if (e.metaKey || e.ctrlKey) {
|
|
7438
|
+
// Open link in a new tab with cmd/ctrl + enter.
|
|
7439
|
+
const link = (()=>{
|
|
7440
|
+
const _el$ = $15f380f0ce2812cc$var$_tmpl$.cloneNode(true);
|
|
7441
|
+
(0, $kyEB6$setAttribute)(_el$, "href", href);
|
|
7442
|
+
return _el$;
|
|
7443
|
+
})();
|
|
7444
|
+
document.body.append(link);
|
|
7445
|
+
link.click();
|
|
7446
|
+
link.remove();
|
|
7447
|
+
return true;
|
|
7448
|
+
}
|
|
7449
|
+
return false;
|
|
7450
|
+
}
|
|
7099
7451
|
|
|
7100
7452
|
|
|
7101
7453
|
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_ }) {
|
|
7454
|
+
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
7455
|
const [searching_for_value, set_searching_for_value] = (0, $kyEB6$createSignal)();
|
|
7104
7456
|
const [read_search_field_value] = search_field_value_;
|
|
7105
7457
|
const updating_blocked = (0, $kyEB6$createSignal)(false);
|
|
@@ -7139,7 +7491,10 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7139
7491
|
search_field_value_: search_field_value_,
|
|
7140
7492
|
updating_blocked_: updating_blocked,
|
|
7141
7493
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
7142
|
-
set_override_on_enter_fn_: set_override_on_enter_fn_
|
|
7494
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
7495
|
+
search_query_param_name_: search_page_url_param_name_,
|
|
7496
|
+
url_transformer_: url_transformer_,
|
|
7497
|
+
navigate_page_to_href_: navigate_page_to_href_
|
|
7143
7498
|
});
|
|
7144
7499
|
return [
|
|
7145
7500
|
(0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
@@ -7163,7 +7518,8 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7163
7518
|
url_transformer_: url_transformer_,
|
|
7164
7519
|
get_search_query_: get_search_query_,
|
|
7165
7520
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
7166
|
-
after_submit_: after_submit_
|
|
7521
|
+
after_submit_: after_submit_,
|
|
7522
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7167
7523
|
});
|
|
7168
7524
|
}
|
|
7169
7525
|
}),
|
|
@@ -7190,7 +7546,9 @@ function $a0eb8b431ec1f87b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7190
7546
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
7191
7547
|
get_search_query_: get_search_query_,
|
|
7192
7548
|
include_category_suggestions_: include_category_suggestions_,
|
|
7193
|
-
after_submit_: after_submit_
|
|
7549
|
+
after_submit_: after_submit_,
|
|
7550
|
+
navigate_page_to_href_: navigate_page_to_href_,
|
|
7551
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7194
7552
|
})
|
|
7195
7553
|
];
|
|
7196
7554
|
}
|
|
@@ -7252,8 +7610,33 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
7252
7610
|
}
|
|
7253
7611
|
|
|
7254
7612
|
|
|
7255
|
-
|
|
7256
|
-
|
|
7613
|
+
|
|
7614
|
+
|
|
7615
|
+
|
|
7616
|
+
const $4df637cb4cf113fa$export$af8311b651139246 = (css_properties)=>{
|
|
7617
|
+
return Object.entries(css_properties).map(([key, value])=>`${key}: ${value};`).join(" ");
|
|
7618
|
+
};
|
|
7619
|
+
const $4df637cb4cf113fa$export$1233ca167bf71f9a = (styles)=>{
|
|
7620
|
+
return Object.entries(styles).map(([selector, css_properties])=>`${selector} { ${$4df637cb4cf113fa$export$af8311b651139246(css_properties)} }`).join(" ");
|
|
7621
|
+
};
|
|
7622
|
+
|
|
7623
|
+
|
|
7624
|
+
|
|
7625
|
+
const $19f1f3e588d63502$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<style></style>`, 2);
|
|
7626
|
+
function $19f1f3e588d63502$export$f021bdedd3ec901a(props) {
|
|
7627
|
+
const valid_css_string = (0, $kyEB6$createMemo)(()=>{
|
|
7628
|
+
return (0, $4df637cb4cf113fa$export$1233ca167bf71f9a)(props.styles());
|
|
7629
|
+
});
|
|
7630
|
+
return (()=>{
|
|
7631
|
+
const _el$ = $19f1f3e588d63502$var$_tmpl$.cloneNode(true);
|
|
7632
|
+
(0, $kyEB6$insert)(_el$, valid_css_string);
|
|
7633
|
+
return _el$;
|
|
7634
|
+
})();
|
|
7635
|
+
}
|
|
7636
|
+
|
|
7637
|
+
|
|
7638
|
+
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);
|
|
7639
|
+
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
7640
|
let on_enter_in_query_input_function;
|
|
7258
7641
|
const [input_field, set_input_field] = (0, $kyEB6$createSignal)();
|
|
7259
7642
|
const [get_search_field_value_] = search_field_value_;
|
|
@@ -7294,6 +7677,12 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7294
7677
|
search_page_url_param_name_: search_page_url_param_name_,
|
|
7295
7678
|
get_search_query_: search_query_[0]
|
|
7296
7679
|
});
|
|
7680
|
+
const random_classname = (0, $kyEB6$make_random_classname)();
|
|
7681
|
+
const body_style = (0, $kyEB6$createMemo)(()=>{
|
|
7682
|
+
return {
|
|
7683
|
+
[`.depict .${random_classname}`]: style_props_[0]()
|
|
7684
|
+
};
|
|
7685
|
+
});
|
|
7297
7686
|
const modal_element = (()=>{
|
|
7298
7687
|
const _el$4 = $fabfda1230351b1a$var$_tmpl$3.cloneNode(true), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild;
|
|
7299
7688
|
(0, $kyEB6$addEventListener)(_el$4, "click", (0, $kyEB6$catchify)(({ target: target })=>{
|
|
@@ -7333,7 +7722,9 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7333
7722
|
url_transformer_: url_transformer_,
|
|
7334
7723
|
i18n_: i18n_,
|
|
7335
7724
|
include_category_suggestions_: enable_category_suggestions_ ?? true,
|
|
7336
|
-
after_submit_: after_submit_
|
|
7725
|
+
after_submit_: after_submit_,
|
|
7726
|
+
navigate_page_to_href_: navigate_page_to_href_,
|
|
7727
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
7337
7728
|
});
|
|
7338
7729
|
}
|
|
7339
7730
|
}), null);
|
|
@@ -7354,7 +7745,12 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7354
7745
|
}), null);
|
|
7355
7746
|
(0, $kyEB6$insert)(_el$6, elements_inside_scrollable, null);
|
|
7356
7747
|
(0, $kyEB6$insert)(_el$5, elements_outside_scrollable, null);
|
|
7357
|
-
(0, $kyEB6$
|
|
7748
|
+
(0, $kyEB6$insert)(_el$4, (0, $kyEB6$createComponent)((0, $19f1f3e588d63502$export$f021bdedd3ec901a), {
|
|
7749
|
+
styles: body_style
|
|
7750
|
+
}), null);
|
|
7751
|
+
(0, $kyEB6$effect)((_$p)=>(0, $kyEB6$classList)(_el$5, {
|
|
7752
|
+
[random_classname]: true
|
|
7753
|
+
}, _$p));
|
|
7358
7754
|
return _el$4;
|
|
7359
7755
|
})();
|
|
7360
7756
|
return [
|
|
@@ -7362,7 +7758,15 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({ search_field_value_: search
|
|
|
7362
7758
|
const _el$7 = $fabfda1230351b1a$var$_tmpl$4.cloneNode(true), _el$8 = _el$7.firstChild;
|
|
7363
7759
|
(0, $kyEB6$addEventListener)(_el$8, "click", close_modal_, true);
|
|
7364
7760
|
(0, $kyEB6$insert)(_el$7, modal_element, null);
|
|
7365
|
-
(0, $kyEB6$effect)((
|
|
7761
|
+
(0, $kyEB6$effect)((_p$)=>{
|
|
7762
|
+
const _v$ = (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_MODAL, _v$2 = class_list_?.();
|
|
7763
|
+
_v$ !== _p$._v$ && (0, $kyEB6$setAttribute)(_el$7, "id", _p$._v$ = _v$);
|
|
7764
|
+
_p$._v$2 = (0, $kyEB6$classList)(_el$7, _v$2, _p$._v$2);
|
|
7765
|
+
return _p$;
|
|
7766
|
+
}, {
|
|
7767
|
+
_v$: undefined,
|
|
7768
|
+
_v$2: undefined
|
|
7769
|
+
});
|
|
7366
7770
|
return _el$7;
|
|
7367
7771
|
})()
|
|
7368
7772
|
];
|
|
@@ -7409,6 +7813,8 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
7409
7813
|
|
|
7410
7814
|
|
|
7411
7815
|
|
|
7816
|
+
|
|
7817
|
+
|
|
7412
7818
|
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
7819
|
function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_ , children: children , selected_filters_: selected_filters_ , slider_arrow_button_: slider_arrow_button_ }) {
|
|
7414
7820
|
const category_suggestions_ = (0, $kyEB6$createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
@@ -7461,130 +7867,6 @@ function $793905995512612d$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
7461
7867
|
|
|
7462
7868
|
|
|
7463
7869
|
|
|
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
7870
|
|
|
7589
7871
|
|
|
7590
7872
|
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 +7896,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({ search_query_: search_query
|
|
|
7614
7896
|
|
|
7615
7897
|
|
|
7616
7898
|
|
|
7899
|
+
|
|
7617
7900
|
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
7901
|
function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
7619
7902
|
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;
|
|
@@ -7771,7 +8054,7 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7771
8054
|
tenant_object_.market = tenant_object_.MARKET = market_();
|
|
7772
8055
|
});
|
|
7773
8056
|
return [
|
|
7774
|
-
document.createComment("
|
|
8057
|
+
document.createComment("Search page based on Depict SDK"),
|
|
7775
8058
|
(()=>{
|
|
7776
8059
|
const _el$2 = $7097477c78a89208$var$_tmpl$2.cloneNode(true), _el$3 = _el$2.firstChild;
|
|
7777
8060
|
(0, $kyEB6$insert)(_el$3, input_field, null);
|
|
@@ -7891,6 +8174,7 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7891
8174
|
});
|
|
7892
8175
|
}
|
|
7893
8176
|
}), null);
|
|
8177
|
+
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$2, "id", (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_PAGE));
|
|
7894
8178
|
return _el$2;
|
|
7895
8179
|
})()
|
|
7896
8180
|
];
|
|
@@ -7899,125 +8183,6 @@ function $7097477c78a89208$export$a54ec244c8863715(opts) {
|
|
|
7899
8183
|
|
|
7900
8184
|
|
|
7901
8185
|
|
|
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_tagline"><span class="brand"></span><span class="title"></span></div><div class="price_container"><span class="price"></span></div></div></a>`, 16), $ba4105f38be0a8e0$var$_tmpl$3 = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="tagline"></div>`, 2);
|
|
7912
|
-
function $ba4105f38be0a8e0$export$3b5becc25bbaed73(display_or_variant_container, _index, get_fake_rendering_options, i18n_) {
|
|
7913
|
-
// Support for Spendrups displays, should probably be in the Spendrups script
|
|
7914
|
-
const display = (0, $kyEB6$createMemo)(()=>{
|
|
7915
|
-
const display = display_or_variant_container();
|
|
7916
|
-
if (display.page_url) return display;
|
|
7917
|
-
if (!display?.variants?.length) return;
|
|
7918
|
-
return display.variants.filter((v)=>v.product_id == display.product_id)[0];
|
|
7919
|
-
});
|
|
7920
|
-
const image_url = (0, $kyEB6$createMemo)(()=>display().image_url);
|
|
7921
|
-
const contained_image = (0, $kyEB6$createMemo)(()=>(0, $kyEB6$ContainedImage)({
|
|
7922
|
-
aspect_ratio: 1,
|
|
7923
|
-
alt: "",
|
|
7924
|
-
// @ts-ignore
|
|
7925
|
-
"data-src": image_url(),
|
|
7926
|
-
rendering_options: (0, $kyEB6$untrack)(()=>get_fake_rendering_options()),
|
|
7927
|
-
srcset_opts: {
|
|
7928
|
-
set_dataset: true
|
|
7929
|
-
},
|
|
7930
|
-
init_with_placeholder: true
|
|
7931
|
-
}));
|
|
7932
|
-
const is_sale = (0, $kyEB6$createMemo)(()=>display().sale_price !== display().original_price);
|
|
7933
|
-
return (()=>{
|
|
7934
|
-
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;
|
|
7935
|
-
(0, $kyEB6$insert)(_el$2, contained_image);
|
|
7936
|
-
(0, $kyEB6$insert)(_el$5, ()=>display().brand);
|
|
7937
|
-
(0, $kyEB6$insert)(_el$6, ()=>display().title);
|
|
7938
|
-
(0, $kyEB6$insert)(_el$4, ()=>display().sub_heading_1 || display().sub_heading_2 && (()=>{
|
|
7939
|
-
const _el$10 = $ba4105f38be0a8e0$var$_tmpl$3.cloneNode(true);
|
|
7940
|
-
(0, $kyEB6$insert)(_el$10, ()=>[
|
|
7941
|
-
display().sub_heading_1,
|
|
7942
|
-
display().sub_heading_2
|
|
7943
|
-
].filter((v)=>v).join(" | "));
|
|
7944
|
-
return _el$10;
|
|
7945
|
-
})(), null);
|
|
7946
|
-
(0, $kyEB6$insert)(_el$7, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
7947
|
-
get when () {
|
|
7948
|
-
return is_sale();
|
|
7949
|
-
},
|
|
7950
|
-
get children () {
|
|
7951
|
-
const _el$8 = $ba4105f38be0a8e0$var$_tmpl$.cloneNode(true);
|
|
7952
|
-
(0, $kyEB6$insert)(_el$8, ()=>i18n_.price_formatting_().pre_, null);
|
|
7953
|
-
(0, $kyEB6$insert)(_el$8, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
|
|
7954
|
-
price_: (0, $kyEB6$createMemo)(()=>display().original_price),
|
|
7955
|
-
price_formatting_: i18n_.price_formatting_
|
|
7956
|
-
}), null);
|
|
7957
|
-
(0, $kyEB6$insert)(_el$8, ()=>i18n_.price_formatting_().post_, null);
|
|
7958
|
-
return _el$8;
|
|
7959
|
-
}
|
|
7960
|
-
}), _el$9);
|
|
7961
|
-
(0, $kyEB6$insert)(_el$9, ()=>i18n_.price_formatting_().pre_, null);
|
|
7962
|
-
(0, $kyEB6$insert)(_el$9, ()=>(0, $8c0f86cb3e266eeb$export$469c7af753d08925)({
|
|
7963
|
-
price_: (0, $kyEB6$createMemo)(()=>display().sale_price),
|
|
7964
|
-
price_formatting_: i18n_.price_formatting_
|
|
7965
|
-
}), null);
|
|
7966
|
-
(0, $kyEB6$insert)(_el$9, ()=>i18n_.price_formatting_().post_, null);
|
|
7967
|
-
(0, $kyEB6$effect)((_p$)=>{
|
|
7968
|
-
const _v$ = display().page_url, _v$2 = !!is_sale();
|
|
7969
|
-
_v$ !== _p$._v$ && (0, $kyEB6$setAttribute)(_el$, "href", _p$._v$ = _v$);
|
|
7970
|
-
_v$2 !== _p$._v$2 && _el$9.classList.toggle("sales_price", _p$._v$2 = _v$2);
|
|
7971
|
-
return _p$;
|
|
7972
|
-
}, {
|
|
7973
|
-
_v$: undefined,
|
|
7974
|
-
_v$2: undefined
|
|
7975
|
-
});
|
|
7976
|
-
return _el$;
|
|
7977
|
-
})();
|
|
7978
|
-
}
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
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);
|
|
7993
|
-
function $897bd4a76f611b38$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_ , on_navigation_: on_navigation_ }) {
|
|
7994
|
-
return (()=>{
|
|
7995
|
-
const _el$ = $897bd4a76f611b38$var$_tmpl$2.cloneNode(true), _el$2 = _el$.firstChild;
|
|
7996
|
-
(0, $kyEB6$addEventListener)(_el$, "click", (0, $kyEB6$catchify)((e)=>{
|
|
7997
|
-
if (e.button || e.metaKey || e.ctrlKey) // Not single page navigating because button is not 0 or ctrl/command click
|
|
7998
|
-
return;
|
|
7999
|
-
return on_navigation_?.(category_suggestion_().page_url);
|
|
8000
|
-
}), true);
|
|
8001
|
-
(0, $kyEB6$insert)(_el$2, ()=>category_suggestion_().title);
|
|
8002
|
-
(0, $kyEB6$insert)(_el$, (0, $kyEB6$createComponent)((0, $kyEB6$Show), {
|
|
8003
|
-
get when () {
|
|
8004
|
-
return typeof category_suggestion_().parent_title === "string";
|
|
8005
|
-
},
|
|
8006
|
-
get children () {
|
|
8007
|
-
const _el$3 = $897bd4a76f611b38$var$_tmpl$.cloneNode(true);
|
|
8008
|
-
(0, $kyEB6$insert)(_el$3, ()=>category_suggestion_().parent_title);
|
|
8009
|
-
return _el$3;
|
|
8010
|
-
}
|
|
8011
|
-
}), null);
|
|
8012
|
-
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "href", category_suggestion_().page_url));
|
|
8013
|
-
return _el$;
|
|
8014
|
-
})();
|
|
8015
|
-
}
|
|
8016
|
-
(0, $kyEB6$delegateEvents)([
|
|
8017
|
-
"click"
|
|
8018
|
-
]);
|
|
8019
|
-
|
|
8020
|
-
|
|
8021
8186
|
const $b5cccc8ee7d24677$var$transform_elements = (sorted_cols_at_size)=>{
|
|
8022
8187
|
const cols_at_size = [];
|
|
8023
8188
|
for(let i = 0; i < sorted_cols_at_size.length; i++){
|
|
@@ -8064,6 +8229,8 @@ const $b5cccc8ee7d24677$export$6daf8749b65a1b77 = (cols_at_size)=>{
|
|
|
8064
8229
|
|
|
8065
8230
|
|
|
8066
8231
|
|
|
8232
|
+
|
|
8233
|
+
|
|
8067
8234
|
const $59f48be661ca9195$var$_tmpl$ = /*#__PURE__*/ (0, $kyEB6$template)(`<div class="depict plp search"></div>`, 2);
|
|
8068
8235
|
/**
|
|
8069
8236
|
* 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.
|
|
@@ -8077,7 +8244,7 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
|
|
|
8077
8244
|
#modal_open_signal = (0, $kyEB6$createSignal)(false);
|
|
8078
8245
|
static #has_been_constructed = false;
|
|
8079
8246
|
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
|
|
8080
|
-
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , ...props_on_class }){
|
|
8247
|
+
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal_: bottom_distance_under_modal_ , render_instant_card: render_instant_card , ...props_on_class }){
|
|
8081
8248
|
if ($59f48be661ca9195$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
|
|
8082
8249
|
Object.assign(this, props_on_class);
|
|
8083
8250
|
const alternative_query_submitter_for_spas_ = on_navigation && ((search_param_name, new_search_query, url_transformer)=>{
|
|
@@ -8108,8 +8275,9 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
|
|
|
8108
8275
|
const previous_searches = (0, $21f51c14cb3f586f$export$84bba84a7b837187)(search_query_signal_);
|
|
8109
8276
|
const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
|
|
8110
8277
|
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
|
|
8278
|
+
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
8111
8279
|
const configured_submit_query_ = ()=>(0, $bfd908d13d90934c$export$e16630ecb9644a1c)({
|
|
8112
|
-
on_submit_with_unchanged_value_:
|
|
8280
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
8113
8281
|
search_field_value_: state_.search_field_value,
|
|
8114
8282
|
search_query_: search_query_signal_,
|
|
8115
8283
|
search_param_name_: search_query_url_param_name,
|
|
@@ -8167,9 +8335,11 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
|
|
|
8167
8335
|
submit_query_: configured_submit_query_,
|
|
8168
8336
|
alternative_query_submitter_for_spas_: alternative_query_submitter_for_spas_,
|
|
8169
8337
|
url_transformer_: url_transformer,
|
|
8338
|
+
navigate_page_to_href_: on_navigation,
|
|
8339
|
+
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
8170
8340
|
instant_results_options_: {
|
|
8171
8341
|
min_products_to_fetch_: $59f48be661ca9195$var$min_products_to_fetch_,
|
|
8172
|
-
render_instant_card_:
|
|
8342
|
+
render_instant_card_: render_instant_card,
|
|
8173
8343
|
render_instant_card_placeholder_: (0, $bb15dfb548a7666e$export$ee1733d9a8495996),
|
|
8174
8344
|
has_sort_or_filters_: (0, $kyEB6$createMemo)(()=>!!(Object.keys(state_.search_selected_filters[0]())?.length || state_.search_sorting[0]()))
|
|
8175
8345
|
},
|
|
@@ -8212,21 +8382,16 @@ class $59f48be661ca9195$export$ac6237957a15b3f0 {
|
|
|
8212
8382
|
}
|
|
8213
8383
|
// Open centered modal
|
|
8214
8384
|
const supports_hover = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8215
|
-
const slim = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-width: 600px)");
|
|
8216
8385
|
const desktop_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
8217
8386
|
const mobile_short = (0, $dc9262ef6f786812$export$d9f36cf74e24d595)("(max-height: 1000px)");
|
|
8218
|
-
const
|
|
8219
|
-
const transform_y = (0, $kyEB6$createSignal)(false);
|
|
8387
|
+
const transform_y = (0, $kyEB6$createMemo)(()=>supports_hover() ? !desktop_short() : !mobile_short());
|
|
8220
8388
|
const style_props_ = (0, $kyEB6$createSignal)({
|
|
8221
8389
|
position: "fixed",
|
|
8222
|
-
top: "50%"
|
|
8223
|
-
left: "50%"
|
|
8390
|
+
top: "50%"
|
|
8224
8391
|
});
|
|
8225
|
-
(0, $kyEB6$createComputed)(()=>transform_y[1](supports_hover() ? !desktop_short() : !mobile_short()));
|
|
8226
|
-
(0, $kyEB6$createComputed)(()=>transform_x[1](transform_y[0]() || !slim()));
|
|
8227
8392
|
(0, $kyEB6$createComputed)(()=>style_props_[1]((old_value)=>({
|
|
8228
8393
|
...old_value,
|
|
8229
|
-
transform:
|
|
8394
|
+
transform: transform_y() ? "translateY(-50%)" : "unset"
|
|
8230
8395
|
})));
|
|
8231
8396
|
if (signal_value_is_options) {
|
|
8232
8397
|
const [options_arg1, ...rest1] = open_signal_value;
|
|
@@ -8391,6 +8556,7 @@ function $59f48be661ca9195$export$b94867ecbd698f21({ depict_search: depict_searc
|
|
|
8391
8556
|
(()=>{
|
|
8392
8557
|
const _el$ = $59f48be661ca9195$var$_tmpl$.cloneNode(true);
|
|
8393
8558
|
(0, $kyEB6$insert)(_el$, input);
|
|
8559
|
+
(0, $kyEB6$effect)(()=>(0, $kyEB6$setAttribute)(_el$, "id", (0, $f86ba724282f6690$export$44dad306455dddf).SEARCH_MODAL));
|
|
8394
8560
|
return _el$;
|
|
8395
8561
|
})()
|
|
8396
8562
|
];
|
|
@@ -8423,4 +8589,7 @@ function $59f48be661ca9195$var$run_in_root_or_auto_cleanup(component, error_mess
|
|
|
8423
8589
|
|
|
8424
8590
|
|
|
8425
8591
|
|
|
8426
|
-
|
|
8592
|
+
(0, $kyEB6$dlog)("@depict-ai/ui version", (0, $ec291e0010116877$export$83d89fbfd8236492));
|
|
8593
|
+
|
|
8594
|
+
|
|
8595
|
+
export {$e4615ecd1849548f$export$b91cec6bdc6b32a1 as CategoryTitle, $a79d86d64fb64e8e$export$824dde41348efed1 as embedded_num_products, $7fa23e2a0079eca4$export$e015ed2f2950f2e3 as DepictAPI, $bf52d9f9eebd1938$export$5196e4c01fa56fcb as show_toast, $d1d4dbcadcf4cb02$export$26df08e242fe83a3 as push_state_with_query_param_value, $aea1edf92433e81e$export$fe334901e8bebd57 as disable_scrolling, $5c5f95951393e5d1$export$643598a327b5833e as get_categories, $bb15dfb548a7666e$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $dc9262ef6f786812$export$d9f36cf74e24d595 as media_query_to_accessor, $6e8944558258054f$export$d0596b5cae35ad4 as open_search_with_shift_slash, $b6d5529b253681aa$export$b3ad617e9036868 as align_field, $6936724b9e0b98d5$export$689e204eadb33baf as setup_fast_leave, $2e7dbdfa682bea45$export$93916862db74da11 as czech_category_translation, $2e7dbdfa682bea45$export$62ef558576ddaf3d as czech_search_translation, $88b98b9d8654446d$export$70578856b2420b5d as danish_search_translation, $88b98b9d8654446d$export$f816e22bdb8038e1 as danish_category_translation, $45ff89a5006dbeee$export$e6614b50d36f30aa as dutch_category_translation, $45ff89a5006dbeee$export$5d14584e27bf4bc5 as dutch_search_translation, $8e57f28e9b8ba103$export$434b5d2e9cbbcde1 as english_search_translation, $8e57f28e9b8ba103$export$61b15fe6451cdba0 as english_category_translation, $17bb4bc19a558158$export$bf7930000f7ad633 as finnish_category_translation, $17bb4bc19a558158$export$bb9c5e11b9203620 as finnish_search_translation, $8f244ab97fceb5b3$export$ef75fbff2e809c9 as french_category_translation, $8f244ab97fceb5b3$export$e608b2bb21ba1862 as french_search_translation, $52d8525a7f06f813$export$f1905e1353ecf78e as german_category_translation, $52d8525a7f06f813$export$b43a5e72c07b4d2a as german_search_translation, $af10c927f9d40ee9$export$3812cbf78064c3ab as italian_category_translation, $af10c927f9d40ee9$export$c05550c0848a3fe4 as italian_search_translation, $b6fc9ca373acfd8e$export$e3024c30c728ef08 as norwegian_category_translation, $b6fc9ca373acfd8e$export$dcb702a89633f297 as norwegian_search_translation, $02d28687f3e70797$export$ca594fc9015508ad as polish_category_translation, $02d28687f3e70797$export$b0eb0dd41442f532 as polish_search_translation, $f6f89421463e8473$export$b3b5aa2c4df8976f as portuguese_search_translation, $f6f89421463e8473$export$d8290cf1bac152ab as portuguese_category_translation, $eb8757bc61f65db5$export$40e5a8a77e52bc27 as spanish_category_translation, $eb8757bc61f65db5$export$49b8f20513f0ff25 as spanish_search_translation, $ee9ca02aebefa7e4$export$7ba4dc17618f444f as swedish_category_translation, $ee9ca02aebefa7e4$export$596caee559c76764 as swedish_search_translation, $8c0f86cb3e266eeb$export$469c7af753d08925 as solid_format_price, $753e9b2889a47c89$export$3ccaa27d81dd8556 as PageReplacer, $9653a36120f642b0$export$3a8840c5b2ecf003 as Category, $59f48be661ca9195$export$ac6237957a15b3f0 as DepictSearch, $59f48be661ca9195$export$f2dc7e4e4aa11abb as SearchPage, $59f48be661ca9195$export$b94867ecbd698f21 as SearchField, $59f48be661ca9195$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $8d80d8d4afb6dcd3$export$2cefb7e61fcbae00 as add_to_version_info, $ec291e0010116877$export$83d89fbfd8236492 as version};
|