@depict-ai/ui 1.4.20 → 1.4.21
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/ES10/index.cjs +2 -3
- package/ES10/index.d.ts +1 -1
- package/ES10/index.js +156 -157
- package/latest/index.cjs +2 -3
- package/latest/index.d.ts +1 -1
- package/latest/index.js +156 -157
- package/package.json +1 -1
- package/server/ES10/index.cjs +2 -3
- package/server/ES10/index.d.ts +1 -1
- package/server/ES10/index.js +97 -98
- package/server/latest/index.cjs +2 -3
- package/server/latest/index.d.ts +1 -1
- package/server/latest/index.js +97 -98
package/server/latest/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { add_to_version_info as $i7OB2$add_to_version_info,
|
|
1
|
+
import { add_to_version_info as $i7OB2$add_to_version_info, catchify as $i7OB2$catchify, is_safari as $i7OB2$is_safari, report as $i7OB2$report, observer as $i7OB2$observer, useExpandingContainer as $i7OB2$useExpandingContainer, standard_price_format as $i7OB2$standard_price_format, Amazing_Slider as $i7OB2$Amazing_Slider, slider_snap_css as $i7OB2$slider_snap_css, slider_fading_factory as $i7OB2$slider_fading_factory, make_random_classname as $i7OB2$make_random_classname, dlog as $i7OB2$dlog, hex_to_rgb as $i7OB2$hex_to_rgb, relative_luminance_from_rgb as $i7OB2$relative_luminance_from_rgb, javascript_media_query as $i7OB2$javascript_media_query, n_col_styling_with_dist as $i7OB2$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $i7OB2$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $i7OB2$layout_get_total_rec_amount_for_row, layout_media_query_header as $i7OB2$layout_media_query_header, fetch_recs as $i7OB2$fetch_recs, snakeCasifyObject as $i7OB2$snakeCasifyObject, instant_exec_on_suspect_history_change as $i7OB2$instant_exec_on_suspect_history_change, base_url as $i7OB2$base_url, get_depict_id as $i7OB2$get_depict_id, get_user_id as $i7OB2$get_user_id, get_session_id as $i7OB2$get_session_id, sort_obj as $i7OB2$sort_obj, fetch_retry as $i7OB2$fetch_retry, add_version_query_params as $i7OB2$add_version_query_params, dwarn as $i7OB2$dwarn, make_url_with_query_params as $i7OB2$make_url_with_query_params, edit_current_page_meta_tags as $i7OB2$edit_current_page_meta_tags, use_href_accessor as $i7OB2$use_href_accessor, base64_encode_unicode as $i7OB2$base64_encode_unicode, base64_decode_unicode as $i7OB2$base64_decode_unicode, queueMacroTask as $i7OB2$queueMacroTask, make_asyncIterable_exiter as $i7OB2$make_asyncIterable_exiter, href_change_ipns as $i7OB2$href_change_ipns, ContainedImage as $i7OB2$ContainedImage, deparallelize_no_drop as $i7OB2$deparallelize_no_drop, insert_surfaces as $i7OB2$insert_surfaces } from "@depict-ai/utilishared/latest";
|
|
2
2
|
import { ssrElement as $i7OB2$ssrElement, ssr as $i7OB2$ssr, ssrHydrationKey as $i7OB2$ssrHydrationKey, ssrStyle as $i7OB2$ssrStyle, ssrClassList as $i7OB2$ssrClassList, escape as $i7OB2$escape, insert as $i7OB2$insert, createComponent as $i7OB2$createComponent, ssrAttribute as $i7OB2$ssrAttribute, Dynamic as $i7OB2$Dynamic, isServer as $i7OB2$isServer, mergeProps as $i7OB2$mergeProps } from "solid-js/web";
|
|
3
|
-
import { catchify as $i7OB2$catchify } from "@depict-ai/utilishared/latest/latest";
|
|
4
3
|
import { createSignal as $i7OB2$createSignal, onCleanup as $i7OB2$onCleanup, ErrorBoundary as $i7OB2$ErrorBoundary, createMemo as $i7OB2$createMemo, untrack as $i7OB2$untrack, createEffect as $i7OB2$createEffect, getOwner as $i7OB2$getOwner, Show as $i7OB2$Show, Index as $i7OB2$Index, For as $i7OB2$For, createRenderEffect as $i7OB2$createRenderEffect, createComputed as $i7OB2$createComputed, on as $i7OB2$on, batch as $i7OB2$batch, createRoot as $i7OB2$createRoot, runWithOwner as $i7OB2$runWithOwner, createResource as $i7OB2$createResource, createReaction as $i7OB2$createReaction, Suspense as $i7OB2$Suspense } from "solid-js";
|
|
5
4
|
|
|
6
5
|
/*! Depict.ai search and product listing SDK */
|
|
7
6
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
8
7
|
register_es_version("ui", "latest");
|
|
9
|
-
const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.
|
|
8
|
+
const $ec291e0010116877$export$83d89fbfd8236492 = "1.4.21";
|
|
10
9
|
function $e8ffe11ed01df0fe$export$e6fffe67d4cdd848(whatToWatch) {
|
|
11
10
|
const [size, setSize] = $i7OB2$createSignal(0);
|
|
12
11
|
const resizeObserver = new ResizeObserver($i7OB2$catchify(records => {
|
|
@@ -133,15 +132,15 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
133
132
|
$i7OB2$insert(details_, [summary_, $i7OB2$createComponent(ExpandingContainer, {
|
|
134
133
|
children: children
|
|
135
134
|
})], null);
|
|
136
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$
|
|
137
|
-
$i7OB2$createEffect($i7OB2$
|
|
135
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(details_).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
136
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
138
137
|
const is_open = is_open_memo();
|
|
139
138
|
if (!is_in_dom())
|
|
140
139
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
141
140
|
return;
|
|
142
141
|
if (dont_animate_if_instant_open_ && fresh_component && !timeout_started) {
|
|
143
142
|
timeout_started = true;
|
|
144
|
-
setTimeout($i7OB2$
|
|
143
|
+
setTimeout($i7OB2$catchify(() => fresh_component = false));
|
|
145
144
|
}
|
|
146
145
|
if (is_open) {
|
|
147
146
|
details_.open = true; // open up the toggle so the animation can happen
|
|
@@ -149,10 +148,10 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
149
148
|
await expand(0, do_duration);
|
|
150
149
|
} else {
|
|
151
150
|
const animation = await collapse();
|
|
152
|
-
animation?.addEventListener("finish", $i7OB2$
|
|
151
|
+
animation?.addEventListener("finish", $i7OB2$catchify(() => details_.open = false));
|
|
153
152
|
}
|
|
154
153
|
}));
|
|
155
|
-
details_.addEventListener("toggle", $i7OB2$
|
|
154
|
+
details_.addEventListener("toggle", $i7OB2$catchify(() => {
|
|
156
155
|
const {
|
|
157
156
|
open: open
|
|
158
157
|
} = details_;
|
|
@@ -162,11 +161,11 @@ function $6bb0a0c563dff4bb$export$6c6d7a51fa9aa15d(props) {
|
|
|
162
161
|
}) // in case someone somehow toggles it without us intercepting it at least follow suit
|
|
163
162
|
);
|
|
164
163
|
|
|
165
|
-
summary_.addEventListener("click", $i7OB2$
|
|
164
|
+
summary_.addEventListener("click", $i7OB2$catchify(ev => {
|
|
166
165
|
ev.preventDefault();
|
|
167
166
|
toggle();
|
|
168
167
|
}));
|
|
169
|
-
summary_.addEventListener("keydown", $i7OB2$
|
|
168
|
+
summary_.addEventListener("keydown", $i7OB2$catchify(ev => {
|
|
170
169
|
const {
|
|
171
170
|
key: key
|
|
172
171
|
} = ev;
|
|
@@ -427,9 +426,9 @@ function $1adfe60f3a14a1d7$export$fecbb157621501bd({
|
|
|
427
426
|
});
|
|
428
427
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(document.documentElement.contains(outmost_element));
|
|
429
428
|
const hidden = $i7OB2$createMemo(() => get_search_filters_open_() || get_search_sorting_open_());
|
|
430
|
-
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$
|
|
429
|
+
if (!$i7OB2$untrack(is_in_dom)) (0, $i7OB2$observer).wait_for_element(outmost_element).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
431
430
|
outmost_element.classList.add("selected-filters");
|
|
432
|
-
$i7OB2$createEffect($i7OB2$
|
|
431
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
433
432
|
if (!is_in_dom())
|
|
434
433
|
// wait with setting state until we're in DOM, animation won't work otherwise
|
|
435
434
|
return;
|
|
@@ -554,7 +553,7 @@ function $a4601e6bea3ed1e6$export$dd948f91abc3a1c4({
|
|
|
554
553
|
i18n_: i18n_
|
|
555
554
|
}) : []);
|
|
556
555
|
});
|
|
557
|
-
$i7OB2$createEffect($i7OB2$
|
|
556
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
558
557
|
if (!togglable_rest()) {
|
|
559
558
|
await collapse();
|
|
560
559
|
return;
|
|
@@ -636,7 +635,7 @@ function $a6b08770e164eced$export$e0d834a0ad870cda({
|
|
|
636
635
|
});
|
|
637
636
|
$i7OB2$createComputed(() => {
|
|
638
637
|
clearTimeout(debounce_timeout);
|
|
639
|
-
debounce_timeout = setTimeout($i7OB2$
|
|
638
|
+
debounce_timeout = setTimeout($i7OB2$catchify(range => $i7OB2$untrack(() => {
|
|
640
639
|
const default_data = filter_().data;
|
|
641
640
|
const filter_object = {
|
|
642
641
|
op: filter_().op,
|
|
@@ -803,7 +802,7 @@ function $0b6bc2f8309efa8a$export$e5c2828934226505({
|
|
|
803
802
|
};
|
|
804
803
|
const outer_div = $i7OB2$ssr($0b6bc2f8309efa8a$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$ssrAttribute("aria-label", expanded_() ? $i7OB2$escape(i18n_.morphing_sign_expanded_aria_label_(), true) : $i7OB2$escape(i18n_.morphing_sign_collapsed_aria_label_(), true), false));
|
|
805
804
|
const [is_in_dom, set_is_in_dom] = $i7OB2$createSignal(false);
|
|
806
|
-
(0, $i7OB2$observer).wait_for_element(outer_div).then($i7OB2$
|
|
805
|
+
(0, $i7OB2$observer).wait_for_element(outer_div).then($i7OB2$catchify(() => set_is_in_dom(true)));
|
|
807
806
|
$i7OB2$createEffect(() => {
|
|
808
807
|
if (!is_in_dom())
|
|
809
808
|
// wait for us to being in DOM as animations don't work otherwise
|
|
@@ -956,7 +955,7 @@ function $1c8cac76cb67e9af$export$a32086fa6616eafd({
|
|
|
956
955
|
i18n_: i18n_
|
|
957
956
|
}) : []);
|
|
958
957
|
});
|
|
959
|
-
$i7OB2$createEffect($i7OB2$
|
|
958
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
960
959
|
if (!some_top_level_are_hidden()) {
|
|
961
960
|
await collapse();
|
|
962
961
|
return;
|
|
@@ -997,7 +996,7 @@ function $1c8cac76cb67e9af$var$render_stuff(data, existing_filter, i18n_) {
|
|
|
997
996
|
return value()?.is_checked_?.[0]?.() ?? false;
|
|
998
997
|
},
|
|
999
998
|
input_ref_: input => {
|
|
1000
|
-
input.addEventListener("change", $i7OB2$
|
|
999
|
+
input.addEventListener("change", $i7OB2$catchify(() => $i7OB2$untrack(() => {
|
|
1001
1000
|
const {
|
|
1002
1001
|
checked: checked
|
|
1003
1002
|
} = input;
|
|
@@ -1069,7 +1068,7 @@ function $1c8cac76cb67e9af$var$batching_filter_state_syncer(props) {
|
|
|
1069
1068
|
existing_filter_: existing_filter_
|
|
1070
1069
|
} = props;
|
|
1071
1070
|
let sync_queued = false;
|
|
1072
|
-
const sync_fn = $i7OB2$
|
|
1071
|
+
const sync_fn = $i7OB2$catchify(async () => {
|
|
1073
1072
|
sync_queued = false;
|
|
1074
1073
|
// if we change, update filter state - next microtask, so that "reactions" to the change can process before we send it off to the API
|
|
1075
1074
|
const set_filter = existing_filter_();
|
|
@@ -1126,13 +1125,13 @@ function $1c8cac76cb67e9af$var$create_updating_signal({
|
|
|
1126
1125
|
$i7OB2$createComputed($i7OB2$on(read_checked, trigger_sync_, {
|
|
1127
1126
|
defer: true
|
|
1128
1127
|
}));
|
|
1129
|
-
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$
|
|
1128
|
+
$i7OB2$createComputed($i7OB2$on(read_checked, $i7OB2$catchify(new_value => {
|
|
1130
1129
|
if (updating_blocked) return;
|
|
1131
1130
|
for (const child of child_objects) child.is_checked_[1](new_value);
|
|
1132
1131
|
}), {
|
|
1133
1132
|
defer: true
|
|
1134
1133
|
}));
|
|
1135
|
-
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$
|
|
1134
|
+
$i7OB2$createEffect($i7OB2$on(get_child_object_values, $i7OB2$catchify(() => {
|
|
1136
1135
|
const all_kids_checked = get_child_object_values.every(accessor => accessor());
|
|
1137
1136
|
if (all_kids_checked === read_checked()) return;
|
|
1138
1137
|
updating_blocked = true;
|
|
@@ -1368,7 +1367,7 @@ function $e731d52d97444b7c$export$82ed4b28ecb67608({
|
|
|
1368
1367
|
i18n_: i18n_
|
|
1369
1368
|
}) : []);
|
|
1370
1369
|
});
|
|
1371
|
-
$i7OB2$createEffect($i7OB2$
|
|
1370
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
1372
1371
|
if (!togglable_rest()) {
|
|
1373
1372
|
await collapse();
|
|
1374
1373
|
set_having_expanding_in_dom(false); // Once animation has finished, remove expanding from DOM
|
|
@@ -1941,7 +1940,7 @@ function $c8d5ff4524619fcd$var$ActualSolidLayout(props, container_element) {
|
|
|
1941
1940
|
return;
|
|
1942
1941
|
}
|
|
1943
1942
|
update_children_count();
|
|
1944
|
-
const mutation_observer = new MutationObserver($i7OB2$
|
|
1943
|
+
const mutation_observer = new MutationObserver($i7OB2$catchify(update_children_count));
|
|
1945
1944
|
mutation_observer.observe(container_element, {
|
|
1946
1945
|
childList: true
|
|
1947
1946
|
});
|
|
@@ -1999,7 +1998,7 @@ async function $194bd6b8e4c59830$export$79b1565500412d9b(search_modal, modal_fn_
|
|
|
1999
1998
|
// Animation broke, close it this time
|
|
2000
1999
|
actually_close();else if (!animation_started && closing_animation) {
|
|
2001
2000
|
animation_started = +new Date();
|
|
2002
|
-
$i7OB2$
|
|
2001
|
+
$i7OB2$catchify(closing_animation)()?.then($i7OB2$catchify(actually_close));
|
|
2003
2002
|
} else actually_close();
|
|
2004
2003
|
};
|
|
2005
2004
|
return search_modal({
|
|
@@ -2040,7 +2039,7 @@ async function $c58717f39bf51647$export$58e808b1db15d3bc({
|
|
|
2040
2039
|
function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, router_) {
|
|
2041
2040
|
const signals = {};
|
|
2042
2041
|
const entries = Object.entries(params_to_default_value);
|
|
2043
|
-
const event_handler = $i7OB2$
|
|
2042
|
+
const event_handler = $i7OB2$catchify((what_happened, args) => {
|
|
2044
2043
|
if (what_happened == "popstate") $ca6f574bd8772184$var$history_state_change(signals, entries, args.state);
|
|
2045
2044
|
});
|
|
2046
2045
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
@@ -2064,8 +2063,8 @@ function $ca6f574bd8772184$export$e183a13865960371(params_to_default_value, rout
|
|
|
2064
2063
|
});
|
|
2065
2064
|
// history_dot_state_to_state needs to update after its signals after url_state does BUT in the same task (might even have to be in the same tick in the microtask queue). If we'd use window.addEventListener("popstate") it would be guaranteed to be too late since each event listener has its own task
|
|
2066
2065
|
(0, $i7OB2$instant_exec_on_suspect_history_change).add(event_handler);
|
|
2067
|
-
$i7OB2$onCleanup($i7OB2$
|
|
2068
|
-
$i7OB2$createEffect($i7OB2$
|
|
2066
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => (0, $i7OB2$instant_exec_on_suspect_history_change).delete(event_handler)));
|
|
2067
|
+
$i7OB2$createEffect($i7OB2$catchify(() => $i7OB2$untrack($i7OB2$catchify(() => $ca6f574bd8772184$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
|
|
2069
2068
|
return signals;
|
|
2070
2069
|
}
|
|
2071
2070
|
function $ca6f574bd8772184$var$history_state_change(signals, entries, state) {
|
|
@@ -2178,7 +2177,7 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2178
2177
|
return this.#cache_objs[endpoint] ||= {
|
|
2179
2178
|
in_progress_: {},
|
|
2180
2179
|
cache_: {},
|
|
2181
|
-
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$
|
|
2180
|
+
finalization_registry_: this.#supports_finalization_registry ? new FinalizationRegistry($i7OB2$catchify(key => {
|
|
2182
2181
|
const our_cache = this.#cache_objs[endpoint].cache_;
|
|
2183
2182
|
$i7OB2$dlog("[Search API]: removing", key, "from", our_cache);
|
|
2184
2183
|
delete our_cache[key];
|
|
@@ -2326,11 +2325,11 @@ class $7fa23e2a0079eca4$export$e015ed2f2950f2e3 {
|
|
|
2326
2325
|
result = $e5014ccd0b76d9f4$export$967e966fca9515e(result);
|
|
2327
2326
|
cache_obj.cache_[body] = new WeakRef(result);
|
|
2328
2327
|
resolve_in_progress(result);
|
|
2329
|
-
setTimeout($i7OB2$
|
|
2328
|
+
setTimeout($i7OB2$catchify(() => {
|
|
2330
2329
|
if (this.#supports_finalization_registry) cache_obj.finalization_registry_.register(result, body); // delete key from cache when value (WeakRefs) are collected
|
|
2331
2330
|
else
|
|
2332
2331
|
// delete things from cache after 5 minutes, so it doesn't get too heavy
|
|
2333
|
-
setTimeout($i7OB2$
|
|
2332
|
+
setTimeout($i7OB2$catchify(() => delete cache_obj.cache_[body]), 300000);
|
|
2334
2333
|
}), 60000 // cache values for at least 60 seconds
|
|
2335
2334
|
);
|
|
2336
2335
|
|
|
@@ -2479,7 +2478,7 @@ function $511cc0abd9a64ce8$export$92f2da32c6e7e7ee({
|
|
|
2479
2478
|
});
|
|
2480
2479
|
}
|
|
2481
2480
|
function $8f9120a1ca151e6a$export$205efb947c7ffd78(handler, passive = true) {
|
|
2482
|
-
const catchified_handler = $i7OB2$
|
|
2481
|
+
const catchified_handler = $i7OB2$catchify(handler);
|
|
2483
2482
|
const owner = $i7OB2$getOwner();
|
|
2484
2483
|
// 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.
|
|
2485
2484
|
// Use observer in case that this gets called before body exists
|
|
@@ -2596,7 +2595,7 @@ function $6db49ca163afa2c3$export$83fd5de5504a7a67({
|
|
|
2596
2595
|
fill: "forwards",
|
|
2597
2596
|
easing: "ease-in-out"
|
|
2598
2597
|
});
|
|
2599
|
-
animation.addEventListener("finish", $i7OB2$
|
|
2598
|
+
animation.addEventListener("finish", $i7OB2$catchify(() => {
|
|
2600
2599
|
if (unpermit_when_possible) set_permitted_to_show(false);
|
|
2601
2600
|
animation = undefined;
|
|
2602
2601
|
element.style.display = "none";
|
|
@@ -2751,7 +2750,7 @@ function $056f6ac0a6caa919$export$5e4aed86c12acdd9({
|
|
|
2751
2750
|
last_loaded = +new Date();
|
|
2752
2751
|
is_first_load = true;
|
|
2753
2752
|
});
|
|
2754
|
-
$i7OB2$createEffect($i7OB2$
|
|
2753
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
2755
2754
|
const be_above_percentage = is_first_load ? 50 : 75; // if first load, load earlier
|
|
2756
2755
|
if (percentage_in_view_() < be_above_percentage || is_loading_more) return;
|
|
2757
2756
|
if (!get_last_cursor()) {
|
|
@@ -2921,7 +2920,7 @@ function $0449e7d49398c077$export$a1fd619a4743ca08({
|
|
|
2921
2920
|
const target_to_index_map = new Map();
|
|
2922
2921
|
const index_to_target_map_ = new Map();
|
|
2923
2922
|
const currently_intersecting = new Set();
|
|
2924
|
-
const intersection_observer = new IntersectionObserver($i7OB2$
|
|
2923
|
+
const intersection_observer = new IntersectionObserver($i7OB2$catchify(records => {
|
|
2925
2924
|
for (let i = 0; i < records.length; i++) {
|
|
2926
2925
|
const record = records[i];
|
|
2927
2926
|
const {
|
|
@@ -3240,7 +3239,7 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3240
3239
|
offset: 0
|
|
3241
3240
|
}, 1);
|
|
3242
3241
|
animation.pause();
|
|
3243
|
-
const fn = $i7OB2$
|
|
3242
|
+
const fn = $i7OB2$catchify(animation.play.bind(animation));
|
|
3244
3243
|
cleanup_fns.push(fn);
|
|
3245
3244
|
$i7OB2$onCleanup(fn);
|
|
3246
3245
|
} catch (e) {
|
|
@@ -3251,7 +3250,7 @@ function $aea1edf92433e81e$export$fe334901e8bebd57() {
|
|
|
3251
3250
|
const style = element.style;
|
|
3252
3251
|
const original_value = style.overflow;
|
|
3253
3252
|
style.overflow = "hidden";
|
|
3254
|
-
const fn = $i7OB2$
|
|
3253
|
+
const fn = $i7OB2$catchify(() => style.overflow = original_value);
|
|
3255
3254
|
cleanup_fns.push(fn);
|
|
3256
3255
|
$i7OB2$onCleanup(fn);
|
|
3257
3256
|
}
|
|
@@ -3337,7 +3336,7 @@ function $757dac7f7c6c5241$export$9bf11afa910f536e({
|
|
|
3337
3336
|
set_search_sorting_open(true);
|
|
3338
3337
|
}
|
|
3339
3338
|
});
|
|
3340
|
-
$i7OB2$onCleanup($i7OB2$
|
|
3339
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => {
|
|
3341
3340
|
if (!sorting_expanded() && !filters_expanded()) {
|
|
3342
3341
|
set_search_filters_open(false);
|
|
3343
3342
|
set_search_sorting_open(false);
|
|
@@ -3437,7 +3436,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
3437
3436
|
const [sorting_open, set_sorting_open] = search_sorting_open_;
|
|
3438
3437
|
const [get_current_sorting_] = current_sorting_;
|
|
3439
3438
|
const [is_small, set_is_small] = $i7OB2$createSignal(false);
|
|
3440
|
-
const dismiss_modal_ = $i7OB2$
|
|
3439
|
+
const dismiss_modal_ = $i7OB2$catchify(() => {
|
|
3441
3440
|
set_filters_open(false);
|
|
3442
3441
|
set_sorting_open(false);
|
|
3443
3442
|
});
|
|
@@ -3508,7 +3507,7 @@ function $cdea4cf8c5c071ef$export$d7841e452f2e59a8({
|
|
|
3508
3507
|
if (filters_open()) set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $fab07f52c9861732$export$3f1a388cc0d8fed7), filter_options))));else set_extra_els_in_results_container_($i7OB2$ssr($cdea4cf8c5c071ef$var$_tmpl$2, $i7OB2$ssrHydrationKey(), $i7OB2$escape($i7OB2$createComponent((0, $68a258a92b88f02f$export$1f1775a58da589b5), sorting_options))));
|
|
3509
3508
|
}
|
|
3510
3509
|
});
|
|
3511
|
-
$i7OB2$
|
|
3510
|
+
$i7OB2$catchify(async () => {
|
|
3512
3511
|
({
|
|
3513
3512
|
open_modal_: open_modal_,
|
|
3514
3513
|
close_modal_: close_modal_
|
|
@@ -3611,13 +3610,13 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
3611
3610
|
}) {
|
|
3612
3611
|
let close_toast_;
|
|
3613
3612
|
const stay_open_promise = new Promise(r => close_toast_ = r);
|
|
3614
|
-
$i7OB2$
|
|
3613
|
+
$i7OB2$catchify(async () => {
|
|
3615
3614
|
const closing_animation_duration = 300; // ms
|
|
3616
3615
|
const element = $i7OB2$ssrElement("div", more_attributes, () => $i7OB2$escape(children), true);
|
|
3617
3616
|
const [, set_is_showing_toast] = $bf52d9f9eebd1938$export$22970a0140fc759c;
|
|
3618
3617
|
// if this is a memory leak the garbage collector is stupid - does someone know?
|
|
3619
|
-
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$
|
|
3620
|
-
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$
|
|
3618
|
+
for (const ev of ["pointerover", "focusin"]) element.addEventListener(ev, $i7OB2$catchify(() => closing_animation.pause()));
|
|
3619
|
+
for (const ev of ["pointerout", "focusout"]) element.addEventListener(ev, $i7OB2$catchify(() => closing_animation.play()));
|
|
3621
3620
|
const body = await (0, $i7OB2$observer).wait_for_element("body");
|
|
3622
3621
|
const x_translate = "translateX(-50%) ";
|
|
3623
3622
|
let remove_keyboard_listener;
|
|
@@ -3642,7 +3641,7 @@ function $bf52d9f9eebd1938$export$5196e4c01fa56fcb({
|
|
|
3642
3641
|
// let other toasts close us if they open while we're still here
|
|
3643
3642
|
$bf52d9f9eebd1938$var$closing_functions.add(close_toast_);
|
|
3644
3643
|
set_is_showing_toast(true);
|
|
3645
|
-
const handler = $i7OB2$
|
|
3644
|
+
const handler = $i7OB2$catchify(({
|
|
3646
3645
|
key: key
|
|
3647
3646
|
}) => {
|
|
3648
3647
|
if (key === "Escape")
|
|
@@ -3741,7 +3740,7 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3741
3740
|
}
|
|
3742
3741
|
old_pos = new_pos;
|
|
3743
3742
|
});
|
|
3744
|
-
const touchstart_handler = $i7OB2$
|
|
3743
|
+
const touchstart_handler = $i7OB2$catchify(e => {
|
|
3745
3744
|
is_in_touch_scroll = true;
|
|
3746
3745
|
if (e.touches.length === 1) {
|
|
3747
3746
|
// we had no touches but then we got some. Adding a new touch cancels the inertia. We are in a new touch so do reset the diff
|
|
@@ -3749,12 +3748,12 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3749
3748
|
diff_over_second_or_touch = 0;
|
|
3750
3749
|
}
|
|
3751
3750
|
});
|
|
3752
|
-
const touchend_handler = $i7OB2$
|
|
3751
|
+
const touchend_handler = $i7OB2$catchify(e => {
|
|
3753
3752
|
if (e.touches.length === 0)
|
|
3754
3753
|
// scroll gesture of any type (pinch can also be used as scroll, etc.) ended
|
|
3755
3754
|
inertia_timeout = setTimeout(
|
|
3756
3755
|
// inertia ends after 500ms (educated guess)
|
|
3757
|
-
$i7OB2$
|
|
3756
|
+
$i7OB2$catchify(() => {
|
|
3758
3757
|
is_in_touch_scroll = false;
|
|
3759
3758
|
diff_over_second_or_touch = 0;
|
|
3760
3759
|
}), 500);
|
|
@@ -3772,9 +3771,9 @@ function $0b0380f75d729d63$var$ActualFloatingButtons({
|
|
|
3772
3771
|
const everything_closed = !get_search_filters_open_() && !get_search_sorting_open_();
|
|
3773
3772
|
if (!$i7OB2$untrack(modal_is_closed) && everything_closed)
|
|
3774
3773
|
// I think the point of this is to delay the animation a bit IIRC
|
|
3775
|
-
timeout = setTimeout($i7OB2$
|
|
3774
|
+
timeout = setTimeout($i7OB2$catchify(() => set_if_modal_is_closed(true)), 200);else set_if_modal_is_closed(everything_closed);
|
|
3776
3775
|
});
|
|
3777
|
-
$i7OB2$createComputed($i7OB2$
|
|
3776
|
+
$i7OB2$createComputed($i7OB2$catchify(async () => {
|
|
3778
3777
|
const element = sort_and_filter_element_();
|
|
3779
3778
|
if (!element) return;
|
|
3780
3779
|
await (0, $i7OB2$observer).wait_for_element(element);
|
|
@@ -4057,7 +4056,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
4057
4056
|
}];
|
|
4058
4057
|
$i7OB2$createComputed(() => {
|
|
4059
4058
|
if (place_holdey_quicklinks_data()?.[0]?.query_id) {
|
|
4060
|
-
if (last_was_placeholder) queueMicrotask($i7OB2$
|
|
4059
|
+
if (last_was_placeholder) queueMicrotask($i7OB2$catchify(() => {
|
|
4061
4060
|
sliding_element?.scrollTo({
|
|
4062
4061
|
left: 0
|
|
4063
4062
|
}); // for some reason we land one element to the right after placeholder rendering otherwise
|
|
@@ -4123,7 +4122,7 @@ function $06edf3aec9073663$export$466cdc317043f6cb({
|
|
|
4123
4122
|
} else if (!(intersecting_items_object[selected_index()]?.intersectionRatio >= 0.95)) {
|
|
4124
4123
|
// negated larger than to handle left side of comparison being undefined
|
|
4125
4124
|
let done_work = false;
|
|
4126
|
-
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$
|
|
4125
|
+
$i7OB2$runWithOwner(owner, () => $i7OB2$createComputed($i7OB2$catchify(() => {
|
|
4127
4126
|
if (done_work || !Array.isArray(quicklinks_data_())) return;
|
|
4128
4127
|
const sel_index = selected_index();
|
|
4129
4128
|
const target_element = sel_index >= 0 ? sel_index : 0;
|
|
@@ -4200,7 +4199,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
4200
4199
|
}]); // get rid of old data the browser saves the old state and will restore it later on
|
|
4201
4200
|
};
|
|
4202
4201
|
|
|
4203
|
-
$i7OB2$createComputed($i7OB2$
|
|
4202
|
+
$i7OB2$createComputed($i7OB2$catchify(() => {
|
|
4204
4203
|
const last_result = get_last_result_in_viewport_();
|
|
4205
4204
|
if (last_result == undefined || last_result <= 0 || last_result == Infinity) return;
|
|
4206
4205
|
if (isNaN(last_result)) {
|
|
@@ -4227,7 +4226,7 @@ function $641bba2917fe862b$export$6e49da55e449af7c({
|
|
|
4227
4226
|
set_to_later = last_result;
|
|
4228
4227
|
// If a delayed push timeout is already running, just changing the value that will be pushed is sufficient
|
|
4229
4228
|
if (timeout) return;
|
|
4230
|
-
timeout = setTimeout($i7OB2$
|
|
4229
|
+
timeout = setTimeout($i7OB2$catchify(() => {
|
|
4231
4230
|
timeout = undefined;
|
|
4232
4231
|
last_time_history_changed = +new Date();
|
|
4233
4232
|
set_min_results_loaded(set_to_later);
|
|
@@ -4270,7 +4269,7 @@ function $587cd61972788655$export$210f130a61ac1e8d(fn) {
|
|
|
4270
4269
|
let last_queued;
|
|
4271
4270
|
let last_value;
|
|
4272
4271
|
let initial_run = true;
|
|
4273
|
-
$i7OB2$createComputed($i7OB2$
|
|
4272
|
+
$i7OB2$createComputed($i7OB2$catchify(async () => {
|
|
4274
4273
|
last_value = fn();
|
|
4275
4274
|
if (initial_run) {
|
|
4276
4275
|
initial_run = false;
|
|
@@ -4390,7 +4389,7 @@ function $e7fce80abe608e01$export$3945d6db2dfd3d12({
|
|
|
4390
4389
|
const handler = () => allow_filter_clearing = false;
|
|
4391
4390
|
window.addEventListener("popstate", handler); // popstate only gets called when using back/forwards button of browser or the history navigate to achieve the same, but not on pushState or replaceState
|
|
4392
4391
|
$i7OB2$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
4393
|
-
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$
|
|
4392
|
+
$i7OB2$createEffect($i7OB2$on(crumb_data_, $i7OB2$catchify(new_crumb_data => {
|
|
4394
4393
|
const query_id_of_new_data = query_id_();
|
|
4395
4394
|
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && query_id_of_new_data !== query_id_when_we_got_previous_data) {
|
|
4396
4395
|
const previous_length = previous_crumb_data.length;
|
|
@@ -4541,7 +4540,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4541
4540
|
});
|
|
4542
4541
|
const [plp_results_] = $i7OB2$createResource(query_base_,
|
|
4543
4542
|
// only first page of results, unless the history state says we should load more (can't do that in load more thing, I tested, they need to be added at once for the browser to not give up scroll restoration)
|
|
4544
|
-
$i7OB2$
|
|
4543
|
+
$i7OB2$catchify(base_query => $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
4545
4544
|
id_: $i7OB2$untrack(query_id_),
|
|
4546
4545
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
4547
4546
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
@@ -4649,7 +4648,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4649
4648
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
4650
4649
|
...extra_sort_and_filter_args_
|
|
4651
4650
|
});
|
|
4652
|
-
$i7OB2$
|
|
4651
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
4653
4652
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
4654
4653
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
4655
4654
|
id_: query_id_,
|
|
@@ -4659,7 +4658,7 @@ function $df5d81d0fe61ff21$export$f7d2f673fc2f091d({
|
|
|
4659
4658
|
$i7OB2$createComputed(() => {
|
|
4660
4659
|
if (plp_results_.loading) set_can_write_scroll_restoration(false);else if (plp_results_()) set_can_write_scroll_restoration(true);
|
|
4661
4660
|
});
|
|
4662
|
-
$i7OB2$createRenderEffect($i7OB2$
|
|
4661
|
+
$i7OB2$createRenderEffect($i7OB2$catchify(async () => {
|
|
4663
4662
|
const slim = is_slim_();
|
|
4664
4663
|
const only_show_filters_opener = only_show_filters_opener_?.();
|
|
4665
4664
|
const owner = $i7OB2$getOwner();
|
|
@@ -4866,7 +4865,7 @@ function $ccd5db07a3a069c5$export$477caf01aecaeb2a(options) {
|
|
|
4866
4865
|
const [get_selected_filters_, set_selected_filters] = selected_filters_;
|
|
4867
4866
|
const [get_has_sideways_filter_clearing_flag_, set_has_sideways_filter_clearing_flag] = sideways_filter_clearing_flag_;
|
|
4868
4867
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(globalThis?.location?.href ?? "https://example.com");
|
|
4869
|
-
const history_change_handler = $i7OB2$
|
|
4868
|
+
const history_change_handler = $i7OB2$catchify(() => set_current_href(location.href));
|
|
4870
4869
|
const owner = $i7OB2$getOwner() || $i7OB2$createRoot(() => $i7OB2$getOwner());
|
|
4871
4870
|
const {
|
|
4872
4871
|
sorting_query_param_: sorting_query_param_,
|
|
@@ -5036,7 +5035,7 @@ class $4fd2ba03703a7d92$export$7e1297a3a19f10d8 {
|
|
|
5036
5035
|
* @param is_replace_ if you want to replace the current URL in history instead of pushing a new one
|
|
5037
5036
|
* @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
|
|
5038
5037
|
*/
|
|
5039
|
-
go_to_: $i7OB2$
|
|
5038
|
+
go_to_: $i7OB2$catchify(async ({
|
|
5040
5039
|
new_url_: raw_new_url,
|
|
5041
5040
|
event_: event_,
|
|
5042
5041
|
force_spa_navigation_: force_spa_navigation_,
|
|
@@ -5428,7 +5427,7 @@ const $a6e23a834336fc19$export$824dde41348efed1 = /*@__PURE__*/(() => {
|
|
|
5428
5427
|
|
|
5429
5428
|
const observe_to_signal = (element, setter) => {
|
|
5430
5429
|
const computed_style = getComputedStyle(element);
|
|
5431
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
5430
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify(() => {
|
|
5432
5431
|
setter(element.getBoundingClientRect().width + parseFloat(computed_style.marginLeft) + parseFloat(computed_style.marginRight) + parseFloat(computed_style.borderRightWidth) + parseFloat(computed_style.borderLeftWidth));
|
|
5433
5432
|
}));
|
|
5434
5433
|
resize_observer.observe(element);
|
|
@@ -5622,7 +5621,7 @@ function $5285d2814d0fac0c$export$b94867ecbd698f21({
|
|
|
5622
5621
|
let input_element;
|
|
5623
5622
|
// This is the div where we recommend (and ourselves do) attach the event listener to that opens the search modal.
|
|
5624
5623
|
let field_div;
|
|
5625
|
-
$i7OB2$createEffect($i7OB2$
|
|
5624
|
+
$i7OB2$createEffect($i7OB2$catchify(async () => {
|
|
5626
5625
|
if (disabled_) return;
|
|
5627
5626
|
// we aren't in DOM yet unfortunately, wouldn't even be with onMount
|
|
5628
5627
|
await (0, $i7OB2$observer).wait_for_element(input_element);
|
|
@@ -5728,7 +5727,7 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
5728
5727
|
};
|
|
5729
5728
|
let ro;
|
|
5730
5729
|
if (one_axies_only !== "top") {
|
|
5731
|
-
ro = new ResizeObserver($i7OB2$
|
|
5730
|
+
ro = new ResizeObserver($i7OB2$catchify(records => {
|
|
5732
5731
|
records.forEach(({
|
|
5733
5732
|
contentRect: {
|
|
5734
5733
|
width: width
|
|
@@ -5749,10 +5748,10 @@ function $b6d5529b253681aa$export$b3ad617e9036868(modal_body_style, input_field,
|
|
|
5749
5748
|
// "resize" doesn't fire sometimes when it should, also it doesn't when showing/hiding scrollbars which disabling scrolling does
|
|
5750
5749
|
// this works
|
|
5751
5750
|
// keeping resize just in case
|
|
5752
|
-
const resize_resize_observer = new ResizeObserver($i7OB2$
|
|
5751
|
+
const resize_resize_observer = new ResizeObserver($i7OB2$catchify(align_position));
|
|
5753
5752
|
resize_resize_observer.observe(document.documentElement);
|
|
5754
5753
|
(0, $i7OB2$observer).wait_for_element("body").then(resize_resize_observer.observe.bind(resize_resize_observer));
|
|
5755
|
-
$i7OB2$onCleanup($i7OB2$
|
|
5754
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => {
|
|
5756
5755
|
ro?.disconnect();
|
|
5757
5756
|
resize_resize_observer.disconnect();
|
|
5758
5757
|
}));
|
|
@@ -5780,7 +5779,7 @@ function $48d7e4a9707315b6$export$e026af0c7b64ea5f({
|
|
|
5780
5779
|
}, {
|
|
5781
5780
|
defer: true
|
|
5782
5781
|
}));
|
|
5783
|
-
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$
|
|
5782
|
+
$i7OB2$createComputed($i7OB2$on(get_search_query_, $i7OB2$catchify(() => {
|
|
5784
5783
|
// when a query was submitted, clear filters if clear was pressed before
|
|
5785
5784
|
const clear_value = $i7OB2$untrack(get_clear_filters_next_submit);
|
|
5786
5785
|
if (clear_value) {
|
|
@@ -5805,11 +5804,11 @@ function $21f51c14cb3f586f$export$84bba84a7b837187(read_search_query) {
|
|
|
5805
5804
|
const key = "depict_searches";
|
|
5806
5805
|
const previous_searches = $i7OB2$createSignal(JSON.parse(ls[key] || "[]"));
|
|
5807
5806
|
const [read_previous_searches, write_previous_searches] = previous_searches;
|
|
5808
|
-
$i7OB2$createEffect($i7OB2$
|
|
5807
|
+
$i7OB2$createEffect($i7OB2$catchify(() => {
|
|
5809
5808
|
const json_encoded = JSON.stringify(read_previous_searches());
|
|
5810
5809
|
if (ls[key] !== json_encoded) ls[key] = json_encoded;
|
|
5811
5810
|
}));
|
|
5812
|
-
$i7OB2$createComputed($i7OB2$
|
|
5811
|
+
$i7OB2$createComputed($i7OB2$catchify(() => {
|
|
5813
5812
|
const searches = $i7OB2$untrack(read_previous_searches);
|
|
5814
5813
|
const current_query = read_search_query();
|
|
5815
5814
|
if (!current_query)
|
|
@@ -5943,13 +5942,13 @@ function $eea41f703612261b$export$62f101a8aa597bf8({
|
|
|
5943
5942
|
// don't wait if it's the first request
|
|
5944
5943
|
write_current_instant_query(value);
|
|
5945
5944
|
clearTimeout(timeout);
|
|
5946
|
-
timeout = setTimeout($i7OB2$
|
|
5945
|
+
timeout = setTimeout($i7OB2$catchify(() => write_current_instant_query(value)), 250);
|
|
5947
5946
|
});
|
|
5948
5947
|
const [search_results] = $i7OB2$createResource($i7OB2$createMemo(() => ({
|
|
5949
5948
|
tenant: tenant_(),
|
|
5950
5949
|
market: market_(),
|
|
5951
5950
|
query: read_current_instant_query()
|
|
5952
|
-
})), $i7OB2$
|
|
5951
|
+
})), $i7OB2$catchify(variable_data => {
|
|
5953
5952
|
return depict_api_.query({
|
|
5954
5953
|
// here it is (unfortunately) important that the keys in the object are in the same order as in SearchPage.tsx, because when JSON-encoding them to compare for caching the strings will be different otherwise
|
|
5955
5954
|
limit: $i7OB2$untrack(has_sort_or_filters_) ? max_cards : min_products_to_fetch_,
|
|
@@ -6015,7 +6014,7 @@ function $a36cbc4f68bfd590$export$91c3b6774e8be0f5({
|
|
|
6015
6014
|
const [get_current_href, set_current_href] = $i7OB2$createSignal(location.href);
|
|
6016
6015
|
const [exit_iterable, exitable_iterable] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
6017
6016
|
$i7OB2$onCleanup(exit_iterable);
|
|
6018
|
-
$i7OB2$
|
|
6017
|
+
$i7OB2$catchify(async () => {
|
|
6019
6018
|
for await (const href of exitable_iterable)
|
|
6020
6019
|
// use native links so ppl can cmdclick/right click and open in new tab and see target URL
|
|
6021
6020
|
set_current_href(href);
|
|
@@ -6401,7 +6400,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
6401
6400
|
if (!$i7OB2$untrack(() => read_updating_blocked())) previous_value = sfv;
|
|
6402
6401
|
});
|
|
6403
6402
|
const owner = $i7OB2$getOwner();
|
|
6404
|
-
const handler = $i7OB2$
|
|
6403
|
+
const handler = $i7OB2$catchify(({
|
|
6405
6404
|
keyCode: keyCode
|
|
6406
6405
|
}) => $i7OB2$untrack(() => {
|
|
6407
6406
|
const up = keyCode === 38;
|
|
@@ -6461,7 +6460,7 @@ function $15f380f0ce2812cc$var$actual_navigation_working_on_fake_data({
|
|
|
6461
6460
|
const el = element_();
|
|
6462
6461
|
if (!el) return;
|
|
6463
6462
|
el.addEventListener("keyup", handler);
|
|
6464
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6463
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => el.removeEventListener("keyup", handler)));
|
|
6465
6464
|
});
|
|
6466
6465
|
}
|
|
6467
6466
|
function $1ae0eaca6ada9753$export$af0124069c150252({
|
|
@@ -6659,7 +6658,7 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
6659
6658
|
if (process.env.GA === "false") return;
|
|
6660
6659
|
let debounce_timeout;
|
|
6661
6660
|
const stop_timeout = () => clearTimeout(debounce_timeout);
|
|
6662
|
-
const send_to_ga = $i7OB2$
|
|
6661
|
+
const send_to_ga = $i7OB2$catchify(() => {
|
|
6663
6662
|
const fake_url = new URL(location.href);
|
|
6664
6663
|
const {
|
|
6665
6664
|
searchParams: searchParams
|
|
@@ -6672,12 +6671,12 @@ function $c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
|
6672
6671
|
$i7OB2$onCleanup(() => {
|
|
6673
6672
|
setTimeout(
|
|
6674
6673
|
// do it next event loop because search_field_value_ is wrong this one and search_query might be too because we want the old value to be put into the history entry and a framework like NextJS might take some time to navigate
|
|
6675
|
-
$i7OB2$
|
|
6674
|
+
$i7OB2$catchify(() => {
|
|
6676
6675
|
if ($i7OB2$untrack(get_search_query_) === $i7OB2$untrack(get_search_field_value_)) stop_timeout();
|
|
6677
6676
|
}));
|
|
6678
6677
|
});
|
|
6679
6678
|
let first_call = true;
|
|
6680
|
-
$i7OB2$createEffect($i7OB2$
|
|
6679
|
+
$i7OB2$createEffect($i7OB2$catchify(() => {
|
|
6681
6680
|
get_search_field_value_();
|
|
6682
6681
|
if (first_call) {
|
|
6683
6682
|
// we only want to do stuff when it changes
|
|
@@ -6747,7 +6746,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({
|
|
|
6747
6746
|
const [input_field, set_input_field] = $i7OB2$createSignal();
|
|
6748
6747
|
const [get_search_field_value_] = search_field_value_;
|
|
6749
6748
|
const [get_modal_search_results, set_modal_search_results_] = $i7OB2$createSignal();
|
|
6750
|
-
const close_on_escape_handler = $i7OB2$
|
|
6749
|
+
const close_on_escape_handler = $i7OB2$catchify(({
|
|
6751
6750
|
key: key
|
|
6752
6751
|
}) => {
|
|
6753
6752
|
if (key === "Escape") close_modal_();
|
|
@@ -6762,7 +6761,7 @@ function $fabfda1230351b1a$export$1c593cbd6f1e10bc({
|
|
|
6762
6761
|
if (disable_scrolling_) $aea1edf92433e81e$export$fe334901e8bebd57();
|
|
6763
6762
|
$fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal_, search_query_url_param_name_);
|
|
6764
6763
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
6765
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6764
|
+
$i7OB2$onCleanup($i7OB2$catchify(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
6766
6765
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
6767
6766
|
$c64d28ca12452b21$export$3340fdd8259bd4fd({
|
|
6768
6767
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -6867,8 +6866,8 @@ function $fabfda1230351b1a$var$close_modal_when_navigating_away(close_modal, sea
|
|
|
6867
6866
|
let set_initial_values = false;
|
|
6868
6867
|
let old_pathname;
|
|
6869
6868
|
let old_param_value;
|
|
6870
|
-
$i7OB2$onCleanup($i7OB2$
|
|
6871
|
-
$i7OB2$
|
|
6869
|
+
$i7OB2$onCleanup($i7OB2$catchify(exit_iterable));
|
|
6870
|
+
$i7OB2$catchify(async () => {
|
|
6872
6871
|
for await (const href of exitable_iterable) {
|
|
6873
6872
|
const u_o = new URL(href);
|
|
6874
6873
|
const new_pathname = u_o.pathname;
|
|
@@ -6933,7 +6932,7 @@ function $f8c929beb82c512b$export$9dd50d35b9d94fdf({
|
|
|
6933
6932
|
number_of_results_: number_of_results_,
|
|
6934
6933
|
type: type
|
|
6935
6934
|
}) {
|
|
6936
|
-
const contents = $i7OB2$createMemo($i7OB2$
|
|
6935
|
+
const contents = $i7OB2$createMemo($i7OB2$catchify(() => {
|
|
6937
6936
|
const q = get_search_query_();
|
|
6938
6937
|
return i18n_[type === $f8c929beb82c512b$export$2452208c79fe93ea.content ? "get_showing_pages_for_" : "get_showing_results_for_"]()($i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(q)), $i7OB2$ssr($f8c929beb82c512b$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(formatted_number_of_results_())), !!q, number_of_results_());
|
|
6939
6938
|
}));
|
|
@@ -7191,7 +7190,7 @@ function $b2bf2cdcff8142d8$export$f631859cab12b342({
|
|
|
7191
7190
|
if (!result) return;
|
|
7192
7191
|
return {
|
|
7193
7192
|
href: result.page_url,
|
|
7194
|
-
onClick: $i7OB2$
|
|
7193
|
+
onClick: $i7OB2$catchify(ev => router_.navigate_.go_to_({
|
|
7195
7194
|
new_url_: result.page_url,
|
|
7196
7195
|
is_replace_: false,
|
|
7197
7196
|
event_: ev
|
|
@@ -7444,7 +7443,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7444
7443
|
} : {})
|
|
7445
7444
|
};
|
|
7446
7445
|
});
|
|
7447
|
-
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$
|
|
7446
|
+
const [search_results_] = $i7OB2$createResource(search_query_base_, $i7OB2$catchify(async base_query => {
|
|
7448
7447
|
set_all_products_loaded(false);
|
|
7449
7448
|
// only first page of results
|
|
7450
7449
|
return await $641bba2917fe862b$export$cc42dd29bf655ab6({
|
|
@@ -7472,7 +7471,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7472
7471
|
const available_filters_ = $i7OB2$createMemo(() => search_results_()?.filters);
|
|
7473
7472
|
const modal_body_style = $i7OB2$createSignal({});
|
|
7474
7473
|
const [get_search_field_elements, set_search_field_elements] = $i7OB2$createSignal();
|
|
7475
|
-
const SafeSearchField = $i7OB2$
|
|
7474
|
+
const SafeSearchField = $i7OB2$catchify((0, $5285d2814d0fac0c$export$b94867ecbd698f21));
|
|
7476
7475
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $i7OB2$createSignal(false);
|
|
7477
7476
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $i7OB2$createSignal();
|
|
7478
7477
|
const n_hits = $i7OB2$createMemo(() => search_results_()?.n_hits);
|
|
@@ -7520,7 +7519,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7520
7519
|
$i7OB2$runWithOwner(owner, () => results_filters[1](matches ? [results_for, filters_opener] : $i7OB2$ssr($7097477c78a89208$var$_tmpl$, $i7OB2$ssrHydrationKey(), $i7OB2$escape(results_for), $i7OB2$escape(filters_opener))));
|
|
7521
7520
|
}).remove);
|
|
7522
7521
|
$2ab89d64b7f1d5ef$export$d31a1a1a83ad9413(search_results_, selected_filters_);
|
|
7523
|
-
$i7OB2$
|
|
7522
|
+
$i7OB2$catchify((0, $641bba2917fe862b$export$6e49da55e449af7c))({
|
|
7524
7523
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7525
7524
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
7526
7525
|
id_: get_search_query_,
|
|
@@ -7558,8 +7557,8 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7558
7557
|
if (!search_field) break add_input_field;
|
|
7559
7558
|
modal_body_style[1]({});
|
|
7560
7559
|
modal_body_style_ref_?.(modal_body_style);
|
|
7561
|
-
const align_position = $i7OB2$
|
|
7562
|
-
div_with_field_class.addEventListener("click", $i7OB2$
|
|
7560
|
+
const align_position = $i7OB2$catchify((0, $b6d5529b253681aa$export$b3ad617e9036868))(modal_body_style, search_field, undefined, true);
|
|
7561
|
+
div_with_field_class.addEventListener("click", $i7OB2$catchify(e => {
|
|
7563
7562
|
const target = e.target;
|
|
7564
7563
|
const sel = ".submit";
|
|
7565
7564
|
if (target?.matches?.(sel) || target?.closest?.(sel))
|
|
@@ -7719,7 +7718,7 @@ function $7097477c78a89208$export$a54ec244c8863715({
|
|
|
7719
7718
|
function $4ca91518c9a35379$export$828dcdd425fd3231(aligner) {
|
|
7720
7719
|
const style_element = document.createElement("style");
|
|
7721
7720
|
document.head.append(style_element);
|
|
7722
|
-
const resize_observer = new ResizeObserver($i7OB2$
|
|
7721
|
+
const resize_observer = new ResizeObserver($i7OB2$catchify(() => {
|
|
7723
7722
|
const styles = $926b1b5ba2239356$export$1233ca167bf71f9a({
|
|
7724
7723
|
".depict.plp .depict-search-modal .search-field": {
|
|
7725
7724
|
"height": `${aligner?.clientHeight}px`
|
|
@@ -7882,7 +7881,7 @@ class $806c97b931758897$export$ac6237957a15b3f0 {
|
|
|
7882
7881
|
selected_filters_: selected_filters_
|
|
7883
7882
|
});
|
|
7884
7883
|
$90980bd87c9960f9$export$5162a71f252e6122();
|
|
7885
|
-
$i7OB2$
|
|
7884
|
+
$i7OB2$catchify(async () => {
|
|
7886
7885
|
const {
|
|
7887
7886
|
open_modal_: open_modal_,
|
|
7888
7887
|
close_modal_: close_modal_
|
|
@@ -8149,7 +8148,7 @@ function $806c97b931758897$export$316f6f283ae64765(props) {
|
|
|
8149
8148
|
const style_props_ = $i7OB2$createSignal({
|
|
8150
8149
|
position: "fixed"
|
|
8151
8150
|
});
|
|
8152
|
-
const defaultHandler = $i7OB2$
|
|
8151
|
+
const defaultHandler = $i7OB2$catchify(() => {
|
|
8153
8152
|
// When selecting text in the SearchField that's in the page we want the same selection to persist. It doesn't by itself, since the SearchModal has an entirely different SearchField. Therefore, we manually copy the selection over.
|
|
8154
8153
|
const selected_text_range_ = [input_element.selectionStart, input_element.selectionEnd];
|
|
8155
8154
|
const {
|
|
@@ -8237,7 +8236,7 @@ const $6891c018a834cfdd$export$d86a33413558014e = openModalParams => {
|
|
|
8237
8236
|
}, dispose_aligner];
|
|
8238
8237
|
};
|
|
8239
8238
|
function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
8240
|
-
const handler = $i7OB2$
|
|
8239
|
+
const handler = $i7OB2$catchify(e => {
|
|
8241
8240
|
const {
|
|
8242
8241
|
key: key,
|
|
8243
8242
|
target: target
|
|
@@ -8256,7 +8255,7 @@ function $6e8944558258054f$export$d0596b5cae35ad4(open_search) {
|
|
|
8256
8255
|
function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
8257
8256
|
let old_url;
|
|
8258
8257
|
let disconnect_link_observer;
|
|
8259
|
-
const link_handler = $i7OB2$
|
|
8258
|
+
const link_handler = $i7OB2$catchify(e => {
|
|
8260
8259
|
const link = e.currentTarget || e.target;
|
|
8261
8260
|
if (link.href === old_url) {
|
|
8262
8261
|
history.pushState(history.state, "", link.href);
|
|
@@ -8265,7 +8264,7 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
8265
8264
|
});
|
|
8266
8265
|
let remove_added_listeners;
|
|
8267
8266
|
let resolve_remove_added_listeners;
|
|
8268
|
-
pr.addEventListener("open", $i7OB2$
|
|
8267
|
+
pr.addEventListener("open", $i7OB2$catchify(() => {
|
|
8269
8268
|
remove_added_listeners = new Promise(r => resolve_remove_added_listeners = r);
|
|
8270
8269
|
disconnect_link_observer = (0, $i7OB2$observer).onexists("a", async ({
|
|
8271
8270
|
element: element
|
|
@@ -8275,11 +8274,11 @@ function $6936724b9e0b98d5$export$689e204eadb33baf(pr) {
|
|
|
8275
8274
|
element.removeEventListener("click", link_handler);
|
|
8276
8275
|
});
|
|
8277
8276
|
}));
|
|
8278
|
-
pr.addEventListener("close", $i7OB2$
|
|
8277
|
+
pr.addEventListener("close", $i7OB2$catchify(() => {
|
|
8279
8278
|
disconnect_link_observer?.();
|
|
8280
8279
|
resolve_remove_added_listeners?.();
|
|
8281
8280
|
}));
|
|
8282
|
-
$i7OB2$
|
|
8281
|
+
$i7OB2$catchify(async () => {
|
|
8283
8282
|
for await (const href of (0, $i7OB2$href_change_ipns)) if (!pr.is_page_(new URL(href))) old_url = href;
|
|
8284
8283
|
})();
|
|
8285
8284
|
}
|
|
@@ -8291,7 +8290,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8291
8290
|
static #reverting_permitted = true;
|
|
8292
8291
|
static #visited_urls = (() => {
|
|
8293
8292
|
// Keep track of all URLs that have been visited since the document that was initially loaded (loaded means the process where the browser creates a new `document` and `window` object).
|
|
8294
|
-
$i7OB2$
|
|
8293
|
+
$i7OB2$catchify(async () => {
|
|
8295
8294
|
// Static initialization blocks aren't supported in MobileSafari yet, otherwise this would be one.
|
|
8296
8295
|
// I don't think we want to ship a library that users are *forced* to transpile, it should run in the newest version of all major browsers. So we'll just use a function wrapper for now (adding "last 1 ios version" to the build target does a bunch of other unneeded transpilations).
|
|
8297
8296
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
|
|
@@ -8309,7 +8308,7 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8309
8308
|
async #listen() {
|
|
8310
8309
|
const [exit_ipns, exitable_ipns] = $i7OB2$make_asyncIterable_exiter((0, $i7OB2$href_change_ipns));
|
|
8311
8310
|
this.#stop_listening = exit_ipns;
|
|
8312
|
-
const caught_page_check_fn = $i7OB2$
|
|
8311
|
+
const caught_page_check_fn = $i7OB2$catchify(this.is_page_, "page check failed");
|
|
8313
8312
|
for await (const href of exitable_ipns) {
|
|
8314
8313
|
const url = new URL(href);
|
|
8315
8314
|
if (!caught_page_check_fn(url)) {
|
|
@@ -8327,17 +8326,17 @@ class $753e9b2889a47c89$export$3ccaa27d81dd8556 extends EventTarget {
|
|
|
8327
8326
|
this.addEventListener("close", dispose, {
|
|
8328
8327
|
once: true
|
|
8329
8328
|
});
|
|
8330
|
-
return $i7OB2$
|
|
8329
|
+
return $i7OB2$catchify(this.render_, "rendering failed")() || [];
|
|
8331
8330
|
});
|
|
8332
8331
|
}
|
|
8333
|
-
#unload = $i7OB2$
|
|
8332
|
+
#unload = $i7OB2$catchify(() => {
|
|
8334
8333
|
if (!this.#is_open) return;
|
|
8335
8334
|
this.#disconnect_observer?.();
|
|
8336
8335
|
if ($753e9b2889a47c89$export$3ccaa27d81dd8556.#reverting_permitted) while (this.#revert_fns.length) this.#revert_fns.pop()?.();
|
|
8337
8336
|
this.#is_open = false;
|
|
8338
8337
|
this.dispatchEvent(new CustomEvent("close"));
|
|
8339
8338
|
}, "failed to close page");
|
|
8340
|
-
#load = $i7OB2$
|
|
8339
|
+
#load = $i7OB2$catchify(async els => {
|
|
8341
8340
|
this.#is_open = true;
|
|
8342
8341
|
// So that #load doesn't get called again
|
|
8343
8342
|
let set_should_stay_inserted;
|