@depict-ai/ui 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/main.cjs +326 -629
- package/dist/client/module.js +327 -630
- package/dist/index.d.ts +8 -4
- package/dist/server/main.cjs +308 -445
- package/dist/server/module.js +309 -446
- package/package.json +4 -4
package/dist/client/main.cjs
CHANGED
|
@@ -49,9 +49,7 @@ $parcel$export(module.exports, "defaultGridSpacing", () => $a3280f0aad997933$exp
|
|
|
49
49
|
$parcel$export(module.exports, "defaultColsAtSize", () => $a3280f0aad997933$export$c3834fa86c616831);
|
|
50
50
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $a3280f0aad997933$export$7bf543b9d9be2c22);
|
|
51
51
|
$parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fbfd8236492);
|
|
52
|
-
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
/*! Depict.ai search and product listing SDK */ const $b757f75811f3261f$export$83d89fbfd8236492 = "1.4.3";
|
|
55
53
|
|
|
56
54
|
|
|
57
55
|
|
|
@@ -61,11 +59,11 @@ $parcel$export(module.exports, "version", () => $b757f75811f3261f$export$83d89fb
|
|
|
61
59
|
|
|
62
60
|
|
|
63
61
|
function $4b455f60dadde8b8$export$5bad61ecde080b1f(...params) {
|
|
64
|
-
const { collapse: collapse
|
|
62
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $57o7A$depictaiutilishared.useExpandingContainer)(...params);
|
|
65
63
|
return {
|
|
66
64
|
collapse: collapse,
|
|
67
65
|
expand: expand,
|
|
68
|
-
ExpandingContainer: ({ children: children
|
|
66
|
+
ExpandingContainer: ({ children: children })=>{
|
|
69
67
|
// get reactive signals/solid's jsx elements into `ExpandingContainer`
|
|
70
68
|
const fake_div = document.createElement("div");
|
|
71
69
|
const outer_expanding = (0, $57o7A$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -86,8 +84,8 @@ const $a69e505a12a77874$var$has_new_animate = /*@__PURE__*/ $a69e505a12a77874$ex
|
|
|
86
84
|
function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
87
85
|
let fresh_component = true;
|
|
88
86
|
let timeout_started = false;
|
|
89
|
-
const { details_: details_
|
|
90
|
-
const { expand: expand
|
|
87
|
+
const { details_: details_, summary_: summary_, children: children, duration_: duration_, delay_: delay_, dont_animate_if_instant_open_: dont_animate_if_instant_open_ = true } = props;
|
|
88
|
+
const { expand: expand, ExpandingContainer: ExpandingContainer, collapse: collapse } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
91
89
|
duration: duration_ ?? 250,
|
|
92
90
|
delay: delay_ ?? 0
|
|
93
91
|
});
|
|
@@ -120,7 +118,7 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
120
118
|
}
|
|
121
119
|
}));
|
|
122
120
|
details_.addEventListener("toggle", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
123
|
-
const { open: open
|
|
121
|
+
const { open: open } = details_;
|
|
124
122
|
if (open !== (0, $57o7A$solidjs.untrack)(()=>props.is_open_[0]())) // diffing here since the two items in is_open might be setters and getters that aren't part of one signal like in CheckboxHierarchicalFilter
|
|
125
123
|
props.is_open_[1](open);
|
|
126
124
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
@@ -130,7 +128,7 @@ function $a69e505a12a77874$export$6c6d7a51fa9aa15d(props) {
|
|
|
130
128
|
toggle();
|
|
131
129
|
}));
|
|
132
130
|
summary_.addEventListener("keydown", (0, $57o7A$depictaiutilishared.catchify)((ev)=>{
|
|
133
|
-
const { key: key
|
|
131
|
+
const { key: key } = ev;
|
|
134
132
|
if (key === "Enter" || key === " ") {
|
|
135
133
|
ev.preventDefault();
|
|
136
134
|
toggle();
|
|
@@ -170,14 +168,6 @@ function $0785f4c9947d9b5f$export$f091cbac892643a4(obj) {
|
|
|
170
168
|
|
|
171
169
|
|
|
172
170
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
171
|
function $d659702496cb72ea$export$a71e92cfbb498adc(props) {
|
|
182
172
|
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
183
173
|
const price_formatting = props.price_formatting_;
|
|
@@ -191,13 +181,6 @@ function $d659702496cb72ea$export$a71e92cfbb498adc(props) {
|
|
|
191
181
|
|
|
192
182
|
|
|
193
183
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
184
|
const $0f313083912e447a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>`, 4);
|
|
202
185
|
function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
203
186
|
return (()=>{
|
|
@@ -217,7 +200,7 @@ function $0f313083912e447a$export$8be2714ec7f169ee(props = {}) {
|
|
|
217
200
|
|
|
218
201
|
|
|
219
202
|
const $a0e53f99354809d9$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2);
|
|
220
|
-
function $a0e53f99354809d9$export$6649caad96ef8870({ children: children
|
|
203
|
+
function $a0e53f99354809d9$export$6649caad96ef8870({ children: children, slider_ref_: slider_ref_, faded_opacity_: faded_opacity_ = 0.7, mutation_plugins_: mutation_plugins_ = [] }) {
|
|
221
204
|
const slider = new (0, $57o7A$depictaiutilishared.Amazing_Slider)({
|
|
222
205
|
button_contents: {
|
|
223
206
|
left: [
|
|
@@ -258,19 +241,10 @@ function $a0e53f99354809d9$export$6649caad96ef8870({ children: children , slider
|
|
|
258
241
|
|
|
259
242
|
|
|
260
243
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
244
|
const $ee498ec5e7dc2bba$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2);
|
|
271
245
|
const $ee498ec5e7dc2bba$var$closing_functions = /*@__PURE__*/ new Set();
|
|
272
246
|
const $ee498ec5e7dc2bba$export$22970a0140fc759c = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjs.createSignal)(false);
|
|
273
|
-
function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children
|
|
247
|
+
function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children, on_close_: on_close_, close_after_: close_after_, ...more_attributes }) {
|
|
274
248
|
let close_toast_;
|
|
275
249
|
const stay_open_promise = new Promise((r)=>close_toast_ = r);
|
|
276
250
|
(0, $57o7A$depictaiutilishared.catchify)(async ()=>{
|
|
@@ -322,7 +296,7 @@ function $ee498ec5e7dc2bba$export$5196e4c01fa56fcb({ children: children , on_clo
|
|
|
322
296
|
// let other toasts close us if they open while we're still here
|
|
323
297
|
$ee498ec5e7dc2bba$var$closing_functions.add(close_toast_);
|
|
324
298
|
set_is_showing_toast(true);
|
|
325
|
-
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ key: key
|
|
299
|
+
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ key: key })=>{
|
|
326
300
|
if (key === "Escape") // make pressing escape close the toast
|
|
327
301
|
close_toast_();
|
|
328
302
|
});
|
|
@@ -382,7 +356,7 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
382
356
|
// if we get called to close the toast before it has shown, never show it
|
|
383
357
|
show_configured_toast = ()=>{};
|
|
384
358
|
};
|
|
385
|
-
const { user_triggered_: user_triggered_
|
|
359
|
+
const { user_triggered_: user_triggered_, i18n_: i18n_, also_clear_sorting_: also_clear_sorting_, local_filter_cache_: [get_local_filter_cache, set_local_filter_cache], selected_filters_: [get_selected_filters, set_selected_filters], expanded_hierarchical_filters_: [get_expanded_hierarchical_filters, set_expanded_hierarchical_filters], delay_toast_: delay_toast_ } = props;
|
|
386
360
|
const previous_selected_filters = (0, $57o7A$solidjs.untrack)(get_selected_filters);
|
|
387
361
|
if (!previous_selected_filters.length) {
|
|
388
362
|
// no filters selected, still clear sorting if applicable but don't display a toast for that since it's very minor
|
|
@@ -414,7 +388,7 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
414
388
|
}));
|
|
415
389
|
});
|
|
416
390
|
let show_configured_toast = ()=>{
|
|
417
|
-
({ close_toast_: close_toast_
|
|
391
|
+
({ close_toast_: close_toast_ } = (0, $ee498ec5e7dc2bba$export$5196e4c01fa56fcb)({
|
|
418
392
|
class: "cleared_filters",
|
|
419
393
|
close_after_: 30000,
|
|
420
394
|
on_close_: on_toast_hidden,
|
|
@@ -454,10 +428,6 @@ function $47e2cc552c02110c$export$8895d39404bd2bb1(props) {
|
|
|
454
428
|
|
|
455
429
|
|
|
456
430
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
431
|
const $c77c68e559a1506c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg><path d="M11.669 10.531l9.156-9.156a.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569A.8.8 0 0 0 20.24 0a.77.77 0 0 0-.569.237l-9.14 9.14-9.14-9.14A.79.79 0 0 0 .807 0a.77.77 0 0 0-.569.237A.78.78 0 0 0 0 .807a.77.77 0 0 0 .237.569l9.156 9.156-9.156 9.14c-.159.157-.237.349-.237.569s.079.412.237.569c.085.085.174.148.268.19a1.095 1.095 0 0 0 .316.048.894.894 0 0 0 .285-.048.84.84 0 0 0 .285-.19l9.139-9.14 9.14 9.14a.894.894 0 0 0 .268.19 1.049 1.049 0 0 0 .301.048.941.941 0 0 0 .301-.048.84.84 0 0 0 .285-.19.78.78 0 0 0 .237-.569c0-.221-.079-.412-.237-.569z"></path></svg>`, 4);
|
|
462
432
|
function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
|
|
463
433
|
return (()=>{
|
|
@@ -475,10 +445,10 @@ function $c77c68e559a1506c$export$3b621d86b1566b2(props = {}) {
|
|
|
475
445
|
|
|
476
446
|
|
|
477
447
|
const $235a2771a44e28e9$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="clear-all-filters minor"></button>`, 2), $235a2771a44e28e9$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="inner"><span class="title"><!#><!/>: </span><!#><!/></div>`, 8), $235a2771a44e28e9$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="clear-filter major"><!#><!/><span><!#><!/><!#><!/><!#><!/> – <!#><!/><!#><!/><!#><!/></span></button>`, 18), $235a2771a44e28e9$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="clear-filter major"><!#><!/><span></span></button>`, 6);
|
|
478
|
-
function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_
|
|
479
|
-
const { price_formatting_: price_formatting_
|
|
448
|
+
function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: [read_local_filter_cache], get_search_filters_open_: get_search_filters_open_, get_search_sorting_open_: get_search_sorting_open_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_ }) {
|
|
449
|
+
const { price_formatting_: price_formatting_ } = i18n_;
|
|
480
450
|
const [read_selected_filters, write_selected_filters] = selected_filters_;
|
|
481
|
-
const { collapse: collapse
|
|
451
|
+
const { collapse: collapse, expand: expand, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
482
452
|
duration: 200
|
|
483
453
|
});
|
|
484
454
|
const owner = (0, $57o7A$solidjs.getOwner)();
|
|
@@ -518,7 +488,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
518
488
|
const matching_filter = (0, $57o7A$solidjs.createMemo)(()=>read_local_filter_cache().find((hay)=>hay.field === filter().field && hay.op === filter().op));
|
|
519
489
|
const meta = (0, $57o7A$solidjs.createMemo)(()=>matching_filter()?.meta);
|
|
520
490
|
const iterable_selected_filter_data = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
521
|
-
const { data: data
|
|
491
|
+
const { data: data } = filter();
|
|
522
492
|
if (Array.isArray(data)) return data;
|
|
523
493
|
else return [
|
|
524
494
|
data
|
|
@@ -527,7 +497,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
527
497
|
const data_structure_if_hierarchical = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
528
498
|
const m = meta();
|
|
529
499
|
if (m?.type !== "checkbox-hierarchical") return;
|
|
530
|
-
const { values: values
|
|
500
|
+
const { values: values } = m;
|
|
531
501
|
const data_structure = {};
|
|
532
502
|
for(let i = 0; i < values.length; i++){
|
|
533
503
|
const value = values[i];
|
|
@@ -650,7 +620,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
650
620
|
if (siblings) return [
|
|
651
621
|
parent,
|
|
652
622
|
...Object.values(siblings)
|
|
653
|
-
].every(({ value_: value_
|
|
623
|
+
].every(({ value_: value_ })=>iterable_selected_filter_data()?.some((v)=>Array.isArray(v) && v.length === value_.length && value_.every((val, index)=>v[index] === val)));
|
|
654
624
|
return false;
|
|
655
625
|
});
|
|
656
626
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
@@ -683,7 +653,7 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
683
653
|
const recursive_kids = Object.values(in_structure.children_);
|
|
684
654
|
while(recursive_kids.length){
|
|
685
655
|
const kid = recursive_kids.pop();
|
|
686
|
-
const { value_: value_
|
|
656
|
+
const { value_: value_ } = kid;
|
|
687
657
|
const index_to_remove = cloned_data.findIndex((item)=>Array.isArray(item) && item.length === value_.length && value_.every((val, index)=>item[index] === val));
|
|
688
658
|
if (index_to_remove >= 0) cloned_data.splice(index_to_remove, 1);
|
|
689
659
|
recursive_kids.push(...Object.values(kid.children_));
|
|
@@ -750,28 +720,6 @@ function $235a2771a44e28e9$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
750
720
|
|
|
751
721
|
|
|
752
722
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
723
|
const $b3cf6ca8dc0e9998$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="count"></span>`, 2), $b3cf6ca8dc0e9998$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div><!#><!/></label>`, 11);
|
|
776
724
|
const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = (props)=>{
|
|
777
725
|
// It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
|
|
@@ -827,19 +775,6 @@ const $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d = (props)=>{
|
|
|
827
775
|
|
|
828
776
|
|
|
829
777
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
778
|
const $cc43b6428000c4bf$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg><path d="M10.173 5.548H5.5V.875c0-.075-.027-.14-.081-.193S5.301.601 5.226.601s-.14.027-.193.081-.081.118-.081.193v4.673H.274c-.075 0-.14.027-.193.081A.27.27 0 0 0 0 5.827c0 .075.027.14.081.193s.118.081.193.081h4.678v4.673c0 .075.027.14.081.193s.118.081.193.081.14-.027.193-.081.081-.118.081-.193V6.101h4.673a.27.27 0 0 0 .199-.081c.054-.054.08-.118.08-.193a.27.27 0 0 0-.279-.279z" fill="#000"></path></svg>`, 4);
|
|
844
779
|
function $cc43b6428000c4bf$export$f21ab0717a89c77f(props) {
|
|
845
780
|
return (()=>{
|
|
@@ -856,7 +791,7 @@ function $cc43b6428000c4bf$export$f21ab0717a89c77f(props) {
|
|
|
856
791
|
|
|
857
792
|
|
|
858
793
|
const $0fe1e7efdf4200d6$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button type="button" class="expand-filter"><!#><!/><span></span></button>`, 6);
|
|
859
|
-
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras]
|
|
794
|
+
function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extras, set_show_extras], i18n_: i18n_ }) {
|
|
860
795
|
return (()=>{
|
|
861
796
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($0fe1e7efdf4200d6$var$_tmpl$), _el$3 = _el$.firstChild, [_el$4, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$3.nextSibling), _el$2 = _el$4.nextSibling;
|
|
862
797
|
(0, $57o7A$solidjsweb.addEventListener)(_el$, "click", (0, $57o7A$depictaiutilishared.catchify)(()=>set_show_extras((p)=>!p)), true);
|
|
@@ -878,10 +813,10 @@ function $0fe1e7efdf4200d6$export$ca21a16d65b3dd8({ show_extras_: [get_show_extr
|
|
|
878
813
|
const $d94869c80e337a3d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<form class="checkboxes"><!#><!/><!#><!/></form>`, 6);
|
|
879
814
|
const $d94869c80e337a3d$var$max_visible_without_collapsing = 7;
|
|
880
815
|
const $d94869c80e337a3d$var$show_non_collapsible_when_collapsed = 4;
|
|
881
|
-
function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_
|
|
816
|
+
function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [, set_view_more_button_below_group_] }) {
|
|
882
817
|
const existing_filter = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
883
|
-
const { field: field
|
|
884
|
-
return get_selected_filters().find(({ field: checking_field
|
|
818
|
+
const { field: field, op: op } = filter_();
|
|
819
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
885
820
|
});
|
|
886
821
|
let form;
|
|
887
822
|
const checkboxes = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
@@ -912,7 +847,7 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
912
847
|
const show_extras_signal = (0, $57o7A$solidjs.createSignal)(false);
|
|
913
848
|
const [get_show_extras] = show_extras_signal;
|
|
914
849
|
const togglable_rest = (0, $57o7A$solidjs.createMemo)(()=>checkboxes().length > $d94869c80e337a3d$var$max_visible_without_collapsing);
|
|
915
|
-
const { expand: expand
|
|
850
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
916
851
|
duration: 200
|
|
917
852
|
});
|
|
918
853
|
const expanding_container_els = (0, $57o7A$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -950,7 +885,7 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
950
885
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($d94869c80e337a3d$var$_tmpl$), _el$2 = _el$.firstChild, [_el$3, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$2.nextSibling), _el$4 = _el$3.nextSibling, [_el$5, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$4.nextSibling);
|
|
951
886
|
(0, $57o7A$solidjsweb.addEventListener)(_el$, "change", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
952
887
|
const set_filter = existing_filter();
|
|
953
|
-
const { field: field
|
|
888
|
+
const { field: field, op: op } = filter_();
|
|
954
889
|
const base_object = set_filter ? set_filter : {
|
|
955
890
|
op: op,
|
|
956
891
|
field: field
|
|
@@ -985,19 +920,12 @@ function $d94869c80e337a3d$export$dd948f91abc3a1c4({ filter_: filter_ , selected
|
|
|
985
920
|
|
|
986
921
|
|
|
987
922
|
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
923
|
const $c1dc1554c1b94233$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<form class="radios"></form>`, 2), $c1dc1554c1b94233$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="count"></span>`, 2), $c1dc1554c1b94233$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="radio"><span class="custom-indicator"></span><!#><!/></div><!#><!/></label>`, 11);
|
|
996
|
-
function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected_filters_
|
|
924
|
+
function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected_filters_, filter_: filter_ }) {
|
|
997
925
|
const radio_name = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
998
926
|
const existing_filter = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
999
|
-
const { op: op
|
|
1000
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
927
|
+
const { op: op, field: field } = filter_();
|
|
928
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1001
929
|
});
|
|
1002
930
|
return (()=>{
|
|
1003
931
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($c1dc1554c1b94233$var$_tmpl$);
|
|
@@ -1063,21 +991,10 @@ function $c1dc1554c1b94233$export$430444115f70a734({ selected_filters_: selected
|
|
|
1063
991
|
|
|
1064
992
|
|
|
1065
993
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
994
|
const $0b7222ba8a8bb72f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.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>`, 32), $0b7222ba8a8bb72f$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="slider"><div class="progress"></div></div>`, 4), $0b7222ba8a8bb72f$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="range-group"><input type="range" step="any"><input type="range" step="any"></div>`, 4);
|
|
1078
|
-
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_
|
|
995
|
+
function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_, selected_filters_: selected_filters_, i18n_: i18n_ }) {
|
|
1079
996
|
const current_range = (0, $57o7A$solidjs.createSignal)((0, $57o7A$solidjs.untrack)(()=>filter_().data));
|
|
1080
|
-
const selected_filter = (0, $57o7A$solidjs.createMemo)(()=>selected_filters_[0]().find(({ field: checking_field
|
|
997
|
+
const selected_filter = (0, $57o7A$solidjs.createMemo)(()=>selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === filter_().field && checking_op === filter_().op));
|
|
1081
998
|
let debounce_timeout;
|
|
1082
999
|
(0, $57o7A$solidjs.onCleanup)(()=>clearTimeout(debounce_timeout));
|
|
1083
1000
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
@@ -1128,7 +1045,7 @@ function $0b7222ba8a8bb72f$export$e0d834a0ad870cda({ filter_: filter_ , selected
|
|
|
1128
1045
|
}
|
|
1129
1046
|
});
|
|
1130
1047
|
}
|
|
1131
|
-
function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_
|
|
1048
|
+
function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_, min_: min_, current_range_: current_range_, price_formatting_: price_formatting_, i18n_: i18n_ }) {
|
|
1132
1049
|
let price_input_1;
|
|
1133
1050
|
let price_input_2;
|
|
1134
1051
|
const [get_current_range] = current_range_;
|
|
@@ -1138,13 +1055,13 @@ function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
1138
1055
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($0b7222ba8a8bb72f$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.firstChild, _el$23 = _el$2.nextSibling, [_el$24, _co$7] = (0, $57o7A$solidjsweb.getNextMarker)(_el$23.nextSibling), _el$8 = _el$24.nextSibling, _el$9 = _el$8.firstChild, _el$10 = _el$9.firstChild, [_el$11, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$10.nextSibling), _el$12 = _el$11.nextSibling, [_el$13, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$12.nextSibling), _el$14 = _el$13.nextSibling, [_el$15, _co$3] = (0, $57o7A$solidjsweb.getNextMarker)(_el$14.nextSibling), _el$16 = _el$9.nextSibling, _el$17 = _el$16.firstChild, [_el$18, _co$4] = (0, $57o7A$solidjsweb.getNextMarker)(_el$17.nextSibling), _el$19 = _el$18.nextSibling, [_el$20, _co$5] = (0, $57o7A$solidjsweb.getNextMarker)(_el$19.nextSibling), _el$21 = _el$20.nextSibling, [_el$22, _co$6] = (0, $57o7A$solidjsweb.getNextMarker)(_el$21.nextSibling);
|
|
1139
1056
|
const _ref$ = price_input_1;
|
|
1140
1057
|
typeof _ref$ === "function" ? (0, $57o7A$solidjsweb.use)(_ref$, _el$4) : price_input_1 = _el$4;
|
|
1141
|
-
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "keydown", (0, $57o7A$depictaiutilishared.catchify)(({ key: key
|
|
1058
|
+
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "keydown", (0, $57o7A$depictaiutilishared.catchify)(({ key: key })=>{
|
|
1142
1059
|
if (key === "Enter") $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_, 0, price_input_1);
|
|
1143
1060
|
}), true);
|
|
1144
1061
|
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "blur", (0, $57o7A$depictaiutilishared.catchify)(()=>$0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_, 0, price_input_1)));
|
|
1145
1062
|
const _ref$2 = price_input_2;
|
|
1146
1063
|
typeof _ref$2 === "function" ? (0, $57o7A$solidjsweb.use)(_ref$2, _el$7) : price_input_2 = _el$7;
|
|
1147
|
-
(0, $57o7A$solidjsweb.addEventListener)(_el$7, "keydown", (0, $57o7A$depictaiutilishared.catchify)(({ key: key
|
|
1064
|
+
(0, $57o7A$solidjsweb.addEventListener)(_el$7, "keydown", (0, $57o7A$depictaiutilishared.catchify)(({ key: key })=>{
|
|
1148
1065
|
if (key === "Enter") $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_, 1, price_input_2);
|
|
1149
1066
|
}), true);
|
|
1150
1067
|
(0, $57o7A$solidjsweb.addEventListener)(_el$7, "blur", (0, $57o7A$depictaiutilishared.catchify)(()=>$0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_range_, 1, price_input_2)));
|
|
@@ -1197,7 +1114,7 @@ function $0b7222ba8a8bb72f$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
1197
1114
|
return _el$;
|
|
1198
1115
|
})();
|
|
1199
1116
|
}
|
|
1200
|
-
function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range_
|
|
1117
|
+
function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range_, min_: min_, i18n_: i18n_, max_: max_ }) {
|
|
1201
1118
|
// inspired by https://observablehq.com/@mbostock/nonlinear-slider
|
|
1202
1119
|
const transform_linear_to_nonlinear = ([smaller, larger])=>[
|
|
1203
1120
|
Math.sqrt(smaller),
|
|
@@ -1235,7 +1152,7 @@ function $0b7222ba8a8bb72f$var$ExponentialSlider({ current_range_: current_range
|
|
|
1235
1152
|
i18n_: i18n_
|
|
1236
1153
|
});
|
|
1237
1154
|
}
|
|
1238
|
-
function $0b7222ba8a8bb72f$var$LinearSlider({ max_: max_
|
|
1155
|
+
function $0b7222ba8a8bb72f$var$LinearSlider({ max_: max_, min_: min_, current_range_: current_range_, offset_value_calculator_: offset_value_calculator_, i18n_: i18n_ }) {
|
|
1239
1156
|
let range_input_1;
|
|
1240
1157
|
let range_input_2;
|
|
1241
1158
|
let clickable_slider;
|
|
@@ -1355,19 +1272,8 @@ function $0b7222ba8a8bb72f$var$set_range_with_sanitation(min_, max_, current_ran
|
|
|
1355
1272
|
|
|
1356
1273
|
|
|
1357
1274
|
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
1275
|
const $7567511a7c3e4bd7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="morphing-sign" role="img"><span></span><span></span></div>`, 6);
|
|
1370
|
-
function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_
|
|
1276
|
+
function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_, i18n_: i18n_ }) {
|
|
1371
1277
|
let first_span;
|
|
1372
1278
|
let second_span;
|
|
1373
1279
|
const animation_options = {
|
|
@@ -1419,11 +1325,11 @@ function $7567511a7c3e4bd7$export$e5c2828934226505({ expanded_: expanded_ , i18n
|
|
|
1419
1325
|
const $3bdc00a1353c1150$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<form class="checkboxes hierarchical"><!#><!/><!#><!/></form>`, 6), $3bdc00a1353c1150$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="checkbox-details"><!#><!/><!#><!/></div>`, 6), $3bdc00a1353c1150$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<details></details>`, 2), $3bdc00a1353c1150$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<summary class="category-parent"><div class="summary"><span class="count"></span><!#><!/></div></summary>`, 8);
|
|
1420
1326
|
const $3bdc00a1353c1150$var$max_visible_without_collapsing = 7;
|
|
1421
1327
|
const $3bdc00a1353c1150$var$show_non_collapsible_when_collapsed = 4;
|
|
1422
|
-
function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_
|
|
1328
|
+
function $3bdc00a1353c1150$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_ }) {
|
|
1423
1329
|
let form;
|
|
1424
1330
|
const existing_filter = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1425
|
-
const { field: field
|
|
1426
|
-
return selected_filters_[0]().find(({ field: checking_field
|
|
1331
|
+
const { field: field, op: op } = filter_();
|
|
1332
|
+
return selected_filters_[0]().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1427
1333
|
});
|
|
1428
1334
|
const show_extras = (0, $57o7A$solidjs.createSignal)(false);
|
|
1429
1335
|
const trigger_sync_ = $3bdc00a1353c1150$var$batching_filter_state_syncer({
|
|
@@ -1436,7 +1342,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1436
1342
|
});
|
|
1437
1343
|
const structured_categories = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1438
1344
|
const execute_when_structure_finished = [];
|
|
1439
|
-
const { values: values
|
|
1345
|
+
const { values: values, names: names, counts: counts } = filter_().meta;
|
|
1440
1346
|
const data_structure = {};
|
|
1441
1347
|
for(let i = 0; i < values.length; i++){
|
|
1442
1348
|
const value = values[i];
|
|
@@ -1458,7 +1364,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1458
1364
|
value_: value_as_string,
|
|
1459
1365
|
children_: {}
|
|
1460
1366
|
};
|
|
1461
|
-
const { signal_: signal_
|
|
1367
|
+
const { signal_: signal_, on_structure_complete_: on_structure_complete_ } = $3bdc00a1353c1150$var$create_updating_signal({
|
|
1462
1368
|
self_: created_obj,
|
|
1463
1369
|
existing_filter_: (0, $57o7A$solidjs.untrack)(existing_filter),
|
|
1464
1370
|
trigger_sync_: trigger_sync_
|
|
@@ -1501,7 +1407,7 @@ function $3bdc00a1353c1150$export$a32086fa6616eafd({ filter_: filter_ , selected
|
|
|
1501
1407
|
return data_structure;
|
|
1502
1408
|
});
|
|
1503
1409
|
const some_top_level_are_hidden = (0, $57o7A$solidjs.createMemo)(()=>Object.keys(structured_categories()).length > $3bdc00a1353c1150$var$max_visible_without_collapsing);
|
|
1504
|
-
const { expand: expand
|
|
1410
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
1505
1411
|
duration: 200
|
|
1506
1412
|
});
|
|
1507
1413
|
const expanding_container_els = (0, $57o7A$solidjsweb.createComponent)(ExpandingContainer, {
|
|
@@ -1575,7 +1481,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1575
1481
|
},
|
|
1576
1482
|
input_ref_: (input)=>{
|
|
1577
1483
|
input.addEventListener("change", (0, $57o7A$depictaiutilishared.catchify)(()=>(0, $57o7A$solidjs.untrack)(()=>{
|
|
1578
|
-
const { checked: checked
|
|
1484
|
+
const { checked: checked } = input;
|
|
1579
1485
|
if (checked) value()?.is_expanded_.set_user_expanded_(true);
|
|
1580
1486
|
value()?.is_checked_[1](checked);
|
|
1581
1487
|
})));
|
|
@@ -1622,7 +1528,7 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1622
1528
|
const v = value();
|
|
1623
1529
|
if (!v) // only to prevent cleanup errors
|
|
1624
1530
|
return (0, $57o7A$solidjs.createSignal)(false);
|
|
1625
|
-
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_
|
|
1531
|
+
const { is_expanded_: { ui_should_show_expanded_: ui_should_show_expanded_, set_user_expanded_: set_user_expanded_ } } = v;
|
|
1626
1532
|
return [
|
|
1627
1533
|
ui_should_show_expanded_,
|
|
1628
1534
|
set_user_expanded_
|
|
@@ -1644,13 +1550,13 @@ function $3bdc00a1353c1150$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
1644
1550
|
});
|
|
1645
1551
|
}
|
|
1646
1552
|
function $3bdc00a1353c1150$var$batching_filter_state_syncer(props) {
|
|
1647
|
-
const { filter_: filter_
|
|
1553
|
+
const { filter_: filter_, selected_filters_: selected_filters_, existing_filter_: existing_filter_ } = props;
|
|
1648
1554
|
let sync_queued = false;
|
|
1649
1555
|
const sync_fn = (0, $57o7A$depictaiutilishared.catchify)(async ()=>{
|
|
1650
1556
|
sync_queued = false;
|
|
1651
1557
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1652
1558
|
const set_filter = existing_filter_();
|
|
1653
|
-
const { field: field
|
|
1559
|
+
const { field: field, op: op } = filter_();
|
|
1654
1560
|
const base_object = set_filter ? set_filter : {
|
|
1655
1561
|
op: op,
|
|
1656
1562
|
field: field
|
|
@@ -1683,7 +1589,7 @@ function $3bdc00a1353c1150$var$batching_filter_state_syncer(props) {
|
|
|
1683
1589
|
};
|
|
1684
1590
|
return trigger_sync;
|
|
1685
1591
|
}
|
|
1686
|
-
function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_
|
|
1592
|
+
function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_, existing_filter_: existing_filter_, trigger_sync_: trigger_sync_ }) {
|
|
1687
1593
|
const signal_ = [];
|
|
1688
1594
|
const on_structure_complete_ = ()=>{
|
|
1689
1595
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
@@ -1692,7 +1598,7 @@ function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1692
1598
|
signal_.push(...(0, $57o7A$solidjs.createSignal)(index_of_us_in_selected_filter >= 0 ? true : false));
|
|
1693
1599
|
const [read_checked, write_checked] = signal_;
|
|
1694
1600
|
const child_objects = Object.values(self_.children_);
|
|
1695
|
-
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked]
|
|
1601
|
+
const get_child_object_values = child_objects.map(({ is_checked_: [read_is_checked] })=>read_is_checked);
|
|
1696
1602
|
(0, $57o7A$solidjs.createComputed)((0, $57o7A$solidjs.on)(read_checked, trigger_sync_, {
|
|
1697
1603
|
defer: true
|
|
1698
1604
|
}));
|
|
@@ -1727,8 +1633,8 @@ function $3bdc00a1353c1150$var$create_updating_signal({ self_: self_ , existing_
|
|
|
1727
1633
|
on_structure_complete_: on_structure_complete_
|
|
1728
1634
|
};
|
|
1729
1635
|
}
|
|
1730
|
-
function $3bdc00a1353c1150$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters]
|
|
1731
|
-
const index_in_expanded_filters = (0, $57o7A$solidjs.createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_
|
|
1636
|
+
function $3bdc00a1353c1150$var$make_expanded_signal({ expanded_hierarchical_filters_: [read_expanded_hierarchical_filters, write_expanded_hierarchical_filters], filter_value_: filter_value_ }) {
|
|
1637
|
+
const index_in_expanded_filters = (0, $57o7A$solidjs.createMemo)(()=>read_expanded_hierarchical_filters().findIndex(({ value_: value_ })=>value_.length === filter_value_.length && value_.every((item, index)=>filter_value_[index] === item)), undefined, {
|
|
1732
1638
|
equals: false
|
|
1733
1639
|
} // we always want this to update so that we can make updates of the object on this index depend on this memo
|
|
1734
1640
|
);
|
|
@@ -1793,18 +1699,11 @@ function $3bdc00a1353c1150$var$expand_until_choice(data_structure) {
|
|
|
1793
1699
|
|
|
1794
1700
|
|
|
1795
1701
|
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
1702
|
const $0ef1681699140f1a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="checkbox-grid"></div>`, 2), $0ef1681699140f1a$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="major-minor-transition"></button>`, 2);
|
|
1804
|
-
const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_
|
|
1703
|
+
const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters] })=>{
|
|
1805
1704
|
const existing_filter = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1806
|
-
const { field: field
|
|
1807
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1705
|
+
const { field: field, op: op } = filter_();
|
|
1706
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1808
1707
|
});
|
|
1809
1708
|
const buttons = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1810
1709
|
const meta = filter_().meta;
|
|
@@ -1826,7 +1725,7 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1826
1725
|
const _el$2 = (0, $57o7A$solidjsweb.getNextElement)($0ef1681699140f1a$var$_tmpl$2);
|
|
1827
1726
|
(0, $57o7A$solidjsweb.addEventListener)(_el$2, "click", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
1828
1727
|
const set_filter = existing_filter();
|
|
1829
|
-
const { field: field
|
|
1728
|
+
const { field: field, op: op } = filter_();
|
|
1830
1729
|
const base_object = set_filter ? set_filter : {
|
|
1831
1730
|
op: op,
|
|
1832
1731
|
field: field
|
|
@@ -1884,16 +1783,9 @@ const $0ef1681699140f1a$export$414f6a19d38e655c = ({ filter_: filter_ , selected
|
|
|
1884
1783
|
|
|
1885
1784
|
|
|
1886
1785
|
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
1786
|
function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
1895
1787
|
const signal = (0, $57o7A$solidjs.createSignal)(false);
|
|
1896
|
-
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)(media_query, ({ matches: matches
|
|
1788
|
+
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)(media_query, ({ matches: matches })=>signal[1](matches)).remove);
|
|
1897
1789
|
return signal[0];
|
|
1898
1790
|
}
|
|
1899
1791
|
|
|
@@ -1901,27 +1793,29 @@ function $b54e6192d0caa293$export$d9f36cf74e24d595(media_query) {
|
|
|
1901
1793
|
const $b51a2b8b9355e66c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<form class="checkbox-color"><!#><!/><!#><!/></form>`, 6);
|
|
1902
1794
|
const $b51a2b8b9355e66c$var$max_visible_without_collapsing = 14;
|
|
1903
1795
|
const $b51a2b8b9355e66c$var$show_non_collapsible_when_collapsed = 8;
|
|
1904
|
-
function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_
|
|
1796
|
+
function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_, selected_filters_: [get_selected_filters, set_selected_filters], i18n_: i18n_, view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_] }) {
|
|
1905
1797
|
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("not all and (hover: none)");
|
|
1906
1798
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
1907
1799
|
const existing_filter = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1908
|
-
const { field: field
|
|
1909
|
-
return get_selected_filters().find(({ field: checking_field
|
|
1800
|
+
const { field: field, op: op } = filter_();
|
|
1801
|
+
return get_selected_filters().find(({ field: checking_field, op: checking_op })=>checking_field === field && checking_op === op);
|
|
1910
1802
|
});
|
|
1911
1803
|
let form;
|
|
1912
1804
|
const checkboxes = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
1913
1805
|
const meta = filter_().meta;
|
|
1914
|
-
return meta.values.map((value_, index)
|
|
1915
|
-
|
|
1806
|
+
return meta.values.map((value_, index)=>{
|
|
1807
|
+
return {
|
|
1916
1808
|
value_: value_,
|
|
1917
1809
|
name_: meta.names?.[index],
|
|
1918
|
-
count_: meta.counts?.[index]
|
|
1919
|
-
|
|
1920
|
-
|
|
1810
|
+
count_: meta.counts?.[index]
|
|
1811
|
+
};
|
|
1812
|
+
});
|
|
1921
1813
|
});
|
|
1922
1814
|
const render_checkbox = (checkbox)=>{
|
|
1923
|
-
|
|
1924
|
-
const
|
|
1815
|
+
const color_name = (0, $57o7A$solidjs.createMemo)(()=>checkbox().value_.split(";")?.[0] || "");
|
|
1816
|
+
const hex_color = (0, $57o7A$solidjs.createMemo)(()=>checkbox().value_.split(";")?.[1] || "");
|
|
1817
|
+
const rgb_color = (0, $57o7A$solidjs.createMemo)(()=>(0, $57o7A$depictaiutilishared.hex_to_rgb)(hex_color()));
|
|
1818
|
+
const black_contrast_better = (0, $57o7A$solidjs.createMemo)(()=>rgb_color() ? $b51a2b8b9355e66c$var$does_black_contrast_better(rgb_color()) : true);
|
|
1925
1819
|
const input_row = (0, $57o7A$solidjsweb.createComponent)((0, $b3cf6ca8dc0e9998$export$48513f6b9f8ce62d), {
|
|
1926
1820
|
get value_ () {
|
|
1927
1821
|
return checkbox().value_;
|
|
@@ -1936,51 +1830,22 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
1936
1830
|
return existing_filter()?.data?.includes(checkbox().value_);
|
|
1937
1831
|
},
|
|
1938
1832
|
custom_indicator_ref: (span)=>{
|
|
1939
|
-
const { classList: classList
|
|
1940
|
-
// create some memos for diffing
|
|
1941
|
-
const hue = (0, $57o7A$solidjs.createMemo)(()=>checkbox().color_[0]);
|
|
1942
|
-
const saturation = (0, $57o7A$solidjs.createMemo)(()=>checkbox().color_[1]);
|
|
1943
|
-
const lightness = (0, $57o7A$solidjs.createMemo)(()=>checkbox().color_[2]);
|
|
1944
|
-
const special_type = (0, $57o7A$solidjs.createMemo)(()=>checkbox().color_[3]);
|
|
1833
|
+
const { classList: classList, style: style } = span;
|
|
1945
1834
|
classList.add("color");
|
|
1946
1835
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
// to generate darkened gradient, this was used:
|
|
1951
|
-
// $change: -5%;
|
|
1952
|
-
// background: linear-gradient(
|
|
1953
|
-
// 180deg,
|
|
1954
|
-
// color.adjust(#ff0000, $lightness: $change) 0%,
|
|
1955
|
-
// color.adjust(#ff6e00, $lightness: $change) 17.71%,
|
|
1956
|
-
// color.adjust(#ffff00, $lightness: $change) 33.33%,
|
|
1957
|
-
// color.adjust(#1eb41e, $lightness: $change) 50.52%,
|
|
1958
|
-
// color.adjust(#00d2ff, $lightness: $change) 67.71%,
|
|
1959
|
-
// color.adjust(#3737c8, $lightness: $change) 83.85%,
|
|
1960
|
-
// color.adjust(#d200ff, $lightness: $change) 100%
|
|
1961
|
-
// );
|
|
1962
|
-
classList.toggle("check-multi", true);
|
|
1963
|
-
style.backgroundImage = is_hovered ? `linear-gradient(#e60000 0%, #e66300 17.71%, #e6e600 33.33%, #1a9e1a 50.52%, #00bde6 67.71%, #3232b4 83.85%, #bd00e6 100%)` : `linear-gradient(180deg, #FF0000 0%, #FF6E00 17.71%, #FFFF00 33.33%, #1EB41E 50.52%, #00D2FF 67.71%, #3737C8 83.85%, #D200FF 100%)`;
|
|
1964
|
-
} else {
|
|
1965
|
-
const is_light = lightness() > 50;
|
|
1966
|
-
// lighten or darken (+/- 10) depending on it's over or under 50 lightness
|
|
1967
|
-
// lighten under 25 lightness by 20
|
|
1968
|
-
const target_lightness = is_hovered ? is_light ? lightness() - 10 : lightness() < 25 ? lightness() + 20 : lightness() + 10 : lightness();
|
|
1969
|
-
classList.toggle("check-dark", $b51a2b8b9355e66c$var$black_contrast_better(hue(), saturation(), lightness())); // Decide between black/white checkmark based on which one has better contrast according to WCAG contrast guidelines
|
|
1970
|
-
style.backgroundColor = `hsl(${hue()}, ${saturation()}%, ${target_lightness}%)`;
|
|
1971
|
-
}
|
|
1836
|
+
style.background = hex_color();
|
|
1837
|
+
span.dataset.colorName = color_name();
|
|
1838
|
+
classList.toggle("black-check", black_contrast_better());
|
|
1972
1839
|
});
|
|
1973
1840
|
}
|
|
1974
1841
|
});
|
|
1975
|
-
input_row.addEventListener("mouseover", (0, $57o7A$depictaiutilishared.catchify)(()=>set_is_hovered(true)));
|
|
1976
|
-
input_row.addEventListener("mouseout", (0, $57o7A$depictaiutilishared.catchify)(()=>set_is_hovered(false)));
|
|
1977
1842
|
return input_row;
|
|
1978
1843
|
};
|
|
1979
1844
|
const show_extras_signal = (0, $57o7A$solidjs.createSignal)(false);
|
|
1980
1845
|
const [get_show_extras] = show_extras_signal;
|
|
1981
1846
|
const togglable_rest = (0, $57o7A$solidjs.createMemo)(()=>checkboxes().length > $b51a2b8b9355e66c$var$max_visible_without_collapsing);
|
|
1982
1847
|
const expand_animation_duration = 200;
|
|
1983
|
-
const { expand: expand
|
|
1848
|
+
const { expand: expand, collapse: collapse, ExpandingContainer: ExpandingContainer } = (0, $4b455f60dadde8b8$export$5bad61ecde080b1f)({
|
|
1984
1849
|
duration: expand_animation_duration
|
|
1985
1850
|
});
|
|
1986
1851
|
const [get_having_expanding_in_dom, set_having_expanding_in_dom] = (0, $57o7A$solidjs.createSignal)((0, $57o7A$solidjs.untrack)(togglable_rest)); // We need to remove the expanding els from the DOM if they're empty, otherwise the flexbox makes a weird gap to the right of the last item sometimes
|
|
@@ -2028,7 +1893,7 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
2028
1893
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($b51a2b8b9355e66c$var$_tmpl$), _el$2 = _el$.firstChild, [_el$3, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$2.nextSibling), _el$4 = _el$3.nextSibling, [_el$5, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$4.nextSibling);
|
|
2029
1894
|
(0, $57o7A$solidjsweb.addEventListener)(_el$, "change", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
2030
1895
|
const set_filter = existing_filter();
|
|
2031
|
-
const { field: field
|
|
1896
|
+
const { field: field, op: op } = filter_();
|
|
2032
1897
|
const base_object = set_filter ? set_filter : {
|
|
2033
1898
|
op: op,
|
|
2034
1899
|
field: field
|
|
@@ -2063,9 +1928,9 @@ function $b51a2b8b9355e66c$export$82ed4b28ecb67608({ filter_: filter_ , selected
|
|
|
2063
1928
|
return _el$;
|
|
2064
1929
|
})();
|
|
2065
1930
|
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
const luminance_color = (0, $57o7A$depictaiutilishared.relative_luminance_from_rgb)(...
|
|
1931
|
+
// Daniel's magic https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7648#note_1468373350
|
|
1932
|
+
function $b51a2b8b9355e66c$var$does_black_contrast_better(rgb) {
|
|
1933
|
+
const luminance_color = (0, $57o7A$depictaiutilishared.relative_luminance_from_rgb)(...rgb);
|
|
2069
1934
|
const luminance_white = 1;
|
|
2070
1935
|
const luminance_black = 0;
|
|
2071
1936
|
const contrast_ratio_if_white = (luminance_white + 0.05) / (luminance_color + 0.05);
|
|
@@ -2090,14 +1955,6 @@ var $a636ca15e3d3570d$export$2e2bcd8739ae039 = {
|
|
|
2090
1955
|
|
|
2091
1956
|
|
|
2092
1957
|
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
1958
|
const $0f4656eaf6c22d1d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="16.8" height="14"><path d="M4.617 12.738a.48.48 0 0 1-.164-.027c-.051-.023-.094-.055-.129-.098L.125 8.414A.39.39 0 0 1 0 8.117c0-.113.039-.211.125-.293s.18-.125.293-.125.215.043.297.125l3.902 3.902L16.086.262c.082-.082.18-.125.297-.125s.211.043.293.125.125.184.125.301-.043.215-.125.297L4.914 12.613c-.039.043-.086.078-.141.098s-.102.027-.156.027zm0 0"></path></svg>`, 4);
|
|
2102
1959
|
function $0f4656eaf6c22d1d$export$f2ca6fc699ca1fb4(props = {}) {
|
|
2103
1960
|
return (()=>{
|
|
@@ -2110,17 +1967,17 @@ function $0f4656eaf6c22d1d$export$f2ca6fc699ca1fb4(props = {}) {
|
|
|
2110
1967
|
|
|
2111
1968
|
|
|
2112
1969
|
const $b064919833b3e80b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="show-selected" aria-hidden="true"><span></span><!#><!/></span>`, 6);
|
|
2113
|
-
function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_
|
|
1970
|
+
function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_, i18n_: { price_formatting_: price_formatting_ } }) {
|
|
2114
1971
|
const [show_tick_icon, set_show_tick_icon] = (0, $57o7A$solidjs.createSignal)(false);
|
|
2115
1972
|
const text = (0, $57o7A$solidjs.createMemo)(()=>(0, $57o7A$solidjs.batch)(()=>{
|
|
2116
1973
|
set_show_tick_icon(false);
|
|
2117
|
-
let { size: size
|
|
1974
|
+
let { size: size } = selected_filters_in_group_();
|
|
2118
1975
|
try_specific: {
|
|
2119
1976
|
if (size > 1) break try_specific;
|
|
2120
1977
|
for (const [selected_filter, filter_data] of selected_filters_in_group_()){
|
|
2121
1978
|
// we're intentionally not looping in this statement since we always just want to show the first thing in the filter group
|
|
2122
|
-
const { meta: meta
|
|
2123
|
-
const { type: type
|
|
1979
|
+
const { meta: meta } = filter_data;
|
|
1980
|
+
const { type: type } = meta;
|
|
2124
1981
|
if (type === "range") return [
|
|
2125
1982
|
(0, $57o7A$solidjsweb.memo)(()=>price_formatting_().pre_),
|
|
2126
1983
|
(0, $57o7A$solidjsweb.createComponent)((0, $d659702496cb72ea$export$a71e92cfbb498adc), {
|
|
@@ -2145,7 +2002,7 @@ function $b064919833b3e80b$export$53c59af873b303c9({ selected_filters_in_group_:
|
|
|
2145
2002
|
(0, $57o7A$solidjsweb.memo)(()=>price_formatting_().post_)
|
|
2146
2003
|
];
|
|
2147
2004
|
else {
|
|
2148
|
-
const { data: data
|
|
2005
|
+
const { data: data } = selected_filter;
|
|
2149
2006
|
const data_is_array = Array.isArray(data);
|
|
2150
2007
|
if (data_is_array && data.length !== 1) {
|
|
2151
2008
|
size = data.length;
|
|
@@ -2229,10 +2086,6 @@ function $8c939a05b87fbbbc$export$ab34afce88557c0e(props) {
|
|
|
2229
2086
|
|
|
2230
2087
|
|
|
2231
2088
|
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
2089
|
// Errors caused by SDK consuming code interfacing with the SDK, not the SDK itself or other Depict packages
|
|
2237
2090
|
class $7dd1edb2ee2b43ad$export$e1d52e4f0c7557a1 extends Error {
|
|
2238
2091
|
}
|
|
@@ -2249,7 +2102,7 @@ const $edafe91daf3091d7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solid
|
|
|
2249
2102
|
function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
2250
2103
|
return (0, $57o7A$solidjs.ErrorBoundary)({
|
|
2251
2104
|
fallback (err, retry) {
|
|
2252
|
-
const { message_: message_
|
|
2105
|
+
const { message_: message_, severity_: severity_ } = props;
|
|
2253
2106
|
let message = message_;
|
|
2254
2107
|
if (err instanceof (0, $7dd1edb2ee2b43ad$export$aa14a9f43128f61f)) {
|
|
2255
2108
|
console.error(err.cause);
|
|
@@ -2279,11 +2132,6 @@ function $edafe91daf3091d7$export$b69d0d92862de18b(props) {
|
|
|
2279
2132
|
|
|
2280
2133
|
|
|
2281
2134
|
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
2135
|
const $9fe9883b1d8ecccc$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span></span>`, 2);
|
|
2288
2136
|
function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
|
|
2289
2137
|
return (()=>{
|
|
@@ -2305,7 +2153,7 @@ function $9fe9883b1d8ecccc$export$acb3eaade4b23afd(props) {
|
|
|
2305
2153
|
|
|
2306
2154
|
function $061ff5b4c3d36171$export$89c6019e4baa40b1(props) {
|
|
2307
2155
|
const style = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
2308
|
-
const { style: style
|
|
2156
|
+
const { style: style, height: height, width: width } = props;
|
|
2309
2157
|
return {
|
|
2310
2158
|
...style || {},
|
|
2311
2159
|
height: height ?? "1em",
|
|
@@ -2477,7 +2325,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
|
|
|
2477
2325
|
...props.selected_filters_[0]()
|
|
2478
2326
|
];
|
|
2479
2327
|
for (const filter of filter_array_()){
|
|
2480
|
-
const index = new_filter_obj.findIndex(({ op: op
|
|
2328
|
+
const index = new_filter_obj.findIndex(({ op: op, field: field })=>op === filter.op && field === filter.field);
|
|
2481
2329
|
if (index >= 0) new_filter_obj.splice(index, 1);
|
|
2482
2330
|
}
|
|
2483
2331
|
props.selected_filters_[1](new_filter_obj);
|
|
@@ -2563,7 +2411,7 @@ function $aff9a96d30ed3563$var$ActualFilterBody(props) {
|
|
|
2563
2411
|
|
|
2564
2412
|
|
|
2565
2413
|
|
|
2566
|
-
function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: available_filters_
|
|
2414
|
+
function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: available_filters_, local_filter_cache_: [read_local_cache, write_local_cache], selected_filters_: [read_selected_filters] }) {
|
|
2567
2415
|
let last_remote_state;
|
|
2568
2416
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
2569
2417
|
const remote_filters = Object.fromEntries(available_filters_()?.map((filter)=>[
|
|
@@ -2650,14 +2498,14 @@ function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2650
2498
|
}).map((key)=>data_objs_in_local[key]),
|
|
2651
2499
|
...Object.values(data_objs_in_remote)
|
|
2652
2500
|
];
|
|
2653
|
-
const new_values = new_data.map(({ value_: value_
|
|
2501
|
+
const new_values = new_data.map(({ value_: value_ })=>value_);
|
|
2654
2502
|
const result = {
|
|
2655
2503
|
...remote_filter,
|
|
2656
2504
|
meta: {
|
|
2657
2505
|
...remote_filter.meta,
|
|
2658
2506
|
values: new_values,
|
|
2659
|
-
names: new_data.map(({ name_: name_
|
|
2660
|
-
counts: new_data.map(({ count_: count_
|
|
2507
|
+
names: new_data.map(({ name_: name_ })=>name_),
|
|
2508
|
+
counts: new_data.map(({ count_: count_ })=>count_)
|
|
2661
2509
|
}
|
|
2662
2510
|
};
|
|
2663
2511
|
new_local_filter_state.push(result);
|
|
@@ -2715,16 +2563,6 @@ function $70482f04605572e2$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
2715
2563
|
|
|
2716
2564
|
|
|
2717
2565
|
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
2566
|
function $5f7d55c710fd1bc2$export$2f0cbfbb4354bb52(elements) {
|
|
2729
2567
|
// FYI this probably doesn't work on hugely deep nestings or large amount of elements
|
|
2730
2568
|
return (0, $57o7A$solidjs.createMemo)(()=>$5f7d55c710fd1bc2$var$unwrapping_helper(elements));
|
|
@@ -2812,7 +2650,7 @@ function $f48d0fbb00835aaa$var$ActualSolidLayout(props, container_element) {
|
|
|
2812
2650
|
(0, $57o7A$solidjs.onCleanup)(()=>mutation_observer.disconnect());
|
|
2813
2651
|
set_styling(// this is needed because solid will think that the memo-accessor is a setter function otherwise
|
|
2814
2652
|
()=>(0, $57o7A$solidjs.createMemo)(()=>{
|
|
2815
|
-
const { rows_per_click: rows_per_click
|
|
2653
|
+
const { rows_per_click: rows_per_click, max_rows: max_rows = -1 } = rows_or_empty_object();
|
|
2816
2654
|
const rows_visible = get_rows_visible();
|
|
2817
2655
|
const children_count = get_children_count();
|
|
2818
2656
|
return col_styling() + props.cols_at_size.map((options)=>{
|
|
@@ -2901,7 +2739,7 @@ async function $9abb0a35d4b60ed3$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
2901
2739
|
|
|
2902
2740
|
|
|
2903
2741
|
|
|
2904
|
-
async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant
|
|
2742
|
+
async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant, market: market, headers: headers, ...fetch_recs_options }) {
|
|
2905
2743
|
return await (0, $57o7A$depictaiutilishared.fetch_recs)({
|
|
2906
2744
|
tenant: merchant,
|
|
2907
2745
|
market: market
|
|
@@ -2913,11 +2751,6 @@ async function $bc91d938b8c601b4$export$58e808b1db15d3bc({ merchant: merchant ,
|
|
|
2913
2751
|
|
|
2914
2752
|
|
|
2915
2753
|
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
2754
|
function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, router_) {
|
|
2922
2755
|
const signals = {};
|
|
2923
2756
|
const entries = Object.entries(params_to_default_value);
|
|
@@ -2927,7 +2760,7 @@ function $6e22b5314fb52f4c$export$e183a13865960371(params_to_default_value, rout
|
|
|
2927
2760
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2928
2761
|
(0, $57o7A$solidjs.createRenderEffect)(()=>{
|
|
2929
2762
|
let signal_changed = false;
|
|
2930
|
-
let { state: state
|
|
2763
|
+
let { state: state } = globalThis?.history || {
|
|
2931
2764
|
state: {}
|
|
2932
2765
|
}; // cloning isn't necessary because we're calling replaceState on it anyway
|
|
2933
2766
|
if (state === null || typeof state != "object") state = {};
|
|
@@ -2958,7 +2791,7 @@ function $6e22b5314fb52f4c$var$history_state_change(signals, entries, state) {
|
|
|
2958
2791
|
}
|
|
2959
2792
|
|
|
2960
2793
|
|
|
2961
|
-
function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_default_values_
|
|
2794
|
+
function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_default_values_, router_: router_, prefix_: prefix_ }) {
|
|
2962
2795
|
const get_prefixed_default_values_ = ()=>{
|
|
2963
2796
|
const default_values = get_default_values_();
|
|
2964
2797
|
return Object.fromEntries(Object.entries(default_values).map(([key, value])=>[
|
|
@@ -2987,6 +2820,38 @@ function $26a56f6b44703084$export$9862539c89138352({ get_default_values_: get_de
|
|
|
2987
2820
|
|
|
2988
2821
|
|
|
2989
2822
|
|
|
2823
|
+
/**
|
|
2824
|
+
* We use group_title for more beautiful urls if possible, this function modifies the search filters in an API response to have group_title as field, when possible.
|
|
2825
|
+
* Backend supports accepting group_title as field, so we just pretend it was field in the whole app to avoid major refactoring.
|
|
2826
|
+
* But also because it would be a lot more code since it's not guaranteed for group_title to exist. So at all places where we take `field` to send it to the API we'd have to check if group_title exists and use that instead and at all places where we try to pair filters sent from the API and filters set we'd have to both check if `op` and `field` match or if `op` and `group_title` match.
|
|
2827
|
+
*
|
|
2828
|
+
* This way it's just much simpler - group_title _is_ field for all intents and purposes if it exists, and we don't have to change anything/add lots of if-statements. The only reason we need the old field (actual_field) is for the compatibility with the old filters (see fix_old_filter_links).
|
|
2829
|
+
*/ function $67dc366d96177e70$export$967e966fca9515e(api_response) {
|
|
2830
|
+
if ("filters" in api_response) {
|
|
2831
|
+
const filters = api_response.filters;
|
|
2832
|
+
if (!filters) return api_response;
|
|
2833
|
+
const new_filters = [];
|
|
2834
|
+
for(let i = 0; i < filters.length; i++){
|
|
2835
|
+
const filter = filters[i];
|
|
2836
|
+
const group_title = filter.meta?.group_title?.toLowerCase();
|
|
2837
|
+
const new_filter = {
|
|
2838
|
+
...filter
|
|
2839
|
+
};
|
|
2840
|
+
if (group_title) {
|
|
2841
|
+
new_filter.field = group_title;
|
|
2842
|
+
new_filter.actual_field = filter.field;
|
|
2843
|
+
}
|
|
2844
|
+
new_filters.push(new_filter);
|
|
2845
|
+
}
|
|
2846
|
+
return {
|
|
2847
|
+
...api_response,
|
|
2848
|
+
filters: new_filters
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
return api_response;
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
|
|
2990
2855
|
const $e1d6c0f3d89d531c$var$v2_base_url = (0, $57o7A$depictaiutilishared.base_url) + "/v2/";
|
|
2991
2856
|
const $e1d6c0f3d89d531c$var$search_base_url = $e1d6c0f3d89d531c$var$v2_base_url + "search/";
|
|
2992
2857
|
class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
@@ -3042,7 +2907,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3042
2907
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
3043
2908
|
return response;
|
|
3044
2909
|
}
|
|
3045
|
-
async #run_url_creator_for_rest(
|
|
2910
|
+
async #run_url_creator_for_rest(merchant, market, input_data) {
|
|
3046
2911
|
if (!this.page_url_creator) return input_data;
|
|
3047
2912
|
const displays = input_data.displays;
|
|
3048
2913
|
const breadcrumb = input_data.breadcrumb;
|
|
@@ -3050,8 +2915,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3050
2915
|
if (displays) {
|
|
3051
2916
|
const page_urls = await this.page_url_creator({
|
|
3052
2917
|
type: "products",
|
|
3053
|
-
merchant:
|
|
3054
|
-
market:
|
|
2918
|
+
merchant: merchant,
|
|
2919
|
+
market: market,
|
|
3055
2920
|
displays: [
|
|
3056
2921
|
...input_data.displays
|
|
3057
2922
|
]
|
|
@@ -3078,8 +2943,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3078
2943
|
if (!category_display_array) continue;
|
|
3079
2944
|
const page_urls = await this.page_url_creator({
|
|
3080
2945
|
type: "categories",
|
|
3081
|
-
merchant:
|
|
3082
|
-
market:
|
|
2946
|
+
merchant: merchant,
|
|
2947
|
+
market: market,
|
|
3083
2948
|
data: [
|
|
3084
2949
|
...category_display_array
|
|
3085
2950
|
]
|
|
@@ -3090,8 +2955,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3090
2955
|
}
|
|
3091
2956
|
return input_data;
|
|
3092
2957
|
}
|
|
3093
|
-
async #cached_post_request(
|
|
3094
|
-
const cache_obj = this.#get_cache_obj_for_endpoint(
|
|
2958
|
+
async #cached_post_request(endpoint, input_req, fallback_response) {
|
|
2959
|
+
const cache_obj = this.#get_cache_obj_for_endpoint(endpoint);
|
|
3095
2960
|
const with_ids = this.#add_ids_to_request(input_req);
|
|
3096
2961
|
const metaData = await this.#get_metadata?.();
|
|
3097
2962
|
const request = metaData ? Object.assign(with_ids, {
|
|
@@ -3105,7 +2970,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3105
2970
|
let resolve_in_progress;
|
|
3106
2971
|
cache_obj.in_progress_[body] = new Promise((r)=>resolve_in_progress = r);
|
|
3107
2972
|
try {
|
|
3108
|
-
const api_response = await (0, $57o7A$depictaiutilishared.fetch_retry)((0, $57o7A$depictaiutilishared.add_version_query_params)(
|
|
2973
|
+
const api_response = await (0, $57o7A$depictaiutilishared.fetch_retry)((0, $57o7A$depictaiutilishared.add_version_query_params)(endpoint), {
|
|
3109
2974
|
method: "POST",
|
|
3110
2975
|
body: body
|
|
3111
2976
|
});
|
|
@@ -3119,6 +2984,8 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3119
2984
|
(0, $57o7A$depictaiutilishared.dwarn)("URL creator or json decoding failed", e);
|
|
3120
2985
|
break return_successfully;
|
|
3121
2986
|
}
|
|
2987
|
+
// Here result actually becomes O
|
|
2988
|
+
result = (0, $67dc366d96177e70$export$967e966fca9515e)(result);
|
|
3122
2989
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
3123
2990
|
resolve_in_progress(result);
|
|
3124
2991
|
setTimeout((0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
@@ -3138,7 +3005,7 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3138
3005
|
}
|
|
3139
3006
|
}
|
|
3140
3007
|
constructor(options){
|
|
3141
|
-
const { get_metadata: get_metadata
|
|
3008
|
+
const { get_metadata: get_metadata, get_user_id: get_user_id, get_session_id: get_session_id, page_url_creator: page_url_creator } = options ?? {};
|
|
3142
3009
|
this.#get_metadata = get_metadata;
|
|
3143
3010
|
this.#get_user_id = get_user_id;
|
|
3144
3011
|
this.#get_session_id = get_session_id;
|
|
@@ -3203,21 +3070,14 @@ class $e1d6c0f3d89d531c$export$e015ed2f2950f2e3 {
|
|
|
3203
3070
|
|
|
3204
3071
|
|
|
3205
3072
|
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
3073
|
const $6b384adf40a5f4d7$var$get_available_range = (available_filters_, search_for_field)=>{
|
|
3214
|
-
const maybe_meta = (0, $57o7A$solidjs.untrack)(available_filters_)?.find(({ op: op
|
|
3074
|
+
const maybe_meta = (0, $57o7A$solidjs.untrack)(available_filters_)?.find(({ op: op, field: field })=>field === search_for_field && op === "inrange")?.meta;
|
|
3215
3075
|
if (maybe_meta?.min != undefined && maybe_meta?.max != undefined) return [
|
|
3216
3076
|
maybe_meta.min,
|
|
3217
3077
|
maybe_meta.max
|
|
3218
3078
|
];
|
|
3219
3079
|
};
|
|
3220
|
-
function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: available_filters_
|
|
3080
|
+
function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: available_filters_, selected_filters_: selected_filters_ }) {
|
|
3221
3081
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
3222
3082
|
// we don't want to update (as selected_filters change) as navigating will change the selected range before the available range changes and we might ruin a perfectly valid filter range
|
|
3223
3083
|
available_filters_();
|
|
@@ -3227,7 +3087,7 @@ function $6b384adf40a5f4d7$export$e702733a056c40d6({ available_filters_: availab
|
|
|
3227
3087
|
});
|
|
3228
3088
|
});
|
|
3229
3089
|
}
|
|
3230
|
-
function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_]
|
|
3090
|
+
function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filters_: [read_selected_filters_, write_selected_filters_], available_filters_: available_filters_ }) {
|
|
3231
3091
|
const selected_filters = (0, $57o7A$solidjs.untrack)(read_selected_filters_);
|
|
3232
3092
|
if (!selected_filters) return;
|
|
3233
3093
|
for(let i = 0; i < selected_filters.length; i++){
|
|
@@ -3270,7 +3130,7 @@ function $6b384adf40a5f4d7$var$correct_range_filter_range_once({ selected_filter
|
|
|
3270
3130
|
|
|
3271
3131
|
|
|
3272
3132
|
|
|
3273
|
-
function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_results_
|
|
3133
|
+
function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_results_, i18n_: i18n_ }) {
|
|
3274
3134
|
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
3275
3135
|
const n_hits = search_results_()?.n_hits;
|
|
3276
3136
|
if (isNaN(n_hits)) return "";
|
|
@@ -3287,17 +3147,12 @@ function $0f400c3f7248d5f1$export$92f2da32c6e7e7ee({ search_results_: search_res
|
|
|
3287
3147
|
|
|
3288
3148
|
|
|
3289
3149
|
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
3150
|
function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
3296
3151
|
const catchified_handler = (0, $57o7A$depictaiutilishared.catchify)(handler);
|
|
3297
3152
|
const owner = (0, $57o7A$solidjs.getOwner)();
|
|
3298
3153
|
// Some customers (e.g. equestrian) have `height: 100%` and/or `overflow-x: hidden` on the body, which means that scroll events won't get dispatched on `window`. The pages who get it on <body> won't get it on `window` and vice-versa, so there shouldn't be a worry about duplicate calling of the handler.
|
|
3299
3154
|
// Use observer in case that this gets called before body exists
|
|
3300
|
-
const disconnect = (0, $57o7A$depictaiutilishared.observer).onexists("body", ({ element: element
|
|
3155
|
+
const disconnect = (0, $57o7A$depictaiutilishared.observer).onexists("body", ({ element: element })=>{
|
|
3301
3156
|
element.addEventListener("scroll", catchified_handler, {
|
|
3302
3157
|
passive: passive
|
|
3303
3158
|
});
|
|
@@ -3317,9 +3172,8 @@ function $76b6ac05693f5c71$export$205efb947c7ffd78(handler, passive = true) {
|
|
|
3317
3172
|
}
|
|
3318
3173
|
|
|
3319
3174
|
|
|
3320
|
-
|
|
3321
3175
|
const $401aee5f33dca9e2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="scroll-status" style="display:none"><span class="text"><b></b> – <b></b> <!#><!/> <b></b></span></div>`, 12);
|
|
3322
|
-
function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_
|
|
3176
|
+
function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results_: formatted_number_of_results_, first_result_in_viewport_: [get_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport], number_of_results_: number_of_results_, i18n_: { price_formatting_: price_formatting_, of_: of_ } }) {
|
|
3323
3177
|
if (0, $57o7A$solidjsweb.isServer) return; // won't show in initial render and need scroll position
|
|
3324
3178
|
const [first_to_show, set_first_to_show] = (0, $57o7A$solidjs.createSignal)(0);
|
|
3325
3179
|
const [last_to_show, set_last_to_show] = (0, $57o7A$solidjs.createSignal)(0);
|
|
@@ -3444,22 +3298,9 @@ function $401aee5f33dca9e2$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
3444
3298
|
|
|
3445
3299
|
|
|
3446
3300
|
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
3301
|
|
|
3461
3302
|
const $0d0b172488865048$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="hint" href="javascript:void(0)"></a>`, 2), $0d0b172488865048$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="no-results"><div class="text"></div><!#><!/></div>`, 6);
|
|
3462
|
-
function $0d0b172488865048$export$ef6006467f04ee41({ i18n_: i18n_
|
|
3303
|
+
function $0d0b172488865048$export$ef6006467f04ee41({ i18n_: i18n_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_ }) {
|
|
3463
3304
|
const root = (0, $57o7A$solidjs.getOwner)();
|
|
3464
3305
|
return [
|
|
3465
3306
|
(()=>{
|
|
@@ -3506,7 +3347,7 @@ function $fc23d7668ae0011d$export$a2cc176055f8f08() {
|
|
|
3506
3347
|
|
|
3507
3348
|
let $0caf87eaa19079da$var$cached_placeholder_element;
|
|
3508
3349
|
let $0caf87eaa19079da$var$rendering_cached_placeholder_element;
|
|
3509
|
-
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_
|
|
3350
|
+
function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: product_card_template_, num_placeholders_: num_placeholders_ }) {
|
|
3510
3351
|
const [get_elements, set_elements] = (0, $57o7A$solidjs.createSignal)([]);
|
|
3511
3352
|
let existing_num = 0;
|
|
3512
3353
|
if (0, $57o7A$solidjsweb.isServer) // want to render simple placeholders on server, effects don't run there
|
|
@@ -3537,7 +3378,7 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
3537
3378
|
}
|
|
3538
3379
|
/**
|
|
3539
3380
|
* Get one placeholder element. It will be cloned for each placeholder for ultimate performance even when solid-js isn't rendering the placeholders.
|
|
3540
|
-
*/ function $0caf87eaa19079da$var$Placeholder({ product_card_template_: product_card_template_
|
|
3381
|
+
*/ function $0caf87eaa19079da$var$Placeholder({ product_card_template_: product_card_template_ }) {
|
|
3541
3382
|
const get_cloned_placeholders = (element_to_clone = $0caf87eaa19079da$var$cached_placeholder_element)=>Array.isArray(element_to_clone) ? element_to_clone.map((el)=>el instanceof Node ? el.cloneNode(true) : el) : element_to_clone;
|
|
3542
3383
|
if ($0caf87eaa19079da$var$cached_placeholder_element) return get_cloned_placeholders();
|
|
3543
3384
|
let dispose_original_copy;
|
|
@@ -3590,7 +3431,7 @@ function $0caf87eaa19079da$export$f33414a4df0afd3f({ product_card_template_: pro
|
|
|
3590
3431
|
|
|
3591
3432
|
|
|
3592
3433
|
|
|
3593
|
-
function $3f08fe2992a2a8ca$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_
|
|
3434
|
+
function $3f08fe2992a2a8ca$export$5e4aed86c12acdd9({ percentage_in_view_: percentage_in_view_, set_extra_displays_: set_extra_displays_, all_products_loaded_: all_products_loaded_, plp_results_: plp_results_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_ }) {
|
|
3594
3435
|
let last_loaded = +new Date();
|
|
3595
3436
|
let is_loading_more = false;
|
|
3596
3437
|
let is_first_load = true;
|
|
@@ -3640,7 +3481,7 @@ function $3f08fe2992a2a8ca$export$5e4aed86c12acdd9({ percentage_in_view_: percen
|
|
|
3640
3481
|
|
|
3641
3482
|
|
|
3642
3483
|
|
|
3643
|
-
function $4117463e2939f5f4$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_
|
|
3484
|
+
function $4117463e2939f5f4$export$63dd0350f8559dda({ displays_by_key_: displays_by_key_, get_last_result_in_viewport_: get_last_result_in_viewport_, index_to_target_map_: index_to_target_map_, is_loading_: is_loading_, get_extra_displays: get_extra_displays }) {
|
|
3644
3485
|
const [get_has_rendered_toggle, set_has_rendered_toggle] = (0, $57o7A$solidjs.createSignal)(false);
|
|
3645
3486
|
(0, $57o7A$solidjs.createEffect)(()=>{
|
|
3646
3487
|
// We need this to run after the "render phase"
|
|
@@ -3701,7 +3542,7 @@ function $a73063cc642f3e5f$export$7f8bd308237ab5a5(get_displays_) {
|
|
|
3701
3542
|
});
|
|
3702
3543
|
return displays_by_key_;
|
|
3703
3544
|
}
|
|
3704
|
-
function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_
|
|
3545
|
+
function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_by_key_, merchant_: merchant_, market_: market_, product_card_template_: product_card_template_, do_per_elements_: do_per_elements_ }) {
|
|
3705
3546
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.For), {
|
|
3706
3547
|
get each () {
|
|
3707
3548
|
return [
|
|
@@ -3733,8 +3574,8 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3733
3574
|
elements.push(element);
|
|
3734
3575
|
// Add tracking ids
|
|
3735
3576
|
if (!(element instanceof HTMLElement)) continue; // Apparently only HTMLElements have dataset
|
|
3736
|
-
const { dataset: dataset
|
|
3737
|
-
const { search_result_id: search_result_id
|
|
3577
|
+
const { dataset: dataset } = element;
|
|
3578
|
+
const { search_result_id: search_result_id, product_listing_result_id: product_listing_result_id, recommendation_id: recommendation_id } = display;
|
|
3738
3579
|
if (search_result_id) dataset.searchResultId = search_result_id;
|
|
3739
3580
|
else if (product_listing_result_id) dataset.productListingResultId = product_listing_result_id;
|
|
3740
3581
|
else if (recommendation_id) dataset.recommendationId = recommendation_id;
|
|
@@ -3747,7 +3588,7 @@ function $a73063cc642f3e5f$export$43f0fb951fcb0c54({ displays_by_key_: displays_
|
|
|
3747
3588
|
}
|
|
3748
3589
|
|
|
3749
3590
|
|
|
3750
|
-
function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
3591
|
+
function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_, product_card_template_: product_card_template_, first_result_in_viewport_: [, set_first_result_in_viewport], last_result_in_viewport_: [get_last_result_in_viewport_, set_last_result_in_viewport], merchant_: merchant_, market_: market_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, depict_api_: depict_api_, is_loading_: is_loading_ }) {
|
|
3751
3592
|
// The following sets up an intersection observer to determine which results are in the viewport, used for the ScrollStatus indicator and knowing when to load more
|
|
3752
3593
|
const target_to_index_map = new Map();
|
|
3753
3594
|
const index_to_target_map_ = new Map();
|
|
@@ -3755,7 +3596,7 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3755
3596
|
const intersection_observer = new IntersectionObserver((0, $57o7A$depictaiutilishared.catchify)((records)=>{
|
|
3756
3597
|
for(let i = 0; i < records.length; i++){
|
|
3757
3598
|
const record = records[i];
|
|
3758
|
-
const { target: target
|
|
3599
|
+
const { target: target, intersectionRatio: intersectionRatio } = record;
|
|
3759
3600
|
const index_of_target = target_to_index_map.get(target);
|
|
3760
3601
|
if (index_of_target == undefined) return; // It seems like it can happen that we get IntersectionObserverEntries after the onCleanup function for a recommendation card has run, in Firefox. Probably a bug in Firefox? If I understood the bug correctly, this is a workaround.
|
|
3761
3602
|
const is_in_set = currently_intersecting.has(index_of_target);
|
|
@@ -3819,7 +3660,7 @@ function $ac167f6af6a48fc3$export$a1fd619a4743ca08({ plp_results_: plp_results_
|
|
|
3819
3660
|
|
|
3820
3661
|
|
|
3821
3662
|
const $fe76fb463cc60b89$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="PLP-results"><!#><!/><!#><!/></div>`, 6);
|
|
3822
|
-
function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
3663
|
+
function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_, depict_api_: depict_api_, all_products_loaded_: all_products_loaded_, min_products_to_fetch_: min_products_to_fetch_, query_base_: query_base_, first_result_in_viewport_: first_result_in_viewport_, last_result_in_viewport_: last_result_in_viewport_, scroll_restoration_data_: [get_scroll_restoration_data], no_results_options_: no_results_options_, desktop_filter_elements_: desktop_filter_elements_, sort_or_filter_open_: sort_or_filter_open_, product_card_template_: product_card_template_, layout_options_: layout_options_, id_currently_querying_for_: id_currently_querying_for_ }) {
|
|
3823
3664
|
// The plp_results_ resource will be delayed because we're using createBatchedMemo to not make triplicate API requests, but we need to show the placeholders before already to match Chrome and Firefox's "content has to be there, ready for scroll restoration, before all popstate tasks have been completed"-requirement
|
|
3824
3665
|
const is_loading_ = (0, $57o7A$solidjs.createMemo)(()=>plp_results_.loading || query_base_.loading);
|
|
3825
3666
|
const merchant_ = (0, $57o7A$solidjs.createMemo)(()=>query_base_().tenant);
|
|
@@ -3866,7 +3707,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3866
3707
|
product_card_template_: product_card_template_,
|
|
3867
3708
|
num_placeholders_: (0, $57o7A$solidjs.createMemo)(()=>{
|
|
3868
3709
|
// Can't use the data out of request_base for the id because request_base is too late, we need the correct amount of placeholders before the browser has restored the scroll state after processing all popstate events
|
|
3869
|
-
return (0, $aec24316ed262dc0$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id
|
|
3710
|
+
return (0, $aec24316ed262dc0$export$6c9030e511152266) + (get_scroll_restoration_data().find(({ for_id: for_id })=>for_id === id_currently_querying_for_())?.min_results_loaded ?? min_products_to_fetch_);
|
|
3870
3711
|
})
|
|
3871
3712
|
}) : undefined);
|
|
3872
3713
|
const [get_suspense_is_blocked, set_suspense_is_blocked] = (0, $57o7A$solidjs.createSignal)(false);
|
|
@@ -3973,7 +3814,7 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
3973
3814
|
/**
|
|
3974
3815
|
* Changes cols_at_size depending on if filters are open or not so one card less is shown when the filters are open
|
|
3975
3816
|
* This function is special to the actual PLPResults.
|
|
3976
|
-
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_
|
|
3817
|
+
*/ function $fe76fb463cc60b89$var$make_modified_cols_at_size({ layout_options_: layout_options_, sort_or_filter_open_: sort_or_filter_open_ }) {
|
|
3977
3818
|
return (0, $57o7A$solidjs.createMemo)(()=>{
|
|
3978
3819
|
const layout_options = layout_options_();
|
|
3979
3820
|
// Add grid styling that changes when filters get opened/closed
|
|
@@ -4007,29 +3848,9 @@ function $fe76fb463cc60b89$export$3925f87b1545cfc6({ plp_results_: plp_results_
|
|
|
4007
3848
|
|
|
4008
3849
|
|
|
4009
3850
|
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
3851
|
|
|
4031
3852
|
const $be89be42ce9ea60f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="sorting-attributes"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="sorting-direction"></div>`, 2), $be89be42ce9ea60f$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div><div class="input-row"><input type="radio"><span class="custom-indicator"></span><!#><!/></div></div>`, 9), $be89be42ce9ea60f$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div><label class="input-row"><input type="radio"><span class="custom-indicator"></span><!#><!/></label></div>`, 9);
|
|
4032
|
-
function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_
|
|
3853
|
+
function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: available_sortings_, current_sorting_: [get_current_sorting, set_current_sorting], meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
4033
3854
|
const title_radio_name = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
4034
3855
|
const order_radio_name = (0, $57o7A$depictaiutilishared.make_random_classname)();
|
|
4035
3856
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
@@ -4119,19 +3940,6 @@ function $be89be42ce9ea60f$export$1f1775a58da589b5({ available_sortings_: availa
|
|
|
4119
3940
|
|
|
4120
3941
|
|
|
4121
3942
|
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
3943
|
|
|
4136
3944
|
|
|
4137
3945
|
|
|
@@ -4179,9 +3987,6 @@ function $ca1176b694a6ee2e$export$fe334901e8bebd57() {
|
|
|
4179
3987
|
|
|
4180
3988
|
|
|
4181
3989
|
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
3990
|
const $f958b5ac0e4a78da$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" class="sort-icon"><path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zM9.449 3.5H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h1.398c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-1.051-.699h.703v-.699h-.703zm0 0"></path><path d="M10.852 6.301H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h2.801a.35.35 0 0 1 .348.352v1.398a.35.35 0 0 1-.348.352zm-2.453-.699H10.5v-.703H8.398zm3.851 3.5H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h4.199c.191 0 .352.156.352.352V8.75c0 .191-.16.352-.352.352zm-3.852-.703h3.5V7.7h-3.5zm5.25 3.499H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h5.598a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-5.25-.699H13.3V10.5H8.398zm0 0"></path></svg>`, 6);
|
|
4186
3991
|
function $f958b5ac0e4a78da$export$da32f7add8a22e86(props = {}) {
|
|
4187
3992
|
return (()=>{
|
|
@@ -4194,9 +3999,6 @@ function $f958b5ac0e4a78da$export$da32f7add8a22e86(props = {}) {
|
|
|
4194
3999
|
|
|
4195
4000
|
|
|
4196
4001
|
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
4002
|
const $046db47e0326c715$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" class="sort-icon"><path d="M6.199 10.254a.35.35 0 0 0-.496 0L3.5 12.453V.348a.35.35 0 0 0-.7 0v12.105L.598 10.254c-.137-.137-.359-.137-.492 0a.35.35 0 0 0 0 .492l2.797 2.801a.35.35 0 0 0 .496 0L6.2 10.746c.137-.137.137-.355 0-.492zm3.25 1.644H8.051a.35.35 0 0 1-.352-.348v-1.402a.35.35 0 0 1 .352-.348h1.398a.35.35 0 0 1 .352.348v1.402a.35.35 0 0 1-.352.348zm-1.051-.699h.703V10.5h-.703zm2.454-2.097H8.051c-.195 0-.352-.16-.352-.352V7.352A.35.35 0 0 1 8.051 7h2.801a.35.35 0 0 1 .348.352V8.75c0 .191-.156.352-.348.352zm-2.453-.703H10.5V7.7H8.398zm3.851-2.098H8.051a.35.35 0 0 1-.352-.352V4.551a.35.35 0 0 1 .352-.352h4.199c.191 0 .352.156.352.352v1.398c0 .195-.16.352-.352.352zm-3.852-.699h3.5v-.703h-3.5zm5.25-2.102H8.051a.35.35 0 0 1-.352-.352V1.75c0-.191.156-.352.352-.352h5.598c.195 0 .352.16.352.352v1.398a.35.35 0 0 1-.352.352zm-5.25-.699H13.3v-.699H8.398zm0 0"></path></svg>`, 4);
|
|
4201
4003
|
function $046db47e0326c715$export$d10e63059ddb9fd4(props = {}) {
|
|
4202
4004
|
return (()=>{
|
|
@@ -4209,7 +4011,6 @@ function $046db47e0326c715$export$d10e63059ddb9fd4(props = {}) {
|
|
|
4209
4011
|
|
|
4210
4012
|
|
|
4211
4013
|
|
|
4212
|
-
|
|
4213
4014
|
const $02215fefc955d01e$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="15" class="filter-icon"><path d="M1.75 14.697c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V8.75c0-.096.034-.178.103-.246s.15-.103.246-.103.178.034.246.103.103.15.103.246v5.599c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-9.796c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-3.5c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103.103.153.103.253v3.5c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.796H1.053c-.292 0-.54-.103-.745-.308S0 6.938 0 6.651s.103-.54.308-.745.453-.308.745-.308h1.395c.292 0 .54.103.745.308s.308.453.308.745-.103.533-.308.738-.453.308-.745.308zM1.053 6.303c-.1 0-.185.034-.253.103s-.103.15-.103.246.034.178.103.246S.952 7 1.053 7h1.395c.1 0 .185-.034.253-.103s.103-.15.103-.246-.034-.178-.103-.246-.153-.103-.253-.103H1.053zm5.599 8.395c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246v-2.796c0-.1.034-.184.103-.253s.15-.102.246-.102.178.034.246.102.103.153.103.253v2.796c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-7c-.096 0-.178-.034-.246-.103s-.103-.15-.103-.246V1.053c0-.1.034-.185.103-.253s.15-.103.246-.103.178.034.246.103S7 .952 7 1.053v6.296c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803H5.947c-.287 0-.533-.102-.738-.308s-.308-.453-.308-.745.103-.533.308-.738.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.451.308.738-.103.54-.308.745-.453.308-.745.308zM5.947 9.099c-.096 0-.178.034-.246.103s-.103.15-.103.246.034.185.103.253.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.103-.153.103-.253-.034-.178-.103-.246-.15-.103-.246-.103H5.947zm5.605 5.599c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246v-7c0-.096.034-.178.102-.246S11.453 7 11.553 7s.178.034.246.103.103.15.103.246v7c0 .096-.034.178-.103.246s-.15.103-.246.103zm0-11.197c-.1 0-.184-.034-.253-.103s-.102-.15-.102-.246V1.053c0-.1.034-.185.102-.253s.153-.103.253-.103.178.034.246.103.103.153.103.253v2.099c0 .096-.034.178-.103.246s-.15.103-.246.103zm.697 2.803h-1.401c-.287 0-.533-.103-.738-.308s-.308-.453-.308-.745.103-.54.308-.745.451-.308.738-.308h1.401c.292 0 .54.103.745.308s.308.453.308.745-.102.54-.308.745-.453.308-.745.308zm-1.401-1.401c-.096 0-.178.034-.246.103s-.102.15-.102.246.034.178.102.246.15.103.246.103h1.401c.096 0 .178-.034.246-.103s.102-.15.102-.246-.034-.178-.102-.246-.15-.103-.246-.103h-1.401z"></path></svg>`, 4);
|
|
4214
4015
|
function $02215fefc955d01e$export$28f6150e232898de() {
|
|
4215
4016
|
return (0, $57o7A$solidjsweb.getNextElement)($02215fefc955d01e$var$_tmpl$);
|
|
@@ -4218,7 +4019,7 @@ function $02215fefc955d01e$export$28f6150e232898de() {
|
|
|
4218
4019
|
|
|
4219
4020
|
const $1872ceb56ede7a52$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="clear minor"></button>`, 2), $1872ceb56ede7a52$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp" id="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>`, 20), $1872ceb56ede7a52$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<details class="sorting"></details>`, 2), $1872ceb56ede7a52$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<summary class="sort-filter-summary"><div class="summary"><div class="left-els"><!#><!/><span></span></div><!#><!/></div></summary>`, 12), $1872ceb56ede7a52$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="body"></div>`, 2), $1872ceb56ede7a52$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<details class="filters"></details>`, 2), $1872ceb56ede7a52$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<b></b>`, 2);
|
|
4220
4021
|
const $1872ceb56ede7a52$var$no_go_selector = ".range .range-group";
|
|
4221
|
-
function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for_sorting_
|
|
4022
|
+
function $1872ceb56ede7a52$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_ }) {
|
|
4222
4023
|
(0, $ca1176b694a6ee2e$export$fe334901e8bebd57)();
|
|
4223
4024
|
let modal;
|
|
4224
4025
|
let modal_body;
|
|
@@ -4284,7 +4085,7 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4284
4085
|
}, _el$3);
|
|
4285
4086
|
(0, $57o7A$solidjsweb.addEventListener)(_el$3, "click", dismiss_modal_, true);
|
|
4286
4087
|
(0, $57o7A$solidjsweb.insert)(_el$3, (0, $57o7A$solidjsweb.createComponent)((0, $c77c68e559a1506c$export$3b621d86b1566b2), {}));
|
|
4287
|
-
_el$4.$$touchstart = ({ changedTouches: changedTouches
|
|
4088
|
+
_el$4.$$touchstart = ({ changedTouches: changedTouches, target: target })=>{
|
|
4288
4089
|
// touchstart should always only have one changed touch, track it here
|
|
4289
4090
|
if (touches >= 1) {
|
|
4290
4091
|
(0, $57o7A$depictaiutilishared.dlog)("Got new touch", changedTouches, "ignoring"); // only support 1 touch for now
|
|
@@ -4297,7 +4098,7 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4297
4098
|
set_modal_style("transition", "unset");
|
|
4298
4099
|
set_background_style("transition", "unset");
|
|
4299
4100
|
set_button_style("transition", "unset");
|
|
4300
|
-
const [{ identifier: our_fingers_identifier
|
|
4101
|
+
const [{ identifier: our_fingers_identifier, pageY: start_page_y }] = changedTouches;
|
|
4301
4102
|
let gesture_starting_page_y = start_page_y;
|
|
4302
4103
|
const start_time = +new Date();
|
|
4303
4104
|
let total_distance_travelled = 0;
|
|
@@ -4310,7 +4111,7 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4310
4111
|
return;
|
|
4311
4112
|
modal_scrolling_prevented[1](false);
|
|
4312
4113
|
const velocity = total_distance_travelled / (+new Date() - start_time); // px/ms
|
|
4313
|
-
const { offsetHeight: offsetHeight
|
|
4114
|
+
const { offsetHeight: offsetHeight } = modal;
|
|
4314
4115
|
if (e?.type === "touchend" && distance_from_start_of_gesture > offsetHeight / 3 || velocity > 1.5 && distance_from_start_of_gesture > offsetHeight / 10 // I think this is a good magic number
|
|
4315
4116
|
) dismiss_modal_();
|
|
4316
4117
|
else if (e) {
|
|
@@ -4327,10 +4128,10 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4327
4128
|
modal.removeEventListener("touchmove", move_handler);
|
|
4328
4129
|
});
|
|
4329
4130
|
const move_handler = (0, $57o7A$depictaiutilishared.catchify)((e)=>{
|
|
4330
|
-
const { changedTouches: changedTouches
|
|
4131
|
+
const { changedTouches: changedTouches } = e;
|
|
4331
4132
|
let called_prevent_default = false;
|
|
4332
4133
|
for(let i = 0; i < changedTouches.length; i++){
|
|
4333
|
-
const { pageY: this_move_page_y
|
|
4134
|
+
const { pageY: this_move_page_y, clientY: clientY, identifier: identifier_of_a_touch } = changedTouches[i];
|
|
4334
4135
|
// unrelated to this functionality, we want to block that the site behind is being scrolled when swiping on this if the modal isn't scrollable
|
|
4335
4136
|
const scroll_top_max = modal_body.scrollTopMax || modal_body.scrollHeight - modal_body.clientHeight;
|
|
4336
4137
|
if (scroll_top_max === 0) {
|
|
@@ -4491,7 +4292,6 @@ function $1872ceb56ede7a52$export$9bf11afa910f536e({ args_for_sorting_: args_for
|
|
|
4491
4292
|
|
|
4492
4293
|
|
|
4493
4294
|
|
|
4494
|
-
|
|
4495
4295
|
const $f49857214f7675b1$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M12.949 7.699H.352A.35.35 0 0 1 0 7.352.35.35 0 0 1 .352 7h12.598a.35.35 0 0 1 .352.352.35.35 0 0 1-.352.348zm0 0"></path></svg>`, 4);
|
|
4496
4296
|
function $f49857214f7675b1$export$cb808a3c41736d8e() {
|
|
4497
4297
|
return (0, $57o7A$solidjsweb.getNextElement)($f49857214f7675b1$var$_tmpl$);
|
|
@@ -4501,9 +4301,8 @@ function $f49857214f7675b1$export$cb808a3c41736d8e() {
|
|
|
4501
4301
|
|
|
4502
4302
|
|
|
4503
4303
|
|
|
4504
|
-
|
|
4505
4304
|
const $f8f64d05c525825b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="filters"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="sorting"><div class="body"></div></div>`, 4), $f8f64d05c525825b$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"><!#><!/><!#><!/><!#><!/></div></div></div>`, 12), $f8f64d05c525825b$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="num-filters"></span>`, 2), $f8f64d05c525825b$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="open-filters-button-container"><!#><!/><button type="button"><!#><!/><span></span></button></div>`, 10), $f8f64d05c525825b$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span><!#><!/></button>`, 6);
|
|
4506
|
-
function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_sorting_
|
|
4305
|
+
function $f8f64d05c525825b$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_ }) {
|
|
4507
4306
|
const Self = ()=>{
|
|
4508
4307
|
// This could technically be in SearchPage and CategoryPage and would be better suited there since it writes into local_filter_cache_ which i.e. SelectedFilters uses, but it's better suited here IMO due to DRY and being inside the correct error boundary here
|
|
4509
4308
|
(0, $70482f04605572e2$export$b288c38ae3fddb56)({
|
|
@@ -4597,7 +4396,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4597
4396
|
}
|
|
4598
4397
|
});
|
|
4599
4398
|
(0, $57o7A$depictaiutilishared.catchify)(async ()=>{
|
|
4600
|
-
({ open_modal_: open_modal_
|
|
4399
|
+
({ open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $9abb0a35d4b60ed3$export$79b1565500412d9b)((0, $1872ceb56ede7a52$export$9bf11afa910f536e), {
|
|
4601
4400
|
args_for_sorting_: sorting_options,
|
|
4602
4401
|
args_for_filtering_: filter_options,
|
|
4603
4402
|
search_filters_open_: search_filters_open_,
|
|
@@ -4606,7 +4405,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4606
4405
|
dismiss_modal_: dismiss_modal_,
|
|
4607
4406
|
i18n_: i18n_
|
|
4608
4407
|
}));
|
|
4609
|
-
const { remove: remove
|
|
4408
|
+
const { remove: remove } = (0, $57o7A$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches));
|
|
4610
4409
|
cleanup_promise.then(remove);
|
|
4611
4410
|
})();
|
|
4612
4411
|
get_extra_filters_button_?.(make_open_filters_button());
|
|
@@ -4629,7 +4428,7 @@ function $f8f64d05c525825b$export$d7841e452f2e59a8({ current_sorting_: current_s
|
|
|
4629
4428
|
}
|
|
4630
4429
|
});
|
|
4631
4430
|
}
|
|
4632
|
-
function $f8f64d05c525825b$var$OpenFiltersButton({ i18n_: i18n_
|
|
4431
|
+
function $f8f64d05c525825b$var$OpenFiltersButton({ i18n_: i18n_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, filter_button_width_: filter_button_width_, tabindex_: tabindex_, number_of_rendered_selected_filters_items_: [num_selected_filters] }) {
|
|
4633
4432
|
const filters_closed = (0, $57o7A$solidjs.createMemo)(()=>!search_filters_open_[0]());
|
|
4634
4433
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
4635
4434
|
return (()=>{
|
|
@@ -4686,7 +4485,7 @@ function $f8f64d05c525825b$var$OpenFiltersButton({ i18n_: i18n_ , search_filters
|
|
|
4686
4485
|
return _el$14;
|
|
4687
4486
|
})();
|
|
4688
4487
|
}
|
|
4689
|
-
function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_
|
|
4488
|
+
function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_, get_current_sorting_: get_current_sorting_, search_filters_open_: search_filters_open_, available_sortings_: available_sortings_, search_sorting_open_: search_sorting_open_, sort_button_width_: sort_button_width_, tabindex_: tabindex_, meta_of_currently_selected_sorting_: meta_of_currently_selected_sorting_ }) {
|
|
4690
4489
|
const sorting_closed = (0, $57o7A$solidjs.createMemo)(()=>!search_sorting_open_[0]());
|
|
4691
4490
|
// We assume in embedded_num_products that this is a single HTMLElement so pls change there if you change it here
|
|
4692
4491
|
return (()=>{
|
|
@@ -4750,16 +4549,6 @@ function $f8f64d05c525825b$var$OpenSortingButton({ i18n_: i18n_ , get_current_so
|
|
|
4750
4549
|
|
|
4751
4550
|
|
|
4752
4551
|
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
4552
|
|
|
4764
4553
|
const $084b6a0ee1d481de$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14"><path d="M6.402.453L2.203 4.652a.35.35 0 0 0 0 .496c.137.137.359.137.492 0l3.605-3.605v11.406a.35.35 0 0 0 .348.352.35.35 0 0 0 .352-.352V1.543l3.602 3.605a.35.35 0 0 0 .496 0c.066-.07.102-.16.102-.25a.35.35 0 0 0-.102-.246L6.895.453c-.133-.137-.355-.137-.492 0zm0 0"></path></svg>`, 4);
|
|
4765
4554
|
function $084b6a0ee1d481de$export$2624c5890f1bbcf7() {
|
|
@@ -4767,12 +4556,11 @@ function $084b6a0ee1d481de$export$2624c5890f1bbcf7() {
|
|
|
4767
4556
|
}
|
|
4768
4557
|
|
|
4769
4558
|
|
|
4770
|
-
|
|
4771
4559
|
const $2fb324fbcc7b4a7b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.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);
|
|
4772
4560
|
function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
4773
4561
|
if (0, $57o7A$solidjsweb.isServer) return; // won't show in initial render and need scroll position
|
|
4774
4562
|
const [is_small, set_is_small] = (0, $57o7A$solidjs.createSignal)(true);
|
|
4775
|
-
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches
|
|
4563
|
+
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-width:651px)", ({ matches: matches })=>set_is_small(matches)).remove);
|
|
4776
4564
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
4777
4565
|
get when () {
|
|
4778
4566
|
return is_small();
|
|
@@ -4782,7 +4570,7 @@ function $2fb324fbcc7b4a7b$export$b23abd26de154ede(props) {
|
|
|
4782
4570
|
}
|
|
4783
4571
|
});
|
|
4784
4572
|
}
|
|
4785
|
-
function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_]
|
|
4573
|
+
function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [get_search_filters_open_, set_search_filters_open_], search_sorting_open_: [get_search_sorting_open_, set_search_sorting_open_], current_sorting_: current_sorting_, sort_and_filter_element_: sort_and_filter_element_, i18n_: i18n_ }) {
|
|
4786
4574
|
let old_pos = scrollY;
|
|
4787
4575
|
let diff_over_second_or_touch = 0; // for things not supporting touch events
|
|
4788
4576
|
let timeout;
|
|
@@ -4900,14 +4688,9 @@ function $2fb324fbcc7b4a7b$var$ActualFloatingButtons({ search_filters_open_: [ge
|
|
|
4900
4688
|
|
|
4901
4689
|
|
|
4902
4690
|
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4691
|
+
const $1ab22f2cd39b3061$var$fallback_operator = "in";
|
|
4692
|
+
const $1ab22f2cd39b3061$var$fallback_token = "";
|
|
4693
|
+
const $1ab22f2cd39b3061$var$legacy_filter_prefix = "filter_";
|
|
4911
4694
|
const $1ab22f2cd39b3061$var$operator_map = {
|
|
4912
4695
|
"eq": "≡",
|
|
4913
4696
|
"neq": "≠",
|
|
@@ -4923,6 +4706,10 @@ const $1ab22f2cd39b3061$var$range_delimiter = "-";
|
|
|
4923
4706
|
const $1ab22f2cd39b3061$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4924
4707
|
const $1ab22f2cd39b3061$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
4925
4708
|
const $1ab22f2cd39b3061$var$empty_item_replacement = "0️⃣";
|
|
4709
|
+
const $1ab22f2cd39b3061$var$op_to_token = (op)=>{
|
|
4710
|
+
if (op === $1ab22f2cd39b3061$var$fallback_operator) return $1ab22f2cd39b3061$var$fallback_token;
|
|
4711
|
+
return $1ab22f2cd39b3061$var$operator_map[op];
|
|
4712
|
+
};
|
|
4926
4713
|
/**
|
|
4927
4714
|
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
4928
4715
|
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
@@ -4986,35 +4773,40 @@ function $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data) {
|
|
|
4986
4773
|
}
|
|
4987
4774
|
function $1ab22f2cd39b3061$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4988
4775
|
for (const filter of filters){
|
|
4989
|
-
const { field: field
|
|
4776
|
+
const { field: field, op: op, data: data } = filter;
|
|
4990
4777
|
const encoded_data = $1ab22f2cd39b3061$var$encode_filter_data(op, data);
|
|
4991
|
-
search_params.set(filter_query_param_prefix + field + $1ab22f2cd39b3061$var$
|
|
4778
|
+
search_params.set(filter_query_param_prefix + field + $1ab22f2cd39b3061$var$op_to_token(op), encoded_data);
|
|
4992
4779
|
}
|
|
4993
4780
|
}
|
|
4994
4781
|
function $1ab22f2cd39b3061$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4995
4782
|
const found_filters = [];
|
|
4996
4783
|
for (const key of search_params.keys()){
|
|
4997
|
-
|
|
4784
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
4785
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
4786
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
4787
|
+
chosen_prefix = $1ab22f2cd39b3061$var$legacy_filter_prefix;
|
|
4788
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
4789
|
+
}
|
|
4998
4790
|
const encoded_data = search_params.get(key);
|
|
4999
4791
|
if (!encoded_data) continue;
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
}
|
|
4792
|
+
const [op, token] = Object.entries($1ab22f2cd39b3061$var$operator_map).find(([, token])=>key.endsWith(token)) || [
|
|
4793
|
+
$1ab22f2cd39b3061$var$fallback_operator,
|
|
4794
|
+
$1ab22f2cd39b3061$var$fallback_token
|
|
4795
|
+
];
|
|
4796
|
+
const data = $1ab22f2cd39b3061$var$decode_filter_data(op, encoded_data);
|
|
4797
|
+
if (!data) continue;
|
|
4798
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
4799
|
+
found_filters.push({
|
|
4800
|
+
field: field,
|
|
4801
|
+
op: op,
|
|
4802
|
+
data: data
|
|
4803
|
+
});
|
|
5012
4804
|
}
|
|
5013
4805
|
return found_filters;
|
|
5014
4806
|
}
|
|
5015
4807
|
function $1ab22f2cd39b3061$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
5016
4808
|
if (!sorting) return;
|
|
5017
|
-
const { field: field
|
|
4809
|
+
const { field: field, order: order } = sorting;
|
|
5018
4810
|
const ascending = order === "asc";
|
|
5019
4811
|
search_params.set(sorting_query_param, field + (ascending ? $1ab22f2cd39b3061$var$ascending_token : $1ab22f2cd39b3061$var$descending_token));
|
|
5020
4812
|
}
|
|
@@ -5037,14 +4829,14 @@ function $1ab22f2cd39b3061$export$916e6850778505f6(search_params, filter_query_p
|
|
|
5037
4829
|
const keys = [
|
|
5038
4830
|
...search_params.keys()
|
|
5039
4831
|
];
|
|
5040
|
-
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param) search_params.delete(key);
|
|
4832
|
+
for (const key of keys)if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($1ab22f2cd39b3061$var$legacy_filter_prefix)) search_params.delete(key);
|
|
5041
4833
|
}
|
|
5042
4834
|
const $1ab22f2cd39b3061$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
5043
|
-
function $1ab22f2cd39b3061$export$43cd1e747fecd42e({ to_url_: to_url_
|
|
4835
|
+
function $1ab22f2cd39b3061$export$43cd1e747fecd42e({ to_url_: to_url_, set_clearing_flag_: set_clearing_flag_, from_search_params_: from_search_params_ = new URLSearchParams(location.search), sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5044
4836
|
if (!to_url_) return to_url_;
|
|
5045
4837
|
const was_url_object = to_url_ instanceof URL;
|
|
5046
4838
|
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
5047
|
-
const { searchParams: searchParams
|
|
4839
|
+
const { searchParams: searchParams } = url_object;
|
|
5048
4840
|
if (set_clearing_flag_) searchParams.set($1ab22f2cd39b3061$export$cf5feb2102aec7f2, "true");
|
|
5049
4841
|
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
5050
4842
|
for (const key of from_search_params_.keys())if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
@@ -5055,7 +4847,7 @@ function $1ab22f2cd39b3061$export$43cd1e747fecd42e({ to_url_: to_url_ , set_clea
|
|
|
5055
4847
|
|
|
5056
4848
|
|
|
5057
4849
|
const $e53b2e7e632ac4cb$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<nav class="crumbs"></nav>`, 2), $e53b2e7e632ac4cb$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="crumb"></a>`, 2), $e53b2e7e632ac4cb$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="separator"></span>`, 2);
|
|
5058
|
-
function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data
|
|
4850
|
+
function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_data, router_: router_, i18n_: i18n_, filter_query_param_prefix_: filter_query_param_prefix_, sorting_query_param_: sorting_query_param_ }) {
|
|
5059
4851
|
const placeholder_crumb_data = [
|
|
5060
4852
|
,
|
|
5061
4853
|
,
|
|
@@ -5132,16 +4924,8 @@ function $e53b2e7e632ac4cb$export$5646050d516e06bc({ crumb_data_: get_api_crumb_
|
|
|
5132
4924
|
|
|
5133
4925
|
|
|
5134
4926
|
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
4927
|
const $8cceb1d3a967f369$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<nav class="quicklinks"></nav>`, 2), $8cceb1d3a967f369$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div>QuickLinks failed</div>`, 2), $8cceb1d3a967f369$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="quicklink"></a>`, 2);
|
|
5144
|
-
function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_
|
|
4928
|
+
function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklinks_data_, router_: router_, current_query_id_: current_query_id_, breadcrumb_data_: breadcrumb_data_, i18n_: i18n_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5145
4929
|
let scrolling_logic_ran_for_query_id = false;
|
|
5146
4930
|
let last_scroll_position;
|
|
5147
4931
|
let scroll_to_element_on_dom_insertion;
|
|
@@ -5161,7 +4945,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5161
4945
|
const mutation_plugins = [
|
|
5162
4946
|
function() {
|
|
5163
4947
|
if (!scrolling_logic_ran_for_query_id) return;
|
|
5164
|
-
const { scrollLeft: scrollLeft
|
|
4948
|
+
const { scrollLeft: scrollLeft } = this.insert_here;
|
|
5165
4949
|
if (scrollLeft > 0) {
|
|
5166
4950
|
last_scroll_position = scrollLeft;
|
|
5167
4951
|
const current_id = (0, $57o7A$solidjs.untrack)(current_query_id_);
|
|
@@ -5200,9 +4984,9 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5200
4984
|
faded_opacity_: 0.5,
|
|
5201
4985
|
mutation_plugins_: mutation_plugins,
|
|
5202
4986
|
slider_ref_: (slider)=>{
|
|
5203
|
-
const { insert_here: insert_here
|
|
4987
|
+
const { insert_here: insert_here, intersecting_items_object: intersecting_items_object } = slider;
|
|
5204
4988
|
sliding_element = insert_here;
|
|
5205
|
-
(0, $57o7A$depictaiutilishared.observer).onexists(insert_here, ({ element: element
|
|
4989
|
+
(0, $57o7A$depictaiutilishared.observer).onexists(insert_here, ({ element: element })=>{
|
|
5206
4990
|
if (scroll_to_element_on_dom_insertion == undefined) {
|
|
5207
4991
|
if (!element.scrollLeft) {
|
|
5208
4992
|
const target_position = last_scroll_position;
|
|
@@ -5273,7 +5057,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5273
5057
|
// Solution: instead of not adding the state to the url, add a flag to the link if it's a sibling and then display the toast on load if the flag is set
|
|
5274
5058
|
const is_sibling = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
5275
5059
|
const current_id = current_query_id_();
|
|
5276
|
-
return quicklinks_data_()?.some(({ query_id: query_id
|
|
5060
|
+
return quicklinks_data_()?.some(({ query_id: query_id })=>query_id === current_id);
|
|
5277
5061
|
});
|
|
5278
5062
|
const href = (0, $57o7A$solidjs.createMemo)(()=>// We don't want these links to delete the sort and filter state by default, only if `clear_filters_when_going_sideways` explicitly clears them
|
|
5279
5063
|
(0, $1ab22f2cd39b3061$export$43cd1e747fecd42e)({
|
|
@@ -5330,7 +5114,7 @@ function $8cceb1d3a967f369$export$466cdc317043f6cb({ quicklinks_data_: quicklink
|
|
|
5330
5114
|
|
|
5331
5115
|
const $276380e4607fb9fb$var$max_history_change_frequency = 300;
|
|
5332
5116
|
const $276380e4607fb9fb$var$api_max_products_per_request = 100;
|
|
5333
|
-
function $276380e4607fb9fb$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data]
|
|
5117
|
+
function $276380e4607fb9fb$export$6e49da55e449af7c({ scroll_restoration_data_: [, set_scroll_restoration_data], last_result_in_viewport_: [get_last_result_in_viewport_], id_: id_, can_write_scroll_restoration_: can_write_scroll_restoration_ }) {
|
|
5334
5118
|
// store last actually seen (within viewport) product in history.state
|
|
5335
5119
|
let last_time_history_changed = 0;
|
|
5336
5120
|
let set_to_later;
|
|
@@ -5379,8 +5163,8 @@ function $276380e4607fb9fb$export$6e49da55e449af7c({ scroll_restoration_data_: [
|
|
|
5379
5163
|
}));
|
|
5380
5164
|
(0, $57o7A$solidjs.onCleanup)(()=>clearTimeout(timeout)); // could cause weird bugs otherwise
|
|
5381
5165
|
}
|
|
5382
|
-
async function $276380e4607fb9fb$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data]
|
|
5383
|
-
const to_fetch_according_to_state = (0, $57o7A$solidjs.untrack)(get_scroll_restoration_data).find(({ for_id: for_id
|
|
5166
|
+
async function $276380e4607fb9fb$export$cc42dd29bf655ab6({ scroll_restoration_data_: [get_scroll_restoration_data], make_request_: make_request_, min_products_to_fetch_: min_products_to_fetch_, id_: id_ }) {
|
|
5167
|
+
const to_fetch_according_to_state = (0, $57o7A$solidjs.untrack)(get_scroll_restoration_data).find(({ for_id: for_id })=>for_id === id_)?.min_results_loaded ?? 0;
|
|
5384
5168
|
const total_products_to_fetch = to_fetch_according_to_state < min_products_to_fetch_ ? min_products_to_fetch_ : to_fetch_according_to_state + 20; // if we fetch according to state, fetch some more in case that the screen size increased, there's some in-accuracy or for the user to scroll. Sometimes the load more post processor will trigger to fetch more after this, but I think that's ok.
|
|
5385
5169
|
if (total_products_to_fetch <= $276380e4607fb9fb$var$api_max_products_per_request) return await make_request_(total_products_to_fetch);
|
|
5386
5170
|
const displays = [];
|
|
@@ -5450,7 +5234,7 @@ let $0b6e2070a98de347$export$44dad306455dddf;
|
|
|
5450
5234
|
|
|
5451
5235
|
|
|
5452
5236
|
|
|
5453
|
-
function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_
|
|
5237
|
+
function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_, query_id_: query_id_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, plp_results_: plp_results_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ }) {
|
|
5454
5238
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
5455
5239
|
$ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
5456
5240
|
plp_results_: plp_results_,
|
|
@@ -5477,7 +5261,7 @@ function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
5477
5261
|
const went_downwards = previous_length < new_length;
|
|
5478
5262
|
const shorter_array = went_upwards ? new_crumb_data : previous_crumb_data;
|
|
5479
5263
|
const longer_array = went_upwards ? previous_crumb_data : new_crumb_data;
|
|
5480
|
-
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id
|
|
5264
|
+
if (!((went_upwards || went_downwards) && shorter_array.every(({ query_id: query_id }, index)=>longer_array[index].query_id === query_id))) {
|
|
5481
5265
|
// We went sideways, not up or down. Clear filters.
|
|
5482
5266
|
(0, $47e2cc552c02110c$export$8895d39404bd2bb1)({
|
|
5483
5267
|
user_triggered_: false,
|
|
@@ -5496,7 +5280,7 @@ function $ef972f5c10b1c5b4$export$3945d6db2dfd3d12({ crumb_data_: crumb_data_ ,
|
|
|
5496
5280
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
5497
5281
|
})));
|
|
5498
5282
|
}
|
|
5499
|
-
function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_
|
|
5283
|
+
function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_flag({ plp_results_: plp_results_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, selected_filters_: selected_filters_, local_filter_cache_: local_filter_cache_, sideways_filter_clearing_flag_: [get_sideways_filter_clearing_flag_, set_sideways_filter_clearing_flag_] }) {
|
|
5500
5284
|
const tracking_function_for_plp_results = (0, $57o7A$solidjs.createReaction)(()=>{
|
|
5501
5285
|
// On first rendering of the CategoryPage (after we have results), check if we got to this URL by going sideways in QuickLinks and clear filters with toast if so
|
|
5502
5286
|
if (!(0, $57o7A$solidjs.untrack)(get_sideways_filter_clearing_flag_)) return;
|
|
@@ -5522,20 +5306,16 @@ function $ef972f5c10b1c5b4$var$clear_if_opened_new_tab_with_sideways_url_params_
|
|
|
5522
5306
|
|
|
5523
5307
|
|
|
5524
5308
|
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
5309
|
const $839b3341523d31a2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="statement" style="white-space:pre-wrap">No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.</div>`, 2), $839b3341523d31a2$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="buttons"><button class="ok major"></button></div>`, 4);
|
|
5530
5310
|
function $839b3341523d31a2$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
5531
5311
|
if (!(0, $57o7A$depictaiutilishared.is_debug)) return; // Just to make sure we don't show this in production
|
|
5532
5312
|
const owner = (0, $57o7A$solidjs.getOwner)();
|
|
5533
|
-
const disconnect = (0, $57o7A$depictaiutilishared.observer).onexists(el, ({ element: element
|
|
5313
|
+
const disconnect = (0, $57o7A$depictaiutilishared.observer).onexists(el, ({ element: element })=>(0, $57o7A$solidjs.runWithOwner)(owner, ()=>(0, $57o7A$solidjs.createEffect)(()=>{
|
|
5534
5314
|
if (!document.documentElement.contains(element)) return;
|
|
5535
5315
|
if (!query_id_()) {
|
|
5536
5316
|
const warning = "No category ID specified, this is probably unintentional. Make sure to create (and insert) the CategoryPage *after* you have specified a category ID in your Depict Provider.";
|
|
5537
5317
|
(0, $57o7A$depictaiutilishared.dwarn)(warning);
|
|
5538
|
-
const { close_toast_: close_toast_
|
|
5318
|
+
const { close_toast_: close_toast_ } = (0, $ee498ec5e7dc2bba$export$5196e4c01fa56fcb)({
|
|
5539
5319
|
class: "warning",
|
|
5540
5320
|
close_after_: 120000,
|
|
5541
5321
|
style: {
|
|
@@ -5562,12 +5342,38 @@ function $839b3341523d31a2$export$d4fc5c0e68a52116(el, query_id_, i18n_) {
|
|
|
5562
5342
|
|
|
5563
5343
|
|
|
5564
5344
|
|
|
5565
|
-
|
|
5566
5345
|
const $6b502b1b2155a0bc$export$5c28802497c8a83c = /*@__PURE__*/ Symbol("category_title_type");
|
|
5567
5346
|
|
|
5568
5347
|
|
|
5348
|
+
|
|
5349
|
+
function $6a8e766e914723d8$export$d31a1a1a83ad9413(plp_results_, [get_selected_filters, set_selected_filters]) {
|
|
5350
|
+
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
5351
|
+
const available_filters = plp_results_()?.filters;
|
|
5352
|
+
if (!available_filters) return;
|
|
5353
|
+
const selected_filters = get_selected_filters();
|
|
5354
|
+
if (!selected_filters) return;
|
|
5355
|
+
const new_filters = [];
|
|
5356
|
+
let modified_filters = false;
|
|
5357
|
+
for(let i = 0; i < selected_filters.length; i++){
|
|
5358
|
+
const selected_filter = selected_filters[i];
|
|
5359
|
+
const available_filter = available_filters.find((available_filter)=>available_filter.field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
5360
|
+
const available_filter_old_filter_link = available_filters.find((available_filter)=>available_filter.actual_field === selected_filter.field && available_filter.op === selected_filter.op);
|
|
5361
|
+
if (!available_filter && available_filter_old_filter_link) {
|
|
5362
|
+
new_filters.push({
|
|
5363
|
+
...selected_filter,
|
|
5364
|
+
field: available_filter_old_filter_link.field
|
|
5365
|
+
}); // <- Change the field to be the new field which actually is group_title
|
|
5366
|
+
modified_filters = true;
|
|
5367
|
+
} else new_filters.push(selected_filter);
|
|
5368
|
+
}
|
|
5369
|
+
if (modified_filters) // This will unfortunately trigger a refetch which isn't great UX but it's the best we can do for now
|
|
5370
|
+
set_selected_filters(new_filters);
|
|
5371
|
+
});
|
|
5372
|
+
}
|
|
5373
|
+
|
|
5374
|
+
|
|
5569
5375
|
const $840d88a04b2d22a7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="product-count"><!#><!/> <!#><!/></div>`, 6), $840d88a04b2d22a7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div></div>`, 2), $840d88a04b2d22a7$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $840d88a04b2d22a7$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp category"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
5570
|
-
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_
|
|
5376
|
+
function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_, query_id_: query_id_, listing_type_: listing_type_, 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_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, local_filter_cache_: local_filter_cache_, tenant_: tenant_, market_: market_, router_: router_, show_quicklinks_: show_quicklinks_, category_title_: category_title_, show_breadcrumbs_: show_breadcrumbs_, layout_options_: layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
5571
5377
|
let results_for;
|
|
5572
5378
|
let only_show_filters_opener_;
|
|
5573
5379
|
let middle_elements_;
|
|
@@ -5664,6 +5470,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5664
5470
|
}), _el$6, _co$2);
|
|
5665
5471
|
return _el$;
|
|
5666
5472
|
})();
|
|
5473
|
+
(0, $6a8e766e914723d8$export$d31a1a1a83ad9413)(plp_results_, selected_filters_);
|
|
5667
5474
|
// aiming to have as little unneeded functionality in the bundle as possible, therefore we have two kinds of components that can "plug in" here depending on if there should be a title in the category page along with the count in a row above the buttons on mobile or if it should merge between the buttons when possible
|
|
5668
5475
|
if (category_title_type === "simple") {
|
|
5669
5476
|
const CategoryTitleComponent = category_title_;
|
|
@@ -5676,7 +5483,7 @@ function $840d88a04b2d22a7$export$f7d2f673fc2f091d({ depict_api_: depict_api_ ,
|
|
|
5676
5483
|
}
|
|
5677
5484
|
});
|
|
5678
5485
|
} else if (category_title_type == "interactive") {
|
|
5679
|
-
({ middle_elements_: middle_elements_
|
|
5486
|
+
({ middle_elements_: middle_elements_, only_show_filters_opener_: only_show_filters_opener_, on_filters_constructed_: on_filters_constructed_ } = category_title_({
|
|
5680
5487
|
make_product_count_: make_product_count_,
|
|
5681
5488
|
is_slim_: is_slim_,
|
|
5682
5489
|
set_observed_results_filters_elements_: set_observed_results_filters_elements_,
|
|
@@ -6013,12 +5820,12 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
6013
5820
|
const [get_current_href, set_current_href] = (0, $57o7A$solidjs.createSignal)(globalThis?.location?.href ?? "https://example.com");
|
|
6014
5821
|
const history_change_handler = (0, $57o7A$depictaiutilishared.catchify)(()=>set_current_href(location.href));
|
|
6015
5822
|
const owner = (0, $57o7A$solidjs.getOwner)() || (0, $57o7A$solidjs.createRoot)(()=>(0, $57o7A$solidjs.getOwner)());
|
|
6016
|
-
const { sorting_query_param_: sorting_query_param_
|
|
5823
|
+
const { sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = options;
|
|
6017
5824
|
let writer_started = false;
|
|
6018
5825
|
(0, $57o7A$depictaiutilishared.instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
6019
5826
|
(0, $57o7A$solidjs.onCleanup)(()=>(0, $57o7A$depictaiutilishared.instant_exec_on_suspect_history_change).delete(history_change_handler));
|
|
6020
5827
|
(0, $57o7A$solidjs.createComputed)(()=>{
|
|
6021
|
-
const { searchParams: searchParams
|
|
5828
|
+
const { searchParams: searchParams } = new URL(get_current_href());
|
|
6022
5829
|
(0, $57o7A$solidjs.batch)(()=>{
|
|
6023
5830
|
const found_sorting = (0, $1ab22f2cd39b3061$export$766e9676e74997d3)(searchParams, sorting_query_param_);
|
|
6024
5831
|
if (found_sorting) {
|
|
@@ -6028,7 +5835,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
6028
5835
|
} else set_sorting();
|
|
6029
5836
|
const found_filters = (0, $1ab22f2cd39b3061$export$f934fa24c3a86811)(searchParams, filter_query_param_prefix_);
|
|
6030
5837
|
const selected_filters = (0, $57o7A$solidjs.untrack)(get_selected_filters_);
|
|
6031
|
-
const found_filters_map = new Map(found_filters.map(({ field: field
|
|
5838
|
+
const found_filters_map = new Map(found_filters.map(({ field: field, op: op, data: data })=>[
|
|
6032
5839
|
JSON.stringify([
|
|
6033
5840
|
field,
|
|
6034
5841
|
op
|
|
@@ -6036,7 +5843,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
6036
5843
|
data
|
|
6037
5844
|
]));
|
|
6038
5845
|
// Sorry for this diffing algorithm lol. Looking forwards to Records and Tuples.
|
|
6039
|
-
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field
|
|
5846
|
+
if (selected_filters.length !== found_filters.length || !selected_filters.every(({ field: field, op: op, data: data })=>JSON.stringify(found_filters_map.get(JSON.stringify([
|
|
6040
5847
|
field,
|
|
6041
5848
|
op
|
|
6042
5849
|
]))) === JSON.stringify(data))) set_selected_filters(found_filters);
|
|
@@ -6072,7 +5879,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
6072
5879
|
}
|
|
6073
5880
|
/**
|
|
6074
5881
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
6075
|
-
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_
|
|
5882
|
+
*/ function $c79fd10a3ab7d6e0$var$start_href_writer({ get_sorting_: get_sorting_, get_selected_filters_: get_selected_filters_, router_: router_, get_has_sideways_filter_clearing_flag_: get_has_sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ }) {
|
|
6076
5883
|
(0, $57o7A$solidjs.createEffect)((0, $57o7A$solidjs.on)([
|
|
6077
5884
|
get_sorting_,
|
|
6078
5885
|
get_selected_filters_,
|
|
@@ -6080,7 +5887,7 @@ function $c79fd10a3ab7d6e0$export$477caf01aecaeb2a(options) {
|
|
|
6080
5887
|
], ([sorting, filters, has_sideways_filter_clearing_flag])=>{
|
|
6081
5888
|
const current_href = location.href;
|
|
6082
5889
|
const url_object = new URL(current_href);
|
|
6083
|
-
const { searchParams: searchParams
|
|
5890
|
+
const { searchParams: searchParams } = url_object;
|
|
6084
5891
|
(0, $1ab22f2cd39b3061$export$916e6850778505f6)(searchParams, filter_query_param_prefix_, sorting_query_param_);
|
|
6085
5892
|
(0, $1ab22f2cd39b3061$export$62acb285a7579555)(sorting, searchParams, sorting_query_param_);
|
|
6086
5893
|
(0, $1ab22f2cd39b3061$export$58aa3f171519b6d7)(filters, searchParams, filter_query_param_prefix_);
|
|
@@ -6117,7 +5924,7 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
6117
5924
|
*/ /**
|
|
6118
5925
|
* We store query_id in history.state and do operate on this both here and in js-ui, this is the key to be used which js-ui provides
|
|
6119
5926
|
*/ #throwing_on_navigation(...args) {
|
|
6120
|
-
const { on_navigation_: on_navigation_
|
|
5927
|
+
const { on_navigation_: on_navigation_ } = this;
|
|
6121
5928
|
if (typeof on_navigation_ !== "function") throw new Error("on_navigation_ is not a function");
|
|
6122
5929
|
// make sure that we don't accidentally catchify if the SDK consumer has fucked up
|
|
6123
5930
|
try {
|
|
@@ -6161,7 +5968,7 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
6161
5968
|
* @param force_spa_navigation_ if you want to force SPA navigation even if on_navigation_ is set to "hard_navigation". You should only set this to true for inter-SDK-page navigations
|
|
6162
5969
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
6163
5970
|
* @param category_query_id_ If you are navigating to a category and know the query_id of, please provide it. This is for making a better devEx in js-ui
|
|
6164
|
-
*/ go_to_: (0, $57o7A$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url
|
|
5971
|
+
*/ go_to_: (0, $57o7A$depictaiutilishared.catchify)(async ({ new_url_: raw_new_url, event_: event_, force_spa_navigation_: force_spa_navigation_, is_replace_: is_replace_, category_query_id_: category_query_id_, scroll: scroll = true })=>{
|
|
6165
5972
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
6166
5973
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
6167
5974
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
@@ -6199,11 +6006,10 @@ class $e96dd13889871fc0$export$7e1297a3a19f10d8 {
|
|
|
6199
6006
|
}
|
|
6200
6007
|
|
|
6201
6008
|
|
|
6202
|
-
|
|
6203
6009
|
const $48567ac5b39bac56$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp category"></div>`, 2);
|
|
6204
6010
|
const $48567ac5b39bac56$var$min_products_to_fetch_ = 20;
|
|
6205
6011
|
const $48567ac5b39bac56$var$privately_shared_properties = /*@__PURE__*/ new WeakMap();
|
|
6206
|
-
const $48567ac5b39bac56$var$InExternalAreaDiv = ({ children: children
|
|
6012
|
+
const $48567ac5b39bac56$var$InExternalAreaDiv = ({ children: children })=>(()=>{
|
|
6207
6013
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($48567ac5b39bac56$var$_tmpl$);
|
|
6208
6014
|
(0, $57o7A$solidjsweb.insert)(_el$, children);
|
|
6209
6015
|
(0, $57o7A$solidjsweb.effect)(()=>(0, $57o7A$solidjsweb.setAttribute)(_el$, "id", (0, $0b6e2070a98de347$export$44dad306455dddf).PLP_CATEGORY));
|
|
@@ -6255,7 +6061,7 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
6255
6061
|
set on_navigation(new_function) {
|
|
6256
6062
|
this.#router.on_navigation_ = new_function;
|
|
6257
6063
|
}
|
|
6258
|
-
constructor({ api: api
|
|
6064
|
+
constructor({ api: api, on_navigation: on_navigation, page_url_creator: page_url_creator, unique_instance_key_for_state: unique_instance_key_for_state = "", query_id_state_key: query_id_state_key, ...props_on_class }){
|
|
6259
6065
|
const owner = (0, $57o7A$solidjs.getOwner)() || (0, $57o7A$solidjs.createRoot)(()=>(0, $57o7A$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
6260
6066
|
(0, $57o7A$solidjs.runWithOwner)(owner, ()=>{
|
|
6261
6067
|
if ($48567ac5b39bac56$export$f34314aa9505732e.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $57o7A$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
@@ -6265,8 +6071,8 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
6265
6071
|
this.#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation", query_id_state_key);
|
|
6266
6072
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
6267
6073
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
6268
|
-
const filter_query_param_prefix_ = "
|
|
6269
|
-
const { selected_filters_: selected_filters_
|
|
6074
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
6075
|
+
const { selected_filters_: selected_filters_, current_sorting_: current_sorting_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_ } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
6270
6076
|
router_: this.#router,
|
|
6271
6077
|
sorting_query_param_: sorting_query_param_,
|
|
6272
6078
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -6307,11 +6113,11 @@ class $48567ac5b39bac56$export$f34314aa9505732e {
|
|
|
6307
6113
|
}
|
|
6308
6114
|
}
|
|
6309
6115
|
function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
6310
|
-
const { depict_category: depict_category
|
|
6116
|
+
const { depict_category: depict_category, product_card_template: product_card_template, category_title: category_title } = props;
|
|
6311
6117
|
const shared_properties = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
6312
6118
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
6313
6119
|
const grid_spacing_override = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
6314
|
-
const { grid_spacing: grid_spacing
|
|
6120
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
6315
6121
|
return typeof grid_spacing === "string" ? {
|
|
6316
6122
|
grid_spacing: grid_spacing
|
|
6317
6123
|
} : {
|
|
@@ -6319,7 +6125,7 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
6319
6125
|
grid_spacing: grid_spacing.horizontal
|
|
6320
6126
|
};
|
|
6321
6127
|
});
|
|
6322
|
-
const { state_: { local_filter_cache: local_filter_cache_
|
|
6128
|
+
const { state_: { local_filter_cache: local_filter_cache_, filters_open: category_filters_open_, sorting_open: category_sorting_open_, expanded_filters: expanded_filters_, expanded_hierarchical_filters: expanded_hierarchical_filters_, scroll_restoration_data: scroll_restoration_data_ }, current_sorting_: current_sorting_, selected_filters_: selected_filters_, reset_history_state_: reset_history_state_, depict_api_: depict_api_, i18n_: i18n_, router_: router_, breadcrumb_signal_: breadcrumb_signal_, quicklinks_signal_: quicklinks_signal_, sideways_filter_clearing_flag_: sideways_filter_clearing_flag_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = shared_properties;
|
|
6323
6129
|
(0, $57o7A$solidjs.onCleanup)(reset_history_state_);
|
|
6324
6130
|
return (0, $840d88a04b2d22a7$export$f7d2f673fc2f091d)({
|
|
6325
6131
|
tenant_: ()=>depict_category.merchant,
|
|
@@ -6354,8 +6160,8 @@ function $48567ac5b39bac56$export$e2bf8ce7779e827e(props) {
|
|
|
6354
6160
|
});
|
|
6355
6161
|
}, "Entire CategoryPage failed");
|
|
6356
6162
|
}
|
|
6357
|
-
function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_category
|
|
6358
|
-
const { i18n_: i18n_
|
|
6163
|
+
function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_category }) {
|
|
6164
|
+
const { i18n_: i18n_, breadcrumb_signal_: [crumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
6359
6165
|
return (0, $57o7A$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
6360
6166
|
get children () {
|
|
6361
6167
|
return (0, $e53b2e7e632ac4cb$export$5646050d516e06bc)({
|
|
@@ -6368,8 +6174,8 @@ function $48567ac5b39bac56$export$5b7c3ce0ebe51f86({ depict_category: depict_cat
|
|
|
6368
6174
|
}
|
|
6369
6175
|
});
|
|
6370
6176
|
}
|
|
6371
|
-
function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_category
|
|
6372
|
-
const { i18n_: i18n_
|
|
6177
|
+
function $48567ac5b39bac56$export$de035477d6fef996({ depict_category: depict_category }) {
|
|
6178
|
+
const { i18n_: i18n_, quicklinks_signal_: [quicklinks_data_], breadcrumb_signal_: [breadcrumb_data_], router_: router_, sorting_query_param_: sorting_query_param_, filter_query_param_prefix_: filter_query_param_prefix_ } = $48567ac5b39bac56$var$get_shared_properties(depict_category);
|
|
6373
6179
|
return (0, $57o7A$solidjsweb.createComponent)($48567ac5b39bac56$var$InExternalAreaDiv, {
|
|
6374
6180
|
get children () {
|
|
6375
6181
|
return (0, $8cceb1d3a967f369$export$466cdc317043f6cb)({
|
|
@@ -6394,14 +6200,9 @@ function $48567ac5b39bac56$var$get_shared_properties(depict_category) {
|
|
|
6394
6200
|
|
|
6395
6201
|
|
|
6396
6202
|
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
6203
|
const $0b23bfd073d9a4e8$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="category-title"><h1 class="title"></h1><span class="explanation"> — <!#><!/></span></div>`, 8);
|
|
6403
6204
|
const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
6404
|
-
const actual_function = ({ category_title_: category_title_
|
|
6205
|
+
const actual_function = ({ category_title_: category_title_, product_count_: product_count_ })=>{
|
|
6405
6206
|
return (()=>{
|
|
6406
6207
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($0b23bfd073d9a4e8$var$_tmpl$), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, [_el$6, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$5.nextSibling);
|
|
6407
6208
|
(0, $57o7A$solidjsweb.insert)(_el$2, ()=>category_title_() || (0, $57o7A$solidjsweb.createComponent)((0, $061ff5b4c3d36171$export$89c6019e4baa40b1), {
|
|
@@ -6422,12 +6223,9 @@ const $0b23bfd073d9a4e8$export$b91cec6bdc6b32a1 = /*@__PURE__*/ (()=>{
|
|
|
6422
6223
|
|
|
6423
6224
|
|
|
6424
6225
|
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
6226
|
const $85b747260aa175c9$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="sort-and-filter-buttons fake" aria-hidden="true" style="position:absolute;z-index:-1;pointer-events:none;opacity:0"><div class="outer"><div class="inner"><!#><!/><!#><!/><!#><!/></div></div></div>`, 12);
|
|
6429
6227
|
const $85b747260aa175c9$export$824dde41348efed1 = /*@__PURE__*/ (()=>{
|
|
6430
|
-
const actual_function = ({ make_product_count_: make_product_count_
|
|
6228
|
+
const actual_function = ({ make_product_count_: make_product_count_, set_observed_results_filters_elements_: set_observed_results_filters_elements_, is_slim_: is_slim_, sort_and_filter_element_: sort_and_filter_element_, extra_sort_and_filter_args_: extra_sort_and_filter_args_ })=>{
|
|
6431
6229
|
// this does two things: make the sorting and filters button the same width and move the number of products out of the SortAndFilter middle_elements_ if it doesn't fit
|
|
6432
6230
|
let extra_sort_button_;
|
|
6433
6231
|
let extra_filter_button_;
|
|
@@ -6590,16 +6388,9 @@ async function $63b10c9f461e0ef6$var$download_categories(tenant, market, type) {
|
|
|
6590
6388
|
|
|
6591
6389
|
|
|
6592
6390
|
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
6391
|
function $3bc4a89b971a3af5$export$3f37af283f8fb843(props) {
|
|
6601
6392
|
const style = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
6602
|
-
const { style: style
|
|
6393
|
+
const { style: style, height: height, width: width, aspectRatio: aspectRatio } = props;
|
|
6603
6394
|
const is_image = aspectRatio != undefined;
|
|
6604
6395
|
const size_data = is_image ? {
|
|
6605
6396
|
width: "100%",
|
|
@@ -6645,17 +6436,8 @@ function $6f604560873e4f69$export$ee1733d9a8495996() {
|
|
|
6645
6436
|
|
|
6646
6437
|
|
|
6647
6438
|
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
6439
|
const $dae23104ba8bb78c$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="parent-title"></span>`, 2), $dae23104ba8bb78c$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="category-suggestion"><span class="title"></span><!#><!/></a>`, 6);
|
|
6658
|
-
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_
|
|
6440
|
+
function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: category_suggestion_, router_: router_ }) {
|
|
6659
6441
|
return (()=>{
|
|
6660
6442
|
const _el$ = (0, $57o7A$solidjsweb.getNextElement)($dae23104ba8bb78c$var$_tmpl$2), _el$2 = _el$.firstChild, _el$4 = _el$2.nextSibling, [_el$5, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$4.nextSibling);
|
|
6661
6443
|
(0, $57o7A$solidjsweb.addEventListener)(_el$, "click", (0, $57o7A$depictaiutilishared.catchify)((e)=>{
|
|
@@ -6690,18 +6472,6 @@ function $dae23104ba8bb78c$export$d757d54550ebfb3d({ category_suggestion_: categ
|
|
|
6690
6472
|
|
|
6691
6473
|
|
|
6692
6474
|
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
6475
|
const $3df11fc61432d1fd$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="16"><path d="M.773 7.371L7.98.176C8.098.059 8.238 0 8.402 0s.305.059.422.176S9 .434 9 .598s-.059.305-.176.422L2.648 7.195h19.547a.59.59 0 0 1 .609.609c0 .172-.059.305-.176.422s-.262.176-.434.176H2.648l6.176 6.176a.59.59 0 0 1 .176.426c0 .16-.059.301-.176.422-.055.059-.121.109-.199.137s-.148.039-.223.039-.156-.012-.234-.039a.54.54 0 0 1-.187-.137L.773 8.227c-.117-.117-.176-.258-.176-.422a.6.6 0 0 1 .176-.434zm0 0"></path></svg>`, 4);
|
|
6706
6476
|
function $3df11fc61432d1fd$export$1c641004b5485fed() {
|
|
6707
6477
|
return (0, $57o7A$solidjsweb.getNextElement)($3df11fc61432d1fd$var$_tmpl$);
|
|
@@ -6710,10 +6480,6 @@ function $3df11fc61432d1fd$export$1c641004b5485fed() {
|
|
|
6710
6480
|
|
|
6711
6481
|
|
|
6712
6482
|
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
6483
|
const $87d7574e1d89d69b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg><path d="M19.811 20.174l-6.234-6.809a7.96 7.96 0 0 0 .923-1.179c.274-.424.502-.865.687-1.323a8.04 8.04 0 0 0 .42-1.436 7.88 7.88 0 0 0 .144-1.507c0-.526-.051-1.042-.154-1.548-.096-.506-.243-.995-.441-1.466s-.441-.919-.728-1.343a8.28 8.28 0 0 0-.984-1.21 7.86 7.86 0 0 0-1.2-.984A7.56 7.56 0 0 0 10.89.651C10.418.453 9.929.302 9.423.2S8.401.046 7.875.046 6.833.097 6.327.2 5.332.453 4.86.651a7.56 7.56 0 0 0-1.354.718c-.431.287-.831.615-1.2.984a8.28 8.28 0 0 0-.984 1.21 7.73 7.73 0 0 0-.728 1.343c-.198.472-.349.96-.451 1.466A8.31 8.31 0 0 0 0 7.921a8.31 8.31 0 0 0 .144 1.548c.103.506.253.995.451 1.466a8.08 8.08 0 0 0 .728 1.354 7.86 7.86 0 0 0 .984 1.2 7.54 7.54 0 0 0 1.2.995c.431.287.882.53 1.354.728.472.191.96.338 1.466.441a8.31 8.31 0 0 0 1.548.144c.451 0 .896-.038 1.333-.113a7.83 7.83 0 0 0 1.282-.328 7.55 7.55 0 0 0 1.2-.533 8.08 8.08 0 0 0 1.107-.749l6.245 6.809a.45.45 0 0 0 .174.123.55.55 0 0 0 .205.041.61.61 0 0 0 .195-.031c.061-.021.116-.055.164-.102.109-.096.164-.219.164-.369.007-.144-.038-.267-.133-.369zM1.046 7.921c0-.937.178-1.818.533-2.646.362-.834.851-1.559 1.466-2.174.622-.615 1.347-1.101 2.174-1.456.827-.362 1.712-.543 2.656-.543s1.829.181 2.656.543c.827.355 1.548.841 2.164 1.456.622.615 1.111 1.34 1.466 2.174a6.52 6.52 0 0 1 .543 2.646c0 .943-.181 1.829-.543 2.656a6.89 6.89 0 0 1-1.466 2.174c-.615.615-1.336 1.104-2.164 1.466-.827.356-1.712.533-2.656.533s-1.829-.178-2.656-.533c-.827-.362-1.552-.851-2.174-1.466-.615-.622-1.104-1.347-1.466-2.174-.355-.827-.533-1.712-.533-2.656z"></path></svg>`, 4);
|
|
6718
6484
|
function $87d7574e1d89d69b$export$82eafebb825fc23f(props = {}) {
|
|
6719
6485
|
return (()=>{
|
|
@@ -6730,7 +6496,7 @@ function $87d7574e1d89d69b$export$82eafebb825fc23f(props = {}) {
|
|
|
6730
6496
|
|
|
6731
6497
|
|
|
6732
6498
|
const $66b8b9a9613c141d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="back" type="button"></button>`, 2), $66b8b9a9613c141d$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="search-field"><!#><!/><div class="field"><input class="query" tabindex="0"><button type="button" class="clear"></button></div><button class="submit major" type="button"></button></div>`, 11);
|
|
6733
|
-
function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search_field_value_
|
|
6499
|
+
function $66b8b9a9613c141d$export$b94867ecbd698f21({ 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_, after_focusing_: after_focusing_ }) {
|
|
6734
6500
|
let input_element;
|
|
6735
6501
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
6736
6502
|
let field_div;
|
|
@@ -6759,10 +6525,10 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6759
6525
|
field_div = el;
|
|
6760
6526
|
field_element_ref_?.(el);
|
|
6761
6527
|
}, _el$3);
|
|
6762
|
-
_el$4.$$pointerdown = ({ pointerType: pointerType
|
|
6528
|
+
_el$4.$$pointerdown = ({ pointerType: pointerType })=>{
|
|
6763
6529
|
// When selecting text with a mouse we want a SearchField to be focussed even when releasing the mouse outside the .field element (we assume the event listener which opens the modal is attached to that).
|
|
6764
6530
|
if (pointerType === "mouse") {
|
|
6765
|
-
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ pointerType: pointerType
|
|
6531
|
+
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ pointerType: pointerType, target: target })=>{
|
|
6766
6532
|
if (pointerType !== "mouse" || !(target instanceof Node) || target === field_div || field_div.contains(target)) return;
|
|
6767
6533
|
input_element.click();
|
|
6768
6534
|
});
|
|
@@ -6782,7 +6548,7 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6782
6548
|
});
|
|
6783
6549
|
}));
|
|
6784
6550
|
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "input", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
6785
|
-
const { value: value
|
|
6551
|
+
const { value: value } = input_element;
|
|
6786
6552
|
if (!disabled_ && !value.length) clear_filters_(false); // if the user clears the whole field, reset filters on next submit
|
|
6787
6553
|
search_field_value_[1](value);
|
|
6788
6554
|
}), true);
|
|
@@ -6844,14 +6610,9 @@ function $66b8b9a9613c141d$export$b94867ecbd698f21({ search_field_value_: search
|
|
|
6844
6610
|
|
|
6845
6611
|
|
|
6846
6612
|
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
6613
|
const $fb29c6201c369e39$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="search-recs"><h3 class="search-recs-title"></h3><!#><!/><!#><!/></div>`, 8), $fb29c6201c369e39$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<button class="show-more major" type="button"></button>`, 2);
|
|
6853
6614
|
const $fb29c6201c369e39$export$1c8c715550dc689d = 2;
|
|
6854
|
-
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_
|
|
6615
|
+
function $fb29c6201c369e39$export$7de92c4c2205ebf3({ depict_api_: depict_api_, i18n_: i18n_, search_query_base_: search_query_base_, product_card_template_: product_card_template_, showing_recommendation_rows_: showing_recommendation_rows_, view_more_button_: view_more_button_ = true, layout_options_: layout_options_ }) {
|
|
6855
6616
|
const [get_showing_recommendation_rows] = showing_recommendation_rows_; // We reset this in after_submit in search.tsx FYI
|
|
6856
6617
|
const rows_object = view_more_button_ ? $fb29c6201c369e39$var$make_state_saved_rows(showing_recommendation_rows_, i18n_) : "all";
|
|
6857
6618
|
const [recommendations_resource] = (0, $57o7A$solidjs.createResource)(search_query_base_, (query)=>depict_api_.get_recommended(query).then((r)=>r.displays));
|
|
@@ -6945,7 +6706,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6945
6706
|
let ro;
|
|
6946
6707
|
if (one_axies_only !== "top") {
|
|
6947
6708
|
ro = new ResizeObserver((0, $57o7A$depictaiutilishared.catchify)((records)=>{
|
|
6948
|
-
records.forEach(({ contentRect: { width: width
|
|
6709
|
+
records.forEach(({ contentRect: { width: width } })=>{
|
|
6949
6710
|
if (width_transformer) width = width_transformer(width);
|
|
6950
6711
|
modal_body_style[1]((old_value)=>({
|
|
6951
6712
|
...old_value,
|
|
@@ -6975,7 +6736,7 @@ function $fd463ff0edb29915$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6975
6736
|
|
|
6976
6737
|
|
|
6977
6738
|
|
|
6978
|
-
function $b34ce0b89e6db4e1$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_
|
|
6739
|
+
function $b34ce0b89e6db4e1$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_, get_search_query_: get_search_query_, current_sorting_: current_sorting_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, i18n_: i18n_, local_filter_cache_: local_filter_cache_ }) {
|
|
6979
6740
|
const [get_selected_filters] = selected_filters_;
|
|
6980
6741
|
// Possible values:
|
|
6981
6742
|
// 0 - we should not clear next submit
|
|
@@ -7040,7 +6801,7 @@ function $2b7a005a65221045$export$84bba84a7b837187(read_search_query) {
|
|
|
7040
6801
|
|
|
7041
6802
|
|
|
7042
6803
|
|
|
7043
|
-
async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_
|
|
6804
|
+
async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchanged_value_: on_submit_with_unchanged_value_, search_param_name_: search_param_name_, set_search_field_value_: set_search_field_value_, get_search_query_: get_search_query_, url_transformer_: url_transformer_, router_: router_, after_submit_: after_submit_, get_new_query: get_new_query }) {
|
|
7044
6805
|
const new_search_query = get_new_query();
|
|
7045
6806
|
const previous_query = (0, $57o7A$solidjs.untrack)(get_search_query_);
|
|
7046
6807
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
@@ -7067,21 +6828,6 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
7067
6828
|
|
|
7068
6829
|
|
|
7069
6830
|
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
6831
|
|
|
7086
6832
|
|
|
7087
6833
|
|
|
@@ -7101,18 +6847,8 @@ async function $f328bd45f8ede33c$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
7101
6847
|
|
|
7102
6848
|
|
|
7103
6849
|
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
6850
|
const $6ae613870d3380fc$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="orig price"><!#><!/><!#><!/><!#><!/></span>`, 8), $6ae613870d3380fc$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.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>`, 26), $6ae613870d3380fc$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="tagline"></div>`, 2);
|
|
7115
|
-
const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n
|
|
6851
|
+
const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container, { i18n: i18n }, router_)=>{
|
|
7116
6852
|
const search_result_id = (0, $57o7A$solidjs.createMemo)(()=>display_or_variant_container().search_result_id);
|
|
7117
6853
|
const display = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
7118
6854
|
const display = display_or_variant_container();
|
|
@@ -7215,7 +6951,7 @@ const $6ae613870d3380fc$export$b05c0ae390cf3e06 = (display_or_variant_container,
|
|
|
7215
6951
|
|
|
7216
6952
|
|
|
7217
6953
|
const $6ae556e536054e87$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="instant-results"></div>`, 2);
|
|
7218
|
-
function $6ae556e536054e87$export$62f101a8aa597bf8({ depict_api_: depict_api_
|
|
6954
|
+
function $6ae556e536054e87$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_, router_: router_ }) {
|
|
7219
6955
|
const max_cards = 4;
|
|
7220
6956
|
const [read_current_instant_query, write_current_instant_query] = (0, $57o7A$solidjs.createSignal)("");
|
|
7221
6957
|
let timeout;
|
|
@@ -7287,7 +7023,6 @@ function $6ae556e536054e87$export$62f101a8aa597bf8({ depict_api_: depict_api_ ,
|
|
|
7287
7023
|
|
|
7288
7024
|
|
|
7289
7025
|
|
|
7290
|
-
|
|
7291
7026
|
const $7b98f0cf558884f7$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div style="position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;top:-100%;"></div>`, 2), $7b98f0cf558884f7$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div style="position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;"></div>`, 2);
|
|
7292
7027
|
function $7b98f0cf558884f7$export$50b90be27d8502d9(el, [get_style_props, set_style_props], bottom_distance) {
|
|
7293
7028
|
const overflow_style_beginning = "position:absolute;z-index:-1;pointer-events:none;width:100%;height:200%;";
|
|
@@ -7327,15 +7062,7 @@ function $7b98f0cf558884f7$export$50b90be27d8502d9(el, [get_style_props, set_sty
|
|
|
7327
7062
|
|
|
7328
7063
|
|
|
7329
7064
|
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: value_ , url_transformer_: url_transformer_ }) {
|
|
7065
|
+
function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_, value_: value_, url_transformer_: url_transformer_ }) {
|
|
7339
7066
|
const [get_current_href, set_current_href] = (0, $57o7A$solidjs.createSignal)(location.href);
|
|
7340
7067
|
const [exit_iterable, exitable_iterable] = (0, $57o7A$depictaiutilishared.make_asyncIterable_exiter)((0, $57o7A$depictaiutilishared.href_change_ipns));
|
|
7341
7068
|
(0, $57o7A$solidjs.onCleanup)(exit_iterable);
|
|
@@ -7354,7 +7081,6 @@ function $496cde876b53ce1e$export$91c3b6774e8be0f5({ param_: param_ , value_: va
|
|
|
7354
7081
|
|
|
7355
7082
|
|
|
7356
7083
|
|
|
7357
|
-
|
|
7358
7084
|
const $9e30168c4b1661d2$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="12" height="13"><path d="M6 12.598a5.88 5.88 0 0 1-1.611-.223c-.52-.145-1.008-.352-1.465-.621s-.875-.605-1.254-.996-.693-.83-.955-1.318c-.039-.07-.047-.145-.023-.223s.072-.143.146-.182.145-.047.223-.023.143.072.182.146a5.54 5.54 0 0 0 .861 1.184c.34.352.715.65 1.125.897s.85.435 1.318.568A5.5 5.5 0 0 0 6 12a5.24 5.24 0 0 0 2.098-.422c.656-.285 1.229-.672 1.717-1.16s.879-1.061 1.16-1.717a5.22 5.22 0 0 0 .428-2.104c0-.742-.143-1.441-.428-2.098s-.668-1.229-1.16-1.717a5.42 5.42 0 0 0-1.717-1.154A5.18 5.18 0 0 0 6 1.201c-.496 0-.979.066-1.447.199s-.904.316-1.318.563-.785.539-1.125.891a5.31 5.31 0 0 0-.855 1.172.32.32 0 0 1-.164.141c-.066.023-.135.023-.205 0a.3.3 0 0 1-.158-.135C.691 3.965.682 3.895.697 3.82l.51-2.385c.016-.078.059-.141.129-.187a.28.28 0 0 1 .229-.041c.078.016.141.059.188.129a.28.28 0 0 1 .041.229l-.211.973a5.91 5.91 0 0 1 .926-.814 5.78 5.78 0 0 1 1.066-.609A5.79 5.79 0 0 1 4.746.732C5.156.643 5.574.598 6 .598c.402 0 .795.039 1.178.117s.76.191 1.119.34a5.95 5.95 0 0 1 1.031.551c.328.219.633.469.914.75s.535.592.75.92a5.77 5.77 0 0 1 .551 1.025 5.53 5.53 0 0 1 .34 1.119c.078.387.117.779.117 1.178s-.039.797-.117 1.184-.187.754-.34 1.113a5.96 5.96 0 0 1-.551 1.031 5.56 5.56 0 0 1-.75.914c-.281.285-.586.537-.914.756a5.95 5.95 0 0 1-1.031.551c-.359.148-.732.26-1.119.334s-.775.117-1.178.117zm0-5.695c-.023 0-.049-.004-.076-.012s-.047-.018-.07-.029l-2.701-1.5c-.07-.039-.117-.098-.141-.176a.29.29 0 0 1 .023-.229c.043-.074.104-.123.182-.146s.158-.014.229.029l2.543 1.412 3.152-2.004c.07-.047.145-.061.223-.041a.29.29 0 0 1 .188.135c.047.066.061.141.041.223a.27.27 0 0 1-.129.188L6.158 6.855a.27.27 0 0 1-.076.035c-.027.008-.055.012-.082.012z" fill="#0f0f0f"></path></svg>`, 4);
|
|
7359
7085
|
function $9e30168c4b1661d2$export$5d2caaa6b530761c() {
|
|
7360
7086
|
return (0, $57o7A$solidjsweb.getNextElement)($9e30168c4b1661d2$var$_tmpl$);
|
|
@@ -7363,7 +7089,7 @@ function $9e30168c4b1661d2$export$5d2caaa6b530761c() {
|
|
|
7363
7089
|
|
|
7364
7090
|
|
|
7365
7091
|
const $9a268bf73b31a717$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="previous-searches"><h2 class="text"></h2><div class="list"></div></div>`, 6), $9a268bf73b31a717$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="item"><div class="left"><!#><!/><span></span></div><button class="delete"></button></a>`, 10);
|
|
7366
|
-
function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_
|
|
7092
|
+
function $9a268bf73b31a717$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_, selected_index_: [read_selected_index_, write_selected_index_], url_transformer_: url_transformer_, i18n_: i18n_, submit_query_: submit_query_ }) {
|
|
7367
7093
|
const has_entries = (0, $57o7A$solidjs.createMemo)(()=>previous_searches_().length >= 1);
|
|
7368
7094
|
currently_showing_suggestions_[1]((value)=>{
|
|
7369
7095
|
value[0] = (0, $57o7A$solidjs.createMemo)(()=>previous_searches_().map((result)=>({
|
|
@@ -7451,25 +7177,11 @@ function $9a268bf73b31a717$export$a146ac6fa8346a25({ text_: text_ , previous_sea
|
|
|
7451
7177
|
|
|
7452
7178
|
|
|
7453
7179
|
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
7180
|
|
|
7469
7181
|
|
|
7470
7182
|
|
|
7471
7183
|
const $d023ed916c84e75d$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="highlighted-part"></span>`, 2), $d023ed916c84e75d$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span></span>`, 2);
|
|
7472
|
-
function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo
|
|
7184
|
+
function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: whole_text_to_display_memo, searching_for_value_: searching_for_value_memo, class_: class_ }) {
|
|
7473
7185
|
const [get_has_highlighted, set_has_highlighted] = (0, $57o7A$solidjs.createSignal)(false);
|
|
7474
7186
|
const text_itself = (0, $57o7A$solidjs.createMemo)(()=>(0, $57o7A$solidjs.batch)(()=>{
|
|
7475
7187
|
set_has_highlighted(false);
|
|
@@ -7531,10 +7243,10 @@ function $d023ed916c84e75d$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
|
|
|
7531
7243
|
|
|
7532
7244
|
|
|
7533
7245
|
const $6b65ba8af12c5a26$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a class="suggestion"></a>`, 2), $6b65ba8af12c5a26$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="search-icon"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<span class="type"></span>`, 2), $6b65ba8af12c5a26$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div><!#><!/><span class="value"></span></div>`, 6), $6b65ba8af12c5a26$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<h2 class="text"></h2>`, 2), $6b65ba8af12c5a26$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6), $6b65ba8af12c5a26$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="suggestion-container page"></div>`, 2), $6b65ba8af12c5a26$var$_tmpl$8 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="suggestions"><!#><!/><!#><!/><!#><!/></div>`, 8);
|
|
7534
|
-
function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_
|
|
7535
|
-
const queries_memo = (0, $57o7A$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
7246
|
+
function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_, search_query_url_param_name_: search_query_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_, i18n_: i18n_, include_category_suggestions_: include_category_suggestions_, searching_for_value_: searching_for_value_, router_: router_, submit_query_: submit_query_ }) {
|
|
7247
|
+
const queries_memo = (0, $57o7A$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type, title: title })=>type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
7536
7248
|
));
|
|
7537
|
-
const not_queries_memo = (0, $57o7A$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type
|
|
7249
|
+
const not_queries_memo = (0, $57o7A$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $3ec9e21d6b6debdd$export$3cf9497e790da491)));
|
|
7538
7250
|
const render_entry = (input_obj, autocomplete_data_index, index, is_history = false)=>{
|
|
7539
7251
|
const is_query = (0, $57o7A$solidjs.createMemo)(()=>input_obj().type === (0, $3ec9e21d6b6debdd$export$3cf9497e790da491));
|
|
7540
7252
|
const href_with_changed_params_accessor = (0, $57o7A$solidjs.createMemo)(()=>is_query() ? (0, $496cde876b53ce1e$export$91c3b6774e8be0f5)({
|
|
@@ -7737,10 +7449,8 @@ function $6b65ba8af12c5a26$export$e872e2339fb04a7f({ suggestion_memo_: suggestio
|
|
|
7737
7449
|
|
|
7738
7450
|
|
|
7739
7451
|
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
7452
|
const $6a374b16bfe947d0$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<a target="_blank"></a>`, 2);
|
|
7743
|
-
function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index]
|
|
7453
|
+
function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_selected_index, write_selected_index], currently_showing_suggestions_: [read_currently_showing_suggestions], ...rest_of_props }) {
|
|
7744
7454
|
const last_suggestion_index_ = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
7745
7455
|
const currently_showing_suggestions = read_currently_showing_suggestions();
|
|
7746
7456
|
let total_length = 0;
|
|
@@ -7795,13 +7505,13 @@ function $6a374b16bfe947d0$export$217899a935ef803b({ selected_index_: [read_sele
|
|
|
7795
7505
|
write_selected_fake_index_: write_selected_fake_index_
|
|
7796
7506
|
});
|
|
7797
7507
|
}
|
|
7798
|
-
function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_: element_
|
|
7508
|
+
function $6a374b16bfe947d0$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_, url_transformer_: url_transformer_, search_query_param_name_: search_query_param_name_, router_: router_ }) {
|
|
7799
7509
|
let previous_value;
|
|
7800
7510
|
(0, $57o7A$solidjs.createEffect)(()=>{
|
|
7801
7511
|
const sfv = get_search_field_value();
|
|
7802
7512
|
if (!(0, $57o7A$solidjs.untrack)(()=>read_updating_blocked())) previous_value = sfv;
|
|
7803
7513
|
});
|
|
7804
|
-
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ keyCode: keyCode
|
|
7514
|
+
const handler = (0, $57o7A$depictaiutilishared.catchify)(({ keyCode: keyCode })=>(0, $57o7A$solidjs.untrack)(()=>{
|
|
7805
7515
|
const up = keyCode === 38;
|
|
7806
7516
|
const down = keyCode === 40;
|
|
7807
7517
|
if (!up && !down) return;
|
|
@@ -7828,7 +7538,7 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7828
7538
|
};
|
|
7829
7539
|
// update text field value if needed
|
|
7830
7540
|
if (selected_entry?.type == "query") {
|
|
7831
|
-
const { title: title
|
|
7541
|
+
const { title: title } = selected_entry;
|
|
7832
7542
|
block_updating_for_one_change();
|
|
7833
7543
|
set_search_field_value(title);
|
|
7834
7544
|
override_on_enter_for_this_entry((e)=>{
|
|
@@ -7840,7 +7550,7 @@ function $6a374b16bfe947d0$var$actual_navigation_working_on_fake_data({ element_
|
|
|
7840
7550
|
return $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, url.href);
|
|
7841
7551
|
});
|
|
7842
7552
|
} else if (selected_entry?.type == "category") override_on_enter_for_this_entry((e)=>{
|
|
7843
|
-
const { page_url: page_url
|
|
7553
|
+
const { page_url: page_url } = selected_entry;
|
|
7844
7554
|
if (!$6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, page_url)) // Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
7845
7555
|
router_.navigate_.go_to_({
|
|
7846
7556
|
new_url_: page_url,
|
|
@@ -7878,7 +7588,7 @@ function $6a374b16bfe947d0$var$open_link_on_cmd_pressed(e, href) {
|
|
|
7878
7588
|
|
|
7879
7589
|
|
|
7880
7590
|
const $3ec9e21d6b6debdd$export$3cf9497e790da491 = "query";
|
|
7881
|
-
function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_
|
|
7591
|
+
function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_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_, submit_query_: submit_query_, router_: router_ }) {
|
|
7882
7592
|
const [searching_for_value, set_searching_for_value] = (0, $57o7A$solidjs.createSignal)();
|
|
7883
7593
|
const [read_search_field_value] = search_field_value_;
|
|
7884
7594
|
const updating_blocked = (0, $57o7A$solidjs.createSignal)(false);
|
|
@@ -7892,7 +7602,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7892
7602
|
write_suggestion_signal([]);
|
|
7893
7603
|
return;
|
|
7894
7604
|
}
|
|
7895
|
-
const new_value = api_response.suggestions.sort(({ type: a_type
|
|
7605
|
+
const new_value = api_response.suggestions.sort(({ type: a_type }, { type: b_type } // this is probably stupid? But in the UI we show query suggestions first so for the keyboard suggestions to make sense with the index we sort them first here
|
|
7896
7606
|
)=>a_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 && b_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 || a_type !== $3ec9e21d6b6debdd$export$3cf9497e790da491 && b_type !== $3ec9e21d6b6debdd$export$3cf9497e790da491 ? 0 : a_type === $3ec9e21d6b6debdd$export$3cf9497e790da491 ? -1 : 1);
|
|
7897
7607
|
write_suggestion_signal(new_value);
|
|
7898
7608
|
selected_index_[1](undefined); // reset selected index on new results
|
|
@@ -7937,7 +7647,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7937
7647
|
search_query_param_name_: search_query_url_param_name_,
|
|
7938
7648
|
text_: previous_searches_text_,
|
|
7939
7649
|
get previous_searches_ () {
|
|
7940
|
-
return (0, $57o7A$solidjs.createMemo)(()=>filtered_previous_searches().slice(0,
|
|
7650
|
+
return (0, $57o7A$solidjs.createMemo)(()=>filtered_previous_searches().slice(0, 3));
|
|
7941
7651
|
},
|
|
7942
7652
|
selected_index_: selected_index_,
|
|
7943
7653
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
@@ -7954,7 +7664,7 @@ function $3ec9e21d6b6debdd$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7954
7664
|
const value = searching_for_value()?.toLowerCase();
|
|
7955
7665
|
if (!value) return false;
|
|
7956
7666
|
return search.includes(value) || value.includes(search);
|
|
7957
|
-
}).slice(0,
|
|
7667
|
+
}).slice(0, 2);
|
|
7958
7668
|
});
|
|
7959
7669
|
},
|
|
7960
7670
|
on_previous_searches_page_: show_previous_searches_component,
|
|
@@ -7996,14 +7706,14 @@ function $341a019928b8b91e$export$c7e181728ad525f(url) {
|
|
|
7996
7706
|
}
|
|
7997
7707
|
|
|
7998
7708
|
|
|
7999
|
-
function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_
|
|
7709
|
+
function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_, search_query_url_param_name_: search_query_url_param_name_, url_transformer_: url_transformer_, get_search_query_: get_search_query_ }) {
|
|
8000
7710
|
// @ts-ignore
|
|
8001
7711
|
if (process.env.GA === "false") return;
|
|
8002
7712
|
let debounce_timeout;
|
|
8003
7713
|
const stop_timeout = ()=>clearTimeout(debounce_timeout);
|
|
8004
7714
|
const send_to_ga = (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
8005
7715
|
const fake_url = new URL(location.href);
|
|
8006
|
-
const { searchParams: searchParams
|
|
7716
|
+
const { searchParams: searchParams } = fake_url;
|
|
8007
7717
|
searchParams.set(search_query_url_param_name_, (0, $57o7A$solidjs.untrack)(get_search_field_value_));
|
|
8008
7718
|
searchParams.set("instant_result", "true");
|
|
8009
7719
|
url_transformer_?.(fake_url);
|
|
@@ -8031,8 +7741,6 @@ function $036d367ce3058351$export$3340fdd8259bd4fd({ get_search_field_value_: ge
|
|
|
8031
7741
|
|
|
8032
7742
|
|
|
8033
7743
|
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
7744
|
const $2be658935c4043a9$export$af8311b651139246 = (css_properties)=>{
|
|
8037
7745
|
return Object.entries(css_properties).map(([key, value])=>`${key}: ${value};`).join(" ");
|
|
8038
7746
|
};
|
|
@@ -8056,7 +7764,7 @@ function $b776f25acdda22eb$export$f021bdedd3ec901a(props) {
|
|
|
8056
7764
|
|
|
8057
7765
|
|
|
8058
7766
|
const $f40a47a30a358305$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="discover-more"><button class="major" type="button"></button></div>`, 4), $f40a47a30a358305$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<b></b>`, 2), $f40a47a30a358305$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict-search-modal"><div class="body"><!#><!/><div class="padded"><!#><!/><!#><!/><!#><!/></div><!#><!/></div><!#><!/></div>`, 18), $f40a47a30a358305$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"><div class="depict-search-modal-backdrop"></div><!#><!/></div>`, 6);
|
|
8059
|
-
function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value
|
|
7767
|
+
function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value, get_search_query_: get_search_query_, search_query_url_param_name_: search_query_url_param_name_, previous_searches_: previous_searches_, close_modal_: close_modal_, style_props_: style_props_ = (0, $57o7A$solidjs.createSignal)({}), depict_api_: depict_api_, tenant_: tenant_, market_: market_, submit_query_: props_submit_query, instant_results_options_: instant_results_options_, register_closing_animation_: register_closing_animation_, url_transformer_: url_transformer_, closing_animation_: closing_animation_, clear_filters_: clear_filters_, i18n_: i18n_, disable_scrolling_: disable_scrolling_ = true, enable_category_suggestions_: enable_category_suggestions_, class_list_: class_list_, bottom_distance_under_modal_: bottom_distance_under_modal_, selected_text_range_: selected_text_range_, dont_sync_search_field_value_except_on_submit_: dont_sync_search_field_value_except_on_submit_ = false, router_: router_ }) {
|
|
8060
7768
|
let on_enter_in_search_field_function;
|
|
8061
7769
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
8062
7770
|
// This is desired for when the modal is opened from a UI element that visually does not look connected with the search page or current query
|
|
@@ -8074,7 +7782,7 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8074
7782
|
const [get_search_field_value_] = search_field_value_;
|
|
8075
7783
|
const [elements_outside_scrollable, set_elements_outside_scrollable] = (0, $57o7A$solidjs.createSignal)();
|
|
8076
7784
|
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $57o7A$solidjs.createSignal)();
|
|
8077
|
-
const close_on_escape_handler = (0, $57o7A$depictaiutilishared.catchify)(({ key: key
|
|
7785
|
+
const close_on_escape_handler = (0, $57o7A$depictaiutilishared.catchify)(({ key: key })=>{
|
|
8078
7786
|
if (key === "Escape") close_modal_();
|
|
8079
7787
|
});
|
|
8080
7788
|
const [get_num_results_accessor, set_num_results_accessor_] = (0, $57o7A$solidjs.createSignal)();
|
|
@@ -8087,7 +7795,7 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8087
7795
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
8088
7796
|
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.catchify)(()=>window.removeEventListener("keydown", close_on_escape_handler)));
|
|
8089
7797
|
const owner = (0, $57o7A$solidjs.getOwner)();
|
|
8090
|
-
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-height:700px)", ({ matches: matches
|
|
7798
|
+
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-height:700px)", ({ matches: matches })=>(0, $57o7A$solidjs.runWithOwner)(owner, ()=>{
|
|
8091
7799
|
// the if below is reactive so we need an owner
|
|
8092
7800
|
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
8093
7801
|
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((()=>{
|
|
@@ -8142,7 +7850,7 @@ function $f40a47a30a358305$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
8142
7850
|
search_field.classList.add("in-modal");
|
|
8143
7851
|
const modal_element = (()=>{
|
|
8144
7852
|
const _el$4 = (0, $57o7A$solidjsweb.getNextElement)($f40a47a30a358305$var$_tmpl$3), _el$5 = _el$4.firstChild, _el$13 = _el$5.firstChild, [_el$14, _co$4] = (0, $57o7A$solidjsweb.getNextMarker)(_el$13.nextSibling), _el$6 = _el$14.nextSibling, _el$7 = _el$6.firstChild, [_el$8, _co$] = (0, $57o7A$solidjsweb.getNextMarker)(_el$7.nextSibling), _el$9 = _el$8.nextSibling, [_el$10, _co$2] = (0, $57o7A$solidjsweb.getNextMarker)(_el$9.nextSibling), _el$11 = _el$10.nextSibling, [_el$12, _co$3] = (0, $57o7A$solidjsweb.getNextMarker)(_el$11.nextSibling), _el$15 = _el$6.nextSibling, [_el$16, _co$5] = (0, $57o7A$solidjsweb.getNextMarker)(_el$15.nextSibling), _el$17 = _el$5.nextSibling, [_el$18, _co$6] = (0, $57o7A$solidjsweb.getNextMarker)(_el$17.nextSibling);
|
|
8145
|
-
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "click", (0, $57o7A$depictaiutilishared.catchify)(({ target: target
|
|
7853
|
+
(0, $57o7A$solidjsweb.addEventListener)(_el$4, "click", (0, $57o7A$depictaiutilishared.catchify)(({ target: target })=>{
|
|
8146
7854
|
if (target === modal_element) close_modal_();
|
|
8147
7855
|
}), true);
|
|
8148
7856
|
(0, $57o7A$solidjsweb.insert)(_el$5, search_field, _el$14, _co$4);
|
|
@@ -8257,18 +7965,9 @@ function $f40a47a30a358305$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
8257
7965
|
|
|
8258
7966
|
|
|
8259
7967
|
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
7968
|
|
|
8270
7969
|
const $04048c1bef16c249$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="category-suggestions"></div>`, 2), $04048c1bef16c249$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="category-suggestion"></div>`, 2);
|
|
8271
|
-
function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
7970
|
+
function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_, children: children }) {
|
|
8272
7971
|
const category_suggestions_ = (0, $57o7A$solidjs.createMemo)(()=>suggestions_()?.suggestions.filter((s)=>s.type === "category"));
|
|
8273
7972
|
return (0, $57o7A$solidjsweb.createComponent)((0, $57o7A$solidjs.Show), {
|
|
8274
7973
|
get when () {
|
|
@@ -8319,10 +8018,8 @@ function $04048c1bef16c249$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
8319
8018
|
|
|
8320
8019
|
|
|
8321
8020
|
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
8021
|
const $65a0c4b1c2eb5d0b$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<b></b>`, 2), $65a0c4b1c2eb5d0b$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="results-for"></div>`, 2);
|
|
8325
|
-
function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_
|
|
8022
|
+
function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_, i18n_: i18n_, formatted_number_of_results_: formatted_number_of_results_ }) {
|
|
8326
8023
|
const contents = (0, $57o7A$solidjs.createMemo)((0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
8327
8024
|
const q = get_search_query_();
|
|
8328
8025
|
return i18n_.get_showing_results_for_()((()=>{
|
|
@@ -8351,7 +8048,7 @@ function $65a0c4b1c2eb5d0b$export$9dd50d35b9d94fdf({ get_search_query_: get_sear
|
|
|
8351
8048
|
|
|
8352
8049
|
|
|
8353
8050
|
|
|
8354
|
-
function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_ = (0, $57o7A$solidjs.createSignal)({})
|
|
8051
|
+
function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_ = (0, $57o7A$solidjs.createSignal)({}) } = {}) {
|
|
8355
8052
|
const [, set_style_props] = style_props_;
|
|
8356
8053
|
const supports_hover = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(hover: hover) and (pointer: fine)");
|
|
8357
8054
|
const desktop_short = (0, $b54e6192d0caa293$export$d9f36cf74e24d595)("(max-height: 790px)");
|
|
@@ -8371,7 +8068,7 @@ function $2005eec80e40088f$export$41b4894022a3580f({ style_props_: style_props_
|
|
|
8371
8068
|
|
|
8372
8069
|
|
|
8373
8070
|
const $f1d7cb69f839a526$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6), $f1d7cb69f839a526$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 20);
|
|
8374
|
-
function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_
|
|
8071
|
+
function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_, search_field_value_: search_field_value_, get_search_query_: get_search_query_, open_modal_: open_modal_, submit_query_: submit_query_, current_sorting_: current_sorting_, min_products_to_fetch_: min_products_to_fetch_, search_filters_open_: search_filters_open_, search_sorting_open_: search_sorting_open_, expanded_filters_: expanded_filters_, input_modal_open_: input_modal_open_, selected_filters_: selected_filters_, i18n_: i18n_, make_category_suggestion_card_: make_category_suggestion_card_, expanded_hierarchical_filters_: expanded_hierarchical_filters_, clear_filters_on_next_submit_: clear_filters_on_next_submit_, local_filter_cache_: local_filter_cache_, include_input_field_: include_input_field_, tenant_: tenant_, market_: market_, showing_recommendation_rows_: showing_recommendation_rows_, search_recs_view_more_: search_recs_view_more_, disable_search_recommendations_: disable_search_recommendations_, layout_options_: layout_options_, recommendations_layout_options_: recommendations_layout_options_, scroll_restoration_data_: scroll_restoration_data_, product_card_template_: product_card_template_, modal_body_style_ref_: modal_body_style_ref_ }) {
|
|
8375
8072
|
const [get_sorting] = current_sorting_;
|
|
8376
8073
|
const all_products_loaded_ = (0, $57o7A$solidjs.createSignal)(false);
|
|
8377
8074
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
@@ -8458,7 +8155,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8458
8155
|
});
|
|
8459
8156
|
const results_filters = (0, $57o7A$solidjs.createSignal)();
|
|
8460
8157
|
const owner = (0, $57o7A$solidjs.getOwner)();
|
|
8461
|
-
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-width:600px)", async ({ matches: matches
|
|
8158
|
+
(0, $57o7A$solidjs.onCleanup)((0, $57o7A$depictaiutilishared.javascript_media_query)("(max-width:600px)", async ({ matches: matches })=>{
|
|
8462
8159
|
results_filters[1]();
|
|
8463
8160
|
await new Promise((r)=>queueMicrotask(r));
|
|
8464
8161
|
(0, $57o7A$solidjs.runWithOwner)(owner, ()=>results_filters[1](matches ? [
|
|
@@ -8471,6 +8168,7 @@ function $f1d7cb69f839a526$export$a54ec244c8863715({ depict_api_: depict_api_ ,
|
|
|
8471
8168
|
return _el$;
|
|
8472
8169
|
})()));
|
|
8473
8170
|
}).remove);
|
|
8171
|
+
(0, $6a8e766e914723d8$export$d31a1a1a83ad9413)(search_results_, selected_filters_);
|
|
8474
8172
|
(0, $57o7A$depictaiutilishared.catchify)((0, $276380e4607fb9fb$export$6e49da55e449af7c))({
|
|
8475
8173
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
8476
8174
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
@@ -8696,7 +8394,6 @@ function $d8e94ea381ab57fa$export$828dcdd425fd3231(aligner) {
|
|
|
8696
8394
|
|
|
8697
8395
|
|
|
8698
8396
|
|
|
8699
|
-
|
|
8700
8397
|
const $2c61e4cd8229c49a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$57o7A$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
|
|
8701
8398
|
/**
|
|
8702
8399
|
* 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.
|
|
@@ -8710,8 +8407,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8710
8407
|
#modal_open_signal = (0, $57o7A$solidjs.createSignal)(false);
|
|
8711
8408
|
static #keys_constructed_with = new Set();
|
|
8712
8409
|
#router = new (0, $e96dd13889871fc0$export$7e1297a3a19f10d8)("hard_navigation");
|
|
8713
|
-
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = ""
|
|
8714
|
-
disable_scrolling_during_modal = true
|
|
8410
|
+
constructor({ unique_instance_key_for_state: unique_instance_key_for_state = "", search_query_url_param_name: search_query_url_param_name_ = "query" + unique_instance_key_for_state, url_transformer: url_transformer, on_navigation: on_navigation, enable_category_suggestions: enable_category_suggestions = true, page_url_creator: page_url_creator, disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
8411
|
+
disable_scrolling_during_modal = true, api: api, bottom_distance_under_modal: bottom_distance_under_modal, render_instant_card: render_instant_card, ...props_on_class }){
|
|
8715
8412
|
const owner = (0, $57o7A$solidjs.getOwner)() || (0, $57o7A$solidjs.createRoot)(()=>(0, $57o7A$solidjs.getOwner)()); // we might have an owner, if so, pass it on. Otherwise, create one so solid doesn't print warnings to the console
|
|
8716
8413
|
(0, $57o7A$solidjs.runWithOwner)(owner, ()=>{
|
|
8717
8414
|
if ($2c61e4cd8229c49a$export$ac6237957a15b3f0.#keys_constructed_with.has(unique_instance_key_for_state) && !(0, $57o7A$solidjsweb.isServer)) // on the server we can't write stuff to history.state anyway so can have multiple
|
|
@@ -8719,8 +8416,8 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8719
8416
|
Object.assign(this, props_on_class);
|
|
8720
8417
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
8721
8418
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
8722
|
-
const filter_query_param_prefix_ = "
|
|
8723
|
-
const { current_sorting_: current_sorting_
|
|
8419
|
+
const filter_query_param_prefix_ = "f" + unique_instance_key_for_state + "_";
|
|
8420
|
+
const { current_sorting_: current_sorting_, selected_filters_: selected_filters_, search_query_accessor_: raw_search_query_accessor } = (0, $c79fd10a3ab7d6e0$export$477caf01aecaeb2a)({
|
|
8724
8421
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
8725
8422
|
router_: this.#router,
|
|
8726
8423
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -8792,7 +8489,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8792
8489
|
});
|
|
8793
8490
|
(0, $d84fe647b84b5dc5$export$5162a71f252e6122)();
|
|
8794
8491
|
(0, $57o7A$depictaiutilishared.catchify)(async ()=>{
|
|
8795
|
-
const { open_modal_: open_modal_
|
|
8492
|
+
const { open_modal_: open_modal_, close_modal_: close_modal_ } = await (0, $9abb0a35d4b60ed3$export$79b1565500412d9b)((...args)=>{
|
|
8796
8493
|
(0, $57o7A$solidjs.onCleanup)(()=>this.modal_open = false);
|
|
8797
8494
|
return (0, $f40a47a30a358305$export$1c593cbd6f1e10bc)(...args);
|
|
8798
8495
|
}, {
|
|
@@ -8828,7 +8525,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8828
8525
|
close_modal_();
|
|
8829
8526
|
return;
|
|
8830
8527
|
}
|
|
8831
|
-
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_
|
|
8528
|
+
const { search_page_aligned_modal_body_style_signal_: search_page_aligned_modal_body_style_signal_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
|
|
8832
8529
|
if (signal_value_is_options && open_signal_value[0]?.style_props_) {
|
|
8833
8530
|
// They know what they're doing, just call the modal with the provided options
|
|
8834
8531
|
open_modal_(...open_signal_value);
|
|
@@ -8902,7 +8599,7 @@ class $2c61e4cd8229c49a$export$ac6237957a15b3f0 {
|
|
|
8902
8599
|
this.#market_signal[1](market);
|
|
8903
8600
|
}
|
|
8904
8601
|
async fetchSearchResults(query, filters, maxResults = 48) {
|
|
8905
|
-
const { depict_api_: depict_api_
|
|
8602
|
+
const { depict_api_: depict_api_ } = $2c61e4cd8229c49a$var$privately_shared_properties.get(this);
|
|
8906
8603
|
const result = await depict_api_.query({
|
|
8907
8604
|
tenant: this.merchant,
|
|
8908
8605
|
market: this.market,
|
|
@@ -8920,12 +8617,12 @@ function $2c61e4cd8229c49a$var$get_shared_properties(depict_search) {
|
|
|
8920
8617
|
return shared_properties;
|
|
8921
8618
|
}
|
|
8922
8619
|
function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
8923
|
-
const { depict_search: depict_search
|
|
8620
|
+
const { depict_search: depict_search, product_card_template: product_card_template } = props;
|
|
8924
8621
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
8925
8622
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
8926
|
-
const { state_: state_
|
|
8623
|
+
const { state_: state_ } = shared_properties;
|
|
8927
8624
|
const grid_spacing_override = (0, $57o7A$solidjs.createMemo)(()=>{
|
|
8928
|
-
const { grid_spacing: grid_spacing
|
|
8625
|
+
const { grid_spacing: grid_spacing } = props; // can be reactive
|
|
8929
8626
|
return typeof grid_spacing === "string" ? {
|
|
8930
8627
|
grid_spacing: grid_spacing
|
|
8931
8628
|
} : {
|
|
@@ -8983,7 +8680,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
8983
8680
|
...grid_spacing_override()
|
|
8984
8681
|
})),
|
|
8985
8682
|
recommendations_layout_options_: (0, $57o7A$solidjs.createMemo)(()=>{
|
|
8986
|
-
const { extra_depict_options: extra_depict_options
|
|
8683
|
+
const { extra_depict_options: extra_depict_options } = props;
|
|
8987
8684
|
return extra_depict_options?.recommendations_cols_at_size ? {
|
|
8988
8685
|
cols_at_size: (0, $4e04be41243c3d80$export$6daf8749b65a1b77)(extra_depict_options.recommendations_cols_at_size),
|
|
8989
8686
|
...grid_spacing_override()
|
|
@@ -8994,7 +8691,7 @@ function $2c61e4cd8229c49a$export$f2dc7e4e4aa11abb(props) {
|
|
|
8994
8691
|
}, "Entire SearchPage failed");
|
|
8995
8692
|
}
|
|
8996
8693
|
function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
8997
|
-
const { depict_search: depict_search
|
|
8694
|
+
const { depict_search: depict_search, modal_dispose_handler: modal_dispose_handler, click_handler: click_handler } = props;
|
|
8998
8695
|
const shared_properties = $2c61e4cd8229c49a$var$get_shared_properties(depict_search);
|
|
8999
8696
|
return (0, $95837413165cc2df$export$23fca46f3143581f)(()=>{
|
|
9000
8697
|
let input_element;
|
|
@@ -9023,7 +8720,7 @@ function $2c61e4cd8229c49a$export$316f6f283ae64765(props) {
|
|
|
9023
8720
|
input_element.selectionStart,
|
|
9024
8721
|
input_element.selectionEnd
|
|
9025
8722
|
];
|
|
9026
|
-
const { cleanup: cleanup
|
|
8723
|
+
const { cleanup: cleanup } = $2c61e4cd8229c49a$var$align_field_modal(style_props_, search_field, ()=>props.aligner_ref);
|
|
9027
8724
|
const complete_modal_dispose_handler = ()=>{
|
|
9028
8725
|
modal_dispose_handler?.();
|
|
9029
8726
|
cleanup();
|
|
@@ -9059,7 +8756,7 @@ function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_re
|
|
|
9059
8756
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, input);
|
|
9060
8757
|
return;
|
|
9061
8758
|
}
|
|
9062
|
-
const { cleanup: cleanup
|
|
8759
|
+
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(aligner_ref);
|
|
9063
8760
|
(0, $57o7A$solidjs.onCleanup)(cleanup);
|
|
9064
8761
|
(0, $fd463ff0edb29915$export$b3ad617e9036868)(style_props_, aligner_ref, undefined, false, "top");
|
|
9065
8762
|
});
|
|
@@ -9075,7 +8772,7 @@ function $2c61e4cd8229c49a$var$align_field_modal(style_props_, input, aligner_re
|
|
|
9075
8772
|
|
|
9076
8773
|
|
|
9077
8774
|
const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
9078
|
-
const { search: search
|
|
8775
|
+
const { search: search, makesNewSearch: makesNewSearch = true } = openModalParams;
|
|
9079
8776
|
openModalParams.location ||= "centered";
|
|
9080
8777
|
if (openModalParams.location === "aligned" && !openModalParams.element) throw new Error("No active search header aligner on the page!");
|
|
9081
8778
|
if (openModalParams.location !== "aligned") {
|
|
@@ -9097,7 +8794,7 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
|
9097
8794
|
];
|
|
9098
8795
|
return;
|
|
9099
8796
|
}
|
|
9100
|
-
const { cleanup: cleanup
|
|
8797
|
+
const { cleanup: cleanup } = (0, $d8e94ea381ab57fa$export$828dcdd425fd3231)(openModalParams.element);
|
|
9101
8798
|
let dispose_aligner;
|
|
9102
8799
|
/**
|
|
9103
8800
|
* Setting position to fixed is important to make the modal work with align_field.
|
|
@@ -9129,8 +8826,8 @@ const $9c143d25df1fc2a2$export$d86a33413558014e = (openModalParams)=>{
|
|
|
9129
8826
|
|
|
9130
8827
|
function $5ab706c0a6d61264$export$d0596b5cae35ad4(open_search) {
|
|
9131
8828
|
const handler = (0, $57o7A$depictaiutilishared.catchify)((e)=>{
|
|
9132
|
-
const { key: key
|
|
9133
|
-
const { body: body
|
|
8829
|
+
const { key: key, target: target } = e;
|
|
8830
|
+
const { body: body } = document;
|
|
9134
8831
|
if (key === "/" && (target === body || !body.contains(target))) {
|
|
9135
8832
|
open_search();
|
|
9136
8833
|
e.preventDefault();
|
|
@@ -9158,7 +8855,7 @@ function $08e7f10b1831645f$export$689e204eadb33baf(pr) {
|
|
|
9158
8855
|
let resolve_remove_added_listeners;
|
|
9159
8856
|
pr.addEventListener("open", (0, $57o7A$depictaiutilishared.catchify)(()=>{
|
|
9160
8857
|
remove_added_listeners = new Promise((r)=>resolve_remove_added_listeners = r);
|
|
9161
|
-
disconnect_link_observer = (0, $57o7A$depictaiutilishared.observer).onexists("a", async ({ element: element
|
|
8858
|
+
disconnect_link_observer = (0, $57o7A$depictaiutilishared.observer).onexists("a", async ({ element: element })=>{
|
|
9162
8859
|
element.addEventListener("click", link_handler);
|
|
9163
8860
|
await remove_added_listeners;
|
|
9164
8861
|
element.removeEventListener("click", link_handler);
|
|
@@ -9256,13 +8953,13 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9256
8953
|
try_forever: true
|
|
9257
8954
|
});
|
|
9258
8955
|
const first_element_found = new Promise((r)=>{
|
|
9259
|
-
this.#disconnect_observer = (0, $57o7A$depictaiutilishared.observer).onexists(this.selector_, ({ element: element
|
|
8956
|
+
this.#disconnect_observer = (0, $57o7A$depictaiutilishared.observer).onexists(this.selector_, ({ element: element, disconnector: disconnector })=>{
|
|
9260
8957
|
r();
|
|
9261
8958
|
if (this.append_instead_of_replace_) {
|
|
9262
8959
|
disconnector();
|
|
9263
8960
|
return;
|
|
9264
8961
|
}
|
|
9265
|
-
const { style: style
|
|
8962
|
+
const { style: style } = element;
|
|
9266
8963
|
const old_display_value = style.display;
|
|
9267
8964
|
style.setProperty("display", "none", "important");
|
|
9268
8965
|
this.#revert_fns.push(()=>{
|
|
@@ -9271,7 +8968,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9271
8968
|
});
|
|
9272
8969
|
});
|
|
9273
8970
|
await first_element_found;
|
|
9274
|
-
const { title: title
|
|
8971
|
+
const { title: title } = document;
|
|
9275
8972
|
if (this.title_) {
|
|
9276
8973
|
document.title = this.title_;
|
|
9277
8974
|
this.#revert_fns.push(()=>document.title = title);
|
|
@@ -9319,7 +9016,7 @@ class $0a6acf31d1eae57c$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
9319
9016
|
this.#unload();
|
|
9320
9017
|
this.#stop_listening?.();
|
|
9321
9018
|
}
|
|
9322
|
-
constructor({ is_spa_: is_spa_
|
|
9019
|
+
constructor({ is_spa_: is_spa_, ...options }){
|
|
9323
9020
|
super();
|
|
9324
9021
|
Object.assign(this, options);
|
|
9325
9022
|
this.#listen().catch((e)=>(0, $57o7A$depictaiutilishared.report)([
|