@depict-ai/ui 1.4.4 → 1.4.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 +1041 -220
- package/ES10/index.d.ts +105 -24
- package/ES10/index.js +1041 -220
- package/latest/index.cjs +939 -188
- package/latest/index.d.ts +105 -24
- package/latest/index.js +939 -188
- package/locales/ES10/index.cjs +128 -26
- package/locales/ES10/index.d.ts +4 -1
- package/locales/ES10/index.js +128 -26
- package/locales/latest/index.cjs +128 -26
- package/locales/latest/index.d.ts +4 -1
- package/locales/latest/index.js +128 -26
- package/package.json +4 -4
- package/server/ES10/index.cjs +876 -148
- package/server/ES10/index.d.ts +105 -24
- package/server/ES10/index.js +876 -148
- package/server/latest/index.cjs +783 -122
- package/server/latest/index.d.ts +105 -24
- package/server/latest/index.js +783 -122
package/ES10/index.cjs
CHANGED
|
@@ -60,7 +60,7 @@ $parcel$export(module.exports, "defaultColsAtSize", () => $33eed84f447aa0c0$expo
|
|
|
60
60
|
$parcel$export(module.exports, "defaultCategoryTitlePlugin", () => $33eed84f447aa0c0$export$7bf543b9d9be2c22);
|
|
61
61
|
$parcel$export(module.exports, "version", () => $aa1938dec50d6c12$export$83d89fbfd8236492);
|
|
62
62
|
/*! Depict.ai search and product listing SDK */
|
|
63
|
-
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.
|
|
63
|
+
const $aa1938dec50d6c12$export$83d89fbfd8236492 = "1.4.5";
|
|
64
64
|
function $d6d51b09cb2116a6$export$5bad61ecde080b1f() {
|
|
65
65
|
const {
|
|
66
66
|
collapse: collapse,
|
|
@@ -738,7 +738,7 @@ function $c5842bdb10e57229$export$fecbb157621501bd(_ref) {
|
|
|
738
738
|
}
|
|
739
739
|
(0, $52FdA$solidjsweb.delegateEvents)(["click"]);
|
|
740
740
|
const $6b92e147c6e24046$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<span class="count"></span>`, 2),
|
|
741
|
-
$6b92e147c6e24046$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text"></span></div><!#><!/></label>`, 11);
|
|
741
|
+
$6b92e147c6e24046$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<label class="input-row"><div class="left"><input type="checkbox"><span class="custom-indicator"></span><span class="text line-clamp"></span></div><!#><!/></label>`, 11);
|
|
742
742
|
const $6b92e147c6e24046$export$48513f6b9f8ce62d = props => {
|
|
743
743
|
// It seems like there's no diffing without memos here (since we often just have computations in the getters above that update to the same result often because their dependencies change with unrelated changes often), so put memos here to avoid unneeded DOM changes
|
|
744
744
|
const count = (0, $52FdA$solidjs.createMemo)(() => props.count_);
|
|
@@ -2860,9 +2860,14 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2860
2860
|
// Copy of Layout from utilishared but using solid-js signals instead of async iterable IPNS
|
|
2861
2861
|
const show_all_rows = (0, $52FdA$solidjs.createMemo)(() => props.rows === "all");
|
|
2862
2862
|
const rows_or_empty_object = (0, $52FdA$solidjs.createMemo)(() => show_all_rows() ? {} : props.rows);
|
|
2863
|
-
const
|
|
2864
|
-
const
|
|
2865
|
-
|
|
2863
|
+
const view_more_button_elements = (0, $e82d0d417fa613e8$export$2f0cbfbb4354bb52)((0, $52FdA$solidjs.createMemo)(() => rows_or_empty_object().button));
|
|
2864
|
+
const view_less_button_elements = (0, $e82d0d417fa613e8$export$2f0cbfbb4354bb52)((0, $52FdA$solidjs.createMemo)(() => rows_or_empty_object().view_less_button));
|
|
2865
|
+
const have_a_view_more_button = (0, $52FdA$solidjs.createMemo)(() => {
|
|
2866
|
+
const button = view_more_button_elements();
|
|
2867
|
+
return !(!button || Array.isArray(button) && !button.length);
|
|
2868
|
+
});
|
|
2869
|
+
const have_a_view_less_button = (0, $52FdA$solidjs.createMemo)(() => {
|
|
2870
|
+
const button = view_less_button_elements();
|
|
2866
2871
|
return !(!button || Array.isArray(button) && !button.length);
|
|
2867
2872
|
});
|
|
2868
2873
|
const [get_styling, set_styling] = (0, $52FdA$solidjs.createSignal)();
|
|
@@ -2871,22 +2876,38 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2871
2876
|
const [get_children_count, set_children_count] = (0, $52FdA$solidjs.createSignal)(0);
|
|
2872
2877
|
const update_children_count = () => set_children_count(container_element.children.length);
|
|
2873
2878
|
const col_styling = (0, $52FdA$solidjs.createMemo)(() => (0, $52FdA$depictaiutilishared.n_col_styling_with_dist)(selector_beginning, props.grid_spacing, props.cols_at_size, props.layout, props.override_vertical_spacing));
|
|
2874
|
-
const default_currently_visible_signal = (0, $52FdA$solidjs.createSignal)(0)
|
|
2879
|
+
const default_currently_visible_signal = (0, $52FdA$solidjs.createSignal)((0, $52FdA$solidjs.untrack)(() => {
|
|
2880
|
+
var _rows_or_empty_object;
|
|
2881
|
+
return (_rows_or_empty_object = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object !== void 0 ? _rows_or_empty_object : 1;
|
|
2882
|
+
})); // Keep this signal here, so it doesn't change when rows_or_empty_object and I think it's to be expected that the "internal default signal" stays the same
|
|
2875
2883
|
const rows_visible_signal = (0, $52FdA$solidjs.createMemo)(() => rows_or_empty_object().currently_visible || default_currently_visible_signal);
|
|
2876
2884
|
const get_rows_visible = (0, $52FdA$solidjs.createMemo)(() => rows_visible_signal()[0]());
|
|
2877
2885
|
const set_rows_visible = (0, $52FdA$solidjs.createMemo)(() => rows_visible_signal()[1]);
|
|
2878
|
-
const
|
|
2879
|
-
const
|
|
2886
|
+
const view_more_button_class = (0, $52FdA$depictaiutilishared.make_random_classname)();
|
|
2887
|
+
const view_less_button_class = (0, $52FdA$depictaiutilishared.make_random_classname)();
|
|
2888
|
+
const view_more_button_container = (0, $52FdA$solidjs.createMemo)(() => have_a_view_more_button() && (() => {
|
|
2880
2889
|
const _el$2 = (0, $52FdA$solidjsweb.getNextElement)($6c2c739b113a8ddf$var$_tmpl$);
|
|
2881
2890
|
(0, $52FdA$solidjsweb.addEventListener)(_el$2, "click", (0, $52FdA$depictaiutilishared.catchify)(() => set_rows_visible()(prev => {
|
|
2882
|
-
var
|
|
2883
|
-
return prev + ((
|
|
2891
|
+
var _rows_or_empty_object2;
|
|
2892
|
+
return prev + ((_rows_or_empty_object2 = rows_or_empty_object().rows_per_click) !== null && _rows_or_empty_object2 !== void 0 ? _rows_or_empty_object2 : 1);
|
|
2884
2893
|
})), true);
|
|
2885
|
-
(0, $52FdA$solidjsweb.className)(_el$2, "load-more-container "
|
|
2894
|
+
(0, $52FdA$solidjsweb.className)(_el$2, "load-more-container ".concat(view_more_button_class));
|
|
2886
2895
|
(0, $52FdA$solidjsweb.insert)(_el$2, () => rows_or_empty_object().button);
|
|
2887
2896
|
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
2888
2897
|
return _el$2;
|
|
2889
2898
|
})());
|
|
2899
|
+
// We need to have duplicate buttons because which ones is shown depends on the number of rows visible and therefore on the viewport size and therefore on the css media queries
|
|
2900
|
+
const view_less_button_container = (0, $52FdA$solidjs.createMemo)(() => have_a_view_less_button() && (() => {
|
|
2901
|
+
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($6c2c739b113a8ddf$var$_tmpl$);
|
|
2902
|
+
(0, $52FdA$solidjsweb.addEventListener)(_el$3, "click", (0, $52FdA$depictaiutilishared.catchify)(() => set_rows_visible()(() => {
|
|
2903
|
+
var _rows_or_empty_object3;
|
|
2904
|
+
return (_rows_or_empty_object3 = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object3 !== void 0 ? _rows_or_empty_object3 : 1;
|
|
2905
|
+
})), true);
|
|
2906
|
+
(0, $52FdA$solidjsweb.className)(_el$3, "load-less-container ".concat(view_less_button_class));
|
|
2907
|
+
(0, $52FdA$solidjsweb.insert)(_el$3, () => rows_or_empty_object().view_less_button);
|
|
2908
|
+
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
2909
|
+
return _el$3;
|
|
2910
|
+
})());
|
|
2890
2911
|
container_element.classList.add(container_class);
|
|
2891
2912
|
(0, $52FdA$solidjs.createComputed)(() => {
|
|
2892
2913
|
// Make sure we don't have more rows visible than max_rows (this could happen by max_rows being decreased)
|
|
@@ -2901,10 +2922,6 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2901
2922
|
set_styling(() => col_styling);
|
|
2902
2923
|
return;
|
|
2903
2924
|
}
|
|
2904
|
-
(0, $52FdA$solidjs.untrack)(() => {
|
|
2905
|
-
var _rows_or_empty_object2;
|
|
2906
|
-
return set_rows_visible()((_rows_or_empty_object2 = rows_or_empty_object().start_rows) !== null && _rows_or_empty_object2 !== void 0 ? _rows_or_empty_object2 : 1);
|
|
2907
|
-
});
|
|
2908
2925
|
update_children_count();
|
|
2909
2926
|
const mutation_observer = new MutationObserver((0, $52FdA$depictaiutilishared.catchify)(update_children_count));
|
|
2910
2927
|
mutation_observer.observe(container_element, {
|
|
@@ -2916,33 +2933,36 @@ function $6c2c739b113a8ddf$var$ActualSolidLayout(props, container_element) {
|
|
|
2916
2933
|
() => (0, $52FdA$solidjs.createMemo)(() => {
|
|
2917
2934
|
const {
|
|
2918
2935
|
rows_per_click: rows_per_click,
|
|
2919
|
-
max_rows = -1
|
|
2936
|
+
max_rows = -1,
|
|
2937
|
+
start_rows: start_rows
|
|
2920
2938
|
} = rows_or_empty_object();
|
|
2921
2939
|
const rows_visible = get_rows_visible();
|
|
2922
2940
|
const children_count = get_children_count();
|
|
2923
2941
|
return col_styling() + props.cols_at_size.map(options => {
|
|
2924
|
-
const [, min, max] = options;
|
|
2925
|
-
let
|
|
2942
|
+
const [recs_per_row, min, max] = options;
|
|
2943
|
+
let should_hide_view_more_button;
|
|
2926
2944
|
let visible_recs;
|
|
2927
2945
|
if (props.disable_partial_rows) {
|
|
2928
2946
|
visible_recs = (0, $52FdA$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible, children_count, options);
|
|
2929
2947
|
const visible_recs_next_show_more = (0, $52FdA$depictaiutilishared.layout_get_visible_recs_without_partial_rows)(rows_visible + (rows_per_click || 0),
|
|
2930
2948
|
// Should this really be zero when we default rows_per_click to 1?
|
|
2931
2949
|
children_count, options);
|
|
2932
|
-
|
|
2950
|
+
should_hide_view_more_button = visible_recs === visible_recs_next_show_more;
|
|
2933
2951
|
} else {
|
|
2934
2952
|
visible_recs = (0, $52FdA$depictaiutilishared.layout_get_total_rec_amount_for_row)(rows_visible, options);
|
|
2935
|
-
|
|
2953
|
+
should_hide_view_more_button = visible_recs >= children_count;
|
|
2936
2954
|
}
|
|
2937
|
-
const should_hide_button_final =
|
|
2938
|
-
|
|
2955
|
+
const should_hide_button_final = should_hide_view_more_button || max_rows !== -1 && rows_visible >= max_rows;
|
|
2956
|
+
// I don't really understand the logic for when the view more button gets hidden so IDK if below is correct, but it works how it should for now
|
|
2957
|
+
const should_hide_view_less_button = !should_hide_view_more_button || start_rows == undefined || rows_visible <= start_rows || children_count <= recs_per_row * start_rows;
|
|
2958
|
+
return "".concat((0, $52FdA$depictaiutilishared.layout_media_query_header)(min, max), "{").concat(selector_beginning, ":nth-child(n+").concat(visible_recs + 1, "){display:none}").concat(props.layout == "slider" ? "".concat(selector_beginning, ":nth-child(n+").concat(visible_recs, "){margin-right:0}") : "").concat(should_hide_button_final ? ".depict .".concat(view_more_button_class, "{display:none!important}") : "").concat(should_hide_view_less_button ? ".depict .".concat(view_less_button_class, "{display:none!important}") : "", "}");
|
|
2939
2959
|
}).join("");
|
|
2940
2960
|
}));
|
|
2941
2961
|
});
|
|
2942
|
-
return [container_element, (0, $52FdA$solidjsweb.memo)(
|
|
2943
|
-
const _el$
|
|
2944
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
2945
|
-
return _el$
|
|
2962
|
+
return [container_element, (0, $52FdA$solidjsweb.memo)(view_more_button_container), (0, $52FdA$solidjsweb.memo)(view_less_button_container), (() => {
|
|
2963
|
+
const _el$4 = (0, $52FdA$solidjsweb.getNextElement)($6c2c739b113a8ddf$var$_tmpl$2);
|
|
2964
|
+
(0, $52FdA$solidjsweb.insert)(_el$4, get_styling);
|
|
2965
|
+
return _el$4;
|
|
2946
2966
|
})()];
|
|
2947
2967
|
}
|
|
2948
2968
|
(0, $52FdA$solidjsweb.delegateEvents)(["click"]);
|
|
@@ -3136,16 +3156,17 @@ var $e270e9f953fcbc58$var$_get_user_id = /*#__PURE__*/new WeakMap();
|
|
|
3136
3156
|
var $e270e9f953fcbc58$var$_get_session_id = /*#__PURE__*/new WeakMap();
|
|
3137
3157
|
var $e270e9f953fcbc58$var$_guard_url_creator_length = /*#__PURE__*/new WeakSet();
|
|
3138
3158
|
var $e270e9f953fcbc58$var$_run_url_creator_for_suggest = /*#__PURE__*/new WeakSet();
|
|
3139
|
-
var $e270e9f953fcbc58$var$
|
|
3159
|
+
var $e270e9f953fcbc58$var$_run_display_transformers_for_rest = /*#__PURE__*/new WeakSet();
|
|
3140
3160
|
var $e270e9f953fcbc58$var$_cached_post_request = /*#__PURE__*/new WeakSet();
|
|
3141
3161
|
class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
3142
3162
|
constructor(options) {
|
|
3143
3163
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_cached_post_request);
|
|
3144
|
-
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$
|
|
3164
|
+
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_run_display_transformers_for_rest);
|
|
3145
3165
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_run_url_creator_for_suggest);
|
|
3146
3166
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_guard_url_creator_length);
|
|
3147
3167
|
$e270e9f953fcbc58$var$_classPrivateMethodInitSpec(this, $e270e9f953fcbc58$var$_get_cache_obj_for_endpoint);
|
|
3148
3168
|
(0, $parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty))(this, "page_url_creator", void 0);
|
|
3169
|
+
(0, $parcel$interopDefault($52FdA$babelruntimehelpersdefineProperty))(this, "display_transformers", void 0);
|
|
3149
3170
|
$e270e9f953fcbc58$var$_classPrivateFieldInitSpec(this, $e270e9f953fcbc58$var$_supports_finalization_registry, {
|
|
3150
3171
|
writable: true,
|
|
3151
3172
|
value: typeof FinalizationRegistry === "function"
|
|
@@ -3184,12 +3205,14 @@ class $e270e9f953fcbc58$export$e015ed2f2950f2e3 {
|
|
|
3184
3205
|
get_metadata: get_metadata,
|
|
3185
3206
|
get_user_id: _get_user_id2,
|
|
3186
3207
|
get_session_id: _get_session_id2,
|
|
3187
|
-
page_url_creator:
|
|
3208
|
+
page_url_creator: _page_url_creator,
|
|
3209
|
+
display_transformers: _display_transformers
|
|
3188
3210
|
} = options !== null && options !== void 0 ? options : {};
|
|
3189
3211
|
(0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_metadata, get_metadata);
|
|
3190
3212
|
(0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_user_id, _get_user_id2);
|
|
3191
3213
|
(0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldSet))(this, $e270e9f953fcbc58$var$_get_session_id, _get_session_id2);
|
|
3192
|
-
this.page_url_creator =
|
|
3214
|
+
this.page_url_creator = _page_url_creator;
|
|
3215
|
+
this.display_transformers = _display_transformers;
|
|
3193
3216
|
}
|
|
3194
3217
|
async suggest(input_req) {
|
|
3195
3218
|
var _classPrivateFieldGet4;
|
|
@@ -3266,14 +3289,19 @@ function $e270e9f953fcbc58$var$_guard_url_creator_length2(expected, received) {
|
|
|
3266
3289
|
}
|
|
3267
3290
|
}
|
|
3268
3291
|
async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, market, response) {
|
|
3269
|
-
|
|
3292
|
+
var _this$display_transfo;
|
|
3293
|
+
const page_url_creator = this.page_url_creator;
|
|
3294
|
+
const category_transformer = (_this$display_transfo = this.display_transformers) === null || _this$display_transfo === void 0 ? void 0 : _this$display_transfo.categories;
|
|
3295
|
+
if (!page_url_creator && !category_transformer) return response;
|
|
3270
3296
|
// find category suggestions, run thing with them, and then replace them
|
|
3271
3297
|
const category_suggestions = response.suggestions.filter(suggestion => suggestion.type === "category");
|
|
3272
|
-
const page_urls = await
|
|
3273
|
-
type: "categories",
|
|
3298
|
+
const page_urls = await (page_url_creator || category_transformer)({
|
|
3274
3299
|
market: market,
|
|
3275
3300
|
merchant: merchant,
|
|
3276
|
-
data: [...category_suggestions]
|
|
3301
|
+
data: [...category_suggestions],
|
|
3302
|
+
...(page_url_creator ? {
|
|
3303
|
+
type: "categories"
|
|
3304
|
+
} : {})
|
|
3277
3305
|
});
|
|
3278
3306
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, category_suggestions, page_urls);
|
|
3279
3307
|
while (page_urls.length)
|
|
@@ -3281,17 +3309,29 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_suggest2(merchant, mar
|
|
|
3281
3309
|
Object.defineProperties(category_suggestions.pop(), Object.getOwnPropertyDescriptors(page_urls.pop()));
|
|
3282
3310
|
return response;
|
|
3283
3311
|
}
|
|
3284
|
-
async function $e270e9f953fcbc58$var$
|
|
3285
|
-
|
|
3312
|
+
async function $e270e9f953fcbc58$var$_run_display_transformers_for_rest2(merchant, market, input_data) {
|
|
3313
|
+
const {
|
|
3314
|
+
page_url_creator: page_url_creator,
|
|
3315
|
+
display_transformers: display_transformers
|
|
3316
|
+
} = this;
|
|
3317
|
+
if (!page_url_creator && !display_transformers) return input_data;
|
|
3318
|
+
const product_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.products;
|
|
3319
|
+
const category_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.categories;
|
|
3320
|
+
const content_result_transformer = display_transformers === null || display_transformers === void 0 ? void 0 : display_transformers.contentResults;
|
|
3286
3321
|
const displays = input_data.displays;
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3322
|
+
const {
|
|
3323
|
+
breadcrumb: breadcrumb,
|
|
3324
|
+
quick_links: quick_links,
|
|
3325
|
+
content_search_links: content_search_links
|
|
3326
|
+
} = input_data;
|
|
3327
|
+
if (displays && (page_url_creator || product_transformer)) {
|
|
3328
|
+
const page_urls = await (page_url_creator || product_transformer)({
|
|
3292
3329
|
merchant: merchant,
|
|
3293
3330
|
market: market,
|
|
3294
|
-
displays: [...input_data.displays]
|
|
3331
|
+
displays: [...input_data.displays],
|
|
3332
|
+
...(page_url_creator ? {
|
|
3333
|
+
type: "products"
|
|
3334
|
+
} : {})
|
|
3295
3335
|
});
|
|
3296
3336
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, displays, page_urls);
|
|
3297
3337
|
for (let i = 0; i < displays.length; i++) {
|
|
@@ -3309,19 +3349,30 @@ async function $e270e9f953fcbc58$var$_run_url_creator_for_rest2(merchant, market
|
|
|
3309
3349
|
displays[i] = new_display_or_page_url;
|
|
3310
3350
|
}
|
|
3311
3351
|
}
|
|
3312
|
-
for (const category_display_array of [breadcrumb, quick_links]) {
|
|
3352
|
+
if (page_url_creator || category_transformer) for (const category_display_array of [breadcrumb, quick_links]) {
|
|
3313
3353
|
if (!category_display_array) continue;
|
|
3314
|
-
const page_urls = await
|
|
3315
|
-
type: "categories",
|
|
3354
|
+
const page_urls = await (page_url_creator || category_transformer)({
|
|
3316
3355
|
merchant: merchant,
|
|
3317
3356
|
market: market,
|
|
3318
|
-
data: [...category_display_array]
|
|
3357
|
+
data: [...category_display_array],
|
|
3358
|
+
...(page_url_creator ? {
|
|
3359
|
+
type: "categories"
|
|
3360
|
+
} : {})
|
|
3319
3361
|
});
|
|
3320
3362
|
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, category_display_array, page_urls);
|
|
3321
3363
|
for (let i = 0; i < category_display_array.length; i++)
|
|
3322
3364
|
// Copy over getters so we sneakily can make this reactive
|
|
3323
3365
|
Object.defineProperties(category_display_array[i], Object.getOwnPropertyDescriptors(page_urls[i]));
|
|
3324
3366
|
}
|
|
3367
|
+
if (content_search_links !== null && content_search_links !== void 0 && content_search_links.length && content_result_transformer) {
|
|
3368
|
+
const result = await content_result_transformer({
|
|
3369
|
+
merchant: merchant,
|
|
3370
|
+
market: market,
|
|
3371
|
+
data: [...content_search_links]
|
|
3372
|
+
});
|
|
3373
|
+
$e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_guard_url_creator_length, $e270e9f953fcbc58$var$_guard_url_creator_length2).call(this, content_search_links, result);
|
|
3374
|
+
input_data.content_search_links = result;
|
|
3375
|
+
}
|
|
3325
3376
|
return input_data;
|
|
3326
3377
|
}
|
|
3327
3378
|
async function $e270e9f953fcbc58$var$_cached_post_request2(endpoint, input_req, fallback_response) {
|
|
@@ -3349,7 +3400,7 @@ async function $e270e9f953fcbc58$var$_cached_post_request2(endpoint, input_req,
|
|
|
3349
3400
|
let result;
|
|
3350
3401
|
try {
|
|
3351
3402
|
const unmodified_result = await api_response.json();
|
|
3352
|
-
result = await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$
|
|
3403
|
+
result = await $e270e9f953fcbc58$var$_classPrivateMethodGet(this, $e270e9f953fcbc58$var$_run_display_transformers_for_rest, $e270e9f953fcbc58$var$_run_display_transformers_for_rest2).call(this, input_req.tenant, input_req.market, unmodified_result);
|
|
3353
3404
|
} catch (e) {
|
|
3354
3405
|
(0, $52FdA$depictaiutilishared.dwarn)("URL creator or json decoding failed", e);
|
|
3355
3406
|
break return_successfully;
|
|
@@ -3439,12 +3490,11 @@ function $55f06aa93e360e7f$var$correct_range_filter_range_once(_ref3) {
|
|
|
3439
3490
|
}
|
|
3440
3491
|
function $068bde7fa83ac02c$export$92f2da32c6e7e7ee(_ref) {
|
|
3441
3492
|
let {
|
|
3442
|
-
|
|
3493
|
+
number_: number_,
|
|
3443
3494
|
i18n_: i18n_
|
|
3444
3495
|
} = _ref;
|
|
3445
3496
|
return (0, $52FdA$solidjs.createMemo)(() => {
|
|
3446
|
-
|
|
3447
|
-
const n_hits = (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.n_hits;
|
|
3497
|
+
const n_hits = number_();
|
|
3448
3498
|
if (isNaN(n_hits)) return "";
|
|
3449
3499
|
const price_formatting = i18n_.price_formatting_();
|
|
3450
3500
|
return (0, $52FdA$depictaiutilishared.standard_price_format)(n_hits, 0,
|
|
@@ -6079,7 +6129,10 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
6079
6129
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $52FdA$solidjs.createSignal)(false);
|
|
6080
6130
|
const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $52FdA$solidjs.createSignal)();
|
|
6081
6131
|
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
6082
|
-
|
|
6132
|
+
number_: (0, $52FdA$solidjs.createMemo)(() => {
|
|
6133
|
+
var _plp_results_5;
|
|
6134
|
+
return (_plp_results_5 = plp_results_()) === null || _plp_results_5 === void 0 ? void 0 : _plp_results_5.n_hits;
|
|
6135
|
+
}),
|
|
6083
6136
|
i18n_: i18n_
|
|
6084
6137
|
});
|
|
6085
6138
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = (0, $52FdA$solidjs.createSignal)();
|
|
@@ -6110,8 +6163,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
6110
6163
|
}), _el$4, _co$);
|
|
6111
6164
|
(0, $52FdA$solidjsweb.insert)(_el$, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
6112
6165
|
get when() {
|
|
6113
|
-
var
|
|
6114
|
-
return ((
|
|
6166
|
+
var _plp_results_6;
|
|
6167
|
+
return ((_plp_results_6 = plp_results_()) === null || _plp_results_6 === void 0 ? void 0 : _plp_results_6.n_hits) === 1;
|
|
6115
6168
|
},
|
|
6116
6169
|
get fallback() {
|
|
6117
6170
|
return i18n_.products_();
|
|
@@ -6330,8 +6383,8 @@ function $ede6c70ecdca46fe$export$f7d2f673fc2f091d(_ref) {
|
|
|
6330
6383
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
6331
6384
|
i18n_: i18n_,
|
|
6332
6385
|
number_of_results_: (0, $52FdA$solidjs.createMemo)(() => {
|
|
6333
|
-
var
|
|
6334
|
-
return (
|
|
6386
|
+
var _plp_results_7;
|
|
6387
|
+
return (_plp_results_7 = plp_results_()) === null || _plp_results_7 === void 0 ? void 0 : _plp_results_7.n_hits;
|
|
6335
6388
|
})
|
|
6336
6389
|
});
|
|
6337
6390
|
}
|
|
@@ -6726,7 +6779,6 @@ function $9cbefc32b9dab36d$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
6726
6779
|
return descriptor.value;
|
|
6727
6780
|
}
|
|
6728
6781
|
// We just pass page_url_creator to DepictAPI when we instantiate it, so don't allow it to be specified if api is already specified
|
|
6729
|
-
// on old displays, no page_url_creator can be specified
|
|
6730
6782
|
/**
|
|
6731
6783
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions.
|
|
6732
6784
|
* SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
@@ -6794,6 +6846,7 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
6794
6846
|
api: api,
|
|
6795
6847
|
on_navigation: on_navigation,
|
|
6796
6848
|
page_url_creator: page_url_creator,
|
|
6849
|
+
display_transformers: display_transformers,
|
|
6797
6850
|
unique_instance_key_for_state = "",
|
|
6798
6851
|
query_id_state_key: query_id_state_key,
|
|
6799
6852
|
...props_on_class
|
|
@@ -6862,8 +6915,10 @@ class $9cbefc32b9dab36d$export$f34314aa9505732e {
|
|
|
6862
6915
|
quicklinks_signal_: (0, $52FdA$solidjs.createSignal)(),
|
|
6863
6916
|
i18n_: i18n_,
|
|
6864
6917
|
reset_history_state_: reset_history_state_,
|
|
6918
|
+
// @ts-ignore
|
|
6865
6919
|
depict_api_: api !== null && api !== void 0 ? api : new (0, $e270e9f953fcbc58$export$e015ed2f2950f2e3)({
|
|
6866
|
-
page_url_creator: page_url_creator
|
|
6920
|
+
page_url_creator: page_url_creator,
|
|
6921
|
+
display_transformers: display_transformers
|
|
6867
6922
|
}),
|
|
6868
6923
|
router_: (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $9cbefc32b9dab36d$var$_router),
|
|
6869
6924
|
selected_filters_: selected_filters_,
|
|
@@ -7518,13 +7573,12 @@ function $c77adcdf5346b187$export$7de92c4c2205ebf3(_ref) {
|
|
|
7518
7573
|
});
|
|
7519
7574
|
}
|
|
7520
7575
|
function $c77adcdf5346b187$var$make_state_saved_rows(_ref3, i18n_) {
|
|
7521
|
-
var _untrack;
|
|
7522
7576
|
let [get_showing_recommendation_rows, set_showing_recommendation_rows] = _ref3;
|
|
7523
|
-
const currently_visible = (0, $52FdA$solidjs.createSignal)(0);
|
|
7577
|
+
const currently_visible = (0, $52FdA$solidjs.createSignal)((0, $52FdA$solidjs.untrack)(get_showing_recommendation_rows));
|
|
7524
7578
|
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
7525
7579
|
const rows = {
|
|
7526
7580
|
currently_visible: currently_visible,
|
|
7527
|
-
start_rows:
|
|
7581
|
+
start_rows: $c77adcdf5346b187$export$1c8c715550dc689d,
|
|
7528
7582
|
rows_per_click: 3,
|
|
7529
7583
|
button: (() => {
|
|
7530
7584
|
const _el$7 = (0, $52FdA$solidjsweb.getNextElement)($c77adcdf5346b187$var$_tmpl$2);
|
|
@@ -7697,7 +7751,7 @@ const $65353359a9fbdacd$export$27b710c08412a7ad = obj => {
|
|
|
7697
7751
|
return Object.fromEntries(Object.keys(obj).map(key => [key, obj[key]()]));
|
|
7698
7752
|
};
|
|
7699
7753
|
const $82d079b68975fbf7$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<span class="orig price"><!#><!/><!#><!/><!#><!/></span>`, 8),
|
|
7700
|
-
$82d079b68975fbf7$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="brand"></span><span class="title"></span><!#><!/></div><div class="price-container"><!#><!/><span class="price"><!#><!/><!#><!/><!#><!/></span></div></div></a>`, 26),
|
|
7754
|
+
$82d079b68975fbf7$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a class="instant-card"><div class="img-part"></div><div class="right-part"><div class="title-brand-tagline"><span class="brand"></span><span class="title line-clamp"></span><!#><!/></div><div class="price-container"><!#><!/><span class="price"><!#><!/><!#><!/><!#><!/></span></div></div></a>`, 26),
|
|
7701
7755
|
$82d079b68975fbf7$var$_tmpl$3 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="tagline"></div>`, 2);
|
|
7702
7756
|
const $82d079b68975fbf7$export$b05c0ae390cf3e06 = (display_or_variant_container, _ref, router_) => {
|
|
7703
7757
|
let {
|
|
@@ -7835,9 +7889,11 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
7835
7889
|
render_instant_card_placeholder_: render_instant_card_placeholder_,
|
|
7836
7890
|
min_products_to_fetch_: min_products_to_fetch_,
|
|
7837
7891
|
has_sort_or_filters_: has_sort_or_filters_,
|
|
7838
|
-
|
|
7892
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
7839
7893
|
i18n_: i18n_,
|
|
7840
|
-
router_: router_
|
|
7894
|
+
router_: router_,
|
|
7895
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
7896
|
+
content_search_enabled_: content_search_enabled_
|
|
7841
7897
|
} = _ref;
|
|
7842
7898
|
const max_cards = 4;
|
|
7843
7899
|
const [read_current_instant_query, write_current_instant_query] = (0, $52FdA$solidjs.createSignal)("");
|
|
@@ -7862,13 +7918,23 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
7862
7918
|
...variable_data
|
|
7863
7919
|
});
|
|
7864
7920
|
}));
|
|
7865
|
-
|
|
7866
|
-
|
|
7921
|
+
// Maybe we should move this createResoure out of this component, on the other hand it bloats the parent component and if it fails it takes more than needed with it, so I think writing the content results from here is better
|
|
7922
|
+
// This is for the press-enter-to-instant-content-result feature which gets called from Autocomplete.tsx
|
|
7923
|
+
set_modal_search_results_(() => search_results);
|
|
7924
|
+
(0, $52FdA$solidjs.onCleanup)(() => set_modal_search_results_(undefined)); // for consistency, in case this component crashes
|
|
7925
|
+
set_total_num_results_accessor_(() => (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
7926
|
+
number_: (0, $52FdA$solidjs.createMemo)(() => {
|
|
7927
|
+
var _search_results, _search_results2, _search_results2$cont;
|
|
7928
|
+
const hits = (_search_results = search_results()) === null || _search_results === void 0 ? void 0 : _search_results.n_hits;
|
|
7929
|
+
const content_results = (_search_results2 = search_results()) === null || _search_results2 === void 0 ? void 0 : (_search_results2$cont = _search_results2.content_search_links) === null || _search_results2$cont === void 0 ? void 0 : _search_results2$cont.length;
|
|
7930
|
+
if (!content_results || !content_search_enabled_()) return hits;
|
|
7931
|
+
return (hits !== null && hits !== void 0 ? hits : 0) + content_results;
|
|
7932
|
+
}),
|
|
7867
7933
|
i18n_: i18n_
|
|
7868
7934
|
}));
|
|
7869
7935
|
const sliced_displays = (0, $52FdA$solidjs.createMemo)(() => {
|
|
7870
|
-
var
|
|
7871
|
-
return (
|
|
7936
|
+
var _search_results3, _search_results3$disp;
|
|
7937
|
+
return (_search_results3 = search_results()) === null || _search_results3 === void 0 ? void 0 : (_search_results3$disp = _search_results3.displays) === null || _search_results3$disp === void 0 ? void 0 : _search_results3$disp.slice(0, max_cards);
|
|
7872
7938
|
});
|
|
7873
7939
|
let placeholder;
|
|
7874
7940
|
return (() => {
|
|
@@ -7880,8 +7946,8 @@ function $6e8d48eea3d0469d$export$62f101a8aa597bf8(_ref) {
|
|
|
7880
7946
|
},
|
|
7881
7947
|
get fallback() {
|
|
7882
7948
|
return (0, $52FdA$solidjs.createMemo)(() => {
|
|
7883
|
-
var
|
|
7884
|
-
if (Array.isArray((
|
|
7949
|
+
var _search_results4;
|
|
7950
|
+
if (Array.isArray((_search_results4 = search_results()) === null || _search_results4 === void 0 ? void 0 : _search_results4.displays))
|
|
7885
7951
|
// remove placeholders if we have a response but no results
|
|
7886
7952
|
return undefined;
|
|
7887
7953
|
return new Array(max_cards).fill(1).map(() => (placeholder || (placeholder = render_instant_card_placeholder_())).cloneNode(true));
|
|
@@ -7969,7 +8035,7 @@ function $8767e7eba5066d2b$export$5d2caaa6b530761c() {
|
|
|
7969
8035
|
return (0, $52FdA$solidjsweb.getNextElement)($8767e7eba5066d2b$var$_tmpl$);
|
|
7970
8036
|
}
|
|
7971
8037
|
const $4edbc04f5c5a1843$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="previous-searches"><h2 class="text"></h2><div class="list"></div></div>`, 6),
|
|
7972
|
-
$4edbc04f5c5a1843$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a class="item"><div class="left"><!#><!/><span></span></div><button class="delete"></button></a>`, 10);
|
|
8038
|
+
$4edbc04f5c5a1843$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a class="item"><div class="left"><!#><!/><span class="line-clamp"></span></div><button class="delete"></button></a>`, 10);
|
|
7973
8039
|
function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
7974
8040
|
let {
|
|
7975
8041
|
text_: text_,
|
|
@@ -8055,15 +8121,18 @@ function $4edbc04f5c5a1843$export$a146ac6fa8346a25(_ref) {
|
|
|
8055
8121
|
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === 0 && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
8056
8122
|
})(),
|
|
8057
8123
|
_v$2 = href(),
|
|
8058
|
-
_v$3 =
|
|
8124
|
+
_v$3 = item(),
|
|
8125
|
+
_v$4 = i18n_.previous_searches_delete_entry_from_history_();
|
|
8059
8126
|
_v$ !== _p$._v$ && _el$4.classList.toggle("selected", _p$._v$ = _v$);
|
|
8060
8127
|
_v$2 !== _p$._v$2 && (0, $52FdA$solidjsweb.setAttribute)(_el$4, "href", _p$._v$2 = _v$2);
|
|
8061
|
-
_v$3 !== _p$._v$3 && (0, $52FdA$solidjsweb.setAttribute)(_el$
|
|
8128
|
+
_v$3 !== _p$._v$3 && (0, $52FdA$solidjsweb.setAttribute)(_el$6, "title", _p$._v$3 = _v$3);
|
|
8129
|
+
_v$4 !== _p$._v$4 && (0, $52FdA$solidjsweb.setAttribute)(_el$9, "title", _p$._v$4 = _v$4);
|
|
8062
8130
|
return _p$;
|
|
8063
8131
|
}, {
|
|
8064
8132
|
_v$: undefined,
|
|
8065
8133
|
_v$2: undefined,
|
|
8066
|
-
_v$3: undefined
|
|
8134
|
+
_v$3: undefined,
|
|
8135
|
+
_v$4: undefined
|
|
8067
8136
|
});
|
|
8068
8137
|
return _el$4;
|
|
8069
8138
|
})();
|
|
@@ -8133,18 +8202,38 @@ function $23c3f390dee33ff8$export$ba17c5b7e6dda39f(_ref) {
|
|
|
8133
8202
|
const _el$2 = (0, $52FdA$solidjsweb.getNextElement)($23c3f390dee33ff8$var$_tmpl$2);
|
|
8134
8203
|
(0, $52FdA$solidjsweb.className)(_el$2, class_);
|
|
8135
8204
|
(0, $52FdA$solidjsweb.insert)(_el$2, text_itself);
|
|
8136
|
-
(0, $52FdA$solidjsweb.effect)(
|
|
8205
|
+
(0, $52FdA$solidjsweb.effect)(_p$ => {
|
|
8206
|
+
const _v$ = !!get_has_highlighted(),
|
|
8207
|
+
_v$2 = whole_text_to_display_memo() /* for when line-clamped, users can see full text on hover */;
|
|
8208
|
+
_v$ !== _p$._v$ && _el$2.classList.toggle("has-history-match", _p$._v$ = _v$);
|
|
8209
|
+
_v$2 !== _p$._v$2 && (0, $52FdA$solidjsweb.setAttribute)(_el$2, "title", _p$._v$2 = _v$2);
|
|
8210
|
+
return _p$;
|
|
8211
|
+
}, {
|
|
8212
|
+
_v$: undefined,
|
|
8213
|
+
_v$2: undefined
|
|
8214
|
+
});
|
|
8137
8215
|
return _el$2;
|
|
8138
8216
|
})();
|
|
8139
8217
|
}
|
|
8218
|
+
const $3cf7b4db1e203c93$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path d="M56 26.455a13.71 13.71 0 0 0-9.578 3.967A13.71 13.71 0 0 0 42.455 40v176a13.71 13.71 0 0 0 3.967 9.578A13.71 13.71 0 0 0 56 229.545h144A13.71 13.71 0 0 0 213.545 216V88a2.456 2.456 0 0 1 0-.002c.001-1.452-.597-2.895-1.623-3.922l-55.998-55.998a5.61 5.61 0 0 0-3.922-1.623 2.456 2.456 0 0 1-.002 0zm0 11.09h88A2.456 2.456 0 0 1 146.455 40v48c0 2.903 2.642 5.545 5.545 5.545h48A2.456 2.456 0 0 1 202.455 96v120a2.456 2.456 0 0 1-2.455 2.455H56A2.456 2.456 0 0 1 53.545 216V40A2.456 2.456 0 0 1 56 37.545zm103.061 11.498a2.456 2.456 0 0 1 2.676.531l28.689 28.689a2.456 2.456 0 0 1-1.736 4.191H160A2.456 2.456 0 0 1 157.545 80V51.311a2.456 2.456 0 0 1 1.516-2.268zM96 130.455c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545zm0 32c-2.903 0-5.545 2.642-5.545 5.545s2.642 5.545 5.545 5.545h64c2.903 0 5.545-2.642 5.545-5.545s-2.642-5.545-5.545-5.545z"></path></svg>`, 4);
|
|
8219
|
+
function $3cf7b4db1e203c93$export$605674723bcc715c() {
|
|
8220
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8221
|
+
return (() => {
|
|
8222
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($3cf7b4db1e203c93$var$_tmpl$);
|
|
8223
|
+
(0, $52FdA$solidjsweb.spread)(_el$, props, true, true);
|
|
8224
|
+
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
8225
|
+
return _el$;
|
|
8226
|
+
})();
|
|
8227
|
+
}
|
|
8140
8228
|
const $0677d509ad208e22$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a class="suggestion"></a>`, 2),
|
|
8141
8229
|
$0677d509ad208e22$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="search-icon"></div>`, 2),
|
|
8142
8230
|
$0677d509ad208e22$var$_tmpl$3 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<span class="type"></span>`, 2),
|
|
8143
8231
|
$0677d509ad208e22$var$_tmpl$4 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div><!#><!/><span class="value"></span></div>`, 6),
|
|
8144
|
-
$0677d509ad208e22$var$_tmpl$5 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<
|
|
8145
|
-
$0677d509ad208e22$var$_tmpl$6 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<
|
|
8146
|
-
$0677d509ad208e22$var$_tmpl$7 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="suggestion-container
|
|
8147
|
-
$0677d509ad208e22$var$_tmpl$8 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="
|
|
8232
|
+
$0677d509ad208e22$var$_tmpl$5 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="with-icon"><!#><!/><!#><!/></div>`, 6),
|
|
8233
|
+
$0677d509ad208e22$var$_tmpl$6 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<h2 class="text"></h2>`, 2),
|
|
8234
|
+
$0677d509ad208e22$var$_tmpl$7 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="suggestion-container query"><!#><!/><!#><!/></div>`, 6),
|
|
8235
|
+
$0677d509ad208e22$var$_tmpl$8 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="suggestion-container page"></div>`, 2),
|
|
8236
|
+
$0677d509ad208e22$var$_tmpl$9 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="suggestions"><!#><!/><!#><!/><!#><!/></div>`, 8);
|
|
8148
8237
|
function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
8149
8238
|
let {
|
|
8150
8239
|
suggestion_memo_: suggestion_memo_,
|
|
@@ -8158,7 +8247,8 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8158
8247
|
include_category_suggestions_: include_category_suggestions_,
|
|
8159
8248
|
searching_for_value_: searching_for_value_,
|
|
8160
8249
|
router_: router_,
|
|
8161
|
-
submit_query_: submit_query_
|
|
8250
|
+
submit_query_: submit_query_,
|
|
8251
|
+
get_content_results_: get_content_results_
|
|
8162
8252
|
} = _ref;
|
|
8163
8253
|
const queries_memo = (0, $52FdA$solidjs.createMemo)(() => suggestion_memo_().filter(_ref2 => {
|
|
8164
8254
|
let {
|
|
@@ -8169,12 +8259,18 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8169
8259
|
} // don't show the ones we already show from the history
|
|
8170
8260
|
));
|
|
8171
8261
|
|
|
8172
|
-
const not_queries_memo = (0, $52FdA$solidjs.createMemo)(() =>
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8262
|
+
const not_queries_memo = (0, $52FdA$solidjs.createMemo)(() => {
|
|
8263
|
+
// For the section that shows categories and content results
|
|
8264
|
+
// We want to limit to 3 items, and we want to show the categories first
|
|
8265
|
+
const content_results = get_content_results_() || [];
|
|
8266
|
+
const from_suggest_request = include_category_suggestions_ ? suggestion_memo_().filter(_ref3 => {
|
|
8267
|
+
let {
|
|
8268
|
+
type: type
|
|
8269
|
+
} = _ref3;
|
|
8270
|
+
return type !== (0, $ce079d50d380ee11$export$3cf9497e790da491);
|
|
8271
|
+
}) : [];
|
|
8272
|
+
return [...from_suggest_request.slice(0, content_results.length ? 2 : 3), ...content_results.slice(0, 1)];
|
|
8273
|
+
});
|
|
8178
8274
|
const render_entry = function (input_obj, autocomplete_data_index, index) {
|
|
8179
8275
|
let is_history = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8180
8276
|
const is_query = (0, $52FdA$solidjs.createMemo)(() => input_obj().type === (0, $ce079d50d380ee11$export$3cf9497e790da491));
|
|
@@ -8184,6 +8280,10 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8184
8280
|
url_transformer_: url_transformer_
|
|
8185
8281
|
}) : undefined);
|
|
8186
8282
|
const href = (0, $52FdA$solidjs.createMemo)(() => is_query() ? href_with_changed_params_accessor()() : input_obj().page_url);
|
|
8283
|
+
const is_selected = (0, $52FdA$solidjs.createMemo)(() => {
|
|
8284
|
+
var _read_selected_index_, _read_selected_index_2;
|
|
8285
|
+
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === autocomplete_data_index && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
8286
|
+
});
|
|
8187
8287
|
return (() => {
|
|
8188
8288
|
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$);
|
|
8189
8289
|
(0, $52FdA$solidjsweb.use)(element => element.addEventListener("click", (0, $52FdA$depictaiutilishared.catchify)(ev => {
|
|
@@ -8197,7 +8297,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8197
8297
|
return;
|
|
8198
8298
|
}
|
|
8199
8299
|
router_.navigate_.go_to_({
|
|
8200
|
-
new_url_:
|
|
8300
|
+
new_url_: href(),
|
|
8201
8301
|
is_replace_: false,
|
|
8202
8302
|
event_: ev
|
|
8203
8303
|
});
|
|
@@ -8219,20 +8319,20 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8219
8319
|
return (0, $52FdA$solidjsweb.createComponent)((0, $8767e7eba5066d2b$export$5d2caaa6b530761c), {});
|
|
8220
8320
|
}
|
|
8221
8321
|
}), (0, $52FdA$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
8222
|
-
class_: "value",
|
|
8322
|
+
class_: "value line-clamp",
|
|
8223
8323
|
get whole_text_to_display_() {
|
|
8224
8324
|
return (0, $52FdA$solidjs.createMemo)(() => input_obj().title);
|
|
8225
8325
|
},
|
|
8226
8326
|
searching_for_value_: searching_for_value_
|
|
8227
8327
|
})] : [(0, $52FdA$solidjsweb.memo)((() => {
|
|
8228
|
-
const _c$2 = (0, $52FdA$solidjsweb.memo)(() => typeof input_obj()
|
|
8328
|
+
const _c$2 = (0, $52FdA$solidjsweb.memo)(() => typeof input_obj() /* this is a harmless lie */.parent_title === "string");
|
|
8229
8329
|
return () => _c$2() ? (() => {
|
|
8230
8330
|
const _el$4 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$4),
|
|
8231
8331
|
_el$6 = _el$4.firstChild,
|
|
8232
8332
|
[_el$7, _co$] = (0, $52FdA$solidjsweb.getNextMarker)(_el$6.nextSibling),
|
|
8233
8333
|
_el$5 = _el$7.nextSibling;
|
|
8234
8334
|
(0, $52FdA$solidjsweb.insert)(_el$4, (0, $52FdA$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
8235
|
-
class_: "category",
|
|
8335
|
+
class_: "category line-clamp",
|
|
8236
8336
|
get whole_text_to_display_() {
|
|
8237
8337
|
return (0, $52FdA$solidjs.createMemo)(() => input_obj().title);
|
|
8238
8338
|
},
|
|
@@ -8240,16 +8340,38 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8240
8340
|
}), _el$7, _co$);
|
|
8241
8341
|
(0, $52FdA$solidjsweb.insert)(_el$5, () => input_obj().parent_title);
|
|
8242
8342
|
return _el$4;
|
|
8243
|
-
})() : (
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8343
|
+
})() : (() => {
|
|
8344
|
+
const _c$3 = (0, $52FdA$solidjsweb.memo)(() => input_obj().type === "content");
|
|
8345
|
+
return () => _c$3() ? (() => {
|
|
8346
|
+
const _el$8 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$5),
|
|
8347
|
+
_el$9 = _el$8.firstChild,
|
|
8348
|
+
[_el$10, _co$2] = (0, $52FdA$solidjsweb.getNextMarker)(_el$9.nextSibling),
|
|
8349
|
+
_el$11 = _el$10.nextSibling,
|
|
8350
|
+
[_el$12, _co$3] = (0, $52FdA$solidjsweb.getNextMarker)(_el$11.nextSibling);
|
|
8351
|
+
(0, $52FdA$solidjsweb.insert)(_el$8, (0, $52FdA$solidjsweb.createComponent)((0, $3cf7b4db1e203c93$export$605674723bcc715c), {
|
|
8352
|
+
width: "16",
|
|
8353
|
+
height: "16"
|
|
8354
|
+
}), _el$10, _co$2);
|
|
8355
|
+
(0, $52FdA$solidjsweb.insert)(_el$8, (0, $52FdA$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
8356
|
+
class_: "content line-clamp",
|
|
8357
|
+
get whole_text_to_display_() {
|
|
8358
|
+
return (0, $52FdA$solidjs.createMemo)(() => input_obj().title);
|
|
8359
|
+
},
|
|
8360
|
+
searching_for_value_: searching_for_value_
|
|
8361
|
+
}), _el$12, _co$3);
|
|
8362
|
+
return _el$8;
|
|
8363
|
+
})() : (0, $52FdA$solidjsweb.createComponent)((0, $23c3f390dee33ff8$export$ba17c5b7e6dda39f), {
|
|
8364
|
+
class_: "category line-clamp",
|
|
8365
|
+
get whole_text_to_display_() {
|
|
8366
|
+
return (0, $52FdA$solidjs.createMemo)(() => input_obj().title);
|
|
8367
|
+
},
|
|
8368
|
+
searching_for_value_: searching_for_value_
|
|
8369
|
+
});
|
|
8370
|
+
})();
|
|
8250
8371
|
})()), (() => {
|
|
8251
8372
|
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$3);
|
|
8252
8373
|
(0, $52FdA$solidjsweb.insert)(_el$3, (0, $52FdA$solidjs.createMemo)(() => {
|
|
8374
|
+
if (input_obj().type === "content") return i18n_.content_();
|
|
8253
8375
|
if (input_obj().category_type === "BRAND") return i18n_.brand_();
|
|
8254
8376
|
return i18n_.category_();
|
|
8255
8377
|
}));
|
|
@@ -8258,10 +8380,7 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8258
8380
|
})());
|
|
8259
8381
|
(0, $52FdA$solidjsweb.effect)(_p$ => {
|
|
8260
8382
|
const _v$ = {
|
|
8261
|
-
selected: (
|
|
8262
|
-
var _read_selected_index_, _read_selected_index_2;
|
|
8263
|
-
return ((_read_selected_index_ = read_selected_index_()) === null || _read_selected_index_ === void 0 ? void 0 : _read_selected_index_[0]) === autocomplete_data_index && ((_read_selected_index_2 = read_selected_index_()) === null || _read_selected_index_2 === void 0 ? void 0 : _read_selected_index_2[1]) === index;
|
|
8264
|
-
})(),
|
|
8383
|
+
selected: is_selected(),
|
|
8265
8384
|
history: is_history,
|
|
8266
8385
|
["type-" + input_obj().type]: true
|
|
8267
8386
|
},
|
|
@@ -8288,8 +8407,8 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8288
8407
|
};
|
|
8289
8408
|
const should_show_previous_searches_in_query_part = (0, $52FdA$solidjs.createMemo)(() => !on_previous_searches_page_());
|
|
8290
8409
|
const should_show_at_all = (0, $52FdA$solidjs.createMemo)(() => {
|
|
8291
|
-
var _suggestion_memo_;
|
|
8292
|
-
return ((_suggestion_memo_ = suggestion_memo_()) === null || _suggestion_memo_ === void 0 ? void 0 : _suggestion_memo_.length) || should_show_previous_searches_in_query_part() && filtered_previous_searches_().length;
|
|
8410
|
+
var _suggestion_memo_, _get_content_results_;
|
|
8411
|
+
return ((_suggestion_memo_ = suggestion_memo_()) === null || _suggestion_memo_ === void 0 ? void 0 : _suggestion_memo_.length) || should_show_previous_searches_in_query_part() && filtered_previous_searches_().length || ((_get_content_results_ = get_content_results_()) === null || _get_content_results_ === void 0 ? void 0 : _get_content_results_.length);
|
|
8293
8412
|
});
|
|
8294
8413
|
const should_show_query_part = (0, $52FdA$solidjs.createMemo)(() => queries_memo().length || filtered_previous_searches_().length);
|
|
8295
8414
|
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
@@ -8297,34 +8416,34 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8297
8416
|
return should_show_at_all();
|
|
8298
8417
|
},
|
|
8299
8418
|
get children() {
|
|
8300
|
-
const _el$
|
|
8301
|
-
_el$
|
|
8302
|
-
[_el$
|
|
8303
|
-
_el$
|
|
8304
|
-
[_el$
|
|
8305
|
-
_el$
|
|
8306
|
-
[_el$
|
|
8307
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8419
|
+
const _el$13 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$9),
|
|
8420
|
+
_el$21 = _el$13.firstChild,
|
|
8421
|
+
[_el$22, _co$6] = (0, $52FdA$solidjsweb.getNextMarker)(_el$21.nextSibling),
|
|
8422
|
+
_el$23 = _el$22.nextSibling,
|
|
8423
|
+
[_el$24, _co$7] = (0, $52FdA$solidjsweb.getNextMarker)(_el$23.nextSibling),
|
|
8424
|
+
_el$25 = _el$24.nextSibling,
|
|
8425
|
+
[_el$26, _co$8] = (0, $52FdA$solidjsweb.getNextMarker)(_el$25.nextSibling);
|
|
8426
|
+
(0, $52FdA$solidjsweb.insert)(_el$13, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
8308
8427
|
get when() {
|
|
8309
8428
|
return on_previous_searches_page_();
|
|
8310
8429
|
},
|
|
8311
8430
|
get children() {
|
|
8312
|
-
const _el$
|
|
8313
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8314
|
-
return _el$
|
|
8431
|
+
const _el$14 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$6);
|
|
8432
|
+
(0, $52FdA$solidjsweb.insert)(_el$14, () => i18n_.suggestions_());
|
|
8433
|
+
return _el$14;
|
|
8315
8434
|
}
|
|
8316
|
-
}), _el$
|
|
8317
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8435
|
+
}), _el$22, _co$6);
|
|
8436
|
+
(0, $52FdA$solidjsweb.insert)(_el$13, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
8318
8437
|
get when() {
|
|
8319
8438
|
return should_show_query_part();
|
|
8320
8439
|
},
|
|
8321
8440
|
get children() {
|
|
8322
|
-
const _el$
|
|
8323
|
-
_el$
|
|
8324
|
-
[_el$
|
|
8325
|
-
_el$
|
|
8326
|
-
[_el$
|
|
8327
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8441
|
+
const _el$15 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$7),
|
|
8442
|
+
_el$16 = _el$15.firstChild,
|
|
8443
|
+
[_el$17, _co$4] = (0, $52FdA$solidjsweb.getNextMarker)(_el$16.nextSibling),
|
|
8444
|
+
_el$18 = _el$17.nextSibling,
|
|
8445
|
+
[_el$19, _co$5] = (0, $52FdA$solidjsweb.getNextMarker)(_el$18.nextSibling);
|
|
8446
|
+
(0, $52FdA$solidjsweb.insert)(_el$15, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
8328
8447
|
get when() {
|
|
8329
8448
|
return should_show_previous_searches_in_query_part();
|
|
8330
8449
|
},
|
|
@@ -8347,8 +8466,8 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8347
8466
|
});
|
|
8348
8467
|
})();
|
|
8349
8468
|
}
|
|
8350
|
-
}), _el$
|
|
8351
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8469
|
+
}), _el$17, _co$4);
|
|
8470
|
+
(0, $52FdA$solidjsweb.insert)(_el$15, () => {
|
|
8352
8471
|
const index_in_autocomplete = 2;
|
|
8353
8472
|
set_list_until_cleanup(queries_memo, index_in_autocomplete);
|
|
8354
8473
|
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Index), {
|
|
@@ -8357,18 +8476,18 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8357
8476
|
},
|
|
8358
8477
|
children: (item, index) => render_entry(item, index_in_autocomplete, index)
|
|
8359
8478
|
});
|
|
8360
|
-
}, _el$
|
|
8361
|
-
return _el$
|
|
8479
|
+
}, _el$19, _co$5);
|
|
8480
|
+
return _el$15;
|
|
8362
8481
|
}
|
|
8363
|
-
}), _el$
|
|
8364
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8482
|
+
}), _el$24, _co$7);
|
|
8483
|
+
(0, $52FdA$solidjsweb.insert)(_el$13, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
8365
8484
|
get when() {
|
|
8366
|
-
return not_queries_memo().length
|
|
8485
|
+
return not_queries_memo().length;
|
|
8367
8486
|
},
|
|
8368
8487
|
keyed: false,
|
|
8369
8488
|
get children() {
|
|
8370
|
-
const _el$
|
|
8371
|
-
(0, $52FdA$solidjsweb.insert)(_el$
|
|
8489
|
+
const _el$20 = (0, $52FdA$solidjsweb.getNextElement)($0677d509ad208e22$var$_tmpl$8);
|
|
8490
|
+
(0, $52FdA$solidjsweb.insert)(_el$20, () => {
|
|
8372
8491
|
const index_in_autocomplete = 3;
|
|
8373
8492
|
set_list_until_cleanup(not_queries_memo, index_in_autocomplete);
|
|
8374
8493
|
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Index), {
|
|
@@ -8378,15 +8497,30 @@ function $0677d509ad208e22$export$e872e2339fb04a7f(_ref) {
|
|
|
8378
8497
|
children: (item, index) => render_entry(item, index_in_autocomplete, index)
|
|
8379
8498
|
});
|
|
8380
8499
|
});
|
|
8381
|
-
return _el$
|
|
8500
|
+
return _el$20;
|
|
8382
8501
|
}
|
|
8383
|
-
}), _el$
|
|
8384
|
-
(0, $52FdA$solidjsweb.effect)(() => _el$
|
|
8385
|
-
return _el$
|
|
8502
|
+
}), _el$26, _co$8);
|
|
8503
|
+
(0, $52FdA$solidjsweb.effect)(() => _el$13.classList.toggle("compact", !!on_previous_searches_page_()));
|
|
8504
|
+
return _el$13;
|
|
8386
8505
|
}
|
|
8387
8506
|
});
|
|
8388
8507
|
}
|
|
8389
|
-
const $
|
|
8508
|
+
const $1730e5b4d47679a3$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a target="_blank"></a>`, 2);
|
|
8509
|
+
function $1730e5b4d47679a3$export$1efe1013da60d0e4(e, href) {
|
|
8510
|
+
if (e.metaKey || e.ctrlKey) {
|
|
8511
|
+
// Open link in a new tab with cmd/ctrl + enter.
|
|
8512
|
+
const link = (() => {
|
|
8513
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($1730e5b4d47679a3$var$_tmpl$);
|
|
8514
|
+
(0, $52FdA$solidjsweb.setAttribute)(_el$, "href", href);
|
|
8515
|
+
return _el$;
|
|
8516
|
+
})();
|
|
8517
|
+
document.body.append(link);
|
|
8518
|
+
link.click();
|
|
8519
|
+
link.remove();
|
|
8520
|
+
return true;
|
|
8521
|
+
}
|
|
8522
|
+
return false;
|
|
8523
|
+
}
|
|
8390
8524
|
function $1a7b2e0cdf65293a$export$217899a935ef803b(_ref) {
|
|
8391
8525
|
let {
|
|
8392
8526
|
selected_index_: [read_selected_index, write_selected_index],
|
|
@@ -8464,6 +8598,7 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
8464
8598
|
const sfv = get_search_field_value();
|
|
8465
8599
|
if (!(0, $52FdA$solidjs.untrack)(() => read_updating_blocked())) previous_value = sfv;
|
|
8466
8600
|
});
|
|
8601
|
+
const owner = (0, $52FdA$solidjs.getOwner)();
|
|
8467
8602
|
const handler = (0, $52FdA$depictaiutilishared.catchify)(_ref3 => {
|
|
8468
8603
|
let {
|
|
8469
8604
|
keyCode: keyCode
|
|
@@ -8496,29 +8631,29 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
8496
8631
|
const {
|
|
8497
8632
|
title: title
|
|
8498
8633
|
} = selected_entry;
|
|
8499
|
-
|
|
8634
|
+
(0, $52FdA$solidjs.runWithOwner)(owner, block_updating_for_one_change);
|
|
8500
8635
|
set_search_field_value(title);
|
|
8501
|
-
override_on_enter_for_this_entry(e => {
|
|
8636
|
+
(0, $52FdA$solidjs.runWithOwner)(owner, () => override_on_enter_for_this_entry(e => {
|
|
8502
8637
|
// Open search query in new tab on cmd+enter
|
|
8503
8638
|
// If it's not cmd+enter, pressing enter will just submit the value that was put into the field while selecting with the arrow keys ;)
|
|
8504
8639
|
const url = new URL(location);
|
|
8505
8640
|
url_transformer_ === null || url_transformer_ === void 0 || url_transformer_(url);
|
|
8506
8641
|
url.searchParams.set(search_query_param_name_, title);
|
|
8507
|
-
return $
|
|
8508
|
-
});
|
|
8509
|
-
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "category") override_on_enter_for_this_entry(e => {
|
|
8642
|
+
return (0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, url.href);
|
|
8643
|
+
}));
|
|
8644
|
+
} else if ((selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) == "category" || (selected_entry === null || selected_entry === void 0 ? void 0 : selected_entry.type) === "content") (0, $52FdA$solidjs.runWithOwner)(owner, () => override_on_enter_for_this_entry(e => {
|
|
8510
8645
|
const {
|
|
8511
8646
|
page_url: page_url
|
|
8512
8647
|
} = selected_entry;
|
|
8513
|
-
if (
|
|
8648
|
+
if (!(0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, page_url))
|
|
8514
8649
|
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
8515
8650
|
router_.navigate_.go_to_({
|
|
8516
8651
|
new_url_: page_url,
|
|
8517
8652
|
is_replace_: false
|
|
8518
8653
|
});
|
|
8519
8654
|
return true;
|
|
8520
|
-
});else if (!selected_entry) {
|
|
8521
|
-
|
|
8655
|
+
}));else if (!selected_entry) {
|
|
8656
|
+
(0, $52FdA$solidjs.runWithOwner)(owner, block_updating_for_one_change);
|
|
8522
8657
|
set_search_field_value(previous_value);
|
|
8523
8658
|
}
|
|
8524
8659
|
});
|
|
@@ -8530,20 +8665,39 @@ function $1a7b2e0cdf65293a$var$actual_navigation_working_on_fake_data(_ref2) {
|
|
|
8530
8665
|
(0, $52FdA$solidjs.onCleanup)((0, $52FdA$depictaiutilishared.catchify)(() => el.removeEventListener("keyup", handler)));
|
|
8531
8666
|
});
|
|
8532
8667
|
}
|
|
8533
|
-
function $
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8668
|
+
function $4d9996ee79548b4b$export$af0124069c150252(_ref) {
|
|
8669
|
+
let {
|
|
8670
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
8671
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
8672
|
+
read_suggestion_signal_: read_suggestion_signal_,
|
|
8673
|
+
router_: router_,
|
|
8674
|
+
content_results_: content_results_
|
|
8675
|
+
} = _ref;
|
|
8676
|
+
const [get_autocomplete_wants_override_function, set_autocomplete_wants_override_function] = (0, $52FdA$solidjs.createSignal)(() => false);
|
|
8677
|
+
(0, $52FdA$solidjs.createComputed)(() => {
|
|
8678
|
+
var _get_modal_search_res, _search_results$displ;
|
|
8679
|
+
const suggestions = read_suggestion_signal_();
|
|
8680
|
+
const search_results = (_get_modal_search_res = get_modal_search_results_()) === null || _get_modal_search_res === void 0 ? void 0 : _get_modal_search_res();
|
|
8681
|
+
const content_results = content_results_();
|
|
8682
|
+
// If we only have one content result and nothing else, go there when pressing enter
|
|
8683
|
+
if (!suggestions.length && !(search_results !== null && search_results !== void 0 && (_search_results$displ = search_results.displays) !== null && _search_results$displ !== void 0 && _search_results$displ.length) && (content_results === null || content_results === void 0 ? void 0 : content_results.length) === 1) {
|
|
8684
|
+
const [{
|
|
8685
|
+
page_url: page_url
|
|
8686
|
+
}] = content_results;
|
|
8687
|
+
set_override_on_enter_fn_(e => {
|
|
8688
|
+
if (!(0, $1730e5b4d47679a3$export$1efe1013da60d0e4)(e, page_url))
|
|
8689
|
+
// Above fn will return true if it opened a new tab, and we won't make these checks anymore
|
|
8690
|
+
router_.navigate_.go_to_({
|
|
8691
|
+
new_url_: page_url,
|
|
8692
|
+
is_replace_: false
|
|
8693
|
+
});
|
|
8694
|
+
return true;
|
|
8695
|
+
});
|
|
8696
|
+
return;
|
|
8697
|
+
}
|
|
8698
|
+
set_override_on_enter_fn_(get_autocomplete_wants_override_function());
|
|
8699
|
+
});
|
|
8700
|
+
return new_fn => set_autocomplete_wants_override_function(() => new_fn);
|
|
8547
8701
|
}
|
|
8548
8702
|
const $ce079d50d380ee11$export$3cf9497e790da491 = "query";
|
|
8549
8703
|
function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
@@ -8564,12 +8718,15 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
8564
8718
|
i18n_: i18n_,
|
|
8565
8719
|
include_category_suggestions_: include_category_suggestions_,
|
|
8566
8720
|
submit_query_: submit_query_,
|
|
8567
|
-
router_: router_
|
|
8721
|
+
router_: router_,
|
|
8722
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
8723
|
+
content_search_enabled_: content_search_enabled_
|
|
8568
8724
|
} = _ref;
|
|
8569
8725
|
const [searching_for_value, set_searching_for_value] = (0, $52FdA$solidjs.createSignal)();
|
|
8726
|
+
const [show_stale_content_results, set_show_stale_content_results] = (0, $52FdA$solidjs.createSignal)(false);
|
|
8570
8727
|
const [read_search_field_value] = search_field_value_;
|
|
8571
8728
|
const updating_blocked = (0, $52FdA$solidjs.createSignal)(false);
|
|
8572
|
-
const [
|
|
8729
|
+
const [read_suggestion_signal_, write_suggestion_signal] = (0, $52FdA$solidjs.createSignal)([]);
|
|
8573
8730
|
const filtered_previous_searches = (0, $52FdA$solidjs.createMemo)(() => [...unfiltered_previous_searches[0]()].reverse().filter(q => q !== get_search_query_()));
|
|
8574
8731
|
const deparallelized_fn = (0, $52FdA$depictaiutilishared.deparallelize_no_drop)(async request_obj => {
|
|
8575
8732
|
var _api_response$suggest;
|
|
@@ -8593,15 +8750,39 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
8593
8750
|
});
|
|
8594
8751
|
|
|
8595
8752
|
const show_previous_searches_component = (0, $52FdA$solidjs.createMemo)(() => !read_search_field_value() || (0, $52FdA$solidjs.untrack)(updating_blocked[0]) && !(0, $52FdA$solidjs.untrack)(searching_for_value));
|
|
8753
|
+
const get_content_results_ = (0, $52FdA$solidjs.createMemo)(prev => {
|
|
8754
|
+
var _get_modal_search_res, _get_modal_search_res2, _get_modal_search_res3;
|
|
8755
|
+
if (!content_search_enabled_()) return [];
|
|
8756
|
+
if (show_stale_content_results())
|
|
8757
|
+
// don't update content results when query suggestions don't update because otherwise they disappear when trying to keyboard navigate to them
|
|
8758
|
+
return prev;
|
|
8759
|
+
return (_get_modal_search_res = get_modal_search_results_()) === null || _get_modal_search_res === void 0 ? void 0 : (_get_modal_search_res2 = _get_modal_search_res()) === null || _get_modal_search_res2 === void 0 ? void 0 : (_get_modal_search_res3 = _get_modal_search_res2.content_search_links) === null || _get_modal_search_res3 === void 0 ? void 0 : _get_modal_search_res3.map(link => ({
|
|
8760
|
+
page_url: link.page_url,
|
|
8761
|
+
type: "content",
|
|
8762
|
+
title: link.title
|
|
8763
|
+
}));
|
|
8764
|
+
});
|
|
8765
|
+
// Ideally we'd propagate up the suggestion signal too and call this from SearchModal.tsx? Because it's not super related with autocomplete, but it's not a huge feature, and it's easier here so keeping it.
|
|
8766
|
+
// It's the functionality to open the content results page when you press enter, in the modal, when there's only one content result
|
|
8767
|
+
const manipulated_set_override_on_enter_fn_ = (0, $4d9996ee79548b4b$export$af0124069c150252)({
|
|
8768
|
+
set_override_on_enter_fn_: set_override_on_enter_fn_,
|
|
8769
|
+
get_modal_search_results_: get_modal_search_results_,
|
|
8770
|
+
read_suggestion_signal_: read_suggestion_signal_,
|
|
8771
|
+
router_: router_,
|
|
8772
|
+
content_results_: get_content_results_
|
|
8773
|
+
});
|
|
8596
8774
|
(0, $52FdA$solidjs.createComputed)(() => {
|
|
8597
8775
|
const field_value = read_search_field_value();
|
|
8598
|
-
if (
|
|
8776
|
+
if ((0, $52FdA$solidjs.untrack)(updating_blocked[0]))
|
|
8777
|
+
// not using updating_blocked instead of below signal since I presume they'd start updating too early then
|
|
8778
|
+
set_show_stale_content_results(true);else {
|
|
8599
8779
|
set_searching_for_value(field_value);
|
|
8600
8780
|
deparallelized_fn({
|
|
8601
8781
|
query: field_value,
|
|
8602
8782
|
tenant: tenant_(),
|
|
8603
8783
|
market: market_()
|
|
8604
8784
|
});
|
|
8785
|
+
set_show_stale_content_results(false);
|
|
8605
8786
|
}
|
|
8606
8787
|
});
|
|
8607
8788
|
(0, $52FdA$solidjs.createComputed)((0, $52FdA$solidjs.on)(search_field_value_[0], () => !updating_blocked[0]() && selected_index_[1](undefined), {
|
|
@@ -8613,7 +8794,7 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
8613
8794
|
search_field_value_: search_field_value_,
|
|
8614
8795
|
updating_blocked_: updating_blocked,
|
|
8615
8796
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
8616
|
-
set_override_on_enter_fn_:
|
|
8797
|
+
set_override_on_enter_fn_: manipulated_set_override_on_enter_fn_,
|
|
8617
8798
|
search_query_param_name_: search_query_url_param_name_,
|
|
8618
8799
|
url_transformer_: url_transformer_,
|
|
8619
8800
|
router_: router_
|
|
@@ -8653,11 +8834,12 @@ function $ce079d50d380ee11$export$2f2b9559550c7bbc(_ref) {
|
|
|
8653
8834
|
},
|
|
8654
8835
|
on_previous_searches_page_: show_previous_searches_component,
|
|
8655
8836
|
i18n_: i18n_,
|
|
8837
|
+
get_content_results_: get_content_results_,
|
|
8656
8838
|
url_transformer_: url_transformer_,
|
|
8657
8839
|
searching_for_value_: searching_for_value,
|
|
8658
8840
|
search_query_url_param_name_: search_query_url_param_name_,
|
|
8659
8841
|
selected_index_: selected_index_,
|
|
8660
|
-
suggestion_memo_:
|
|
8842
|
+
suggestion_memo_: read_suggestion_signal_,
|
|
8661
8843
|
currently_showing_suggestions_: currently_showing_suggestions_,
|
|
8662
8844
|
include_category_suggestions_: include_category_suggestions_,
|
|
8663
8845
|
router_: router_,
|
|
@@ -8769,7 +8951,8 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
8769
8951
|
bottom_distance_under_modal_: bottom_distance_under_modal_,
|
|
8770
8952
|
selected_text_range_: selected_text_range_,
|
|
8771
8953
|
dont_sync_search_field_value_except_on_submit_ = false,
|
|
8772
|
-
router_: router_
|
|
8954
|
+
router_: router_,
|
|
8955
|
+
content_search_enabled_: content_search_enabled_
|
|
8773
8956
|
} = _ref;
|
|
8774
8957
|
let on_enter_in_search_field_function;
|
|
8775
8958
|
// As per feedback from stronger we sometimes want a modal with the search field value disconnected from the one in the rest of the UI, see https://depictaiworkspace.slack.com/archives/C02J16R9XEH/p1679065878487709.
|
|
@@ -8786,48 +8969,38 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
8786
8969
|
};
|
|
8787
8970
|
const [input_field, set_input_field] = (0, $52FdA$solidjs.createSignal)();
|
|
8788
8971
|
const [get_search_field_value_] = search_field_value_;
|
|
8789
|
-
const [
|
|
8790
|
-
const [elements_inside_scrollable, set_elements_inside_scrollable] = (0, $52FdA$solidjs.createSignal)();
|
|
8972
|
+
const [get_modal_search_results, set_modal_search_results_] = (0, $52FdA$solidjs.createSignal)();
|
|
8791
8973
|
const close_on_escape_handler = (0, $52FdA$depictaiutilishared.catchify)(_ref2 => {
|
|
8792
8974
|
let {
|
|
8793
8975
|
key: key
|
|
8794
8976
|
} = _ref2;
|
|
8795
8977
|
if (key === "Escape") close_modal_();
|
|
8796
8978
|
});
|
|
8797
|
-
const [
|
|
8979
|
+
const [get_total_num_results_accessor, set_total_num_results_accessor_] = (0, $52FdA$solidjs.createSignal)();
|
|
8798
8980
|
const selected_index = (0, $52FdA$solidjs.createSignal)();
|
|
8799
8981
|
const currently_showing_suggestions_ = (0, $52FdA$solidjs.createSignal)([], {
|
|
8800
8982
|
equals: false
|
|
8801
8983
|
});
|
|
8984
|
+
const less_than_700_high = (0, $3e17e871e9d0911d$export$d9f36cf74e24d595)("(max-height:700px)");
|
|
8985
|
+
const DiscoverMoreSection = () => (() => {
|
|
8986
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($24419668d5fcfcd5$var$_tmpl$),
|
|
8987
|
+
_el$2 = _el$.firstChild;
|
|
8988
|
+
(0, $52FdA$solidjsweb.addEventListener)(_el$2, "click", (0, $52FdA$depictaiutilishared.catchify)(() => submit_query_()), true);
|
|
8989
|
+
(0, $52FdA$solidjsweb.insert)(_el$2, (() => {
|
|
8990
|
+
const _c$ = (0, $52FdA$solidjsweb.memo)(() => !!get_search_field_value_());
|
|
8991
|
+
return () => _c$() ? i18n_.modal_view_all_results_()((() => {
|
|
8992
|
+
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($24419668d5fcfcd5$var$_tmpl$2);
|
|
8993
|
+
(0, $52FdA$solidjsweb.insert)(_el$3, () => get_total_num_results_accessor === null || get_total_num_results_accessor === void 0 ? void 0 : get_total_num_results_accessor());
|
|
8994
|
+
return _el$3;
|
|
8995
|
+
})()) : i18n_.modal_discover_more_();
|
|
8996
|
+
})());
|
|
8997
|
+
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
8998
|
+
return _el$;
|
|
8999
|
+
})();
|
|
8802
9000
|
if (disable_scrolling_) (0, $8c2e68c6d458169b$export$fe334901e8bebd57)();
|
|
8803
9001
|
$24419668d5fcfcd5$var$close_modal_when_navigating_away(close_modal_, search_query_url_param_name_);
|
|
8804
9002
|
window.addEventListener("keydown", close_on_escape_handler);
|
|
8805
9003
|
(0, $52FdA$solidjs.onCleanup)((0, $52FdA$depictaiutilishared.catchify)(() => window.removeEventListener("keydown", close_on_escape_handler)));
|
|
8806
|
-
const owner = (0, $52FdA$solidjs.getOwner)();
|
|
8807
|
-
(0, $52FdA$solidjs.onCleanup)((0, $52FdA$depictaiutilishared.javascript_media_query)("(max-height:700px)", _ref3 => {
|
|
8808
|
-
let {
|
|
8809
|
-
matches: matches
|
|
8810
|
-
} = _ref3;
|
|
8811
|
-
return (0, $52FdA$solidjs.runWithOwner)(owner, () => {
|
|
8812
|
-
// the if below is reactive so we need an owner
|
|
8813
|
-
(matches ? set_elements_outside_scrollable : set_elements_inside_scrollable)("");
|
|
8814
|
-
(matches ? set_elements_inside_scrollable : set_elements_outside_scrollable)((() => {
|
|
8815
|
-
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($24419668d5fcfcd5$var$_tmpl$),
|
|
8816
|
-
_el$2 = _el$.firstChild;
|
|
8817
|
-
(0, $52FdA$solidjsweb.addEventListener)(_el$2, "click", (0, $52FdA$depictaiutilishared.catchify)(() => submit_query_()), true);
|
|
8818
|
-
(0, $52FdA$solidjsweb.insert)(_el$2, (() => {
|
|
8819
|
-
const _c$ = (0, $52FdA$solidjsweb.memo)(() => !!get_search_field_value_());
|
|
8820
|
-
return () => _c$() ? i18n_.modal_view_all_results_()((() => {
|
|
8821
|
-
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($24419668d5fcfcd5$var$_tmpl$2);
|
|
8822
|
-
(0, $52FdA$solidjsweb.insert)(_el$3, () => get_num_results_accessor === null || get_num_results_accessor === void 0 ? void 0 : get_num_results_accessor());
|
|
8823
|
-
return _el$3;
|
|
8824
|
-
})()) : i18n_.modal_discover_more_();
|
|
8825
|
-
})());
|
|
8826
|
-
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
8827
|
-
return _el$;
|
|
8828
|
-
})());
|
|
8829
|
-
});
|
|
8830
|
-
}).remove);
|
|
8831
9004
|
if (closing_animation_) register_closing_animation_(closing_animation_);
|
|
8832
9005
|
(0, $4e44eb7e21ff022a$export$3340fdd8259bd4fd)({
|
|
8833
9006
|
get_search_field_value_: get_search_field_value_,
|
|
@@ -8882,10 +9055,10 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
8882
9055
|
[_el$16, _co$5] = (0, $52FdA$solidjsweb.getNextMarker)(_el$15.nextSibling),
|
|
8883
9056
|
_el$17 = _el$5.nextSibling,
|
|
8884
9057
|
[_el$18, _co$6] = (0, $52FdA$solidjsweb.getNextMarker)(_el$17.nextSibling);
|
|
8885
|
-
(0, $52FdA$solidjsweb.addEventListener)(_el$4, "click", (0, $52FdA$depictaiutilishared.catchify)(
|
|
9058
|
+
(0, $52FdA$solidjsweb.addEventListener)(_el$4, "click", (0, $52FdA$depictaiutilishared.catchify)(_ref3 => {
|
|
8886
9059
|
let {
|
|
8887
9060
|
target: target
|
|
8888
|
-
} =
|
|
9061
|
+
} = _ref3;
|
|
8889
9062
|
if (target === modal_element) close_modal_();
|
|
8890
9063
|
}), true);
|
|
8891
9064
|
(0, $52FdA$solidjsweb.insert)(_el$5, search_field, _el$14, _co$4);
|
|
@@ -8913,7 +9086,9 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
8913
9086
|
i18n_: i18n_,
|
|
8914
9087
|
include_category_suggestions_: enable_category_suggestions_ !== null && enable_category_suggestions_ !== void 0 ? enable_category_suggestions_ : true,
|
|
8915
9088
|
router_: router_,
|
|
8916
|
-
submit_query_: submit_query_
|
|
9089
|
+
submit_query_: submit_query_,
|
|
9090
|
+
get_modal_search_results_: get_modal_search_results,
|
|
9091
|
+
content_search_enabled_: content_search_enabled_
|
|
8917
9092
|
});
|
|
8918
9093
|
}
|
|
8919
9094
|
}), _el$8, _co$);
|
|
@@ -8927,14 +9102,30 @@ function $24419668d5fcfcd5$export$1c593cbd6f1e10bc(_ref) {
|
|
|
8927
9102
|
tenant_: tenant_,
|
|
8928
9103
|
i18n_: i18n_,
|
|
8929
9104
|
market_: market_,
|
|
8930
|
-
|
|
9105
|
+
set_total_num_results_accessor_: set_total_num_results_accessor_,
|
|
8931
9106
|
router_: router_,
|
|
9107
|
+
set_modal_search_results_: set_modal_search_results_,
|
|
9108
|
+
content_search_enabled_: content_search_enabled_,
|
|
8932
9109
|
...instant_results_options_
|
|
8933
9110
|
});
|
|
8934
9111
|
}
|
|
8935
9112
|
}), _el$10, _co$2);
|
|
8936
|
-
(0, $52FdA$solidjsweb.insert)(_el$6,
|
|
8937
|
-
|
|
9113
|
+
(0, $52FdA$solidjsweb.insert)(_el$6, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9114
|
+
get when() {
|
|
9115
|
+
return less_than_700_high();
|
|
9116
|
+
},
|
|
9117
|
+
get children() {
|
|
9118
|
+
return (0, $52FdA$solidjsweb.createComponent)(DiscoverMoreSection, {});
|
|
9119
|
+
}
|
|
9120
|
+
}), _el$12, _co$3);
|
|
9121
|
+
(0, $52FdA$solidjsweb.insert)(_el$5, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9122
|
+
get when() {
|
|
9123
|
+
return !less_than_700_high();
|
|
9124
|
+
},
|
|
9125
|
+
get children() {
|
|
9126
|
+
return (0, $52FdA$solidjsweb.createComponent)(DiscoverMoreSection, {});
|
|
9127
|
+
}
|
|
9128
|
+
}), _el$16, _co$5);
|
|
8938
9129
|
(0, $52FdA$solidjsweb.insert)(_el$4, (0, $52FdA$solidjsweb.createComponent)((0, $cc66bbf6e783bb58$export$f021bdedd3ec901a), {
|
|
8939
9130
|
styles: body_style
|
|
8940
9131
|
}), _el$18, _co$6);
|
|
@@ -9045,11 +9236,13 @@ function $9870a8a48ee126af$export$9dd50d35b9d94fdf(_ref) {
|
|
|
9045
9236
|
let {
|
|
9046
9237
|
get_search_query_: get_search_query_,
|
|
9047
9238
|
i18n_: i18n_,
|
|
9048
|
-
formatted_number_of_results_: formatted_number_of_results_
|
|
9239
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
9240
|
+
number_of_results_: number_of_results_,
|
|
9241
|
+
type: type
|
|
9049
9242
|
} = _ref;
|
|
9050
9243
|
const contents = (0, $52FdA$solidjs.createMemo)((0, $52FdA$depictaiutilishared.catchify)(() => {
|
|
9051
9244
|
const q = get_search_query_();
|
|
9052
|
-
return i18n_.get_showing_results_for_()((() => {
|
|
9245
|
+
return i18n_[type === $9870a8a48ee126af$export$2452208c79fe93ea.content ? "get_showing_pages_for_" : "get_showing_results_for_"]()((() => {
|
|
9053
9246
|
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($9870a8a48ee126af$var$_tmpl$);
|
|
9054
9247
|
(0, $52FdA$solidjsweb.insert)(_el$, q);
|
|
9055
9248
|
return _el$;
|
|
@@ -9057,7 +9250,7 @@ function $9870a8a48ee126af$export$9dd50d35b9d94fdf(_ref) {
|
|
|
9057
9250
|
const _el$2 = (0, $52FdA$solidjsweb.getNextElement)($9870a8a48ee126af$var$_tmpl$);
|
|
9058
9251
|
(0, $52FdA$solidjsweb.insert)(_el$2, formatted_number_of_results_);
|
|
9059
9252
|
return _el$2;
|
|
9060
|
-
})());
|
|
9253
|
+
})(), !!q, number_of_results_());
|
|
9061
9254
|
}));
|
|
9062
9255
|
return (() => {
|
|
9063
9256
|
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($9870a8a48ee126af$var$_tmpl$2);
|
|
@@ -9065,6 +9258,11 @@ function $9870a8a48ee126af$export$9dd50d35b9d94fdf(_ref) {
|
|
|
9065
9258
|
return _el$3;
|
|
9066
9259
|
})();
|
|
9067
9260
|
}
|
|
9261
|
+
let $9870a8a48ee126af$export$2452208c79fe93ea;
|
|
9262
|
+
(function (ShowingResultsForType) {
|
|
9263
|
+
ShowingResultsForType[ShowingResultsForType["products"] = 0] = "products";
|
|
9264
|
+
ShowingResultsForType[ShowingResultsForType["content"] = 1] = "content";
|
|
9265
|
+
})($9870a8a48ee126af$export$2452208c79fe93ea || ($9870a8a48ee126af$export$2452208c79fe93ea = {}));
|
|
9068
9266
|
function $996102a9349df6d7$export$41b4894022a3580f() {
|
|
9069
9267
|
let {
|
|
9070
9268
|
style_props_ = (0, $52FdA$solidjs.createSignal)({})
|
|
@@ -9084,8 +9282,521 @@ function $996102a9349df6d7$export$41b4894022a3580f() {
|
|
|
9084
9282
|
})));
|
|
9085
9283
|
return style_props_;
|
|
9086
9284
|
}
|
|
9285
|
+
const $99472afa7112c427$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<span class="highlighted-part"></span>`, 2);
|
|
9286
|
+
const $99472afa7112c427$var$dont_cut_in_between_less_than_characters = 30;
|
|
9287
|
+
function $99472afa7112c427$export$e1a98a189fd2c0e7(_ref) {
|
|
9288
|
+
let {
|
|
9289
|
+
content_result_: content_result_,
|
|
9290
|
+
key_: key_,
|
|
9291
|
+
cut_when_possible_: cut_when_possible_
|
|
9292
|
+
} = _ref;
|
|
9293
|
+
const matched_tokens = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9294
|
+
var _content_result_$high, _content_result_$high2;
|
|
9295
|
+
return (_content_result_$high = content_result_().highlights) === null || _content_result_$high === void 0 ? void 0 : (_content_result_$high2 = _content_result_$high.find(highlight => highlight.field == key_)) === null || _content_result_$high2 === void 0 ? void 0 : _content_result_$high2.matched_tokens;
|
|
9296
|
+
});
|
|
9297
|
+
const full_value = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9298
|
+
var _content_result_$key_;
|
|
9299
|
+
return (_content_result_$key_ = content_result_()[key_]) === null || _content_result_$key_ === void 0 ? void 0 : _content_result_$key_.replaceAll("\n", " ");
|
|
9300
|
+
});
|
|
9301
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9302
|
+
get when() {
|
|
9303
|
+
var _matched_tokens;
|
|
9304
|
+
return (_matched_tokens = matched_tokens()) === null || _matched_tokens === void 0 ? void 0 : _matched_tokens.length;
|
|
9305
|
+
},
|
|
9306
|
+
get fallback() {
|
|
9307
|
+
return full_value();
|
|
9308
|
+
},
|
|
9309
|
+
get children() {
|
|
9310
|
+
return (() => {
|
|
9311
|
+
const segmented_cut_text = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9312
|
+
const segmented_text = $99472afa7112c427$var$segment_text(full_value(), matched_tokens());
|
|
9313
|
+
if (cut_when_possible_) $99472afa7112c427$var$cut_text(segmented_text);
|
|
9314
|
+
return segmented_text;
|
|
9315
|
+
});
|
|
9316
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Index), {
|
|
9317
|
+
get each() {
|
|
9318
|
+
return segmented_cut_text();
|
|
9319
|
+
},
|
|
9320
|
+
children: item => {
|
|
9321
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9322
|
+
get when() {
|
|
9323
|
+
return item().highlighted_;
|
|
9324
|
+
},
|
|
9325
|
+
get fallback() {
|
|
9326
|
+
return item().text_;
|
|
9327
|
+
},
|
|
9328
|
+
get children() {
|
|
9329
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($99472afa7112c427$var$_tmpl$);
|
|
9330
|
+
(0, $52FdA$solidjsweb.insert)(_el$, () => item().text_);
|
|
9331
|
+
return _el$;
|
|
9332
|
+
}
|
|
9333
|
+
});
|
|
9334
|
+
}
|
|
9335
|
+
});
|
|
9336
|
+
})();
|
|
9337
|
+
}
|
|
9338
|
+
});
|
|
9339
|
+
}
|
|
9340
|
+
function $99472afa7112c427$var$cut_text(segmented_text) {
|
|
9341
|
+
// cut away chunks of text that are not highlighted to give a google-like overview of the content
|
|
9342
|
+
const highlighted_segments = segmented_text === null || segmented_text === void 0 ? void 0 : segmented_text.filter(segment => segment.highlighted_);
|
|
9343
|
+
if (!segmented_text || !(highlighted_segments !== null && highlighted_segments !== void 0 && highlighted_segments.length)) return;
|
|
9344
|
+
// We have one or more highlighted segments
|
|
9345
|
+
if (highlighted_segments.length === 1) {
|
|
9346
|
+
// cut away from the left until the start of the highlighted sentence if just one sentence is highlighted
|
|
9347
|
+
$99472afa7112c427$var$cut_start(segmented_text.indexOf(highlighted_segments[0]), segmented_text);
|
|
9348
|
+
return;
|
|
9349
|
+
}
|
|
9350
|
+
// We have two or more highlighted segments, take the two biggest chunks and show them + a bit text around
|
|
9351
|
+
const sorted_highlighted_segments = [...highlighted_segments].sort((a, b) => b.text_.trim().length - a.text_.trim().length // trim to avoid unfair comparisons due to whitespace
|
|
9352
|
+
);
|
|
9353
|
+
|
|
9354
|
+
const [longest_segment, next_longest_segment] = sorted_highlighted_segments;
|
|
9355
|
+
// We need to cut before the first segment - possibly through other segments - and maybe between segments
|
|
9356
|
+
let [index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
|
|
9357
|
+
$99472afa7112c427$var$cut_start(index_of_first_segment, segmented_text);
|
|
9358
|
+
// update indexes since we might have removed segments
|
|
9359
|
+
[index_of_first_segment, index_of_second_segment] = [segmented_text.indexOf(longest_segment), segmented_text.indexOf(next_longest_segment)].sort((a, b) => a - b);
|
|
9360
|
+
let number_of_characters_between_segments = 0;
|
|
9361
|
+
for (let i = index_of_first_segment + 1; i < index_of_second_segment; i++) {
|
|
9362
|
+
const segment = segmented_text[i];
|
|
9363
|
+
number_of_characters_between_segments += segment.text_.length;
|
|
9364
|
+
}
|
|
9365
|
+
if (number_of_characters_between_segments < $99472afa7112c427$var$dont_cut_in_between_less_than_characters)
|
|
9366
|
+
// don't cut if there are less than 30 characters between the two segments
|
|
9367
|
+
return;
|
|
9368
|
+
// We have more than 50 characters between the two segments, cut between them
|
|
9369
|
+
const [split_start_segment, split_start_character] = $99472afa7112c427$var$find_split_point(index_of_first_segment, index_of_second_segment, segmented_text);
|
|
9370
|
+
const [split_end_segment, split_end_character] = $99472afa7112c427$var$find_split_point(index_of_second_segment, index_of_first_segment, segmented_text);
|
|
9371
|
+
if (split_start_segment === undefined || split_end_segment === undefined ||
|
|
9372
|
+
// identical split point, or split end before split start, can't do anything
|
|
9373
|
+
split_start_segment == split_end_segment && split_start_character >= split_end_character || split_start_segment > split_end_segment) return;
|
|
9374
|
+
const dots_segment = {
|
|
9375
|
+
text_: " … ",
|
|
9376
|
+
highlighted_: false
|
|
9377
|
+
};
|
|
9378
|
+
const split_and_dotted_values = segmented_text.flatMap((segment, i) => {
|
|
9379
|
+
if (i < split_start_segment || i > split_end_segment) return segment;
|
|
9380
|
+
const text = segment.text_;
|
|
9381
|
+
if (i == split_end_segment && i == split_start_segment) return [{
|
|
9382
|
+
...segment,
|
|
9383
|
+
text_: text.slice(0, split_start_character).trimEnd()
|
|
9384
|
+
}, dots_segment, {
|
|
9385
|
+
...segment,
|
|
9386
|
+
text_: text.slice(split_end_character + 1, text.length).trimStart()
|
|
9387
|
+
}];else if (i == split_start_segment) {
|
|
9388
|
+
segment.text_ = text.slice(0, split_start_character).trimEnd(); // this would be split_start_character + 1, but we want to remove the last "dot" because . ... looks weird
|
|
9389
|
+
return segment;
|
|
9390
|
+
} else if (i == split_end_segment) return [dots_segment, {
|
|
9391
|
+
...segment,
|
|
9392
|
+
text_: text.slice(split_end_character + 1, text.length).trimStart()
|
|
9393
|
+
}];
|
|
9394
|
+
return []; // remove all segments inbetween
|
|
9395
|
+
});
|
|
9396
|
+
|
|
9397
|
+
segmented_text.splice(0, segmented_text.length, ...split_and_dotted_values); // Sorry…
|
|
9398
|
+
$99472afa7112c427$var$heal_holes(segmented_text);
|
|
9399
|
+
}
|
|
9400
|
+
function $99472afa7112c427$var$heal_holes(segmented_text) {
|
|
9401
|
+
// try to heal "holes" created in the segments so there are only alternating segments
|
|
9402
|
+
const segments_to_delete = new Set();
|
|
9403
|
+
for (let i = 0; i < segmented_text.length; i++) {
|
|
9404
|
+
var _previous_segment, _previous_segment2;
|
|
9405
|
+
const segment = segmented_text[i];
|
|
9406
|
+
let previous_segment;
|
|
9407
|
+
for (let j = i - 1; j >= 0; j--) {
|
|
9408
|
+
previous_segment = segmented_text[j];
|
|
9409
|
+
// Don't write to a segment that's marked for deletion or the contents we write to it will be deleted
|
|
9410
|
+
if (!segments_to_delete.has(previous_segment)) break;
|
|
9411
|
+
}
|
|
9412
|
+
if ((_previous_segment = previous_segment) !== null && _previous_segment !== void 0 && _previous_segment.highlighted_ && segment.highlighted_ || ((_previous_segment2 = previous_segment) === null || _previous_segment2 === void 0 ? void 0 : _previous_segment2.highlighted_) === false && segment.highlighted_ === false) {
|
|
9413
|
+
previous_segment.text_ += segment.text_; // IDK if this ever happens
|
|
9414
|
+
segments_to_delete.add(segment);
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
for (const segment of segments_to_delete) {
|
|
9418
|
+
const index = segmented_text.indexOf(segment);
|
|
9419
|
+
segmented_text.splice(index, 1);
|
|
9420
|
+
}
|
|
9421
|
+
}
|
|
9422
|
+
function $99472afa7112c427$var$find_split_point(index_of_start_segment, index_of_end_segment, segmented_text) {
|
|
9423
|
+
let be_very_aggressive = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
9424
|
+
const should_loop_backwards = index_of_start_segment > index_of_end_segment;
|
|
9425
|
+
const step = should_loop_backwards ? -1 : 1;
|
|
9426
|
+
const desperate_split_attempts = [":", ";", ","];
|
|
9427
|
+
while (desperate_split_attempts.length) {
|
|
9428
|
+
const split_point_between_words = [];
|
|
9429
|
+
// for the middle also try to split with a few more characters if the default ones don't work over a full run
|
|
9430
|
+
const desperate_split_attempt = desperate_split_attempts.pop();
|
|
9431
|
+
let is_first_character = true;
|
|
9432
|
+
for (let i = index_of_start_segment + step; should_loop_backwards ? i > index_of_end_segment : i < index_of_end_segment; i += step) {
|
|
9433
|
+
const segment = segmented_text[i];
|
|
9434
|
+
const text = segment.text_;
|
|
9435
|
+
for (let j = should_loop_backwards ? text.length - 1 : 0; should_loop_backwards ? j >= 0 : j < text.length; j += step) {
|
|
9436
|
+
const character = text[j];
|
|
9437
|
+
if (character == "." || character == "?" || character == "!" || character == desperate_split_attempt) return [i, j]; // segment index, character index
|
|
9438
|
+
if (is_first_character) is_first_character = false;else if (be_very_aggressive && character == " ") {
|
|
9439
|
+
split_point_between_words.push([i, j]);
|
|
9440
|
+
if (split_point_between_words.length > 3)
|
|
9441
|
+
// We can't find a split point, so we'll just split between words
|
|
9442
|
+
// This is because for UI reasons we only want to show 2 lines of text, so we need to be very aggressive with getting the second match soon
|
|
9443
|
+
return split_point_between_words[1];
|
|
9444
|
+
}
|
|
9445
|
+
}
|
|
9446
|
+
}
|
|
9447
|
+
}
|
|
9448
|
+
return [];
|
|
9449
|
+
}
|
|
9450
|
+
function $99472afa7112c427$var$cut_start(cut_left_of_index, segmented_text) {
|
|
9451
|
+
// Cut the start of the text to bring the first matching token
|
|
9452
|
+
let is_first_character = false;
|
|
9453
|
+
let words_encountered = 0;
|
|
9454
|
+
outmost_loop: for (let i = cut_left_of_index - 1; i >= 0; i--) {
|
|
9455
|
+
const segment = segmented_text[i];
|
|
9456
|
+
// We assume that two adjacent highlighted segments don't exist and have been merged if they were to have existed
|
|
9457
|
+
const text = segment.text_;
|
|
9458
|
+
for (let j = text.length - 1; j >= 0; j--) {
|
|
9459
|
+
const character = text[j];
|
|
9460
|
+
const is_space = character == " ";
|
|
9461
|
+
if (!is_first_character && is_space) words_encountered++;
|
|
9462
|
+
if (character == "." || character == "?" || character == "!" || character == "," || words_encountered > 8 && is_space) {
|
|
9463
|
+
// We have to be really aggressive at the start of sentences so stuff can be seen on mobile, hence comma
|
|
9464
|
+
segment.text_ = text.slice(j + 1).trimStart();
|
|
9465
|
+
segmented_text.splice(0, i);
|
|
9466
|
+
if (character === "," || is_space)
|
|
9467
|
+
// if we cut at a comma or psace, we add a … at the beginning
|
|
9468
|
+
segmented_text.unshift({
|
|
9469
|
+
text_: "… ",
|
|
9470
|
+
highlighted_: false
|
|
9471
|
+
});
|
|
9472
|
+
break outmost_loop;
|
|
9473
|
+
}
|
|
9474
|
+
if (is_first_character) is_first_character = false;
|
|
9475
|
+
}
|
|
9476
|
+
}
|
|
9477
|
+
$99472afa7112c427$var$heal_holes(segmented_text); // if we added a ... there could now be a sequence that's not alternating true/false
|
|
9478
|
+
}
|
|
9479
|
+
|
|
9480
|
+
function $99472afa7112c427$var$segment_text(text, matched_strings) {
|
|
9481
|
+
// segment text where the matched strings are highlighted sections
|
|
9482
|
+
const output = [];
|
|
9483
|
+
if (!text) return; // shouldn't happen but whatever
|
|
9484
|
+
for (let i = 0; i < text.length; i++) {
|
|
9485
|
+
const found_strings = [];
|
|
9486
|
+
if (!i || text[i - 1] == " ")
|
|
9487
|
+
// only match at the start of a word or string, it looks weird if i.e. "we" is highlighted in "activewear
|
|
9488
|
+
for (let j = 0; j < matched_strings.length; j++) {
|
|
9489
|
+
const matched_string = matched_strings[j];
|
|
9490
|
+
const part_in_text = text.slice(i, i + matched_string.length);
|
|
9491
|
+
if (matched_string.length < 2) continue; // don't match on single characters, i.e. "I", it looks weird
|
|
9492
|
+
if (part_in_text.toLowerCase() === matched_string.toLowerCase()) found_strings.push(part_in_text); // use the casing from the text, not from typesense, can look weird otherwise
|
|
9493
|
+
}
|
|
9494
|
+
|
|
9495
|
+
const last_index_in_output = output.length - 1;
|
|
9496
|
+
if (!found_strings.length) {
|
|
9497
|
+
var _output$last_index_in;
|
|
9498
|
+
const character = text[i];
|
|
9499
|
+
if (((_output$last_index_in = output[last_index_in_output]) === null || _output$last_index_in === void 0 ? void 0 : _output$last_index_in.highlighted_) === false || output.length && /\s/.test(character))
|
|
9500
|
+
// always push whitespace characters to the last segment, this is because typesense doesn't see them as part of the matched tokens but we want to be able to detect "phat" matched segments
|
|
9501
|
+
output[last_index_in_output].text_ += character;else output.push({
|
|
9502
|
+
highlighted_: false,
|
|
9503
|
+
text_: character
|
|
9504
|
+
});
|
|
9505
|
+
} else {
|
|
9506
|
+
var _output$last_index_in2;
|
|
9507
|
+
const longest_found_string = found_strings.reduce((a, b) => a.length > b.length ? a : b);
|
|
9508
|
+
if ((_output$last_index_in2 = output[last_index_in_output]) !== null && _output$last_index_in2 !== void 0 && _output$last_index_in2.highlighted_) output[last_index_in_output].text_ += longest_found_string;else output.push({
|
|
9509
|
+
highlighted_: true,
|
|
9510
|
+
text_: longest_found_string
|
|
9511
|
+
});
|
|
9512
|
+
i += longest_found_string.length - 1;
|
|
9513
|
+
}
|
|
9514
|
+
}
|
|
9515
|
+
return output;
|
|
9516
|
+
}
|
|
9517
|
+
const $f1fc9ea3e7632eba$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<a></a>`, 2),
|
|
9518
|
+
$f1fc9ea3e7632eba$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div></div>`, 2),
|
|
9519
|
+
$f1fc9ea3e7632eba$var$_tmpl$3 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="description line-clamp"></div>`, 2),
|
|
9520
|
+
$f1fc9ea3e7632eba$var$_tmpl$4 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="content-card"><div class="image"></div><div class="info"><!#><!/><!#><!/></div></div>`, 10);
|
|
9521
|
+
function $f1fc9ea3e7632eba$export$f631859cab12b342(_ref) {
|
|
9522
|
+
let {
|
|
9523
|
+
router_: router_,
|
|
9524
|
+
content_result_: content_result_
|
|
9525
|
+
} = _ref;
|
|
9526
|
+
const make_link_attributes = () => {
|
|
9527
|
+
const result = content_result_ === null || content_result_ === void 0 ? void 0 : content_result_();
|
|
9528
|
+
if (!result) return;
|
|
9529
|
+
return {
|
|
9530
|
+
href: result.page_url,
|
|
9531
|
+
onClick: (0, $52FdA$depictaiutilishared.catchify)(ev => router_.navigate_.go_to_({
|
|
9532
|
+
new_url_: result.page_url,
|
|
9533
|
+
is_replace_: false,
|
|
9534
|
+
event_: ev
|
|
9535
|
+
}))
|
|
9536
|
+
};
|
|
9537
|
+
};
|
|
9538
|
+
const LinkIfPossible = _ref2 => {
|
|
9539
|
+
let {
|
|
9540
|
+
children: children,
|
|
9541
|
+
...attributes
|
|
9542
|
+
} = _ref2;
|
|
9543
|
+
if (content_result_) return (() => {
|
|
9544
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($f1fc9ea3e7632eba$var$_tmpl$);
|
|
9545
|
+
(0, $52FdA$solidjsweb.spread)(_el$, attributes, false, true);
|
|
9546
|
+
(0, $52FdA$solidjsweb.insert)(_el$, children);
|
|
9547
|
+
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
9548
|
+
return _el$;
|
|
9549
|
+
})();
|
|
9550
|
+
return (() => {
|
|
9551
|
+
const _el$2 = (0, $52FdA$solidjsweb.getNextElement)($f1fc9ea3e7632eba$var$_tmpl$2);
|
|
9552
|
+
(0, $52FdA$solidjsweb.spread)(_el$2, attributes, false, true);
|
|
9553
|
+
(0, $52FdA$solidjsweb.insert)(_el$2, children);
|
|
9554
|
+
(0, $52FdA$solidjsweb.runHydrationEvents)();
|
|
9555
|
+
return _el$2;
|
|
9556
|
+
})();
|
|
9557
|
+
};
|
|
9558
|
+
return (() => {
|
|
9559
|
+
const _el$3 = (0, $52FdA$solidjsweb.getNextElement)($f1fc9ea3e7632eba$var$_tmpl$4),
|
|
9560
|
+
_el$4 = _el$3.firstChild,
|
|
9561
|
+
_el$5 = _el$4.nextSibling,
|
|
9562
|
+
_el$7 = _el$5.firstChild,
|
|
9563
|
+
[_el$8, _co$] = (0, $52FdA$solidjsweb.getNextMarker)(_el$7.nextSibling),
|
|
9564
|
+
_el$9 = _el$8.nextSibling,
|
|
9565
|
+
[_el$10, _co$2] = (0, $52FdA$solidjsweb.getNextMarker)(_el$9.nextSibling);
|
|
9566
|
+
(0, $52FdA$solidjsweb.insert)(_el$4, (0, $52FdA$solidjsweb.createComponent)(LinkIfPossible, (0, $52FdA$solidjsweb.mergeProps)(make_link_attributes, {
|
|
9567
|
+
tabIndex: "-1",
|
|
9568
|
+
get children() {
|
|
9569
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $3cf7b4db1e203c93$export$605674723bcc715c), {
|
|
9570
|
+
width: "28",
|
|
9571
|
+
height: "28"
|
|
9572
|
+
});
|
|
9573
|
+
}
|
|
9574
|
+
})));
|
|
9575
|
+
(0, $52FdA$solidjsweb.insert)(_el$5, (0, $52FdA$solidjsweb.createComponent)(LinkIfPossible, (0, $52FdA$solidjsweb.mergeProps)({
|
|
9576
|
+
"class": "content-title line-clamp"
|
|
9577
|
+
}, make_link_attributes, {
|
|
9578
|
+
get title() {
|
|
9579
|
+
return content_result_ === null || content_result_ === void 0 ? void 0 : content_result_().title;
|
|
9580
|
+
},
|
|
9581
|
+
get children() {
|
|
9582
|
+
return content_result_ ? (0, $52FdA$solidjsweb.createComponent)((0, $99472afa7112c427$export$e1a98a189fd2c0e7), {
|
|
9583
|
+
content_result_: content_result_,
|
|
9584
|
+
key_: "title",
|
|
9585
|
+
cut_when_possible_: false
|
|
9586
|
+
}) : (0, $52FdA$solidjsweb.createComponent)((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
9587
|
+
height: "1em",
|
|
9588
|
+
width: "20ch"
|
|
9589
|
+
});
|
|
9590
|
+
}
|
|
9591
|
+
})), _el$8, _co$);
|
|
9592
|
+
(0, $52FdA$solidjsweb.insert)(_el$5, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9593
|
+
get when() {
|
|
9594
|
+
return (content_result_ === null || content_result_ === void 0 ? void 0 : content_result_().description) || !content_result_;
|
|
9595
|
+
},
|
|
9596
|
+
get children() {
|
|
9597
|
+
const _el$6 = (0, $52FdA$solidjsweb.getNextElement)($f1fc9ea3e7632eba$var$_tmpl$3);
|
|
9598
|
+
(0, $52FdA$solidjsweb.insert)(_el$6, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9599
|
+
when: content_result_,
|
|
9600
|
+
get fallback() {
|
|
9601
|
+
return Array.from({
|
|
9602
|
+
length: 4
|
|
9603
|
+
}).map(() => (0, $52FdA$solidjsweb.createComponent)((0, $a7f7d416e6f61504$export$89c6019e4baa40b1), {
|
|
9604
|
+
height: "1em",
|
|
9605
|
+
width: "min(50ch, 100%)"
|
|
9606
|
+
}));
|
|
9607
|
+
},
|
|
9608
|
+
get children() {
|
|
9609
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $99472afa7112c427$export$e1a98a189fd2c0e7), {
|
|
9610
|
+
content_result_: content_result_,
|
|
9611
|
+
key_: "description",
|
|
9612
|
+
cut_when_possible_: true
|
|
9613
|
+
});
|
|
9614
|
+
}
|
|
9615
|
+
}));
|
|
9616
|
+
return _el$6;
|
|
9617
|
+
}
|
|
9618
|
+
}), _el$10, _co$2);
|
|
9619
|
+
return _el$3;
|
|
9620
|
+
})();
|
|
9621
|
+
}
|
|
9622
|
+
function $bf4a8d57aa8dd1c8$export$9ff751cd77687edc(_ref) {
|
|
9623
|
+
let {
|
|
9624
|
+
search_results_: search_results_,
|
|
9625
|
+
router_: router_
|
|
9626
|
+
} = _ref;
|
|
9627
|
+
const content_results = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9628
|
+
var _search_results_;
|
|
9629
|
+
return (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.content_search_links;
|
|
9630
|
+
});
|
|
9631
|
+
const content_results_by_page_url = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9632
|
+
const map = new Map();
|
|
9633
|
+
const results = content_results();
|
|
9634
|
+
if (!results) return map;
|
|
9635
|
+
for (let i = 0; i < results.length; i++) {
|
|
9636
|
+
const content_result = results[i];
|
|
9637
|
+
map.set(content_result.page_url, content_result);
|
|
9638
|
+
}
|
|
9639
|
+
return map;
|
|
9640
|
+
});
|
|
9641
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.For), {
|
|
9642
|
+
get each() {
|
|
9643
|
+
return [...content_results_by_page_url().keys()];
|
|
9644
|
+
},
|
|
9645
|
+
children: page_url => {
|
|
9646
|
+
const content_result = (0, $52FdA$solidjs.createMemo)(() => content_results_by_page_url().get(page_url));
|
|
9647
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $f1fc9ea3e7632eba$export$f631859cab12b342), {
|
|
9648
|
+
content_result_: content_result,
|
|
9649
|
+
router_: router_
|
|
9650
|
+
});
|
|
9651
|
+
}
|
|
9652
|
+
});
|
|
9653
|
+
}
|
|
9654
|
+
function $05f255c0a94b9ca1$export$4405d077f0a20494(_ref) {
|
|
9655
|
+
let {
|
|
9656
|
+
content_results_rows_: [get_history_state_content_results_rows],
|
|
9657
|
+
cols_at_size_: cols_at_size_
|
|
9658
|
+
} = _ref;
|
|
9659
|
+
const largest_column = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9660
|
+
const largest_in_cols_at_size = Math.max(...cols_at_size_().map(_ref2 => {
|
|
9661
|
+
let [cols] = _ref2;
|
|
9662
|
+
return cols;
|
|
9663
|
+
}));
|
|
9664
|
+
if (isNaN(largest_in_cols_at_size) || Math.abs(largest_in_cols_at_size) === Infinity) return 4; // fallback to something big so we always have the right amount of placeholders
|
|
9665
|
+
return largest_in_cols_at_size;
|
|
9666
|
+
});
|
|
9667
|
+
const num_placeholders = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9668
|
+
var _get_history_state_co;
|
|
9669
|
+
return ((_get_history_state_co = get_history_state_content_results_rows()) !== null && _get_history_state_co !== void 0 ? _get_history_state_co : (0, $eab939d0b95b75ee$export$70ceae36059a1036)) * largest_column();
|
|
9670
|
+
});
|
|
9671
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Index), {
|
|
9672
|
+
get each() {
|
|
9673
|
+
return Array.from({
|
|
9674
|
+
length: num_placeholders()
|
|
9675
|
+
});
|
|
9676
|
+
},
|
|
9677
|
+
children: () => (0, $52FdA$solidjsweb.createComponent)((0, $f1fc9ea3e7632eba$export$f631859cab12b342), {})
|
|
9678
|
+
});
|
|
9679
|
+
}
|
|
9680
|
+
const $eab939d0b95b75ee$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="content-results"><!#><!/><!#><!/></div>`, 6),
|
|
9681
|
+
$eab939d0b95b75ee$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<button class="view-more"></button>`, 2),
|
|
9682
|
+
$eab939d0b95b75ee$var$_tmpl$3 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<button class="view-less"></button>`, 2);
|
|
9683
|
+
const $eab939d0b95b75ee$export$70ceae36059a1036 = 1;
|
|
9684
|
+
function $eab939d0b95b75ee$export$6d0c9c22f6652669(_ref) {
|
|
9685
|
+
let {
|
|
9686
|
+
search_results_: search_results_,
|
|
9687
|
+
get_search_query_: get_search_query_,
|
|
9688
|
+
i18n_: i18n_,
|
|
9689
|
+
layout_options_: layout_options_,
|
|
9690
|
+
router_: router_,
|
|
9691
|
+
query_base_: query_base_,
|
|
9692
|
+
content_results_rows_: content_results_rows_
|
|
9693
|
+
} = _ref;
|
|
9694
|
+
const content_results = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9695
|
+
var _search_results_;
|
|
9696
|
+
return (_search_results_ = search_results_()) === null || _search_results_ === void 0 ? void 0 : _search_results_.content_search_links;
|
|
9697
|
+
});
|
|
9698
|
+
const num_results = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9699
|
+
var _content_results;
|
|
9700
|
+
return (_content_results = content_results()) === null || _content_results === void 0 ? void 0 : _content_results.length;
|
|
9701
|
+
});
|
|
9702
|
+
const is_loading_ = (0, $52FdA$solidjs.createMemo)(() => search_results_.loading || query_base_.loading); // See comment in PLPResults/index.tsx on why we need this
|
|
9703
|
+
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
9704
|
+
number_: num_results,
|
|
9705
|
+
i18n_: i18n_
|
|
9706
|
+
});
|
|
9707
|
+
const [is_showing_placeholders, set_is_showing_placeholders] = (0, $52FdA$solidjs.createSignal)(false);
|
|
9708
|
+
const rows_object = $eab939d0b95b75ee$var$make_state_saved_rows(content_results_rows_, i18n_);
|
|
9709
|
+
return (() => {
|
|
9710
|
+
const _el$ = (0, $52FdA$solidjsweb.getNextElement)($eab939d0b95b75ee$var$_tmpl$),
|
|
9711
|
+
_el$2 = _el$.firstChild,
|
|
9712
|
+
[_el$3, _co$] = (0, $52FdA$solidjsweb.getNextMarker)(_el$2.nextSibling),
|
|
9713
|
+
_el$4 = _el$3.nextSibling,
|
|
9714
|
+
[_el$5, _co$2] = (0, $52FdA$solidjsweb.getNextMarker)(_el$4.nextSibling);
|
|
9715
|
+
(0, $52FdA$solidjsweb.insert)(_el$, (0, $52FdA$solidjsweb.createComponent)((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), {
|
|
9716
|
+
get_search_query_: get_search_query_,
|
|
9717
|
+
i18n_: i18n_,
|
|
9718
|
+
formatted_number_of_results_: formatted_number_of_results_,
|
|
9719
|
+
get type() {
|
|
9720
|
+
return (0, $9870a8a48ee126af$export$2452208c79fe93ea).content;
|
|
9721
|
+
},
|
|
9722
|
+
number_of_results_: num_results
|
|
9723
|
+
}), _el$3, _co$);
|
|
9724
|
+
(0, $52FdA$solidjsweb.insert)(_el$, (0, $52FdA$solidjsweb.createComponent)((0, $6c2c739b113a8ddf$export$d21e32dfedac04be), (0, $52FdA$solidjsweb.mergeProps)({
|
|
9725
|
+
layout: "grid",
|
|
9726
|
+
element_attributes: {
|
|
9727
|
+
class: "cards"
|
|
9728
|
+
}
|
|
9729
|
+
}, layout_options_, {
|
|
9730
|
+
rows: rows_object,
|
|
9731
|
+
get children() {
|
|
9732
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Suspense), {
|
|
9733
|
+
get fallback() {
|
|
9734
|
+
return (() => {
|
|
9735
|
+
set_is_showing_placeholders(true);
|
|
9736
|
+
(0, $52FdA$solidjs.onCleanup)(() => set_is_showing_placeholders(false));
|
|
9737
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $05f255c0a94b9ca1$export$4405d077f0a20494), {
|
|
9738
|
+
content_results_rows_: content_results_rows_,
|
|
9739
|
+
get cols_at_size_() {
|
|
9740
|
+
return (0, $52FdA$solidjs.createMemo)(() => layout_options_().cols_at_size);
|
|
9741
|
+
}
|
|
9742
|
+
});
|
|
9743
|
+
})();
|
|
9744
|
+
},
|
|
9745
|
+
get children() {
|
|
9746
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $bf4a8d57aa8dd1c8$export$9ff751cd77687edc), {
|
|
9747
|
+
router_: router_,
|
|
9748
|
+
search_results_: search_results_
|
|
9749
|
+
});
|
|
9750
|
+
}
|
|
9751
|
+
});
|
|
9752
|
+
}
|
|
9753
|
+
})), _el$5, _co$2);
|
|
9754
|
+
(0, $52FdA$solidjsweb.effect)(_p$ => {
|
|
9755
|
+
var _content_results2;
|
|
9756
|
+
const _v$ = !!is_showing_placeholders(),
|
|
9757
|
+
_v$2 = is_loading_() || ((_content_results2 = content_results()) === null || _content_results2 === void 0 ? void 0 : _content_results2.length) > 0 ? "" : "none";
|
|
9758
|
+
_v$ !== _p$._v$ && _el$.classList.toggle("loading", _p$._v$ = _v$);
|
|
9759
|
+
_v$2 !== _p$._v$2 && _el$.style.setProperty("display", _p$._v$2 = _v$2);
|
|
9760
|
+
return _p$;
|
|
9761
|
+
}, {
|
|
9762
|
+
_v$: undefined,
|
|
9763
|
+
_v$2: undefined
|
|
9764
|
+
});
|
|
9765
|
+
return _el$;
|
|
9766
|
+
})();
|
|
9767
|
+
}
|
|
9768
|
+
function $eab939d0b95b75ee$var$make_state_saved_rows(_ref2, i18n_) {
|
|
9769
|
+
let [get_showing_content_results_rows, set_showing_content_results_rows] = _ref2;
|
|
9770
|
+
const currently_visible = (0, $52FdA$solidjs.createSignal)((0, $52FdA$solidjs.untrack)(get_showing_content_results_rows));
|
|
9771
|
+
const [get_currently_visible, set_currently_visible] = currently_visible;
|
|
9772
|
+
const rows = {
|
|
9773
|
+
currently_visible: currently_visible,
|
|
9774
|
+
start_rows: $eab939d0b95b75ee$export$70ceae36059a1036,
|
|
9775
|
+
button: (() => {
|
|
9776
|
+
const _el$6 = (0, $52FdA$solidjsweb.getNextElement)($eab939d0b95b75ee$var$_tmpl$2);
|
|
9777
|
+
(0, $52FdA$solidjsweb.insert)(_el$6, () => i18n_.view_more_());
|
|
9778
|
+
return _el$6;
|
|
9779
|
+
})(),
|
|
9780
|
+
view_less_button: (() => {
|
|
9781
|
+
const _el$7 = (0, $52FdA$solidjsweb.getNextElement)($eab939d0b95b75ee$var$_tmpl$3);
|
|
9782
|
+
(0, $52FdA$solidjsweb.insert)(_el$7, () => i18n_.view_less_());
|
|
9783
|
+
return _el$7;
|
|
9784
|
+
})(),
|
|
9785
|
+
rows_per_click: 3
|
|
9786
|
+
};
|
|
9787
|
+
(0, $52FdA$solidjs.createComputed)((0, $52FdA$solidjs.on)(get_currently_visible, new_visible => set_showing_content_results_rows(new_visible), {
|
|
9788
|
+
defer: true
|
|
9789
|
+
}));
|
|
9790
|
+
(0, $52FdA$solidjs.createComputed)((0, $52FdA$solidjs.on)(get_showing_content_results_rows, function () {
|
|
9791
|
+
let new_rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : $eab939d0b95b75ee$export$70ceae36059a1036;
|
|
9792
|
+
return set_currently_visible(new_rows);
|
|
9793
|
+
}, {
|
|
9794
|
+
defer: true
|
|
9795
|
+
}));
|
|
9796
|
+
return rows;
|
|
9797
|
+
}
|
|
9087
9798
|
const $739c927cbecd26b0$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="filter-results-for-one-row"><!#><!/><!#><!/></div>`, 6),
|
|
9088
|
-
$739c927cbecd26b0$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"
|
|
9799
|
+
$739c927cbecd26b0$var$_tmpl$2 = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="depict plp search"><div class="listing-page"><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/><!#><!/></div><!#><!/><!#><!/></div>`, 22);
|
|
9089
9800
|
function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
9090
9801
|
let {
|
|
9091
9802
|
depict_api_: depict_api_,
|
|
@@ -9115,7 +9826,11 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9115
9826
|
recommendations_layout_options_: recommendations_layout_options_,
|
|
9116
9827
|
scroll_restoration_data_: scroll_restoration_data_,
|
|
9117
9828
|
product_card_template_: product_card_template_,
|
|
9118
|
-
modal_body_style_ref_: modal_body_style_ref_
|
|
9829
|
+
modal_body_style_ref_: modal_body_style_ref_,
|
|
9830
|
+
router_: router_,
|
|
9831
|
+
content_results_rows_: content_results_rows_,
|
|
9832
|
+
content_layout_options_: content_layout_options_,
|
|
9833
|
+
content_search_enabled_: content_search_enabled_
|
|
9119
9834
|
} = _ref;
|
|
9120
9835
|
const [get_sorting] = current_sorting_;
|
|
9121
9836
|
const all_products_loaded_ = (0, $52FdA$solidjs.createSignal)(false);
|
|
@@ -9182,16 +9897,29 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9182
9897
|
const SafeSearchField = (0, $52FdA$depictaiutilishared.catchify)((0, $29e5dbeb69da7a36$export$b94867ecbd698f21));
|
|
9183
9898
|
const [sort_or_filter_open_, set_sort_or_filter_open_] = (0, $52FdA$solidjs.createSignal)(false);
|
|
9184
9899
|
const [desktop_filter_elements_, set_desktop_filter_elements] = (0, $52FdA$solidjs.createSignal)();
|
|
9900
|
+
const n_hits = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9901
|
+
var _search_results_3;
|
|
9902
|
+
return (_search_results_3 = search_results_()) === null || _search_results_3 === void 0 ? void 0 : _search_results_3.n_hits;
|
|
9903
|
+
});
|
|
9185
9904
|
const formatted_number_of_results_ = (0, $068bde7fa83ac02c$export$92f2da32c6e7e7ee)({
|
|
9186
|
-
|
|
9905
|
+
number_: n_hits,
|
|
9187
9906
|
i18n_: i18n_
|
|
9188
9907
|
});
|
|
9189
9908
|
const [sort_and_filter_element_, set_sort_and_filter_element_] = (0, $52FdA$solidjs.createSignal)();
|
|
9190
|
-
const
|
|
9909
|
+
const no_results_text_ = (0, $52FdA$solidjs.createMemo)(() => {
|
|
9910
|
+
var _search_results_4, _search_results_4$con;
|
|
9911
|
+
return ((_search_results_4 = search_results_()) !== null && _search_results_4 !== void 0 && (_search_results_4$con = _search_results_4.content_search_links) !== null && _search_results_4$con !== void 0 && _search_results_4$con.length ? i18n_.no_products_ : i18n_.no_results_text_)();
|
|
9912
|
+
});
|
|
9913
|
+
const results_for = (0, $52FdA$solidjsweb.createComponent)((0, $9870a8a48ee126af$export$9dd50d35b9d94fdf), (0, $52FdA$solidjsweb.mergeProps)({
|
|
9914
|
+
get type() {
|
|
9915
|
+
return (0, $9870a8a48ee126af$export$2452208c79fe93ea).products;
|
|
9916
|
+
},
|
|
9917
|
+
number_of_results_: n_hits
|
|
9918
|
+
}, {
|
|
9191
9919
|
get_search_query_: get_search_query_,
|
|
9192
9920
|
i18n_: i18n_,
|
|
9193
9921
|
formatted_number_of_results_: formatted_number_of_results_
|
|
9194
|
-
});
|
|
9922
|
+
}));
|
|
9195
9923
|
const filters_opener = (0, $f70cc6dfcadf0fd5$export$d7841e452f2e59a8)({
|
|
9196
9924
|
set_sort_or_filter_open_: set_sort_or_filter_open_,
|
|
9197
9925
|
set_extra_els_in_results_container_: set_desktop_filter_elements,
|
|
@@ -9315,10 +10043,12 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9315
10043
|
[_el$17, _co$7] = (0, $52FdA$solidjsweb.getNextMarker)(_el$16.nextSibling),
|
|
9316
10044
|
_el$18 = _el$17.nextSibling,
|
|
9317
10045
|
[_el$19, _co$8] = (0, $52FdA$solidjsweb.getNextMarker)(_el$18.nextSibling),
|
|
9318
|
-
_el$20 = _el$
|
|
10046
|
+
_el$20 = _el$19.nextSibling,
|
|
9319
10047
|
[_el$21, _co$9] = (0, $52FdA$solidjsweb.getNextMarker)(_el$20.nextSibling),
|
|
9320
|
-
_el$22 = _el$
|
|
9321
|
-
[_el$23, _co$10] = (0, $52FdA$solidjsweb.getNextMarker)(_el$22.nextSibling)
|
|
10048
|
+
_el$22 = _el$7.nextSibling,
|
|
10049
|
+
[_el$23, _co$10] = (0, $52FdA$solidjsweb.getNextMarker)(_el$22.nextSibling),
|
|
10050
|
+
_el$24 = _el$23.nextSibling,
|
|
10051
|
+
[_el$25, _co$11] = (0, $52FdA$solidjsweb.getNextMarker)(_el$24.nextSibling);
|
|
9322
10052
|
(0, $52FdA$solidjsweb.insert)(_el$7, get_search_field_elements, _el$9, _co$3);
|
|
9323
10053
|
(0, $52FdA$solidjsweb.insert)(_el$7, make_category_suggestion_card_ ? (0, $52FdA$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
9324
10054
|
severity_: "error",
|
|
@@ -9330,7 +10060,29 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9330
10060
|
});
|
|
9331
10061
|
}
|
|
9332
10062
|
}) : null, _el$11, _co$4);
|
|
9333
|
-
(0, $52FdA$solidjsweb.insert)(_el$7, (
|
|
10063
|
+
(0, $52FdA$solidjsweb.insert)(_el$7, (0, $52FdA$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
10064
|
+
severity_: "error",
|
|
10065
|
+
message_: "ContentResults failed",
|
|
10066
|
+
get children() {
|
|
10067
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
10068
|
+
get when() {
|
|
10069
|
+
return content_search_enabled_();
|
|
10070
|
+
},
|
|
10071
|
+
get children() {
|
|
10072
|
+
return (0, $52FdA$solidjsweb.createComponent)((0, $eab939d0b95b75ee$export$6d0c9c22f6652669), {
|
|
10073
|
+
content_results_rows_: content_results_rows_,
|
|
10074
|
+
search_results_: search_results_,
|
|
10075
|
+
i18n_: i18n_,
|
|
10076
|
+
get_search_query_: get_search_query_,
|
|
10077
|
+
layout_options_: content_layout_options_,
|
|
10078
|
+
router_: router_,
|
|
10079
|
+
query_base_: search_query_base_
|
|
10080
|
+
});
|
|
10081
|
+
}
|
|
10082
|
+
});
|
|
10083
|
+
}
|
|
10084
|
+
}), _el$13, _co$5);
|
|
10085
|
+
(0, $52FdA$solidjsweb.insert)(_el$7, () => results_filters[0](), _el$15, _co$6);
|
|
9334
10086
|
(0, $52FdA$solidjsweb.insert)(_el$7, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9335
10087
|
get when() {
|
|
9336
10088
|
var _selected_filters_$;
|
|
@@ -9354,7 +10106,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9354
10106
|
}
|
|
9355
10107
|
});
|
|
9356
10108
|
}
|
|
9357
|
-
}), _el$
|
|
10109
|
+
}), _el$17, _co$7);
|
|
9358
10110
|
(0, $52FdA$solidjsweb.insert)(_el$7, (0, $52FdA$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
9359
10111
|
severity_: "error",
|
|
9360
10112
|
message_: "Search results failed",
|
|
@@ -9377,11 +10129,14 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9377
10129
|
selected_filters_: selected_filters_,
|
|
9378
10130
|
expanded_hierarchical_filters_: expanded_hierarchical_filters_,
|
|
9379
10131
|
local_filter_cache_: local_filter_cache_,
|
|
9380
|
-
i18n_:
|
|
10132
|
+
i18n_: {
|
|
10133
|
+
...i18n_,
|
|
10134
|
+
no_results_text_: no_results_text_
|
|
10135
|
+
}
|
|
9381
10136
|
}
|
|
9382
10137
|
});
|
|
9383
10138
|
}
|
|
9384
|
-
}), _el$
|
|
10139
|
+
}), _el$19, _co$8);
|
|
9385
10140
|
(0, $52FdA$solidjsweb.insert)(_el$7, (0, $52FdA$solidjsweb.createComponent)((0, $52FdA$solidjs.Show), {
|
|
9386
10141
|
get when() {
|
|
9387
10142
|
return get_all_products_loaded() && !disable_search_recommendations_;
|
|
@@ -9409,7 +10164,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9409
10164
|
}
|
|
9410
10165
|
});
|
|
9411
10166
|
}
|
|
9412
|
-
}), _el$
|
|
10167
|
+
}), _el$21, _co$9);
|
|
9413
10168
|
(0, $52FdA$solidjsweb.insert)(_el$6, (0, $52FdA$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
9414
10169
|
message_: "Scroll status failed",
|
|
9415
10170
|
severity_: "error",
|
|
@@ -9420,12 +10175,12 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9420
10175
|
formatted_number_of_results_: formatted_number_of_results_,
|
|
9421
10176
|
i18n_: i18n_,
|
|
9422
10177
|
number_of_results_: (0, $52FdA$solidjs.createMemo)(() => {
|
|
9423
|
-
var
|
|
9424
|
-
return (
|
|
10178
|
+
var _search_results_5;
|
|
10179
|
+
return (_search_results_5 = search_results_()) === null || _search_results_5 === void 0 ? void 0 : _search_results_5.n_hits;
|
|
9425
10180
|
})
|
|
9426
10181
|
});
|
|
9427
10182
|
}
|
|
9428
|
-
}), _el$
|
|
10183
|
+
}), _el$23, _co$10);
|
|
9429
10184
|
(0, $52FdA$solidjsweb.insert)(_el$6, (0, $52FdA$solidjsweb.createComponent)((0, $1b3cf201cdd38687$export$b69d0d92862de18b), {
|
|
9430
10185
|
message_: "Floating buttons failed",
|
|
9431
10186
|
severity_: "error",
|
|
@@ -9438,7 +10193,7 @@ function $739c927cbecd26b0$export$a54ec244c8863715(_ref) {
|
|
|
9438
10193
|
i18n_: i18n_
|
|
9439
10194
|
});
|
|
9440
10195
|
}
|
|
9441
|
-
}), _el$
|
|
10196
|
+
}), _el$25, _co$11);
|
|
9442
10197
|
(0, $52FdA$solidjsweb.effect)(() => (0, $52FdA$solidjsweb.setAttribute)(_el$6, "id", (0, $c95c6dd9e93acd82$export$44dad306455dddf).SEARCH_PAGE));
|
|
9443
10198
|
return _el$6;
|
|
9444
10199
|
})()];
|
|
@@ -9463,6 +10218,38 @@ function $98bd00c15a2e3159$export$828dcdd425fd3231(aligner) {
|
|
|
9463
10218
|
cleanup: cleanup
|
|
9464
10219
|
};
|
|
9465
10220
|
}
|
|
10221
|
+
|
|
10222
|
+
/**
|
|
10223
|
+
* Content results ContentCard look stupid on mobile if there are two columns of them, so we limit the number of columns to 1 if the screen is too small
|
|
10224
|
+
*/
|
|
10225
|
+
function $b1ea8d47bcf03111$export$ff7109b9b2b206ba(sdk_cols_at_size) {
|
|
10226
|
+
let min_width_for_more_than_one_column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
|
|
10227
|
+
if (!sdk_cols_at_size.length) return sdk_cols_at_size;
|
|
10228
|
+
const sorted_sizes = sdk_cols_at_size.map(_ref => {
|
|
10229
|
+
let [cols, max_width] = _ref;
|
|
10230
|
+
return [cols, max_width !== null && max_width !== void 0 ? max_width : Infinity];
|
|
10231
|
+
}).sort((_ref2, _ref3) => {
|
|
10232
|
+
let [, a] = _ref2;
|
|
10233
|
+
let [, b] = _ref3;
|
|
10234
|
+
return a - b;
|
|
10235
|
+
});
|
|
10236
|
+
const [[, smallest_max_width]] = sorted_sizes;
|
|
10237
|
+
if (smallest_max_width > min_width_for_more_than_one_column)
|
|
10238
|
+
// If everything above min_width_for_more_than_one_column, we can just add a 1 column at the beginning
|
|
10239
|
+
return [[1, min_width_for_more_than_one_column], ...sdk_cols_at_size];
|
|
10240
|
+
const to_delete = [];
|
|
10241
|
+
for (let i = 0; i < sorted_sizes.length; i++) {
|
|
10242
|
+
const [, max_width] = sorted_sizes[i];
|
|
10243
|
+
if (max_width > min_width_for_more_than_one_column) continue;
|
|
10244
|
+
to_delete.push(i);
|
|
10245
|
+
}
|
|
10246
|
+
while (to_delete.length) sorted_sizes.splice(to_delete.pop(), 1);
|
|
10247
|
+
sorted_sizes.unshift([1, min_width_for_more_than_one_column]);
|
|
10248
|
+
return sorted_sizes.map(_ref4 => {
|
|
10249
|
+
let [cols, max_width] = _ref4;
|
|
10250
|
+
return max_width == Infinity ? [cols] : [cols, max_width];
|
|
10251
|
+
});
|
|
10252
|
+
}
|
|
9466
10253
|
const $ddd39c5f36f49703$var$_tmpl$ = /*#__PURE__*/(0, $52FdA$solidjsweb.template)(`<div class="depict plp search"></div>`, 2);
|
|
9467
10254
|
function $ddd39c5f36f49703$var$_classPrivateFieldInitSpec(obj, privateMap, value) {
|
|
9468
10255
|
$ddd39c5f36f49703$var$_checkPrivateRedeclaration(obj, privateMap);
|
|
@@ -9494,6 +10281,7 @@ function $ddd39c5f36f49703$var$_classApplyDescriptorGet(receiver, descriptor) {
|
|
|
9494
10281
|
* Type for the private properties that are shared between the different exported search SDK wrapper functions. SDK users are not allowed to change/access these, they're an internal implementation detail.
|
|
9495
10282
|
*/
|
|
9496
10283
|
const $ddd39c5f36f49703$var$privately_shared_properties = /*@__PURE__*/new WeakMap();
|
|
10284
|
+
const $ddd39c5f36f49703$var$content_search_default = false;
|
|
9497
10285
|
const $ddd39c5f36f49703$var$min_products_to_fetch_ = 20;
|
|
9498
10286
|
const $ddd39c5f36f49703$export$bde3eb976dfded9 = depict_search => {
|
|
9499
10287
|
var _privately_shared_pro;
|
|
@@ -9503,6 +10291,7 @@ var $ddd39c5f36f49703$var$_locale_signal = /*#__PURE__*/new WeakMap();
|
|
|
9503
10291
|
var $ddd39c5f36f49703$var$_merchant_signal = /*#__PURE__*/new WeakMap();
|
|
9504
10292
|
var $ddd39c5f36f49703$var$_market_signal = /*#__PURE__*/new WeakMap();
|
|
9505
10293
|
var $ddd39c5f36f49703$var$_modal_open_signal = /*#__PURE__*/new WeakMap();
|
|
10294
|
+
var $ddd39c5f36f49703$var$_content_search_signal = /*#__PURE__*/new WeakMap();
|
|
9506
10295
|
var $ddd39c5f36f49703$var$_router = /*#__PURE__*/new WeakMap();
|
|
9507
10296
|
class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
9508
10297
|
constructor(_ref) {
|
|
@@ -9514,9 +10303,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9514
10303
|
on_navigation: on_navigation,
|
|
9515
10304
|
enable_category_suggestions = true,
|
|
9516
10305
|
page_url_creator: page_url_creator,
|
|
10306
|
+
display_transformers: display_transformers,
|
|
10307
|
+
api: api,
|
|
9517
10308
|
// Stuff needed for non-standard customer deployments that we shouldn't actually expose
|
|
9518
10309
|
disable_scrolling_during_modal = true,
|
|
9519
|
-
api: api,
|
|
9520
10310
|
bottom_distance_under_modal: bottom_distance_under_modal,
|
|
9521
10311
|
render_instant_card: render_instant_card,
|
|
9522
10312
|
...props_on_class
|
|
@@ -9537,6 +10327,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9537
10327
|
writable: true,
|
|
9538
10328
|
value: (0, $52FdA$solidjs.createSignal)(false)
|
|
9539
10329
|
});
|
|
10330
|
+
$ddd39c5f36f49703$var$_classPrivateFieldInitSpec(this, $ddd39c5f36f49703$var$_content_search_signal, {
|
|
10331
|
+
writable: true,
|
|
10332
|
+
value: (0, $52FdA$solidjs.createSignal)()
|
|
10333
|
+
});
|
|
9540
10334
|
$ddd39c5f36f49703$var$_classPrivateFieldInitSpec(this, $ddd39c5f36f49703$var$_router, {
|
|
9541
10335
|
writable: true,
|
|
9542
10336
|
value: new (0, $73014ff36186a4dd$export$7e1297a3a19f10d8)("hard_navigation")
|
|
@@ -9572,6 +10366,7 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9572
10366
|
local_filter_cache: [],
|
|
9573
10367
|
expanded_hierarchical_filters: [],
|
|
9574
10368
|
showing_recommendation_rows: (0, $c77adcdf5346b187$export$1c8c715550dc689d),
|
|
10369
|
+
content_results_rows: (0, $eab939d0b95b75ee$export$70ceae36059a1036),
|
|
9575
10370
|
scroll_restoration_data: []
|
|
9576
10371
|
};
|
|
9577
10372
|
},
|
|
@@ -9583,12 +10378,18 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9583
10378
|
const get_search_query_ = (0, $52FdA$solidjs.createMemo)(previous_value => {
|
|
9584
10379
|
if (get_search_query_updating_blocked()) return previous_value;else return raw_search_query_accessor();
|
|
9585
10380
|
});
|
|
10381
|
+
// @ts-ignore
|
|
9586
10382
|
const depict_api_ = api !== null && api !== void 0 ? api : new (0, $e270e9f953fcbc58$export$e015ed2f2950f2e3)({
|
|
9587
|
-
page_url_creator: page_url_creator
|
|
10383
|
+
page_url_creator: page_url_creator,
|
|
10384
|
+
display_transformers: display_transformers
|
|
9588
10385
|
});
|
|
9589
10386
|
const previous_searches = (0, $cfeb65948dbdcaab$export$84bba84a7b837187)(get_search_query_);
|
|
9590
10387
|
const [, set_search_showing_recommendation_rows] = state_.showing_recommendation_rows;
|
|
9591
|
-
const
|
|
10388
|
+
const [, set_search_content_results_rows] = state_.content_results_rows;
|
|
10389
|
+
const after_submit_ = () => {
|
|
10390
|
+
set_search_showing_recommendation_rows((0, $c77adcdf5346b187$export$1c8c715550dc689d));
|
|
10391
|
+
set_search_content_results_rows((0, $eab939d0b95b75ee$export$70ceae36059a1036));
|
|
10392
|
+
}; // do this every time after we have submitted a new query - otherwise there might already be a saved number of rows in the state
|
|
9592
10393
|
const on_submit_with_unchanged_value_ = () => this.modal_open = false;
|
|
9593
10394
|
const [get_search_field_value_, set_search_field_value_] = state_.field_value;
|
|
9594
10395
|
const configured_submit_query_ = new_query => (0, $7f680455a2aa1079$export$e16630ecb9644a1c)({
|
|
@@ -9646,6 +10447,10 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9646
10447
|
submit_query_: configured_submit_query_,
|
|
9647
10448
|
url_transformer_: url_transformer,
|
|
9648
10449
|
router_: (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_router),
|
|
10450
|
+
content_search_enabled_: () => {
|
|
10451
|
+
var _classPrivateFieldGet2;
|
|
10452
|
+
return (_classPrivateFieldGet2 = (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[0]()) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : $ddd39c5f36f49703$var$content_search_default;
|
|
10453
|
+
},
|
|
9649
10454
|
instant_results_options_: {
|
|
9650
10455
|
min_products_to_fetch_: $ddd39c5f36f49703$var$min_products_to_fetch_,
|
|
9651
10456
|
render_instant_card_: render_instant_card,
|
|
@@ -9714,6 +10519,12 @@ class $ddd39c5f36f49703$export$ac6237957a15b3f0 {
|
|
|
9714
10519
|
(0, $52FdA$solidjs.onCleanup)(() => $ddd39c5f36f49703$var$_classStaticPrivateFieldSpecGet($ddd39c5f36f49703$export$ac6237957a15b3f0, $ddd39c5f36f49703$export$ac6237957a15b3f0, $ddd39c5f36f49703$var$_keys_constructed_with).delete(unique_instance_key_for_state));
|
|
9715
10520
|
});
|
|
9716
10521
|
}
|
|
10522
|
+
get enable_content_search() {
|
|
10523
|
+
return (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[0]();
|
|
10524
|
+
}
|
|
10525
|
+
set enable_content_search(new_state) {
|
|
10526
|
+
(0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_content_search_signal)[1](new_state);
|
|
10527
|
+
}
|
|
9717
10528
|
get on_navigation() {
|
|
9718
10529
|
// The only non-reactive public property on the class (I don't see it making sense to have it reactive)
|
|
9719
10530
|
return (0, $parcel$interopDefault($52FdA$babelruntimehelpersclassPrivateFieldGet))(this, $ddd39c5f36f49703$var$_router).on_navigation_;
|
|
@@ -9800,6 +10611,10 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
9800
10611
|
depict_api_: shared_properties.depict_api_,
|
|
9801
10612
|
min_products_to_fetch_: $ddd39c5f36f49703$var$min_products_to_fetch_,
|
|
9802
10613
|
local_filter_cache_: state_.local_filter_cache,
|
|
10614
|
+
content_search_enabled_: () => {
|
|
10615
|
+
var _depict_search$enable;
|
|
10616
|
+
return (_depict_search$enable = depict_search.enable_content_search) !== null && _depict_search$enable !== void 0 ? _depict_search$enable : $ddd39c5f36f49703$var$content_search_default;
|
|
10617
|
+
},
|
|
9803
10618
|
search_field_value_: state_.field_value,
|
|
9804
10619
|
get_search_query_: shared_properties.get_search_query_,
|
|
9805
10620
|
clear_filters_on_next_submit_: shared_properties.clear_filters_on_next_submit_,
|
|
@@ -9829,6 +10644,8 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
9829
10644
|
search_filters_open_: state_.filters_open,
|
|
9830
10645
|
search_sorting_open_: state_.sorting_open,
|
|
9831
10646
|
expanded_filters_: state_.expanded_filters,
|
|
10647
|
+
content_results_rows_: state_.content_results_rows,
|
|
10648
|
+
router_: shared_properties.router_,
|
|
9832
10649
|
make_category_suggestion_card_: shared_properties.enable_category_suggestions_ ? category_suggestion_ => {
|
|
9833
10650
|
return (0, $3001ad378baf39dc$export$d757d54550ebfb3d)({
|
|
9834
10651
|
category_suggestion_: category_suggestion_,
|
|
@@ -9844,6 +10661,10 @@ function $ddd39c5f36f49703$export$f2dc7e4e4aa11abb(props) {
|
|
|
9844
10661
|
cols_at_size: (0, $5401a6698b0c0658$export$6daf8749b65a1b77)(props.cols_at_size),
|
|
9845
10662
|
...grid_spacing_override()
|
|
9846
10663
|
})),
|
|
10664
|
+
content_layout_options_: (0, $52FdA$solidjs.createMemo)(() => ({
|
|
10665
|
+
cols_at_size: (0, $5401a6698b0c0658$export$6daf8749b65a1b77)((0, $b1ea8d47bcf03111$export$ff7109b9b2b206ba)(props.cols_at_size)),
|
|
10666
|
+
...grid_spacing_override()
|
|
10667
|
+
})),
|
|
9847
10668
|
recommendations_layout_options_: (0, $52FdA$solidjs.createMemo)(() => {
|
|
9848
10669
|
const {
|
|
9849
10670
|
extra_depict_options: extra_depict_options
|