@depict-ai/ui 2.0.21 → 2.0.23
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 +234 -209
- package/ES10/index.d.ts +45 -37
- package/ES10/index.js +234 -211
- package/latest/index.cjs +225 -198
- package/latest/index.d.ts +45 -37
- package/latest/index.js +225 -200
- package/package.json +2 -2
- package/server/ES10/index.cjs +228 -206
- package/server/ES10/index.d.ts +45 -37
- package/server/ES10/index.js +228 -208
- package/server/latest/index.cjs +219 -195
- package/server/latest/index.d.ts +45 -37
- package/server/latest/index.js +219 -197
package/server/ES10/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $b8hua$add_to_version_info, queueMacroTask as $b8hua$queueMacroTask, catchify as $b8hua$catchify, is_safari as $b8hua$is_safari, observer as $b8hua$observer, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, slider_fractional_factory as $b8hua$slider_fractional_factory,
|
|
1
|
+
import { add_to_version_info as $b8hua$add_to_version_info, base64_encode_unicode as $b8hua$base64_encode_unicode, base64_decode_unicode as $b8hua$base64_decode_unicode, dlog as $b8hua$dlog, queueMacroTask as $b8hua$queueMacroTask, catchify as $b8hua$catchify, is_safari as $b8hua$is_safari, observer as $b8hua$observer, Amazing_Slider as $b8hua$Amazing_Slider, slider_snap_css as $b8hua$slider_snap_css, slider_fading_factory as $b8hua$slider_fading_factory, slider_fractional_factory as $b8hua$slider_fractional_factory, camelCasifyObject as $b8hua$camelCasifyObject, make_random_classname as $b8hua$make_random_classname, n_col_styling_with_dist as $b8hua$n_col_styling_with_dist, layout_get_visible_recs_without_partial_rows as $b8hua$layout_get_visible_recs_without_partial_rows, layout_get_total_rec_amount_for_row as $b8hua$layout_get_total_rec_amount_for_row, layout_media_query_header as $b8hua$layout_media_query_header, report as $b8hua$report, useExpandingContainer as $b8hua$useExpandingContainer, standard_price_format as $b8hua$standard_price_format, hex_to_rgb as $b8hua$hex_to_rgb, relative_luminance_from_rgb as $b8hua$relative_luminance_from_rgb, fetch_recs as $b8hua$fetch_recs, snakeCasifyObject as $b8hua$snakeCasifyObject, instant_exec_on_suspect_history_change as $b8hua$instant_exec_on_suspect_history_change, base_url as $b8hua$base_url, get_depict_id as $b8hua$get_depict_id, get_user_id as $b8hua$get_user_id, get_session_id as $b8hua$get_session_id, make_url_with_query_params as $b8hua$make_url_with_query_params, fetch_retry as $b8hua$fetch_retry, add_version_query_params as $b8hua$add_version_query_params, dwarn as $b8hua$dwarn, sort_obj as $b8hua$sort_obj, edit_current_page_meta_tags as $b8hua$edit_current_page_meta_tags, javascript_media_query as $b8hua$javascript_media_query, use_href_accessor as $b8hua$use_href_accessor, make_asyncIterable_exiter as $b8hua$make_asyncIterable_exiter, href_change_ipns as $b8hua$href_change_ipns, ContainedImage as $b8hua$ContainedImage, deparallelize_no_drop as $b8hua$deparallelize_no_drop, ListenableSet as $b8hua$ListenableSet, insert_surfaces as $b8hua$insert_surfaces } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import { createComponent as $b8hua$createComponent, ssr as $b8hua$ssr, ssrHydrationKey as $b8hua$ssrHydrationKey, ssrStyle as $b8hua$ssrStyle, ssrElement as $b8hua$ssrElement, escape as $b8hua$escape, insert as $b8hua$insert, ssrAttribute as $b8hua$ssrAttribute, mergeProps as $b8hua$mergeProps, isServer as $b8hua$isServer, ssrClassList as $b8hua$ssrClassList, Dynamic as $b8hua$Dynamic } from "solid-js/web";
|
|
3
3
|
import { createSignal as $b8hua$createSignal, getOwner as $b8hua$getOwner, createEffect as $b8hua$createEffect, runWithOwner as $b8hua$runWithOwner, onCleanup as $b8hua$onCleanup, createMemo as $b8hua$createMemo, createContext as $b8hua$createContext, useContext as $b8hua$useContext, createResource as $b8hua$createResource, Suspense as $b8hua$Suspense, Show as $b8hua$Show, createRenderEffect as $b8hua$createRenderEffect, createRoot as $b8hua$createRoot, For as $b8hua$For, createUniqueId as $b8hua$createUniqueId, untrack as $b8hua$untrack, createComputed as $b8hua$createComputed, ErrorBoundary as $b8hua$ErrorBoundary, Index as $b8hua$Index, on as $b8hua$on, batch as $b8hua$batch, createReaction as $b8hua$createReaction } from "solid-js";
|
|
4
4
|
import $b8hua$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
@@ -8,7 +8,185 @@ import $b8hua$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/def
|
|
|
8
8
|
/*! Depict.ai search and product listing SDK */
|
|
9
9
|
import { register_es_version } from "../../multi_import_deduplicator.mjs";
|
|
10
10
|
register_es_version("ui", "ES10");
|
|
11
|
-
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.
|
|
11
|
+
const $8db9a15135765c11$export$83d89fbfd8236492 = "2.0.23";
|
|
12
|
+
const $2855bffe06ef7a03$var$fallback_operator = "in";
|
|
13
|
+
const $2855bffe06ef7a03$var$fallback_token = "";
|
|
14
|
+
const $2855bffe06ef7a03$var$legacy_filter_prefix = "filter_";
|
|
15
|
+
const $2855bffe06ef7a03$var$operator_map = {
|
|
16
|
+
"eq": "≡",
|
|
17
|
+
"neq": "≠",
|
|
18
|
+
"in": "∈",
|
|
19
|
+
"nin": "∉",
|
|
20
|
+
"leq": "≤",
|
|
21
|
+
"geq": "≥",
|
|
22
|
+
"inrange": "\uD83D\uDD22"
|
|
23
|
+
};
|
|
24
|
+
const $2855bffe06ef7a03$var$ascending_token = "\uD83D\uDCC8";
|
|
25
|
+
const $2855bffe06ef7a03$var$descending_token = "\uD83D\uDCC9";
|
|
26
|
+
const $2855bffe06ef7a03$var$range_delimiter = "-";
|
|
27
|
+
const $2855bffe06ef7a03$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
28
|
+
const $2855bffe06ef7a03$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
29
|
+
const $2855bffe06ef7a03$var$empty_item_replacement = "0️⃣";
|
|
30
|
+
const $2855bffe06ef7a03$var$op_to_token = op => {
|
|
31
|
+
if (op === $2855bffe06ef7a03$var$fallback_operator) return $2855bffe06ef7a03$var$fallback_token;
|
|
32
|
+
return $2855bffe06ef7a03$var$operator_map[op];
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
36
|
+
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
37
|
+
* No deep or mixed nesting levels are supported.
|
|
38
|
+
*/
|
|
39
|
+
function $2855bffe06ef7a03$var$array_is_serializable(array) {
|
|
40
|
+
let is_root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
41
|
+
if (array.every(item => Array.isArray(item))) {
|
|
42
|
+
if (!is_root)
|
|
43
|
+
// Deeply nested arrays are not supported, but also don't exist as filters (yet)
|
|
44
|
+
return false;
|
|
45
|
+
return array.every(item => $2855bffe06ef7a03$var$array_is_serializable(item, false));
|
|
46
|
+
}
|
|
47
|
+
if (array.some(item => typeof item !== "string"))
|
|
48
|
+
// Numbers are not supported, since 1 and "1" would encode to the same thing
|
|
49
|
+
return false;
|
|
50
|
+
// Encoding reserved characters is not supported
|
|
51
|
+
return !array.some(item => item.includes($2855bffe06ef7a03$var$array_item_delimiter) || item.includes($2855bffe06ef7a03$var$string_item_delimiter) || item === $2855bffe06ef7a03$var$empty_item_replacement);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Human readable string[] or string[][] serialization for URLs.
|
|
55
|
+
* @param array
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
function $2855bffe06ef7a03$var$encode_array(array) {
|
|
59
|
+
const is_nested = array.every(item => Array.isArray(item));
|
|
60
|
+
if (is_nested) return array.map($2855bffe06ef7a03$var$encode_array).join($2855bffe06ef7a03$var$array_item_delimiter) + $2855bffe06ef7a03$var$array_item_delimiter; // Nested arrays require a suffix to close nesting levels
|
|
61
|
+
return array.map(item => item === "" ? $2855bffe06ef7a03$var$empty_item_replacement : item).join($2855bffe06ef7a03$var$string_item_delimiter);
|
|
62
|
+
}
|
|
63
|
+
function $2855bffe06ef7a03$var$decode_array(encoded_array) {
|
|
64
|
+
const is_nested = encoded_array.includes($2855bffe06ef7a03$var$array_item_delimiter);
|
|
65
|
+
if (is_nested) return encoded_array.split($2855bffe06ef7a03$var$array_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter
|
|
66
|
+
.map($2855bffe06ef7a03$var$decode_array);
|
|
67
|
+
return encoded_array.split($2855bffe06ef7a03$var$string_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter in the single item special case
|
|
68
|
+
.map(item => item === $2855bffe06ef7a03$var$empty_item_replacement ? "" : item);
|
|
69
|
+
}
|
|
70
|
+
function $2855bffe06ef7a03$var$encode_filter_data(op, data) {
|
|
71
|
+
if (data === "true")
|
|
72
|
+
// boolean encoding
|
|
73
|
+
return "1";
|
|
74
|
+
if (data === "false")
|
|
75
|
+
// boolean encoding
|
|
76
|
+
return "0";
|
|
77
|
+
const data_is_array = Array.isArray(data);
|
|
78
|
+
if (op === "inrange" && data_is_array && data.every(item => typeof item === "number"))
|
|
79
|
+
// numeric range filter encoding
|
|
80
|
+
return data.join($2855bffe06ef7a03$var$range_delimiter);
|
|
81
|
+
if (data_is_array && $2855bffe06ef7a03$var$array_is_serializable(data)) {
|
|
82
|
+
const encoded_data = $2855bffe06ef7a03$var$encode_array(data);
|
|
83
|
+
if (!encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter) && !encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter))
|
|
84
|
+
// A string[] with only one item will encode without delimiters, which is indistinguishable from a plain string during decoding
|
|
85
|
+
// In that case we add a delimiter suffix at the end
|
|
86
|
+
return encoded_data + $2855bffe06ef7a03$var$string_item_delimiter;
|
|
87
|
+
return encoded_data;
|
|
88
|
+
}
|
|
89
|
+
// Fallback encoding
|
|
90
|
+
return $b8hua$base64_encode_unicode(JSON.stringify(data));
|
|
91
|
+
}
|
|
92
|
+
function $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data) {
|
|
93
|
+
if (encoded_data === "1") return "true";
|
|
94
|
+
if (encoded_data === "0") return "false";
|
|
95
|
+
if (op === "inrange" && encoded_data.includes($2855bffe06ef7a03$var$range_delimiter)) return encoded_data.split($2855bffe06ef7a03$var$range_delimiter).map(x => parseFloat(x));
|
|
96
|
+
if (encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter) || encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter)) return $2855bffe06ef7a03$var$decode_array(encoded_data);
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse($b8hua$base64_decode_unicode(encoded_data));
|
|
99
|
+
} catch (e) {
|
|
100
|
+
$b8hua$dlog("Failed to fallback parse filter data", op, encoded_data, e);
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
function $2855bffe06ef7a03$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
105
|
+
for (const filter of filters) {
|
|
106
|
+
const {
|
|
107
|
+
field: field,
|
|
108
|
+
op: op,
|
|
109
|
+
data: data
|
|
110
|
+
} = filter;
|
|
111
|
+
const encoded_data = $2855bffe06ef7a03$var$encode_filter_data(op, data);
|
|
112
|
+
search_params.set(filter_query_param_prefix + field + $2855bffe06ef7a03$var$op_to_token(op), encoded_data);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function $2855bffe06ef7a03$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
116
|
+
const found_filters = [];
|
|
117
|
+
for (const key of search_params.keys()) {
|
|
118
|
+
// Allow for backwards compatibility with the old filter query param prefix
|
|
119
|
+
let chosen_prefix = filter_query_param_prefix;
|
|
120
|
+
if (!key.startsWith(chosen_prefix)) {
|
|
121
|
+
chosen_prefix = $2855bffe06ef7a03$var$legacy_filter_prefix;
|
|
122
|
+
if (!key.startsWith(chosen_prefix)) continue;
|
|
123
|
+
}
|
|
124
|
+
const encoded_data = search_params.get(key);
|
|
125
|
+
if (!encoded_data) continue;
|
|
126
|
+
const [op, token] = Object.entries($2855bffe06ef7a03$var$operator_map).find(_ref => {
|
|
127
|
+
let [, token] = _ref;
|
|
128
|
+
return key.endsWith(token);
|
|
129
|
+
}) || [$2855bffe06ef7a03$var$fallback_operator, $2855bffe06ef7a03$var$fallback_token];
|
|
130
|
+
const data = $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data);
|
|
131
|
+
if (!data) continue;
|
|
132
|
+
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
133
|
+
found_filters.push({
|
|
134
|
+
field: field,
|
|
135
|
+
op: op,
|
|
136
|
+
data: data
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return found_filters;
|
|
140
|
+
}
|
|
141
|
+
function $2855bffe06ef7a03$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
142
|
+
if (!sorting) return;
|
|
143
|
+
const {
|
|
144
|
+
field: field,
|
|
145
|
+
order: order
|
|
146
|
+
} = sorting;
|
|
147
|
+
const ascending = order === "asc";
|
|
148
|
+
search_params.set(sorting_query_param, field + (ascending ? $2855bffe06ef7a03$var$ascending_token : $2855bffe06ef7a03$var$descending_token));
|
|
149
|
+
}
|
|
150
|
+
function $2855bffe06ef7a03$export$766e9676e74997d3(search_params, sorting_query_param_) {
|
|
151
|
+
const encoded_sorting = search_params.get(sorting_query_param_);
|
|
152
|
+
if (!encoded_sorting) return;
|
|
153
|
+
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$ascending_token)) return {
|
|
154
|
+
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$ascending_token.length),
|
|
155
|
+
order: "asc"
|
|
156
|
+
};
|
|
157
|
+
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$descending_token)) return {
|
|
158
|
+
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$descending_token.length),
|
|
159
|
+
order: "desc"
|
|
160
|
+
};
|
|
161
|
+
$b8hua$dlog("Invalid sorting query param value", encoded_sorting);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
function $2855bffe06ef7a03$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
165
|
+
// We'll be modifying the URLSearchParams object, so we need to make a copy of the keys first
|
|
166
|
+
const keys = [...search_params.keys()];
|
|
167
|
+
for (const key of keys) if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($2855bffe06ef7a03$var$legacy_filter_prefix)) search_params.delete(key);
|
|
168
|
+
}
|
|
169
|
+
const $2855bffe06ef7a03$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
170
|
+
function $2855bffe06ef7a03$export$43cd1e747fecd42e(_ref2) {
|
|
171
|
+
let {
|
|
172
|
+
to_url_: to_url_,
|
|
173
|
+
set_clearing_flag_: set_clearing_flag_,
|
|
174
|
+
from_search_params_ = new URLSearchParams(location.search),
|
|
175
|
+
sorting_query_param_: sorting_query_param_,
|
|
176
|
+
filter_query_param_prefix_: filter_query_param_prefix_
|
|
177
|
+
} = _ref2;
|
|
178
|
+
if (!to_url_) return to_url_;
|
|
179
|
+
const was_url_object = to_url_ instanceof URL;
|
|
180
|
+
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
181
|
+
const {
|
|
182
|
+
searchParams: searchParams
|
|
183
|
+
} = url_object;
|
|
184
|
+
if (set_clearing_flag_) searchParams.set($2855bffe06ef7a03$export$cf5feb2102aec7f2, "true");
|
|
185
|
+
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
186
|
+
for (const key of from_search_params_.keys()) if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
187
|
+
if (was_url_object) return url_object;
|
|
188
|
+
return url_object.href;
|
|
189
|
+
}
|
|
12
190
|
const $5441862cd2f5e111$var$ListingContext = /*@__PURE__*/$b8hua$createContext();
|
|
13
191
|
function $5441862cd2f5e111$export$e68cff63f76bd15b(props) {
|
|
14
192
|
const our_object = {};
|
|
@@ -979,6 +1157,14 @@ function $9783d437ad61594c$export$3b621d86b1566b2() {
|
|
|
979
1157
|
"viewBox": "0 0 21.064 21.064"
|
|
980
1158
|
}), () => $b8hua$ssr($9783d437ad61594c$var$_tmpl$), true);
|
|
981
1159
|
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* Lower cases a string if possible. Mostly used to make the filter url values case-insensitive.
|
|
1163
|
+
*/
|
|
1164
|
+
function $af5d8e0b7d97a7f6$export$325f75597868c4f0(stuff) {
|
|
1165
|
+
if (typeof stuff !== "string") return stuff;
|
|
1166
|
+
return stuff.toLowerCase();
|
|
1167
|
+
}
|
|
982
1168
|
const $4711a82d08d2021b$var$_tmpl$ = ["<button", ' class="clear-all-filters minor">', "</button>"],
|
|
983
1169
|
$4711a82d08d2021b$var$_tmpl$2 = ["<div", ' class="inner"><span class="title"><!--#-->', "<!--/-->: </span><!--#-->", "<!--/--></div>"],
|
|
984
1170
|
$4711a82d08d2021b$var$_tmpl$3 = ["<button", ' class="clear-filter major"><!--#-->', "<!--/--><span><!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--> – <!--#-->", "<!--/--><!--#-->", "<!--/--><!--#-->", "<!--/--></span></button>"],
|
|
@@ -1046,7 +1232,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1046
1232
|
let created_an_object = false;
|
|
1047
1233
|
for (let j = 0; j < value.length; j++) {
|
|
1048
1234
|
var _pointer;
|
|
1049
|
-
const this_categories_name = value[j];
|
|
1235
|
+
const this_categories_name = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value[j]);
|
|
1050
1236
|
const obj = (_pointer = pointer)[this_categories_name] || (_pointer[this_categories_name] = (() => {
|
|
1051
1237
|
const value_as_string = value.map(v => typeof v === "number" ? v + "" : v); // don't think backend will ever send numbers but technically it's allowed;
|
|
1052
1238
|
const created_obj = {
|
|
@@ -1120,7 +1306,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1120
1306
|
var _meta, _meta$values;
|
|
1121
1307
|
const sel_d = selected_data();
|
|
1122
1308
|
return (_meta = meta()) === null || _meta === void 0 ? void 0 : (_meta$values = _meta.values) === null || _meta$values === void 0 ? void 0 : _meta$values.findIndex(value => {
|
|
1123
|
-
return value === sel_d || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => sel_d[index] === item);
|
|
1309
|
+
return $af5d8e0b7d97a7f6$export$325f75597868c4f0(value) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(sel_d) || Array.isArray(value) && Array.isArray(sel_d) && value.length === sel_d.length && value.every((item, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(sel_d[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(item));
|
|
1124
1310
|
});
|
|
1125
1311
|
});
|
|
1126
1312
|
const name = $b8hua$createMemo(() => {
|
|
@@ -1136,7 +1322,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1136
1322
|
let pointer = structure;
|
|
1137
1323
|
for (const step of selected_data()) {
|
|
1138
1324
|
var _pointer2, _we_in_structure;
|
|
1139
|
-
we_in_structure = (_pointer2 = pointer) === null || _pointer2 === void 0 ? void 0 : _pointer2[step];
|
|
1325
|
+
we_in_structure = (_pointer2 = pointer) === null || _pointer2 === void 0 ? void 0 : _pointer2[$af5d8e0b7d97a7f6$export$325f75597868c4f0(step)];
|
|
1140
1326
|
pointer = (_we_in_structure = we_in_structure) === null || _we_in_structure === void 0 ? void 0 : _we_in_structure.children_;
|
|
1141
1327
|
}
|
|
1142
1328
|
return we_in_structure;
|
|
@@ -1151,7 +1337,7 @@ function $4711a82d08d2021b$export$fecbb157621501bd(_ref) {
|
|
|
1151
1337
|
let {
|
|
1152
1338
|
value_: value_
|
|
1153
1339
|
} = _ref2;
|
|
1154
|
-
return (_iterable_selected_fi = iterable_selected_filter_data()) === null || _iterable_selected_fi === void 0 ? void 0 : _iterable_selected_fi.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => v[index] === val));
|
|
1340
|
+
return (_iterable_selected_fi = iterable_selected_filter_data()) === null || _iterable_selected_fi === void 0 ? void 0 : _iterable_selected_fi.some(v => Array.isArray(v) && v.length === value_.length && value_.every((val, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(v[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(val)));
|
|
1155
1341
|
});
|
|
1156
1342
|
return false;
|
|
1157
1343
|
});
|
|
@@ -1270,6 +1456,12 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
1270
1456
|
});
|
|
1271
1457
|
const render_checkbox = checkbox => {
|
|
1272
1458
|
// Checkbox always calls the getters in props, so we don't wrap these values into memos
|
|
1459
|
+
const is_checked = $b8hua$createMemo(() => {
|
|
1460
|
+
var _existing_filter;
|
|
1461
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
1462
|
+
const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
|
|
1463
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
|
|
1464
|
+
});
|
|
1273
1465
|
return $b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
1274
1466
|
get value_() {
|
|
1275
1467
|
return checkbox().value_;
|
|
@@ -1281,8 +1473,7 @@ function $133484ef10e4e954$export$dd948f91abc3a1c4(_ref) {
|
|
|
1281
1473
|
return checkbox().count_;
|
|
1282
1474
|
},
|
|
1283
1475
|
get checked_() {
|
|
1284
|
-
|
|
1285
|
-
return (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : (_existing_filter$data = _existing_filter.data) === null || _existing_filter$data === void 0 ? void 0 : _existing_filter$data.includes(checkbox().value_);
|
|
1476
|
+
return is_checked();
|
|
1286
1477
|
}
|
|
1287
1478
|
});
|
|
1288
1479
|
};
|
|
@@ -1369,7 +1560,7 @@ function $b54fc842e721c9eb$export$430444115f70a734(_ref) {
|
|
|
1369
1560
|
var _existing_filter;
|
|
1370
1561
|
const v = value();
|
|
1371
1562
|
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
1372
|
-
if (data === v) return true;
|
|
1563
|
+
if ($af5d8e0b7d97a7f6$export$325f75597868c4f0(data) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(v)) return true;
|
|
1373
1564
|
return Array.isArray(data) && data.every((item, index) => item === v[index]);
|
|
1374
1565
|
})(), true), $b8hua$escape($b8hua$createMemo(() => {
|
|
1375
1566
|
var _filter_$meta, _filter_$meta$names;
|
|
@@ -1948,7 +2139,7 @@ function $0ae614c5c7babb43$var$create_updating_signal(_ref3) {
|
|
|
1948
2139
|
var _existing_filter_$dat, _existing_filter_$dat2;
|
|
1949
2140
|
// wait for the children to have populated and us to have received the correct value_ and name_ values
|
|
1950
2141
|
let updating_blocked = false;
|
|
1951
|
-
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => self_.value_[index] === sub_el));
|
|
2142
|
+
const index_of_us_in_selected_filter = existing_filter_ === null || existing_filter_ === void 0 ? void 0 : (_existing_filter_$dat = existing_filter_.data) === null || _existing_filter_$dat === void 0 ? void 0 : (_existing_filter_$dat2 = _existing_filter_$dat.findIndex) === null || _existing_filter_$dat2 === void 0 ? void 0 : _existing_filter_$dat2.call(_existing_filter_$dat, el => el.length === self_.value_.length && el.every((sub_el, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(self_.value_[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(sub_el)));
|
|
1952
2143
|
signal_.push(...$b8hua$createSignal(index_of_us_in_selected_filter >= 0));
|
|
1953
2144
|
const [read_checked, write_checked] = signal_;
|
|
1954
2145
|
const child_objects = Object.values(self_.children_);
|
|
@@ -2135,8 +2326,10 @@ const $830ea8efda59884e$export$414f6a19d38e655c = _ref => {
|
|
|
2135
2326
|
},
|
|
2136
2327
|
children: value => {
|
|
2137
2328
|
const is_selected = $b8hua$createMemo(() => {
|
|
2138
|
-
var _existing_filter
|
|
2139
|
-
|
|
2329
|
+
var _existing_filter;
|
|
2330
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
2331
|
+
const current_value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(value().value_);
|
|
2332
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === current_value));
|
|
2140
2333
|
});
|
|
2141
2334
|
const MakeButton = attributes => $b8hua$ssrElement("button", () => ({
|
|
2142
2335
|
...attributes,
|
|
@@ -2235,16 +2428,6 @@ function $830ea8efda59884e$var$adjust_sizes(container_width, sizes, set_cols_at_
|
|
|
2235
2428
|
overrides: column_to_row_result
|
|
2236
2429
|
}]]);
|
|
2237
2430
|
}
|
|
2238
|
-
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
2239
|
-
const signal = $b8hua$createSignal(false);
|
|
2240
|
-
$b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
|
|
2241
|
-
let {
|
|
2242
|
-
matches: matches
|
|
2243
|
-
} = _ref;
|
|
2244
|
-
return signal[1](matches);
|
|
2245
|
-
}).remove);
|
|
2246
|
-
return signal[0];
|
|
2247
|
-
}
|
|
2248
2431
|
const $2cb856c297c53e6c$var$_tmpl$ = ["<form", ' class="checkbox-color"><!--#-->', "<!--/--><!--#-->", "<!--/--></form>"];
|
|
2249
2432
|
const $2cb856c297c53e6c$var$max_visible_without_collapsing = 30;
|
|
2250
2433
|
const $2cb856c297c53e6c$var$show_non_collapsible_when_collapsed = 8;
|
|
@@ -2255,7 +2438,6 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
2255
2438
|
i18n_: i18n_,
|
|
2256
2439
|
view_more_button_below_group_: [_get_view_more_button_below_group_, set_view_more_button_below_group_]
|
|
2257
2440
|
} = _ref;
|
|
2258
|
-
const supports_hover = $00a5b94f0c11efbb$export$d9f36cf74e24d595("not all and (hover: none)");
|
|
2259
2441
|
// same as in CheckboxFilter, maybe we should make this DRY at some point
|
|
2260
2442
|
const existing_filter = $b8hua$createMemo(() => {
|
|
2261
2443
|
const {
|
|
@@ -2293,6 +2475,12 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
2293
2475
|
});
|
|
2294
2476
|
const rgb_color = $b8hua$createMemo(() => $b8hua$hex_to_rgb(hex_color()));
|
|
2295
2477
|
const black_contrast_better = $b8hua$createMemo(() => rgb_color() ? $2cb856c297c53e6c$var$does_black_contrast_better(rgb_color()) : false);
|
|
2478
|
+
const is_checked = $b8hua$createMemo(() => {
|
|
2479
|
+
var _existing_filter;
|
|
2480
|
+
const data = (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : _existing_filter.data;
|
|
2481
|
+
const value = $af5d8e0b7d97a7f6$export$325f75597868c4f0(checkbox().value_);
|
|
2482
|
+
return !!(data !== null && data !== void 0 && data.some(item => $af5d8e0b7d97a7f6$export$325f75597868c4f0(item) === value));
|
|
2483
|
+
});
|
|
2296
2484
|
const input_row = $b8hua$createComponent((0, $19e828709c7723a0$export$48513f6b9f8ce62d), {
|
|
2297
2485
|
get value_() {
|
|
2298
2486
|
return checkbox().value_;
|
|
@@ -2304,8 +2492,7 @@ function $2cb856c297c53e6c$export$82ed4b28ecb67608(_ref) {
|
|
|
2304
2492
|
return checkbox().count_;
|
|
2305
2493
|
},
|
|
2306
2494
|
get checked_() {
|
|
2307
|
-
|
|
2308
|
-
return (_existing_filter = existing_filter()) === null || _existing_filter === void 0 ? void 0 : (_existing_filter$data = _existing_filter.data) === null || _existing_filter$data === void 0 ? void 0 : _existing_filter$data.includes(checkbox().value_);
|
|
2495
|
+
return is_checked();
|
|
2309
2496
|
},
|
|
2310
2497
|
custom_indicator_ref: span => {
|
|
2311
2498
|
const {
|
|
@@ -2461,7 +2648,7 @@ function $d0ff304c14f50521$export$53c59af873b303c9(_ref) {
|
|
|
2461
2648
|
break try_specific;
|
|
2462
2649
|
}
|
|
2463
2650
|
const needle = data_is_array ? data[0] : data;
|
|
2464
|
-
const index_in_meta = meta.values.findIndex(value => needle === value || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => needle[index] === item));
|
|
2651
|
+
const index_in_meta = meta.values.findIndex(value => $af5d8e0b7d97a7f6$export$325f75597868c4f0(needle) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(value) || Array.isArray(needle) && Array.isArray(value) && needle.length === value.length && value.every((item, index) => $af5d8e0b7d97a7f6$export$325f75597868c4f0(needle[index]) === $af5d8e0b7d97a7f6$export$325f75597868c4f0(item)));
|
|
2465
2652
|
return ((_names = meta.names) === null || _names === void 0 ? void 0 : _names[index_in_meta]) || ((_values = meta.values) === null || _values === void 0 ? void 0 : _values[index_in_meta]);
|
|
2466
2653
|
}
|
|
2467
2654
|
}
|
|
@@ -2977,7 +3164,8 @@ function $972f6bce0f9d61be$export$e183a13865960371(params_to_default_value, rout
|
|
|
2977
3164
|
const signals = {};
|
|
2978
3165
|
const entries = Object.entries(params_to_default_value);
|
|
2979
3166
|
const event_handler = $b8hua$catchify((what_happened, args) => {
|
|
2980
|
-
|
|
3167
|
+
// Intentionally always update our signals to the history state to allow external control of SDK state for doing things like https://linear.app/depictai/issue/X-1432/is-this-possible-with-the-depict-sdk
|
|
3168
|
+
$972f6bce0f9d61be$var$history_state_change(signals, entries, what_happened === "popstate" ? args.state : history.state);
|
|
2981
3169
|
});
|
|
2982
3170
|
// createRenderEffect because we need the instant execution so the signals always contain values, even before solid's render phase
|
|
2983
3171
|
$b8hua$createRenderEffect(() => {
|
|
@@ -3411,6 +3599,16 @@ async function $284849364a6ef73a$var$_cached_post_request2(endpoint, input_req,
|
|
|
3411
3599
|
delete cache_obj.in_progress_[body];
|
|
3412
3600
|
}
|
|
3413
3601
|
}
|
|
3602
|
+
function $00a5b94f0c11efbb$export$d9f36cf74e24d595(media_query) {
|
|
3603
|
+
const signal = $b8hua$createSignal(false);
|
|
3604
|
+
$b8hua$onCleanup($b8hua$javascript_media_query(media_query, _ref => {
|
|
3605
|
+
let {
|
|
3606
|
+
matches: matches
|
|
3607
|
+
} = _ref;
|
|
3608
|
+
return signal[1](matches);
|
|
3609
|
+
}).remove);
|
|
3610
|
+
return signal[0];
|
|
3611
|
+
}
|
|
3414
3612
|
const $9b5022ae72f56399$var$get_available_range = (available_filters_, search_for_field) => {
|
|
3415
3613
|
var _untrack, _untrack$find;
|
|
3416
3614
|
const maybe_meta = (_untrack = $b8hua$untrack(available_filters_)) === null || _untrack === void 0 ? void 0 : (_untrack$find = _untrack.find(_ref => {
|
|
@@ -4709,184 +4907,6 @@ function $6a16b21155984cef$var$ActualFloatingButtons(_ref2) {
|
|
|
4709
4907
|
}));
|
|
4710
4908
|
return $b8hua$ssr($6a16b21155984cef$var$_tmpl$, $b8hua$ssrHydrationKey(), "floating-buttons ".concat(is_scrolling_upwards() && modal_is_closed() && !regular_buttons_are_in_view() && !get_is_showing_toast() ? "show-them" : ""), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.filter_text_(), true), false), $b8hua$escape($b8hua$createComponent((0, $05f67356defcdd65$export$28f6150e232898de), {})), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.sorting_text_(), true), false), ((_current_sorting_$ = current_sorting_[0]()) === null || _current_sorting_$ === void 0 ? void 0 : _current_sorting_$.order) === "asc" ? $b8hua$escape($b8hua$createComponent((0, $79af35736fe8e5c8$export$da32f7add8a22e86), {})) : $b8hua$escape($b8hua$createComponent((0, $73e3c96bc365e0e9$export$d10e63059ddb9fd4), {})), $b8hua$ssrAttribute("aria-label", $b8hua$escape(i18n_.scroll_to_top_(), true), false), $b8hua$escape($b8hua$createComponent((0, $70f5ae4deea73eee$export$2624c5890f1bbcf7), {})));
|
|
4711
4909
|
}
|
|
4712
|
-
const $2855bffe06ef7a03$var$fallback_operator = "in";
|
|
4713
|
-
const $2855bffe06ef7a03$var$fallback_token = "";
|
|
4714
|
-
const $2855bffe06ef7a03$var$legacy_filter_prefix = "filter_";
|
|
4715
|
-
const $2855bffe06ef7a03$var$operator_map = {
|
|
4716
|
-
"eq": "≡",
|
|
4717
|
-
"neq": "≠",
|
|
4718
|
-
"in": "∈",
|
|
4719
|
-
"nin": "∉",
|
|
4720
|
-
"leq": "≤",
|
|
4721
|
-
"geq": "≥",
|
|
4722
|
-
"inrange": "\uD83D\uDD22"
|
|
4723
|
-
};
|
|
4724
|
-
const $2855bffe06ef7a03$var$ascending_token = "\uD83D\uDCC8";
|
|
4725
|
-
const $2855bffe06ef7a03$var$descending_token = "\uD83D\uDCC9";
|
|
4726
|
-
const $2855bffe06ef7a03$var$range_delimiter = "-";
|
|
4727
|
-
const $2855bffe06ef7a03$var$string_item_delimiter = "‚"; // This is not a comma but a comma-like character that browsers will render in the URL bar.
|
|
4728
|
-
const $2855bffe06ef7a03$var$array_item_delimiter = "‣"; // FIXME: decide on a character. Could theoretically be a double string delimiter.
|
|
4729
|
-
const $2855bffe06ef7a03$var$empty_item_replacement = "0️⃣";
|
|
4730
|
-
const $2855bffe06ef7a03$var$op_to_token = op => {
|
|
4731
|
-
if (op === $2855bffe06ef7a03$var$fallback_operator) return $2855bffe06ef7a03$var$fallback_token;
|
|
4732
|
-
return $2855bffe06ef7a03$var$operator_map[op];
|
|
4733
|
-
};
|
|
4734
|
-
/**
|
|
4735
|
-
* Checks if a given array of filter data can be neatly serialized into an URL query parameter, or if it should fall back to JSON+base64.
|
|
4736
|
-
* The requirements are either an array of strings, containing no reserved characters, or an array of arrays of strings, containing no reserved characters.
|
|
4737
|
-
* No deep or mixed nesting levels are supported.
|
|
4738
|
-
*/
|
|
4739
|
-
function $2855bffe06ef7a03$var$array_is_serializable(array) {
|
|
4740
|
-
let is_root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
4741
|
-
if (array.every(item => Array.isArray(item))) {
|
|
4742
|
-
if (!is_root)
|
|
4743
|
-
// Deeply nested arrays are not supported, but also don't exist as filters (yet)
|
|
4744
|
-
return false;
|
|
4745
|
-
return array.every(item => $2855bffe06ef7a03$var$array_is_serializable(item, false));
|
|
4746
|
-
}
|
|
4747
|
-
if (array.some(item => typeof item !== "string"))
|
|
4748
|
-
// Numbers are not supported, since 1 and "1" would encode to the same thing
|
|
4749
|
-
return false;
|
|
4750
|
-
// Encoding reserved characters is not supported
|
|
4751
|
-
return !array.some(item => item.includes($2855bffe06ef7a03$var$array_item_delimiter) || item.includes($2855bffe06ef7a03$var$string_item_delimiter) || item === $2855bffe06ef7a03$var$empty_item_replacement);
|
|
4752
|
-
}
|
|
4753
|
-
/**
|
|
4754
|
-
* Human readable string[] or string[][] serialization for URLs.
|
|
4755
|
-
* @param array
|
|
4756
|
-
* @returns
|
|
4757
|
-
*/
|
|
4758
|
-
function $2855bffe06ef7a03$var$encode_array(array) {
|
|
4759
|
-
const is_nested = array.every(item => Array.isArray(item));
|
|
4760
|
-
if (is_nested) return array.map($2855bffe06ef7a03$var$encode_array).join($2855bffe06ef7a03$var$array_item_delimiter) + $2855bffe06ef7a03$var$array_item_delimiter; // Nested arrays require a suffix to close nesting levels
|
|
4761
|
-
return array.map(item => item === "" ? $2855bffe06ef7a03$var$empty_item_replacement : item).join($2855bffe06ef7a03$var$string_item_delimiter);
|
|
4762
|
-
}
|
|
4763
|
-
function $2855bffe06ef7a03$var$decode_array(encoded_array) {
|
|
4764
|
-
const is_nested = encoded_array.includes($2855bffe06ef7a03$var$array_item_delimiter);
|
|
4765
|
-
if (is_nested) return encoded_array.split($2855bffe06ef7a03$var$array_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter
|
|
4766
|
-
.map($2855bffe06ef7a03$var$decode_array);
|
|
4767
|
-
return encoded_array.split($2855bffe06ef7a03$var$string_item_delimiter).filter(s => s !== "") // Remove empty segments, caused by trailing delimiter in the single item special case
|
|
4768
|
-
.map(item => item === $2855bffe06ef7a03$var$empty_item_replacement ? "" : item);
|
|
4769
|
-
}
|
|
4770
|
-
function $2855bffe06ef7a03$var$encode_filter_data(op, data) {
|
|
4771
|
-
if (data === "true")
|
|
4772
|
-
// boolean encoding
|
|
4773
|
-
return "1";
|
|
4774
|
-
if (data === "false")
|
|
4775
|
-
// boolean encoding
|
|
4776
|
-
return "0";
|
|
4777
|
-
const data_is_array = Array.isArray(data);
|
|
4778
|
-
if (op === "inrange" && data_is_array && data.every(item => typeof item === "number"))
|
|
4779
|
-
// numeric range filter encoding
|
|
4780
|
-
return data.join($2855bffe06ef7a03$var$range_delimiter);
|
|
4781
|
-
if (data_is_array && $2855bffe06ef7a03$var$array_is_serializable(data)) {
|
|
4782
|
-
const encoded_data = $2855bffe06ef7a03$var$encode_array(data);
|
|
4783
|
-
if (!encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter) && !encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter))
|
|
4784
|
-
// A string[] with only one item will encode without delimiters, which is indistinguishable from a plain string during decoding
|
|
4785
|
-
// In that case we add a delimiter suffix at the end
|
|
4786
|
-
return encoded_data + $2855bffe06ef7a03$var$string_item_delimiter;
|
|
4787
|
-
return encoded_data;
|
|
4788
|
-
}
|
|
4789
|
-
// Fallback encoding
|
|
4790
|
-
return $b8hua$base64_encode_unicode(JSON.stringify(data));
|
|
4791
|
-
}
|
|
4792
|
-
function $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data) {
|
|
4793
|
-
if (encoded_data === "1") return "true";
|
|
4794
|
-
if (encoded_data === "0") return "false";
|
|
4795
|
-
if (op === "inrange" && encoded_data.includes($2855bffe06ef7a03$var$range_delimiter)) return encoded_data.split($2855bffe06ef7a03$var$range_delimiter).map(x => parseFloat(x));
|
|
4796
|
-
if (encoded_data.includes($2855bffe06ef7a03$var$string_item_delimiter) || encoded_data.includes($2855bffe06ef7a03$var$array_item_delimiter)) return $2855bffe06ef7a03$var$decode_array(encoded_data);
|
|
4797
|
-
try {
|
|
4798
|
-
return JSON.parse($b8hua$base64_decode_unicode(encoded_data));
|
|
4799
|
-
} catch (e) {
|
|
4800
|
-
$b8hua$dlog("Failed to fallback parse filter data", op, encoded_data, e);
|
|
4801
|
-
}
|
|
4802
|
-
return null;
|
|
4803
|
-
}
|
|
4804
|
-
function $2855bffe06ef7a03$export$58aa3f171519b6d7(filters, search_params, filter_query_param_prefix) {
|
|
4805
|
-
for (const filter of filters) {
|
|
4806
|
-
const {
|
|
4807
|
-
field: field,
|
|
4808
|
-
op: op,
|
|
4809
|
-
data: data
|
|
4810
|
-
} = filter;
|
|
4811
|
-
const encoded_data = $2855bffe06ef7a03$var$encode_filter_data(op, data);
|
|
4812
|
-
search_params.set(filter_query_param_prefix + field + $2855bffe06ef7a03$var$op_to_token(op), encoded_data);
|
|
4813
|
-
}
|
|
4814
|
-
}
|
|
4815
|
-
function $2855bffe06ef7a03$export$f934fa24c3a86811(search_params, filter_query_param_prefix) {
|
|
4816
|
-
const found_filters = [];
|
|
4817
|
-
for (const key of search_params.keys()) {
|
|
4818
|
-
// Allow for backwards compatibility with the old filter query param prefix
|
|
4819
|
-
let chosen_prefix = filter_query_param_prefix;
|
|
4820
|
-
if (!key.startsWith(chosen_prefix)) {
|
|
4821
|
-
chosen_prefix = $2855bffe06ef7a03$var$legacy_filter_prefix;
|
|
4822
|
-
if (!key.startsWith(chosen_prefix)) continue;
|
|
4823
|
-
}
|
|
4824
|
-
const encoded_data = search_params.get(key);
|
|
4825
|
-
if (!encoded_data) continue;
|
|
4826
|
-
const [op, token] = Object.entries($2855bffe06ef7a03$var$operator_map).find(_ref => {
|
|
4827
|
-
let [, token] = _ref;
|
|
4828
|
-
return key.endsWith(token);
|
|
4829
|
-
}) || [$2855bffe06ef7a03$var$fallback_operator, $2855bffe06ef7a03$var$fallback_token];
|
|
4830
|
-
const data = $2855bffe06ef7a03$var$decode_filter_data(op, encoded_data);
|
|
4831
|
-
if (!data) continue;
|
|
4832
|
-
const field = key.slice(chosen_prefix.length, token ? -token.length : undefined);
|
|
4833
|
-
found_filters.push({
|
|
4834
|
-
field: field,
|
|
4835
|
-
op: op,
|
|
4836
|
-
data: data
|
|
4837
|
-
});
|
|
4838
|
-
}
|
|
4839
|
-
return found_filters;
|
|
4840
|
-
}
|
|
4841
|
-
function $2855bffe06ef7a03$export$62acb285a7579555(sorting, search_params, sorting_query_param) {
|
|
4842
|
-
if (!sorting) return;
|
|
4843
|
-
const {
|
|
4844
|
-
field: field,
|
|
4845
|
-
order: order
|
|
4846
|
-
} = sorting;
|
|
4847
|
-
const ascending = order === "asc";
|
|
4848
|
-
search_params.set(sorting_query_param, field + (ascending ? $2855bffe06ef7a03$var$ascending_token : $2855bffe06ef7a03$var$descending_token));
|
|
4849
|
-
}
|
|
4850
|
-
function $2855bffe06ef7a03$export$766e9676e74997d3(search_params, sorting_query_param_) {
|
|
4851
|
-
const encoded_sorting = search_params.get(sorting_query_param_);
|
|
4852
|
-
if (!encoded_sorting) return;
|
|
4853
|
-
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$ascending_token)) return {
|
|
4854
|
-
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$ascending_token.length),
|
|
4855
|
-
order: "asc"
|
|
4856
|
-
};
|
|
4857
|
-
if (encoded_sorting.endsWith($2855bffe06ef7a03$var$descending_token)) return {
|
|
4858
|
-
field: encoded_sorting.slice(0, -$2855bffe06ef7a03$var$descending_token.length),
|
|
4859
|
-
order: "desc"
|
|
4860
|
-
};
|
|
4861
|
-
$b8hua$dlog("Invalid sorting query param value", encoded_sorting);
|
|
4862
|
-
return;
|
|
4863
|
-
}
|
|
4864
|
-
function $2855bffe06ef7a03$export$916e6850778505f6(search_params, filter_query_param_prefix, sorting_query_param) {
|
|
4865
|
-
// We'll be modifying the URLSearchParams object, so we need to make a copy of the keys first
|
|
4866
|
-
const keys = [...search_params.keys()];
|
|
4867
|
-
for (const key of keys) if (key.startsWith(filter_query_param_prefix) || key === sorting_query_param || key.startsWith($2855bffe06ef7a03$var$legacy_filter_prefix)) search_params.delete(key);
|
|
4868
|
-
}
|
|
4869
|
-
const $2855bffe06ef7a03$export$cf5feb2102aec7f2 = "went_sideways_clear_filters";
|
|
4870
|
-
function $2855bffe06ef7a03$export$43cd1e747fecd42e(_ref2) {
|
|
4871
|
-
let {
|
|
4872
|
-
to_url_: to_url_,
|
|
4873
|
-
set_clearing_flag_: set_clearing_flag_,
|
|
4874
|
-
from_search_params_ = new URLSearchParams(location.search),
|
|
4875
|
-
sorting_query_param_: sorting_query_param_,
|
|
4876
|
-
filter_query_param_prefix_: filter_query_param_prefix_
|
|
4877
|
-
} = _ref2;
|
|
4878
|
-
if (!to_url_) return to_url_;
|
|
4879
|
-
const was_url_object = to_url_ instanceof URL;
|
|
4880
|
-
const url_object = was_url_object ? to_url_ : new URL(to_url_, location.origin);
|
|
4881
|
-
const {
|
|
4882
|
-
searchParams: searchParams
|
|
4883
|
-
} = url_object;
|
|
4884
|
-
if (set_clearing_flag_) searchParams.set($2855bffe06ef7a03$export$cf5feb2102aec7f2, "true");
|
|
4885
|
-
if (from_search_params_.has(sorting_query_param_)) searchParams.set(sorting_query_param_, from_search_params_.get(sorting_query_param_));
|
|
4886
|
-
for (const key of from_search_params_.keys()) if (key.startsWith(filter_query_param_prefix_)) searchParams.set(key, from_search_params_.get(key));
|
|
4887
|
-
if (was_url_object) return url_object;
|
|
4888
|
-
return url_object.href;
|
|
4889
|
-
}
|
|
4890
4910
|
const $52efc9ae4382e25a$var$_tmpl$ = ["<nav", ' class="crumbs"', ">", "</nav>"],
|
|
4891
4911
|
$52efc9ae4382e25a$var$_tmpl$2 = ["<a", ' class="crumb"', ">", "</a>"],
|
|
4892
4912
|
$52efc9ae4382e25a$var$_tmpl$3 = ["<span", ' class="separator">', "</span>"];
|
|
@@ -9792,7 +9812,7 @@ function $f9fd3017c20b774a$var$_get_rendered_recs2() {
|
|
|
9792
9812
|
}
|
|
9793
9813
|
function $f9fd3017c20b774a$var$_empty_page_bugfix2() {
|
|
9794
9814
|
// Called when a "page" is "opened" using PageReplacer
|
|
9795
|
-
const on_maybe_popstate = what_happened => {
|
|
9815
|
+
const on_maybe_popstate = $b8hua$catchify(what_happened => {
|
|
9796
9816
|
if (what_happened !== "popstate") return;
|
|
9797
9817
|
const cleaned_current_url = $f9fd3017c20b774a$var$clean_url(location.href);
|
|
9798
9818
|
if (!$f9fd3017c20b774a$var$_classStaticPrivateFieldSpecGet($f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$var$_visited_urls).has(cleaned_current_url)) {
|
|
@@ -9821,7 +9841,7 @@ function $f9fd3017c20b774a$var$_empty_page_bugfix2() {
|
|
|
9821
9841
|
$f9fd3017c20b774a$var$_classStaticPrivateFieldSpecSet($f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$export$3ccaa27d81dd8556, $f9fd3017c20b774a$var$_reverting_permitted, false); // Disallow any reverting since we can't - it would flash a white page until the reload has finished.
|
|
9822
9842
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f9fd3017c20b774a$var$_unload).call(this); // Call unload to "kill" the solid-js stuff quicker so that it stops updating - the user is expecting the next thing that happens to be a navigation to the actual page the URL says they're on.
|
|
9823
9843
|
}
|
|
9824
|
-
};
|
|
9844
|
+
});
|
|
9825
9845
|
|
|
9826
9846
|
(0, $b8hua$instant_exec_on_suspect_history_change).add(on_maybe_popstate);
|
|
9827
9847
|
$b8hua$babelruntimehelpersclassPrivateFieldGet(this, $f9fd3017c20b774a$var$_revert_fns).push(() => (0, $b8hua$instant_exec_on_suspect_history_change).delete(on_maybe_popstate)); // Don't run the bugfixer if there isn't a PageReplacer page open since I assume the bug only happens when going back from a PageReplace'd page
|
|
@@ -9855,4 +9875,4 @@ const $d399250dfa491636$export$c3834fa86c616831 = [[4], [3, 1024], [2, 901]];
|
|
|
9855
9875
|
const $d399250dfa491636$export$864d304a0bc46829 = "2%";
|
|
9856
9876
|
const $d399250dfa491636$export$7bf543b9d9be2c22 = (0, $fa332ea03168857c$export$b91cec6bdc6b32a1);
|
|
9857
9877
|
$b8hua$add_to_version_info("ui", (0, $8db9a15135765c11$export$83d89fbfd8236492));
|
|
9858
|
-
export { $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $0dc044cffe1e825b$export$9f191182275e9ef as make_accurate_size_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };
|
|
9878
|
+
export { $2855bffe06ef7a03$export$58aa3f171519b6d7 as encode_filters, $2855bffe06ef7a03$export$f934fa24c3a86811 as decode_filters, $4df489344a0f97c7$export$d7b7ab832c20e2f4 as shopifyContainedImageContextSymbol, $5441862cd2f5e111$export$e68cff63f76bd15b as ListingProvider, $5441862cd2f5e111$export$8d0c4fdbb05a2f2e as useListing, $4df489344a0f97c7$export$e4b984597b71e989 as ShopifyContainedImage, $002f09d00aac50b2$export$6649caad96ef8870 as SlidableItems, $0dc044cffe1e825b$export$9f191182275e9ef as make_accurate_size_accessor, $d5d7e58c5c9d8db0$export$9574e176201e5e8d as RecommendationSlider, $b432b11321ad4c97$export$9756467d34d91cdb as RecommendationGrid, $56047603f9d212b6$export$6e5611bc7e57e477 as ShopifyResponsiveImg, $56047603f9d212b6$export$e6fffe67d4cdd848 as makeSizeAccessor, $801e8845d3fa3653$export$94026ee33dbabc26 as ImageContainer, $74777e8fe65b3dcb$export$b69d0d92862de18b as SentryErrorBoundary, $ad371564683947ab$export$6c6d7a51fa9aa15d as ExpandingDetails, $e18ab2868df26f40$export$f091cbac892643a4 as accessor_of_object_to_object_with_accessor_values, $4711a82d08d2021b$export$fecbb157621501bd as SelectedFilters, $f6b0500577e1b210$export$3f1a388cc0d8fed7 as FilterBody, $44aa24b1bb793549$export$b288c38ae3fddb56 as create_modified_filters, $63f1f8dbcd07d3b0$export$d21e32dfedac04be as SolidLayout, $d5f1e6a0f9117286$export$79b1565500412d9b as general_modal_abstraction, $9783d437ad61594c$export$3b621d86b1566b2 as CrossIcon, $ca6ab5f08bd28bca$export$8be2714ec7f169ee as GenericSliderArrowButton, $5c5732ef44f05b26$export$58e808b1db15d3bc as fetchDepictRecommendations, $f5f54892fd0c7d9f$export$de035477d6fef996 as QuickLinks, $f5f54892fd0c7d9f$export$5b7c3ce0ebe51f86 as BreadCrumbs, $fa332ea03168857c$export$b91cec6bdc6b32a1 as CategoryTitle, $702d7656a373973e$export$824dde41348efed1 as embedded_num_products, $96fd967c5b358ead$export$643598a327b5833e as get_categories, $f5f54892fd0c7d9f$export$f34314aa9505732e as DepictCategory, $f5f54892fd0c7d9f$export$e2bf8ce7779e827e as CategoryPage, $eb064bc3350276c1$export$ac6237957a15b3f0 as DepictSearch, $eb064bc3350276c1$export$bde3eb976dfded9 as get_search_query_updating_blocked_signal, $eb064bc3350276c1$export$f2dc7e4e4aa11abb as SearchPage, $eb064bc3350276c1$export$316f6f283ae64765 as SearchField, $f3b7124b76123e44$export$aa14a9f43128f61f as ProductCardError, $169c13c0531d91d2$export$d86a33413558014e as open_modal_with_alignment, $5eaa00b951637e96$export$ee1733d9a8495996 as DefaultInstantCardPlaceholder, $1308a7816c3d4f2d$export$b3ad617e9036868 as align_field, $a9c7ba6087881ac2$export$6daf8749b65a1b77 as convert_sdk_cols_at_size_to_layout, $cc64aabf2c7a1f1a$export$1233ca167bf71f9a as styles_to_valid_css_string, $e56d241d0f33d459$export$fe334901e8bebd57 as disable_scrolling, $573c007c697a1831$export$d0596b5cae35ad4 as open_search_with_shift_slash, $284849364a6ef73a$export$e015ed2f2950f2e3 as DepictAPI, $00a5b94f0c11efbb$export$d9f36cf74e24d595 as media_query_to_accessor, $e60a76195ac6d408$export$689e204eadb33baf as setup_fast_leave, $a61a2051e15c8d7a$export$5196e4c01fa56fcb as show_toast, $60ec7a29849d81db$export$a71e92cfbb498adc as SolidFormatPrice, $37e8c97bb6876197$export$828dcdd425fd3231 as connect_search_field_height_to_aligner_height, $bc2337c9a05ecd18$export$acb3eaade4b23afd as BasePlaceholder, $ceafb6fb91c6f394$export$89c6019e4baa40b1 as TextPlaceholder, $3ab4aa97880fb88d$export$3f37af283f8fb843 as ImagePlaceholder, $f9fd3017c20b774a$export$3ccaa27d81dd8556 as PageReplacer, $d399250dfa491636$export$864d304a0bc46829 as defaultGridSpacing, $d399250dfa491636$export$c3834fa86c616831 as defaultColsAtSize, $d399250dfa491636$export$7bf543b9d9be2c22 as defaultCategoryTitlePlugin, $8db9a15135765c11$export$83d89fbfd8236492 as version };
|