@commerce-blocks/sdk 2.0.0 → 2.0.2
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/README.md +71 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +940 -896
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { effect as
|
|
2
|
-
import { batch as
|
|
3
|
-
const
|
|
4
|
-
version:
|
|
5
|
-
},
|
|
6
|
-
function
|
|
1
|
+
import { effect as ie, signal as q, computed as L } from "@preact/signals-core";
|
|
2
|
+
import { batch as rr, computed as nr, effect as ar, signal as or } from "@preact/signals-core";
|
|
3
|
+
const Ne = "2.0.2", Le = {
|
|
4
|
+
version: Ne
|
|
5
|
+
}, Pe = "https://app.uselayers.com/api/storefront/v1", qe = 1e3, De = 100, Fe = 300 * qe, ce = Le.version, K = 1, X = 24, ne = 1, ae = 1, oe = 100, Ue = 10, Me = 200, Ve = 300, $e = 50, Be = 1e3;
|
|
6
|
+
function k(e) {
|
|
7
7
|
return { data: e };
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function y(e) {
|
|
10
10
|
return { error: e };
|
|
11
11
|
}
|
|
12
12
|
function Q(e) {
|
|
@@ -17,25 +17,25 @@ function Q(e) {
|
|
|
17
17
|
cause: e.cause
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function Ge(e) {
|
|
21
21
|
if (!e) return;
|
|
22
22
|
const t = e["retry-after"] ?? e["Retry-After"];
|
|
23
23
|
if (!t) return;
|
|
24
24
|
const r = t.trim();
|
|
25
25
|
if (/^\d+$/.test(r))
|
|
26
26
|
return Number(r) * 1e3;
|
|
27
|
-
const
|
|
28
|
-
if (!isNaN(
|
|
29
|
-
return Math.max(0,
|
|
27
|
+
const a = new Date(t);
|
|
28
|
+
if (!isNaN(a.getTime()))
|
|
29
|
+
return Math.max(0, a.getTime() - Date.now());
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ie(e) {
|
|
32
32
|
return {
|
|
33
33
|
_tag: "ApiError",
|
|
34
34
|
code: e.code,
|
|
35
35
|
source: e.source,
|
|
36
36
|
message: e.message,
|
|
37
37
|
status: e.status,
|
|
38
|
-
retryAfterMs: e.retryAfterMs ??
|
|
38
|
+
retryAfterMs: e.retryAfterMs ?? Ge(e.responseHeaders),
|
|
39
39
|
cause: e.cause
|
|
40
40
|
};
|
|
41
41
|
}
|
|
@@ -49,15 +49,15 @@ function B(e) {
|
|
|
49
49
|
input: e.input
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
function M(e, t, r,
|
|
52
|
+
function M(e, t, r, a) {
|
|
53
53
|
return {
|
|
54
54
|
field: e,
|
|
55
55
|
code: t,
|
|
56
56
|
message: r,
|
|
57
|
-
...
|
|
57
|
+
...a
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function H(e) {
|
|
61
61
|
return {
|
|
62
62
|
_tag: "ConfigError",
|
|
63
63
|
code: e.code,
|
|
@@ -67,38 +67,38 @@ function z(e) {
|
|
|
67
67
|
expected: e.expected
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
function Lt(e) {
|
|
72
|
-
return typeof e == "object" && e !== null && $e.has(e._tag ?? "");
|
|
73
|
-
}
|
|
70
|
+
const xe = /* @__PURE__ */ new Set(["NetworkError", "ApiError", "ValidationError", "ConfigError"]);
|
|
74
71
|
function qt(e) {
|
|
72
|
+
return typeof e == "object" && e !== null && xe.has(e._tag ?? "");
|
|
73
|
+
}
|
|
74
|
+
function Dt(e) {
|
|
75
75
|
return e._tag === "NetworkError" ? e.code === "TIMEOUT" || e.code === "CONNECTION_FAILED" || e.code === "DNS_FAILED" : e._tag === "ApiError" ? e.code === "RATE_LIMITED" || e.code === "SERVICE_UNAVAILABLE" || e.code === "NOT_READY" || e.status !== void 0 && e.status >= 500 : !1;
|
|
76
76
|
}
|
|
77
|
-
const
|
|
77
|
+
const je = {
|
|
78
78
|
401: "UNAUTHORIZED",
|
|
79
79
|
403: "FORBIDDEN",
|
|
80
80
|
404: "NOT_FOUND",
|
|
81
81
|
425: "NOT_READY",
|
|
82
82
|
429: "RATE_LIMITED"
|
|
83
83
|
};
|
|
84
|
-
function
|
|
85
|
-
const { status: r } = e,
|
|
86
|
-
let
|
|
84
|
+
function He(e, t) {
|
|
85
|
+
const { status: r } = e, a = je[r] ?? (r >= 500 ? "SERVICE_UNAVAILABLE" : "UNKNOWN");
|
|
86
|
+
let c;
|
|
87
87
|
try {
|
|
88
88
|
const n = JSON.parse(t);
|
|
89
|
-
typeof n.retry_after_ms == "number" && (
|
|
89
|
+
typeof n.retry_after_ms == "number" && (c = n.retry_after_ms);
|
|
90
90
|
} catch {
|
|
91
91
|
}
|
|
92
|
-
return
|
|
93
|
-
code:
|
|
92
|
+
return Ie({
|
|
93
|
+
code: a,
|
|
94
94
|
source: "layers",
|
|
95
95
|
message: t || `HTTP ${r}`,
|
|
96
96
|
status: r,
|
|
97
|
-
retryAfterMs:
|
|
97
|
+
retryAfterMs: c,
|
|
98
98
|
responseHeaders: Object.fromEntries(e.headers.entries())
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function Qe(e) {
|
|
102
102
|
if (e instanceof Error && (e.name === "AbortError" || e.name === "TimeoutError")) {
|
|
103
103
|
const t = e.name === "TimeoutError" || e.message.includes("timeout");
|
|
104
104
|
return Q({
|
|
@@ -113,16 +113,16 @@ function Ge(e) {
|
|
|
113
113
|
cause: e
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
async function
|
|
116
|
+
async function Je(e) {
|
|
117
117
|
if (!e.ok) {
|
|
118
118
|
const t = await e.text().catch(() => "");
|
|
119
|
-
return
|
|
119
|
+
return y(He(e, t));
|
|
120
120
|
}
|
|
121
121
|
try {
|
|
122
|
-
return
|
|
122
|
+
return k(await e.json());
|
|
123
123
|
} catch (t) {
|
|
124
|
-
return
|
|
125
|
-
|
|
124
|
+
return y(
|
|
125
|
+
Ie({
|
|
126
126
|
code: "PARSE_ERROR",
|
|
127
127
|
source: "layers",
|
|
128
128
|
message: "Invalid JSON response",
|
|
@@ -131,59 +131,59 @@ async function xe(e) {
|
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function de({
|
|
135
135
|
token: e,
|
|
136
136
|
json: t = !0
|
|
137
137
|
}) {
|
|
138
138
|
const r = {
|
|
139
139
|
Accept: "application/json",
|
|
140
140
|
"X-Storefront-Access-Token": e,
|
|
141
|
-
"X-SDK-Client": `commerce-blocks-sdk/${
|
|
141
|
+
"X-SDK-Client": `commerce-blocks-sdk/${ce}`
|
|
142
142
|
};
|
|
143
143
|
return t && (r["Content-Type"] = "application/json"), r;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
const { baseUrl: r =
|
|
145
|
+
function fe({ config: e, endpoint: t }) {
|
|
146
|
+
const { baseUrl: r = Pe } = e;
|
|
147
147
|
return `${r}${t}`;
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function me(e) {
|
|
150
150
|
return e.fetch ?? ((t, r) => fetch(t, r));
|
|
151
151
|
}
|
|
152
|
-
async function
|
|
152
|
+
async function ge(e, t, r) {
|
|
153
153
|
try {
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
} catch (
|
|
157
|
-
return
|
|
154
|
+
const a = await e(t, r);
|
|
155
|
+
return Je(a);
|
|
156
|
+
} catch (a) {
|
|
157
|
+
return y(Qe(a));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
async function
|
|
161
|
-
return me(
|
|
160
|
+
async function $(e) {
|
|
161
|
+
return ge(me(e.config), fe(e), {
|
|
162
162
|
method: "POST",
|
|
163
|
-
headers:
|
|
163
|
+
headers: de({ token: e.config.token }),
|
|
164
164
|
body: JSON.stringify(e.body),
|
|
165
165
|
signal: e.signal
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
async function
|
|
168
|
+
async function Ke(e) {
|
|
169
169
|
const t = new URLSearchParams();
|
|
170
|
-
for (const [
|
|
171
|
-
n != null && t.append(
|
|
172
|
-
const r = t.toString(),
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
for (const [c, n] of Object.entries(e.params))
|
|
171
|
+
n != null && t.append(c, typeof n == "object" ? JSON.stringify(n) : String(n));
|
|
172
|
+
const r = t.toString(), a = r ? `${e.endpoint}?${r}` : e.endpoint;
|
|
173
|
+
return ge(
|
|
174
|
+
me(e.config),
|
|
175
|
+
fe({ config: e.config, endpoint: a }),
|
|
176
176
|
{
|
|
177
177
|
method: "GET",
|
|
178
|
-
headers:
|
|
178
|
+
headers: de({ token: e.config.token }),
|
|
179
179
|
signal: e.signal
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
|
-
async function
|
|
184
|
-
return me(
|
|
183
|
+
async function Xe(e) {
|
|
184
|
+
return ge(me(e.config), fe(e), {
|
|
185
185
|
method: "POST",
|
|
186
|
-
headers:
|
|
186
|
+
headers: de({ token: e.config.token, json: !1 }),
|
|
187
187
|
body: e.formData,
|
|
188
188
|
signal: e.signal
|
|
189
189
|
});
|
|
@@ -194,35 +194,32 @@ function U(e, t, r) {
|
|
|
194
194
|
fields: [M(t, "REQUIRED_FIELD", `${t} is required`)]
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function j(e, t) {
|
|
198
198
|
if (!e) return null;
|
|
199
199
|
const r = [];
|
|
200
|
-
return e.page !== void 0 && e.page <
|
|
201
|
-
M("page", "OUT_OF_RANGE", `page must be >= ${
|
|
200
|
+
return e.page !== void 0 && e.page < ne && r.push(
|
|
201
|
+
M("page", "OUT_OF_RANGE", `page must be >= ${ne}`, {
|
|
202
202
|
value: e.page,
|
|
203
|
-
constraints: { min:
|
|
203
|
+
constraints: { min: ne }
|
|
204
204
|
})
|
|
205
|
-
), e.limit !== void 0 && (e.limit <
|
|
205
|
+
), e.limit !== void 0 && (e.limit < ae || e.limit > oe) && r.push(
|
|
206
206
|
M(
|
|
207
207
|
"limit",
|
|
208
208
|
"OUT_OF_RANGE",
|
|
209
|
-
`limit must be between ${
|
|
209
|
+
`limit must be between ${ae} and ${oe}`,
|
|
210
210
|
{
|
|
211
211
|
value: e.limit,
|
|
212
|
-
constraints: { min:
|
|
212
|
+
constraints: { min: ae, max: oe }
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
), r.length > 0 ? B({ operation: t, fields: r }) : null;
|
|
216
216
|
}
|
|
217
|
-
const
|
|
217
|
+
const Ye = [
|
|
218
218
|
"title",
|
|
219
219
|
"handle",
|
|
220
220
|
"available",
|
|
221
|
-
"images",
|
|
222
221
|
"options_v2",
|
|
223
|
-
"variants",
|
|
224
222
|
"first_or_matched_variant",
|
|
225
|
-
"price_range",
|
|
226
223
|
"vendor",
|
|
227
224
|
"product_type",
|
|
228
225
|
"tags",
|
|
@@ -233,10 +230,10 @@ const Qe = [
|
|
|
233
230
|
"combined_listing_parent_product_id",
|
|
234
231
|
"combined_listing_role"
|
|
235
232
|
];
|
|
236
|
-
function
|
|
233
|
+
function ze(e) {
|
|
237
234
|
if (!e.token)
|
|
238
|
-
return
|
|
239
|
-
|
|
235
|
+
return y(
|
|
236
|
+
H({
|
|
240
237
|
code: "MISSING_CONFIG",
|
|
241
238
|
message: "token is required",
|
|
242
239
|
field: "token",
|
|
@@ -244,87 +241,92 @@ function Je(e) {
|
|
|
244
241
|
})
|
|
245
242
|
);
|
|
246
243
|
if (!e.sorts || e.sorts.length === 0)
|
|
247
|
-
return
|
|
248
|
-
|
|
244
|
+
return y(
|
|
245
|
+
H({
|
|
249
246
|
code: "MISSING_CONFIG",
|
|
250
247
|
message: "At least one sort option is required",
|
|
251
248
|
field: "sorts",
|
|
252
249
|
expected: "non-empty array of Sort"
|
|
253
250
|
})
|
|
254
251
|
);
|
|
255
|
-
|
|
256
|
-
return
|
|
257
|
-
|
|
252
|
+
if (e.facets && !Array.isArray(e.facets))
|
|
253
|
+
return y(
|
|
254
|
+
H({
|
|
255
|
+
code: "INVALID_CONFIG",
|
|
256
|
+
message: "facets must be an array",
|
|
257
|
+
field: "facets",
|
|
258
|
+
expected: "array of Facet"
|
|
259
|
+
})
|
|
260
|
+
);
|
|
261
|
+
const t = [.../* @__PURE__ */ new Set([...Ye, ...e.attributes ?? []])];
|
|
258
262
|
function r({
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
includeFacets: c = !0
|
|
263
|
+
transformBody: n,
|
|
264
|
+
rest: i,
|
|
265
|
+
includeFacets: u = !0
|
|
263
266
|
}) {
|
|
264
|
-
let
|
|
265
|
-
attributes: t
|
|
266
|
-
...
|
|
267
|
+
let s = {
|
|
268
|
+
attributes: t,
|
|
269
|
+
...i
|
|
267
270
|
};
|
|
268
|
-
return
|
|
271
|
+
return u && (s.facets ?? (s.facets = e.facets?.map((d) => d.code) ?? []), s.retrieveFacetCount ?? (s.retrieveFacetCount = !0), s.includeFacetRanges ?? (s.includeFacetRanges = !0)), n && (s = n(s)), s;
|
|
269
272
|
}
|
|
270
|
-
const
|
|
273
|
+
const a = {
|
|
271
274
|
token: e.token,
|
|
272
275
|
baseUrl: e.baseUrl,
|
|
273
276
|
fetch: e.fetch
|
|
274
277
|
};
|
|
275
|
-
return
|
|
276
|
-
browse: async (n,
|
|
278
|
+
return k({
|
|
279
|
+
browse: async (n, i) => {
|
|
277
280
|
const u = U("browse", "collectionHandle", n.collectionHandle);
|
|
278
|
-
if (u) return
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
283
|
-
const { collectionHandle:
|
|
284
|
-
return
|
|
285
|
-
config:
|
|
286
|
-
endpoint: `/browse/${
|
|
287
|
-
body: r({
|
|
288
|
-
signal:
|
|
281
|
+
if (u) return y(u);
|
|
282
|
+
const s = U("browse", "sort_order_code", n.sort_order_code);
|
|
283
|
+
if (s) return y(s);
|
|
284
|
+
const d = j(n.pagination, "browse");
|
|
285
|
+
if (d) return y(d);
|
|
286
|
+
const { collectionHandle: o, transformBody: l, ...g } = n;
|
|
287
|
+
return $({
|
|
288
|
+
config: a,
|
|
289
|
+
endpoint: `/browse/${encodeURIComponent(o)}`,
|
|
290
|
+
body: r({ transformBody: l, rest: g }),
|
|
291
|
+
signal: i
|
|
289
292
|
});
|
|
290
293
|
},
|
|
291
|
-
predictiveSearch: async (n,
|
|
294
|
+
predictiveSearch: async (n, i) => {
|
|
292
295
|
const u = U("predictiveSearch", "query", n);
|
|
293
|
-
return u ?
|
|
294
|
-
config:
|
|
296
|
+
return u ? y(u) : Ke({
|
|
297
|
+
config: a,
|
|
295
298
|
endpoint: "/search/complete",
|
|
296
299
|
params: { query: n },
|
|
297
|
-
signal:
|
|
300
|
+
signal: i
|
|
298
301
|
});
|
|
299
302
|
},
|
|
300
|
-
prepareSearch: async (n,
|
|
303
|
+
prepareSearch: async (n, i) => {
|
|
301
304
|
const u = U("prepareSearch", "query", n.query);
|
|
302
|
-
if (u) return
|
|
303
|
-
const { query:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
signal: s
|
|
305
|
+
if (u) return y(u);
|
|
306
|
+
const { query: s, transformBody: d, ...o } = n, l = r({ transformBody: d, rest: o, includeFacets: !1 });
|
|
307
|
+
return $({
|
|
308
|
+
config: a,
|
|
309
|
+
endpoint: `/search/${encodeURIComponent(s)}/prepare`,
|
|
310
|
+
body: l,
|
|
311
|
+
signal: i
|
|
310
312
|
});
|
|
311
313
|
},
|
|
312
|
-
search: async (n,
|
|
314
|
+
search: async (n, i) => {
|
|
313
315
|
const u = U("search", "query", n.query);
|
|
314
|
-
if (u) return
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
const { query:
|
|
318
|
-
return
|
|
319
|
-
config:
|
|
320
|
-
endpoint: `/search/${encodeURIComponent(
|
|
321
|
-
body: r({
|
|
322
|
-
signal:
|
|
316
|
+
if (u) return y(u);
|
|
317
|
+
const s = j(n.pagination, "search");
|
|
318
|
+
if (s) return y(s);
|
|
319
|
+
const { query: d, transformBody: o, ...l } = n;
|
|
320
|
+
return $({
|
|
321
|
+
config: a,
|
|
322
|
+
endpoint: `/search/${encodeURIComponent(d)}/execute`,
|
|
323
|
+
body: r({ transformBody: o, rest: l }),
|
|
324
|
+
signal: i
|
|
323
325
|
});
|
|
324
326
|
},
|
|
325
|
-
imageSearch: async (n,
|
|
327
|
+
imageSearch: async (n, i) => {
|
|
326
328
|
if (!n.image_data && !n.image_id)
|
|
327
|
-
return
|
|
329
|
+
return y(
|
|
328
330
|
B({
|
|
329
331
|
operation: "imageSearch",
|
|
330
332
|
fields: [
|
|
@@ -332,62 +334,83 @@ function Je(e) {
|
|
|
332
334
|
]
|
|
333
335
|
})
|
|
334
336
|
);
|
|
335
|
-
const u =
|
|
336
|
-
if (u) return
|
|
337
|
-
const {
|
|
338
|
-
return
|
|
339
|
-
config:
|
|
337
|
+
const u = j(n.pagination, "imageSearch");
|
|
338
|
+
if (u) return y(u);
|
|
339
|
+
const { transformBody: s, ...d } = n;
|
|
340
|
+
return $({
|
|
341
|
+
config: a,
|
|
340
342
|
endpoint: "/search/image",
|
|
341
|
-
body: r({
|
|
342
|
-
signal:
|
|
343
|
+
body: r({ transformBody: s, rest: d, includeFacets: !1 }),
|
|
344
|
+
signal: i
|
|
343
345
|
});
|
|
344
346
|
},
|
|
345
|
-
uploadImage: async (n,
|
|
347
|
+
uploadImage: async (n, i) => {
|
|
346
348
|
const u = new FormData();
|
|
347
|
-
return u.append("image", n),
|
|
348
|
-
config:
|
|
349
|
+
return u.append("image", n), Xe({
|
|
350
|
+
config: a,
|
|
349
351
|
endpoint: "/images/upload",
|
|
350
352
|
formData: u,
|
|
351
|
-
signal:
|
|
353
|
+
signal: i
|
|
352
354
|
});
|
|
353
355
|
},
|
|
354
|
-
blocks: async (n,
|
|
356
|
+
blocks: async (n, i) => {
|
|
355
357
|
const u = U("block", "blockId", n.blockId);
|
|
356
|
-
if (u) return
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
const { blockId:
|
|
360
|
-
return
|
|
361
|
-
config:
|
|
362
|
-
endpoint: `/blocks/${
|
|
363
|
-
body: r({
|
|
364
|
-
signal:
|
|
358
|
+
if (u) return y(u);
|
|
359
|
+
const s = j(n.pagination, "block");
|
|
360
|
+
if (s) return y(s);
|
|
361
|
+
const { blockId: d, transformBody: o, ...l } = n;
|
|
362
|
+
return $({
|
|
363
|
+
config: a,
|
|
364
|
+
endpoint: `/blocks/${encodeURIComponent(d)}/products`,
|
|
365
|
+
body: r({ transformBody: o, rest: l }),
|
|
366
|
+
signal: i
|
|
365
367
|
});
|
|
366
368
|
},
|
|
367
|
-
searchContent: async (n,
|
|
369
|
+
searchContent: async (n, i) => {
|
|
368
370
|
const u = U("searchContent", "query", n.query);
|
|
369
|
-
if (u) return
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
const { query:
|
|
373
|
-
let
|
|
374
|
-
return
|
|
375
|
-
config:
|
|
376
|
-
endpoint: `/search/content/${encodeURIComponent(
|
|
377
|
-
body:
|
|
378
|
-
signal:
|
|
371
|
+
if (u) return y(u);
|
|
372
|
+
const s = j(n.pagination, "searchContent");
|
|
373
|
+
if (s) return y(s);
|
|
374
|
+
const { query: d, transformBody: o, ...l } = n;
|
|
375
|
+
let g = { ...l };
|
|
376
|
+
return o && (g = o(g)), $({
|
|
377
|
+
config: a,
|
|
378
|
+
endpoint: `/search/content/${encodeURIComponent(d)}/execute`,
|
|
379
|
+
body: g,
|
|
380
|
+
signal: i
|
|
379
381
|
});
|
|
380
382
|
}
|
|
381
383
|
});
|
|
382
384
|
}
|
|
383
|
-
function
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
function We(e) {
|
|
386
|
+
try {
|
|
387
|
+
if (typeof window > "u" || !window.localStorage) return null;
|
|
388
|
+
} catch {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
return {
|
|
392
|
+
read: () => {
|
|
393
|
+
try {
|
|
394
|
+
return window.localStorage.getItem(e);
|
|
395
|
+
} catch {
|
|
396
|
+
return null;
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
write: (t) => {
|
|
400
|
+
try {
|
|
401
|
+
window.localStorage.setItem(e, t);
|
|
402
|
+
} catch {
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
remove: () => {
|
|
406
|
+
try {
|
|
407
|
+
window.localStorage.removeItem(e);
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
410
|
+
}
|
|
388
411
|
};
|
|
389
412
|
}
|
|
390
|
-
function
|
|
413
|
+
function Ft(e, t) {
|
|
391
414
|
return {
|
|
392
415
|
read() {
|
|
393
416
|
try {
|
|
@@ -410,139 +433,145 @@ function Dt(e, t) {
|
|
|
410
433
|
}
|
|
411
434
|
};
|
|
412
435
|
}
|
|
413
|
-
const
|
|
414
|
-
function
|
|
436
|
+
const Ze = "cb-sdk-store";
|
|
437
|
+
function be(e, t) {
|
|
415
438
|
if (e.size <= t) return;
|
|
416
|
-
const
|
|
417
|
-
for (const [
|
|
418
|
-
e.delete(
|
|
439
|
+
const a = [...e.entries()].sort((c, n) => c[1].timestamp - n[1].timestamp).slice(0, e.size - t);
|
|
440
|
+
for (const [c] of a)
|
|
441
|
+
e.delete(c);
|
|
419
442
|
}
|
|
420
|
-
function
|
|
421
|
-
typeof requestIdleCallback == "function" ? requestIdleCallback(e, { timeout:
|
|
443
|
+
function et(e) {
|
|
444
|
+
typeof requestIdleCallback == "function" ? requestIdleCallback(e, { timeout: Be }) : setTimeout(e, 0);
|
|
422
445
|
}
|
|
423
|
-
function
|
|
446
|
+
function tt(e = {}) {
|
|
424
447
|
const {
|
|
425
|
-
ttl: t =
|
|
426
|
-
maxEntries: r =
|
|
427
|
-
storageKey:
|
|
428
|
-
storageAdapter:
|
|
429
|
-
} = e, n = /* @__PURE__ */ new Map(),
|
|
448
|
+
ttl: t = Fe,
|
|
449
|
+
maxEntries: r = De,
|
|
450
|
+
storageKey: a = Ze,
|
|
451
|
+
storageAdapter: c
|
|
452
|
+
} = e, n = /* @__PURE__ */ new Map(), i = c ?? We(a);
|
|
430
453
|
let u = 0;
|
|
431
|
-
function
|
|
432
|
-
return Date.now() -
|
|
454
|
+
function s(o) {
|
|
455
|
+
return Date.now() - o > t;
|
|
433
456
|
}
|
|
434
|
-
function
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
|
|
438
|
-
if (
|
|
457
|
+
function d() {
|
|
458
|
+
if (!i) return;
|
|
459
|
+
const o = ++u;
|
|
460
|
+
et(() => {
|
|
461
|
+
if (o === u)
|
|
439
462
|
try {
|
|
440
|
-
const
|
|
441
|
-
for (const [
|
|
442
|
-
|
|
443
|
-
const
|
|
444
|
-
queries:
|
|
445
|
-
version:
|
|
463
|
+
const l = [];
|
|
464
|
+
for (const [p, h] of n)
|
|
465
|
+
s(h.createdAt) || l.push([p, h]);
|
|
466
|
+
const g = {
|
|
467
|
+
queries: l.slice(0, r),
|
|
468
|
+
version: ce
|
|
446
469
|
};
|
|
447
|
-
|
|
470
|
+
i.write(JSON.stringify(g));
|
|
448
471
|
} catch {
|
|
449
472
|
}
|
|
450
473
|
});
|
|
451
474
|
}
|
|
452
475
|
return {
|
|
453
|
-
get(
|
|
454
|
-
|
|
476
|
+
get(o) {
|
|
477
|
+
const l = n.get(o);
|
|
478
|
+
return l ? s(l.createdAt) ? (n.delete(o), null) : (l.timestamp = Date.now(), l) : null;
|
|
455
479
|
},
|
|
456
|
-
set(
|
|
457
|
-
|
|
480
|
+
set(o, l) {
|
|
481
|
+
const g = Date.now();
|
|
482
|
+
n.set(o, { data: l, timestamp: g, createdAt: g }), be(n, r), d();
|
|
458
483
|
},
|
|
459
|
-
isExpired(
|
|
460
|
-
const
|
|
461
|
-
return
|
|
484
|
+
isExpired(o) {
|
|
485
|
+
const l = n.get(o);
|
|
486
|
+
return l ? s(l.createdAt) : !0;
|
|
462
487
|
},
|
|
463
|
-
invalidate(
|
|
464
|
-
for (const
|
|
465
|
-
|
|
488
|
+
invalidate(o) {
|
|
489
|
+
for (const l of n.keys())
|
|
490
|
+
l.includes(o) && n.delete(l);
|
|
491
|
+
d();
|
|
466
492
|
},
|
|
467
493
|
persist() {
|
|
468
|
-
|
|
494
|
+
d();
|
|
469
495
|
},
|
|
470
496
|
restore() {
|
|
471
|
-
if (
|
|
497
|
+
if (i)
|
|
472
498
|
try {
|
|
473
|
-
const
|
|
474
|
-
if (!
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
|
|
499
|
+
const o = i.read();
|
|
500
|
+
if (!o) return;
|
|
501
|
+
const l = JSON.parse(o);
|
|
502
|
+
if (l.version !== ce) {
|
|
503
|
+
i.remove();
|
|
478
504
|
return;
|
|
479
505
|
}
|
|
480
|
-
if (!Array.isArray(
|
|
481
|
-
|
|
506
|
+
if (!Array.isArray(l.queries)) {
|
|
507
|
+
i.remove();
|
|
482
508
|
return;
|
|
483
509
|
}
|
|
484
|
-
for (const [
|
|
485
|
-
|
|
510
|
+
for (const [g, p] of l.queries) {
|
|
511
|
+
const h = p.createdAt ?? p.timestamp;
|
|
512
|
+
s(h) || (p.createdAt ?? (p.createdAt = p.timestamp), n.set(g, p));
|
|
513
|
+
}
|
|
514
|
+
be(n, r);
|
|
486
515
|
} catch {
|
|
487
|
-
|
|
516
|
+
i.remove();
|
|
488
517
|
}
|
|
489
518
|
},
|
|
490
519
|
clear() {
|
|
491
|
-
n.clear(), u++,
|
|
520
|
+
n.clear(), u++, i?.remove();
|
|
492
521
|
},
|
|
493
522
|
get stats() {
|
|
494
523
|
return { entries: n.size };
|
|
495
524
|
}
|
|
496
525
|
};
|
|
497
526
|
}
|
|
498
|
-
function
|
|
499
|
-
return e === null || typeof e != "object" ? JSON.stringify(e) : Array.isArray(e) ? `[${e.map(
|
|
500
|
-
(
|
|
527
|
+
function ue(e) {
|
|
528
|
+
return e === null || typeof e != "object" ? JSON.stringify(e) : Array.isArray(e) ? `[${e.map(ue).join(",")}]` : `{${Object.keys(e).sort().map(
|
|
529
|
+
(a) => `${JSON.stringify(a)}:${ue(e[a])}`
|
|
501
530
|
).join(",")}}`;
|
|
502
531
|
}
|
|
503
|
-
function
|
|
532
|
+
function z({
|
|
504
533
|
prefix: e,
|
|
505
534
|
id: t,
|
|
506
535
|
params: r = {}
|
|
507
536
|
}) {
|
|
508
537
|
if (!t?.trim()) return;
|
|
509
|
-
const
|
|
510
|
-
([n,
|
|
538
|
+
const a = `${e}/${encodeURIComponent(t)}`, c = Object.entries(r).filter(([n, i]) => i != null && n !== "signal").sort(([n], [i]) => n.localeCompare(i)).map(
|
|
539
|
+
([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(typeof i == "object" ? ue(i) : String(i))}`
|
|
511
540
|
).join("&");
|
|
512
|
-
return
|
|
541
|
+
return c ? `${a}?${c}` : a;
|
|
513
542
|
}
|
|
514
|
-
function
|
|
515
|
-
return
|
|
543
|
+
function se() {
|
|
544
|
+
return y(Q({ code: "ABORTED", message: "Request aborted" }));
|
|
516
545
|
}
|
|
517
|
-
function
|
|
546
|
+
function rt() {
|
|
518
547
|
const e = /* @__PURE__ */ new Map();
|
|
519
548
|
return {
|
|
520
549
|
async resolve(t) {
|
|
521
|
-
const { key: r, cache:
|
|
550
|
+
const { key: r, cache: a, signal: c, onFetch: n, fn: i } = t;
|
|
522
551
|
if (!r)
|
|
523
|
-
return n?.(),
|
|
524
|
-
const u =
|
|
525
|
-
if (u
|
|
552
|
+
return n?.(), i(c);
|
|
553
|
+
const u = a.get(r);
|
|
554
|
+
if (u)
|
|
526
555
|
return { data: u.data };
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
|
|
531
|
-
const
|
|
532
|
-
|
|
556
|
+
if (c.aborted) return se();
|
|
557
|
+
const s = e.get(r);
|
|
558
|
+
if (s) {
|
|
559
|
+
s.consumers++, n?.();
|
|
560
|
+
const p = () => {
|
|
561
|
+
s.consumers--, s.consumers <= 0 && (s.controller.abort(), e.get(r) === s && e.delete(r));
|
|
533
562
|
};
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
return
|
|
563
|
+
c.addEventListener("abort", p, { once: !0 });
|
|
564
|
+
const h = await s.promise;
|
|
565
|
+
return c.removeEventListener("abort", p), c.aborted ? se() : h;
|
|
537
566
|
}
|
|
538
|
-
const
|
|
539
|
-
|
|
567
|
+
const d = new AbortController(), o = { promise: null, controller: d, consumers: 1 }, l = () => {
|
|
568
|
+
o.consumers--, o.consumers <= 0 && (d.abort(), e.get(r) === o && e.delete(r));
|
|
540
569
|
};
|
|
541
|
-
|
|
542
|
-
e.delete(r);
|
|
570
|
+
c.addEventListener("abort", l, { once: !0 }), n?.(), e.set(r, o), o.promise = i(d.signal).finally(() => {
|
|
571
|
+
e.get(r) === o && e.delete(r);
|
|
543
572
|
});
|
|
544
|
-
const
|
|
545
|
-
return
|
|
573
|
+
const g = await o.promise;
|
|
574
|
+
return c.removeEventListener("abort", l), c.aborted ? se() : g;
|
|
546
575
|
},
|
|
547
576
|
clear() {
|
|
548
577
|
for (const t of e.values())
|
|
@@ -551,202 +580,214 @@ function Ze() {
|
|
|
551
580
|
}
|
|
552
581
|
};
|
|
553
582
|
}
|
|
554
|
-
var
|
|
555
|
-
function
|
|
583
|
+
var le = /* @__PURE__ */ ((e) => (e.Equal = "eq", e.NotEqual = "not_eq", e.In = "in", e.NotIn = "not_in", e.GreaterThan = "gt", e.GreaterThanOrEqual = "gte", e.LessThan = "lt", e.LessThanOrEqual = "lte", e.Exists = "exists", e.NotExists = "not_exists", e))(le || {}), Ae = /* @__PURE__ */ ((e) => (e.And = "AND", e.Or = "OR", e))(Ae || {});
|
|
584
|
+
function Ut(e, t) {
|
|
556
585
|
return { property: e, operator: "eq", values: [t] };
|
|
557
586
|
}
|
|
558
|
-
function
|
|
587
|
+
function Mt(e, t) {
|
|
559
588
|
return { property: e, operator: "not_eq", values: [t] };
|
|
560
589
|
}
|
|
561
|
-
function
|
|
590
|
+
function Vt(e, t) {
|
|
562
591
|
return { property: e, operator: "in", values: t };
|
|
563
592
|
}
|
|
564
593
|
function $t(e, t) {
|
|
565
594
|
return { property: e, operator: "not_in", values: t };
|
|
566
595
|
}
|
|
567
|
-
function
|
|
596
|
+
function Bt(e, t) {
|
|
568
597
|
return { property: e, operator: "gt", values: [t] };
|
|
569
598
|
}
|
|
570
|
-
function
|
|
599
|
+
function Gt(e, t) {
|
|
571
600
|
return { property: e, operator: "gte", values: [t] };
|
|
572
601
|
}
|
|
573
|
-
function
|
|
602
|
+
function xt(e, t) {
|
|
574
603
|
return { property: e, operator: "lt", values: [t] };
|
|
575
604
|
}
|
|
576
|
-
function
|
|
605
|
+
function jt(e, t) {
|
|
577
606
|
return { property: e, operator: "lte", values: [t] };
|
|
578
607
|
}
|
|
579
|
-
function
|
|
608
|
+
function Ht(e) {
|
|
580
609
|
return { property: e, operator: "exists", values: [] };
|
|
581
610
|
}
|
|
582
|
-
function
|
|
611
|
+
function Qt(e) {
|
|
583
612
|
return { property: e, operator: "not_exists", values: [] };
|
|
584
613
|
}
|
|
585
|
-
function
|
|
614
|
+
function nt(...e) {
|
|
586
615
|
return { conditional: "AND", expressions: e };
|
|
587
616
|
}
|
|
588
|
-
function
|
|
617
|
+
function Jt(...e) {
|
|
589
618
|
return { conditional: "OR", expressions: e };
|
|
590
619
|
}
|
|
591
|
-
function
|
|
620
|
+
function at(e) {
|
|
592
621
|
return "conditional" in e;
|
|
593
622
|
}
|
|
594
|
-
function
|
|
595
|
-
return
|
|
623
|
+
function Kt(e) {
|
|
624
|
+
return at(e) ? e : nt(e);
|
|
596
625
|
}
|
|
597
|
-
function
|
|
626
|
+
function Se(e, t) {
|
|
598
627
|
return `gid://shopify/${e}/${t}`;
|
|
599
628
|
}
|
|
600
|
-
function
|
|
601
|
-
return
|
|
629
|
+
function ot(e) {
|
|
630
|
+
return Se("Product", e);
|
|
602
631
|
}
|
|
603
|
-
function
|
|
604
|
-
return
|
|
632
|
+
function st(e) {
|
|
633
|
+
return Se("ProductVariant", e);
|
|
605
634
|
}
|
|
606
|
-
const
|
|
607
|
-
function
|
|
635
|
+
const Ee = (e) => encodeURIComponent(e).replace(/-/g, "%2D");
|
|
636
|
+
function Re({
|
|
608
637
|
type: e,
|
|
609
638
|
selectedOptions: t
|
|
610
639
|
}) {
|
|
611
640
|
if (t.length === 0)
|
|
612
641
|
return `${e}-`;
|
|
613
|
-
const r = t.map(({ name:
|
|
642
|
+
const r = t.map(({ name: a, value: c }) => `${Ee(a)}:${Ee(c)}`).join("-");
|
|
614
643
|
return `${e}-${r}`;
|
|
615
644
|
}
|
|
616
|
-
function
|
|
645
|
+
function Te(e) {
|
|
617
646
|
return e.product_id ?? e.id;
|
|
618
647
|
}
|
|
619
|
-
function
|
|
620
|
-
return
|
|
648
|
+
function it(e) {
|
|
649
|
+
return ot(Te(e));
|
|
621
650
|
}
|
|
622
|
-
const
|
|
651
|
+
const pe = "USD", ct = "en-US";
|
|
623
652
|
function G(e, t, r) {
|
|
624
653
|
return { amount: e, currencyCode: t, formatted: r(e, t) };
|
|
625
654
|
}
|
|
626
|
-
const
|
|
627
|
-
function
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
return o || (o = new Intl.NumberFormat(at, {
|
|
655
|
+
const we = /* @__PURE__ */ new Map();
|
|
656
|
+
function he(e, t) {
|
|
657
|
+
let r = we.get(t);
|
|
658
|
+
return r || (r = new Intl.NumberFormat(ct, {
|
|
631
659
|
style: "currency",
|
|
632
660
|
currency: t
|
|
633
|
-
})
|
|
661
|
+
}), we.set(t, r)), r.format(e);
|
|
634
662
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
637
|
-
if (
|
|
663
|
+
function ut(e, t, r) {
|
|
664
|
+
const a = e?.["variants.price"];
|
|
665
|
+
if (a)
|
|
638
666
|
return {
|
|
639
|
-
min: G(
|
|
640
|
-
max: G(
|
|
667
|
+
min: G(a.min, t, r),
|
|
668
|
+
max: G(a.max, t, r)
|
|
641
669
|
};
|
|
642
670
|
}
|
|
643
|
-
function
|
|
671
|
+
function lt({
|
|
644
672
|
layers: e,
|
|
645
|
-
currencyCode: t =
|
|
646
|
-
formatPrice: r =
|
|
647
|
-
swatches:
|
|
648
|
-
breakoutContext:
|
|
673
|
+
currencyCode: t = pe,
|
|
674
|
+
formatPrice: r = he,
|
|
675
|
+
swatches: a = [],
|
|
676
|
+
breakoutContext: c
|
|
649
677
|
}) {
|
|
650
|
-
const n =
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
678
|
+
const n = e.first_or_matched_variant, i = Te(e), u = it(e), s = e.title, d = e.handle, o = e.vendor ?? "", l = e.product_type ?? "", g = e.tags, p = dt(e), h = ft(e, a), w = mt(n), S = Re({ type: "Product", selectedOptions: w }), I = e.metafields, C = e.calculated, O = G(parseFloat(n.price), t, r), b = n.compare_at_price ? G(parseFloat(n.compare_at_price), t, r) : null, T = n.available, f = n.featured_media ? {
|
|
679
|
+
mediaContentType: n.featured_media.media_type ?? null,
|
|
680
|
+
url: n.featured_media.src,
|
|
681
|
+
alt: n.featured_media.alt ?? "",
|
|
682
|
+
width: n.featured_media.width,
|
|
683
|
+
height: n.featured_media.height
|
|
684
|
+
} : null, m = e.category ? {
|
|
654
685
|
id: e.category.id,
|
|
655
686
|
name: e.category.name,
|
|
656
687
|
fullName: e.category.full_name,
|
|
657
688
|
isLeaf: e.category.is_leaf,
|
|
658
689
|
isRoot: e.category.is_root
|
|
659
|
-
} : null
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
let C = [], P = null;
|
|
667
|
-
if (i?.isVariantTile) {
|
|
668
|
-
P = i.variantId;
|
|
669
|
-
const y = _.find((S) => S.numericId === P);
|
|
670
|
-
if (y) {
|
|
671
|
-
const S = new Set(i.optionCodes);
|
|
672
|
-
C = y.selectedOptions.filter((j) => S.has(j.name));
|
|
673
|
-
}
|
|
690
|
+
} : null;
|
|
691
|
+
let v, E;
|
|
692
|
+
if (e.variants?.length)
|
|
693
|
+
v = gt(e, t, r), E = v.find((_) => _.numericId === n.id) ?? null;
|
|
694
|
+
else {
|
|
695
|
+
const _ = Ce(n, t, r);
|
|
696
|
+
v = [_], E = _;
|
|
674
697
|
}
|
|
698
|
+
let R = [], N = null;
|
|
699
|
+
if (c?.isVariantTile)
|
|
700
|
+
if (N = c.variantId, e.variants?.length) {
|
|
701
|
+
const _ = v.find((A) => A.numericId === N);
|
|
702
|
+
if (_) {
|
|
703
|
+
const A = new Set(c.optionCodes);
|
|
704
|
+
R = _.selectedOptions.filter((ee) => A.has(ee.name));
|
|
705
|
+
}
|
|
706
|
+
} else {
|
|
707
|
+
const _ = new Set(c.optionCodes);
|
|
708
|
+
R = w.filter((A) => _.has(A.name));
|
|
709
|
+
}
|
|
675
710
|
return {
|
|
676
|
-
id:
|
|
677
|
-
gid:
|
|
678
|
-
numericId:
|
|
679
|
-
title:
|
|
680
|
-
handle:
|
|
681
|
-
type:
|
|
682
|
-
vendor:
|
|
683
|
-
availableForSale:
|
|
684
|
-
images:
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
options:
|
|
688
|
-
tags:
|
|
689
|
-
variants:
|
|
690
|
-
selectedOptions:
|
|
691
|
-
metafields:
|
|
692
|
-
calculated:
|
|
693
|
-
category:
|
|
694
|
-
featuredMedia:
|
|
711
|
+
id: S,
|
|
712
|
+
gid: u,
|
|
713
|
+
numericId: i,
|
|
714
|
+
title: s,
|
|
715
|
+
handle: d,
|
|
716
|
+
type: l,
|
|
717
|
+
vendor: o,
|
|
718
|
+
availableForSale: T,
|
|
719
|
+
images: p,
|
|
720
|
+
price: O,
|
|
721
|
+
compareAtPrice: b,
|
|
722
|
+
options: h,
|
|
723
|
+
tags: g,
|
|
724
|
+
variants: v,
|
|
725
|
+
selectedOptions: w,
|
|
726
|
+
metafields: I,
|
|
727
|
+
calculated: C,
|
|
728
|
+
category: m,
|
|
729
|
+
featuredMedia: f,
|
|
695
730
|
combinedListingParentProductId: e.combined_listing_parent_product_id,
|
|
696
731
|
combinedListingRole: e.combined_listing_role,
|
|
697
732
|
selectedVariant: E,
|
|
698
|
-
breakoutOptions:
|
|
699
|
-
breakoutVariantId:
|
|
733
|
+
breakoutOptions: R,
|
|
734
|
+
breakoutVariantId: N
|
|
700
735
|
};
|
|
701
736
|
}
|
|
702
|
-
function
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
return
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
737
|
+
function dt(e) {
|
|
738
|
+
if (e.images?.length)
|
|
739
|
+
return e.images.map((r, a) => ({
|
|
740
|
+
url: r.src,
|
|
741
|
+
alt: r.alt ?? "",
|
|
742
|
+
width: r.width,
|
|
743
|
+
height: r.height,
|
|
744
|
+
position: r.position ?? a,
|
|
745
|
+
variantIds: r.variant_ids ?? []
|
|
746
|
+
}));
|
|
747
|
+
const t = e.first_or_matched_variant.featured_media;
|
|
748
|
+
return t ? [
|
|
749
|
+
{
|
|
750
|
+
url: t.src,
|
|
751
|
+
alt: t.alt ?? "",
|
|
752
|
+
width: t.width,
|
|
753
|
+
height: t.height,
|
|
754
|
+
position: 0,
|
|
755
|
+
variantIds: []
|
|
756
|
+
}
|
|
757
|
+
] : [];
|
|
717
758
|
}
|
|
718
|
-
function
|
|
759
|
+
function ft(e, t) {
|
|
719
760
|
const r = [];
|
|
720
|
-
for (const
|
|
721
|
-
for (const
|
|
722
|
-
const n =
|
|
723
|
-
name:
|
|
724
|
-
value:
|
|
761
|
+
for (const a of e.options_v2)
|
|
762
|
+
for (const c of a.values) {
|
|
763
|
+
const n = c.swatch, u = n && (n.color || n.image) ? {
|
|
764
|
+
name: a.name,
|
|
765
|
+
value: c.value,
|
|
725
766
|
color: n.color,
|
|
726
767
|
imageUrl: n.image?.url ?? null
|
|
727
|
-
} : t.find((
|
|
728
|
-
r.push({ name:
|
|
768
|
+
} : t.find((s) => s.name === a.name && s.value === c.value);
|
|
769
|
+
r.push({ name: a.name, code: a.code, value: c.value, swatch: u });
|
|
729
770
|
}
|
|
730
771
|
return r;
|
|
731
772
|
}
|
|
732
|
-
function
|
|
773
|
+
function mt(e) {
|
|
733
774
|
return e.selected_options.map((t) => ({ name: t.name, value: t.value }));
|
|
734
775
|
}
|
|
735
|
-
function
|
|
736
|
-
return e.variants.map((
|
|
776
|
+
function gt(e, t, r) {
|
|
777
|
+
return (e.variants ?? []).map((a) => Ce(a, t, r));
|
|
737
778
|
}
|
|
738
|
-
function
|
|
739
|
-
const
|
|
779
|
+
function Ce(e, t, r) {
|
|
780
|
+
const a = parseFloat(e.price), c = e.compare_at_price ? parseFloat(e.compare_at_price) : null;
|
|
740
781
|
return {
|
|
741
|
-
id:
|
|
742
|
-
gid:
|
|
782
|
+
id: Re({ type: "ProductVariant", selectedOptions: e.selected_options }),
|
|
783
|
+
gid: st(e.id),
|
|
743
784
|
numericId: e.id,
|
|
744
785
|
title: e.title,
|
|
745
786
|
availableForSale: e.available,
|
|
746
787
|
sku: e.sku,
|
|
747
788
|
position: e.position,
|
|
748
|
-
price: G(
|
|
749
|
-
compareAtPrice:
|
|
789
|
+
price: G(a, t, r),
|
|
790
|
+
compareAtPrice: c != null ? G(c, t, r) : null,
|
|
750
791
|
image: e.featured_media ? {
|
|
751
792
|
url: e.featured_media.src,
|
|
752
793
|
alt: e.featured_media.alt ?? "",
|
|
@@ -763,27 +804,27 @@ function mt(e, t, r) {
|
|
|
763
804
|
hasSellingPlan: e.has_selling_plan ?? !1
|
|
764
805
|
};
|
|
765
806
|
}
|
|
766
|
-
function
|
|
807
|
+
function W({
|
|
767
808
|
results: e,
|
|
768
809
|
meta: t,
|
|
769
|
-
currencyCode: r =
|
|
770
|
-
formatPrice:
|
|
771
|
-
swatches:
|
|
810
|
+
currencyCode: r = pe,
|
|
811
|
+
formatPrice: a = he,
|
|
812
|
+
swatches: c,
|
|
772
813
|
extender: n
|
|
773
814
|
}) {
|
|
774
|
-
const
|
|
815
|
+
const i = t?.variantBreakouts?.map((u) => u.optionCode) ?? [];
|
|
775
816
|
return e.map((u) => {
|
|
776
|
-
const
|
|
817
|
+
const s = pt(u, i), d = lt({
|
|
777
818
|
layers: u,
|
|
778
819
|
currencyCode: r,
|
|
779
|
-
formatPrice:
|
|
780
|
-
swatches:
|
|
781
|
-
breakoutContext:
|
|
820
|
+
formatPrice: a,
|
|
821
|
+
swatches: c,
|
|
822
|
+
breakoutContext: s
|
|
782
823
|
});
|
|
783
|
-
return n ? { ...
|
|
824
|
+
return n ? { ...d, ...n({ base: d, raw: u }) } : d;
|
|
784
825
|
});
|
|
785
826
|
}
|
|
786
|
-
function
|
|
827
|
+
function pt(e, t) {
|
|
787
828
|
if (!(e.__typename !== "Variant" || t.length === 0))
|
|
788
829
|
return {
|
|
789
830
|
isVariantTile: !0,
|
|
@@ -803,67 +844,67 @@ function D({
|
|
|
803
844
|
}) {
|
|
804
845
|
return { data: e, error: null, isFetching: t };
|
|
805
846
|
}
|
|
806
|
-
function
|
|
847
|
+
function P({
|
|
807
848
|
error: e,
|
|
808
849
|
data: t = null,
|
|
809
850
|
isFetching: r = !1
|
|
810
851
|
}) {
|
|
811
852
|
return { data: t, error: e, isFetching: r };
|
|
812
853
|
}
|
|
813
|
-
const
|
|
814
|
-
function
|
|
815
|
-
|
|
854
|
+
const ye = "__COMMERCE_BLOCKS__", ve = typeof window < "u" && typeof window.document < "u";
|
|
855
|
+
function ht(e) {
|
|
856
|
+
ve && (window[ye] = e);
|
|
816
857
|
}
|
|
817
|
-
function
|
|
818
|
-
if (!
|
|
819
|
-
return
|
|
820
|
-
|
|
858
|
+
function Xt() {
|
|
859
|
+
if (!ve)
|
|
860
|
+
return y(
|
|
861
|
+
H({
|
|
821
862
|
code: "INVALID_CONFIG",
|
|
822
863
|
message: "Client only available in browser",
|
|
823
864
|
field: "environment",
|
|
824
865
|
expected: "browser"
|
|
825
866
|
})
|
|
826
867
|
);
|
|
827
|
-
const e = window[
|
|
828
|
-
return e ?
|
|
829
|
-
|
|
868
|
+
const e = window[ye];
|
|
869
|
+
return e ? k(e) : y(
|
|
870
|
+
H({
|
|
830
871
|
code: "MISSING_CONFIG",
|
|
831
872
|
message: "Client not initialized. Call createClient() first.",
|
|
832
873
|
field: "client"
|
|
833
874
|
})
|
|
834
875
|
);
|
|
835
876
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
877
|
+
function Yt() {
|
|
878
|
+
return ve && !!window[ye];
|
|
838
879
|
}
|
|
839
880
|
function Y(e) {
|
|
840
881
|
let t = null;
|
|
841
882
|
return {
|
|
842
883
|
next(r) {
|
|
843
|
-
return t?.abort(), t =
|
|
884
|
+
return t?.abort(), t = _e(r, e), t.signal;
|
|
844
885
|
},
|
|
845
886
|
abort() {
|
|
846
887
|
t?.abort();
|
|
847
888
|
}
|
|
848
889
|
};
|
|
849
890
|
}
|
|
850
|
-
function
|
|
891
|
+
function _e(...e) {
|
|
851
892
|
const t = new AbortController(), r = [];
|
|
852
|
-
for (const
|
|
853
|
-
if (!
|
|
854
|
-
if (
|
|
855
|
-
t.abort(
|
|
893
|
+
for (const a of e) {
|
|
894
|
+
if (!a) continue;
|
|
895
|
+
if (a.aborted) {
|
|
896
|
+
t.abort(a.reason);
|
|
856
897
|
break;
|
|
857
898
|
}
|
|
858
|
-
const
|
|
859
|
-
|
|
899
|
+
const c = () => t.abort(a.reason);
|
|
900
|
+
a.addEventListener("abort", c, { once: !0 }), r.push(() => a.removeEventListener("abort", c));
|
|
860
901
|
}
|
|
861
|
-
return r.length && t.signal.addEventListener("abort", () => r.forEach((
|
|
902
|
+
return r.length && t.signal.addEventListener("abort", () => r.forEach((a) => a()), {
|
|
862
903
|
once: !0
|
|
863
904
|
}), t;
|
|
864
905
|
}
|
|
865
|
-
function
|
|
866
|
-
return
|
|
906
|
+
function V(e, t) {
|
|
907
|
+
return ie(() => t(e.value));
|
|
867
908
|
}
|
|
868
909
|
function F() {
|
|
869
910
|
const e = /* @__PURE__ */ new Set();
|
|
@@ -878,12 +919,12 @@ function F() {
|
|
|
878
919
|
}
|
|
879
920
|
};
|
|
880
921
|
}
|
|
881
|
-
function
|
|
922
|
+
function Z({
|
|
882
923
|
products: e,
|
|
883
924
|
raw: t,
|
|
884
925
|
extender: r,
|
|
885
|
-
currencyCode:
|
|
886
|
-
formatPrice:
|
|
926
|
+
currencyCode: a = pe,
|
|
927
|
+
formatPrice: c = he
|
|
887
928
|
}) {
|
|
888
929
|
const n = {
|
|
889
930
|
products: e,
|
|
@@ -893,7 +934,7 @@ function ee({
|
|
|
893
934
|
resultsPerPage: t.resultsPerPage,
|
|
894
935
|
facets: t.facets ?? {},
|
|
895
936
|
facetRanges: t.facetRanges,
|
|
896
|
-
priceRange:
|
|
937
|
+
priceRange: ut(t.facetRanges, a, c),
|
|
897
938
|
attributionToken: t.attributionToken,
|
|
898
939
|
_workflow: t._workflow
|
|
899
940
|
};
|
|
@@ -903,135 +944,137 @@ function J(e, t) {
|
|
|
903
944
|
if (t) {
|
|
904
945
|
if (e.config.transforms?.filters)
|
|
905
946
|
return e.config.transforms.filters(t);
|
|
947
|
+
if (typeof t == "object" && !Array.isArray(t) && "conditional" in t && "expressions" in t)
|
|
948
|
+
return t;
|
|
906
949
|
if (e.config.filterAliases && typeof t == "object" && !Array.isArray(t)) {
|
|
907
|
-
const r = t,
|
|
908
|
-
for (const [
|
|
950
|
+
const r = t, a = [];
|
|
951
|
+
for (const [c, n] of Object.entries(r)) {
|
|
909
952
|
if (n == null) continue;
|
|
910
|
-
const
|
|
911
|
-
const
|
|
912
|
-
return
|
|
953
|
+
const i = e.config.filterAliases[c], u = typeof i == "string" ? i : i?.property ?? c, s = typeof i == "object" ? i.values : void 0, o = (Array.isArray(n) ? n : [n]).map((l) => {
|
|
954
|
+
const g = s?.[String(l)];
|
|
955
|
+
return g !== void 0 ? g : l;
|
|
913
956
|
});
|
|
914
|
-
|
|
957
|
+
a.push({
|
|
915
958
|
property: u,
|
|
916
|
-
operator:
|
|
917
|
-
values:
|
|
959
|
+
operator: o.length > 1 ? le.In : le.Equal,
|
|
960
|
+
values: o
|
|
918
961
|
});
|
|
919
962
|
}
|
|
920
|
-
return
|
|
921
|
-
conditional:
|
|
922
|
-
expressions:
|
|
963
|
+
return a.length === 0 ? void 0 : {
|
|
964
|
+
conditional: Ae.And,
|
|
965
|
+
expressions: a
|
|
923
966
|
};
|
|
924
967
|
}
|
|
925
968
|
return t;
|
|
926
969
|
}
|
|
927
970
|
}
|
|
928
|
-
function
|
|
971
|
+
function yt({ ctx: e }) {
|
|
929
972
|
return ({ handle: t, defaultSort: r }) => {
|
|
930
|
-
const
|
|
973
|
+
const a = q({
|
|
931
974
|
data: null,
|
|
932
975
|
error: null,
|
|
933
976
|
isFetching: !1
|
|
934
|
-
}),
|
|
935
|
-
let n = r ?? e.config.sorts[0]?.code;
|
|
936
|
-
const
|
|
977
|
+
}), c = Y();
|
|
978
|
+
let n = r ?? e.config.sorts[0]?.code, i = 0;
|
|
979
|
+
const u = F();
|
|
937
980
|
return {
|
|
938
|
-
state:
|
|
939
|
-
async execute(
|
|
981
|
+
state: a,
|
|
982
|
+
async execute(s = {}) {
|
|
940
983
|
const {
|
|
941
|
-
page:
|
|
942
|
-
limit:
|
|
943
|
-
filters:
|
|
944
|
-
sort:
|
|
945
|
-
signal:
|
|
946
|
-
includeMeta:
|
|
947
|
-
linking:
|
|
948
|
-
transformRequest:
|
|
949
|
-
} =
|
|
950
|
-
n =
|
|
951
|
-
const
|
|
984
|
+
page: d = K,
|
|
985
|
+
limit: o = X,
|
|
986
|
+
filters: l,
|
|
987
|
+
sort: g,
|
|
988
|
+
signal: p,
|
|
989
|
+
includeMeta: h = e.config.includeMeta ?? !1,
|
|
990
|
+
linking: w,
|
|
991
|
+
transformRequest: S
|
|
992
|
+
} = s, I = g ?? n;
|
|
993
|
+
n = I;
|
|
994
|
+
const C = ++i, O = c.next(p), b = z({
|
|
952
995
|
prefix: "/browse",
|
|
953
996
|
id: t,
|
|
954
|
-
params: { sort:
|
|
955
|
-
}), { data:
|
|
956
|
-
key:
|
|
997
|
+
params: { sort: I, page: d, limit: o, filters: l, linking: w }
|
|
998
|
+
}), { data: T, error: f } = await e.coordinator.resolve({
|
|
999
|
+
key: b,
|
|
957
1000
|
cache: e.cache,
|
|
958
|
-
signal:
|
|
1001
|
+
signal: O,
|
|
959
1002
|
onFetch: () => {
|
|
960
|
-
|
|
1003
|
+
a.value = x({ state: a.value });
|
|
961
1004
|
},
|
|
962
|
-
fn: async (
|
|
963
|
-
const { data:
|
|
1005
|
+
fn: async (m) => {
|
|
1006
|
+
const { data: v, error: E } = await e.layers.browse(
|
|
964
1007
|
{
|
|
965
1008
|
collectionHandle: t,
|
|
966
|
-
sort_order_code:
|
|
967
|
-
pagination: { page:
|
|
968
|
-
filter_group: J(e,
|
|
969
|
-
dynamicLinking:
|
|
970
|
-
transformBody:
|
|
1009
|
+
sort_order_code: I,
|
|
1010
|
+
pagination: { page: d, limit: o },
|
|
1011
|
+
filter_group: J(e, l),
|
|
1012
|
+
dynamicLinking: w,
|
|
1013
|
+
transformBody: S
|
|
971
1014
|
},
|
|
972
|
-
|
|
1015
|
+
m
|
|
973
1016
|
);
|
|
974
|
-
if (
|
|
975
|
-
const { results:
|
|
976
|
-
results:
|
|
977
|
-
meta:
|
|
1017
|
+
if (E) return y(E);
|
|
1018
|
+
const { results: R, _meta: N } = v, _ = W({
|
|
1019
|
+
results: R,
|
|
1020
|
+
meta: N,
|
|
978
1021
|
currencyCode: e.config.currency,
|
|
979
1022
|
formatPrice: e.config.formatPrice,
|
|
980
1023
|
swatches: e.config.swatches,
|
|
981
1024
|
extender: e.config.transforms?.product
|
|
982
|
-
}),
|
|
983
|
-
products:
|
|
984
|
-
raw:
|
|
1025
|
+
}), A = Z({
|
|
1026
|
+
products: _,
|
|
1027
|
+
raw: v,
|
|
985
1028
|
extender: e.config.transforms?.collection,
|
|
986
1029
|
currencyCode: e.config.currency,
|
|
987
1030
|
formatPrice: e.config.formatPrice
|
|
988
1031
|
});
|
|
989
|
-
return
|
|
1032
|
+
return h && v._meta && (A._meta = v._meta), b && e.cache.set(b, A), k(A);
|
|
990
1033
|
}
|
|
991
1034
|
});
|
|
992
|
-
return
|
|
1035
|
+
return C !== i ? f ? y(f) : k(T) : f ? (a.value = P({ error: f, data: a.value.data }), y(f)) : (a.value = D({ data: T }), k(T));
|
|
993
1036
|
},
|
|
994
|
-
subscribe(
|
|
995
|
-
return
|
|
1037
|
+
subscribe(s) {
|
|
1038
|
+
return u.add(V(a, s));
|
|
996
1039
|
},
|
|
997
1040
|
dispose() {
|
|
998
|
-
|
|
1041
|
+
u.clear(), c.abort();
|
|
999
1042
|
}
|
|
1000
1043
|
};
|
|
1001
1044
|
};
|
|
1002
1045
|
}
|
|
1003
|
-
function
|
|
1046
|
+
function vt(e, t) {
|
|
1004
1047
|
return t?.aborted ? Promise.resolve() : new Promise((r) => {
|
|
1005
|
-
const
|
|
1048
|
+
const a = setTimeout(r, e);
|
|
1006
1049
|
t?.addEventListener(
|
|
1007
1050
|
"abort",
|
|
1008
1051
|
() => {
|
|
1009
|
-
clearTimeout(
|
|
1052
|
+
clearTimeout(a), r();
|
|
1010
1053
|
},
|
|
1011
1054
|
{ once: !0 }
|
|
1012
1055
|
);
|
|
1013
1056
|
});
|
|
1014
1057
|
}
|
|
1015
|
-
async function
|
|
1058
|
+
async function _t(e, { maxRetries: t = 3, defaultDelayMs: r = 1e3, signal: a, shouldRetry: c }) {
|
|
1016
1059
|
let n = await e();
|
|
1017
|
-
for (let
|
|
1060
|
+
for (let i = 0; i < t && n.error && !(!c(n.error) || a?.aborted); i++) {
|
|
1018
1061
|
const u = "retryAfterMs" in n.error ? n.error.retryAfterMs ?? r : r;
|
|
1019
|
-
if (await
|
|
1062
|
+
if (await vt(u, a), a?.aborted) break;
|
|
1020
1063
|
n = await e();
|
|
1021
1064
|
}
|
|
1022
1065
|
return n;
|
|
1023
1066
|
}
|
|
1024
|
-
function
|
|
1067
|
+
function bt(e) {
|
|
1025
1068
|
return e._tag === "ApiError" && e.status === 425;
|
|
1026
1069
|
}
|
|
1027
|
-
function
|
|
1070
|
+
function Et({ ctx: e }) {
|
|
1028
1071
|
return (t = {}) => {
|
|
1029
1072
|
const r = q({
|
|
1030
1073
|
data: null,
|
|
1031
1074
|
error: null,
|
|
1032
1075
|
isFetching: !1
|
|
1033
1076
|
});
|
|
1034
|
-
let
|
|
1077
|
+
let a = {
|
|
1035
1078
|
query: t.query,
|
|
1036
1079
|
page: t.page,
|
|
1037
1080
|
limit: t.limit,
|
|
@@ -1040,210 +1083,212 @@ function bt({ ctx: e }) {
|
|
|
1040
1083
|
linking: t.linking,
|
|
1041
1084
|
transformRequest: t.transformRequest
|
|
1042
1085
|
};
|
|
1043
|
-
const
|
|
1044
|
-
let n;
|
|
1045
|
-
const
|
|
1046
|
-
function
|
|
1047
|
-
const { signal:
|
|
1048
|
-
return
|
|
1086
|
+
const c = Y(t.signal);
|
|
1087
|
+
let n, i = 0;
|
|
1088
|
+
const u = F();
|
|
1089
|
+
function s(d = {}) {
|
|
1090
|
+
const { signal: o, searchId: l, temporary: g, ...p } = d, h = { ...a, ...p };
|
|
1091
|
+
return g || (a = h), { ...h, signal: o, searchId: l };
|
|
1049
1092
|
}
|
|
1050
1093
|
return {
|
|
1051
1094
|
state: r,
|
|
1052
|
-
async prepare(
|
|
1053
|
-
const
|
|
1054
|
-
if (!
|
|
1055
|
-
return
|
|
1095
|
+
async prepare(d = {}) {
|
|
1096
|
+
const o = s(d), { query: l, filters: g, tuning: p, linking: h, transformRequest: w } = o;
|
|
1097
|
+
if (!l)
|
|
1098
|
+
return y(
|
|
1056
1099
|
B({
|
|
1057
1100
|
operation: "search.prepare",
|
|
1058
1101
|
fields: [M("query", "REQUIRED_FIELD", "query is required")]
|
|
1059
1102
|
})
|
|
1060
1103
|
);
|
|
1061
|
-
const
|
|
1104
|
+
const S = J(e, g), I = await e.layers.prepareSearch(
|
|
1062
1105
|
{
|
|
1063
|
-
query:
|
|
1064
|
-
filter_group:
|
|
1065
|
-
tuning:
|
|
1066
|
-
dynamicLinking:
|
|
1067
|
-
transformBody:
|
|
1106
|
+
query: l,
|
|
1107
|
+
filter_group: S,
|
|
1108
|
+
tuning: p,
|
|
1109
|
+
dynamicLinking: h,
|
|
1110
|
+
transformBody: w
|
|
1068
1111
|
},
|
|
1069
|
-
|
|
1112
|
+
d.signal
|
|
1070
1113
|
);
|
|
1071
|
-
return
|
|
1114
|
+
return I.error ? y(I.error) : (n = I.data.search_id, k({ searchId: I.data.search_id }));
|
|
1072
1115
|
},
|
|
1073
|
-
async execute(
|
|
1074
|
-
const
|
|
1075
|
-
query:
|
|
1076
|
-
page:
|
|
1077
|
-
limit:
|
|
1078
|
-
filters:
|
|
1079
|
-
tuning:
|
|
1080
|
-
linking:
|
|
1081
|
-
transformRequest:
|
|
1082
|
-
} =
|
|
1083
|
-
if (!
|
|
1084
|
-
const
|
|
1116
|
+
async execute(d = {}) {
|
|
1117
|
+
const o = s(d), {
|
|
1118
|
+
query: l,
|
|
1119
|
+
page: g = K,
|
|
1120
|
+
limit: p = X,
|
|
1121
|
+
filters: h,
|
|
1122
|
+
tuning: w,
|
|
1123
|
+
linking: S,
|
|
1124
|
+
transformRequest: I
|
|
1125
|
+
} = o;
|
|
1126
|
+
if (!l) {
|
|
1127
|
+
const R = B({
|
|
1085
1128
|
operation: "search.execute",
|
|
1086
1129
|
fields: [M("query", "REQUIRED_FIELD", "query is required")]
|
|
1087
1130
|
});
|
|
1088
|
-
return r.value =
|
|
1131
|
+
return r.value = P({ error: R, data: r.value.data }), y(R);
|
|
1089
1132
|
}
|
|
1090
|
-
const
|
|
1133
|
+
const C = d.searchId, O = J(e, h), b = ++i, T = c.next(d.signal), f = C ?? n;
|
|
1091
1134
|
n = void 0;
|
|
1092
|
-
const
|
|
1135
|
+
const m = z({
|
|
1093
1136
|
prefix: "/search",
|
|
1094
|
-
id:
|
|
1095
|
-
params: { page:
|
|
1096
|
-
}), { data:
|
|
1097
|
-
key:
|
|
1137
|
+
id: l,
|
|
1138
|
+
params: { page: g, limit: p, filters: h, tuning: w, linking: S }
|
|
1139
|
+
}), { data: v, error: E } = await e.coordinator.resolve({
|
|
1140
|
+
key: m,
|
|
1098
1141
|
cache: e.cache,
|
|
1099
|
-
signal:
|
|
1142
|
+
signal: T,
|
|
1100
1143
|
onFetch: () => {
|
|
1101
1144
|
r.value = x({ state: r.value });
|
|
1102
1145
|
},
|
|
1103
|
-
fn: async (
|
|
1104
|
-
let
|
|
1105
|
-
if (!
|
|
1106
|
-
const
|
|
1146
|
+
fn: async (R) => {
|
|
1147
|
+
let N = f;
|
|
1148
|
+
if (!N) {
|
|
1149
|
+
const re = await e.layers.prepareSearch(
|
|
1107
1150
|
{
|
|
1108
|
-
query:
|
|
1109
|
-
filter_group:
|
|
1110
|
-
tuning:
|
|
1111
|
-
dynamicLinking:
|
|
1112
|
-
transformBody:
|
|
1151
|
+
query: l,
|
|
1152
|
+
filter_group: O,
|
|
1153
|
+
tuning: w,
|
|
1154
|
+
dynamicLinking: S,
|
|
1155
|
+
transformBody: I
|
|
1113
1156
|
},
|
|
1114
|
-
|
|
1157
|
+
R
|
|
1115
1158
|
);
|
|
1116
|
-
if (
|
|
1117
|
-
|
|
1159
|
+
if (re.error) return y(re.error);
|
|
1160
|
+
N = re.data.search_id;
|
|
1118
1161
|
}
|
|
1119
|
-
const
|
|
1162
|
+
const _ = await _t(
|
|
1120
1163
|
() => e.layers.search(
|
|
1121
1164
|
{
|
|
1122
|
-
query:
|
|
1123
|
-
search_id:
|
|
1124
|
-
pagination: { page:
|
|
1125
|
-
filter_group:
|
|
1126
|
-
tuning:
|
|
1127
|
-
dynamicLinking:
|
|
1128
|
-
transformBody:
|
|
1165
|
+
query: l,
|
|
1166
|
+
search_id: N,
|
|
1167
|
+
pagination: { page: g, limit: p },
|
|
1168
|
+
filter_group: O,
|
|
1169
|
+
tuning: w,
|
|
1170
|
+
dynamicLinking: S,
|
|
1171
|
+
transformBody: I
|
|
1129
1172
|
},
|
|
1130
|
-
|
|
1173
|
+
R
|
|
1131
1174
|
),
|
|
1132
1175
|
{
|
|
1133
|
-
maxRetries:
|
|
1134
|
-
defaultDelayMs:
|
|
1135
|
-
signal:
|
|
1136
|
-
shouldRetry:
|
|
1176
|
+
maxRetries: Ue,
|
|
1177
|
+
defaultDelayMs: Me,
|
|
1178
|
+
signal: R,
|
|
1179
|
+
shouldRetry: bt
|
|
1137
1180
|
}
|
|
1138
1181
|
);
|
|
1139
|
-
if (
|
|
1140
|
-
const { results:
|
|
1141
|
-
results:
|
|
1142
|
-
meta:
|
|
1182
|
+
if (_.error) return y(_.error);
|
|
1183
|
+
const { results: A, _meta: ee } = _.data, ke = W({
|
|
1184
|
+
results: A,
|
|
1185
|
+
meta: ee,
|
|
1143
1186
|
currencyCode: e.config.currency,
|
|
1144
1187
|
formatPrice: e.config.formatPrice,
|
|
1145
1188
|
swatches: e.config.swatches,
|
|
1146
1189
|
extender: e.config.transforms?.product
|
|
1147
|
-
}),
|
|
1148
|
-
products:
|
|
1149
|
-
raw:
|
|
1190
|
+
}), te = Z({
|
|
1191
|
+
products: ke,
|
|
1192
|
+
raw: _.data,
|
|
1150
1193
|
extender: e.config.transforms?.search,
|
|
1151
1194
|
currencyCode: e.config.currency,
|
|
1152
1195
|
formatPrice: e.config.formatPrice
|
|
1153
1196
|
});
|
|
1154
|
-
return e.config.includeMeta &&
|
|
1197
|
+
return e.config.includeMeta && _.data._meta && (te._meta = _.data._meta), m && e.cache.set(m, te), k(te);
|
|
1155
1198
|
}
|
|
1156
1199
|
});
|
|
1157
|
-
return
|
|
1200
|
+
return b !== i ? E ? y(E) : k(v) : E ? (r.value = P({ error: E, data: r.value.data }), y(E)) : (r.value = D({ data: v }), k(v));
|
|
1158
1201
|
},
|
|
1159
|
-
subscribe(
|
|
1160
|
-
return
|
|
1202
|
+
subscribe(d) {
|
|
1203
|
+
return u.add(V(r, d));
|
|
1161
1204
|
},
|
|
1162
1205
|
dispose() {
|
|
1163
|
-
|
|
1206
|
+
u.clear(), c.abort();
|
|
1164
1207
|
}
|
|
1165
1208
|
};
|
|
1166
1209
|
};
|
|
1167
1210
|
}
|
|
1168
|
-
function
|
|
1211
|
+
function wt({ ctx: e }) {
|
|
1169
1212
|
return ({ blockId: t, anchor: r }) => {
|
|
1170
|
-
const
|
|
1213
|
+
const a = q({
|
|
1171
1214
|
data: null,
|
|
1172
1215
|
error: null,
|
|
1173
1216
|
isFetching: !1
|
|
1174
|
-
}),
|
|
1217
|
+
}), c = Y();
|
|
1218
|
+
let n = 0;
|
|
1219
|
+
const i = F();
|
|
1175
1220
|
return {
|
|
1176
|
-
state:
|
|
1177
|
-
async execute(
|
|
1221
|
+
state: a,
|
|
1222
|
+
async execute(u = {}) {
|
|
1178
1223
|
const {
|
|
1179
|
-
page:
|
|
1180
|
-
limit:
|
|
1181
|
-
filters:
|
|
1182
|
-
signal:
|
|
1183
|
-
discounts:
|
|
1184
|
-
context:
|
|
1185
|
-
linking:
|
|
1186
|
-
transformRequest:
|
|
1187
|
-
} =
|
|
1224
|
+
page: s = K,
|
|
1225
|
+
limit: d = X,
|
|
1226
|
+
filters: o,
|
|
1227
|
+
signal: l,
|
|
1228
|
+
discounts: g,
|
|
1229
|
+
context: p,
|
|
1230
|
+
linking: h,
|
|
1231
|
+
transformRequest: w
|
|
1232
|
+
} = u, S = ++n, I = c.next(l), C = z({
|
|
1188
1233
|
prefix: "/blocks",
|
|
1189
1234
|
id: t,
|
|
1190
|
-
params: { anchor: r, page:
|
|
1191
|
-
}), { data:
|
|
1192
|
-
key:
|
|
1235
|
+
params: { anchor: r, page: s, limit: d, filters: o, discounts: g, context: p, linking: h }
|
|
1236
|
+
}), { data: O, error: b } = await e.coordinator.resolve({
|
|
1237
|
+
key: C,
|
|
1193
1238
|
cache: e.cache,
|
|
1194
1239
|
signal: I,
|
|
1195
1240
|
onFetch: () => {
|
|
1196
|
-
|
|
1241
|
+
a.value = x({ state: a.value });
|
|
1197
1242
|
},
|
|
1198
|
-
fn: async (
|
|
1199
|
-
const { data:
|
|
1243
|
+
fn: async (T) => {
|
|
1244
|
+
const { data: f, error: m } = await e.layers.blocks(
|
|
1200
1245
|
{
|
|
1201
1246
|
blockId: t,
|
|
1202
1247
|
anchor_id: r,
|
|
1203
|
-
pagination: { page:
|
|
1204
|
-
filter_group: J(e,
|
|
1205
|
-
discountEntitlements:
|
|
1206
|
-
context:
|
|
1207
|
-
dynamicLinking:
|
|
1208
|
-
transformBody:
|
|
1248
|
+
pagination: { page: s, limit: d },
|
|
1249
|
+
filter_group: J(e, o),
|
|
1250
|
+
discountEntitlements: g,
|
|
1251
|
+
context: p,
|
|
1252
|
+
dynamicLinking: h,
|
|
1253
|
+
transformBody: w
|
|
1209
1254
|
},
|
|
1210
|
-
|
|
1255
|
+
T
|
|
1211
1256
|
);
|
|
1212
|
-
if (
|
|
1213
|
-
const { results:
|
|
1214
|
-
results:
|
|
1215
|
-
meta:
|
|
1257
|
+
if (m) return y(m);
|
|
1258
|
+
const { results: v, _meta: E } = f, R = W({
|
|
1259
|
+
results: v,
|
|
1260
|
+
meta: E,
|
|
1216
1261
|
currencyCode: e.config.currency,
|
|
1217
1262
|
formatPrice: e.config.formatPrice,
|
|
1218
1263
|
swatches: e.config.swatches,
|
|
1219
1264
|
extender: e.config.transforms?.product
|
|
1220
|
-
}),
|
|
1221
|
-
products:
|
|
1222
|
-
raw:
|
|
1265
|
+
}), N = Z({
|
|
1266
|
+
products: R,
|
|
1267
|
+
raw: f,
|
|
1223
1268
|
extender: e.config.transforms?.block,
|
|
1224
1269
|
currencyCode: e.config.currency,
|
|
1225
1270
|
formatPrice: e.config.formatPrice
|
|
1226
1271
|
});
|
|
1227
|
-
return e.config.includeMeta &&
|
|
1272
|
+
return e.config.includeMeta && f._meta && (N._meta = f._meta), f.block && (N.block = f.block), C && e.cache.set(C, N), k(N);
|
|
1228
1273
|
}
|
|
1229
1274
|
});
|
|
1230
|
-
return
|
|
1275
|
+
return S !== n ? b ? y(b) : k(O) : b ? (a.value = P({ error: b, data: a.value.data }), y(b)) : (a.value = D({ data: O }), k(O));
|
|
1231
1276
|
},
|
|
1232
|
-
subscribe(
|
|
1233
|
-
return
|
|
1277
|
+
subscribe(u) {
|
|
1278
|
+
return i.add(V(a, u));
|
|
1234
1279
|
},
|
|
1235
1280
|
dispose() {
|
|
1236
|
-
|
|
1281
|
+
i.clear(), c.abort();
|
|
1237
1282
|
}
|
|
1238
1283
|
};
|
|
1239
1284
|
};
|
|
1240
1285
|
}
|
|
1241
|
-
function
|
|
1286
|
+
function It(e, t) {
|
|
1242
1287
|
let r = null;
|
|
1243
1288
|
return {
|
|
1244
|
-
call(...
|
|
1289
|
+
call(...a) {
|
|
1245
1290
|
r && clearTimeout(r), r = setTimeout(() => {
|
|
1246
|
-
r = null, e(...
|
|
1291
|
+
r = null, e(...a);
|
|
1247
1292
|
}, t);
|
|
1248
1293
|
},
|
|
1249
1294
|
cancel() {
|
|
@@ -1251,159 +1296,159 @@ function wt(e, t) {
|
|
|
1251
1296
|
}
|
|
1252
1297
|
};
|
|
1253
1298
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const r = new Set(t.map((
|
|
1256
|
-
return e.filter((
|
|
1299
|
+
function At(e, t) {
|
|
1300
|
+
const r = new Set(t.map((a) => a.toLowerCase()));
|
|
1301
|
+
return e.filter((a) => !r.has(a.toLowerCase()));
|
|
1257
1302
|
}
|
|
1258
|
-
function
|
|
1303
|
+
function St({ ctx: e }) {
|
|
1259
1304
|
return (t = {}) => {
|
|
1260
1305
|
const {
|
|
1261
|
-
debounce: r =
|
|
1262
|
-
excludeInputQuery:
|
|
1263
|
-
excludeQueries:
|
|
1306
|
+
debounce: r = Ve,
|
|
1307
|
+
excludeInputQuery: a = !1,
|
|
1308
|
+
excludeQueries: c,
|
|
1264
1309
|
signal: n
|
|
1265
|
-
} = t,
|
|
1310
|
+
} = t, i = q({
|
|
1266
1311
|
data: null,
|
|
1267
1312
|
error: null,
|
|
1268
1313
|
isFetching: !1
|
|
1269
1314
|
}), u = Y(n);
|
|
1270
|
-
let
|
|
1271
|
-
const
|
|
1272
|
-
function
|
|
1273
|
-
|
|
1315
|
+
let s = 0;
|
|
1316
|
+
const d = /* @__PURE__ */ new Map(), o = F();
|
|
1317
|
+
function l() {
|
|
1318
|
+
o.clear(), g.cancel(), u.abort(), d.clear(), n?.removeEventListener("abort", l);
|
|
1274
1319
|
}
|
|
1275
|
-
n?.addEventListener("abort",
|
|
1276
|
-
const
|
|
1277
|
-
const
|
|
1278
|
-
if (!
|
|
1279
|
-
|
|
1320
|
+
n?.addEventListener("abort", l, { once: !0 });
|
|
1321
|
+
const g = It(async (h) => {
|
|
1322
|
+
const w = h.trim();
|
|
1323
|
+
if (!w) {
|
|
1324
|
+
i.value = { data: null, error: null, isFetching: !1 };
|
|
1280
1325
|
return;
|
|
1281
1326
|
}
|
|
1282
|
-
const
|
|
1283
|
-
if (
|
|
1284
|
-
|
|
1327
|
+
const S = w.toLowerCase(), I = d.get(S);
|
|
1328
|
+
if (I) {
|
|
1329
|
+
i.value = D({ data: I });
|
|
1285
1330
|
return;
|
|
1286
1331
|
}
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1289
|
-
const b = await e.layers.predictiveSearch(
|
|
1290
|
-
if (
|
|
1332
|
+
const C = u.next(), O = ++s;
|
|
1333
|
+
i.value = x({ state: i.value });
|
|
1334
|
+
const b = await e.layers.predictiveSearch(w, C);
|
|
1335
|
+
if (O === s)
|
|
1291
1336
|
if (b.error)
|
|
1292
|
-
b.error._tag !== "NetworkError" || b.error.code !== "ABORTED" ?
|
|
1337
|
+
b.error._tag !== "NetworkError" || b.error.code !== "ABORTED" ? i.value = P({ error: b.error }) : i.value = x({ state: i.value, isFetching: !1 });
|
|
1293
1338
|
else {
|
|
1294
|
-
const
|
|
1295
|
-
...
|
|
1296
|
-
...
|
|
1297
|
-
], f =
|
|
1339
|
+
const T = [
|
|
1340
|
+
...a ? [b.data.originalQuery, b.data.normalizedQuery] : [],
|
|
1341
|
+
...c ?? []
|
|
1342
|
+
], f = T.length ? {
|
|
1298
1343
|
...b.data,
|
|
1299
|
-
matchedQueries:
|
|
1344
|
+
matchedQueries: At(b.data.matchedQueries, T)
|
|
1300
1345
|
} : b.data;
|
|
1301
|
-
|
|
1346
|
+
d.set(S, f), d.size > $e && d.delete(d.keys().next().value), i.value = D({ data: f });
|
|
1302
1347
|
}
|
|
1303
1348
|
}, r);
|
|
1304
|
-
function
|
|
1305
|
-
return
|
|
1349
|
+
function p(h) {
|
|
1350
|
+
return o.add(V(i, h));
|
|
1306
1351
|
}
|
|
1307
1352
|
return {
|
|
1308
|
-
state:
|
|
1309
|
-
execute: (
|
|
1310
|
-
subscribe:
|
|
1311
|
-
dispose:
|
|
1353
|
+
state: i,
|
|
1354
|
+
execute: (h) => g.call(h),
|
|
1355
|
+
subscribe: p,
|
|
1356
|
+
dispose: l
|
|
1312
1357
|
};
|
|
1313
1358
|
};
|
|
1314
1359
|
}
|
|
1315
|
-
function
|
|
1360
|
+
function Rt({ ctx: e }) {
|
|
1316
1361
|
return ({ image: t, signal: r }) => {
|
|
1317
|
-
const
|
|
1362
|
+
const a = q({
|
|
1318
1363
|
data: null,
|
|
1319
1364
|
error: null,
|
|
1320
1365
|
isFetching: !0
|
|
1321
|
-
}),
|
|
1366
|
+
}), c = F(), n = _e(r);
|
|
1322
1367
|
return (async () => {
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
1368
|
+
const i = await e.layers.uploadImage(t, n.signal);
|
|
1369
|
+
if (i.error) {
|
|
1370
|
+
a.value = P({ error: i.error });
|
|
1326
1371
|
return;
|
|
1327
1372
|
}
|
|
1328
|
-
|
|
1329
|
-
})().catch((
|
|
1330
|
-
|
|
1331
|
-
error: Q({ code: "CONNECTION_FAILED", message: String(
|
|
1373
|
+
a.value = D({ data: { imageId: i.data.imageId } });
|
|
1374
|
+
})().catch((i) => {
|
|
1375
|
+
a.value = P({
|
|
1376
|
+
error: Q({ code: "CONNECTION_FAILED", message: String(i) })
|
|
1332
1377
|
});
|
|
1333
1378
|
}), {
|
|
1334
|
-
state:
|
|
1335
|
-
subscribe(
|
|
1336
|
-
return
|
|
1379
|
+
state: a,
|
|
1380
|
+
subscribe(i) {
|
|
1381
|
+
return c.add(V(a, i));
|
|
1337
1382
|
},
|
|
1338
1383
|
dispose() {
|
|
1339
|
-
|
|
1384
|
+
c.clear(), n.abort();
|
|
1340
1385
|
}
|
|
1341
1386
|
};
|
|
1342
1387
|
};
|
|
1343
1388
|
}
|
|
1344
|
-
function
|
|
1389
|
+
function Tt({ ctx: e }) {
|
|
1345
1390
|
return (t) => {
|
|
1346
1391
|
const {
|
|
1347
1392
|
imageId: r,
|
|
1348
|
-
page:
|
|
1349
|
-
limit:
|
|
1393
|
+
page: a = K,
|
|
1394
|
+
limit: c = X,
|
|
1350
1395
|
filters: n,
|
|
1351
|
-
tuning:
|
|
1396
|
+
tuning: i,
|
|
1352
1397
|
signal: u,
|
|
1353
|
-
linking:
|
|
1354
|
-
transformRequest:
|
|
1355
|
-
} = t,
|
|
1398
|
+
linking: s,
|
|
1399
|
+
transformRequest: d
|
|
1400
|
+
} = t, o = q({
|
|
1356
1401
|
data: null,
|
|
1357
1402
|
error: null,
|
|
1358
1403
|
isFetching: !0
|
|
1359
|
-
}),
|
|
1404
|
+
}), l = F(), g = _e(u);
|
|
1360
1405
|
return (async () => {
|
|
1361
|
-
const
|
|
1406
|
+
const p = await e.layers.imageSearch(
|
|
1362
1407
|
{
|
|
1363
1408
|
image_id: r,
|
|
1364
|
-
pagination: { page:
|
|
1409
|
+
pagination: { page: a, limit: c },
|
|
1365
1410
|
filter_group: J(e, n),
|
|
1366
|
-
tuning:
|
|
1367
|
-
dynamicLinking:
|
|
1368
|
-
transformBody:
|
|
1411
|
+
tuning: i,
|
|
1412
|
+
dynamicLinking: s,
|
|
1413
|
+
transformBody: d
|
|
1369
1414
|
},
|
|
1370
|
-
|
|
1415
|
+
g.signal
|
|
1371
1416
|
);
|
|
1372
|
-
if (
|
|
1373
|
-
|
|
1417
|
+
if (p.error) {
|
|
1418
|
+
o.value = P({ error: p.error });
|
|
1374
1419
|
return;
|
|
1375
1420
|
}
|
|
1376
|
-
const { results:
|
|
1377
|
-
results:
|
|
1378
|
-
meta:
|
|
1421
|
+
const { results: h, _meta: w } = p.data, S = W({
|
|
1422
|
+
results: h,
|
|
1423
|
+
meta: w,
|
|
1379
1424
|
currencyCode: e.config.currency,
|
|
1380
1425
|
formatPrice: e.config.formatPrice,
|
|
1381
1426
|
swatches: e.config.swatches,
|
|
1382
1427
|
extender: e.config.transforms?.product
|
|
1383
|
-
}),
|
|
1384
|
-
products:
|
|
1385
|
-
raw:
|
|
1428
|
+
}), I = Z({
|
|
1429
|
+
products: S,
|
|
1430
|
+
raw: p.data,
|
|
1386
1431
|
extender: e.config.transforms?.search,
|
|
1387
1432
|
currencyCode: e.config.currency,
|
|
1388
1433
|
formatPrice: e.config.formatPrice
|
|
1389
1434
|
});
|
|
1390
|
-
|
|
1391
|
-
})().catch((
|
|
1392
|
-
|
|
1393
|
-
error: Q({ code: "CONNECTION_FAILED", message: String(
|
|
1435
|
+
o.value = D({ data: I });
|
|
1436
|
+
})().catch((p) => {
|
|
1437
|
+
o.value = P({
|
|
1438
|
+
error: Q({ code: "CONNECTION_FAILED", message: String(p) })
|
|
1394
1439
|
});
|
|
1395
1440
|
}), {
|
|
1396
|
-
state:
|
|
1397
|
-
subscribe(
|
|
1398
|
-
return
|
|
1441
|
+
state: o,
|
|
1442
|
+
subscribe(p) {
|
|
1443
|
+
return l.add(V(o, p));
|
|
1399
1444
|
},
|
|
1400
1445
|
dispose() {
|
|
1401
|
-
|
|
1446
|
+
l.clear(), g.abort();
|
|
1402
1447
|
}
|
|
1403
1448
|
};
|
|
1404
1449
|
};
|
|
1405
1450
|
}
|
|
1406
|
-
function
|
|
1451
|
+
function Ct(e) {
|
|
1407
1452
|
return {
|
|
1408
1453
|
title: e.title,
|
|
1409
1454
|
handle: e.handle,
|
|
@@ -1414,14 +1459,14 @@ function Tt(e) {
|
|
|
1414
1459
|
publishedAt: e.published_at
|
|
1415
1460
|
};
|
|
1416
1461
|
}
|
|
1417
|
-
function
|
|
1462
|
+
function Ot({ ctx: e }) {
|
|
1418
1463
|
return (t = {}) => {
|
|
1419
1464
|
const r = q({
|
|
1420
1465
|
data: null,
|
|
1421
1466
|
error: null,
|
|
1422
1467
|
isFetching: !1
|
|
1423
1468
|
});
|
|
1424
|
-
let
|
|
1469
|
+
let a = {
|
|
1425
1470
|
query: t.query,
|
|
1426
1471
|
contentType: t.contentType,
|
|
1427
1472
|
page: t.page,
|
|
@@ -1429,77 +1474,79 @@ function Ct({ ctx: e }) {
|
|
|
1429
1474
|
tuning: t.tuning,
|
|
1430
1475
|
transformRequest: t.transformRequest
|
|
1431
1476
|
};
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1477
|
+
const c = Y(t.signal);
|
|
1478
|
+
let n = 0;
|
|
1479
|
+
const i = F();
|
|
1480
|
+
function u(s = {}) {
|
|
1481
|
+
const { signal: d, temporary: o, ...l } = s, g = { ...a, ...l };
|
|
1482
|
+
return o || (a = g), { ...g, signal: d };
|
|
1436
1483
|
}
|
|
1437
1484
|
return {
|
|
1438
1485
|
state: r,
|
|
1439
|
-
async execute(
|
|
1440
|
-
const
|
|
1441
|
-
query:
|
|
1442
|
-
contentType:
|
|
1443
|
-
page:
|
|
1444
|
-
limit:
|
|
1445
|
-
tuning:
|
|
1446
|
-
transformRequest:
|
|
1447
|
-
} =
|
|
1448
|
-
if (!
|
|
1449
|
-
const
|
|
1486
|
+
async execute(s = {}) {
|
|
1487
|
+
const d = u(s), {
|
|
1488
|
+
query: o,
|
|
1489
|
+
contentType: l,
|
|
1490
|
+
page: g = K,
|
|
1491
|
+
limit: p = X,
|
|
1492
|
+
tuning: h,
|
|
1493
|
+
transformRequest: w
|
|
1494
|
+
} = d;
|
|
1495
|
+
if (!o) {
|
|
1496
|
+
const T = B({
|
|
1450
1497
|
operation: "searchContent.execute",
|
|
1451
1498
|
fields: [M("query", "REQUIRED_FIELD", "query is required")]
|
|
1452
1499
|
});
|
|
1453
|
-
return r.value =
|
|
1500
|
+
return r.value = P({ error: T, data: r.value.data }), y(T);
|
|
1454
1501
|
}
|
|
1455
|
-
const
|
|
1502
|
+
const S = c.next(s.signal), I = ++n, C = z({
|
|
1456
1503
|
prefix: "/search-content",
|
|
1457
|
-
id:
|
|
1458
|
-
params: { contentType:
|
|
1459
|
-
}), { data:
|
|
1460
|
-
key:
|
|
1504
|
+
id: o,
|
|
1505
|
+
params: { contentType: l, page: g, limit: p, tuning: h }
|
|
1506
|
+
}), { data: O, error: b } = await e.coordinator.resolve({
|
|
1507
|
+
key: C,
|
|
1461
1508
|
cache: e.cache,
|
|
1462
|
-
signal:
|
|
1509
|
+
signal: S,
|
|
1463
1510
|
onFetch: () => {
|
|
1464
1511
|
r.value = x({ state: r.value });
|
|
1465
1512
|
},
|
|
1466
|
-
fn: async (
|
|
1467
|
-
const
|
|
1513
|
+
fn: async (T) => {
|
|
1514
|
+
const f = await e.layers.searchContent(
|
|
1468
1515
|
{
|
|
1469
|
-
query:
|
|
1470
|
-
content_type:
|
|
1471
|
-
pagination: { page:
|
|
1472
|
-
tuning:
|
|
1473
|
-
transformBody:
|
|
1516
|
+
query: o,
|
|
1517
|
+
content_type: l,
|
|
1518
|
+
pagination: { page: g, limit: p },
|
|
1519
|
+
tuning: h,
|
|
1520
|
+
transformBody: w
|
|
1474
1521
|
},
|
|
1475
|
-
|
|
1522
|
+
T
|
|
1476
1523
|
);
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
let
|
|
1480
|
-
articles:
|
|
1481
|
-
query:
|
|
1482
|
-
contentType:
|
|
1483
|
-
totalResults:
|
|
1484
|
-
page:
|
|
1485
|
-
resultsPerPage:
|
|
1524
|
+
if (f.error) return y(f.error);
|
|
1525
|
+
const m = f.data;
|
|
1526
|
+
let v = {
|
|
1527
|
+
articles: m.results.map(Ct),
|
|
1528
|
+
query: m.query,
|
|
1529
|
+
contentType: m.contentType,
|
|
1530
|
+
totalResults: m.totalResults,
|
|
1531
|
+
page: m.page,
|
|
1532
|
+
resultsPerPage: m.resultsPerPage
|
|
1486
1533
|
};
|
|
1487
|
-
return e.config.transforms?.searchContent && (
|
|
1534
|
+
return e.config.transforms?.searchContent && (v = e.config.transforms.searchContent(v, m)), C && e.cache.set(C, v), k(v);
|
|
1488
1535
|
}
|
|
1489
1536
|
});
|
|
1490
|
-
return
|
|
1537
|
+
return I !== n ? b ? y(b) : k(O) : b ? (r.value = P({ error: b, data: r.value.data }), y(b)) : (r.value = D({ data: O }), k(O));
|
|
1491
1538
|
},
|
|
1492
|
-
subscribe(
|
|
1493
|
-
return
|
|
1539
|
+
subscribe(s) {
|
|
1540
|
+
return i.add(V(r, s));
|
|
1494
1541
|
},
|
|
1495
1542
|
dispose() {
|
|
1496
|
-
|
|
1543
|
+
i.clear(), c.abort();
|
|
1497
1544
|
}
|
|
1498
1545
|
};
|
|
1499
1546
|
};
|
|
1500
1547
|
}
|
|
1501
|
-
function
|
|
1502
|
-
const t =
|
|
1548
|
+
function zt(e) {
|
|
1549
|
+
const t = ze({
|
|
1503
1550
|
token: e.token,
|
|
1504
1551
|
baseUrl: e.baseUrl,
|
|
1505
1552
|
sorts: e.sorts,
|
|
@@ -1507,151 +1554,148 @@ function Yt(e) {
|
|
|
1507
1554
|
attributes: e.attributes,
|
|
1508
1555
|
fetch: e.fetch
|
|
1509
1556
|
});
|
|
1510
|
-
if (t.error) return
|
|
1511
|
-
const r = t.data,
|
|
1557
|
+
if (t.error) return y(t.error);
|
|
1558
|
+
const r = t.data, a = tt({
|
|
1512
1559
|
maxEntries: e.cacheLimit,
|
|
1513
1560
|
ttl: e.cacheLifetime,
|
|
1514
1561
|
storageAdapter: e.storage
|
|
1515
1562
|
});
|
|
1516
|
-
if (e.restoreCache !== !1 &&
|
|
1517
|
-
for (const [u,
|
|
1518
|
-
|
|
1519
|
-
const
|
|
1563
|
+
if (e.restoreCache !== !1 && a.restore(), e.initialData)
|
|
1564
|
+
for (const [u, s] of Object.entries(e.initialData))
|
|
1565
|
+
a.set(u, s);
|
|
1566
|
+
const c = rt(), n = {
|
|
1520
1567
|
config: e,
|
|
1521
1568
|
layers: r,
|
|
1522
|
-
cache:
|
|
1523
|
-
coordinator:
|
|
1524
|
-
},
|
|
1569
|
+
cache: a,
|
|
1570
|
+
coordinator: c
|
|
1571
|
+
}, i = {
|
|
1525
1572
|
config: e,
|
|
1526
|
-
cache:
|
|
1527
|
-
collection:
|
|
1528
|
-
search:
|
|
1529
|
-
blocks:
|
|
1530
|
-
suggest:
|
|
1531
|
-
uploadImage:
|
|
1532
|
-
searchByImage:
|
|
1533
|
-
searchContent:
|
|
1573
|
+
cache: a,
|
|
1574
|
+
collection: yt({ ctx: n }),
|
|
1575
|
+
search: Et({ ctx: n }),
|
|
1576
|
+
blocks: wt({ ctx: n }),
|
|
1577
|
+
suggest: St({ ctx: n }),
|
|
1578
|
+
uploadImage: Rt({ ctx: n }),
|
|
1579
|
+
searchByImage: Tt({ ctx: n }),
|
|
1580
|
+
searchContent: Ot({ ctx: n })
|
|
1534
1581
|
};
|
|
1535
|
-
return
|
|
1582
|
+
return ht(i), k(i);
|
|
1536
1583
|
}
|
|
1537
|
-
function
|
|
1584
|
+
function Wt({
|
|
1538
1585
|
product: e,
|
|
1539
1586
|
selectedOptions: t = [],
|
|
1540
1587
|
breakoutOptions: r
|
|
1541
1588
|
}) {
|
|
1542
|
-
const
|
|
1543
|
-
const f = n.value.filter((
|
|
1544
|
-
return [...
|
|
1545
|
-
}),
|
|
1546
|
-
() =>
|
|
1547
|
-
),
|
|
1548
|
-
() =>
|
|
1549
|
-
variants:
|
|
1589
|
+
const a = r ?? e.breakoutOptions ?? [], c = new Set(a.map((f) => f.name)), n = q(t), i = q(null), u = F(), s = L(() => kt(e.variants, a)), d = L(() => {
|
|
1590
|
+
const f = n.value.filter((m) => !c.has(m.name));
|
|
1591
|
+
return [...a, ...f];
|
|
1592
|
+
}), o = L(
|
|
1593
|
+
() => Oe(s.value, d.value)
|
|
1594
|
+
), l = L(
|
|
1595
|
+
() => Nt({
|
|
1596
|
+
variants: s.value,
|
|
1550
1597
|
productOptions: e.options,
|
|
1551
1598
|
selectedOptions: n.value,
|
|
1552
|
-
breakoutOptions:
|
|
1553
|
-
breakoutNames:
|
|
1599
|
+
breakoutOptions: a,
|
|
1600
|
+
breakoutNames: c
|
|
1554
1601
|
})
|
|
1555
|
-
),
|
|
1556
|
-
const f =
|
|
1602
|
+
), g = L(() => e.options.find((m) => m.swatch)?.name ?? null), p = L(() => {
|
|
1603
|
+
const f = g.value;
|
|
1557
1604
|
if (!f) return /* @__PURE__ */ new Map();
|
|
1558
|
-
const
|
|
1559
|
-
for (const
|
|
1560
|
-
const E =
|
|
1561
|
-
E &&
|
|
1605
|
+
const m = /* @__PURE__ */ new Map();
|
|
1606
|
+
for (const v of s.value) {
|
|
1607
|
+
const E = v.selectedOptions.find((R) => R.name === f);
|
|
1608
|
+
E && m.set(v.numericId, E.value);
|
|
1562
1609
|
}
|
|
1563
|
-
return
|
|
1564
|
-
}),
|
|
1565
|
-
const f =
|
|
1566
|
-
return f ? e.options.filter((
|
|
1567
|
-
}),
|
|
1568
|
-
() =>
|
|
1610
|
+
return m;
|
|
1611
|
+
}), h = L(() => {
|
|
1612
|
+
const f = g.value;
|
|
1613
|
+
return f ? e.options.filter((m) => m.name === f).map((m) => m.value) : [];
|
|
1614
|
+
}), w = L(
|
|
1615
|
+
() => Lt({
|
|
1569
1616
|
images: e.images,
|
|
1570
|
-
swatchValues:
|
|
1571
|
-
variantSwatchMap:
|
|
1572
|
-
selectedVariantId:
|
|
1617
|
+
swatchValues: h.value,
|
|
1618
|
+
variantSwatchMap: p.value,
|
|
1619
|
+
selectedVariantId: o.value?.numericId ?? null
|
|
1573
1620
|
})
|
|
1574
|
-
),
|
|
1575
|
-
const f =
|
|
1576
|
-
if (!f?.image) return
|
|
1577
|
-
if (!
|
|
1578
|
-
const
|
|
1579
|
-
return
|
|
1580
|
-
(
|
|
1581
|
-
)) : f.image ? [f.image] :
|
|
1582
|
-
}),
|
|
1583
|
-
const f =
|
|
1621
|
+
), S = L(() => {
|
|
1622
|
+
const f = o.value;
|
|
1623
|
+
if (!f?.image) return w.value;
|
|
1624
|
+
if (!g.value) return f.image ? [f.image] : w.value;
|
|
1625
|
+
const v = p.value.get(f.numericId);
|
|
1626
|
+
return v ? w.value.filter((E) => E.variantIds.length === 0 ? !0 : E.variantIds.some(
|
|
1627
|
+
(R) => p.value.get(R) === v
|
|
1628
|
+
)) : f.image ? [f.image] : w.value;
|
|
1629
|
+
}), I = L(() => {
|
|
1630
|
+
const f = o.value;
|
|
1584
1631
|
if (!f) return { price: null, compareAtPrice: null, isOnSale: !1 };
|
|
1585
|
-
const
|
|
1586
|
-
return { price: f.price, compareAtPrice: f.compareAtPrice, isOnSale:
|
|
1587
|
-
}),
|
|
1588
|
-
const f =
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
const p = f.map((y) => y.price), w = p.reduce((y, S) => y.amount < S.amount ? y : S), E = p.reduce((y, S) => y.amount > S.amount ? y : S), C = f.map((y) => y.compareAtPrice).filter((y) => y !== null), P = C.length > 0 ? {
|
|
1592
|
-
min: C.reduce((y, S) => y.amount < S.amount ? y : S),
|
|
1593
|
-
max: C.reduce((y, S) => y.amount > S.amount ? y : S)
|
|
1632
|
+
const m = f.compareAtPrice !== null && f.compareAtPrice.amount > f.price.amount;
|
|
1633
|
+
return { price: f.price, compareAtPrice: f.compareAtPrice, isOnSale: m };
|
|
1634
|
+
}), C = L(() => {
|
|
1635
|
+
const f = s.value, m = f.map((_) => _.price), v = m.reduce((_, A) => _.amount < A.amount ? _ : A), E = m.reduce((_, A) => _.amount > A.amount ? _ : A), R = f.map((_) => _.compareAtPrice).filter((_) => _ !== null), N = R.length > 0 ? {
|
|
1636
|
+
min: R.reduce((_, A) => _.amount < A.amount ? _ : A),
|
|
1637
|
+
max: R.reduce((_, A) => _.amount > A.amount ? _ : A)
|
|
1594
1638
|
} : null;
|
|
1595
|
-
return { priceRange: { min:
|
|
1596
|
-
}),
|
|
1639
|
+
return { priceRange: { min: v, max: E }, compareAtPriceRange: N };
|
|
1640
|
+
}), O = L(() => {
|
|
1597
1641
|
const f = /* @__PURE__ */ new Set();
|
|
1598
|
-
for (const
|
|
1642
|
+
for (const m of l.value) f.add(m.name);
|
|
1599
1643
|
return f;
|
|
1600
|
-
}), b =
|
|
1601
|
-
const f = new Set(
|
|
1602
|
-
return [...
|
|
1603
|
-
}),
|
|
1604
|
-
const f =
|
|
1644
|
+
}), b = L(() => {
|
|
1645
|
+
const f = new Set(d.value.map((m) => m.name));
|
|
1646
|
+
return [...O.value].every((m) => f.has(m));
|
|
1647
|
+
}), T = L(() => {
|
|
1648
|
+
const f = i.value;
|
|
1605
1649
|
if (f !== null) return f;
|
|
1606
|
-
const
|
|
1607
|
-
if (!
|
|
1608
|
-
const
|
|
1609
|
-
return
|
|
1650
|
+
const m = o.value;
|
|
1651
|
+
if (!m?.image) return 1;
|
|
1652
|
+
const v = S.value.findIndex((E) => E.url === m.image?.url);
|
|
1653
|
+
return v >= 0 ? v + 1 : 1;
|
|
1610
1654
|
});
|
|
1611
1655
|
return u.add(
|
|
1612
|
-
|
|
1613
|
-
n.value,
|
|
1656
|
+
ie(() => {
|
|
1657
|
+
n.value, i.value = null;
|
|
1614
1658
|
})
|
|
1615
1659
|
), {
|
|
1616
1660
|
product: e,
|
|
1617
1661
|
// Reactive state
|
|
1618
|
-
variants:
|
|
1619
|
-
selectedVariant:
|
|
1620
|
-
options:
|
|
1621
|
-
images:
|
|
1622
|
-
price:
|
|
1623
|
-
priceRange:
|
|
1624
|
-
carouselPosition:
|
|
1662
|
+
variants: s,
|
|
1663
|
+
selectedVariant: o,
|
|
1664
|
+
options: l,
|
|
1665
|
+
images: S,
|
|
1666
|
+
price: I,
|
|
1667
|
+
priceRange: C,
|
|
1668
|
+
carouselPosition: T,
|
|
1625
1669
|
isSelectionComplete: b,
|
|
1626
1670
|
// Actions
|
|
1627
1671
|
selectOption(f) {
|
|
1628
|
-
const
|
|
1629
|
-
n.value =
|
|
1672
|
+
const m = n.value;
|
|
1673
|
+
n.value = m.filter((v) => v.name !== f.name).concat(f);
|
|
1630
1674
|
},
|
|
1631
1675
|
setSelectedOptions(f) {
|
|
1632
|
-
const
|
|
1633
|
-
n.value = [...
|
|
1676
|
+
const m = new Set(f.map((E) => E.name)), v = n.value.filter((E) => !m.has(E.name));
|
|
1677
|
+
n.value = [...v, ...f];
|
|
1634
1678
|
},
|
|
1635
1679
|
setSelectedVariant(f) {
|
|
1636
|
-
const
|
|
1637
|
-
if (!
|
|
1638
|
-
const
|
|
1639
|
-
n.value =
|
|
1680
|
+
const m = s.value.find((E) => E.numericId === f);
|
|
1681
|
+
if (!m) return;
|
|
1682
|
+
const v = m.selectedOptions.filter((E) => !c.has(E.name));
|
|
1683
|
+
n.value = v;
|
|
1640
1684
|
},
|
|
1641
1685
|
setCarouselPosition(f) {
|
|
1642
|
-
|
|
1686
|
+
i.value = f;
|
|
1643
1687
|
},
|
|
1644
1688
|
subscribe(f) {
|
|
1645
1689
|
return u.add(
|
|
1646
|
-
|
|
1690
|
+
ie(() => {
|
|
1647
1691
|
f({
|
|
1648
|
-
variants:
|
|
1649
|
-
selectedVariant:
|
|
1650
|
-
options:
|
|
1651
|
-
images:
|
|
1652
|
-
price:
|
|
1653
|
-
priceRange:
|
|
1654
|
-
carouselPosition:
|
|
1692
|
+
variants: s.value,
|
|
1693
|
+
selectedVariant: o.value,
|
|
1694
|
+
options: l.value,
|
|
1695
|
+
images: S.value,
|
|
1696
|
+
price: I.value,
|
|
1697
|
+
priceRange: C.value,
|
|
1698
|
+
carouselPosition: T.value,
|
|
1655
1699
|
isSelectionComplete: b.value
|
|
1656
1700
|
});
|
|
1657
1701
|
})
|
|
@@ -1665,138 +1709,138 @@ function zt({
|
|
|
1665
1709
|
function kt(e, t) {
|
|
1666
1710
|
return t.length === 0 ? e : e.filter(
|
|
1667
1711
|
(r) => t.every(
|
|
1668
|
-
(
|
|
1712
|
+
(a) => r.selectedOptions.some((c) => c.name === a.name && c.value === a.value)
|
|
1669
1713
|
)
|
|
1670
1714
|
);
|
|
1671
1715
|
}
|
|
1672
|
-
function
|
|
1716
|
+
function Oe(e, t) {
|
|
1673
1717
|
return t.length === 0 ? e.length === 1 ? e[0] : null : e.find(
|
|
1674
1718
|
(r) => t.every(
|
|
1675
|
-
(
|
|
1719
|
+
(a) => r.selectedOptions.some((c) => c.name === a.name && c.value === a.value)
|
|
1676
1720
|
)
|
|
1677
1721
|
) ?? null;
|
|
1678
1722
|
}
|
|
1679
|
-
function
|
|
1723
|
+
function Nt({
|
|
1680
1724
|
variants: e,
|
|
1681
1725
|
productOptions: t,
|
|
1682
1726
|
selectedOptions: r,
|
|
1683
|
-
breakoutOptions:
|
|
1684
|
-
breakoutNames:
|
|
1727
|
+
breakoutOptions: a,
|
|
1728
|
+
breakoutNames: c
|
|
1685
1729
|
}) {
|
|
1686
1730
|
const n = /* @__PURE__ */ new Set();
|
|
1687
|
-
for (const
|
|
1688
|
-
for (const
|
|
1689
|
-
|
|
1690
|
-
const
|
|
1691
|
-
for (const
|
|
1692
|
-
|
|
1731
|
+
for (const o of e)
|
|
1732
|
+
for (const l of o.selectedOptions)
|
|
1733
|
+
c.has(l.name) || n.add(`${l.name}:${l.value}`);
|
|
1734
|
+
const i = /* @__PURE__ */ new Map();
|
|
1735
|
+
for (const o of t)
|
|
1736
|
+
o.swatch && i.set(`${o.name}:${o.value}`, o.swatch);
|
|
1693
1737
|
const u = /* @__PURE__ */ new Set();
|
|
1694
|
-
for (const
|
|
1695
|
-
const
|
|
1696
|
-
for (const
|
|
1697
|
-
if (
|
|
1698
|
-
|
|
1699
|
-
const
|
|
1700
|
-
let
|
|
1701
|
-
|
|
1702
|
-
value:
|
|
1703
|
-
status:
|
|
1704
|
-
selected: u.has(`${
|
|
1705
|
-
swatch:
|
|
1738
|
+
for (const o of r) u.add(`${o.name}:${o.value}`);
|
|
1739
|
+
const s = /* @__PURE__ */ new Map(), d = [...a, ...r];
|
|
1740
|
+
for (const o of t) {
|
|
1741
|
+
if (c.has(o.name) || !n.has(`${o.name}:${o.value}`)) continue;
|
|
1742
|
+
s.has(o.name) || s.set(o.name, []);
|
|
1743
|
+
const l = d.filter((w) => w.name !== o.name).concat({ name: o.name, value: o.value }), g = [...a, ...l.filter((w) => !c.has(w.name))], p = Oe(e, g);
|
|
1744
|
+
let h;
|
|
1745
|
+
p ? p.availableForSale ? h = "available" : p.inventoryPolicy === "CONTINUE" ? h = "backorderable" : h = "sold-out" : h = "unavailable", s.get(o.name).push({
|
|
1746
|
+
value: o.value,
|
|
1747
|
+
status: h,
|
|
1748
|
+
selected: u.has(`${o.name}:${o.value}`),
|
|
1749
|
+
swatch: i.get(`${o.name}:${o.value}`) ?? null
|
|
1706
1750
|
});
|
|
1707
1751
|
}
|
|
1708
|
-
return Array.from(
|
|
1752
|
+
return Array.from(s.entries()).map(([o, l]) => ({ name: o, values: l }));
|
|
1709
1753
|
}
|
|
1710
|
-
function
|
|
1754
|
+
function Lt({
|
|
1711
1755
|
images: e,
|
|
1712
1756
|
swatchValues: t,
|
|
1713
1757
|
variantSwatchMap: r,
|
|
1714
|
-
selectedVariantId:
|
|
1758
|
+
selectedVariantId: a
|
|
1715
1759
|
}) {
|
|
1716
1760
|
if (t.length === 0)
|
|
1717
|
-
return [...e].sort((
|
|
1718
|
-
const
|
|
1719
|
-
for (const
|
|
1720
|
-
if (
|
|
1721
|
-
|
|
1761
|
+
return [...e].sort((s, d) => s.position - d.position);
|
|
1762
|
+
const c = a !== null ? r.get(a) ?? null : null, n = /* @__PURE__ */ new Map(), i = [];
|
|
1763
|
+
for (const s of e) {
|
|
1764
|
+
if (s.variantIds.length === 0) {
|
|
1765
|
+
i.push(s);
|
|
1722
1766
|
continue;
|
|
1723
1767
|
}
|
|
1724
|
-
let
|
|
1725
|
-
for (const
|
|
1726
|
-
const
|
|
1727
|
-
if (
|
|
1728
|
-
|
|
1768
|
+
let d = null;
|
|
1769
|
+
for (const o of s.variantIds) {
|
|
1770
|
+
const l = r.get(o);
|
|
1771
|
+
if (l) {
|
|
1772
|
+
d = l;
|
|
1729
1773
|
break;
|
|
1730
1774
|
}
|
|
1731
1775
|
}
|
|
1732
|
-
if (
|
|
1733
|
-
const
|
|
1734
|
-
|
|
1776
|
+
if (d) {
|
|
1777
|
+
const o = n.get(d) ?? [];
|
|
1778
|
+
o.push(s), n.set(d, o);
|
|
1735
1779
|
} else
|
|
1736
|
-
|
|
1780
|
+
i.push(s);
|
|
1737
1781
|
}
|
|
1738
|
-
for (const
|
|
1739
|
-
|
|
1740
|
-
|
|
1782
|
+
for (const s of n.values())
|
|
1783
|
+
s.sort((d, o) => d.position - o.position);
|
|
1784
|
+
i.sort((s, d) => s.position - d.position);
|
|
1741
1785
|
const u = [];
|
|
1742
|
-
|
|
1743
|
-
for (const
|
|
1744
|
-
|
|
1745
|
-
return u.push(...
|
|
1746
|
-
}
|
|
1747
|
-
function
|
|
1748
|
-
return new Promise((r,
|
|
1749
|
-
const
|
|
1750
|
-
if (
|
|
1786
|
+
c && n.has(c) && u.push(...n.get(c));
|
|
1787
|
+
for (const s of t)
|
|
1788
|
+
s !== c && n.has(s) && u.push(...n.get(s));
|
|
1789
|
+
return u.push(...i), u;
|
|
1790
|
+
}
|
|
1791
|
+
function Zt(e, t = {}) {
|
|
1792
|
+
return new Promise((r, a) => {
|
|
1793
|
+
const c = new XMLHttpRequest();
|
|
1794
|
+
if (c.open(t.method || "GET", e, !0), t.headers) {
|
|
1751
1795
|
const n = t.headers;
|
|
1752
|
-
for (const
|
|
1796
|
+
for (const i in n) c.setRequestHeader(i, n[i]);
|
|
1753
1797
|
}
|
|
1754
|
-
if (t.signal && (t.signal.addEventListener("abort", () =>
|
|
1755
|
-
|
|
1798
|
+
if (t.signal && (t.signal.addEventListener("abort", () => c.abort()), t.signal.aborted)) {
|
|
1799
|
+
a(new DOMException("Aborted", "AbortError"));
|
|
1756
1800
|
return;
|
|
1757
1801
|
}
|
|
1758
|
-
|
|
1802
|
+
c.onload = () => {
|
|
1759
1803
|
const n = new Headers();
|
|
1760
|
-
|
|
1761
|
-
`).forEach((
|
|
1762
|
-
const [u, ...
|
|
1763
|
-
u && n.append(u,
|
|
1804
|
+
c.getAllResponseHeaders().trim().split(`\r
|
|
1805
|
+
`).forEach((i) => {
|
|
1806
|
+
const [u, ...s] = i.split(": ");
|
|
1807
|
+
u && n.append(u, s.join(": "));
|
|
1764
1808
|
}), r(
|
|
1765
|
-
new Response(
|
|
1766
|
-
status:
|
|
1767
|
-
statusText:
|
|
1809
|
+
new Response(c.response, {
|
|
1810
|
+
status: c.status,
|
|
1811
|
+
statusText: c.statusText,
|
|
1768
1812
|
headers: n
|
|
1769
1813
|
})
|
|
1770
1814
|
);
|
|
1771
|
-
},
|
|
1815
|
+
}, c.onerror = () => a(new TypeError("Network request failed")), c.ontimeout = () => a(new DOMException("Timeout", "TimeoutError")), c.onabort = () => a(new DOMException("Aborted", "AbortError")), c.send(t.body);
|
|
1772
1816
|
});
|
|
1773
1817
|
}
|
|
1774
1818
|
export {
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1819
|
+
nt as and,
|
|
1820
|
+
rr as batch,
|
|
1821
|
+
nr as computed,
|
|
1822
|
+
zt as createClient,
|
|
1823
|
+
Wt as createProductCard,
|
|
1824
|
+
ar as effect,
|
|
1825
|
+
Ut as eq,
|
|
1826
|
+
Ht as exists,
|
|
1827
|
+
Ft as fileStorage,
|
|
1828
|
+
Kt as filter,
|
|
1829
|
+
Xt as getClient,
|
|
1830
|
+
Bt as gt,
|
|
1831
|
+
Gt as gte,
|
|
1832
|
+
Vt as inValues,
|
|
1833
|
+
qt as isClientError,
|
|
1834
|
+
Yt as isInitialized,
|
|
1835
|
+
Dt as isRetryable,
|
|
1836
|
+
We as localStorageAdapter,
|
|
1837
|
+
xt as lt,
|
|
1838
|
+
jt as lte,
|
|
1839
|
+
Mt as notEq,
|
|
1840
|
+
Qt as notExists,
|
|
1797
1841
|
$t as notIn,
|
|
1798
|
-
|
|
1842
|
+
Jt as or,
|
|
1799
1843
|
or as signal,
|
|
1800
|
-
|
|
1801
|
-
|
|
1844
|
+
V as subscribe,
|
|
1845
|
+
Zt as xhrFetch
|
|
1802
1846
|
};
|