@depict-ai/ui 0.0.79 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -9
- package/dist/main.js +270 -216
- package/dist/module.js +273 -219
- package/package.json +12 -5
package/dist/main.js
CHANGED
|
@@ -31,11 +31,11 @@ $parcel$export(module.exports, "DepictAPI", () => $9ce64f69303c371e$export$e015e
|
|
|
31
31
|
$parcel$export(module.exports, "media_query_to_accessor", () => $beec9d22e42ed2cf$export$d9f36cf74e24d595);
|
|
32
32
|
$parcel$export(module.exports, "setup_fast_leave", () => $d589470b68ce5b67$export$689e204eadb33baf);
|
|
33
33
|
$parcel$export(module.exports, "show_toast", () => $b3e6a0e9382bf87e$export$5196e4c01fa56fcb);
|
|
34
|
-
$parcel$export(module.exports, "
|
|
34
|
+
$parcel$export(module.exports, "SolidFormatPrice", () => $5fc9fc23df1591db$export$a71e92cfbb498adc);
|
|
35
35
|
$parcel$export(module.exports, "connect_search_field_height_to_aligner_height", () => $246e3e89a097f014$export$828dcdd425fd3231);
|
|
36
36
|
$parcel$export(module.exports, "PageReplacer", () => $37e96a5ebc768cc7$export$3ccaa27d81dd8556);
|
|
37
37
|
$parcel$export(module.exports, "version", () => $ae93561d5649a847$export$83d89fbfd8236492);
|
|
38
|
-
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.
|
|
38
|
+
/*! Depict.ai search and product listing SDK */ const $ae93561d5649a847$export$83d89fbfd8236492 = "0.0.80";
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -57,25 +57,28 @@ async function $8c4e48a4bf96b284$export$58e808b1db15d3bc({ merchant: merchant ,
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
function $1ee6da2465098194$export$e183a13865960371(params_to_default_value) {
|
|
60
|
+
function $1ee6da2465098194$export$e183a13865960371(params_to_default_value, router_) {
|
|
61
61
|
const signals = {};
|
|
62
62
|
const entries = Object.entries(params_to_default_value);
|
|
63
63
|
const event_handler = (0, $46MJV$depictaiutilishared.catchify)(({ state: state })=>$1ee6da2465098194$var$history_state_change(signals, entries, state));
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
65
|
+
(0, $46MJV$solidjs.createRenderEffect)(()=>{
|
|
66
|
+
let signal_changed = false;
|
|
67
|
+
let { state: state } = history; // cloning isn't necessary because we're calling replaceState on it anyway
|
|
68
|
+
if (state === null || typeof state != "object") state = {};
|
|
69
|
+
for (const [param, default_value] of entries){
|
|
70
|
+
const [read_signal] = signals[param] ||= (0, $46MJV$solidjs.createSignal)(state[param] ?? default_value);
|
|
67
71
|
const new_value = read_signal();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (state === null || typeof state != "object") state = {};
|
|
72
|
+
if (new_value !== state[param]) {
|
|
73
|
+
signal_changed = true;
|
|
71
74
|
state[param] = new_value;
|
|
72
|
-
history.replaceState(state, "", location.href);
|
|
73
75
|
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
+
}
|
|
77
|
+
if (signal_changed) router_.navigate_.replace_state_(state);
|
|
78
|
+
});
|
|
76
79
|
window.addEventListener("popstate", event_handler);
|
|
77
80
|
(0, $46MJV$solidjs.onCleanup)((0, $46MJV$depictaiutilishared.catchify)(()=>window.removeEventListener("popstate", event_handler)));
|
|
78
|
-
(0, $46MJV$solidjs.createEffect)((0, $46MJV$depictaiutilishared.catchify)(()=>(0, $46MJV$solidjs.untrack)((0, $46MJV$depictaiutilishared.catchify)(()=>$1ee6da2465098194$var$history_state_change(signals, entries, history.state))))); // we need this to run after the
|
|
81
|
+
(0, $46MJV$solidjs.createEffect)((0, $46MJV$depictaiutilishared.catchify)(()=>(0, $46MJV$solidjs.untrack)((0, $46MJV$depictaiutilishared.catchify)(()=>$1ee6da2465098194$var$history_state_change(signals, entries, history.state))))); // we need this to run after reading the initial state from history.state to write the defaults to history.state
|
|
79
82
|
return signals;
|
|
80
83
|
}
|
|
81
84
|
function $1ee6da2465098194$var$history_state_change(signals, entries, state) {
|
|
@@ -89,8 +92,8 @@ function $1ee6da2465098194$var$history_state_change(signals, entries, state) {
|
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
|
|
92
|
-
function $0de081f67b6d15b5$export$9862539c89138352(get_default_values_) {
|
|
93
|
-
const state = (0, $1ee6da2465098194$export$e183a13865960371)(get_default_values_());
|
|
95
|
+
function $0de081f67b6d15b5$export$9862539c89138352(get_default_values_, router_) {
|
|
96
|
+
const state = (0, $1ee6da2465098194$export$e183a13865960371)(get_default_values_(), router_);
|
|
94
97
|
const reset_state = ()=>{
|
|
95
98
|
const new_defaults = get_default_values_();
|
|
96
99
|
for(const key in state){
|
|
@@ -315,8 +318,12 @@ function $891da49c419865de$export$92f2da32c6e7e7ee({ search_results_: search_res
|
|
|
315
318
|
|
|
316
319
|
|
|
317
320
|
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
|
|
322
|
+
function $5fc9fc23df1591db$export$a71e92cfbb498adc(props) {
|
|
323
|
+
return (0, $46MJV$solidjs.createMemo)(()=>{
|
|
324
|
+
const price_formatting = props.price_formatting_;
|
|
325
|
+
return (0, $46MJV$depictaiutilishared.standard_price_format)(props.price_, price_formatting.places_after_comma_, price_formatting.decimal_places_delimiter_, price_formatting.thousands_delimiter_);
|
|
326
|
+
});
|
|
320
327
|
}
|
|
321
328
|
|
|
322
329
|
|
|
@@ -423,19 +430,27 @@ function $08fa9d20f7ec85af$export$83fd5de5504a7a67({ formatted_number_of_results
|
|
|
423
430
|
}));
|
|
424
431
|
});
|
|
425
432
|
return (()=>{
|
|
426
|
-
const _el$ = $08fa9d20f7ec85af$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$
|
|
433
|
+
const _el$ = $08fa9d20f7ec85af$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$7 = _el$4.nextSibling, _el$8 = _el$7.nextSibling, _el$11 = _el$8.nextSibling, _el$9 = _el$11.nextSibling, _el$10 = _el$9.nextSibling;
|
|
427
434
|
const _ref$ = element;
|
|
428
435
|
typeof _ref$ === "function" ? (0, $46MJV$solidjsweb.use)(_ref$, _el$) : element = _el$;
|
|
429
|
-
(0, $46MJV$solidjsweb.insert)(_el$3, (0, $5fc9fc23df1591db$export$
|
|
430
|
-
price_
|
|
431
|
-
|
|
436
|
+
(0, $46MJV$solidjsweb.insert)(_el$3, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
437
|
+
get price_ () {
|
|
438
|
+
return first_to_show();
|
|
439
|
+
},
|
|
440
|
+
get price_formatting_ () {
|
|
441
|
+
return modified_price_formatting_();
|
|
442
|
+
}
|
|
432
443
|
}));
|
|
433
|
-
(0, $46MJV$solidjsweb.insert)(_el$
|
|
434
|
-
price_
|
|
435
|
-
|
|
444
|
+
(0, $46MJV$solidjsweb.insert)(_el$7, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
445
|
+
get price_ () {
|
|
446
|
+
return last_to_show();
|
|
447
|
+
},
|
|
448
|
+
get price_formatting_ () {
|
|
449
|
+
return modified_price_formatting_();
|
|
450
|
+
}
|
|
436
451
|
}));
|
|
437
|
-
(0, $46MJV$solidjsweb.insert)(_el$2, of_, _el$
|
|
438
|
-
(0, $46MJV$solidjsweb.insert)(_el$
|
|
452
|
+
(0, $46MJV$solidjsweb.insert)(_el$2, of_, _el$11);
|
|
453
|
+
(0, $46MJV$solidjsweb.insert)(_el$10, count_to_show);
|
|
439
454
|
return _el$;
|
|
440
455
|
})();
|
|
441
456
|
}
|
|
@@ -710,7 +725,8 @@ function $92e4e7906daa1ff8$export$8895d39404bd2bb1(props) {
|
|
|
710
725
|
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;
|
|
711
726
|
const previous_selected_filters = (0, $46MJV$solidjs.untrack)(get_selected_filters);
|
|
712
727
|
if (!previous_selected_filters.length) {
|
|
713
|
-
// no filters selected,
|
|
728
|
+
// no filters selected, still clear sorting if applicable but don't display a toast for that since it's very minor
|
|
729
|
+
if (also_clear_sorting_) props.current_sorting_[1]();
|
|
714
730
|
if (delay_toast_) return ()=>{};
|
|
715
731
|
return;
|
|
716
732
|
}
|
|
@@ -1381,16 +1397,24 @@ function $c130252ae1aed6e2$export$fecbb157621501bd({ number_of_rendered_selected
|
|
|
1381
1397
|
};
|
|
1382
1398
|
(0, $46MJV$solidjsweb.insert)(_el$5, (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$depictaiutilishared.CrossIcon), {}), _el$6);
|
|
1383
1399
|
(0, $46MJV$solidjsweb.insert)(_el$6, ()=>price_formatting_().pre_, _el$7);
|
|
1384
|
-
(0, $46MJV$solidjsweb.insert)(_el$6, ()
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}
|
|
1400
|
+
(0, $46MJV$solidjsweb.insert)(_el$6, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
1401
|
+
get price_ () {
|
|
1402
|
+
return filter().data[0];
|
|
1403
|
+
},
|
|
1404
|
+
get price_formatting_ () {
|
|
1405
|
+
return price_formatting_();
|
|
1406
|
+
}
|
|
1407
|
+
}), _el$7);
|
|
1388
1408
|
(0, $46MJV$solidjsweb.insert)(_el$6, ()=>price_formatting_().post_, _el$7);
|
|
1389
1409
|
(0, $46MJV$solidjsweb.insert)(_el$6, ()=>price_formatting_().pre_, null);
|
|
1390
|
-
(0, $46MJV$solidjsweb.insert)(_el$6, ()
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
}
|
|
1410
|
+
(0, $46MJV$solidjsweb.insert)(_el$6, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
1411
|
+
get price_ () {
|
|
1412
|
+
return filter().data[1];
|
|
1413
|
+
},
|
|
1414
|
+
get price_formatting_ () {
|
|
1415
|
+
return price_formatting_();
|
|
1416
|
+
}
|
|
1417
|
+
}), null);
|
|
1394
1418
|
(0, $46MJV$solidjsweb.insert)(_el$6, ()=>price_formatting_().post_, null);
|
|
1395
1419
|
return _el$5;
|
|
1396
1420
|
})();
|
|
@@ -1961,16 +1985,24 @@ function $6833018d8bbbb2ad$var$RangeSelector({ max_: max_ , min_: min_ , current
|
|
|
1961
1985
|
i18n_: i18n_
|
|
1962
1986
|
}), _el$8);
|
|
1963
1987
|
(0, $46MJV$solidjsweb.insert)(_el$9, pre_price, null);
|
|
1964
|
-
(0, $46MJV$solidjsweb.insert)(_el$9, ()
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1988
|
+
(0, $46MJV$solidjsweb.insert)(_el$9, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
1989
|
+
get price_ () {
|
|
1990
|
+
return min_();
|
|
1991
|
+
},
|
|
1992
|
+
get price_formatting_ () {
|
|
1993
|
+
return price_formatting_();
|
|
1994
|
+
}
|
|
1995
|
+
}), null);
|
|
1968
1996
|
(0, $46MJV$solidjsweb.insert)(_el$9, post_price, null);
|
|
1969
1997
|
(0, $46MJV$solidjsweb.insert)(_el$10, pre_price, null);
|
|
1970
|
-
(0, $46MJV$solidjsweb.insert)(_el$10, ()
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
}
|
|
1998
|
+
(0, $46MJV$solidjsweb.insert)(_el$10, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
1999
|
+
get price_ () {
|
|
2000
|
+
return max_();
|
|
2001
|
+
},
|
|
2002
|
+
get price_formatting_ () {
|
|
2003
|
+
return price_formatting_();
|
|
2004
|
+
}
|
|
2005
|
+
}), null);
|
|
1974
2006
|
(0, $46MJV$solidjsweb.insert)(_el$10, post_price, null);
|
|
1975
2007
|
(0, $46MJV$solidjsweb.effect)((_p$)=>{
|
|
1976
2008
|
const _v$ = i18n_.range_filter_low_point_aria_label_(), _v$2 = min_(), _v$3 = max_(), _v$4 = i18n_.range_filter_high_point_aria_label_(), _v$5 = min_(), _v$6 = max_();
|
|
@@ -2875,48 +2907,57 @@ var $6865c7388a79e957$export$2e2bcd8739ae039 = {
|
|
|
2875
2907
|
const $8578879ddb04f368$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<span class="show-selected" aria-hidden="true"><span></span></span>`, 4);
|
|
2876
2908
|
function $8578879ddb04f368$export$53c59af873b303c9({ selected_filters_in_group_: selected_filters_in_group_ , i18n_: { price_formatting_: price_formatting_ } }) {
|
|
2877
2909
|
const [show_tick_icon, set_show_tick_icon] = (0, $46MJV$solidjs.createSignal)(false);
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().post_),
|
|
2896
|
-
" – ",
|
|
2897
|
-
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().pre_),
|
|
2898
|
-
(0, $46MJV$solidjsweb.memo)(()=>(0, $5fc9fc23df1591db$export$469c7af753d08925)({
|
|
2899
|
-
price_: (0, $46MJV$solidjs.createMemo)(()=>selected_filter.data[1]),
|
|
2900
|
-
price_formatting_: price_formatting_
|
|
2901
|
-
})),
|
|
2902
|
-
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().post_)
|
|
2903
|
-
];
|
|
2904
|
-
else {
|
|
2905
|
-
const { data: data } = selected_filter;
|
|
2906
|
-
const data_is_array = Array.isArray(data);
|
|
2907
|
-
if (data_is_array && data.length !== 1) {
|
|
2908
|
-
size = data.length;
|
|
2909
|
-
break try_specific;
|
|
2910
|
-
}
|
|
2911
|
-
const needle = data_is_array ? data[0] : data;
|
|
2912
|
-
const index_in_meta = meta.values.findIndex((value)=>needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index)=>needle[index] === item));
|
|
2913
|
-
return meta.names?.[index_in_meta] || meta.values?.[index_in_meta];
|
|
2910
|
+
const text = (0, $46MJV$solidjs.createMemo)(()=>(0, $46MJV$solidjs.batch)(()=>{
|
|
2911
|
+
set_show_tick_icon(false);
|
|
2912
|
+
let { size: size } = selected_filters_in_group_();
|
|
2913
|
+
try_specific: {
|
|
2914
|
+
if (size > 1) break try_specific;
|
|
2915
|
+
for (const [selected_filter, filter_data] of selected_filters_in_group_()){
|
|
2916
|
+
// we're intentionally not looping in this statement since we always just want to show the first thing in the filter group
|
|
2917
|
+
const { meta: meta } = filter_data;
|
|
2918
|
+
const { type: type } = meta;
|
|
2919
|
+
if (type === "range") return [
|
|
2920
|
+
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().pre_),
|
|
2921
|
+
(0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
2922
|
+
get price_ () {
|
|
2923
|
+
return selected_filter.data[0];
|
|
2924
|
+
},
|
|
2925
|
+
get price_formatting_ () {
|
|
2926
|
+
return price_formatting_();
|
|
2914
2927
|
}
|
|
2928
|
+
}),
|
|
2929
|
+
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().post_),
|
|
2930
|
+
" – ",
|
|
2931
|
+
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().pre_),
|
|
2932
|
+
(0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
2933
|
+
get price_ () {
|
|
2934
|
+
return selected_filter.data[1];
|
|
2935
|
+
},
|
|
2936
|
+
get price_formatting_ () {
|
|
2937
|
+
return price_formatting_();
|
|
2938
|
+
}
|
|
2939
|
+
}),
|
|
2940
|
+
(0, $46MJV$solidjsweb.memo)(()=>price_formatting_().post_)
|
|
2941
|
+
];
|
|
2942
|
+
else {
|
|
2943
|
+
const { data: data } = selected_filter;
|
|
2944
|
+
const data_is_array = Array.isArray(data);
|
|
2945
|
+
if (data_is_array && data.length !== 1) {
|
|
2946
|
+
size = data.length;
|
|
2947
|
+
break try_specific;
|
|
2915
2948
|
}
|
|
2949
|
+
const needle = data_is_array ? data[0] : data;
|
|
2950
|
+
const index_in_meta = meta.values.findIndex((value)=>needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index)=>needle[index] === item));
|
|
2951
|
+
return meta.names?.[index_in_meta] || meta.values?.[index_in_meta];
|
|
2916
2952
|
}
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2953
|
+
}
|
|
2954
|
+
}
|
|
2955
|
+
set_show_tick_icon(true);
|
|
2956
|
+
return size + "";
|
|
2957
|
+
}));
|
|
2958
|
+
return (()=>{
|
|
2959
|
+
const _el$ = $8578879ddb04f368$var$_tmpl$.cloneNode(true), _el$2 = _el$.firstChild;
|
|
2960
|
+
(0, $46MJV$solidjsweb.insert)(_el$2, text);
|
|
2920
2961
|
(0, $46MJV$solidjsweb.insert)(_el$, (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$solidjs.Show), {
|
|
2921
2962
|
get when () {
|
|
2922
2963
|
return show_tick_icon();
|
|
@@ -2982,6 +3023,7 @@ function $5804fd6cbfb7160f$export$ab34afce88557c0e(props) {
|
|
|
2982
3023
|
|
|
2983
3024
|
|
|
2984
3025
|
|
|
3026
|
+
|
|
2985
3027
|
const $1587765bd31f3722$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filter-collapsible"></div>`, 2), $1587765bd31f3722$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<button class="clear-group"><span></span></button>`, 4), $1587765bd31f3722$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="view-more-clear"></div>`, 2), $1587765bd31f3722$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filter-collapsible-body"><div class="filter-part"></div></div>`, 4), $1587765bd31f3722$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<details class="filter-collapsible"></details>`, 2), $1587765bd31f3722$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<summary class="filter-group-summary"><div class="summary"><span></span><div class="selected-w-sign"></div></div></summary>`, 8), $1587765bd31f3722$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="ungrouped"></div>`, 2), $1587765bd31f3722$var$_tmpl$8 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<button class="clear-all-filters major"></button>`, 2);
|
|
2986
3028
|
function $1587765bd31f3722$export$3f1a388cc0d8fed7(props) {
|
|
2987
3029
|
// Split like this to make placeholder wrapping more visible & this component is exported and used in MobileModal
|
|
@@ -3093,13 +3135,22 @@ function $1587765bd31f3722$var$ActualFilterBody(props) {
|
|
|
3093
3135
|
return "Filter group " + JSON.stringify(section_) + " failed";
|
|
3094
3136
|
},
|
|
3095
3137
|
get children () {
|
|
3096
|
-
return (0, $46MJV$
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3138
|
+
return (0, $46MJV$solidjsweb.createComponent)((0, $46MJV$solidjsweb.Dynamic), {
|
|
3139
|
+
get component () {
|
|
3140
|
+
return (0, $6865c7388a79e957$export$2e2bcd8739ae039)[filter()?.meta?.type];
|
|
3141
|
+
},
|
|
3142
|
+
filter_: filter,
|
|
3143
|
+
get expanded_hierarchical_filters_ () {
|
|
3144
|
+
return props.expanded_hierarchical_filters_;
|
|
3145
|
+
},
|
|
3146
|
+
get selected_filters_ () {
|
|
3147
|
+
return props.selected_filters_;
|
|
3148
|
+
},
|
|
3149
|
+
get i18n_ () {
|
|
3150
|
+
return props.i18n_;
|
|
3151
|
+
},
|
|
3152
|
+
view_more_button_below_group_: view_more_button_below_group
|
|
3153
|
+
});
|
|
3103
3154
|
}
|
|
3104
3155
|
})
|
|
3105
3156
|
}));
|
|
@@ -3155,19 +3206,27 @@ function $1587765bd31f3722$var$ActualFilterBody(props) {
|
|
|
3155
3206
|
get each () {
|
|
3156
3207
|
return untogglable_filters();
|
|
3157
3208
|
},
|
|
3158
|
-
children: (filter)
|
|
3159
|
-
{
|
|
3209
|
+
children: (filter)=>{
|
|
3160
3210
|
const view_more_button_below_group = (0, $46MJV$solidjs.createSignal)();
|
|
3161
|
-
const
|
|
3211
|
+
const [get_view_more_button_below_group] = view_more_button_below_group;
|
|
3212
|
+
return [
|
|
3213
|
+
(0, $46MJV$solidjsweb.createComponent)((0, $46MJV$solidjsweb.Dynamic), {
|
|
3214
|
+
get component () {
|
|
3215
|
+
return (0, $6865c7388a79e957$export$2e2bcd8739ae039)[filter()?.meta?.type];
|
|
3216
|
+
},
|
|
3162
3217
|
filter_: filter,
|
|
3163
|
-
expanded_hierarchical_filters_
|
|
3164
|
-
|
|
3165
|
-
|
|
3218
|
+
get expanded_hierarchical_filters_ () {
|
|
3219
|
+
return props.expanded_hierarchical_filters_;
|
|
3220
|
+
},
|
|
3221
|
+
get selected_filters_ () {
|
|
3222
|
+
return props.selected_filters_;
|
|
3223
|
+
},
|
|
3224
|
+
get i18n_ () {
|
|
3225
|
+
return props.i18n_;
|
|
3226
|
+
},
|
|
3166
3227
|
view_more_button_below_group_: view_more_button_below_group
|
|
3167
|
-
})
|
|
3168
|
-
|
|
3169
|
-
filter_element_memo,
|
|
3170
|
-
view_more_button_below_group[0]
|
|
3228
|
+
}),
|
|
3229
|
+
(0, $46MJV$solidjsweb.memo)(get_view_more_button_below_group)
|
|
3171
3230
|
];
|
|
3172
3231
|
}
|
|
3173
3232
|
}));
|
|
@@ -3775,6 +3834,7 @@ function $0bc45cf6753f874a$export$b288c38ae3fddb56({ available_filters_: availab
|
|
|
3775
3834
|
|
|
3776
3835
|
const $881cb1745bafff7a$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filters"><div class="body"></div></div>`, 4), $881cb1745bafff7a$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="sorting"><div class="body"></div></div>`, 4), $881cb1745bafff7a$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="sort-and-filter-buttons"><div class="outer"><div class="inner"></div></div></div>`, 6), $881cb1745bafff7a$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<span class="num-filters"></span>`, 2), $881cb1745bafff7a$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="open-filters-button-container"><button class="filter toggle-button major-minor-transition" type="button"><span></span></button></div>`, 6), $881cb1745bafff7a$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<button class="toggle-button for-sorting major-minor-transition"><span></span></button>`, 4);
|
|
3777
3836
|
function $881cb1745bafff7a$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_ }) {
|
|
3837
|
+
// @ts-ignore
|
|
3778
3838
|
return (0, $0f2f58dd60b11888$export$b69d0d92862de18b)({
|
|
3779
3839
|
severity_: "error",
|
|
3780
3840
|
message_: "Sorting and filters failed",
|
|
@@ -5172,6 +5232,7 @@ function $623202ae203e9e59$export$f091cbac892643a4(obj) {
|
|
|
5172
5232
|
|
|
5173
5233
|
function $f27b0b326e0a87e2$export$23fca46f3143581f(component, error_message) {
|
|
5174
5234
|
const component_in_error_boundary = (do_with_elements)=>{
|
|
5235
|
+
// @ts-ignore
|
|
5175
5236
|
return (0, $0f2f58dd60b11888$export$b69d0d92862de18b)({
|
|
5176
5237
|
severity_: "error",
|
|
5177
5238
|
message_: error_message,
|
|
@@ -5198,13 +5259,16 @@ function $f27b0b326e0a87e2$export$23fca46f3143581f(component, error_message) {
|
|
|
5198
5259
|
|
|
5199
5260
|
|
|
5200
5261
|
|
|
5201
|
-
function $
|
|
5262
|
+
function $cb699e435fadd254$export$477caf01aecaeb2a({ search_query_url_param_name_: search_query_url_param_name_ , router_: router_ }) {
|
|
5263
|
+
const search_query_ = search_query_url_param_name_ ? (0, $46MJV$solidjs.createSignal)("") : undefined;
|
|
5264
|
+
const get_search_query_ = search_query_?.[0];
|
|
5265
|
+
const set_search_query = search_query_?.[1];
|
|
5202
5266
|
const current_sorting_ = (0, $46MJV$solidjs.createSignal)();
|
|
5203
5267
|
const selected_filters_ = (0, $46MJV$solidjs.createSignal)([]);
|
|
5204
|
-
const [
|
|
5205
|
-
const [
|
|
5268
|
+
const [get_sorting_, set_sorting] = current_sorting_;
|
|
5269
|
+
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
5206
5270
|
const [get_current_href, set_current_href] = (0, $46MJV$solidjs.createSignal)(location.href);
|
|
5207
|
-
const history_change_handler = ()=>set_current_href(location.href);
|
|
5271
|
+
const history_change_handler = (0, $46MJV$depictaiutilishared.catchify)(()=>set_current_href(location.href));
|
|
5208
5272
|
const owner = (0, $46MJV$solidjs.getOwner)() || (0, $46MJV$solidjs.createRoot)(()=>(0, $46MJV$solidjs.getOwner)());
|
|
5209
5273
|
let writer_started = false;
|
|
5210
5274
|
(0, $46MJV$depictaiutilishared.instant_exec_on_suspect_history_change).add(history_change_handler);
|
|
@@ -5214,12 +5278,12 @@ function $004640621ca953d0$export$7bcff1eb3eca57d7(router) {
|
|
|
5214
5278
|
(0, $46MJV$solidjs.batch)(()=>{
|
|
5215
5279
|
const found_sorting = (0, $c6a04c153e9853a7$export$766e9676e74997d3)(searchParams);
|
|
5216
5280
|
if (found_sorting) {
|
|
5217
|
-
const current_sorting = (0, $46MJV$solidjs.untrack)(
|
|
5281
|
+
const current_sorting = (0, $46MJV$solidjs.untrack)(get_sorting_);
|
|
5218
5282
|
// Do some diffing since we might assume in certain places of the code that if the signal changes it means the sorting has changed
|
|
5219
5283
|
if (current_sorting?.field !== found_sorting.field || current_sorting?.order !== found_sorting.order) set_sorting(found_sorting);
|
|
5220
5284
|
} else set_sorting();
|
|
5221
5285
|
const found_filters = (0, $c6a04c153e9853a7$export$f934fa24c3a86811)(searchParams);
|
|
5222
|
-
const selected_filters = (0, $46MJV$solidjs.untrack)(
|
|
5286
|
+
const selected_filters = (0, $46MJV$solidjs.untrack)(get_selected_filters_);
|
|
5223
5287
|
const found_filters_map = new Map(found_filters.map(({ field: field , op: op , data: data })=>[
|
|
5224
5288
|
JSON.stringify([
|
|
5225
5289
|
field,
|
|
@@ -5232,25 +5296,36 @@ function $004640621ca953d0$export$7bcff1eb3eca57d7(router) {
|
|
|
5232
5296
|
field,
|
|
5233
5297
|
op
|
|
5234
5298
|
]))) === JSON.stringify(data))) set_selected_filters(found_filters);
|
|
5299
|
+
if (search_query_url_param_name_) {
|
|
5300
|
+
const found_query = searchParams.get(search_query_url_param_name_);
|
|
5301
|
+
set_search_query(found_query || "");
|
|
5302
|
+
}
|
|
5235
5303
|
if (!writer_started) {
|
|
5236
5304
|
// The owner here is the createComputed which gets disposed the next time the computation runs - but we actually just want to delay the start of the href_writer until our signals contain the current value of the URL, therefore the runWithOwner
|
|
5237
|
-
(0, $46MJV$solidjs.runWithOwner)(owner, ()=>$
|
|
5305
|
+
(0, $46MJV$solidjs.runWithOwner)(owner, ()=>$cb699e435fadd254$var$start_href_writer({
|
|
5306
|
+
get_sorting_: get_sorting_,
|
|
5307
|
+
get_selected_filters_: get_selected_filters_,
|
|
5308
|
+
router_: router_
|
|
5309
|
+
}));
|
|
5238
5310
|
writer_started = true;
|
|
5239
5311
|
}
|
|
5240
5312
|
});
|
|
5241
5313
|
});
|
|
5314
|
+
// @ts-ignore
|
|
5242
5315
|
return {
|
|
5243
5316
|
current_sorting_: current_sorting_,
|
|
5244
|
-
selected_filters_: selected_filters_
|
|
5317
|
+
selected_filters_: selected_filters_,
|
|
5318
|
+
...typeof search_query_url_param_name_ === "string" ? {
|
|
5319
|
+
search_query_accessor_: get_search_query_
|
|
5320
|
+
} : {}
|
|
5245
5321
|
};
|
|
5246
5322
|
}
|
|
5247
5323
|
/**
|
|
5248
5324
|
* Writes the sorting and filters to the URL query parameters when they change.
|
|
5249
|
-
*/ function $
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
get_selected_filters
|
|
5325
|
+
*/ function $cb699e435fadd254$var$start_href_writer({ get_sorting_: get_sorting_ , get_selected_filters_: get_selected_filters_ , router_: router_ }) {
|
|
5326
|
+
(0, $46MJV$solidjs.createEffect)((0, $46MJV$solidjs.on)([
|
|
5327
|
+
get_sorting_,
|
|
5328
|
+
get_selected_filters_
|
|
5254
5329
|
], ([sorting, filters])=>{
|
|
5255
5330
|
const current_href = location.href;
|
|
5256
5331
|
const url_object = new URL(current_href);
|
|
@@ -5268,7 +5343,7 @@ function $004640621ca953d0$export$7bcff1eb3eca57d7(router) {
|
|
|
5268
5343
|
// Having the array middle step because if we'd check the "size" property of the map the algorithm could be fooled if there were two query parameters with the same key
|
|
5269
5344
|
const new_search_params_map = new Map(new_search_params);
|
|
5270
5345
|
if (unmodified_search_params.length !== new_search_params.length || !unmodified_search_params.every(([key, value])=>new_search_params_map.get(key) === value)) // Only update URL if it actually changed
|
|
5271
|
-
|
|
5346
|
+
router_.navigate_.go_to_({
|
|
5272
5347
|
is_replace_: true,
|
|
5273
5348
|
new_url_: url_object.href,
|
|
5274
5349
|
force_spa_navigation_: true
|
|
@@ -5328,10 +5403,14 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
|
5328
5403
|
* @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
|
|
5329
5404
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5330
5405
|
* @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
|
|
5331
|
-
*/ go_to_: async ({ new_url_:
|
|
5406
|
+
*/ go_to_: (0, $46MJV$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_ })=>{
|
|
5407
|
+
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
5332
5408
|
const wants_hard_navigation = this.on_navigation_ === "hard_navigation";
|
|
5333
5409
|
if (this.#dont_attempt_navigation(event_)) return;
|
|
5334
|
-
|
|
5410
|
+
const different_origin = new_url_.origin !== location.origin;
|
|
5411
|
+
if (wants_hard_navigation && (!force_spa_navigation_ || different_origin)) {
|
|
5412
|
+
if (force_spa_navigation_ && different_origin) // If we call history.pushState on a different origin, it will throw an error, so fallback to hard navigations
|
|
5413
|
+
(0, $46MJV$depictaiutilishared.dwarn)("Can't single page navigate to", new_url_.href, "due to different origin, this MIGHT mean you should fix the URLs");
|
|
5335
5414
|
if (!event_) // If we haven't gotten an event, nothing will happen by not calling prevent default, so we need to change the URL
|
|
5336
5415
|
location.assign(new_url_);
|
|
5337
5416
|
return;
|
|
@@ -5349,7 +5428,7 @@ class $43940d5ca403c293$export$7e1297a3a19f10d8 {
|
|
|
5349
5428
|
new_url: new_url_ instanceof URL ? new_url_ : new URL(new_url_, location.origin)
|
|
5350
5429
|
});
|
|
5351
5430
|
await promise;
|
|
5352
|
-
}
|
|
5431
|
+
})
|
|
5353
5432
|
};
|
|
5354
5433
|
constructor(on_navigation){
|
|
5355
5434
|
this.on_navigation_ = on_navigation;
|
|
@@ -5411,7 +5490,9 @@ class $068a627cc18f7bb6$export$f34314aa9505732e {
|
|
|
5411
5490
|
Object.assign(this, props_on_class); // set initial signal values
|
|
5412
5491
|
(0, $33815c5a406b6cc0$export$5162a71f252e6122)();
|
|
5413
5492
|
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
5414
|
-
const { selected_filters_: selected_filters_ , current_sorting_: current_sorting_ } = (0, $
|
|
5493
|
+
const { selected_filters_: selected_filters_ , current_sorting_: current_sorting_ } = (0, $cb699e435fadd254$export$477caf01aecaeb2a)({
|
|
5494
|
+
router_: this.#router
|
|
5495
|
+
});
|
|
5415
5496
|
const [reset_history_state_, state_] = (0, $0de081f67b6d15b5$export$9862539c89138352)(()=>({
|
|
5416
5497
|
category_filters_open: false,
|
|
5417
5498
|
category_sorting_open: false,
|
|
@@ -5420,7 +5501,7 @@ class $068a627cc18f7bb6$export$f34314aa9505732e {
|
|
|
5420
5501
|
category_local_filter_cache: [],
|
|
5421
5502
|
category_expanded_hierarchical_filters: [],
|
|
5422
5503
|
category_scroll_restoration_data: []
|
|
5423
|
-
}));
|
|
5504
|
+
}), this.#router);
|
|
5424
5505
|
const i18n_ = (0, $623202ae203e9e59$export$f091cbac892643a4)(this.#locale_signal[0]);
|
|
5425
5506
|
$068a627cc18f7bb6$var$privately_shared_properties.set(this, {
|
|
5426
5507
|
state_: state_,
|
|
@@ -6065,7 +6146,7 @@ function $67b60b572b7b7059$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
6065
6146
|
|
|
6066
6147
|
|
|
6067
6148
|
|
|
6068
|
-
function $8b282f736ce4f3b8$export$e026af0c7b64ea5f({ selected_filters_: selected_filters_ ,
|
|
6149
|
+
function $8b282f736ce4f3b8$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_ }) {
|
|
6069
6150
|
const [get_selected_filters] = selected_filters_;
|
|
6070
6151
|
// Possible values:
|
|
6071
6152
|
// 0 - we should not clear next submit
|
|
@@ -6080,7 +6161,7 @@ function $8b282f736ce4f3b8$export$e026af0c7b64ea5f({ selected_filters_: selected
|
|
|
6080
6161
|
}, {
|
|
6081
6162
|
defer: true
|
|
6082
6163
|
}));
|
|
6083
|
-
(0, $46MJV$solidjs.createComputed)((0, $46MJV$solidjs.on)(
|
|
6164
|
+
(0, $46MJV$solidjs.createComputed)((0, $46MJV$solidjs.on)(get_search_query_, (0, $46MJV$depictaiutilishared.catchify)(()=>{
|
|
6084
6165
|
// when a query was submitted, clear filters if clear was pressed before
|
|
6085
6166
|
const clear_value = (0, $46MJV$solidjs.untrack)(get_clear_filters_next_submit);
|
|
6086
6167
|
if (clear_value) {
|
|
@@ -6105,12 +6186,11 @@ function $8b282f736ce4f3b8$export$e026af0c7b64ea5f({ selected_filters_: selected
|
|
|
6105
6186
|
|
|
6106
6187
|
|
|
6107
6188
|
|
|
6108
|
-
function $ad118c2ba257d9b7$export$84bba84a7b837187(
|
|
6189
|
+
function $ad118c2ba257d9b7$export$84bba84a7b837187(read_search_query) {
|
|
6109
6190
|
const ls = localStorage;
|
|
6110
6191
|
const key = "depict_searches";
|
|
6111
6192
|
const previous_searches = (0, $46MJV$solidjs.createSignal)(JSON.parse(ls[key] || "[]"));
|
|
6112
6193
|
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
6113
|
-
const [read_search_query] = search_query;
|
|
6114
6194
|
(0, $46MJV$solidjs.createEffect)((0, $46MJV$depictaiutilishared.catchify)(()=>{
|
|
6115
6195
|
const json_encoded = JSON.stringify(read_previous_searches());
|
|
6116
6196
|
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
@@ -6131,9 +6211,9 @@ function $ad118c2ba257d9b7$export$84bba84a7b837187(search_query) {
|
|
|
6131
6211
|
|
|
6132
6212
|
|
|
6133
6213
|
|
|
6134
|
-
async function $1c323edfb89c9dca$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_ ,
|
|
6214
|
+
async function $1c323edfb89c9dca$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 }) {
|
|
6135
6215
|
const new_search_query = get_new_query();
|
|
6136
|
-
const previous_query = (0, $46MJV$solidjs.untrack)(
|
|
6216
|
+
const previous_query = (0, $46MJV$solidjs.untrack)(get_search_query_);
|
|
6137
6217
|
if (previous_query === new_search_query && new URLSearchParams(location.search).has(search_param_name_)) {
|
|
6138
6218
|
// don't push a history entry / re-search if someone submits a search again
|
|
6139
6219
|
// do close the modal though
|
|
@@ -6157,32 +6237,6 @@ async function $1c323edfb89c9dca$export$e16630ecb9644a1c({ on_submit_with_unchan
|
|
|
6157
6237
|
|
|
6158
6238
|
|
|
6159
6239
|
|
|
6160
|
-
function $690220645373c65e$export$2542ffb77b620b02(params_to_default_value) {
|
|
6161
|
-
// TODO: remove this abstraction, put it in same place as filters
|
|
6162
|
-
// TODO: make it only return an accessor
|
|
6163
|
-
const signals = {};
|
|
6164
|
-
const entries = Object.entries(params_to_default_value);
|
|
6165
|
-
for (const [param, default_value] of entries)signals[param] = (0, $46MJV$solidjs.createSignal)(default_value ?? "");
|
|
6166
|
-
const [exit_iterable, exitable_iterable] = (0, $46MJV$depictaiutilishared.make_asyncIterable_exiter)((0, $46MJV$depictaiutilishared.href_change_ipns));
|
|
6167
|
-
(0, $46MJV$solidjs.onCleanup)((0, $46MJV$depictaiutilishared.catchify)(exit_iterable));
|
|
6168
|
-
(0, $46MJV$depictaiutilishared.catchify)(async ()=>{
|
|
6169
|
-
for await (const href of exitable_iterable){
|
|
6170
|
-
const { searchParams: searchParams } = new URL(href);
|
|
6171
|
-
for (const [param, default_value] of entries){
|
|
6172
|
-
const [_get, set] = signals[param];
|
|
6173
|
-
if (searchParams.has(param)) {
|
|
6174
|
-
const new_val = searchParams.get(param) ?? default_value ?? "";
|
|
6175
|
-
set(new_val);
|
|
6176
|
-
} else set(default_value ?? "");
|
|
6177
|
-
}
|
|
6178
|
-
}
|
|
6179
|
-
})();
|
|
6180
|
-
return signals;
|
|
6181
|
-
}
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
6240
|
|
|
6187
6241
|
|
|
6188
6242
|
|
|
@@ -6280,19 +6334,27 @@ const $1bf0125991f2d39b$export$b05c0ae390cf3e06 = (display_or_variant_container,
|
|
|
6280
6334
|
get children () {
|
|
6281
6335
|
const _el$8 = $1bf0125991f2d39b$var$_tmpl$.cloneNode(true);
|
|
6282
6336
|
(0, $46MJV$solidjsweb.insert)(_el$8, ()=>i18n.price_formatting_().pre_, null);
|
|
6283
|
-
(0, $46MJV$solidjsweb.insert)(_el$8, ()
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
}
|
|
6337
|
+
(0, $46MJV$solidjsweb.insert)(_el$8, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
6338
|
+
get price_ () {
|
|
6339
|
+
return display().original_price;
|
|
6340
|
+
},
|
|
6341
|
+
get price_formatting_ () {
|
|
6342
|
+
return i18n.price_formatting_();
|
|
6343
|
+
}
|
|
6344
|
+
}), null);
|
|
6287
6345
|
(0, $46MJV$solidjsweb.insert)(_el$8, ()=>i18n.price_formatting_().post_, null);
|
|
6288
6346
|
return _el$8;
|
|
6289
6347
|
}
|
|
6290
6348
|
}), _el$9);
|
|
6291
6349
|
(0, $46MJV$solidjsweb.insert)(_el$9, ()=>i18n.price_formatting_().pre_, null);
|
|
6292
|
-
(0, $46MJV$solidjsweb.insert)(_el$9, ()
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
}
|
|
6350
|
+
(0, $46MJV$solidjsweb.insert)(_el$9, (0, $46MJV$solidjsweb.createComponent)((0, $5fc9fc23df1591db$export$a71e92cfbb498adc), {
|
|
6351
|
+
get price_ () {
|
|
6352
|
+
return display().sale_price;
|
|
6353
|
+
},
|
|
6354
|
+
get price_formatting_ () {
|
|
6355
|
+
return i18n.price_formatting_();
|
|
6356
|
+
}
|
|
6357
|
+
}), null);
|
|
6296
6358
|
(0, $46MJV$solidjsweb.insert)(_el$9, ()=>i18n.price_formatting_().post_, null);
|
|
6297
6359
|
(0, $46MJV$solidjsweb.effect)((_p$)=>{
|
|
6298
6360
|
const _v$ = href(), _v$2 = !!is_sale();
|
|
@@ -6678,14 +6740,14 @@ function $5a0afe153acd45d7$export$ba17c5b7e6dda39f({ whole_text_to_display_: who
|
|
|
6678
6740
|
|
|
6679
6741
|
|
|
6680
6742
|
const $aabe56c678fa29ec$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<a class="suggestion"></a>`, 2), $aabe56c678fa29ec$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="search-icon"></div>`, 2), $aabe56c678fa29ec$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<span class="type"></span>`, 2), $aabe56c678fa29ec$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div><span class="value"></span></div>`, 4), $aabe56c678fa29ec$var$_tmpl$5 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<h2 class="text"></h2>`, 2), $aabe56c678fa29ec$var$_tmpl$6 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="suggestion-container query"></div>`, 2), $aabe56c678fa29ec$var$_tmpl$7 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="suggestion-container page"></div>`, 2), $aabe56c678fa29ec$var$_tmpl$8 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="suggestions"></div>`, 2);
|
|
6681
|
-
function $aabe56c678fa29ec$export$e872e2339fb04a7f({ suggestion_memo_: suggestion_memo_ ,
|
|
6743
|
+
function $aabe56c678fa29ec$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_ }) {
|
|
6682
6744
|
const queries_memo = (0, $46MJV$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type , title: title })=>type === (0, $81eea900c72d569b$export$3cf9497e790da491) && !filtered_previous_searches_().includes(title) // don't show the ones we already show from the history
|
|
6683
6745
|
));
|
|
6684
6746
|
const not_queries_memo = (0, $46MJV$solidjs.createMemo)(()=>suggestion_memo_().filter(({ type: type })=>type !== (0, $81eea900c72d569b$export$3cf9497e790da491)));
|
|
6685
6747
|
const render_entry = (input_obj, autocomplete_data_index, index, is_history = false)=>{
|
|
6686
6748
|
const is_query = (0, $46MJV$solidjs.createMemo)(()=>input_obj().type === (0, $81eea900c72d569b$export$3cf9497e790da491));
|
|
6687
6749
|
const href_with_changed_params_accessor = (0, $46MJV$solidjs.createMemo)(()=>is_query() ? (0, $41151dd3f5de2c98$export$91c3b6774e8be0f5)({
|
|
6688
|
-
param_:
|
|
6750
|
+
param_: search_query_url_param_name_,
|
|
6689
6751
|
value_: (0, $46MJV$solidjs.createMemo)(()=>input_obj().title),
|
|
6690
6752
|
url_transformer_: url_transformer_
|
|
6691
6753
|
}) : undefined);
|
|
@@ -7021,7 +7083,7 @@ function $bc74fbd61efdd8a5$var$open_link_on_cmd_pressed(e, href) {
|
|
|
7021
7083
|
|
|
7022
7084
|
|
|
7023
7085
|
const $81eea900c72d569b$export$3cf9497e790da491 = "query";
|
|
7024
|
-
function $81eea900c72d569b$export$2f2b9559550c7bbc({ search_field_value_: search_field_value_ ,
|
|
7086
|
+
function $81eea900c72d569b$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_ }) {
|
|
7025
7087
|
const [searching_for_value, set_searching_for_value] = (0, $46MJV$solidjs.createSignal)();
|
|
7026
7088
|
const [read_search_field_value] = search_field_value_;
|
|
7027
7089
|
const updating_blocked = (0, $46MJV$solidjs.createSignal)(false);
|
|
@@ -7062,7 +7124,7 @@ function $81eea900c72d569b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7062
7124
|
updating_blocked_: updating_blocked,
|
|
7063
7125
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
7064
7126
|
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
7065
|
-
search_query_param_name_:
|
|
7127
|
+
search_query_param_name_: search_query_url_param_name_,
|
|
7066
7128
|
url_transformer_: url_transformer_,
|
|
7067
7129
|
router_: router_
|
|
7068
7130
|
});
|
|
@@ -7077,7 +7139,7 @@ function $81eea900c72d569b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7077
7139
|
get set_unfiltered_previous_searches_ () {
|
|
7078
7140
|
return unfiltered_previous_searches[1];
|
|
7079
7141
|
},
|
|
7080
|
-
search_query_param_name_:
|
|
7142
|
+
search_query_param_name_: search_query_url_param_name_,
|
|
7081
7143
|
text_: previous_searches_text_,
|
|
7082
7144
|
get previous_searches_ () {
|
|
7083
7145
|
return (0, $46MJV$solidjs.createMemo)(()=>filtered_previous_searches().slice(0, 5));
|
|
@@ -7104,7 +7166,7 @@ function $81eea900c72d569b$export$2f2b9559550c7bbc({ search_field_value_: search
|
|
|
7104
7166
|
i18n_: i18n_,
|
|
7105
7167
|
url_transformer_: url_transformer_,
|
|
7106
7168
|
searching_for_value_: searching_for_value,
|
|
7107
|
-
|
|
7169
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7108
7170
|
selected_index_: selected_index_,
|
|
7109
7171
|
suggestion_memo_: read_suggestion_signal,
|
|
7110
7172
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
@@ -7139,13 +7201,13 @@ function $fe1bd893954cc9ca$export$c7e181728ad525f(url) {
|
|
|
7139
7201
|
}
|
|
7140
7202
|
|
|
7141
7203
|
|
|
7142
|
-
function $4ee1f6be4255fde6$export$3340fdd8259bd4fd({ get_search_field_value_: get_search_field_value_ ,
|
|
7204
|
+
function $4ee1f6be4255fde6$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_ }) {
|
|
7143
7205
|
let debounce_timeout;
|
|
7144
7206
|
const stop_timeout = ()=>clearTimeout(debounce_timeout);
|
|
7145
7207
|
const send_to_ga = (0, $46MJV$depictaiutilishared.catchify)(()=>{
|
|
7146
7208
|
const fake_url = new URL(location.href);
|
|
7147
7209
|
const { searchParams: searchParams } = fake_url;
|
|
7148
|
-
searchParams.set(
|
|
7210
|
+
searchParams.set(search_query_url_param_name_, (0, $46MJV$solidjs.untrack)(get_search_field_value_));
|
|
7149
7211
|
searchParams.set("instant_result", "true");
|
|
7150
7212
|
url_transformer_?.(fake_url);
|
|
7151
7213
|
(0, $fe1bd893954cc9ca$export$c7e181728ad525f)(fake_url);
|
|
@@ -7196,7 +7258,7 @@ function $4a976b492943589f$export$f021bdedd3ec901a(props) {
|
|
|
7196
7258
|
|
|
7197
7259
|
|
|
7198
7260
|
const $121d25ca6af2898f$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="discover-more"><button class="major" type="button"></button></div>`, 4), $121d25ca6af2898f$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<b></b>`, 2), $121d25ca6af2898f$var$_tmpl$3 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict-search-modal"><div class="body"><div class="padded"></div></div></div>`, 6), $121d25ca6af2898f$var$_tmpl$4 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict plp search"><div class="depict-search-modal-backdrop"></div></div>`, 4);
|
|
7199
|
-
function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_search_field_value ,
|
|
7261
|
+
function $121d25ca6af2898f$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, $46MJV$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_ }) {
|
|
7200
7262
|
let on_enter_in_search_field_function;
|
|
7201
7263
|
// 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.
|
|
7202
7264
|
// 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
|
|
@@ -7223,7 +7285,7 @@ function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7223
7285
|
equals: false
|
|
7224
7286
|
});
|
|
7225
7287
|
if (disable_scrolling_) (0, $fa41c421eb980e23$export$fe334901e8bebd57)();
|
|
7226
|
-
$121d25ca6af2898f$var$close_modal_when_navigating_away(close_modal_,
|
|
7288
|
+
$121d25ca6af2898f$var$close_modal_when_navigating_away(close_modal_, search_query_url_param_name_);
|
|
7227
7289
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
7228
7290
|
(0, $46MJV$solidjs.onCleanup)((0, $46MJV$depictaiutilishared.catchify)(()=>window.removeEventListener("keydown", close_on_escape_handler)));
|
|
7229
7291
|
const owner = (0, $46MJV$solidjs.getOwner)();
|
|
@@ -7248,8 +7310,8 @@ function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7248
7310
|
(0, $4ee1f6be4255fde6$export$3340fdd8259bd4fd)({
|
|
7249
7311
|
get_search_field_value_: get_search_field_value_,
|
|
7250
7312
|
url_transformer_: url_transformer_,
|
|
7251
|
-
|
|
7252
|
-
get_search_query_:
|
|
7313
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7314
|
+
get_search_query_: get_search_query_
|
|
7253
7315
|
});
|
|
7254
7316
|
const random_classname = (0, $46MJV$depictaiutilishared.make_random_classname)();
|
|
7255
7317
|
const body_style = (0, $46MJV$solidjs.createMemo)(()=>{
|
|
@@ -7266,7 +7328,6 @@ function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7266
7328
|
input_field_ref_: (element)=>set_input_field(element),
|
|
7267
7329
|
override_on_enter_: (e)=>on_enter_in_search_field_function?.(e),
|
|
7268
7330
|
on_back_: close_modal_,
|
|
7269
|
-
search_query_: search_query_,
|
|
7270
7331
|
search_field_value_: search_field_value_,
|
|
7271
7332
|
submit_query_: submit_query_,
|
|
7272
7333
|
clear_filters_: clear_filters_,
|
|
@@ -7298,9 +7359,9 @@ function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7298
7359
|
get previous_searches_text_ () {
|
|
7299
7360
|
return i18n_.previous_searches_text_;
|
|
7300
7361
|
},
|
|
7301
|
-
|
|
7362
|
+
get_search_query_: get_search_query_,
|
|
7302
7363
|
previous_searches_: previous_searches_,
|
|
7303
|
-
|
|
7364
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7304
7365
|
market_: market_,
|
|
7305
7366
|
tenant_: tenant_,
|
|
7306
7367
|
selected_index_: selected_index,
|
|
@@ -7358,7 +7419,7 @@ function $121d25ca6af2898f$export$1c593cbd6f1e10bc({ search_field_value_: props_
|
|
|
7358
7419
|
})()
|
|
7359
7420
|
];
|
|
7360
7421
|
}
|
|
7361
|
-
function $121d25ca6af2898f$var$close_modal_when_navigating_away(close_modal,
|
|
7422
|
+
function $121d25ca6af2898f$var$close_modal_when_navigating_away(close_modal, search_query_url_param_name_) {
|
|
7362
7423
|
const [exit_iterable, exitable_iterable] = (0, $46MJV$depictaiutilishared.make_asyncIterable_exiter)((0, $46MJV$depictaiutilishared.href_change_ipns));
|
|
7363
7424
|
let set_initial_values = false;
|
|
7364
7425
|
let old_pathname;
|
|
@@ -7368,7 +7429,7 @@ function $121d25ca6af2898f$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
7368
7429
|
for await (const href of exitable_iterable){
|
|
7369
7430
|
const u_o = new URL(href);
|
|
7370
7431
|
const new_pathname = u_o.pathname;
|
|
7371
|
-
const new_param_value = u_o.searchParams.get(
|
|
7432
|
+
const new_param_value = u_o.searchParams.get(search_query_url_param_name_);
|
|
7372
7433
|
if (set_initial_values) {
|
|
7373
7434
|
if (new_param_value !== old_param_value || new_pathname !== old_pathname) {
|
|
7374
7435
|
// close modal when pathname or query changes
|
|
@@ -7457,9 +7518,9 @@ function $ea038dec4ee16624$export$c05a196222ba1302({ suggestions_: suggestions_
|
|
|
7457
7518
|
|
|
7458
7519
|
|
|
7459
7520
|
const $297ca03cb5dd5701$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<b></b>`, 2), $297ca03cb5dd5701$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="results-for"></div>`, 2);
|
|
7460
|
-
function $297ca03cb5dd5701$export$9dd50d35b9d94fdf({
|
|
7521
|
+
function $297ca03cb5dd5701$export$9dd50d35b9d94fdf({ get_search_query_: get_search_query_ , i18n_: i18n_ , formatted_number_of_results_: formatted_number_of_results_ }) {
|
|
7461
7522
|
const contents = (0, $46MJV$solidjs.createMemo)((0, $46MJV$depictaiutilishared.catchify)(()=>{
|
|
7462
|
-
const q =
|
|
7523
|
+
const q = get_search_query_();
|
|
7463
7524
|
return i18n_.get_showing_results_for_()((()=>{
|
|
7464
7525
|
const _el$ = $297ca03cb5dd5701$var$_tmpl$.cloneNode(true);
|
|
7465
7526
|
(0, $46MJV$solidjsweb.insert)(_el$, q);
|
|
@@ -7486,7 +7547,7 @@ function $297ca03cb5dd5701$export$9dd50d35b9d94fdf({ search_query_: search_query
|
|
|
7486
7547
|
|
|
7487
7548
|
const $93779a41dce11249$var$_tmpl$ = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="filter-results-for-one-row"></div>`, 2), $93779a41dce11249$var$_tmpl$2 = /*@__PURE__*/ (0, /*@__PURE__*/$46MJV$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"></div></div>`, 4);
|
|
7488
7549
|
function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
7489
|
-
const { depict_api_: depict_api_ , search_field_value_: search_field_value_ ,
|
|
7550
|
+
const { 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_ , slider_arrow_button_: slider_arrow_button_ , make_category_suggestion_card_: make_category_suggestion_card_ , expanded_hierarchical_filters_: expanded_hierarchical_filters_ , clear_filters_on_next_submit_: clear_filters_on_next_submit_ , local_filter_cache_: local_filter_cache_ , include_input_field_: include_input_field_ , tenant_: tenant_ , market_: market_ , showing_recommendation_rows_: showing_recommendation_rows_ , rr_options_: rr_options_ , recommendations_rr_options_: recommendations_rr_options_ = rr_options_ , search_recs_view_more_: search_recs_view_more_ , get_product_id_: get_product_id_ , disable_search_recommendations_: disable_search_recommendations_ , layout_options_: layout_options_ , recommendations_layout_options_: recommendations_layout_options_ = layout_options_ , scroll_restoration_data_: scroll_restoration_data_ } = opts;
|
|
7490
7551
|
const tenant_object_ = new (0, $46MJV$depictaiutilishared.Tenant)({
|
|
7491
7552
|
TENANT: (0, $46MJV$solidjs.untrack)(tenant_),
|
|
7492
7553
|
MARKET: (0, $46MJV$solidjs.untrack)(market_),
|
|
@@ -7494,7 +7555,6 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7494
7555
|
get_product_id: get_product_id_
|
|
7495
7556
|
});
|
|
7496
7557
|
const [get_sorting] = current_sorting_;
|
|
7497
|
-
const [get_search_query] = search_query_;
|
|
7498
7558
|
const all_products_loaded_ = (0, $46MJV$solidjs.createSignal)(false);
|
|
7499
7559
|
const [get_all_products_loaded, set_all_products_loaded] = all_products_loaded_;
|
|
7500
7560
|
const number_of_rendered_selected_filters_items_ = (0, $46MJV$solidjs.createSignal)(0);
|
|
@@ -7510,7 +7570,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7510
7570
|
return {
|
|
7511
7571
|
tenant: tenant_(),
|
|
7512
7572
|
market: market_(),
|
|
7513
|
-
query:
|
|
7573
|
+
query: get_search_query_(),
|
|
7514
7574
|
...f.length ? {
|
|
7515
7575
|
filters: f
|
|
7516
7576
|
} : {},
|
|
@@ -7523,7 +7583,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7523
7583
|
set_all_products_loaded(false);
|
|
7524
7584
|
// only first page of results
|
|
7525
7585
|
return await (0, $151280ad98f4438b$export$cc42dd29bf655ab6)({
|
|
7526
|
-
id_: (0, $46MJV$solidjs.untrack)(
|
|
7586
|
+
id_: (0, $46MJV$solidjs.untrack)(get_search_query_),
|
|
7527
7587
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7528
7588
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7529
7589
|
make_request_: (limit, cursor)=>depict_api_.query({
|
|
@@ -7536,7 +7596,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7536
7596
|
});
|
|
7537
7597
|
}));
|
|
7538
7598
|
const [suggestions] = (0, $46MJV$solidjs.createResource)((0, $46MJV$solidjs.createMemo)(()=>({
|
|
7539
|
-
query:
|
|
7599
|
+
query: get_search_query_(),
|
|
7540
7600
|
tenant: tenant_(),
|
|
7541
7601
|
market: market_()
|
|
7542
7602
|
})), (opts)=>depict_api_.suggest(opts));
|
|
@@ -7553,7 +7613,6 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7553
7613
|
let div_with_field_class;
|
|
7554
7614
|
search_field = SafeSearchField({
|
|
7555
7615
|
i18n_: i18n_,
|
|
7556
|
-
search_query_: search_query_,
|
|
7557
7616
|
search_field_value_: search_field_value_,
|
|
7558
7617
|
submit_query_: submit_query_,
|
|
7559
7618
|
clear_filters_: clear_filters_on_next_submit_,
|
|
@@ -7591,7 +7650,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7591
7650
|
});
|
|
7592
7651
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = (0, $46MJV$solidjs.createSignal)();
|
|
7593
7652
|
const results_for = (0, $46MJV$solidjsweb.createComponent)((0, $297ca03cb5dd5701$export$9dd50d35b9d94fdf), {
|
|
7594
|
-
|
|
7653
|
+
get_search_query_: get_search_query_,
|
|
7595
7654
|
i18n_: i18n_,
|
|
7596
7655
|
formatted_number_of_results_: formatted_number_of_results_
|
|
7597
7656
|
});
|
|
@@ -7630,7 +7689,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7630
7689
|
(0, $46MJV$depictaiutilishared.catchify)((0, $151280ad98f4438b$export$6e49da55e449af7c))({
|
|
7631
7690
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7632
7691
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
7633
|
-
id_:
|
|
7692
|
+
id_: get_search_query_,
|
|
7634
7693
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
7635
7694
|
});
|
|
7636
7695
|
(0, $46MJV$solidjs.createComputed)(()=>{
|
|
@@ -7642,7 +7701,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7642
7701
|
available_filters_: available_filters_
|
|
7643
7702
|
});
|
|
7644
7703
|
(0, $46MJV$solidjs.createEffect)(()=>{
|
|
7645
|
-
|
|
7704
|
+
get_search_query_();
|
|
7646
7705
|
(0, $fe1bd893954cc9ca$export$c7e181728ad525f)(location);
|
|
7647
7706
|
});
|
|
7648
7707
|
(0, $46MJV$solidjs.createComputed)(()=>{
|
|
@@ -7709,7 +7768,7 @@ function $93779a41dce11249$export$a54ec244c8863715(opts) {
|
|
|
7709
7768
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
7710
7769
|
tenant_object_: tenant_object_,
|
|
7711
7770
|
type_for_tracking_: "search",
|
|
7712
|
-
id_currently_querying_for_:
|
|
7771
|
+
id_currently_querying_for_: get_search_query_,
|
|
7713
7772
|
no_results_options_: {
|
|
7714
7773
|
selected_filters_: selected_filters_,
|
|
7715
7774
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -7822,13 +7881,17 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7822
7881
|
#modal_open_signal = (0, $46MJV$solidjs.createSignal)(false);
|
|
7823
7882
|
static #has_been_constructed = false;
|
|
7824
7883
|
#router = new (0, $43940d5ca403c293$export$7e1297a3a19f10d8)("hard_navigation");
|
|
7825
|
-
constructor({ search_query_url_param_name:
|
|
7826
|
-
disable_scrolling_during_modal = true , api: api ,
|
|
7884
|
+
constructor({ search_query_url_param_name: search_query_url_param_name_ = "query" , url_transformer: url_transformer , on_navigation: on_navigation , enable_category_suggestions: enable_category_suggestions = true , disable_scrolling_during_modal: // Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
7885
|
+
disable_scrolling_during_modal = true , api: api , bottom_distance_under_modal: bottom_distance_under_modal , render_instant_card: render_instant_card , ...props_on_class }){
|
|
7827
7886
|
if ($79fbf145b15af988$export$ac6237957a15b3f0.#has_been_constructed) throw new Error("You can only have one instance of DepictSearch");
|
|
7828
7887
|
Object.assign(this, props_on_class);
|
|
7829
|
-
|
|
7888
|
+
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7889
|
+
const { current_sorting_: current_sorting_ , selected_filters_: selected_filters_ , search_query_accessor_: raw_search_query_accessor } = (0, $cb699e435fadd254$export$477caf01aecaeb2a)({
|
|
7890
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7891
|
+
router_: this.#router
|
|
7892
|
+
});
|
|
7830
7893
|
const [reset_history_state_, state_] = (0, $0de081f67b6d15b5$export$9862539c89138352)(()=>({
|
|
7831
|
-
search_field_value: new URLSearchParams(location.search).get(
|
|
7894
|
+
search_field_value: new URLSearchParams(location.search).get(search_query_url_param_name_) ?? "",
|
|
7832
7895
|
search_filters_open: false,
|
|
7833
7896
|
search_sorting_open: false,
|
|
7834
7897
|
search_expanded_filters: [],
|
|
@@ -7837,14 +7900,15 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7837
7900
|
search_expanded_hierarchical_filters: [],
|
|
7838
7901
|
search_showing_recommendation_rows: (0, $9f81b7ced87aabf2$export$1c8c715550dc689d),
|
|
7839
7902
|
search_scroll_restoration_data: []
|
|
7840
|
-
}));
|
|
7903
|
+
}), this.#router);
|
|
7841
7904
|
const search_query_updating_blocked_ = (0, $46MJV$solidjs.createSignal)(false);
|
|
7842
|
-
const
|
|
7843
|
-
|
|
7905
|
+
const [get_search_query_updating_blocked] = search_query_updating_blocked_;
|
|
7906
|
+
const get_search_query_ = (0, $46MJV$solidjs.createMemo)((previous_value)=>{
|
|
7907
|
+
if (get_search_query_updating_blocked()) return previous_value;
|
|
7908
|
+
else return raw_search_query_accessor();
|
|
7844
7909
|
});
|
|
7845
|
-
const search_query_signal_ = (0, $46MJV$solidjs.createSignal)((0, $46MJV$solidjs.untrack)(raw_search_query_signal[0]));
|
|
7846
7910
|
const depict_api_ = api ?? new (0, $9ce64f69303c371e$export$e015ed2f2950f2e3)();
|
|
7847
|
-
const previous_searches = (0, $ad118c2ba257d9b7$export$84bba84a7b837187)(
|
|
7911
|
+
const previous_searches = (0, $ad118c2ba257d9b7$export$84bba84a7b837187)(get_search_query_);
|
|
7848
7912
|
const [, set_search_showing_recommendation_rows] = state_.search_showing_recommendation_rows;
|
|
7849
7913
|
const after_submit_ = ()=>set_search_showing_recommendation_rows((0, $9f81b7ced87aabf2$export$1c8c715550dc689d)); // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
7850
7914
|
const on_submit_with_unchanged_value_ = ()=>this.modal_open = false;
|
|
@@ -7852,31 +7916,24 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7852
7916
|
const configured_submit_query_ = (new_query)=>(0, $1c323edfb89c9dca$export$e16630ecb9644a1c)({
|
|
7853
7917
|
on_submit_with_unchanged_value_: on_submit_with_unchanged_value_,
|
|
7854
7918
|
set_search_field_value_: set_search_field_value_,
|
|
7855
|
-
|
|
7856
|
-
search_param_name_:
|
|
7857
|
-
url_transformer_: url_transformer,
|
|
7919
|
+
get_search_query_: get_search_query_,
|
|
7920
|
+
search_param_name_: search_query_url_param_name_,
|
|
7858
7921
|
after_submit_: after_submit_,
|
|
7859
7922
|
get_new_query: ()=>new_query || (0, $46MJV$solidjs.untrack)(get_search_field_value_),
|
|
7923
|
+
url_transformer_: url_transformer,
|
|
7860
7924
|
router_: this.#router
|
|
7861
7925
|
});
|
|
7862
7926
|
const i18n_ = (0, $623202ae203e9e59$export$f091cbac892643a4)(this.#locale_signal[0]);
|
|
7863
7927
|
const clear_filters_on_next_submit_ = (0, $8b282f736ce4f3b8$export$e026af0c7b64ea5f)({
|
|
7864
7928
|
selected_filters_: selected_filters_,
|
|
7865
|
-
|
|
7929
|
+
get_search_query_: get_search_query_,
|
|
7866
7930
|
current_sorting_: current_sorting_,
|
|
7867
7931
|
expanded_hierarchical_filters_: state_.search_expanded_hierarchical_filters,
|
|
7868
7932
|
i18n_: i18n_,
|
|
7869
7933
|
local_filter_cache_: state_.search_local_filter_cache
|
|
7870
7934
|
});
|
|
7871
|
-
if (on_navigation) this.#router.on_navigation_ = on_navigation;
|
|
7872
|
-
(0, $46MJV$solidjs.createComputed)(()=>{
|
|
7873
|
-
const [get_search_query_updating_blocked] = search_query_updating_blocked_;
|
|
7874
|
-
const [get_raw_search_query_signal] = raw_search_query_signal;
|
|
7875
|
-
const [, set_search_query_signal] = search_query_signal_; // this signal won't get written from anywhere, see url_params_to_signals JSDoc
|
|
7876
|
-
if (!get_search_query_updating_blocked()) set_search_query_signal(get_raw_search_query_signal());
|
|
7877
|
-
});
|
|
7878
7935
|
$79fbf145b15af988$var$privately_shared_properties.set(this, {
|
|
7879
|
-
search_query_url_param_name_:
|
|
7936
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7880
7937
|
reset_history_state_: reset_history_state_,
|
|
7881
7938
|
state_: state_,
|
|
7882
7939
|
router_: this.#router,
|
|
@@ -7885,7 +7942,7 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7885
7942
|
enable_category_suggestions_: enable_category_suggestions,
|
|
7886
7943
|
clear_filters_on_next_submit_: clear_filters_on_next_submit_,
|
|
7887
7944
|
configured_submit_query_: configured_submit_query_,
|
|
7888
|
-
|
|
7945
|
+
get_search_query_: get_search_query_,
|
|
7889
7946
|
i18n_: i18n_,
|
|
7890
7947
|
search_query_updating_blocked_: search_query_updating_blocked_,
|
|
7891
7948
|
current_sorting_: current_sorting_,
|
|
@@ -7899,8 +7956,8 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7899
7956
|
return (0, $121d25ca6af2898f$export$1c593cbd6f1e10bc)(...args);
|
|
7900
7957
|
}, {
|
|
7901
7958
|
search_field_value_: state_.search_field_value,
|
|
7902
|
-
|
|
7903
|
-
|
|
7959
|
+
get_search_query_: get_search_query_,
|
|
7960
|
+
search_query_url_param_name_: search_query_url_param_name_,
|
|
7904
7961
|
previous_searches_: previous_searches,
|
|
7905
7962
|
depict_api_: depict_api_,
|
|
7906
7963
|
tenant_: this.#merchant_signal[0],
|
|
@@ -7918,7 +7975,7 @@ class $79fbf145b15af988$export$ac6237957a15b3f0 {
|
|
|
7918
7975
|
i18n_: i18n_,
|
|
7919
7976
|
enable_category_suggestions_: enable_category_suggestions,
|
|
7920
7977
|
disable_scrolling_: disable_scrolling_during_modal,
|
|
7921
|
-
bottom_distance_under_modal_:
|
|
7978
|
+
bottom_distance_under_modal_: bottom_distance_under_modal
|
|
7922
7979
|
});
|
|
7923
7980
|
// This will add some default behaviour to open_modal_ if no style_props_ are supplied
|
|
7924
7981
|
// The default behaviour is to align the modal with the input field if possible
|
|
@@ -8048,7 +8105,7 @@ function $79fbf145b15af988$export$f2dc7e4e4aa11abb({ depict_search: depict_searc
|
|
|
8048
8105
|
min_products_to_fetch_: $79fbf145b15af988$var$min_products_to_fetch_,
|
|
8049
8106
|
local_filter_cache_: state_.search_local_filter_cache,
|
|
8050
8107
|
search_field_value_: state_.search_field_value,
|
|
8051
|
-
|
|
8108
|
+
get_search_query_: shared_properties.get_search_query_,
|
|
8052
8109
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
8053
8110
|
open_modal_: (...args)=>depict_search.modal_open = args,
|
|
8054
8111
|
submit_query_: shared_properties.configured_submit_query_,
|
|
@@ -8113,9 +8170,6 @@ function $79fbf145b15af988$export$316f6f283ae64765({ depict_search: depict_searc
|
|
|
8113
8170
|
return (0, $f27b0b326e0a87e2$export$23fca46f3143581f)(()=>{
|
|
8114
8171
|
let input_element;
|
|
8115
8172
|
const search_field = (0, $46MJV$solidjsweb.createComponent)((0, $2989e355f64e18e1$export$b94867ecbd698f21), {
|
|
8116
|
-
get search_query_ () {
|
|
8117
|
-
return shared_properties.search_query_signal_;
|
|
8118
|
-
},
|
|
8119
8173
|
get search_field_value_ () {
|
|
8120
8174
|
return shared_properties.state_.search_field_value;
|
|
8121
8175
|
},
|