@depict-ai/ui 3.0.3 → 3.0.5
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 +162 -151
- package/ES10/index.d.ts +211 -201
- package/ES10/index.js +164 -153
- package/latest/index.cjs +139 -113
- package/latest/index.d.ts +211 -201
- package/latest/index.js +141 -115
- package/package.json +4 -4
- package/server/ES10/index.cjs +137 -126
- package/server/ES10/index.d.ts +211 -201
- package/server/ES10/index.js +139 -128
- package/server/latest/index.cjs +128 -108
- package/server/latest/index.d.ts +211 -201
- package/server/latest/index.js +130 -110
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.5";
|
|
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
|
}
|
|
@@ -875,27 +875,31 @@ function $2d7bad8684bc7f44$export$43f0fb951fcb0c54(_ref) {
|
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
877
|
// source: https://medium.com/@pancemarko/deep-equality-in-javascript-determining-if-two-objects-are-equal-bf98cf47e934
|
|
878
|
+
// deeply diffs two objects
|
|
879
|
+
// Modified by chatGPT to not be recursive, since stiga was getting a stack overflow just due to the size of their data
|
|
880
|
+
// Modified futher to bias towards saying objects are equal non-primitive objects differ
|
|
878
881
|
function $2d7bad8684bc7f44$var$deep_equal(obj1, obj2) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
|
|
882
|
+
const stack = [[obj1, obj2]];
|
|
883
|
+
while (stack.length > 0) {
|
|
884
|
+
const [currentObj1, currentObj2] = stack.pop();
|
|
885
|
+
if (currentObj1 === currentObj2) continue;
|
|
886
|
+
if (Array.isArray(currentObj1) && Array.isArray(currentObj2)) {
|
|
887
|
+
if (currentObj1.length !== currentObj2.length) return false;
|
|
888
|
+
for (let i = 0; i < currentObj1.length; i++) stack.push([currentObj1[i], currentObj2[i]]);
|
|
889
|
+
} else if (typeof currentObj1 === "object" && typeof currentObj2 === "object" && currentObj1 !== null && currentObj2 !== null) {
|
|
890
|
+
if (Array.isArray(currentObj1) || Array.isArray(currentObj2)) return false;
|
|
891
|
+
const keys1 = Object.keys(currentObj1);
|
|
892
|
+
const keys2 = Object.keys(currentObj2);
|
|
893
|
+
if (keys1.length !== keys2.length || !keys1.every(key => keys2.includes(key))) return false;
|
|
894
|
+
for (let key in currentObj1) {
|
|
895
|
+
if ($2d7bad8684bc7f44$var$result_ids.includes(key)) continue; // ignore comparing values for keys we know are changing with every request
|
|
896
|
+
stack.push([currentObj1[key], currentObj2[key]]);
|
|
897
|
+
}
|
|
898
|
+
} else if (typeof currentObj1 !== "function" && typeof currentObj2 !== "function")
|
|
899
|
+
// Claim that all functions are equal, since the only way a function ends up here is because someone added it in the displayTransformer and that shouldn't force us to re-render, right?
|
|
900
|
+
return false;
|
|
897
901
|
}
|
|
898
|
-
return
|
|
902
|
+
return true;
|
|
899
903
|
}
|
|
900
904
|
const $63f1f8dbcd07d3b0$var$_tmpl$ = ["<div", ' class="', '">', "</div>"],
|
|
901
905
|
$63f1f8dbcd07d3b0$var$_tmpl$2 = ["<style", ' type="text/css">', "</style>"];
|
|
@@ -4672,6 +4676,11 @@ function $ed0fefda39a0f15d$export$967e966fca9515e(api_response) {
|
|
|
4672
4676
|
}
|
|
4673
4677
|
return api_response;
|
|
4674
4678
|
}
|
|
4679
|
+
|
|
4680
|
+
// Minifiable and tree-shakable enum
|
|
4681
|
+
// Why not use const enum? See https://gitlab.com/depict-ai/depict.ai/-/merge_requests/9223#note_1675965260
|
|
4682
|
+
const $397620a4d7958ed1$export$74ee7529ce0f8a00 = "listingId";
|
|
4683
|
+
const $397620a4d7958ed1$export$5aae649db1b959fc = "externalId";
|
|
4675
4684
|
function $284849364a6ef73a$var$_classPrivateMethodInitSpec(obj, privateSet) {
|
|
4676
4685
|
$284849364a6ef73a$var$_checkPrivateRedeclaration(obj, privateSet);
|
|
4677
4686
|
privateSet.add(obj);
|
|
@@ -4780,9 +4789,14 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4780
4789
|
})
|
|
4781
4790
|
});
|
|
4782
4791
|
}
|
|
4783
|
-
async get_listing(
|
|
4792
|
+
async get_listing(_ref) {
|
|
4793
|
+
let {
|
|
4794
|
+
id_type_: id_type_,
|
|
4795
|
+
id_to_query_for_: id_to_query_for_,
|
|
4796
|
+
...input_req
|
|
4797
|
+
} = _ref;
|
|
4784
4798
|
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(
|
|
4799
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_),
|
|
4786
4800
|
input_req_: input_req,
|
|
4787
4801
|
fallback_response_: () => ({
|
|
4788
4802
|
listing_id: "",
|
|
@@ -4796,20 +4810,18 @@ class $284849364a6ef73a$export$e015ed2f2950f2e3 {
|
|
|
4796
4810
|
"quick_links": [],
|
|
4797
4811
|
failed: true
|
|
4798
4812
|
}),
|
|
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
|
|
4813
|
+
method_: "GET"
|
|
4801
4814
|
});
|
|
4802
4815
|
}
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
...
|
|
4808
|
-
};
|
|
4809
|
-
delete cloned_request["listing_id"];
|
|
4816
|
+
async get_listing_products(_ref2) {
|
|
4817
|
+
let {
|
|
4818
|
+
id_to_query_for_: id_to_query_for_,
|
|
4819
|
+
id_type_: id_type_,
|
|
4820
|
+
...input_req_
|
|
4821
|
+
} = _ref2;
|
|
4810
4822
|
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_:
|
|
4823
|
+
endpoint_: $284849364a6ef73a$var$v3_base_url + "listings/" + (id_type_ === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id/" : "") + encodeURIComponent(id_to_query_for_) + "/products",
|
|
4824
|
+
input_req_: input_req_,
|
|
4813
4825
|
fallback_response_: () => ({
|
|
4814
4826
|
"n_hits": 0,
|
|
4815
4827
|
"displays": [],
|
|
@@ -4847,7 +4859,7 @@ async function $284849364a6ef73a$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
4847
4859
|
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
4848
4860
|
if (!category_transformer) return response;
|
|
4849
4861
|
// find category suggestions, run thing with them, and then replace them
|
|
4850
|
-
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "
|
|
4862
|
+
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "listing");
|
|
4851
4863
|
const transformed_category_suggestions = await category_transformer({
|
|
4852
4864
|
market: market,
|
|
4853
4865
|
merchant: merchant,
|
|
@@ -4893,15 +4905,14 @@ async function $284849364a6ef73a$var$_run_display_transformers_for_rest2(merchan
|
|
|
4893
4905
|
});
|
|
4894
4906
|
return input_data;
|
|
4895
4907
|
}
|
|
4896
|
-
async function $284849364a6ef73a$var$_cached_request2(
|
|
4908
|
+
async function $284849364a6ef73a$var$_cached_request2(_ref3) {
|
|
4897
4909
|
var _classPrivateFieldGet5, _cache_obj$cache_$bod, _cache_obj$cache_$bod2;
|
|
4898
4910
|
let {
|
|
4899
4911
|
endpoint_: endpoint_,
|
|
4900
4912
|
input_req_: input_req_,
|
|
4901
4913
|
fallback_response_: fallback_response_,
|
|
4902
|
-
method_ = "POST"
|
|
4903
|
-
|
|
4904
|
-
} = _ref;
|
|
4914
|
+
method_ = "POST"
|
|
4915
|
+
} = _ref3;
|
|
4905
4916
|
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
4917
|
const with_ids = $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_add_ids_to_request).call(this, input_req_);
|
|
4907
4918
|
const metaData = await ((_classPrivateFieldGet5 = $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $284849364a6ef73a$var$_get_metadata)) === null || _classPrivateFieldGet5 === void 0 ? void 0 : _classPrivateFieldGet5.call(this));
|
|
@@ -4918,7 +4929,6 @@ async function $284849364a6ef73a$var$_cached_request2(_ref) {
|
|
|
4918
4929
|
cache_obj.in_progress_[body] = new Promise(r => resolve_in_progress = r);
|
|
4919
4930
|
try {
|
|
4920
4931
|
const is_post = method_ === "POST";
|
|
4921
|
-
if (!is_post && delete_key_before_sending_) delete sorted_request[delete_key_before_sending_];
|
|
4922
4932
|
const url_to_request = is_post ? endpoint_ : $b8hua$make_url_with_query_params(endpoint_, sorted_request);
|
|
4923
4933
|
const api_response = await $b8hua$fetch_retry($b8hua$add_version_query_params(url_to_request), {
|
|
4924
4934
|
method: method_,
|
|
@@ -5254,7 +5264,7 @@ function $6d2962bc9370f884$export$5e4aed86c12acdd9(_ref) {
|
|
|
5254
5264
|
// After first load, always just load 20 since people might just be browsing the top ones still
|
|
5255
5265
|
min_products_to_fetch_ : now - last_loaded < 10000 ? min_products_to_fetch_ * 5 : min_products_to_fetch_;
|
|
5256
5266
|
// 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_["
|
|
5267
|
+
const api_response = await depict_api_["query" in base_part ? "query" : "get_listing_products"]({
|
|
5258
5268
|
cursor: get_last_cursor(),
|
|
5259
5269
|
limit: number_of_results_to_load,
|
|
5260
5270
|
...base_part
|
|
@@ -6634,11 +6644,12 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6634
6644
|
let {
|
|
6635
6645
|
quicklinks_data_: quicklinks_data_,
|
|
6636
6646
|
router_: router_,
|
|
6637
|
-
|
|
6647
|
+
id_to_query_for_: id_to_query_for_,
|
|
6638
6648
|
breadcrumb_data_: breadcrumb_data_,
|
|
6639
6649
|
i18n_: i18n_,
|
|
6640
6650
|
sorting_query_param_: sorting_query_param_,
|
|
6641
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
6651
|
+
filter_query_param_prefix_: filter_query_param_prefix_,
|
|
6652
|
+
id_type_: id_type_
|
|
6642
6653
|
} = _ref;
|
|
6643
6654
|
let scrolling_logic_ran_for_listing_id = false;
|
|
6644
6655
|
let last_scroll_position;
|
|
@@ -6646,13 +6657,13 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6646
6657
|
let last_was_placeholder = false;
|
|
6647
6658
|
let sliding_element;
|
|
6648
6659
|
$b8hua$createComputed(() => {
|
|
6649
|
-
|
|
6660
|
+
id_to_query_for_();
|
|
6650
6661
|
scrolling_logic_ran_for_listing_id = false;
|
|
6651
6662
|
});
|
|
6652
6663
|
const place_holdey_quicklinks_data = $b8hua$createMemo(() => quicklinks_data_() || [,,,]);
|
|
6653
6664
|
const selected_index = $b8hua$createMemo(() => {
|
|
6654
6665
|
var _quicklinks_data_;
|
|
6655
|
-
return (_quicklinks_data_ = quicklinks_data_()) === null || _quicklinks_data_ === void 0 ? void 0 : _quicklinks_data_.findIndex(item => item
|
|
6666
|
+
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
6667
|
}); // this will be -1 when viewing child categories
|
|
6657
6668
|
const scrollpos_per_listing_id = {};
|
|
6658
6669
|
const mutation_plugins = [function () {
|
|
@@ -6662,7 +6673,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6662
6673
|
} = this.insert_here;
|
|
6663
6674
|
if (scrollLeft > 0) {
|
|
6664
6675
|
last_scroll_position = scrollLeft;
|
|
6665
|
-
const current_id = $b8hua$untrack(
|
|
6676
|
+
const current_id = $b8hua$untrack(id_to_query_for_);
|
|
6666
6677
|
// make sure to not save position where selected item isn't in viewport
|
|
6667
6678
|
const current_selected_index = $b8hua$untrack(selected_index);
|
|
6668
6679
|
const intersecting_thing = this.intersecting_items_object[current_selected_index];
|
|
@@ -6727,7 +6738,7 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6727
6738
|
equals: false
|
|
6728
6739
|
}), new_data => {
|
|
6729
6740
|
const quicklinks_data = quicklinks_data_(); // this signal should have updated by now since this is a createEffect
|
|
6730
|
-
const current_id =
|
|
6741
|
+
const current_id = id_to_query_for_();
|
|
6731
6742
|
if (!new_data || !quicklinks_data || !current_id) return;
|
|
6732
6743
|
const owner = $b8hua$getOwner();
|
|
6733
6744
|
queueMicrotask(() => {
|
|
@@ -6778,13 +6789,9 @@ function $43fbb365ed0ac99e$export$466cdc317043f6cb(_ref) {
|
|
|
6778
6789
|
// 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
6790
|
const is_sibling = $b8hua$createMemo(() => {
|
|
6780
6791
|
var _quicklinks_data_2;
|
|
6781
|
-
const current_id =
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
listing_id: listing_id
|
|
6785
|
-
} = _ref3;
|
|
6786
|
-
return listing_id === current_id;
|
|
6787
|
-
});
|
|
6792
|
+
const current_id = id_to_query_for_();
|
|
6793
|
+
const lookForId = id_type_() === $397620a4d7958ed1$export$5aae649db1b959fc ? "external_id" : "listing_id";
|
|
6794
|
+
return (_quicklinks_data_2 = quicklinks_data_()) === null || _quicklinks_data_2 === void 0 ? void 0 : _quicklinks_data_2.some(quickLink => quickLink[lookForId] === current_id);
|
|
6788
6795
|
});
|
|
6789
6796
|
const href = $b8hua$createMemo(() => {
|
|
6790
6797
|
var _display_accessor;
|
|
@@ -7003,13 +7010,14 @@ function $b4465d8d605f61e9$export$8895d39404bd2bb1(props) {
|
|
|
7003
7010
|
function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
7004
7011
|
let {
|
|
7005
7012
|
crumb_data_: crumb_data_,
|
|
7006
|
-
|
|
7013
|
+
id_to_query_for_: id_to_query_for_,
|
|
7007
7014
|
i18n_: i18n_,
|
|
7008
7015
|
selected_filters_: selected_filters_,
|
|
7009
7016
|
local_filter_cache_: local_filter_cache_,
|
|
7010
7017
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7011
7018
|
plp_results_: plp_results_,
|
|
7012
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7019
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7020
|
+
id_type_: id_type_
|
|
7013
7021
|
} = _ref;
|
|
7014
7022
|
// If we just got opened in a new tab, clear filters instantly and remove the flag
|
|
7015
7023
|
$a4777acaffa35a82$var$clear_if_opened_new_tab_with_sideways_url_params_flag({
|
|
@@ -7020,17 +7028,21 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
7020
7028
|
i18n_: i18n_,
|
|
7021
7029
|
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7022
7030
|
});
|
|
7023
|
-
//
|
|
7031
|
+
// The code below is for when we're already open and the user navigates to a new category
|
|
7024
7032
|
let previous_crumb_data = $b8hua$untrack(crumb_data_);
|
|
7025
|
-
let
|
|
7033
|
+
let id_when_we_got_previous_data = {
|
|
7034
|
+
id_: $b8hua$untrack(id_to_query_for_),
|
|
7035
|
+
type_: $b8hua$untrack(id_type_)
|
|
7036
|
+
};
|
|
7026
7037
|
let allow_filter_clearing = true; // set to false when going backwards/forwards
|
|
7027
7038
|
// temporarily disable filter clearing when going backwards/forwards
|
|
7028
7039
|
const handler = () => allow_filter_clearing = false;
|
|
7029
7040
|
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
7041
|
$b8hua$onCleanup(() => window.removeEventListener("popstate", handler));
|
|
7031
7042
|
$b8hua$createEffect($b8hua$on(crumb_data_, $b8hua$catchify1(new_crumb_data => {
|
|
7032
|
-
const
|
|
7033
|
-
|
|
7043
|
+
const id_of_new_data = id_to_query_for_();
|
|
7044
|
+
const type_of_id_of_new_data = id_type_();
|
|
7045
|
+
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
7046
|
const previous_length = previous_crumb_data.length;
|
|
7035
7047
|
const new_length = new_crumb_data.length;
|
|
7036
7048
|
const went_upwards = new_length < previous_length;
|
|
@@ -7056,7 +7068,10 @@ function $a4777acaffa35a82$export$3945d6db2dfd3d12(_ref) {
|
|
|
7056
7068
|
sideways_filter_clearing_flag_[1](false);
|
|
7057
7069
|
}
|
|
7058
7070
|
}
|
|
7059
|
-
|
|
7071
|
+
id_when_we_got_previous_data = {
|
|
7072
|
+
id_: id_of_new_data,
|
|
7073
|
+
type_: type_of_id_of_new_data
|
|
7074
|
+
};
|
|
7060
7075
|
previous_crumb_data = new_crumb_data;
|
|
7061
7076
|
if (!allow_filter_clearing) allow_filter_clearing = true;
|
|
7062
7077
|
})));
|
|
@@ -7124,8 +7139,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7124
7139
|
var _on_filters_construct;
|
|
7125
7140
|
let {
|
|
7126
7141
|
depict_api_: depict_api_,
|
|
7127
|
-
|
|
7128
|
-
|
|
7142
|
+
id_to_query_for_: id_to_query_for_,
|
|
7143
|
+
id_type_: id_type_,
|
|
7129
7144
|
current_sorting_: current_sorting_,
|
|
7130
7145
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7131
7146
|
category_filters_open_: category_filters_open_,
|
|
@@ -7178,7 +7193,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7178
7193
|
merchant: merchant_(),
|
|
7179
7194
|
market: market_(),
|
|
7180
7195
|
locale: backend_locale_(),
|
|
7181
|
-
|
|
7196
|
+
id_to_query_for_: id_to_query_for_(),
|
|
7197
|
+
id_type_: id_type_(),
|
|
7182
7198
|
...(f.length ? {
|
|
7183
7199
|
filters: f
|
|
7184
7200
|
} : {}),
|
|
@@ -7190,8 +7206,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7190
7206
|
// Make "Get products in listing" request to get products in listing
|
|
7191
7207
|
const [plp_products_] = $b8hua$createResource(products_query_base_,
|
|
7192
7208
|
// 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(
|
|
7209
|
+
$b8hua$catchify(base_query => $5e6abec0dab4e610$export$cc42dd29bf655ab6({
|
|
7210
|
+
id_: $b8hua$untrack(id_to_query_for_),
|
|
7195
7211
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7196
7212
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7197
7213
|
make_request_: (limit, cursor) => depict_api_.get_listing_products({
|
|
@@ -7206,10 +7222,11 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7206
7222
|
merchant: merchant_(),
|
|
7207
7223
|
market: market_(),
|
|
7208
7224
|
locale: backend_locale_(),
|
|
7209
|
-
|
|
7225
|
+
id_to_query_for_: id_to_query_for_(),
|
|
7226
|
+
id_type_: id_type_()
|
|
7210
7227
|
}));
|
|
7211
7228
|
// Make "Get Listing" request to get quicklinks, breadcrumbs, title, etc
|
|
7212
|
-
const [plp_meta] = $b8hua$createResource(meta_query_base, $b8hua$
|
|
7229
|
+
const [plp_meta] = $b8hua$createResource(meta_query_base, $b8hua$catchify(query => depict_api_.get_listing(query)));
|
|
7213
7230
|
const available_sortings_ = $b8hua$createMemo(() => {
|
|
7214
7231
|
var _plp_products_, _plp_products_$sorts;
|
|
7215
7232
|
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 +7250,6 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7233
7250
|
var _plp_meta2;
|
|
7234
7251
|
return (_plp_meta2 = plp_meta()) === null || _plp_meta2 === void 0 ? void 0 : _plp_meta2.quick_links;
|
|
7235
7252
|
});
|
|
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
7253
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = $b8hua$createSignal(false);
|
|
7248
7254
|
const [desktop_filter_elements_, set_desktop_filter_elements] = $b8hua$createSignal();
|
|
7249
7255
|
const formatted_number_of_results_ = $43fbdca0f726a34b$export$92f2da32c6e7e7ee({
|
|
@@ -7307,7 +7313,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7307
7313
|
}));
|
|
7308
7314
|
results_for = make_product_count_();
|
|
7309
7315
|
} else {
|
|
7310
|
-
$b8hua$
|
|
7316
|
+
$b8hua$report1(new Error("Unrecognised category_title_type, UI will look messed up"), "error");
|
|
7311
7317
|
results_for = $b8hua$ssr($4b4b262708b516ee$var$_tmpl$2, $b8hua$ssrHydrationKey());
|
|
7312
7318
|
}
|
|
7313
7319
|
const filters_opener = $7396052a1484264f$export$d7841e452f2e59a8({
|
|
@@ -7329,17 +7335,17 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7329
7335
|
number_of_rendered_selected_filters_items_: number_of_rendered_selected_filters_items_,
|
|
7330
7336
|
...extra_sort_and_filter_args_
|
|
7331
7337
|
});
|
|
7332
|
-
$b8hua$
|
|
7338
|
+
$b8hua$catchify((0, $5e6abec0dab4e610$export$6e49da55e449af7c))({
|
|
7333
7339
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
7334
7340
|
last_result_in_viewport_: last_result_in_viewport_,
|
|
7335
|
-
id_:
|
|
7341
|
+
id_: id_to_query_for_,
|
|
7336
7342
|
can_write_scroll_restoration_: can_write_scroll_restoration_
|
|
7337
7343
|
});
|
|
7338
7344
|
(_on_filters_construct = on_filters_constructed_) === null || _on_filters_construct === void 0 || _on_filters_construct();
|
|
7339
7345
|
$b8hua$createComputed(() => {
|
|
7340
7346
|
if (plp_products_.loading) set_can_write_scroll_restoration(false);else if (plp_products_()) set_can_write_scroll_restoration(true);
|
|
7341
7347
|
});
|
|
7342
|
-
$b8hua$createRenderEffect($b8hua$
|
|
7348
|
+
$b8hua$createRenderEffect($b8hua$catchify(async () => {
|
|
7343
7349
|
var _only_show_filters_op;
|
|
7344
7350
|
const slim = is_slim_();
|
|
7345
7351
|
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 +7359,15 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7353
7359
|
available_filters_: available_filters_
|
|
7354
7360
|
});
|
|
7355
7361
|
$a4777acaffa35a82$export$3945d6db2dfd3d12({
|
|
7356
|
-
|
|
7362
|
+
id_to_query_for_: id_to_query_for_,
|
|
7357
7363
|
crumb_data_: crumb_data_,
|
|
7358
7364
|
i18n_: i18n_,
|
|
7359
7365
|
selected_filters_: selected_filters_,
|
|
7360
7366
|
local_filter_cache_: local_filter_cache_,
|
|
7361
7367
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
7362
7368
|
plp_results_: plp_products_,
|
|
7363
|
-
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_
|
|
7369
|
+
sideways_filter_clearing_flag_: sideways_filter_clearing_flag_,
|
|
7370
|
+
id_type_: id_type_
|
|
7364
7371
|
});
|
|
7365
7372
|
get_breadcrumb_accessor_ === null || get_breadcrumb_accessor_ === void 0 || get_breadcrumb_accessor_(crumb_data_);
|
|
7366
7373
|
get_quicklinks_accessor_ === null || get_quicklinks_accessor_ === void 0 || get_quicklinks_accessor_(quicklinks_data_);
|
|
@@ -7384,7 +7391,8 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7384
7391
|
get children() {
|
|
7385
7392
|
return $b8hua$createComponent((0, $43fbb365ed0ac99e$export$466cdc317043f6cb), {
|
|
7386
7393
|
quicklinks_data_: quicklinks_data_,
|
|
7387
|
-
|
|
7394
|
+
id_to_query_for_: id_to_query_for_,
|
|
7395
|
+
id_type_: id_type_,
|
|
7388
7396
|
router_: router_,
|
|
7389
7397
|
breadcrumb_data_: crumb_data_,
|
|
7390
7398
|
i18n_: i18n_,
|
|
@@ -7435,7 +7443,7 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7435
7443
|
sort_or_filter_open_: sort_or_filter_open_,
|
|
7436
7444
|
desktop_filter_elements_: desktop_filter_elements_,
|
|
7437
7445
|
content_blocks_by_row_: content_blocks_by_row_,
|
|
7438
|
-
id_currently_querying_for_:
|
|
7446
|
+
id_currently_querying_for_: id_to_query_for_,
|
|
7439
7447
|
no_results_options_: {
|
|
7440
7448
|
selected_filters_: selected_filters_,
|
|
7441
7449
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
@@ -7479,10 +7487,10 @@ function $4b4b262708b516ee$export$f7d2f673fc2f091d(_ref) {
|
|
|
7479
7487
|
* Adds the current page as last breadcrumb to the breadcrumb trail
|
|
7480
7488
|
*/
|
|
7481
7489
|
function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
7482
|
-
const href_accessor = $b8hua$
|
|
7490
|
+
const href_accessor = $b8hua$use_href_accessor();
|
|
7483
7491
|
return $b8hua$createMemo(() => {
|
|
7484
|
-
var
|
|
7485
|
-
const api_value = (
|
|
7492
|
+
var _plp_meta3;
|
|
7493
|
+
const api_value = (_plp_meta3 = plp_meta()) === null || _plp_meta3 === void 0 ? void 0 : _plp_meta3.breadcrumbs;
|
|
7486
7494
|
if (!api_value) return api_value;
|
|
7487
7495
|
return [...api_value, {
|
|
7488
7496
|
get listing_id() {
|
|
@@ -7496,6 +7504,12 @@ function $4b4b262708b516ee$var$add_us_to_crumbs(plp_meta, title) {
|
|
|
7496
7504
|
},
|
|
7497
7505
|
get slug() {
|
|
7498
7506
|
return plp_meta().slug;
|
|
7507
|
+
},
|
|
7508
|
+
get listing_type() {
|
|
7509
|
+
return plp_meta().listing_type;
|
|
7510
|
+
},
|
|
7511
|
+
get external_id() {
|
|
7512
|
+
return plp_meta().external_id;
|
|
7499
7513
|
}
|
|
7500
7514
|
}];
|
|
7501
7515
|
});
|
|
@@ -7700,8 +7714,7 @@ var $f5f54892fd0c7d9f$var$_router = /*#__PURE__*/new WeakMap();
|
|
|
7700
7714
|
var $f5f54892fd0c7d9f$var$_localization_signal = /*#__PURE__*/new WeakMap();
|
|
7701
7715
|
var $f5f54892fd0c7d9f$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
7702
7716
|
var $f5f54892fd0c7d9f$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
7703
|
-
var $f5f54892fd0c7d9f$var$
|
|
7704
|
-
var $f5f54892fd0c7d9f$var$_meta_title_suffix_ = /*#__PURE__*/new WeakMap();
|
|
7717
|
+
var $f5f54892fd0c7d9f$var$_listing_query_signal = /*#__PURE__*/new WeakMap();
|
|
7705
7718
|
var $f5f54892fd0c7d9f$var$_disable_override_listing_id = /*#__PURE__*/new WeakMap();
|
|
7706
7719
|
class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
7707
7720
|
get localization() {
|
|
@@ -7711,11 +7724,11 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7711
7724
|
set localization(locale_obj) {
|
|
7712
7725
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_localization_signal)[1](locale_obj);
|
|
7713
7726
|
}
|
|
7714
|
-
get
|
|
7715
|
-
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
7727
|
+
get listing_query() {
|
|
7728
|
+
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[0]();
|
|
7716
7729
|
}
|
|
7717
|
-
set
|
|
7718
|
-
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$
|
|
7730
|
+
set listing_query(query) {
|
|
7731
|
+
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_listing_query_signal)[1](query);
|
|
7719
7732
|
}
|
|
7720
7733
|
get merchant() {
|
|
7721
7734
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_merchant_signal)[0]();
|
|
@@ -7729,12 +7742,6 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7729
7742
|
set market(market) {
|
|
7730
7743
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_market_signal)[1](market);
|
|
7731
7744
|
}
|
|
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
7745
|
get disable_override_listing_id() {
|
|
7739
7746
|
return $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id)[0]();
|
|
7740
7747
|
}
|
|
@@ -7754,7 +7761,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7754
7761
|
on_navigation: on_navigation,
|
|
7755
7762
|
display_transformers: display_transformers,
|
|
7756
7763
|
unique_instance_key_for_state = "",
|
|
7757
|
-
|
|
7764
|
+
listing_query_state_key: listing_query_state_key,
|
|
7758
7765
|
...props_on_class
|
|
7759
7766
|
} = _ref2;
|
|
7760
7767
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_router, {
|
|
@@ -7773,13 +7780,9 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7773
7780
|
writable: true,
|
|
7774
7781
|
value: $b8hua$createSignal()
|
|
7775
7782
|
});
|
|
7776
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$
|
|
7783
|
+
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_listing_query_signal, {
|
|
7777
7784
|
writable: true,
|
|
7778
|
-
value: $b8hua$createSignal(
|
|
7779
|
-
});
|
|
7780
|
-
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_meta_title_suffix_, {
|
|
7781
|
-
writable: true,
|
|
7782
|
-
value: $b8hua$createSignal()
|
|
7785
|
+
value: $b8hua$createSignal({})
|
|
7783
7786
|
});
|
|
7784
7787
|
$f5f54892fd0c7d9f$var$_classPrivateFieldInitSpec(this, $f5f54892fd0c7d9f$var$_disable_override_listing_id, {
|
|
7785
7788
|
writable: true,
|
|
@@ -7792,7 +7795,7 @@ class $f5f54892fd0c7d9f$export$f34314aa9505732e {
|
|
|
7792
7795
|
throw new Error("You can only have one instance of DepictCategory with the same uniqueInstanceKeyForState");
|
|
7793
7796
|
Object.assign(this, props_on_class); // set initial signal values
|
|
7794
7797
|
$68e6625c8d51f847$export$5162a71f252e6122();
|
|
7795
|
-
$b8hua$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation",
|
|
7798
|
+
$b8hua$babelruntimehelpersclassPrivateFieldSet(this, $f5f54892fd0c7d9f$var$_router, new (0, $ac571292d606f30b$export$7e1297a3a19f10d8)("hard_navigation", listing_query_state_key));
|
|
7796
7799
|
if (on_navigation) $b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f5f54892fd0c7d9f$var$_router).on_navigation_ = on_navigation;
|
|
7797
7800
|
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
7801
|
const sorting_query_param_ = "sorting" + unique_instance_key_for_state;
|
|
@@ -7861,14 +7864,16 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
7861
7864
|
category_title: category_title
|
|
7862
7865
|
} = props;
|
|
7863
7866
|
const shared_properties = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
7867
|
+
const diffableListingQuery = $b8hua$createMemo(() => Object.values(depict_category.listing_query || {}).join(""));
|
|
7864
7868
|
return $83e8cf2c0b87a58a$export$23fca46f3143581f(() => {
|
|
7865
7869
|
$b8hua$createEffect(prev => {
|
|
7866
7870
|
// 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
|
-
|
|
7871
|
+
diffableListingQuery(); // Only re-run this effect when the listing query *actually* changes (not just the object reference)
|
|
7872
|
+
const newId = $b8hua$untrack(() => depict_category.listing_query);
|
|
7873
|
+
$01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)(newId, prev);
|
|
7874
|
+
return newId;
|
|
7870
7875
|
});
|
|
7871
|
-
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.
|
|
7876
|
+
$b8hua$onCleanup(() => $01c33966d9ddb108$export$f50b88e2a00918b5(props.on_listing_query_change)());
|
|
7872
7877
|
const grid_spacing_override = $b8hua$createMemo(() => {
|
|
7873
7878
|
const {
|
|
7874
7879
|
grid_spacing: grid_spacing
|
|
@@ -7909,8 +7914,11 @@ function $f5f54892fd0c7d9f$export$e2bf8ce7779e827e(props) {
|
|
|
7909
7914
|
depict_api_: depict_api_,
|
|
7910
7915
|
min_products_to_fetch_: $f5f54892fd0c7d9f$var$min_products_to_fetch_,
|
|
7911
7916
|
local_filter_cache_: local_filter_cache_,
|
|
7912
|
-
|
|
7913
|
-
|
|
7917
|
+
id_to_query_for_: $b8hua$createMemo(() => !depict_category.disable_override_listing_id && override_listing_id_accessor_() || depict_category.listing_query.id),
|
|
7918
|
+
id_type_: $b8hua$createMemo(() => {
|
|
7919
|
+
if (!depict_category.disable_override_listing_id && override_listing_id_accessor_()) return $397620a4d7958ed1$export$74ee7529ce0f8a00;
|
|
7920
|
+
return depict_category.listing_query.type;
|
|
7921
|
+
}),
|
|
7914
7922
|
i18n_: i18n_,
|
|
7915
7923
|
show_quicklinks_: $b8hua$createMemo(() => {
|
|
7916
7924
|
var _props$show_quicklink;
|
|
@@ -7978,13 +7986,16 @@ function $f5f54892fd0c7d9f$export$de035477d6fef996(_ref4) {
|
|
|
7978
7986
|
sorting_query_param_: sorting_query_param_,
|
|
7979
7987
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
7980
7988
|
} = $f5f54892fd0c7d9f$var$get_shared_properties(depict_category);
|
|
7989
|
+
const id_to_query_for_ = $b8hua$createMemo(() => depict_category.listing_query.id);
|
|
7990
|
+
const id_type_ = $b8hua$createMemo(() => depict_category.listing_query.type);
|
|
7981
7991
|
return $b8hua$createComponent($f5f54892fd0c7d9f$var$InExternalAreaDiv, {
|
|
7982
7992
|
get children() {
|
|
7983
7993
|
return $43fbb365ed0ac99e$export$466cdc317043f6cb({
|
|
7984
7994
|
i18n_: i18n_,
|
|
7985
7995
|
quicklinks_data_: quicklinks_data_,
|
|
7986
7996
|
router_: router_,
|
|
7987
|
-
|
|
7997
|
+
id_type_: id_type_,
|
|
7998
|
+
id_to_query_for_: id_to_query_for_,
|
|
7988
7999
|
breadcrumb_data_: breadcrumb_data_,
|
|
7989
8000
|
sorting_query_param_: sorting_query_param_,
|
|
7990
8001
|
filter_query_param_prefix_: filter_query_param_prefix_
|
|
@@ -8800,7 +8811,7 @@ function $40dd3f46f55d62ba$export$e872e2339fb04a7f(_ref) {
|
|
|
8800
8811
|
searching_for_value_: searching_for_value_
|
|
8801
8812
|
}), $b8hua$ssr($40dd3f46f55d62ba$var$_tmpl$3, $b8hua$ssrHydrationKey(), $b8hua$escape($b8hua$createMemo(() => {
|
|
8802
8813
|
if (input_obj().type === "content") return i18n_.content_();
|
|
8803
|
-
if (input_obj().
|
|
8814
|
+
if (input_obj().listing_type === "brand") return i18n_.brand_();
|
|
8804
8815
|
return i18n_.category_();
|
|
8805
8816
|
})()))]));
|
|
8806
8817
|
};
|
|
@@ -9024,7 +9035,7 @@ function $2ebb1d6ae6763f7a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
9024
9035
|
url.searchParams.set(search_query_param_name_, title);
|
|
9025
9036
|
return $76b6e14a50da4597$export$1efe1013da60d0e4(e, url.href);
|
|
9026
9037
|
}));
|
|
9027
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "
|
|
9038
|
+
} 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
9039
|
const {
|
|
9029
9040
|
page_url: page_url
|
|
9030
9041
|
} = selected_entry;
|
|
@@ -9504,7 +9515,7 @@ function $754f319a849bfdbc$export$c05a196222ba1302(_ref) {
|
|
|
9504
9515
|
} = _ref;
|
|
9505
9516
|
const category_suggestions_ = $b8hua$createMemo(() => {
|
|
9506
9517
|
var _suggestions_;
|
|
9507
|
-
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "
|
|
9518
|
+
return (_suggestions_ = suggestions_()) === null || _suggestions_ === void 0 ? void 0 : _suggestions_.suggestions.filter(s => s.type === "listing");
|
|
9508
9519
|
});
|
|
9509
9520
|
return $b8hua$createComponent((0, $b8hua$Show), {
|
|
9510
9521
|
get when() {
|