@depict-ai/ui 3.0.3 → 3.0.4
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 +133 -132
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +135 -134
- package/latest/index.cjs +110 -94
- package/latest/index.d.ts +211 -201
- package/latest/index.js +112 -96
- package/package.json +4 -4
- package/server/ES10/index.cjs +108 -107
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +110 -109
- package/server/latest/index.cjs +99 -89
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +101 -91
- package/locales/require.js +0 -1152
package/server/ES10/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { add_to_version_info as $b8hua$add_to_version_info, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, catchify as $b8hua$catchify1, observer as $b8hua$observer, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, report as $b8hua$report, dlog as $b8hua$dlog, ContainedImage as $b8hua$ContainedImage, use_href_accessor as $b8hua$use_href_accessor1, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, queueMacroTask as $b8hua$queueMacroTask, is_safari as $b8hua$is_safari, slider_fractional_factory as $b8hua$slider_fractional_factory, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, fetch_retry as $b8hua$fetch_retry, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj,
|
|
1
|
+
import { add_to_version_info as $b8hua$add_to_version_info, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, get_session_id as $b8hua$get_session_id, add_version_query_params as $b8hua$add_version_query_params, base_url as $b8hua$base_url, dwarn as $b8hua$dwarn, catchify as $b8hua$catchify1, observer as $b8hua$observer, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, report as $b8hua$report, dlog as $b8hua$dlog, ContainedImage as $b8hua$ContainedImage, use_href_accessor as $b8hua$use_href_accessor1, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, queueMacroTask as $b8hua$queueMacroTask, is_safari as $b8hua$is_safari, slider_fractional_factory as $b8hua$slider_fractional_factory, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, snakeCasifyObject as $b8hua$snakeCasifyObject, fetch_retry as $b8hua$fetch_retry, make_url_with_query_params as $b8hua$make_url_with_query_params, sort_obj as $b8hua$sort_obj, javascript_media_query as $b8hua$javascript_media_query, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ListenableSet as $b8hua$ListenableSet1, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import { createComponent as $b8hua$createComponent, mergeProps as $b8hua$mergeProps, Dynamic as $b8hua$Dynamic, ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, escape as $b8hua$escape, ssrAttribute as $b8hua$ssrAttribute, insert as $b8hua$insert, ssrElement as $b8hua$ssrElement, ssrClassList as $b8hua$ssrClassList, ssrStyle as $b8hua$ssrStyle, isServer as $b8hua$isServer, spread as $b8hua$spread } from "solid-js/web";
|
|
3
3
|
import { createContext as $b8hua$createContext, useContext as $b8hua$useContext, createSignal as $b8hua$createSignal, createSelector as $b8hua$createSelector, getOwner as $b8hua$getOwner, runWithOwner as $b8hua$runWithOwner, Index as $b8hua$Index, createMemo as $b8hua$createMemo, children as $b8hua$children, onCleanup as $b8hua$onCleanup, createEffect as $b8hua$createEffect, untrack as $b8hua$untrack, Show as $b8hua$Show, createUniqueId as $b8hua$createUniqueId, mergeProps as $b8hua$mergeProps1, ErrorBoundary as $b8hua$ErrorBoundary, createResource as $b8hua$createResource, splitProps as $b8hua$splitProps, createRoot as $b8hua$createRoot, createRenderEffect as $b8hua$createRenderEffect, batch as $b8hua$batch, Suspense as $b8hua$Suspense, on as $b8hua$on, For as $b8hua$For, createComputed as $b8hua$createComputed, createReaction as $b8hua$createReaction, mapArray as $b8hua$mapArray } from "solid-js";
|
|
4
|
-
import { ListenableSet as $b8hua$ListenableSet, catchify as $b8hua$catchify, use_href_accessor as $b8hua$use_href_accessor } from "@depict-ai/utilishared/ES10";
|
|
4
|
+
import { ListenableSet as $b8hua$ListenableSet, catchify as $b8hua$catchify, use_href_accessor as $b8hua$use_href_accessor, report as $b8hua$report1 } from "@depict-ai/utilishared/ES10";
|
|
5
5
|
import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
6
|
import $b8hua$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
7
7
|
import $b8hua$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
@@ -10,7 +10,7 @@ import { createStore as $b8hua$createStore, reconcile as $b8hua$reconcile } from
|
|
|
10
10
|
/*! Depict.ai search and product listing SDK */
|
|
11
11
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
12
12
|
register_es_version("ui", "ES10");
|
|
13
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.
|
|
13
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "3.0.4";
|
|
14
14
|
const $ca6ab5f08bd28bca$var$_tmpl$ = ["<svg", ' xmlns="http://www.w3.org/2000/svg"', ' viewBox="0 0 14 26"><path d="M2 24.656c-.078 0-.156-.016-.234-.047s-.133-.066-.187-.129c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422l10.371-10.371L1.578 2.883c-.117-.117-.176-.258-.176-.422s.059-.305.176-.422.258-.176.422-.176.305.059.422.176l10.805 10.793a.59.59 0 0 1 .176.434c0 .172-.059.305-.176.422L2.422 24.48a.42.42 0 0 1-.199.129.54.54 0 0 1-.223.047zm0 0" fill="#0f0f0f"></path></svg>'];
|
|
15
15
|
function $ca6ab5f08bd28bca$export$8be2714ec7f169ee() {
|
|
16
16
|
var _$escape2, _$escape3;
|
|
@@ -347,12 +347,12 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
|
347
347
|
* Vue has async router that needs to be awaited (it navigates after a microtask)
|
|
348
348
|
* This standardises waiting for all kinds of routers
|
|
349
349
|
*/
|
|
350
|
-
constructor(on_navigation,
|
|
350
|
+
constructor(on_navigation, listing_query_state_key) {
|
|
351
351
|
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_get_navigation_happened_promise);
|
|
352
352
|
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_dont_attempt_navigation);
|
|
353
353
|
$ac571292d606f30b$var$_classPrivateMethodInitSpec(this, $ac571292d606f30b$var$_throwing_on_navigation);
|
|
354
354
|
$b8hua$babelruntimehelpersdefineProperty(this, "on_navigation_", void 0);
|
|
355
|
-
$b8hua$babelruntimehelpersdefineProperty(this, "
|
|
355
|
+
$b8hua$babelruntimehelpersdefineProperty(this, "listing_query_state_key", void 0);
|
|
356
356
|
$b8hua$babelruntimehelpersdefineProperty(this, "navigate_", {
|
|
357
357
|
/**
|
|
358
358
|
* Call this if you *just* want to replace the state object in history.state
|
|
@@ -376,7 +376,7 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
|
376
376
|
event_: event_,
|
|
377
377
|
force_spa_navigation_: force_spa_navigation_,
|
|
378
378
|
is_replace_: is_replace_,
|
|
379
|
-
|
|
379
|
+
listing_query_: listing_query_,
|
|
380
380
|
scroll = true
|
|
381
381
|
} = _ref;
|
|
382
382
|
const new_url_ = raw_new_url instanceof URL ? raw_new_url : new URL(raw_new_url, location.origin);
|
|
@@ -397,10 +397,10 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
|
397
397
|
if (force_spa_navigation_ && wants_hard_navigation) {
|
|
398
398
|
// Don't allow hard navigation if we're forcing SPA navigation, which we do for things where PageReplacer can be used for performance
|
|
399
399
|
const new_state = history.state;
|
|
400
|
-
if (
|
|
400
|
+
if (listing_query_) {
|
|
401
401
|
// In JS-UI we need to know the listing_id of the current category, therefore push it into state
|
|
402
|
-
if (!this.
|
|
403
|
-
new_state[this.
|
|
402
|
+
if (!this.listing_query_state_key) $b8hua$report(new Error("listing_query_state_key is not set"), "error");
|
|
403
|
+
new_state[this.listing_query_state_key] = listing_query_;
|
|
404
404
|
}
|
|
405
405
|
history[is_replace_ ? "replaceState" : "pushState"](new_state, "", new_url_);
|
|
406
406
|
} else $ac571292d606f30b$var$_classPrivateMethodGet(this, $ac571292d606f30b$var$_throwing_on_navigation, $ac571292d606f30b$var$_throwing_on_navigation2).call(this, {
|
|
@@ -411,7 +411,7 @@ class $ac571292d606f30b$export$7e1297a3a19f10d8 {
|
|
|
411
411
|
await promise;
|
|
412
412
|
})
|
|
413
413
|
});
|
|
414
|
-
this.
|
|
414
|
+
this.listing_query_state_key = listing_query_state_key;
|
|
415
415
|
this.on_navigation_ = on_navigation;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -4672,6 +4672,8 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
|
|
|
4672
4672
|
}
|
|
4673
4673
|
return api_response;
|
|
4674
4674
|
}
|
|
4675
|
+
const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
|
|
4676
|
+
const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
|
|
4675
4677
|
function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
4676
4678
|
$284849364a6ef73a$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
4677
4679
|
privateSet.add(obj);
|
|
@@ -4780,9 +4782,14 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4780
4782
|
})
|
|
4781
4783
|
});
|
|
4782
4784
|
}
|
|
4783
|
-
async get_listing(
|
|
4785
|
+
async get_listing(_ref) {
|
|
4786
|
+
let {
|
|
4787
|
+
id_type_: id_type_,
|
|
4788
|
+
id_to_query_for_: id_to_query_for_,
|
|
4789
|
+
...input_req
|
|
4790
|
+
} = _ref;
|
|
4784
4791
|
return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_cached_request, $284849364a6ef73a$var$_cached_request2).call(this, {
|
|
4785
|
-
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
4792
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
4786
4793
|
input_req_: input_req,
|
|
4787
4794
|
fallback_response_: () => ({
|
|
4788
4795
|
listing_id: "",
|
|
@@ -4796,20 +4803,18 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4796
4803
|
"quick_links": [],
|
|
4797
4804
|
failed: true
|
|
4798
4805
|
}),
|
|
4799
|
-
method_: "GET"
|
|
4800
|
-
delete_key_before_sending_: "listing_id" // this goes into the path, but we still need to have it in the request object until the last second as we want to include it as a key when caching requests
|
|
4806
|
+
method_: "GET"
|
|
4801
4807
|
});
|
|
4802
4808
|
}
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
...
|
|
4808
|
-
};
|
|
4809
|
-
delete cloned_request["listing_id"];
|
|
4809
|
+
async get_listing_products(_ref2) {
|
|
4810
|
+
let {
|
|
4811
|
+
id_to_query_for_: id_to_query_for_,
|
|
4812
|
+
id_type_: id_type_,
|
|
4813
|
+
...input_req_
|
|
4814
|
+
} = _ref2;
|
|
4810
4815
|
return await $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_cached_request, $284849364a6ef73a$var$_cached_request2).call(this, {
|
|
4811
|
-
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + encodeURIComponent(
|
|
4812
|
-
input_req_:
|
|
4816
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
4817
|
+
input_req_: input_req_,
|
|
4813
4818
|
fallback_response_: () => ({
|
|
4814
4819
|
"n_hits": 0,
|
|
4815
4820
|
"displays": [],
|
|
@@ -4847,7 +4852,7 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
4847
4852
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
4848
4853
|
if (!category_transformer) return response;
|
|
4849
4854
|
// find category suggestions, run thing with them, and then replace them
|
|
4850
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
4855
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
4851
4856
|
const transformed_category_suggestions = await category_transformer({
|
|
4852
4857
|
market: market,
|
|
4853
4858
|
merchant: merchant,
|
|
@@ -4893,15 +4898,14 @@ async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchan
|
|
|
4893
4898
|
});
|
|
4894
4899
|
return input_data;
|
|
4895
4900
|
}
|
|
4896
|
-
async function $284849364a6ef73a$var$_cached_request2(
|
|
4901
|
+
async function $284849364a6ef73a$var$_cached_request2(_ref3) {
|
|
4897
4902
|
var _classPrivateFieldGet5, _cache_obj$cache_$bod, _cache_obj$cache_$bod2;
|
|
4898
4903
|
let {
|
|
4899
4904
|
endpoint_: endpoint_,
|
|
4900
4905
|
input_req_: input_req_,
|
|
4901
4906
|
fallback_response_: fallback_response_,
|
|
4902
|
-
method_ = "POST"
|
|
4903
|
-
|
|
4904
|
-
} = _ref;
|
|
4907
|
+
method_ = "POST"
|
|
4908
|
+
} = _ref3;
|
|
4905
4909
|
const cache_obj = $284849364a6ef73a$var$_classPrivateMethodGet(this, $284849364a6ef73a$var$_get_cache_obj_for_endpoint, $284849364a6ef73a$var$_get_cache_obj_for_endpoint2).call(this, endpoint_);
|
|
4906
4910
|
const with_ids = $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_add_ids_to_request).call(this, input_req_);
|
|
4907
4911
|
const metaData = await ((_classPrivateFieldGet5 = $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_get_metadata)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.call(this));
|
|
@@ -4918,7 +4922,6 @@ async function $284849364a6ef73a$var$_cached_request2(_ref) {
|
|
|
4918
4922
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
4919
4923
|
try {
|
|
4920
4924
|
const is_post = method_ === "POST";
|
|
4921
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
4922
4925
|
const url_to_request = is_post ? endpoint_ : $b8hua$make_url_with_query_params(endpoint_, sorted_request);
|
|
4923
4926
|
const api_response = await $b8hua$fetch_retry($b8hua$add_version_query_params(url_to_request), {
|
|
4924
4927
|
method: method_,
|
|
@@ -5254,7 +5257,7 @@ function $6d2962bc9370f884$export$5e4aed86c12acdd9(_ref) {
|
|
|
5254
5257
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
5255
5258
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
5256
5259
|
// dlog("loading ", number_of_results_to_load, "products, because it was", now - last_loaded, "ms since last load");
|
|
5257
|
-
const api_response = await depict_api_["
|
|
5260
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
5258
5261
|
cursor: get_last_cursor(),
|
|
5259
5262
|
limit: number_of_results_to_load,
|
|
5260
5263
|
...base_part
|
|
@@ -6634,11 +6637,12 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6634
6637
|
let {
|
|
6635
6638
|
quicklinks_data_: quicklinks_data_,
|
|
6636
6639
|
router_: router_,
|
|
6637
|
-
|
|
6640
|
+
id_to_query_for_: id_to_query_for_,
|
|
6638
6641
|
breadcrumb_data_: breadcrumb_data_,
|
|
6639
6642
|
i18n_: i18n_,
|
|
6640
6643
|
sorting_query_param_: sorting_query_param_,
|
|
6641
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
6644
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
6645
|
+
id_type_: id_type_
|
|
6642
6646
|
} = _ref;
|
|
6643
6647
|
let scrolling_logic_ran_for_listing_id = false;
|
|
6644
6648
|
let last_scroll_position;
|
|
@@ -6646,13 +6650,13 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6646
6650
|
let last_was_placeholder = false;
|
|
6647
6651
|
let sliding_element;
|
|
6648
6652
|
$b8hua$createComputed(() => {
|
|
6649
|
-
|
|
6653
|
+
id_to_query_for_();
|
|
6650
6654
|
scrolling_logic_ran_for_listing_id = false;
|
|
6651
6655
|
});
|
|
6652
6656
|
const place_holdey_quicklinks_data = $b8hua$createMemo(() => quicklinks_data_() || [,,,]);
|
|
6653
6657
|
const selected_index = $b8hua$createMemo(() => {
|
|
6654
6658
|
var _quicklinks_data_;
|
|
6655
|
-
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item
|
|
6659
|
+
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item[id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id"] === id_to_query_for_());
|
|
6656
6660
|
}); // this will be -1 when viewing child categories
|
|
6657
6661
|
const scrollpos_per_listing_id = {};
|
|
6658
6662
|
const mutation_plugins = [function () {
|
|
@@ -6662,7 +6666,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6662
6666
|
} = this.insert_here;
|
|
6663
6667
|
if (scrollLeft > 0) {
|
|
6664
6668
|
last_scroll_position = scrollLeft;
|
|
6665
|
-
const current_id = $b8hua$untrack(
|
|
6669
|
+
const current_id = $b8hua$untrack(id_to_query_for_);
|
|
6666
6670
|
// make sure to not save position where selected item isn't in viewport
|
|
6667
6671
|
const current_selected_index = $b8hua$untrack(selected_index);
|
|
6668
6672
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -6727,7 +6731,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6727
6731
|
equals: false
|
|
6728
6732
|
}), new_data => {
|
|
6729
6733
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
6730
|
-
const current_id =
|
|
6734
|
+
const current_id = id_to_query_for_();
|
|
6731
6735
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
6732
6736
|
const owner = $b8hua$getOwner();
|
|
6733
6737
|
queueMicrotask(() => {
|
|
@@ -6778,13 +6782,9 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6778
6782
|
// Solution: instead of not adding the state to the url, add a flag to the link if it's a sibling and then display the toast on load if the flag is set
|
|
6779
6783
|
const is_sibling = $b8hua$createMemo(() => {
|
|
6780
6784
|
var _quicklinks_data_2;
|
|
6781
|
-
const current_id =
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
listing_id: listing_id
|
|
6785
|
-
} = _ref3;
|
|
6786
|
-
return listing_id === current_id;
|
|
6787
|
-
});
|
|
6785
|
+
const current_id = id_to_query_for_();
|
|
6786
|
+
const lookForId = id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
6787
|
+
return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(quickLink => quickLink[lookForId] === current_id);
|
|
6788
6788
|
});
|
|
6789
6789
|
const href = $b8hua$createMemo(() => {
|
|
6790
6790
|
var _display_accessor;
|
|
@@ -7003,13 +7003,14 @@ function $b4465d8d605f61e9$export$8895d39404bd2bb1(props) {
|
|
|
7003
7003
|
function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
7004
7004
|
let {
|
|
7005
7005
|
crumb_data_: crumb_data_,
|
|
7006
|
-
|
|
7006
|
+
id_to_query_for_: id_to_query_for_,
|
|
7007
7007
|
i18n_: i18n_,
|
|
7008
7008
|
selected_filters_: selected_filters_,
|
|
7009
7009
|
local_filter_cache_: local_filter_cache_,
|
|
7010
7010
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7011
7011
|
plp_results_: plp_results_,
|
|
7012
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7012
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7013
|
+
id_type_: id_type_
|
|
7013
7014
|
} = _ref;
|
|
7014
7015
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
7015
7016
|
$a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -7020,17 +7021,21 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
7020
7021
|
i18n_: i18n_,
|
|
7021
7022
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7022
7023
|
});
|
|
7023
|
-
//
|
|
7024
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
7024
7025
|
let previous_crumb_data = $b8hua$untrack(crumb_data_);
|
|
7025
|
-
let
|
|
7026
|
+
let id_when_we_got_previous_data = {
|
|
7027
|
+
id_: $b8hua$untrack(id_to_query_for_),
|
|
7028
|
+
type_: $b8hua$untrack(id_type_)
|
|
7029
|
+
};
|
|
7026
7030
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
7027
7031
|
// temporarily disable filter clearing when going backwards/forwards
|
|
7028
7032
|
const handler = () => allow_filter_clearing = false;
|
|
7029
7033
|
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
|
|
7030
7034
|
$b8hua$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
7031
7035
|
$b8hua$createEffect($b8hua$on(crumb_data_, $b8hua$catchify1(new_crumb_data => {
|
|
7032
|
-
const
|
|
7033
|
-
|
|
7036
|
+
const id_of_new_data = id_to_query_for_();
|
|
7037
|
+
const type_of_id_of_new_data = id_type_();
|
|
7038
|
+
if (allow_filter_clearing && previous_crumb_data && new_crumb_data && (id_of_new_data !== id_when_we_got_previous_data.id_ || type_of_id_of_new_data !== id_when_we_got_previous_data.type_)) {
|
|
7034
7039
|
const previous_length = previous_crumb_data.length;
|
|
7035
7040
|
const new_length = new_crumb_data.length;
|
|
7036
7041
|
const went_upwards = new_length < previous_length;
|
|
@@ -7056,7 +7061,10 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
7056
7061
|
sideways_filter_clearing_flag_[1](false);
|
|
7057
7062
|
}
|
|
7058
7063
|
}
|
|
7059
|
-
|
|
7064
|
+
id_when_we_got_previous_data = {
|
|
7065
|
+
id_: id_of_new_data,
|
|
7066
|
+
type_: type_of_id_of_new_data
|
|
7067
|
+
};
|
|
7060
7068
|
previous_crumb_data = new_crumb_data;
|
|
7061
7069
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
7062
7070
|
})));
|
|
@@ -7124,8 +7132,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7124
7132
|
var _on_filters_construct;
|
|
7125
7133
|
let {
|
|
7126
7134
|
depict_api_: depict_api_,
|
|
7127
|
-
|
|
7128
|
-
|
|
7135
|
+
id_to_query_for_: id_to_query_for_,
|
|
7136
|
+
id_type_: id_type_,
|
|
7129
7137
|
current_sorting_: current_sorting_,
|
|
7130
7138
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7131
7139
|
category_filters_open_: category_filters_open_,
|
|
@@ -7178,7 +7186,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7178
7186
|
merchant: merchant_(),
|
|
7179
7187
|
market: market_(),
|
|
7180
7188
|
locale: backend_locale_(),
|
|
7181
|
-
|
|
7189
|
+
id_to_query_for_: id_to_query_for_(),
|
|
7190
|
+
id_type_: id_type_(),
|
|
7182
7191
|
...(f.length ? {
|
|
7183
7192
|
filters: f
|
|
7184
7193
|
} : {}),
|
|
@@ -7190,8 +7199,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7190
7199
|
// Make "Get products in listing" request to get products in listing
|
|
7191
7200
|
const [plp_products_] = $b8hua$createResource(products_query_base_,
|
|
7192
7201
|
// 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)
|
|
7193
|
-
$b8hua$
|
|
7194
|
-
id_: $b8hua$untrack(
|
|
7202
|
+
$b8hua$catchify(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
|
|
7203
|
+
id_: $b8hua$untrack(id_to_query_for_),
|
|
7195
7204
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7196
7205
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7197
7206
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -7206,10 +7215,11 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7206
7215
|
merchant: merchant_(),
|
|
7207
7216
|
market: market_(),
|
|
7208
7217
|
locale: backend_locale_(),
|
|
7209
|
-
|
|
7218
|
+
id_to_query_for_: id_to_query_for_(),
|
|
7219
|
+
id_type_: id_type_()
|
|
7210
7220
|
}));
|
|
7211
7221
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
7212
|
-
const [plp_meta] = $b8hua$createResource(meta_query_base, $b8hua$
|
|
7222
|
+
const [plp_meta] = $b8hua$createResource(meta_query_base, $b8hua$catchify(query => depict_api_.get_listing(query)));
|
|
7213
7223
|
const available_sortings_ = $b8hua$createMemo(() => {
|
|
7214
7224
|
var _plp_products_, _plp_products_$sorts;
|
|
7215
7225
|
return (_plp_products_ = plp_products_()) === null || _plp_products_ === void 0 ? void 0 : (_plp_products_$sorts = _plp_products_.sorts) === null || _plp_products_$sorts === void 0 ? void 0 : _plp_products_$sorts.map(sort => {
|
|
@@ -7233,17 +7243,6 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7233
7243
|
var _plp_meta2;
|
|
7234
7244
|
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
|
|
7235
7245
|
});
|
|
7236
|
-
const meta_tag_data_ = $b8hua$createMemo(() => {
|
|
7237
|
-
var _plp_meta3;
|
|
7238
|
-
if ((_plp_meta3 = plp_meta()) !== null && _plp_meta3 !== void 0 && _plp_meta3.replace_meta_tags) {
|
|
7239
|
-
var _plp_meta4, _plp_meta5;
|
|
7240
|
-
return {
|
|
7241
|
-
title: ((_plp_meta4 = plp_meta()) === null || _plp_meta4 === void 0 ? void 0 : _plp_meta4.title) + (meta_title_suffix_() || ""),
|
|
7242
|
-
description: (_plp_meta5 = plp_meta()) === null || _plp_meta5 === void 0 ? void 0 : _plp_meta5.description
|
|
7243
|
-
};
|
|
7244
|
-
}
|
|
7245
|
-
});
|
|
7246
|
-
$b8hua$edit_current_page_meta_tags(meta_tag_data_);
|
|
7247
7246
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $b8hua$createSignal(false);
|
|
7248
7247
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $b8hua$createSignal();
|
|
7249
7248
|
const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
|
|
@@ -7307,7 +7306,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7307
7306
|
}));
|
|
7308
7307
|
results_for = make_product_count_();
|
|
7309
7308
|
} else {
|
|
7310
|
-
$b8hua$
|
|
7309
|
+
$b8hua$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7311
7310
|
results_for = $b8hua$ssr($4b4b262708b516ee$var$_tmpl$2, $b8hua$ssrHydrationKey());
|
|
7312
7311
|
}
|
|
7313
7312
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
@@ -7329,17 +7328,17 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7329
7328
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7330
7329
|
...extra_sort_and_filter_args_
|
|
7331
7330
|
});
|
|
7332
|
-
$b8hua$
|
|
7331
|
+
$b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
7333
7332
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7334
7333
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
7335
|
-
id_:
|
|
7334
|
+
id_: id_to_query_for_,
|
|
7336
7335
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
7337
7336
|
});
|
|
7338
7337
|
(_on_filters_construct = on_filters_constructed_) === null || _on_filters_construct === void 0 || _on_filters_construct();
|
|
7339
7338
|
$b8hua$createComputed(() => {
|
|
7340
7339
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
7341
7340
|
});
|
|
7342
|
-
$b8hua$createRenderEffect($b8hua$
|
|
7341
|
+
$b8hua$createRenderEffect($b8hua$catchify(async () => {
|
|
7343
7342
|
var _only_show_filters_op;
|
|
7344
7343
|
const slim = is_slim_();
|
|
7345
7344
|
const only_show_filters_opener = (_only_show_filters_op = only_show_filters_opener_) === null || _only_show_filters_op === void 0 ? void 0 : _only_show_filters_op();
|
|
@@ -7353,14 +7352,15 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7353
7352
|
available_filters_: available_filters_
|
|
7354
7353
|
});
|
|
7355
7354
|
$a4777acaffa35a82$export$3945d6db2dfd3d12({
|
|
7356
|
-
|
|
7355
|
+
id_to_query_for_: id_to_query_for_,
|
|
7357
7356
|
crumb_data_: crumb_data_,
|
|
7358
7357
|
i18n_: i18n_,
|
|
7359
7358
|
selected_filters_: selected_filters_,
|
|
7360
7359
|
local_filter_cache_: local_filter_cache_,
|
|
7361
7360
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7362
7361
|
plp_results_: plp_products_,
|
|
7363
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7362
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7363
|
+
id_type_: id_type_
|
|
7364
7364
|
});
|
|
7365
7365
|
get_breadcrumb_accessor_ === null || get_breadcrumb_accessor_ === void 0 || get_breadcrumb_accessor_(crumb_data_);
|
|
7366
7366
|
get_quicklinks_accessor_ === null || get_quicklinks_accessor_ === void 0 || get_quicklinks_accessor_(quicklinks_data_);
|
|
@@ -7384,7 +7384,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7384
7384
|
get children() {
|
|
7385
7385
|
return $b8hua$createComponent((0, $43fbb365ed0ac99e$export$466cdc317043f6cb), {
|
|
7386
7386
|
quicklinks_data_: quicklinks_data_,
|
|
7387
|
-
|
|
7387
|
+
id_to_query_for_: id_to_query_for_,
|
|
7388
|
+
id_type_: id_type_,
|
|
7388
7389
|
router_: router_,
|
|
7389
7390
|
breadcrumb_data_: crumb_data_,
|
|
7390
7391
|
i18n_: i18n_,
|
|
@@ -7435,7 +7436,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7435
7436
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
7436
7437
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
7437
7438
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
7438
|
-
id_currently_querying_for_:
|
|
7439
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
7439
7440
|
no_results_options_: {
|
|
7440
7441
|
selected_filters_: selected_filters_,
|
|
7441
7442
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -7479,10 +7480,10 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7479
7480
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
7480
7481
|
*/
|
|
7481
7482
|
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
7482
|
-
const href_accessor = $b8hua$
|
|
7483
|
+
const href_accessor = $b8hua$use_href_accessor();
|
|
7483
7484
|
return $b8hua$createMemo(() => {
|
|
7484
|
-
var
|
|
7485
|
-
const api_value = (
|
|
7485
|
+
var _plp_meta3;
|
|
7486
|
+
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
7486
7487
|
if (!api_value) return api_value;
|
|
7487
7488
|
return [...api_value, {
|
|
7488
7489
|
get listing_id() {
|
|
@@ -7496,6 +7497,12 @@ function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
7496
7497
|
},
|
|
7497
7498
|
get slug() {
|
|
7498
7499
|
return plp_meta().slug;
|
|
7500
|
+
},
|
|
7501
|
+
get listing_type() {
|
|
7502
|
+
return plp_meta().listing_type;
|
|
7503
|
+
},
|
|
7504
|
+
get external_id() {
|
|
7505
|
+
return plp_meta().external_id;
|
|
7499
7506
|
}
|
|
7500
7507
|
}];
|
|
7501
7508
|
});
|
|
@@ -7700,8 +7707,7 @@ var $f5f54892fd0c7d9f$var$_router = /*#__PURE__*/new WeakMap();
|
|
|
7700
7707
|
var $f5f54892fd0c7d9f$var$_localization_signal = /*#__PURE__*/new WeakMap();
|
|
7701
7708
|
var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
7702
7709
|
var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
7703
|
-
var $f5f54892fd0c7d9f$var$
|
|
7704
|
-
var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
|
|
7710
|
+
var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
7705
7711
|
var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
7706
7712
|
class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
7707
7713
|
get localization() {
|
|
@@ -7711,11 +7717,11 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7711
7717
|
set localization(locale_obj) {
|
|
7712
7718
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
|
|
7713
7719
|
}
|
|
7714
|
-
get
|
|
7715
|
-
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
7720
|
+
get listing_query() {
|
|
7721
|
+
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[0]();
|
|
7716
7722
|
}
|
|
7717
|
-
set
|
|
7718
|
-
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
7723
|
+
set listing_query(query) {
|
|
7724
|
+
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[1](query);
|
|
7719
7725
|
}
|
|
7720
7726
|
get merchant() {
|
|
7721
7727
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_merchant_signal)[0]();
|
|
@@ -7729,12 +7735,6 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7729
7735
|
set market(market) {
|
|
7730
7736
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_market_signal)[1](market);
|
|
7731
7737
|
}
|
|
7732
|
-
get meta_title_suffix() {
|
|
7733
|
-
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[0]();
|
|
7734
|
-
}
|
|
7735
|
-
set meta_title_suffix(new_suffix) {
|
|
7736
|
-
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_)[1](new_suffix);
|
|
7737
|
-
}
|
|
7738
7738
|
get disable_override_listing_id() {
|
|
7739
7739
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id)[0]();
|
|
7740
7740
|
}
|
|
@@ -7754,7 +7754,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7754
7754
|
on_navigation: on_navigation,
|
|
7755
7755
|
display_transformers: display_transformers,
|
|
7756
7756
|
unique_instance_key_for_state = "",
|
|
7757
|
-
|
|
7757
|
+
listing_query_state_key: listing_query_state_key,
|
|
7758
7758
|
...props_on_class
|
|
7759
7759
|
} = _ref2;
|
|
7760
7760
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
|
|
@@ -7773,13 +7773,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7773
7773
|
writable: true,
|
|
7774
7774
|
value: $b8hua$createSignal()
|
|
7775
7775
|
});
|
|
7776
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$
|
|
7777
|
-
writable: true,
|
|
7778
|
-
value: $b8hua$createSignal("")
|
|
7779
|
-
});
|
|
7780
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
|
|
7776
|
+
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_query_signal, {
|
|
7781
7777
|
writable: true,
|
|
7782
|
-
value: $b8hua$createSignal()
|
|
7778
|
+
value: $b8hua$createSignal({})
|
|
7783
7779
|
});
|
|
7784
7780
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id, {
|
|
7785
7781
|
writable: true,
|
|
@@ -7792,7 +7788,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7792
7788
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
7793
7789
|
Object.assign(this, props_on_class); // set initial signal values
|
|
7794
7790
|
$68e6625c8d51f847$export$5162a71f252e6122();
|
|
7795
|
-
$b8hua$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation",
|
|
7791
|
+
$b8hua$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key));
|
|
7796
7792
|
if (on_navigation) $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router).on_navigation_ = on_navigation;
|
|
7797
7793
|
const override_listing_id_query_param_names_ = ["listing_id_" + unique_instance_key_for_state, "listing_id"]; // If you're wondering why this is an array https://gitlab.com/depict-ai/depict.ai/-/merge_requests/7958#note_1511700842
|
|
7798
7794
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -7861,14 +7857,16 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
7861
7857
|
category_title: category_title
|
|
7862
7858
|
} = props;
|
|
7863
7859
|
const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
7860
|
+
const diffableListingQuery = $b8hua$createMemo(() => Object.values(depict_category.listing_query).join(""));
|
|
7864
7861
|
return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
|
|
7865
7862
|
$b8hua$createEffect(prev => {
|
|
7866
7863
|
// this is here (and not on DepictCategory) so that people also know when PageReplacer removes the page, it's intended to help people replace their own content when a depict page is navigated, see https://depictaiworkspace.slack.com/archives/C04M8MGCF3K/p1691670636155369
|
|
7867
|
-
|
|
7868
|
-
$
|
|
7869
|
-
|
|
7864
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
7865
|
+
const newId = $b8hua$untrack(() => depict_category.listing_query);
|
|
7866
|
+
$01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
7867
|
+
return newId;
|
|
7870
7868
|
});
|
|
7871
|
-
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.
|
|
7869
|
+
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
7872
7870
|
const grid_spacing_override = $b8hua$createMemo(() => {
|
|
7873
7871
|
const {
|
|
7874
7872
|
grid_spacing: grid_spacing
|
|
@@ -7909,8 +7907,8 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
7909
7907
|
depict_api_: depict_api_,
|
|
7910
7908
|
min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
|
|
7911
7909
|
local_filter_cache_: local_filter_cache_,
|
|
7912
|
-
|
|
7913
|
-
|
|
7910
|
+
id_to_query_for_: $b8hua$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
7911
|
+
id_type_: $b8hua$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() ? $397620a4d7958ed1$export$74ee7529ce0f8a00 : depict_category.listing_query.type),
|
|
7914
7912
|
i18n_: i18n_,
|
|
7915
7913
|
show_quicklinks_: $b8hua$createMemo(() => {
|
|
7916
7914
|
var _props$show_quicklink;
|
|
@@ -7978,13 +7976,16 @@ function $f5f54892fd0c7d9f$export$de035477d6fef996(_ref4) {
|
|
|
7978
7976
|
sorting_query_param_: sorting_query_param_,
|
|
7979
7977
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
7980
7978
|
} = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
7979
|
+
const id_to_query_for_ = $b8hua$createMemo(() => depict_category.listing_query.id);
|
|
7980
|
+
const id_type_ = $b8hua$createMemo(() => depict_category.listing_query.type);
|
|
7981
7981
|
return $b8hua$createComponent($f5f54892fd0c7d9f$var$InExternalAreaDiv, {
|
|
7982
7982
|
get children() {
|
|
7983
7983
|
return $43fbb365ed0ac99e$export$466cdc317043f6cb({
|
|
7984
7984
|
i18n_: i18n_,
|
|
7985
7985
|
quicklinks_data_: quicklinks_data_,
|
|
7986
7986
|
router_: router_,
|
|
7987
|
-
|
|
7987
|
+
id_type_: id_type_,
|
|
7988
|
+
id_to_query_for_: id_to_query_for_,
|
|
7988
7989
|
breadcrumb_data_: breadcrumb_data_,
|
|
7989
7990
|
sorting_query_param_: sorting_query_param_,
|
|
7990
7991
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -8800,7 +8801,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8800
8801
|
searching_for_value_: searching_for_value_
|
|
8801
8802
|
}), $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createMemo(() => {
|
|
8802
8803
|
if (input_obj().type === "content") return i18n_.content_();
|
|
8803
|
-
if (input_obj().
|
|
8804
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
8804
8805
|
return i18n_.category_();
|
|
8805
8806
|
})()))]));
|
|
8806
8807
|
};
|
|
@@ -9024,7 +9025,7 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
9024
9025
|
url.searchParams.set(search_query_param_name_, title);
|
|
9025
9026
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
9026
9027
|
}));
|
|
9027
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "
|
|
9028
|
+
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "listing" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") $b8hua$runWithOwner(owner, () => override_on_enter_for_this_entry(e => {
|
|
9028
9029
|
const {
|
|
9029
9030
|
page_url: page_url
|
|
9030
9031
|
} = selected_entry;
|
|
@@ -9504,7 +9505,7 @@ function $754f319a849bfdbc$export$c05a196222ba1302(_ref) {
|
|
|
9504
9505
|
} = _ref;
|
|
9505
9506
|
const category_suggestions_ = $b8hua$createMemo(() => {
|
|
9506
9507
|
var _suggestions_;
|
|
9507
|
-
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "
|
|
9508
|
+
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "listing");
|
|
9508
9509
|
});
|
|
9509
9510
|
return $b8hua$createComponent((0, $b8hua$Show), {
|
|
9510
9511
|
get when() {
|