@faststore/api 4.10.1-dev.2 → 4.10.1-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +46 -46
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.mjs +860 -787
- package/dist/es/index.mjs.map +1 -1
- package/dist/src/platforms/vtex/clients/commerce/index.d.ts +16 -2
- package/dist/src/platforms/vtex/clients/commerce/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/fetch.d.ts +1 -0
- package/dist/src/platforms/vtex/clients/fetch.d.ts.map +1 -1
- package/dist/src/platforms/vtex/clients/index.d.ts +2 -2
- package/dist/src/platforms/vtex/clients/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/getOrderEntryOperation.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/index.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/query.d.ts.map +1 -1
- package/dist/src/platforms/vtex/resolvers/subscribeToNewsletter.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/platforms/vtex/clients/commerce/index.ts +80 -3
- package/src/platforms/vtex/clients/fetch.ts +52 -1
- package/src/platforms/vtex/resolvers/subscribeToNewsletter.ts +28 -1
package/dist/es/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { mergeTypeDefs as
|
|
2
|
-
import { makeExecutableSchema as
|
|
3
|
-
import { mapSchema as
|
|
4
|
-
import { GraphQLScalarType as
|
|
5
|
-
import { logger as
|
|
6
|
-
import
|
|
1
|
+
import { mergeTypeDefs as hn } from "@graphql-tools/merge";
|
|
2
|
+
import { makeExecutableSchema as nt, mergeSchemas as tt } from "@graphql-tools/schema";
|
|
3
|
+
import { mapSchema as fn, MapperKind as Sn, getDirective as yn } from "@graphql-tools/utils";
|
|
4
|
+
import { GraphQLScalarType as rt, print as it, parse as at, isSchema as ot } from "graphql";
|
|
5
|
+
import { logger as st, OTELAPI as W } from "@faststore/diagnostics";
|
|
6
|
+
import ct from "isomorphic-unfetch";
|
|
7
7
|
import { parse as ie } from "cookie";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
var
|
|
14
|
-
const
|
|
8
|
+
import Te from "p-limit";
|
|
9
|
+
import Se from "dataloader";
|
|
10
|
+
import lt from "sanitize-html";
|
|
11
|
+
import Re from "fast-deep-equal";
|
|
12
|
+
import dt from "node:crypto";
|
|
13
|
+
var ut = /* @__PURE__ */ ((e) => (e.Personal = "personal", e.Shared = "shared", e))(ut || {}), pt = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))(pt || {}), gt = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))(gt || {}), mt = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(mt || {}), ht = /* @__PURE__ */ ((e) => (e.DiscountDesc = "discount_desc", e.NameAsc = "name_asc", e.NameDesc = "name_desc", e.OrdersDesc = "orders_desc", e.PriceAsc = "price_asc", e.PriceDesc = "price_desc", e.ReleaseDesc = "release_desc", e.ScoreDesc = "score_desc", e))(ht || {}), ft = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(ft || {}), St = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(St || {});
|
|
14
|
+
const yt = () => function(n = {}) {
|
|
15
15
|
const t = process.env.FS_DISCOVERY_APP_KEY ?? "", r = process.env.FS_DISCOVERY_APP_TOKEN ?? "";
|
|
16
16
|
if (!t || !r)
|
|
17
17
|
throw new te("No authentication AppKey and AppToken passed.");
|
|
@@ -20,78 +20,78 @@ const mt = () => function(n = {}) {
|
|
|
20
20
|
"X-VTEX-API-AppKey": t,
|
|
21
21
|
"X-VTEX-API-AppToken": r
|
|
22
22
|
};
|
|
23
|
-
},
|
|
23
|
+
}, It = async (e) => {
|
|
24
24
|
const {
|
|
25
25
|
clients: { commerce: n }
|
|
26
26
|
} = e;
|
|
27
27
|
try {
|
|
28
28
|
if ((await n.vtexid.validate())?.authStatus?.toLowerCase() !== "success")
|
|
29
|
-
throw new
|
|
29
|
+
throw new ue("Authentication required");
|
|
30
30
|
} catch (t) {
|
|
31
31
|
const r = t.extensions?.status ?? t.status;
|
|
32
|
-
throw r === 401 ? new
|
|
32
|
+
throw r === 401 ? new ue("Authentication required") : r === 403 ? new te("You are not allowed to access this resource") : new ue("Authentication required");
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, vt = "auth", Ot = {
|
|
35
35
|
typeDefs: "directive @auth on FIELD_DEFINITION",
|
|
36
|
-
transformer: (e) =>
|
|
37
|
-
[
|
|
38
|
-
if (
|
|
36
|
+
transformer: (e) => fn(e, {
|
|
37
|
+
[Sn.OBJECT_FIELD]: (n) => {
|
|
38
|
+
if (yn(e, n, vt)?.[0]) {
|
|
39
39
|
const r = n.resolve;
|
|
40
|
-
n.resolve = async (i, a, o, s) => (await
|
|
40
|
+
n.resolve = async (i, a, o, s) => (await It(o), r?.(i, a, o, s));
|
|
41
41
|
}
|
|
42
42
|
return n;
|
|
43
43
|
}
|
|
44
44
|
})
|
|
45
|
-
},
|
|
45
|
+
}, Ct = "cacheControl", $o = (e, n) => {
|
|
46
46
|
const {
|
|
47
47
|
scope: t = "private",
|
|
48
48
|
sMaxAge: r = 0,
|
|
49
49
|
staleWhileRevalidate: i = 0
|
|
50
50
|
} = e;
|
|
51
51
|
return `${n ? "private" : t}, s-maxage=${r}, stale-while-revalidate=${i}`;
|
|
52
|
-
},
|
|
52
|
+
}, Le = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, bt = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, wt = {
|
|
53
53
|
typeDefs: "directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",
|
|
54
|
-
transformer: (e) =>
|
|
55
|
-
[
|
|
56
|
-
const t =
|
|
54
|
+
transformer: (e) => fn(e, {
|
|
55
|
+
[Sn.OBJECT_FIELD]: (n) => {
|
|
56
|
+
const t = yn(e, n, Ct)?.[0];
|
|
57
57
|
if (t) {
|
|
58
58
|
const { sMaxAge: r, staleWhileRevalidate: i, scope: a } = t, o = n.resolve;
|
|
59
59
|
n.resolve = (s, c, d, g) => (d.cacheControl = {
|
|
60
|
-
sMaxAge:
|
|
61
|
-
staleWhileRevalidate:
|
|
60
|
+
sMaxAge: Le(d.cacheControl?.sMaxAge, r),
|
|
61
|
+
staleWhileRevalidate: Le(
|
|
62
62
|
d.cacheControl?.staleWhileRevalidate,
|
|
63
63
|
i
|
|
64
64
|
),
|
|
65
|
-
scope:
|
|
65
|
+
scope: bt(d.cacheControl?.scope, a)
|
|
66
66
|
}, o?.(s, c, d, g));
|
|
67
67
|
}
|
|
68
68
|
return n;
|
|
69
69
|
}
|
|
70
70
|
})
|
|
71
|
-
},
|
|
72
|
-
const r =
|
|
71
|
+
}, At = (e) => (n, t) => {
|
|
72
|
+
const r = hn([
|
|
73
73
|
...(e ?? []).map(({ typeDefs: i }) => i),
|
|
74
74
|
t
|
|
75
75
|
]);
|
|
76
76
|
return (e ?? []).reduce(
|
|
77
77
|
(i, { transformer: a }) => a?.(i) ?? i,
|
|
78
|
-
|
|
78
|
+
nt({
|
|
79
79
|
typeDefs: r,
|
|
80
80
|
resolvers: n
|
|
81
81
|
})
|
|
82
82
|
);
|
|
83
|
-
},
|
|
84
|
-
name:
|
|
85
|
-
version:
|
|
86
|
-
},
|
|
83
|
+
}, In = "@faststore/api", vn = "4.10.1-dev.3", Be = {
|
|
84
|
+
name: In,
|
|
85
|
+
version: vn
|
|
86
|
+
}, Ue = st("@faststore/api"), Pt = (e, n = "Unknown Graphql Resolver") => (t, r, i, a) => {
|
|
87
87
|
if (!i?.OTEL_ENABLED)
|
|
88
88
|
return e(t, r, i, a);
|
|
89
89
|
const o = W.trace.getTracer("Graphql").startSpan(n, {
|
|
90
90
|
kind: W.SpanKind.INTERNAL,
|
|
91
91
|
attributes: {
|
|
92
92
|
timestamp: Date.now(),
|
|
93
|
-
"@faststore_version":
|
|
94
|
-
"@faststore_package_name":
|
|
93
|
+
"@faststore_version": vn,
|
|
94
|
+
"@faststore_package_name": In,
|
|
95
95
|
"@faststore_account_name": i.account,
|
|
96
96
|
"@faststore_environment": process.env.NODE_ENV,
|
|
97
97
|
"@faststore_resolver_parent_type": a?.parentType?.name,
|
|
@@ -105,72 +105,92 @@ const mt = () => function(n = {}) {
|
|
|
105
105
|
);
|
|
106
106
|
return c instanceof Promise ? c.then(
|
|
107
107
|
(d) => (o.end(), d),
|
|
108
|
-
(d) =>
|
|
108
|
+
(d) => $e(d, o, n)
|
|
109
109
|
) : (o.end(), c);
|
|
110
110
|
} catch (c) {
|
|
111
|
-
return
|
|
111
|
+
return $e(c, o, n);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
function
|
|
114
|
+
function $e(e, n, t) {
|
|
115
115
|
throw n.setStatus({ code: W.SpanStatusCode.ERROR }), n.recordException(e), n.end(), console.error(`Error at resolver: ${t}:
|
|
116
|
-
%o`, e),
|
|
116
|
+
%o`, e), Ue("error", `Error at resolver: %s
|
|
117
117
|
%o`, t, e), e;
|
|
118
118
|
}
|
|
119
|
-
class
|
|
119
|
+
class K extends Error {
|
|
120
120
|
constructor(n, t) {
|
|
121
121
|
super(t), this.extensions = n, this.name = "FastStoreError";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class k extends K {
|
|
125
125
|
constructor(n) {
|
|
126
126
|
super({ status: 400, type: "BadRequestError" }, n);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class ue extends K {
|
|
130
130
|
constructor(n) {
|
|
131
131
|
super({ status: 401, type: "UnauthorizedError" }, n);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
class te extends
|
|
134
|
+
class te extends K {
|
|
135
135
|
constructor(n) {
|
|
136
136
|
super({ status: 403, type: "ForbiddenError" }, n);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
class z extends
|
|
139
|
+
class z extends K {
|
|
140
140
|
constructor(n) {
|
|
141
141
|
super({ status: 404, type: "NotFoundError" }, n);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
|
|
144
|
+
const Mo = (e) => e?.name === "FastStoreError", zo = (e) => e?.extensions?.type === "BadRequestError", Vo = (e) => e?.extensions?.type === "UnauthorizedError", Dt = (e) => e?.extensions?.type === "ForbiddenError", ee = (e) => e?.extensions?.type === "NotFoundError", Et = `${Be.name}@${Be.version}`, kt = /authorization|cookie|token|secret|api-?key|appkey/i, On = "[redacted]", Me = (e) => {
|
|
145
|
+
if (!e)
|
|
146
|
+
return;
|
|
147
|
+
const n = {}, t = (r, i) => {
|
|
148
|
+
n[r] = kt.test(r) ? On : i;
|
|
149
|
+
};
|
|
150
|
+
return Array.isArray(e) ? e.forEach(([r, i]) => t(r, i)) : typeof e.forEach == "function" ? e.forEach((i, a) => t(a, i)) : Object.entries(e).forEach(([r, i]) => t(r, i)), n;
|
|
151
|
+
}, y = async (e, n, t) => {
|
|
152
|
+
const r = await ct(e, {
|
|
146
153
|
...n,
|
|
147
154
|
headers: {
|
|
148
155
|
...n?.headers ?? {},
|
|
149
|
-
"User-Agent":
|
|
156
|
+
"User-Agent": Et
|
|
150
157
|
}
|
|
151
158
|
});
|
|
152
159
|
if (r.ok)
|
|
153
160
|
return t?.storeCookies && t.storeCookies(r.headers), r.status !== 204 ? r.json() : void 0;
|
|
154
|
-
console.error(
|
|
161
|
+
console.error(
|
|
162
|
+
// Only the URL: a `Request` instance could carry unredacted headers.
|
|
163
|
+
typeof e == "string" ? e : e.url,
|
|
164
|
+
n && {
|
|
165
|
+
...n,
|
|
166
|
+
headers: Me(n.headers),
|
|
167
|
+
body: n.body ? On : void 0
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
status: r.status,
|
|
171
|
+
statusText: r.statusText,
|
|
172
|
+
headers: Me(r.headers)
|
|
173
|
+
}
|
|
174
|
+
);
|
|
155
175
|
const i = await r.text();
|
|
156
176
|
if (typeof r?.status == "number")
|
|
157
177
|
switch (r.status) {
|
|
158
178
|
case 400:
|
|
159
|
-
throw new
|
|
179
|
+
throw new k(i);
|
|
160
180
|
case 401:
|
|
161
|
-
throw new
|
|
181
|
+
throw new ue(i);
|
|
162
182
|
case 403:
|
|
163
183
|
throw new te(i);
|
|
164
184
|
case 404:
|
|
165
185
|
throw new z(i);
|
|
166
186
|
default:
|
|
167
|
-
throw new
|
|
187
|
+
throw new K(
|
|
168
188
|
{ status: r.status, type: "UnknownError" },
|
|
169
189
|
i
|
|
170
190
|
);
|
|
171
191
|
}
|
|
172
192
|
throw new Error(i);
|
|
173
|
-
},
|
|
193
|
+
}, _t = ({ account: e, environment: n }) => {
|
|
174
194
|
const t = `https://${e}.${n}.com.br`;
|
|
175
195
|
return {
|
|
176
196
|
getLocalizedProduct: (r, i) => y(`${t}/api/catalog-dataplane/product/${r}`, {
|
|
@@ -181,7 +201,7 @@ const _o = (e) => e?.name === "FastStoreError", Ro = (e) => e?.extensions?.type
|
|
|
181
201
|
}
|
|
182
202
|
})
|
|
183
203
|
};
|
|
184
|
-
},
|
|
204
|
+
}, Cn = (e) => {
|
|
185
205
|
if (!e)
|
|
186
206
|
return e;
|
|
187
207
|
const n = /* @__PURE__ */ new Map(), t = e.split(";"), r = [];
|
|
@@ -195,8 +215,8 @@ const _o = (e) => e?.name === "FastStoreError", Ro = (e) => e?.extensions?.type
|
|
|
195
215
|
}
|
|
196
216
|
}
|
|
197
217
|
}), r.map((i) => `${i}=${n.get(i)}`).join("; ");
|
|
198
|
-
},
|
|
199
|
-
const t = n.match(
|
|
218
|
+
}, Tt = /^([^=]+)=([^;]*)/, Rt = (e, n) => {
|
|
219
|
+
const t = n.match(Tt);
|
|
200
220
|
if (t) {
|
|
201
221
|
const r = t[1], i = t[2];
|
|
202
222
|
e.storage.cookies.set(r, {
|
|
@@ -204,32 +224,32 @@ const _o = (e) => e?.name === "FastStoreError", Ro = (e) => e?.extensions?.type
|
|
|
204
224
|
setCookie: n
|
|
205
225
|
});
|
|
206
226
|
}
|
|
207
|
-
},
|
|
227
|
+
}, Ut = (e, n) => {
|
|
208
228
|
n.getSetCookie().forEach(
|
|
209
|
-
(t) =>
|
|
229
|
+
(t) => Rt(e, t)
|
|
210
230
|
);
|
|
211
|
-
},
|
|
231
|
+
}, Nt = (e) => (n) => Ut(e, n), ve = (e) => {
|
|
212
232
|
if (!e.headers?.cookie)
|
|
213
233
|
return null;
|
|
214
|
-
const n =
|
|
234
|
+
const n = Cn(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
|
|
215
235
|
return t.length === 0 ? n : t.reduce(
|
|
216
|
-
(r, [i, { value: a }]) =>
|
|
236
|
+
(r, [i, { value: a }]) => Ft(
|
|
217
237
|
r,
|
|
218
238
|
i,
|
|
219
239
|
a
|
|
220
240
|
),
|
|
221
241
|
n
|
|
222
242
|
);
|
|
223
|
-
},
|
|
224
|
-
const r =
|
|
243
|
+
}, bn = (e) => function(t) {
|
|
244
|
+
const r = ve(e);
|
|
225
245
|
return r ? {
|
|
226
246
|
...t,
|
|
227
247
|
cookie: r
|
|
228
248
|
} : t;
|
|
229
249
|
}, $ = (e, n) => {
|
|
230
|
-
const t =
|
|
250
|
+
const t = Cn(e);
|
|
231
251
|
return ie(t)[`VtexIdclientAutCookie_${n}`] || "";
|
|
232
|
-
},
|
|
252
|
+
}, Ft = (e, n, t) => {
|
|
233
253
|
const r = new RegExp(`(${n})=([^;]*)`), i = e.match(r);
|
|
234
254
|
return i ? e.replace(
|
|
235
255
|
i[0],
|
|
@@ -245,12 +265,12 @@ function H(e) {
|
|
|
245
265
|
return null;
|
|
246
266
|
}
|
|
247
267
|
}
|
|
248
|
-
const
|
|
268
|
+
const Lt = "storefront/faststore.recommendation-shelf@v4", Z = {
|
|
249
269
|
method: "POST",
|
|
250
270
|
headers: {
|
|
251
271
|
"content-type": "application/json"
|
|
252
272
|
}
|
|
253
|
-
},
|
|
273
|
+
}, Bt = 100, ce = /* @__PURE__ */ new Set(), $t = (e) => e.split("/").map(encodeURIComponent).join("/"), ye = (e) => e ? { headers: { "Accept-Language": e } } : void 0, Mt = /^\d{4}-\d{2}-\d{2}$/, zt = /* @__PURE__ */ new Set([
|
|
254
274
|
"Draft",
|
|
255
275
|
"Requested",
|
|
256
276
|
"InReview",
|
|
@@ -261,7 +281,7 @@ const _t = "storefront/faststore.recommendation-shelf@v4", Z = {
|
|
|
261
281
|
"ConvertedToCart",
|
|
262
282
|
"ConvertedToOrder"
|
|
263
283
|
]);
|
|
264
|
-
function
|
|
284
|
+
function Vt({
|
|
265
285
|
page: e,
|
|
266
286
|
perPage: n,
|
|
267
287
|
status: t,
|
|
@@ -284,19 +304,19 @@ function Nt({
|
|
|
284
304
|
["expiresAtFrom", a],
|
|
285
305
|
["expiresAtTo", o]
|
|
286
306
|
])
|
|
287
|
-
if (c && !
|
|
307
|
+
if (c && !Mt.test(c))
|
|
288
308
|
throw new Error(
|
|
289
309
|
`listUserQuotes: invalid ${s} "${c}" — must be YYYY-MM-DD`
|
|
290
310
|
);
|
|
291
311
|
if (t && t.length > 0) {
|
|
292
|
-
const s = t.filter((c) => !
|
|
312
|
+
const s = t.filter((c) => !zt.has(c));
|
|
293
313
|
if (s.length > 0)
|
|
294
314
|
throw new Error(
|
|
295
315
|
`listUserQuotes: invalid status values: ${s.join(", ")}`
|
|
296
316
|
);
|
|
297
317
|
}
|
|
298
318
|
}
|
|
299
|
-
function
|
|
319
|
+
function qt({
|
|
300
320
|
page: e,
|
|
301
321
|
perPage: n,
|
|
302
322
|
status: t,
|
|
@@ -309,13 +329,13 @@ function Lt({
|
|
|
309
329
|
const c = new URLSearchParams();
|
|
310
330
|
return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((d) => c.append("status", d)), r && c.append("createdAtFrom", r), i && c.append("createdAtTo", i), a && c.append("expiresAtFrom", a), o && c.append("expiresAtTo", o), s?.trim() && c.append("label", s.trim()), c;
|
|
311
331
|
}
|
|
312
|
-
const
|
|
313
|
-
const a = `https://${e}.${n}.com.br`, o =
|
|
332
|
+
const xt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
|
|
333
|
+
const a = `https://${e}.${n}.com.br`, o = Nt(i), s = bn(i), c = yt(), d = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", g = r && r.map((l) => l + ".").find((l) => d.includes(l)) || "", p = d.replace(g, ""), f = `${a}/api/recommend-bff/v2`, h = s({
|
|
314
334
|
accept: "application/json",
|
|
315
335
|
"content-type": "application/json",
|
|
316
|
-
"x-vtex-rec-origin": `${e}/${
|
|
336
|
+
"x-vtex-rec-origin": `${e}/${Lt}`
|
|
317
337
|
}), I = (l = {}) => {
|
|
318
|
-
const u = $(
|
|
338
|
+
const u = $(ve(i) ?? "", e);
|
|
319
339
|
return s({
|
|
320
340
|
...l,
|
|
321
341
|
"X-FORWARDED-HOST": p,
|
|
@@ -355,8 +375,8 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
355
375
|
category: async (l, u) => {
|
|
356
376
|
try {
|
|
357
377
|
return await y(
|
|
358
|
-
`${a}/api/catalog_system/pub/category/by-linkid/${
|
|
359
|
-
|
|
378
|
+
`${a}/api/catalog_system/pub/category/by-linkid/${$t(l)}`,
|
|
379
|
+
ye(u)
|
|
360
380
|
);
|
|
361
381
|
} catch (m) {
|
|
362
382
|
if (ee(m)) return null;
|
|
@@ -367,7 +387,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
367
387
|
try {
|
|
368
388
|
return await y(
|
|
369
389
|
`${a}/api/catalog_system/pub/brand/by-linkid/${encodeURIComponent(l)}`,
|
|
370
|
-
|
|
390
|
+
ye(u)
|
|
371
391
|
);
|
|
372
392
|
} catch (m) {
|
|
373
393
|
if (ee(m)) return null;
|
|
@@ -378,7 +398,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
378
398
|
try {
|
|
379
399
|
return await y(
|
|
380
400
|
`${a}/api/catalog_system/pub/collection/by-linkid/${encodeURIComponent(l)}`,
|
|
381
|
-
|
|
401
|
+
ye(u)
|
|
382
402
|
);
|
|
383
403
|
} catch (m) {
|
|
384
404
|
if (ee(m)) return null;
|
|
@@ -431,16 +451,16 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
431
451
|
const b = v ? {
|
|
432
452
|
startDateUtc: m?.deliveryWindow?.startDate,
|
|
433
453
|
endDateUtc: m?.deliveryWindow?.endDate
|
|
434
|
-
} : null,
|
|
435
|
-
logisticsInfo: Array.from({ length: u }, (A,
|
|
436
|
-
itemIndex:
|
|
454
|
+
} : null, O = {
|
|
455
|
+
logisticsInfo: Array.from({ length: u }, (A, C) => ({
|
|
456
|
+
itemIndex: C,
|
|
437
457
|
selectedDeliveryChannel: m?.deliveryChannel || null,
|
|
438
458
|
selectedSla: m?.deliveryMethod || null,
|
|
439
459
|
deliveryWindow: b
|
|
440
460
|
})),
|
|
441
461
|
selectedAddresses: S,
|
|
442
462
|
clearAddressIfPostalCodeNotFound: t
|
|
443
|
-
},
|
|
463
|
+
}, T = s({
|
|
444
464
|
"content-type": "application/json",
|
|
445
465
|
"X-FORWARDED-HOST": p
|
|
446
466
|
});
|
|
@@ -448,8 +468,8 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
448
468
|
`${a}/api/checkout/pub/orderForm/${l}/attachments/shippingData`,
|
|
449
469
|
{
|
|
450
470
|
...Z,
|
|
451
|
-
headers:
|
|
452
|
-
body: JSON.stringify(
|
|
471
|
+
headers: T,
|
|
472
|
+
body: JSON.stringify(O)
|
|
453
473
|
},
|
|
454
474
|
{ storeCookies: o }
|
|
455
475
|
);
|
|
@@ -499,9 +519,9 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
499
519
|
const { salesChannel: v } = m, b = s({
|
|
500
520
|
"content-type": "application/json",
|
|
501
521
|
"X-FORWARDED-HOST": p
|
|
502
|
-
}),
|
|
503
|
-
(!S || !l) &&
|
|
504
|
-
const
|
|
522
|
+
}), O = new URLSearchParams();
|
|
523
|
+
(!S || !l) && O.set("sc", v), l && O.set("refreshOutdatedData", u.toString());
|
|
524
|
+
const T = l ? `/${l}` : "", A = `${a}/api/checkout/pub/orderForm${T}?${O}`;
|
|
505
525
|
return y(
|
|
506
526
|
A,
|
|
507
527
|
{
|
|
@@ -536,14 +556,14 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
536
556
|
const b = new URLSearchParams({
|
|
537
557
|
allowOutdatedData: m,
|
|
538
558
|
sc: S
|
|
539
|
-
}),
|
|
559
|
+
}), O = s({
|
|
540
560
|
"content-type": "application/json",
|
|
541
561
|
"X-FORWARDED-HOST": p
|
|
542
562
|
});
|
|
543
563
|
return y(
|
|
544
564
|
`${a}/api/checkout/pub/orderForm/${l}/items?${b}`,
|
|
545
565
|
{
|
|
546
|
-
headers:
|
|
566
|
+
headers: O,
|
|
547
567
|
body: JSON.stringify({
|
|
548
568
|
orderItems: u,
|
|
549
569
|
noSplitItem: !v
|
|
@@ -586,14 +606,14 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
586
606
|
"geoCoordinates",
|
|
587
607
|
`${u?.longitude};${u?.latitude}`
|
|
588
608
|
);
|
|
589
|
-
const b = `${a}/api/checkout/pub/regions/?${v.toString()}`,
|
|
609
|
+
const b = `${a}/api/checkout/pub/regions/?${v.toString()}`, O = s({
|
|
590
610
|
"content-type": "application/json",
|
|
591
611
|
"X-FORWARDED-HOST": p
|
|
592
612
|
});
|
|
593
613
|
return y(
|
|
594
614
|
b,
|
|
595
615
|
{
|
|
596
|
-
headers:
|
|
616
|
+
headers: O
|
|
597
617
|
},
|
|
598
618
|
{ storeCookies: o }
|
|
599
619
|
);
|
|
@@ -675,15 +695,56 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
675
695
|
);
|
|
676
696
|
}
|
|
677
697
|
},
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
698
|
+
/**
|
|
699
|
+
* Creates a newsletter subscription in the `NL` Master Data entity.
|
|
700
|
+
*
|
|
701
|
+
* With `FS_NEWSLETTER_APP_KEY`/`FS_NEWSLETTER_APP_TOKEN` set, the document is
|
|
702
|
+
* created with a `POST` authenticated by that dedicated key, so `NL` fields
|
|
703
|
+
* can stay private. The request is create-only: the body is built here from
|
|
704
|
+
* the validated fields and never carries a document id, so the caller can't
|
|
705
|
+
* reach an existing record.
|
|
706
|
+
*
|
|
707
|
+
* Without the credentials, it falls back to the legacy anonymous `PATCH`,
|
|
708
|
+
* which only works while `NL` fields are public.
|
|
709
|
+
*/
|
|
710
|
+
subscribeToNewsletter: ({
|
|
711
|
+
name: l,
|
|
712
|
+
email: u
|
|
713
|
+
}) => {
|
|
714
|
+
const m = JSON.stringify({
|
|
715
|
+
...l ? { name: l } : {},
|
|
716
|
+
email: u,
|
|
717
|
+
isNewsletterOptIn: !0
|
|
718
|
+
}), S = process.env.FS_NEWSLETTER_APP_KEY, v = process.env.FS_NEWSLETTER_APP_TOKEN;
|
|
719
|
+
if (S && v)
|
|
720
|
+
return y(`${a}/api/dataentities/NL/documents`, {
|
|
721
|
+
method: "POST",
|
|
722
|
+
headers: {
|
|
723
|
+
"content-type": "application/json",
|
|
724
|
+
accept: "application/json",
|
|
725
|
+
"X-VTEX-API-AppKey": S,
|
|
726
|
+
"X-VTEX-API-AppToken": v
|
|
727
|
+
},
|
|
728
|
+
body: m
|
|
729
|
+
});
|
|
730
|
+
if (!ce.has(e)) {
|
|
731
|
+
ce.size >= Bt && ce.clear(), ce.add(e);
|
|
732
|
+
const b = [
|
|
733
|
+
!S && "FS_NEWSLETTER_APP_KEY",
|
|
734
|
+
!v && "FS_NEWSLETTER_APP_TOKEN"
|
|
735
|
+
].filter(Boolean), O = `[subscribeToNewsletter] ${b.join(" and ")} ${b.length > 1 ? "are" : "is"} not set. Falling back to an anonymous Master Data request, which requires public fields in the NL entity. Configure both credentials and make the NL fields private.`;
|
|
736
|
+
console.warn(O), Ue("warn", "%s", O);
|
|
737
|
+
}
|
|
738
|
+
return y(
|
|
739
|
+
`${a}/api/dataentities/NL/documents/`,
|
|
740
|
+
{
|
|
741
|
+
...Z,
|
|
742
|
+
body: m,
|
|
743
|
+
method: "PATCH"
|
|
744
|
+
},
|
|
745
|
+
{ storeCookies: o }
|
|
746
|
+
);
|
|
747
|
+
},
|
|
687
748
|
profile: {
|
|
688
749
|
addresses: async (l) => {
|
|
689
750
|
const u = s({
|
|
@@ -719,33 +780,33 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
719
780
|
dateFinal: S,
|
|
720
781
|
text: v,
|
|
721
782
|
clientEmail: b,
|
|
722
|
-
perPage:
|
|
723
|
-
pendingMyApproval:
|
|
783
|
+
perPage: O,
|
|
784
|
+
pendingMyApproval: T
|
|
724
785
|
}) => {
|
|
725
786
|
const A = new URLSearchParams();
|
|
726
787
|
if (m) {
|
|
727
|
-
const
|
|
788
|
+
const D = new Date(m).setHours(
|
|
728
789
|
0,
|
|
729
790
|
0,
|
|
730
791
|
0,
|
|
731
792
|
0
|
|
732
793
|
);
|
|
733
|
-
m = new Date(
|
|
794
|
+
m = new Date(D).toISOString();
|
|
734
795
|
}
|
|
735
796
|
if (S) {
|
|
736
|
-
const
|
|
797
|
+
const D = new Date(S).setHours(
|
|
737
798
|
23,
|
|
738
799
|
59,
|
|
739
800
|
59,
|
|
740
801
|
999
|
|
741
802
|
);
|
|
742
|
-
S = new Date(
|
|
803
|
+
S = new Date(D).toISOString();
|
|
743
804
|
}
|
|
744
805
|
v && A.append("text", v), u && u.length > 0 && A.append("status", u.filter(Boolean).join(",")), m && S ? A.append(
|
|
745
806
|
"creation_date",
|
|
746
807
|
`creationDate:[${m} TO ${S}]`
|
|
747
|
-
) : m ? A.append("creation_date", `creationDate:[${m} TO *]`) : S && A.append("creation_date", `creationDate:[* TO ${S}]`), b && A.append("clientEmail", b), l && A.append("page", l.toString()),
|
|
748
|
-
const
|
|
808
|
+
) : m ? A.append("creation_date", `creationDate:[${m} TO *]`) : S && A.append("creation_date", `creationDate:[* TO ${S}]`), b && A.append("clientEmail", b), l && A.append("page", l.toString()), O && A.append("per_page", O.toString()), T && A.append("my_pending_approvals", String(!0));
|
|
809
|
+
const C = s({
|
|
749
810
|
"content-type": "application/json",
|
|
750
811
|
"X-FORWARDED-HOST": p
|
|
751
812
|
});
|
|
@@ -753,7 +814,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
753
814
|
`${a}/api/oms/user/orders?${A.toString()}`,
|
|
754
815
|
{
|
|
755
816
|
method: "GET",
|
|
756
|
-
headers:
|
|
817
|
+
headers: C
|
|
757
818
|
},
|
|
758
819
|
{ storeCookies: o }
|
|
759
820
|
);
|
|
@@ -783,7 +844,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
783
844
|
const v = s({
|
|
784
845
|
"content-type": "application/json",
|
|
785
846
|
"X-FORWARDED-HOST": p
|
|
786
|
-
}),
|
|
847
|
+
}), T = {
|
|
787
848
|
params: {
|
|
788
849
|
ruleId: m,
|
|
789
850
|
dimensionId: u,
|
|
@@ -795,7 +856,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
795
856
|
{
|
|
796
857
|
method: "POST",
|
|
797
858
|
headers: v,
|
|
798
|
-
body: JSON.stringify(
|
|
859
|
+
body: JSON.stringify(T)
|
|
799
860
|
},
|
|
800
861
|
{ storeCookies: o }
|
|
801
862
|
);
|
|
@@ -945,7 +1006,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
945
1006
|
contractId: l
|
|
946
1007
|
}) => {
|
|
947
1008
|
if (!l)
|
|
948
|
-
throw new
|
|
1009
|
+
throw new k("Missing contractId to fetch CL fields.");
|
|
949
1010
|
const u = I({
|
|
950
1011
|
Accept: "application/json",
|
|
951
1012
|
"content-type": "application/json"
|
|
@@ -963,7 +1024,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
963
1024
|
userId: l
|
|
964
1025
|
}) => {
|
|
965
1026
|
if (!l)
|
|
966
|
-
throw new
|
|
1027
|
+
throw new k("Missing userId to fetch shopper name.");
|
|
967
1028
|
const u = c({
|
|
968
1029
|
Accept: "application/json",
|
|
969
1030
|
"content-type": "application/json",
|
|
@@ -981,8 +1042,8 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
981
1042
|
},
|
|
982
1043
|
quotes: {
|
|
983
1044
|
listUserQuotes: (l) => {
|
|
984
|
-
|
|
985
|
-
const u =
|
|
1045
|
+
Vt(l);
|
|
1046
|
+
const u = qt(l), m = s({
|
|
986
1047
|
"content-type": "application/json",
|
|
987
1048
|
"X-FORWARDED-HOST": p
|
|
988
1049
|
});
|
|
@@ -1001,7 +1062,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1001
1062
|
const l = s({
|
|
1002
1063
|
"content-type": "application/json",
|
|
1003
1064
|
"X-FORWARDED-HOST": p
|
|
1004
|
-
}), u = $(
|
|
1065
|
+
}), u = $(ve(i) ?? "", e);
|
|
1005
1066
|
return y(
|
|
1006
1067
|
`${a}/api/vtexid/credential/validate`,
|
|
1007
1068
|
{
|
|
@@ -1023,17 +1084,17 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1023
1084
|
"content-type": "application/json",
|
|
1024
1085
|
"X-FORWARDED-HOST": p
|
|
1025
1086
|
}), v = `----FastStoreUploadBoundary${Date.now()}`, b = `\r
|
|
1026
|
-
`,
|
|
1087
|
+
`, T = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", A = u.replaceAll(/[\r\n"]/g, "_"), C = [
|
|
1027
1088
|
`--${v}`,
|
|
1028
1089
|
`Content-Disposition: form-data; name="file"; filename="${A}"`,
|
|
1029
|
-
`Content-Type: ${
|
|
1090
|
+
`Content-Type: ${T}`,
|
|
1030
1091
|
"",
|
|
1031
1092
|
""
|
|
1032
|
-
].join(b),
|
|
1033
|
-
|
|
1093
|
+
].join(b), D = `${b}--${v}--${b}`, P = Buffer.from(C), _ = Buffer.from(D), E = new Uint8Array(
|
|
1094
|
+
P.byteLength + l.byteLength + _.byteLength
|
|
1034
1095
|
);
|
|
1035
1096
|
let R = 0;
|
|
1036
|
-
return
|
|
1097
|
+
return E.set(P, R), R += P.byteLength, E.set(l, R), R += l.byteLength, E.set(_, R), y(
|
|
1037
1098
|
`${a}/api/order-entry/upload?an=${e}`,
|
|
1038
1099
|
{
|
|
1039
1100
|
method: "POST",
|
|
@@ -1041,7 +1102,7 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1041
1102
|
...S,
|
|
1042
1103
|
"content-type": `multipart/form-data; boundary=${v}`
|
|
1043
1104
|
},
|
|
1044
|
-
body:
|
|
1105
|
+
body: E.buffer
|
|
1045
1106
|
},
|
|
1046
1107
|
{}
|
|
1047
1108
|
);
|
|
@@ -1147,23 +1208,23 @@ const Bt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
|
|
|
1147
1208
|
}
|
|
1148
1209
|
}
|
|
1149
1210
|
};
|
|
1150
|
-
}, re = (e) => e.discoveryConfig?.localization ?? {}, X = (e) => re(e).enabled === !0,
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
ve,
|
|
1211
|
+
}, re = (e) => e.discoveryConfig?.localization ?? {}, X = (e) => re(e).enabled === !0, jt = (e) => Object.keys(re(e).locales ?? {}), Wt = (e) => re(e).defaultLocale, wn = (e) => X(e) && e.storage.locale || void 0, Oe = "fuzzy", Ce = "operator", be = "pickupPoint", ze = "shipping", Ve = "delivery-options", Ht = "in-stock", Gt = "trade-policy", Xt = "region-id", Yt = /* @__PURE__ */ new Set([
|
|
1212
|
+
Gt,
|
|
1213
|
+
Xt,
|
|
1154
1214
|
Oe,
|
|
1155
|
-
Ce
|
|
1156
|
-
|
|
1215
|
+
Ce,
|
|
1216
|
+
be
|
|
1217
|
+
]), Kt = /* @__PURE__ */ new Set([
|
|
1157
1218
|
"zip-code",
|
|
1158
1219
|
"pickupPoint",
|
|
1159
1220
|
"country",
|
|
1160
1221
|
"coordinates",
|
|
1161
1222
|
"deliveryZonesHash",
|
|
1162
1223
|
"pickupPointsHash"
|
|
1163
|
-
]),
|
|
1224
|
+
]), qe = (e) => encodeURI(decodeURI(e)), Jt = (e) => encodeURIComponent(
|
|
1164
1225
|
decodeURIComponent(e).normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "")
|
|
1165
|
-
),
|
|
1166
|
-
function
|
|
1226
|
+
), Qt = /^pickup-in-point-(.+)$/;
|
|
1227
|
+
function An(e) {
|
|
1167
1228
|
if (!e)
|
|
1168
1229
|
return {};
|
|
1169
1230
|
try {
|
|
@@ -1176,18 +1237,18 @@ function On(e) {
|
|
|
1176
1237
|
return {};
|
|
1177
1238
|
}
|
|
1178
1239
|
}
|
|
1179
|
-
function
|
|
1240
|
+
function Zt(e) {
|
|
1180
1241
|
const n = {}, t = [];
|
|
1181
1242
|
for (const r of e.split(";")) {
|
|
1182
1243
|
const i = r.indexOf("=");
|
|
1183
1244
|
if (i < 0) continue;
|
|
1184
1245
|
const a = r.slice(0, i), o = r.slice(i + 1);
|
|
1185
|
-
!a || !o || (
|
|
1246
|
+
!a || !o || (Kt.has(a) ? n[a] = o : t.push({ key: a, value: o }));
|
|
1186
1247
|
}
|
|
1187
1248
|
return { shipping: n, extraFacets: t };
|
|
1188
1249
|
}
|
|
1189
|
-
function
|
|
1190
|
-
const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, extraFacets: r } =
|
|
1250
|
+
function er(e) {
|
|
1251
|
+
const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, extraFacets: r } = Zt(n);
|
|
1191
1252
|
return {
|
|
1192
1253
|
segmentParams: {
|
|
1193
1254
|
sc: e.channel,
|
|
@@ -1208,7 +1269,7 @@ function Xt(e) {
|
|
|
1208
1269
|
extraFacets: r
|
|
1209
1270
|
};
|
|
1210
1271
|
}
|
|
1211
|
-
function
|
|
1272
|
+
function Pn(e, n) {
|
|
1212
1273
|
const t = [
|
|
1213
1274
|
["sc", n.sc],
|
|
1214
1275
|
["regionId", n.regionId],
|
|
@@ -1228,11 +1289,11 @@ function Cn(e, n) {
|
|
|
1228
1289
|
for (const [r, i] of t)
|
|
1229
1290
|
i != null && i !== "" && e.append(r, String(i));
|
|
1230
1291
|
}
|
|
1231
|
-
function
|
|
1232
|
-
return
|
|
1292
|
+
function Dn(e) {
|
|
1293
|
+
return Qt.exec(e)?.[1];
|
|
1233
1294
|
}
|
|
1234
|
-
function
|
|
1235
|
-
const n = e.find((r) => r.key === "shipping"), t = n ?
|
|
1295
|
+
function nr(e) {
|
|
1296
|
+
const n = e.find((r) => r.key === "shipping"), t = n ? Dn(n.value) : void 0;
|
|
1236
1297
|
if (t !== void 0)
|
|
1237
1298
|
try {
|
|
1238
1299
|
return decodeURIComponent(t);
|
|
@@ -1240,8 +1301,8 @@ function Yt(e) {
|
|
|
1240
1301
|
return t;
|
|
1241
1302
|
}
|
|
1242
1303
|
}
|
|
1243
|
-
function
|
|
1244
|
-
const t =
|
|
1304
|
+
function tr(e, n) {
|
|
1305
|
+
const t = nr(
|
|
1245
1306
|
n
|
|
1246
1307
|
);
|
|
1247
1308
|
return t === void 0 ? e : {
|
|
@@ -1249,25 +1310,25 @@ function Jt(e, n) {
|
|
|
1249
1310
|
pickupPoint: t
|
|
1250
1311
|
};
|
|
1251
1312
|
}
|
|
1252
|
-
function
|
|
1253
|
-
return e.map((n) => n.key !== "shipping" ||
|
|
1313
|
+
function rr(e) {
|
|
1314
|
+
return e.map((n) => n.key !== "shipping" || Dn(n.value) === void 0 ? n : { ...n, value: "pickup-in-point" });
|
|
1254
1315
|
}
|
|
1255
|
-
function
|
|
1316
|
+
function ir(e, n) {
|
|
1256
1317
|
let t = [...e];
|
|
1257
1318
|
const r = t.some((i) => i.key === "shipping");
|
|
1258
1319
|
for (const i of n)
|
|
1259
1320
|
(!r || i.key !== "shipping") && t.push(i);
|
|
1260
|
-
return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")),
|
|
1321
|
+
return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")), rr(t);
|
|
1261
1322
|
}
|
|
1262
|
-
function
|
|
1323
|
+
function En(e) {
|
|
1263
1324
|
return e.reduce((n, t) => {
|
|
1264
1325
|
let { key: r, value: i } = t;
|
|
1265
|
-
return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${
|
|
1326
|
+
return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${qe(r)}/${Jt(qe(i)).replaceAll(/ |%20/g, "-")}/`;
|
|
1266
1327
|
}, "");
|
|
1267
1328
|
}
|
|
1268
|
-
const
|
|
1269
|
-
function
|
|
1270
|
-
const { segmentParams: t, extraFacets: r } =
|
|
1329
|
+
const ar = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), or = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
|
|
1330
|
+
function sr(e, n) {
|
|
1331
|
+
const { segmentParams: t, extraFacets: r } = er(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
|
|
1271
1332
|
return {
|
|
1272
1333
|
segmentParams: {
|
|
1273
1334
|
...t,
|
|
@@ -1278,23 +1339,23 @@ function nr(e, n) {
|
|
|
1278
1339
|
extraFacets: r
|
|
1279
1340
|
};
|
|
1280
1341
|
}
|
|
1281
|
-
function
|
|
1282
|
-
const t = e.filter(({ key: c }) => !
|
|
1283
|
-
({ key: c, value: d }) => c ===
|
|
1342
|
+
function cr(e, n) {
|
|
1343
|
+
const t = e.filter(({ key: c }) => !Yt.has(c)), r = e.find(
|
|
1344
|
+
({ key: c, value: d }) => c === ze && d !== "all-delivery-methods"
|
|
1284
1345
|
) ?? null, i = e.find(
|
|
1285
|
-
({ key: c, value: d }) => c ===
|
|
1346
|
+
({ key: c, value: d }) => c === Ve && d !== "all-delivery-options"
|
|
1286
1347
|
) ?? null, a = [...t], o = a.some(
|
|
1287
|
-
({ key: c }) => c ===
|
|
1348
|
+
({ key: c }) => c === ze
|
|
1288
1349
|
), s = a.some(
|
|
1289
|
-
({ key: c }) => c ===
|
|
1350
|
+
({ key: c }) => c === Ve
|
|
1290
1351
|
);
|
|
1291
|
-
return r !== null && !o && a.push(r), i !== null && !s && a.push(i),
|
|
1352
|
+
return r !== null && !o && a.push(r), i !== null && !s && a.push(i), ir(a, n);
|
|
1292
1353
|
}
|
|
1293
|
-
function
|
|
1294
|
-
const t = e.find(({ key: a }) => a ===
|
|
1295
|
-
t &&
|
|
1354
|
+
function lr(e, n) {
|
|
1355
|
+
const t = e.find(({ key: a }) => a === Oe) ?? null, r = e.find(({ key: a }) => a === Ce) ?? null, i = e.find(({ key: a }) => a === be) ?? null;
|
|
1356
|
+
t && ar(t) && n.append(Oe, t.value), r && or(r) && n.append(Ce, r.value), i && n.append(be, i.value);
|
|
1296
1357
|
}
|
|
1297
|
-
function
|
|
1358
|
+
function xe(e, n, t, r) {
|
|
1298
1359
|
const {
|
|
1299
1360
|
query: i = "",
|
|
1300
1361
|
page: a,
|
|
@@ -1311,32 +1372,32 @@ function ze(e, n, t, r) {
|
|
|
1311
1372
|
h.append("from", u.toString()), h.append("to", m.toString());
|
|
1312
1373
|
}
|
|
1313
1374
|
i && h.append("query", i), r.includeSort && s && h.append("sort", s);
|
|
1314
|
-
const I =
|
|
1375
|
+
const I = tr(
|
|
1315
1376
|
t.segmentParams,
|
|
1316
1377
|
c
|
|
1317
1378
|
);
|
|
1318
|
-
if (
|
|
1319
|
-
const u = c.find(({ key: S }) => S ===
|
|
1379
|
+
if (Pn(h, I ?? t.segmentParams), lr(c, h), d && h.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
|
|
1380
|
+
const u = c.find(({ key: S }) => S === Ht), m = u ? u.value : p?.toString() ?? n.hideUnavailableItems.toString();
|
|
1320
1381
|
h.append("hideUnavailableItems", m);
|
|
1321
1382
|
}
|
|
1322
1383
|
n?.simulationBehavior !== void 0 && h.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && h.append("showSponsored", n.showSponsored.toString()), g !== void 0 && h.append("sponsoredCount", g.toString()), f !== void 0 && h.append("allowRedirect", f.toString());
|
|
1323
|
-
const l =
|
|
1324
|
-
|
|
1384
|
+
const l = En(
|
|
1385
|
+
cr(c, t.extraFacets)
|
|
1325
1386
|
);
|
|
1326
1387
|
return { params: h, path: l };
|
|
1327
1388
|
}
|
|
1328
|
-
function
|
|
1389
|
+
function dr(e, n) {
|
|
1329
1390
|
const { field: t, value: r, hideUnavailableItems: i, showInvisibleItems: a } = e, o = new URLSearchParams({
|
|
1330
1391
|
field: t ?? "",
|
|
1331
1392
|
value: r ?? ""
|
|
1332
1393
|
});
|
|
1333
|
-
return
|
|
1394
|
+
return Pn(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
|
|
1334
1395
|
}
|
|
1335
|
-
function
|
|
1396
|
+
function le(e) {
|
|
1336
1397
|
return (e ?? "").replaceAll(/[\s-]/g, "").toUpperCase();
|
|
1337
1398
|
}
|
|
1338
|
-
function
|
|
1339
|
-
const { segmentParams: t, extraFacets: r } = n, { postalCode: i, country: a, coordinates: o } = e, s = !!i, c = a || t.country, d = s &&
|
|
1399
|
+
function ur(e, n) {
|
|
1400
|
+
const { segmentParams: t, extraFacets: r } = n, { postalCode: i, country: a, coordinates: o } = e, s = !!i, c = a || t.country, d = s && le(i) === le(t["zip-code"]) && le(c) === le(t.country), g = s ? i : t["zip-code"], p = s ? c : t.country, f = d ? t.coordinates : void 0, h = s ? o ?? f : o || t.coordinates, I = !s || d, l = !!(t.deliveryZonesHash && t.pickupPointHash);
|
|
1340
1401
|
if ((!g || !p) && !!!h && !(I && l))
|
|
1341
1402
|
throw new Error(
|
|
1342
1403
|
"Missing delivery location for pickup point availability. Provide postalCode and country, coordinates, or a segment with zip-code."
|
|
@@ -1344,7 +1405,7 @@ function ar(e, n) {
|
|
|
1344
1405
|
const m = new URLSearchParams(), S = (v, b) => {
|
|
1345
1406
|
b != null && String(b) !== "" && m.append(v, String(b));
|
|
1346
1407
|
};
|
|
1347
|
-
return S("sc", t.sc), S("locale", t.locale), S("country", p), S("zip-code", g), S("coordinates", h), I && (S("deliveryZonesHash", t.deliveryZonesHash), S("pickupPointsHash", t.pickupPointHash)), { params: m, path:
|
|
1408
|
+
return S("sc", t.sc), S("locale", t.locale), S("country", p), S("zip-code", g), S("coordinates", h), I && (S("deliveryZonesHash", t.deliveryZonesHash), S("pickupPointsHash", t.pickupPointHash)), { params: m, path: En(r) };
|
|
1348
1409
|
}
|
|
1349
1410
|
function q(e, n) {
|
|
1350
1411
|
return {
|
|
@@ -1357,11 +1418,11 @@ function q(e, n) {
|
|
|
1357
1418
|
};
|
|
1358
1419
|
}
|
|
1359
1420
|
function x(e) {
|
|
1360
|
-
const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a =
|
|
1421
|
+
const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = sr(t, r);
|
|
1361
1422
|
switch (n) {
|
|
1362
1423
|
case "product-search":
|
|
1363
1424
|
case "facets": {
|
|
1364
|
-
const { params: o, path: s } =
|
|
1425
|
+
const { params: o, path: s } = xe(
|
|
1365
1426
|
i,
|
|
1366
1427
|
r,
|
|
1367
1428
|
a,
|
|
@@ -1370,7 +1431,7 @@ function x(e) {
|
|
|
1370
1431
|
return q(s, o);
|
|
1371
1432
|
}
|
|
1372
1433
|
case "catalog-count": {
|
|
1373
|
-
const { params: o, path: s } =
|
|
1434
|
+
const { params: o, path: s } = xe(
|
|
1374
1435
|
i,
|
|
1375
1436
|
r,
|
|
1376
1437
|
a,
|
|
@@ -1379,7 +1440,7 @@ function x(e) {
|
|
|
1379
1440
|
return q(s, o);
|
|
1380
1441
|
}
|
|
1381
1442
|
case "products": {
|
|
1382
|
-
const o =
|
|
1443
|
+
const o = dr(i, a.segmentParams);
|
|
1383
1444
|
return q("", o);
|
|
1384
1445
|
}
|
|
1385
1446
|
case "search-suggestions": {
|
|
@@ -1396,7 +1457,7 @@ function x(e) {
|
|
|
1396
1457
|
return q("", o);
|
|
1397
1458
|
}
|
|
1398
1459
|
case "pickup-point-availability": {
|
|
1399
|
-
const { params: o, path: s } =
|
|
1460
|
+
const { params: o, path: s } = ur(
|
|
1400
1461
|
i,
|
|
1401
1462
|
a
|
|
1402
1463
|
);
|
|
@@ -1408,16 +1469,16 @@ function x(e) {
|
|
|
1408
1469
|
}
|
|
1409
1470
|
}
|
|
1410
1471
|
}
|
|
1411
|
-
const
|
|
1412
|
-
function
|
|
1472
|
+
const pr = 10;
|
|
1473
|
+
function gr(e) {
|
|
1413
1474
|
const { regionId: n, seller: t } = e.storage.channel;
|
|
1414
1475
|
return (t ? Buffer.from(`SW#${t}`).toString("base64") : void 0) ?? (n || void 0);
|
|
1415
1476
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const t =
|
|
1477
|
+
function mr(e) {
|
|
1478
|
+
const t = An(e.headers?.cookie).cultureInfo || "";
|
|
1418
1479
|
return X(e) ? e.storage.locale || t : t || e.storage.locale || "";
|
|
1419
1480
|
}
|
|
1420
|
-
const
|
|
1481
|
+
const hr = ({
|
|
1421
1482
|
account: e,
|
|
1422
1483
|
environment: n,
|
|
1423
1484
|
hideUnavailableItems: t,
|
|
@@ -1425,69 +1486,69 @@ const lr = ({
|
|
|
1425
1486
|
showSponsored: i,
|
|
1426
1487
|
subDomainPrefix: a
|
|
1427
1488
|
}, o) => {
|
|
1428
|
-
const s = `https://${e}.${n}.com.br`, c =
|
|
1489
|
+
const s = `https://${e}.${n}.com.br`, c = bn(o), d = An(o.headers?.cookie), g = () => ({
|
|
1429
1490
|
salesChannel: o.storage.channel.salesChannel,
|
|
1430
|
-
regionId:
|
|
1431
|
-
locale:
|
|
1491
|
+
regionId: gr(o),
|
|
1492
|
+
locale: mr(o),
|
|
1432
1493
|
hideUnavailableItems: t,
|
|
1433
1494
|
simulationBehavior: r,
|
|
1434
1495
|
showSponsored: i
|
|
1435
|
-
}), p = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", f = a && a.map((
|
|
1496
|
+
}), p = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", f = a && a.map((C) => C + ".").find((C) => p.includes(C)) || "", h = p.replace(f, ""), I = c({
|
|
1436
1497
|
"content-type": "application/json",
|
|
1437
1498
|
"X-FORWARDED-HOST": h
|
|
1438
|
-
}), l = ({ type:
|
|
1439
|
-
const
|
|
1440
|
-
endpoint:
|
|
1499
|
+
}), l = ({ type: C, ...D }) => {
|
|
1500
|
+
const P = C === "facets" ? "facets" : "product-search", _ = x({
|
|
1501
|
+
endpoint: P,
|
|
1441
1502
|
segment: d,
|
|
1442
1503
|
defaults: g(),
|
|
1443
|
-
args:
|
|
1504
|
+
args: D
|
|
1444
1505
|
});
|
|
1445
1506
|
return y(
|
|
1446
|
-
`${s}/api/intelligent-search/v1/${
|
|
1507
|
+
`${s}/api/intelligent-search/v1/${P}/${_.path}?${_.params.toString()}`,
|
|
1447
1508
|
{ headers: I }
|
|
1448
1509
|
);
|
|
1449
|
-
}, u = (
|
|
1450
|
-
field:
|
|
1451
|
-
value:
|
|
1452
|
-
hideUnavailableItems:
|
|
1453
|
-
showInvisibleItems:
|
|
1510
|
+
}, u = (C) => l({ ...C, type: "product_search" }), m = ({
|
|
1511
|
+
field: C,
|
|
1512
|
+
value: D,
|
|
1513
|
+
hideUnavailableItems: P,
|
|
1514
|
+
showInvisibleItems: _
|
|
1454
1515
|
}) => {
|
|
1455
|
-
const
|
|
1516
|
+
const E = x({
|
|
1456
1517
|
endpoint: "products",
|
|
1457
1518
|
segment: d,
|
|
1458
1519
|
defaults: g(),
|
|
1459
1520
|
args: {
|
|
1460
|
-
field:
|
|
1461
|
-
value:
|
|
1462
|
-
hideUnavailableItems:
|
|
1463
|
-
showInvisibleItems:
|
|
1521
|
+
field: C,
|
|
1522
|
+
value: D,
|
|
1523
|
+
hideUnavailableItems: P,
|
|
1524
|
+
showInvisibleItems: _
|
|
1464
1525
|
}
|
|
1465
1526
|
});
|
|
1466
1527
|
return y(
|
|
1467
|
-
`${s}/api/intelligent-search/v1/products?${
|
|
1528
|
+
`${s}/api/intelligent-search/v1/products?${E.params.toString()}`,
|
|
1468
1529
|
{ headers: I }
|
|
1469
1530
|
);
|
|
1470
1531
|
};
|
|
1471
1532
|
return {
|
|
1472
|
-
facets: (
|
|
1533
|
+
facets: (C) => l({ ...C, type: "facets" }),
|
|
1473
1534
|
products: u,
|
|
1474
1535
|
fetchProduct: m,
|
|
1475
1536
|
productsByIdentifier: async ({
|
|
1476
|
-
field:
|
|
1477
|
-
values:
|
|
1478
|
-
showInvisibleItems:
|
|
1479
|
-
hideUnavailableItems:
|
|
1537
|
+
field: C,
|
|
1538
|
+
values: D,
|
|
1539
|
+
showInvisibleItems: P,
|
|
1540
|
+
hideUnavailableItems: _
|
|
1480
1541
|
}) => {
|
|
1481
|
-
const
|
|
1542
|
+
const E = Te(pr);
|
|
1482
1543
|
return (await Promise.all(
|
|
1483
|
-
|
|
1484
|
-
(w) =>
|
|
1544
|
+
D.map(
|
|
1545
|
+
(w) => E(async () => {
|
|
1485
1546
|
try {
|
|
1486
1547
|
return await m({
|
|
1487
|
-
field:
|
|
1548
|
+
field: C,
|
|
1488
1549
|
value: w,
|
|
1489
|
-
hideUnavailableItems:
|
|
1490
|
-
showInvisibleItems:
|
|
1550
|
+
hideUnavailableItems: _,
|
|
1551
|
+
showInvisibleItems: P
|
|
1491
1552
|
});
|
|
1492
1553
|
} catch {
|
|
1493
1554
|
return null;
|
|
@@ -1498,67 +1559,67 @@ const lr = ({
|
|
|
1498
1559
|
(w) => w !== null
|
|
1499
1560
|
);
|
|
1500
1561
|
},
|
|
1501
|
-
suggestedTerms: (
|
|
1502
|
-
const
|
|
1562
|
+
suggestedTerms: (C) => {
|
|
1563
|
+
const D = x({
|
|
1503
1564
|
endpoint: "search-suggestions",
|
|
1504
1565
|
segment: d,
|
|
1505
1566
|
defaults: g(),
|
|
1506
|
-
args: { query:
|
|
1567
|
+
args: { query: C.query }
|
|
1507
1568
|
});
|
|
1508
1569
|
return y(
|
|
1509
|
-
`${s}/api/intelligent-search/v1/search-suggestions?${
|
|
1570
|
+
`${s}/api/intelligent-search/v1/search-suggestions?${D.params.toString()}`,
|
|
1510
1571
|
{ headers: I }
|
|
1511
1572
|
);
|
|
1512
1573
|
},
|
|
1513
1574
|
topSearches: () => {
|
|
1514
|
-
const
|
|
1575
|
+
const C = x({
|
|
1515
1576
|
endpoint: "top-searches",
|
|
1516
1577
|
segment: d,
|
|
1517
1578
|
defaults: g()
|
|
1518
1579
|
});
|
|
1519
1580
|
return y(
|
|
1520
|
-
`${s}/api/intelligent-search/v1/top-searches?${
|
|
1581
|
+
`${s}/api/intelligent-search/v1/top-searches?${C.params.toString()}`,
|
|
1521
1582
|
{ headers: I }
|
|
1522
1583
|
);
|
|
1523
1584
|
},
|
|
1524
|
-
productCount: (
|
|
1525
|
-
const
|
|
1585
|
+
productCount: (C) => {
|
|
1586
|
+
const D = x({
|
|
1526
1587
|
endpoint: "catalog-count",
|
|
1527
1588
|
segment: d,
|
|
1528
1589
|
defaults: g(),
|
|
1529
|
-
args:
|
|
1590
|
+
args: C
|
|
1530
1591
|
});
|
|
1531
1592
|
return y(
|
|
1532
|
-
`${s}/api/intelligent-search/v1/catalog-count/${
|
|
1593
|
+
`${s}/api/intelligent-search/v1/catalog-count/${D.path}?${D.params.toString()}`,
|
|
1533
1594
|
{ headers: I }
|
|
1534
1595
|
);
|
|
1535
1596
|
},
|
|
1536
1597
|
pickupPointAvailability: ({
|
|
1537
|
-
postalCode:
|
|
1538
|
-
country:
|
|
1539
|
-
coordinates:
|
|
1598
|
+
postalCode: C,
|
|
1599
|
+
country: D,
|
|
1600
|
+
coordinates: P
|
|
1540
1601
|
}) => {
|
|
1541
|
-
const
|
|
1602
|
+
const _ = x({
|
|
1542
1603
|
endpoint: "pickup-point-availability",
|
|
1543
1604
|
segment: d,
|
|
1544
1605
|
defaults: g(),
|
|
1545
|
-
args: { postalCode:
|
|
1546
|
-
}),
|
|
1606
|
+
args: { postalCode: C, country: D, coordinates: P }
|
|
1607
|
+
}), E = _.path ? `/${_.path}` : "";
|
|
1547
1608
|
return y(
|
|
1548
|
-
`${s}/api/intelligent-search/v1/pickup-point-availability${
|
|
1609
|
+
`${s}/api/intelligent-search/v1/pickup-point-availability${E}?${_.params.toString()}`,
|
|
1549
1610
|
{ headers: I }
|
|
1550
1611
|
);
|
|
1551
1612
|
}
|
|
1552
1613
|
};
|
|
1553
|
-
},
|
|
1554
|
-
const t =
|
|
1614
|
+
}, fr = (e, n) => {
|
|
1615
|
+
const t = hr(e, n), r = xt(e, n), i = _t(e);
|
|
1555
1616
|
return {
|
|
1556
1617
|
search: t,
|
|
1557
1618
|
commerce: r,
|
|
1558
1619
|
catalog: i
|
|
1559
1620
|
};
|
|
1560
|
-
},
|
|
1561
|
-
const t =
|
|
1621
|
+
}, Sr = 20, yr = (e) => e.entityType === "category", we = (e) => e.entityType === "brand", je = (e) => e.entityType === "collection", Ir = (e, n) => {
|
|
1622
|
+
const t = Te(Sr), r = async (i) => Promise.all(
|
|
1562
1623
|
i.map(
|
|
1563
1624
|
(a) => t(async () => {
|
|
1564
1625
|
const o = a.slug.toLowerCase(), s = a.locale, c = await n.commerce.catalog.byLinkId.category(
|
|
@@ -1589,18 +1650,18 @@ const lr = ({
|
|
|
1589
1650
|
})
|
|
1590
1651
|
)
|
|
1591
1652
|
);
|
|
1592
|
-
return new
|
|
1653
|
+
return new Se(r, {
|
|
1593
1654
|
// DataLoader is used for caching, not batching
|
|
1594
1655
|
batch: !1,
|
|
1595
1656
|
// Dedup by lowercased slug + captured locale so casing variants share an
|
|
1596
1657
|
// entry while same-slug / different-locale loads stay isolated.
|
|
1597
1658
|
cacheKeyFn: ({ slug: i, locale: a }) => `${i.toLowerCase()}::${a ?? ""}`
|
|
1598
1659
|
});
|
|
1599
|
-
},
|
|
1660
|
+
}, vr = (e, n) => {
|
|
1600
1661
|
const t = async (r) => Promise.all(r.map((i) => n.commerce.catalog.salesChannel(i)));
|
|
1601
|
-
return new
|
|
1602
|
-
},
|
|
1603
|
-
const t =
|
|
1662
|
+
return new Se(t);
|
|
1663
|
+
}, Or = 1, Cr = (e, n) => {
|
|
1664
|
+
const t = Te(Or), r = async (a) => {
|
|
1604
1665
|
const o = a.reduce((p, { items: f }) => [...p, f], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
|
|
1605
1666
|
country: a[0].country,
|
|
1606
1667
|
postalCode: a[0].postalCode,
|
|
@@ -1620,20 +1681,20 @@ const lr = ({
|
|
|
1620
1681
|
items: d.slice(g[f], g[f + 1]).filter((h) => !!h)
|
|
1621
1682
|
}));
|
|
1622
1683
|
}, i = async (a) => t(r, a);
|
|
1623
|
-
return new
|
|
1684
|
+
return new Se(i, {
|
|
1624
1685
|
maxBatchSize: 50
|
|
1625
1686
|
});
|
|
1626
|
-
},
|
|
1627
|
-
function
|
|
1687
|
+
}, br = (e, n) => lt(e, n);
|
|
1688
|
+
function wr(e) {
|
|
1628
1689
|
return {
|
|
1629
1690
|
...e,
|
|
1630
|
-
description: e.description ?
|
|
1691
|
+
description: e.description ? br(e.description) : e.description
|
|
1631
1692
|
};
|
|
1632
1693
|
}
|
|
1633
1694
|
const L = (e, n) => ({
|
|
1634
1695
|
...e,
|
|
1635
|
-
isVariantOf:
|
|
1636
|
-
}),
|
|
1696
|
+
isVariantOf: wr(n)
|
|
1697
|
+
}), Ar = ({ flags: e }, n) => {
|
|
1637
1698
|
const t = async (r) => {
|
|
1638
1699
|
const i = r.map((g) => g.split("-")[0]), a = r.some(
|
|
1639
1700
|
(g) => g.split("-")[1] === "invisibleItems"
|
|
@@ -1658,31 +1719,31 @@ const L = (e, n) => ({
|
|
|
1658
1719
|
);
|
|
1659
1720
|
return c;
|
|
1660
1721
|
};
|
|
1661
|
-
return new
|
|
1722
|
+
return new Se(t, {
|
|
1662
1723
|
maxBatchSize: 99
|
|
1663
1724
|
// Max allowed batch size of Search API
|
|
1664
1725
|
});
|
|
1665
|
-
},
|
|
1666
|
-
const { clients: t } = n, r =
|
|
1726
|
+
}, Pr = (e, n) => {
|
|
1727
|
+
const { clients: t } = n, r = Ar(e, t), i = Cr(e, t), a = Ir(e, t), o = vr(e, t);
|
|
1667
1728
|
return {
|
|
1668
1729
|
skuLoader: r,
|
|
1669
1730
|
simulationLoader: i,
|
|
1670
1731
|
collectionLoader: a,
|
|
1671
1732
|
salesChannelLoader: o
|
|
1672
1733
|
};
|
|
1673
|
-
}, M = (e) => e.AvailableQuantity > 0, Y = (e) => e.spotPrice ?? 0,
|
|
1734
|
+
}, M = (e) => e.AvailableQuantity > 0, Y = (e) => e.spotPrice ?? 0, Dr = (e) => e.Price ?? 0, We = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", kn = (e, n) => M(e) && !M(n) ? -1 : !M(e) && M(n) ? 1 : Y(e) - Y(n), Er = (e) => e === "available", G = (e, n = 0, t = 1) => {
|
|
1674
1735
|
const r = n / t;
|
|
1675
1736
|
return Math.round((e + r) * 100) / 100;
|
|
1676
|
-
},
|
|
1737
|
+
}, kr = (e, n = { includeTaxes: !1 }) => {
|
|
1677
1738
|
const t = e.filter(M), r = t[t.length - 1], i = r ? Y(r) : 0;
|
|
1678
1739
|
return n.includeTaxes ? G(i, r?.Tax, r?.product?.unitMultiplier) : i;
|
|
1679
|
-
},
|
|
1740
|
+
}, He = (e, n = { includeTaxes: !1 }) => {
|
|
1680
1741
|
const [t] = e.filter(M), r = t ? Y(t) : 0;
|
|
1681
1742
|
return n.includeTaxes ? G(r, t?.Tax, t?.product?.unitMultiplier) : r;
|
|
1682
|
-
},
|
|
1683
|
-
highPrice: (e) =>
|
|
1684
|
-
lowPrice: (e) =>
|
|
1685
|
-
lowPriceWithTaxes: (e) =>
|
|
1743
|
+
}, _r = {
|
|
1744
|
+
highPrice: (e) => kr(e),
|
|
1745
|
+
lowPrice: (e) => He(e),
|
|
1746
|
+
lowPriceWithTaxes: (e) => He(e, { includeTaxes: !0 }),
|
|
1686
1747
|
offerCount: (e) => e.length,
|
|
1687
1748
|
priceCurrency: async (e, n, t) => {
|
|
1688
1749
|
const {
|
|
@@ -1692,20 +1753,20 @@ const L = (e, n) => ({
|
|
|
1692
1753
|
return (await r.load(i.salesChannel)).CurrencyCode ?? "";
|
|
1693
1754
|
},
|
|
1694
1755
|
offers: (e) => e
|
|
1695
|
-
},
|
|
1756
|
+
}, Tr = {
|
|
1696
1757
|
ratingValue: () => 5,
|
|
1697
1758
|
reviewCount: () => 0
|
|
1698
|
-
},
|
|
1759
|
+
}, Ge = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Rr = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ur = (e) => {
|
|
1699
1760
|
let n = e.slice(0);
|
|
1700
|
-
for (let t = 0; t <
|
|
1701
|
-
n = n.replace(new RegExp(
|
|
1761
|
+
for (let t = 0; t < Ge.length; t++)
|
|
1762
|
+
n = n.replace(new RegExp(Ge.charAt(t), "g"), Rr.charAt(t));
|
|
1702
1763
|
return n;
|
|
1703
|
-
},
|
|
1704
|
-
function
|
|
1764
|
+
}, Nr = (e) => e.replace(/[·/_,:]/, "-");
|
|
1765
|
+
function me(e) {
|
|
1705
1766
|
const t = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}><=_^]/g, "-");
|
|
1706
|
-
return
|
|
1767
|
+
return Nr(Ur(t)).toLowerCase();
|
|
1707
1768
|
}
|
|
1708
|
-
const
|
|
1769
|
+
const Ie = (e) => e.toLowerCase(), de = (e, n) => {
|
|
1709
1770
|
const t = n.split("/").filter(Boolean), {
|
|
1710
1771
|
loaders: { collectionLoader: r }
|
|
1711
1772
|
} = e;
|
|
@@ -1713,11 +1774,11 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1713
1774
|
t.map(
|
|
1714
1775
|
(i, a) => r.load({
|
|
1715
1776
|
slug: t.slice(0, a + 1).join("/"),
|
|
1716
|
-
locale:
|
|
1777
|
+
locale: wn(e)
|
|
1717
1778
|
})
|
|
1718
1779
|
)
|
|
1719
1780
|
);
|
|
1720
|
-
}, j = (e) =>
|
|
1781
|
+
}, j = (e) => yr(e) ? e.slug : we(e) ? e.linkId : e.linkId ?? me(e.name), _n = {
|
|
1721
1782
|
id: ({ id: e }) => e.toString(),
|
|
1722
1783
|
slug: (e) => j(e),
|
|
1723
1784
|
seo: (e) => ({
|
|
@@ -1727,23 +1788,23 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1727
1788
|
// for forward-compat; fall back to description for by-linkid parity.
|
|
1728
1789
|
description: e.metaTagDescription ?? e.description
|
|
1729
1790
|
}),
|
|
1730
|
-
type: (e) =>
|
|
1791
|
+
type: (e) => we(e) ? "Brand" : je(e) ? "Collection" : e.fatherCategoryId === null ? "Department" : "Category",
|
|
1731
1792
|
meta: async (e, n, t) => {
|
|
1732
1793
|
const r = j(e);
|
|
1733
|
-
if (
|
|
1794
|
+
if (we(e))
|
|
1734
1795
|
return { selectedFacets: [{ key: "brand", value: r }] };
|
|
1735
|
-
if (
|
|
1796
|
+
if (je(e))
|
|
1736
1797
|
return { selectedFacets: [{ key: "productclusterids", value: e.id }] };
|
|
1737
1798
|
const { defaultLocale: i } = re(t);
|
|
1738
1799
|
return {
|
|
1739
|
-
selectedFacets: (await
|
|
1800
|
+
selectedFacets: (await de(t, r)).map((o, s) => ({
|
|
1740
1801
|
key: `category-${s + 1}`,
|
|
1741
1802
|
value: i && o.availableLinkIds?.[i] || o.linkId
|
|
1742
1803
|
}))
|
|
1743
1804
|
};
|
|
1744
1805
|
},
|
|
1745
1806
|
breadcrumbList: async (e, n, t) => {
|
|
1746
|
-
const r = await
|
|
1807
|
+
const r = await de(t, j(e));
|
|
1747
1808
|
return {
|
|
1748
1809
|
itemListElement: r.map((i, a) => ({
|
|
1749
1810
|
item: `/${j(i)}`,
|
|
@@ -1762,7 +1823,7 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1762
1823
|
if (a.split("/").filter(Boolean).length === 0) return null;
|
|
1763
1824
|
let o;
|
|
1764
1825
|
try {
|
|
1765
|
-
o = await
|
|
1826
|
+
o = await de(t, a);
|
|
1766
1827
|
} catch (s) {
|
|
1767
1828
|
return console.warn("[otherLocales] failed to load collection entities:", s), null;
|
|
1768
1829
|
}
|
|
@@ -1775,7 +1836,7 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1775
1836
|
}
|
|
1776
1837
|
return c.length > 0 ? {
|
|
1777
1838
|
locale: s,
|
|
1778
|
-
slug:
|
|
1839
|
+
slug: Ie(c.join("/"))
|
|
1779
1840
|
} : null;
|
|
1780
1841
|
}).filter((s) => s !== null);
|
|
1781
1842
|
},
|
|
@@ -1784,21 +1845,21 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1784
1845
|
if (r.split("/").filter(Boolean).length === 0) return null;
|
|
1785
1846
|
let i;
|
|
1786
1847
|
try {
|
|
1787
|
-
i = await
|
|
1848
|
+
i = await de(t, r);
|
|
1788
1849
|
} catch (o) {
|
|
1789
1850
|
return console.warn("[canonicalSlug] failed to load collection entities:", o), null;
|
|
1790
1851
|
}
|
|
1791
1852
|
const a = i.map((o) => o.linkId);
|
|
1792
|
-
return a.every((o) => !!o) ?
|
|
1853
|
+
return a.every((o) => !!o) ? Ie(a.join("/")) : Ie(r);
|
|
1793
1854
|
}
|
|
1794
|
-
},
|
|
1855
|
+
}, Tn = {
|
|
1795
1856
|
buy: "whoboughtalsobought",
|
|
1796
1857
|
view: "whosawalsosaw",
|
|
1797
1858
|
similars: "similars",
|
|
1798
1859
|
viewAndBought: "whosawalsobought",
|
|
1799
1860
|
accessories: "accessories",
|
|
1800
1861
|
suggestions: "suggestions"
|
|
1801
|
-
},
|
|
1862
|
+
}, Xe = ({ key: e, value: n }) => {
|
|
1802
1863
|
switch (e) {
|
|
1803
1864
|
case "price":
|
|
1804
1865
|
return { key: e, value: n.replace("-to-", ":") };
|
|
@@ -1814,61 +1875,61 @@ const ye = (e) => e.toLowerCase(), le = (e, n) => {
|
|
|
1814
1875
|
default:
|
|
1815
1876
|
return { key: e, value: n };
|
|
1816
1877
|
}
|
|
1817
|
-
},
|
|
1878
|
+
}, Ye = (e) => {
|
|
1818
1879
|
const n = e.split(":").map(Number);
|
|
1819
1880
|
return n.length !== 2 || Number.isNaN(n[0]) || Number.isNaN(n[1]) ? null : n;
|
|
1820
|
-
},
|
|
1881
|
+
}, Fr = (e) => typeof Tn[e] == "string", Lr = (e) => {
|
|
1821
1882
|
const n = e?.filter(
|
|
1822
|
-
(t) =>
|
|
1883
|
+
(t) => Fr(t.key)
|
|
1823
1884
|
);
|
|
1824
1885
|
if (Array.isArray(n) && n.length > 1)
|
|
1825
|
-
throw new
|
|
1886
|
+
throw new k(
|
|
1826
1887
|
`You passed ${n.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${n.map((t) => t.key).join(",")}`
|
|
1827
1888
|
);
|
|
1828
1889
|
return n?.[0] ?? null;
|
|
1829
|
-
},
|
|
1890
|
+
}, Br = (e) => e?.find((n) => n.key === "slug")?.value ?? null, $r = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ke = (e) => e?.find((n) => n.key === "locale")?.value ?? null, Je = (e) => e?.find((n) => n.key === "channel")?.value ?? null, Ae = (e, n) => {
|
|
1830
1891
|
let t = 0;
|
|
1831
1892
|
for (let r = 1; r < e.length; r++)
|
|
1832
1893
|
n(e[t], e[r]) > 0 && (t = r);
|
|
1833
1894
|
return e[t];
|
|
1834
|
-
},
|
|
1895
|
+
}, Mr = {
|
|
1835
1896
|
__resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
|
|
1836
|
-
},
|
|
1897
|
+
}, zr = {
|
|
1837
1898
|
key: ({ key: e }) => e,
|
|
1838
1899
|
label: ({ name: e }) => e,
|
|
1839
1900
|
values: ({ values: e }) => e.sort((n, t) => n.name.localeCompare(t.name))
|
|
1840
|
-
},
|
|
1901
|
+
}, Vr = {
|
|
1841
1902
|
key: ({ key: e }) => e,
|
|
1842
1903
|
label: ({ name: e }) => e,
|
|
1843
1904
|
min: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
|
|
1844
|
-
const i =
|
|
1905
|
+
const i = Ye(
|
|
1845
1906
|
r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
|
|
1846
|
-
), o =
|
|
1907
|
+
), o = Ae(e, (s, c) => s.range.from - c.range.from)?.range?.from ?? 0;
|
|
1847
1908
|
return {
|
|
1848
1909
|
selected: i?.[0] ?? o,
|
|
1849
1910
|
absolute: o
|
|
1850
1911
|
};
|
|
1851
1912
|
},
|
|
1852
1913
|
max: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
|
|
1853
|
-
const i =
|
|
1914
|
+
const i = Ye(
|
|
1854
1915
|
r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
|
|
1855
|
-
), o =
|
|
1916
|
+
), o = Ae(e, (s, c) => c.range.to - s.range.to)?.range?.to ?? 0;
|
|
1856
1917
|
return {
|
|
1857
1918
|
selected: i?.[1] ?? o,
|
|
1858
1919
|
absolute: o
|
|
1859
1920
|
};
|
|
1860
1921
|
}
|
|
1861
|
-
},
|
|
1922
|
+
}, qr = {
|
|
1862
1923
|
value: ({ value: e }) => e,
|
|
1863
1924
|
label: ({ name: e }) => e || "unknown",
|
|
1864
1925
|
selected: ({ selected: e }) => e,
|
|
1865
1926
|
quantity: ({ quantity: e }) => e
|
|
1866
|
-
},
|
|
1927
|
+
}, xr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1867
1928
|
if (!n?.orderId)
|
|
1868
|
-
throw new
|
|
1929
|
+
throw new k("Missing orderId");
|
|
1869
1930
|
return { data: (await t.checkout.cancelOrder(n))?.data };
|
|
1870
1931
|
};
|
|
1871
|
-
function
|
|
1932
|
+
function Rn(e) {
|
|
1872
1933
|
if (!e || e.status !== "pending")
|
|
1873
1934
|
return null;
|
|
1874
1935
|
for (const n of e.dimensionStatus) {
|
|
@@ -1886,45 +1947,57 @@ function kn(e) {
|
|
|
1886
1947
|
}
|
|
1887
1948
|
return null;
|
|
1888
1949
|
}
|
|
1889
|
-
function
|
|
1950
|
+
function jr(e) {
|
|
1890
1951
|
if (!e || e.status !== "pending") return !1;
|
|
1891
1952
|
const n = e.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
|
|
1892
1953
|
return n.length === 0 ? !1 : n.every((t) => !t.isUserNextAuthorizer);
|
|
1893
1954
|
}
|
|
1894
|
-
const
|
|
1895
|
-
const r = await t.oms.processOrderAuthorization(n), i =
|
|
1955
|
+
const Wr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1956
|
+
const r = await t.oms.processOrderAuthorization(n), i = Rn(r);
|
|
1896
1957
|
return {
|
|
1897
|
-
isPendingForOtherAuthorizer: !i &&
|
|
1958
|
+
isPendingForOtherAuthorizer: !i && jr(r),
|
|
1898
1959
|
ruleForAuthorization: i
|
|
1899
1960
|
};
|
|
1900
|
-
},
|
|
1961
|
+
}, Hr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1901
1962
|
if (!n?.objectKey)
|
|
1902
|
-
throw new
|
|
1963
|
+
throw new k("Missing objectKey");
|
|
1903
1964
|
const r = n.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
|
|
1904
1965
|
return t.orderEntry.startOperation({
|
|
1905
1966
|
objectKey: n.objectKey,
|
|
1906
1967
|
orderFormId: r,
|
|
1907
1968
|
sessionToken: n.sessionToken ?? void 0
|
|
1908
1969
|
});
|
|
1909
|
-
},
|
|
1970
|
+
}, Gr = async (e, n, t) => {
|
|
1910
1971
|
if (!(await t.clients.commerce.recommendation.startRecommendationSession())?.recommendationsUserId)
|
|
1911
1972
|
throw new Error(
|
|
1912
1973
|
"Failed to start recommendation session: no session data returned"
|
|
1913
1974
|
);
|
|
1914
1975
|
return !0;
|
|
1915
|
-
},
|
|
1976
|
+
}, Xr = 254, Qe = 100, Yr = /^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/, Kr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1977
|
+
const r = n.email?.trim().toLowerCase() ?? "", i = n.name?.trim() ?? "";
|
|
1978
|
+
if (r.length > Xr || !Yr.test(r))
|
|
1979
|
+
throw new k("Invalid email");
|
|
1980
|
+
if (i.length > Qe)
|
|
1981
|
+
throw new k(
|
|
1982
|
+
`Invalid name: must have at most ${Qe} characters`
|
|
1983
|
+
);
|
|
1984
|
+
return { id: (await t.subscribeToNewsletter({
|
|
1985
|
+
email: r,
|
|
1986
|
+
name: i || void 0
|
|
1987
|
+
}))?.Id };
|
|
1988
|
+
}, Jr = async (e, { data: n }, { clients: { commerce: t } }) => {
|
|
1916
1989
|
const { fileContent: r, fileName: i, mimeType: a } = n;
|
|
1917
1990
|
if (!r || !i || !a)
|
|
1918
|
-
throw new
|
|
1991
|
+
throw new k(
|
|
1919
1992
|
"Missing required fields: fileContent, fileName, mimeType"
|
|
1920
1993
|
);
|
|
1921
1994
|
const o = r.replaceAll(/\s/g, ""), s = 5 * 1024 * 1024;
|
|
1922
1995
|
if (Math.floor(o.length * 3 / 4) > s)
|
|
1923
|
-
throw new
|
|
1996
|
+
throw new k("File exceeds maximum allowed size of 5MB");
|
|
1924
1997
|
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
|
|
1925
1998
|
o
|
|
1926
1999
|
))
|
|
1927
|
-
throw new
|
|
2000
|
+
throw new k("Invalid Base64 fileContent");
|
|
1928
2001
|
const g = Buffer.from(o, "base64");
|
|
1929
2002
|
return await t.orderEntry.uploadFile({
|
|
1930
2003
|
fileBuffer: g,
|
|
@@ -1950,33 +2023,33 @@ class ae {
|
|
|
1950
2023
|
return JSON.stringify(n);
|
|
1951
2024
|
}
|
|
1952
2025
|
}
|
|
1953
|
-
function
|
|
2026
|
+
function Qr(e, n) {
|
|
1954
2027
|
return n == null || n === "" || String(n) === String(e.salesChannel ?? "") ? null : ae.stringify({
|
|
1955
2028
|
...e,
|
|
1956
2029
|
salesChannel: String(n),
|
|
1957
2030
|
hasOnlyDefaultSalesChannel: !1
|
|
1958
2031
|
});
|
|
1959
2032
|
}
|
|
1960
|
-
function
|
|
2033
|
+
function Zr(e, n, t) {
|
|
1961
2034
|
return t != null && String(e.salesChannel ?? "") === t && String(n ?? "") !== t ? !1 : e.items.length > 0 ? !0 : e.salesChannel == null || e.salesChannel === "" ? !1 : String(e.salesChannel) === String(n ?? "");
|
|
1962
2035
|
}
|
|
1963
|
-
const
|
|
2036
|
+
const Un = (e) => {
|
|
1964
2037
|
try {
|
|
1965
2038
|
return JSON.parse(e ?? "") ?? {};
|
|
1966
2039
|
} catch {
|
|
1967
2040
|
return {};
|
|
1968
2041
|
}
|
|
1969
2042
|
};
|
|
1970
|
-
function
|
|
1971
|
-
const t =
|
|
2043
|
+
function Nn(e, { localizationEnabled: n = !0 } = {}) {
|
|
2044
|
+
const t = Un(e).salesChannelSource;
|
|
1972
2045
|
return t === "url" ? n ? t : void 0 : t === "orderForm" ? t : void 0;
|
|
1973
2046
|
}
|
|
1974
|
-
const
|
|
1975
|
-
function
|
|
1976
|
-
const n =
|
|
2047
|
+
const Fn = (e) => !!e?.localization?.enabled;
|
|
2048
|
+
function Ln(e) {
|
|
2049
|
+
const n = Un(e).rejectedSalesChannel;
|
|
1977
2050
|
return (typeof n == "string" || typeof n == "number") && String(n) || void 0;
|
|
1978
2051
|
}
|
|
1979
|
-
function
|
|
2052
|
+
function ei(e, n, t, r, i, a) {
|
|
1980
2053
|
const o = n ?? void 0, s = t ?? e.regionId, c = i ? e.salesChannel || o : o ?? e.salesChannel, d = a != null && a !== String(c ?? "");
|
|
1981
2054
|
return ae.stringify({
|
|
1982
2055
|
salesChannel: c,
|
|
@@ -1987,16 +2060,16 @@ function Hr(e, n, t, r, i, a) {
|
|
|
1987
2060
|
...d ? { rejectedSalesChannel: a } : {}
|
|
1988
2061
|
});
|
|
1989
2062
|
}
|
|
1990
|
-
const
|
|
1991
|
-
function
|
|
2063
|
+
const Ze = "1";
|
|
2064
|
+
function ni(e, n, t, r) {
|
|
1992
2065
|
const i = String(e.salesChannel ?? "");
|
|
1993
|
-
return n === void 0 && i ===
|
|
2066
|
+
return n === void 0 && i === Ze && !!t && t !== Ze && !new URLSearchParams(r).has("sc") ? t : i;
|
|
1994
2067
|
}
|
|
1995
2068
|
const ne = (e, n) => {
|
|
1996
2069
|
e.storage.channel = ae.parse(n);
|
|
1997
|
-
},
|
|
2070
|
+
}, Pe = (e, n) => {
|
|
1998
2071
|
e.storage.locale = n;
|
|
1999
|
-
},
|
|
2072
|
+
}, Ne = (e) => dt.createHash("md5").update(e).digest("hex"), V = {
|
|
2000
2073
|
attachment: "ATTACHMENT",
|
|
2001
2074
|
specification: "SPECIFICATION",
|
|
2002
2075
|
attribute: "ATTRIBUTE",
|
|
@@ -2007,14 +2080,14 @@ const ne = (e, n) => {
|
|
|
2007
2080
|
*/
|
|
2008
2081
|
service: "SERVICE"
|
|
2009
2082
|
};
|
|
2010
|
-
function
|
|
2083
|
+
function Bn(e) {
|
|
2011
2084
|
return {
|
|
2012
2085
|
name: e.name,
|
|
2013
2086
|
value: e.content,
|
|
2014
2087
|
valueReference: V.attachment
|
|
2015
2088
|
};
|
|
2016
2089
|
}
|
|
2017
|
-
function
|
|
2090
|
+
function ti(e) {
|
|
2018
2091
|
return {
|
|
2019
2092
|
propertyID: e.id,
|
|
2020
2093
|
name: e.name,
|
|
@@ -2025,27 +2098,27 @@ function Xr(e) {
|
|
|
2025
2098
|
}
|
|
2026
2099
|
};
|
|
2027
2100
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
2101
|
+
function $n(e) {
|
|
2102
|
+
return Ne(
|
|
2030
2103
|
`${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`
|
|
2031
2104
|
);
|
|
2032
2105
|
}
|
|
2033
|
-
const
|
|
2106
|
+
const Mn = (e, n) => e < n ? -1 : e > n ? 1 : 0, ri = (e, n) => Mn(e.name, n.name), ii = (e) => [...e ?? []].sort(ri), en = (e) => e !== null && typeof e == "object" && !Array.isArray(e), ai = (e) => en(e) && typeof e.name == "string" && en(e.content), oi = (e) => ({
|
|
2034
2107
|
name: e.name,
|
|
2035
2108
|
content: Object.fromEntries(
|
|
2036
|
-
Object.keys(e.content).sort(
|
|
2109
|
+
Object.keys(e.content).sort(Mn).map((n) => [n, e.content[n]])
|
|
2037
2110
|
)
|
|
2038
|
-
}),
|
|
2111
|
+
}), zn = (e, n) => Ne(
|
|
2039
2112
|
`SERVICE:${e}:${JSON.stringify(
|
|
2040
|
-
|
|
2041
|
-
|
|
2113
|
+
ii((n ?? []).filter(ai)).map(
|
|
2114
|
+
oi
|
|
2042
2115
|
)
|
|
2043
2116
|
)}`
|
|
2044
|
-
),
|
|
2045
|
-
function
|
|
2117
|
+
), si = "SERVICE:unreadable";
|
|
2118
|
+
function Fe(e) {
|
|
2046
2119
|
const n = e.attachments ?? [];
|
|
2047
2120
|
return {
|
|
2048
|
-
propertyID:
|
|
2121
|
+
propertyID: zn(e.id, n),
|
|
2049
2122
|
name: e.name,
|
|
2050
2123
|
value: {
|
|
2051
2124
|
id: e.id,
|
|
@@ -2055,27 +2128,27 @@ function Te(e) {
|
|
|
2055
2128
|
valueReference: V.service
|
|
2056
2129
|
};
|
|
2057
2130
|
}
|
|
2058
|
-
const
|
|
2131
|
+
const ci = (e) => {
|
|
2059
2132
|
try {
|
|
2060
2133
|
return JSON.parse(e);
|
|
2061
2134
|
} catch {
|
|
2062
2135
|
return null;
|
|
2063
2136
|
}
|
|
2064
|
-
},
|
|
2065
|
-
const n = typeof e == "string" ?
|
|
2137
|
+
}, li = (e) => {
|
|
2138
|
+
const n = typeof e == "string" ? ci(e) : e;
|
|
2066
2139
|
if (n === null || typeof n != "object")
|
|
2067
2140
|
return null;
|
|
2068
2141
|
const { id: t, attachments: r } = n;
|
|
2069
2142
|
return typeof t != "string" && typeof t != "number" ? null : { id: String(t), attachments: r };
|
|
2070
2143
|
};
|
|
2071
|
-
function
|
|
2072
|
-
const n =
|
|
2073
|
-
return n ?
|
|
2144
|
+
function di(e) {
|
|
2145
|
+
const n = li(e.value);
|
|
2146
|
+
return n ? zn(
|
|
2074
2147
|
n.id,
|
|
2075
2148
|
Array.isArray(n.attachments) ? n.attachments : []
|
|
2076
|
-
) :
|
|
2149
|
+
) : si;
|
|
2077
2150
|
}
|
|
2078
|
-
const
|
|
2151
|
+
const ui = (e) => {
|
|
2079
2152
|
const n = e.postalCode, t = e.geoCoordinates, r = {
|
|
2080
2153
|
addressType: e.addressType || null,
|
|
2081
2154
|
postalCode: n || null,
|
|
@@ -2094,7 +2167,7 @@ const ri = (e) => {
|
|
|
2094
2167
|
r.geoCoordinates = i !== null && a !== null ? [a, i] : [];
|
|
2095
2168
|
}
|
|
2096
2169
|
return [r];
|
|
2097
|
-
},
|
|
2170
|
+
}, pi = (e, n, t) => {
|
|
2098
2171
|
const r = n.postalCode, i = n.geoCoordinates, a = e?.shippingData?.availableAddresses ?? [], o = e?.shippingData?.selectedAddresses ?? [];
|
|
2099
2172
|
if (!t && o.length > 0)
|
|
2100
2173
|
return [o[0]];
|
|
@@ -2108,17 +2181,17 @@ const ri = (e) => {
|
|
|
2108
2181
|
return [s];
|
|
2109
2182
|
}
|
|
2110
2183
|
return null;
|
|
2111
|
-
},
|
|
2112
|
-
if (!
|
|
2184
|
+
}, Vn = (e, n) => {
|
|
2185
|
+
if (!gi(n))
|
|
2113
2186
|
return { updateShipping: !1, addressChanged: !1 };
|
|
2114
|
-
if (!
|
|
2187
|
+
if (!Si(e))
|
|
2115
2188
|
return { updateShipping: !1, addressChanged: !1 };
|
|
2116
2189
|
const [t] = e?.shippingData?.selectedAddresses ?? [];
|
|
2117
|
-
if (
|
|
2190
|
+
if (mi(t, n.postalCode) || hi(t, n.geoCoordinates) || fi(t, n.addressType))
|
|
2118
2191
|
return { updateShipping: !0, addressChanged: !0 };
|
|
2119
2192
|
const { logisticsInfo: r } = e.shippingData;
|
|
2120
|
-
return
|
|
2121
|
-
},
|
|
2193
|
+
return yi(r, n) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
|
|
2194
|
+
}, gi = (e) => !!e.postalCode || e.geoCoordinates?.latitude && e.geoCoordinates?.longitude, mi = (e, n) => typeof n == "string" && e?.postalCode !== n, hi = (e, n) => typeof n?.latitude == "number" && typeof n?.longitude == "number" && (e?.geoCoordinates[0] !== n?.longitude || e?.geoCoordinates[1] !== n?.latitude), fi = (e, n) => typeof n == "string" && e?.addressType !== n, Si = (e) => e.items.length !== 0, yi = (e, n) => {
|
|
2122
2195
|
const t = n?.deliveryMode?.deliveryChannel, r = n?.deliveryMode?.deliveryMethod, { startDate: i, endDate: a } = n?.deliveryMode?.deliveryWindow || {};
|
|
2123
2196
|
return e.some(
|
|
2124
2197
|
({ selectedDeliveryChannel: o, selectedSla: s, slas: c }) => {
|
|
@@ -2128,16 +2201,16 @@ const ri = (e) => {
|
|
|
2128
2201
|
));
|
|
2129
2202
|
}
|
|
2130
2203
|
);
|
|
2131
|
-
},
|
|
2132
|
-
const n =
|
|
2204
|
+
}, qn = (e) => e.valueReference === V.attachment, Ii = (e) => e.valueReference === V.service, vi = (e) => (e.itemOffered.additionalProperty ?? []).filter(Ii).map(di).sort((n, t) => n.localeCompare(t)), xn = (e) => {
|
|
2205
|
+
const n = vi(e);
|
|
2133
2206
|
return n.length > 0 ? `services:${n.join("-")}` : void 0;
|
|
2134
2207
|
}, De = (e) => [
|
|
2135
2208
|
e.itemOffered.sku,
|
|
2136
2209
|
e.seller.identifier,
|
|
2137
2210
|
e.price < 0.01 ? "Gift" : void 0,
|
|
2138
|
-
e.itemOffered.additionalProperty?.filter(
|
|
2139
|
-
|
|
2140
|
-
].filter(Boolean).join("::"),
|
|
2211
|
+
e.itemOffered.additionalProperty?.filter(qn).map($n).join("-"),
|
|
2212
|
+
xn(e)
|
|
2213
|
+
].filter(Boolean).join("::"), he = (e, n) => ({
|
|
2141
2214
|
listPrice: e.listPrice / 100,
|
|
2142
2215
|
price: e.sellingPrice / 100,
|
|
2143
2216
|
quantity: e.quantity,
|
|
@@ -2147,49 +2220,49 @@ const ri = (e) => {
|
|
|
2147
2220
|
image: [],
|
|
2148
2221
|
name: e.name,
|
|
2149
2222
|
additionalProperty: [
|
|
2150
|
-
...e.attachments.map(
|
|
2151
|
-
...(e.bundleItems ?? []).map(
|
|
2223
|
+
...e.attachments.map(Bn),
|
|
2224
|
+
...(e.bundleItems ?? []).map(Fe)
|
|
2152
2225
|
]
|
|
2153
2226
|
},
|
|
2154
2227
|
index: n
|
|
2155
|
-
}),
|
|
2228
|
+
}), Oi = (e) => ({
|
|
2156
2229
|
quantity: e.quantity,
|
|
2157
2230
|
seller: e.seller.identifier,
|
|
2158
2231
|
id: e.itemOffered.sku,
|
|
2159
2232
|
index: e.index,
|
|
2160
|
-
attachments: (e.itemOffered.additionalProperty?.filter(
|
|
2233
|
+
attachments: (e.itemOffered.additionalProperty?.filter(qn) ?? []).map((n) => ({
|
|
2161
2234
|
name: n.name,
|
|
2162
2235
|
content: n.value
|
|
2163
2236
|
})),
|
|
2164
2237
|
...e.priceToken ? { priceToken: e.priceToken } : {}
|
|
2165
|
-
}),
|
|
2238
|
+
}), nn = (e) => e.reduce((n, t) => {
|
|
2166
2239
|
const r = De(t);
|
|
2167
2240
|
return n.has(r) || n.set(r, []), n.get(r)?.push(t), n;
|
|
2168
|
-
}, /* @__PURE__ */ new Map()),
|
|
2241
|
+
}, /* @__PURE__ */ new Map()), Ci = (e, n) => {
|
|
2169
2242
|
const t = ({ priceToken: s, ...c }, d) => ({
|
|
2170
2243
|
...c,
|
|
2171
2244
|
itemOffered: {
|
|
2172
2245
|
sku: c.itemOffered.sku
|
|
2173
2246
|
},
|
|
2174
|
-
services:
|
|
2247
|
+
services: xn(c),
|
|
2175
2248
|
index: d
|
|
2176
|
-
}), r = n.items.map(
|
|
2249
|
+
}), r = n.items.map(he).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = Re(r, i);
|
|
2177
2250
|
return a && o;
|
|
2178
2251
|
};
|
|
2179
|
-
function
|
|
2252
|
+
function jn(e, n) {
|
|
2180
2253
|
return e?.some(
|
|
2181
2254
|
(t) => t.parentItemIndex !== null && t.parentItemIndex !== void 0 && e[t.parentItemIndex]?.id === n
|
|
2182
2255
|
);
|
|
2183
2256
|
}
|
|
2184
|
-
function
|
|
2257
|
+
function Wn(e, n) {
|
|
2185
2258
|
return e?.some(
|
|
2186
2259
|
(t) => t.id === n && t.parentItemIndex !== null
|
|
2187
2260
|
);
|
|
2188
2261
|
}
|
|
2189
|
-
const
|
|
2262
|
+
const tn = (e) => {
|
|
2190
2263
|
const n = e.items.reduce(
|
|
2191
2264
|
(t, r, i) => {
|
|
2192
|
-
const a =
|
|
2265
|
+
const a = Wn(e.items, r.id) || jn(e.items, r.id) ? `${De(he(r))}::${i}` : De(he(r));
|
|
2193
2266
|
return t[a] || (t[a] = []), t[a].push(r), t;
|
|
2194
2267
|
},
|
|
2195
2268
|
{}
|
|
@@ -2208,7 +2281,7 @@ const Qe = (e) => {
|
|
|
2208
2281
|
};
|
|
2209
2282
|
})
|
|
2210
2283
|
};
|
|
2211
|
-
},
|
|
2284
|
+
}, Ee = async (e, n, t, r) => ({
|
|
2212
2285
|
order: {
|
|
2213
2286
|
orderNumber: e.orderFormId,
|
|
2214
2287
|
acceptedOffer: e.items.map(async (i) => ({
|
|
@@ -2222,9 +2295,9 @@ const Qe = (e) => {
|
|
|
2222
2295
|
text: i,
|
|
2223
2296
|
status: a.toUpperCase()
|
|
2224
2297
|
}))
|
|
2225
|
-
}),
|
|
2298
|
+
}), Hn = ({ items: e }, n) => {
|
|
2226
2299
|
const t = e.map((r) => {
|
|
2227
|
-
const i = (r.bundleItems ?? []).map(
|
|
2300
|
+
const i = (r.bundleItems ?? []).map(Fe).map(({ propertyID: a }) => a).sort((a, o) => a.localeCompare(o));
|
|
2228
2301
|
return {
|
|
2229
2302
|
id: r.id,
|
|
2230
2303
|
quantity: r.quantity,
|
|
@@ -2234,16 +2307,16 @@ const Qe = (e) => {
|
|
|
2234
2307
|
...i.length > 0 ? { services: i } : {}
|
|
2235
2308
|
};
|
|
2236
2309
|
});
|
|
2237
|
-
return
|
|
2310
|
+
return Ne(
|
|
2238
2311
|
JSON.stringify({ sessionId: n?.id ?? "", items: t })
|
|
2239
2312
|
);
|
|
2240
|
-
},
|
|
2313
|
+
}, rn = async (e, n, t) => {
|
|
2241
2314
|
try {
|
|
2242
2315
|
return await n.checkout.setCustomData({
|
|
2243
2316
|
id: e.orderFormId,
|
|
2244
2317
|
appId: "faststore",
|
|
2245
2318
|
key: "cartEtag",
|
|
2246
|
-
value:
|
|
2319
|
+
value: Hn(e, t)
|
|
2247
2320
|
});
|
|
2248
2321
|
} catch (r) {
|
|
2249
2322
|
throw console.error(
|
|
@@ -2253,22 +2326,22 @@ const Qe = (e) => {
|
|
|
2253
2326
|
More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api`
|
|
2254
2327
|
), r;
|
|
2255
2328
|
}
|
|
2256
|
-
},
|
|
2329
|
+
}, bi = (e, n) => {
|
|
2257
2330
|
const r = e.customData?.customApps.find(
|
|
2258
2331
|
(a) => a.id === "faststore"
|
|
2259
2332
|
)?.fields?.cartEtag;
|
|
2260
|
-
return r == null ? !0 :
|
|
2261
|
-
},
|
|
2333
|
+
return r == null ? !0 : Hn(e, n) !== r;
|
|
2334
|
+
}, wi = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
|
|
2262
2335
|
id: e
|
|
2263
|
-
}),
|
|
2336
|
+
}), an = async (e, n, { clients: { commerce: t } }) => {
|
|
2264
2337
|
if (!n)
|
|
2265
2338
|
return e;
|
|
2266
|
-
const { updateShipping: r, addressChanged: i } =
|
|
2339
|
+
const { updateShipping: r, addressChanged: i } = Vn(
|
|
2267
2340
|
e,
|
|
2268
2341
|
n
|
|
2269
2342
|
);
|
|
2270
2343
|
if (r) {
|
|
2271
|
-
const a =
|
|
2344
|
+
const a = pi(e, n, i), s = a || ui(n);
|
|
2272
2345
|
return !!n.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
|
|
2273
2346
|
{
|
|
2274
2347
|
id: e.orderFormId,
|
|
@@ -2288,18 +2361,18 @@ const Qe = (e) => {
|
|
|
2288
2361
|
);
|
|
2289
2362
|
}
|
|
2290
2363
|
return e;
|
|
2291
|
-
},
|
|
2364
|
+
}, Ai = (e, n) => {
|
|
2292
2365
|
if (!e)
|
|
2293
2366
|
return "";
|
|
2294
2367
|
const r = ie(e)[n];
|
|
2295
2368
|
return r ? r.split("=")[1] : "";
|
|
2296
|
-
},
|
|
2369
|
+
}, Pi = async (e, n, t, r) => {
|
|
2297
2370
|
const { commerce: i } = e.clients, a = await i.checkout.orderForm({
|
|
2298
2371
|
id: n,
|
|
2299
2372
|
channel: e.storage.channel,
|
|
2300
2373
|
preserveSalesChannel: !!n && !t
|
|
2301
2374
|
});
|
|
2302
|
-
return !n ||
|
|
2375
|
+
return !n || Zr(
|
|
2303
2376
|
a,
|
|
2304
2377
|
e.storage.channel.salesChannel,
|
|
2305
2378
|
r
|
|
@@ -2307,103 +2380,103 @@ const Qe = (e) => {
|
|
|
2307
2380
|
id: n,
|
|
2308
2381
|
channel: e.storage.channel
|
|
2309
2382
|
});
|
|
2310
|
-
},
|
|
2383
|
+
}, on = (e, n, t) => {
|
|
2311
2384
|
if (!t || n.items.length === 0)
|
|
2312
2385
|
return null;
|
|
2313
|
-
const r =
|
|
2386
|
+
const r = Qr(
|
|
2314
2387
|
e.storage.channel,
|
|
2315
2388
|
n.salesChannel
|
|
2316
2389
|
);
|
|
2317
2390
|
return r ? (ne(e, r), n.salesChannel ? String(n.salesChannel) : null) : null;
|
|
2318
|
-
},
|
|
2319
|
-
const i =
|
|
2391
|
+
}, sn = (e, n, t, r) => r ? Ee(e, n, t, r) : null, Di = async (e, { cart: { order: n }, session: t }, r) => {
|
|
2392
|
+
const i = Ai(
|
|
2320
2393
|
r.headers.cookie,
|
|
2321
2394
|
"checkout.vtex.com"
|
|
2322
2395
|
), {
|
|
2323
2396
|
clients: { commerce: a },
|
|
2324
2397
|
loaders: { skuLoader: o }
|
|
2325
|
-
} = r, s = t?.channel, c = t?.locale, d =
|
|
2326
|
-
localizationEnabled:
|
|
2327
|
-
}) === "url", g =
|
|
2328
|
-
s && ne(r, s), c &&
|
|
2329
|
-
const p = await
|
|
2398
|
+
} = r, s = t?.channel, c = t?.locale, d = Nn(s, {
|
|
2399
|
+
localizationEnabled: Fn(r.discoveryConfig)
|
|
2400
|
+
}) === "url", g = Ln(s);
|
|
2401
|
+
s && ne(r, s), c && Pe(r, c);
|
|
2402
|
+
const p = await Pi(
|
|
2330
2403
|
r,
|
|
2331
2404
|
i || void 0,
|
|
2332
2405
|
d,
|
|
2333
2406
|
g
|
|
2334
2407
|
), f = p.orderFormId;
|
|
2335
|
-
p.messages.length !== 0 && await
|
|
2408
|
+
p.messages.length !== 0 && await wi(f, r);
|
|
2336
2409
|
const h = ie(r?.headers?.cookie ?? "")?.vtex_session, I = H(h), { acceptedOffer: l, shouldSplitItem: u } = n;
|
|
2337
|
-
if (
|
|
2338
|
-
const w =
|
|
2410
|
+
if (bi(p, I)) {
|
|
2411
|
+
const w = on(
|
|
2339
2412
|
r,
|
|
2340
2413
|
p,
|
|
2341
2414
|
!d
|
|
2342
|
-
),
|
|
2415
|
+
), F = await rn(
|
|
2343
2416
|
p,
|
|
2344
2417
|
a,
|
|
2345
2418
|
I
|
|
2346
|
-
).then(
|
|
2419
|
+
).then(tn);
|
|
2347
2420
|
if (f)
|
|
2348
|
-
return
|
|
2349
|
-
|
|
2421
|
+
return Ee(
|
|
2422
|
+
F,
|
|
2350
2423
|
o,
|
|
2351
2424
|
u,
|
|
2352
2425
|
w
|
|
2353
2426
|
);
|
|
2354
2427
|
}
|
|
2355
|
-
const S =
|
|
2428
|
+
const S = on(
|
|
2356
2429
|
r,
|
|
2357
2430
|
p,
|
|
2358
2431
|
!d
|
|
2359
|
-
), v =
|
|
2360
|
-
(w, [
|
|
2361
|
-
const oe = b.get(
|
|
2432
|
+
), v = nn(l), b = nn(p.items.map(he)), O = Array.from(b.entries()), T = Array.from(v.entries()), { itemsToAdd: A, itemsToUpdate: C } = T.reduce(
|
|
2433
|
+
(w, [F, J]) => {
|
|
2434
|
+
const oe = b.get(F);
|
|
2362
2435
|
if (!oe)
|
|
2363
|
-
return
|
|
2436
|
+
return J.forEach((Q) => w.itemsToAdd.push(Q)), w;
|
|
2364
2437
|
const [B, ...se] = oe;
|
|
2365
|
-
if (
|
|
2438
|
+
if (Wn(p.items, B.itemOffered.sku) || jn(p.items, B.itemOffered.sku))
|
|
2366
2439
|
return w.itemsToUpdate.push(B), w;
|
|
2367
|
-
const
|
|
2440
|
+
const Zn = J.reduce((Q, et) => Q + et.quantity, 0);
|
|
2368
2441
|
return w.itemsToUpdate.push({
|
|
2369
2442
|
...B,
|
|
2370
|
-
quantity:
|
|
2443
|
+
quantity: Zn
|
|
2371
2444
|
}), se.forEach((Q) => w.itemsToUpdate.push({ ...Q, quantity: 0 })), w;
|
|
2372
2445
|
},
|
|
2373
2446
|
{
|
|
2374
2447
|
itemsToAdd: [],
|
|
2375
2448
|
itemsToUpdate: []
|
|
2376
2449
|
}
|
|
2377
|
-
),
|
|
2378
|
-
|
|
2379
|
-
), { updateShipping:
|
|
2380
|
-
if (
|
|
2381
|
-
return
|
|
2450
|
+
), D = O.filter(([w]) => !v.has(w)).flatMap(([, w]) => w.map((F) => ({ ...F, quantity: 0 }))), P = [...A, ...C, ...D].map(
|
|
2451
|
+
Oi
|
|
2452
|
+
), { updateShipping: _ } = t ? Vn(p, t) : { updateShipping: !1 };
|
|
2453
|
+
if (P.length === 0 && !_)
|
|
2454
|
+
return sn(
|
|
2382
2455
|
p,
|
|
2383
2456
|
o,
|
|
2384
2457
|
u,
|
|
2385
2458
|
S
|
|
2386
2459
|
);
|
|
2387
|
-
let
|
|
2388
|
-
|
|
2460
|
+
let E;
|
|
2461
|
+
P.length > 0 ? E = await a.checkout.updateOrderFormItems({
|
|
2389
2462
|
id: p.orderFormId,
|
|
2390
|
-
orderItems:
|
|
2463
|
+
orderItems: P,
|
|
2391
2464
|
shouldSplitItem: u
|
|
2392
2465
|
}).then(
|
|
2393
|
-
(w) =>
|
|
2394
|
-
) :
|
|
2466
|
+
(w) => an(w, t, r)
|
|
2467
|
+
) : E = await an(
|
|
2395
2468
|
p,
|
|
2396
2469
|
t,
|
|
2397
2470
|
r
|
|
2398
|
-
),
|
|
2471
|
+
), E = await Promise.resolve(E).then((w) => {
|
|
2399
2472
|
if (t?.marketingData) {
|
|
2400
|
-
const
|
|
2473
|
+
const F = {
|
|
2401
2474
|
...w.marketingData,
|
|
2402
2475
|
...t.marketingData
|
|
2403
2476
|
};
|
|
2404
2477
|
return a.checkout.marketingData({
|
|
2405
2478
|
id: p.orderFormId,
|
|
2406
|
-
marketingData:
|
|
2479
|
+
marketingData: F
|
|
2407
2480
|
});
|
|
2408
2481
|
}
|
|
2409
2482
|
return w;
|
|
@@ -2413,50 +2486,50 @@ const Qe = (e) => {
|
|
|
2413
2486
|
...w.clientPreferencesData,
|
|
2414
2487
|
locale: c
|
|
2415
2488
|
}
|
|
2416
|
-
}) : w).then((w) =>
|
|
2417
|
-
const R =
|
|
2489
|
+
}) : w).then((w) => rn(w, a, I)).then(tn);
|
|
2490
|
+
const R = Re(
|
|
2418
2491
|
p.messages,
|
|
2419
|
-
|
|
2492
|
+
E.messages
|
|
2420
2493
|
);
|
|
2421
|
-
return
|
|
2422
|
-
|
|
2494
|
+
return Ci(n, E) && R ? sn(
|
|
2495
|
+
E,
|
|
2423
2496
|
o,
|
|
2424
2497
|
u,
|
|
2425
2498
|
S
|
|
2426
|
-
) :
|
|
2427
|
-
|
|
2499
|
+
) : Ee(
|
|
2500
|
+
E,
|
|
2428
2501
|
o,
|
|
2429
2502
|
u,
|
|
2430
2503
|
S
|
|
2431
2504
|
);
|
|
2432
|
-
},
|
|
2505
|
+
}, Ei = (e) => {
|
|
2433
2506
|
const n = (e?.corporateName ?? "").trim();
|
|
2434
2507
|
return n || (e?.firstName ?? "").trim();
|
|
2435
|
-
},
|
|
2508
|
+
}, ki = (e) => {
|
|
2436
2509
|
if (!e || typeof e != "object")
|
|
2437
2510
|
return !1;
|
|
2438
2511
|
const n = e;
|
|
2439
2512
|
return typeof n.customerId == "string" && n.customerId.trim() !== "" && typeof n.contractName == "string" && typeof n.isActive == "boolean" && typeof n.isCurrent == "boolean";
|
|
2440
|
-
},
|
|
2513
|
+
}, _i = (e) => {
|
|
2441
2514
|
const n = e?.availableContracts?.value;
|
|
2442
|
-
return Array.isArray(n) ? n.filter(
|
|
2443
|
-
},
|
|
2515
|
+
return Array.isArray(n) ? n.filter(ki) : [];
|
|
2516
|
+
}, Ti = (e) => e?.customerId ? !!((e.contractName ?? "").trim() && e.isActive) : !1, cn = (e) => e?.namespaces?.shopper?.activeContractId?.value?.trim() ?? e?.namespaces?.authentication?.customerId?.value?.trim() ?? e?.namespaces?.profile?.id?.value?.trim() ?? "", Ri = (e) => {
|
|
2444
2517
|
if (!Array.isArray(e) || e.length === 0) return "";
|
|
2445
2518
|
const n = e.find((t) => t?.isDefault === !0) ?? e[0];
|
|
2446
2519
|
return String(n?.id ?? "").trim();
|
|
2447
|
-
},
|
|
2520
|
+
}, Ui = (e, n = "", t = "") => {
|
|
2448
2521
|
const r = n.trim(), i = t.trim();
|
|
2449
|
-
return e.filter(
|
|
2522
|
+
return e.filter(Ti).map((a) => ({
|
|
2450
2523
|
id: a.customerId,
|
|
2451
2524
|
corporateName: a.contractName.trim(),
|
|
2452
2525
|
isActive: r ? a.customerId === r : a.isCurrent,
|
|
2453
2526
|
isDefault: i !== "" && a.customerId === i
|
|
2454
2527
|
}));
|
|
2455
|
-
},
|
|
2456
|
-
const t =
|
|
2528
|
+
}, Gn = (e, n) => {
|
|
2529
|
+
const t = Ei(e);
|
|
2457
2530
|
return t || (n?.firstName?.value ?? "").trim();
|
|
2458
2531
|
};
|
|
2459
|
-
async function
|
|
2532
|
+
async function Ni(e, n, t) {
|
|
2460
2533
|
try {
|
|
2461
2534
|
const r = await e.commerce.checkout.address({
|
|
2462
2535
|
postalCode: t,
|
|
@@ -2473,7 +2546,7 @@ async function Di(e, n, t) {
|
|
|
2473
2546
|
), r;
|
|
2474
2547
|
}
|
|
2475
2548
|
}
|
|
2476
|
-
function
|
|
2549
|
+
function Fi(e, n, t, r, i, a) {
|
|
2477
2550
|
const o = new URLSearchParams(e);
|
|
2478
2551
|
return o.has("facets") && o.delete("facets"), o.set("sc", o.get("sc") ?? n.salesChannel), t && o.set("postalCode", t), r && o.set("country", r), i && o.set(
|
|
2479
2552
|
"geoCoordinates",
|
|
@@ -2481,7 +2554,7 @@ function Pi(e, n, t, r, i, a) {
|
|
|
2481
2554
|
// long,lat is the format expected
|
|
2482
2555
|
), o.set("locale", a), o;
|
|
2483
2556
|
}
|
|
2484
|
-
function
|
|
2557
|
+
function Li(e, n) {
|
|
2485
2558
|
return {
|
|
2486
2559
|
utmCampaign: e.get("utm_campaign") ?? n?.utmCampaign ?? "",
|
|
2487
2560
|
utmMedium: e.get("utm_medium") ?? n?.utmMedium ?? "",
|
|
@@ -2491,7 +2564,7 @@ function ki(e, n) {
|
|
|
2491
2564
|
utmiPart: e.get("utmi_pc") ?? n?.utmiPart ?? ""
|
|
2492
2565
|
};
|
|
2493
2566
|
}
|
|
2494
|
-
async function
|
|
2567
|
+
async function Bi(e, n, t) {
|
|
2495
2568
|
const r = H($(n ?? "", t));
|
|
2496
2569
|
let i = !1;
|
|
2497
2570
|
if (r)
|
|
@@ -2506,7 +2579,7 @@ async function Ei(e, n, t) {
|
|
|
2506
2579
|
unitId: i ? r?.unitId : void 0
|
|
2507
2580
|
};
|
|
2508
2581
|
}
|
|
2509
|
-
async function
|
|
2582
|
+
async function $i(e, n, t, r, i, a) {
|
|
2510
2583
|
return !n.seller || !(t || r) ? void 0 : (await e.commerce.checkout.region({
|
|
2511
2584
|
postalCode: t,
|
|
2512
2585
|
geoCoordinates: r,
|
|
@@ -2514,13 +2587,13 @@ async function Ui(e, n, t, r, i, a) {
|
|
|
2514
2587
|
salesChannel: a
|
|
2515
2588
|
}))?.[0]?.sellers.find((c) => n.seller === c.id)?.id;
|
|
2516
2589
|
}
|
|
2517
|
-
function
|
|
2590
|
+
function ln(e) {
|
|
2518
2591
|
return typeof e?.value == "string" ? e.value : "";
|
|
2519
2592
|
}
|
|
2520
|
-
function
|
|
2593
|
+
function Mi(e) {
|
|
2521
2594
|
if (!e.isRepresentative)
|
|
2522
2595
|
return null;
|
|
2523
|
-
const n =
|
|
2596
|
+
const n = ln(e.shopper?.firstName), t = ln(e.shopper?.lastName);
|
|
2524
2597
|
return {
|
|
2525
2598
|
isRepresentative: !0,
|
|
2526
2599
|
customerId: e.authentication?.customerId?.value ?? e.customerId ?? "",
|
|
@@ -2531,11 +2604,11 @@ function _i(e) {
|
|
|
2531
2604
|
userName: `${n} ${t}`.trim(),
|
|
2532
2605
|
userEmail: e.authentication?.storeUserEmail?.value ?? "",
|
|
2533
2606
|
savedPostalCode: e.publicData?.postalCode?.value ?? "",
|
|
2534
|
-
contractName:
|
|
2607
|
+
contractName: Gn(e.contract, e.profile),
|
|
2535
2608
|
organizationManager: e.shopper?.organizationManager?.value ?? !1
|
|
2536
2609
|
};
|
|
2537
2610
|
}
|
|
2538
|
-
function
|
|
2611
|
+
function zi(e) {
|
|
2539
2612
|
return e?.id ? {
|
|
2540
2613
|
id: e.id?.value ?? "",
|
|
2541
2614
|
email: e.email?.value ?? "",
|
|
@@ -2543,14 +2616,14 @@ function Ri(e) {
|
|
|
2543
2616
|
familyName: e.lastName?.value ?? ""
|
|
2544
2617
|
} : null;
|
|
2545
2618
|
}
|
|
2546
|
-
const
|
|
2619
|
+
const Vi = (e) => e instanceof K && (e.extensions.status === 401 || e.extensions.status === 403), qi = (e) => e instanceof Error && /sales\s*channel/i.test(e.message), xi = (e, n, t, r) => {
|
|
2547
2620
|
if (n !== "orderForm" || t !== r)
|
|
2548
2621
|
return !1;
|
|
2549
|
-
if (
|
|
2622
|
+
if (qi(e))
|
|
2550
2623
|
return !0;
|
|
2551
2624
|
const i = `[validateSession] Session Manager rejected adopted sales channel ${t} with an unrecognized error; keeping the adoption.`, a = e instanceof Error ? e.message : e;
|
|
2552
|
-
return console.warn(i, a),
|
|
2553
|
-
},
|
|
2625
|
+
return console.warn(i, a), Ue("warn", "%s %o", i, a), !1;
|
|
2626
|
+
}, ji = async (e, n, t, r) => {
|
|
2554
2627
|
const i = { salesChannelSource: t, rejectedSalesChannel: void 0 };
|
|
2555
2628
|
try {
|
|
2556
2629
|
return {
|
|
@@ -2558,9 +2631,9 @@ const Ti = (e) => e instanceof J && (e.extensions.status === 401 || e.extensions
|
|
|
2558
2631
|
sessionData: await e.commerce.session(n.toString())
|
|
2559
2632
|
};
|
|
2560
2633
|
} catch (a) {
|
|
2561
|
-
if (t === "url" || !
|
|
2634
|
+
if (t === "url" || !Vi(a))
|
|
2562
2635
|
return { ...i, sessionData: null };
|
|
2563
|
-
const o = n.get("sc") ?? void 0, s =
|
|
2636
|
+
const o = n.get("sc") ?? void 0, s = xi(
|
|
2564
2637
|
a,
|
|
2565
2638
|
t,
|
|
2566
2639
|
o,
|
|
@@ -2574,12 +2647,12 @@ const Ti = (e) => e instanceof J && (e.extensions.status === 401 || e.extensions
|
|
|
2574
2647
|
rejectedSalesChannel: o
|
|
2575
2648
|
};
|
|
2576
2649
|
}
|
|
2577
|
-
},
|
|
2578
|
-
const c = ae.parse(n.channel ?? ""), d =
|
|
2579
|
-
localizationEnabled:
|
|
2650
|
+
}, Wi = async (e, { session: n, search: t }, { clients: r, headers: i, account: a, storage: o, discoveryConfig: s }) => {
|
|
2651
|
+
const c = ae.parse(n.channel ?? ""), d = Nn(n.channel, {
|
|
2652
|
+
localizationEnabled: Fn(s)
|
|
2580
2653
|
}), g = {
|
|
2581
2654
|
...c,
|
|
2582
|
-
salesChannel:
|
|
2655
|
+
salesChannel: ni(
|
|
2583
2656
|
c,
|
|
2584
2657
|
d,
|
|
2585
2658
|
o?.channel?.salesChannel ? String(o.channel.salesChannel) : void 0,
|
|
@@ -2588,62 +2661,62 @@ const Ti = (e) => e instanceof J && (e.extensions.status === 401 || e.extensions
|
|
|
2588
2661
|
}, p = String(n.postalCode ?? ""), f = n.country ?? "";
|
|
2589
2662
|
let h = n.city ?? null, I = n.geoCoordinates ?? null;
|
|
2590
2663
|
if ((!h || !I) && p !== "" && f !== "") {
|
|
2591
|
-
const se = await
|
|
2664
|
+
const se = await Ni(
|
|
2592
2665
|
r,
|
|
2593
2666
|
f,
|
|
2594
2667
|
p
|
|
2595
2668
|
);
|
|
2596
2669
|
h = se.city, I = se.geoCoordinates;
|
|
2597
2670
|
}
|
|
2598
|
-
const u =
|
|
2671
|
+
const u = Fi(
|
|
2599
2672
|
t,
|
|
2600
2673
|
g,
|
|
2601
2674
|
p,
|
|
2602
2675
|
f,
|
|
2603
2676
|
I,
|
|
2604
2677
|
n.locale
|
|
2605
|
-
), m =
|
|
2678
|
+
), m = Li(u, n.marketingData), { isRepresentative: S, customerId: v, unitId: b } = await Bi(
|
|
2606
2679
|
r,
|
|
2607
2680
|
i?.cookie,
|
|
2608
2681
|
a
|
|
2609
|
-
), { sessionData:
|
|
2682
|
+
), { sessionData: O, salesChannelSource: T, rejectedSalesChannel: A } = await ji(
|
|
2610
2683
|
r,
|
|
2611
2684
|
u,
|
|
2612
2685
|
d,
|
|
2613
2686
|
String(g.salesChannel ?? "")
|
|
2614
|
-
),
|
|
2687
|
+
), C = O?.namespaces.profile ?? null, D = O?.namespaces.shopper ?? null, P = O?.namespaces.store ?? null, _ = O?.namespaces.authentication ?? null, E = O?.namespaces.checkout ?? null, R = O?.namespaces.public ?? null;
|
|
2615
2688
|
let w = null;
|
|
2616
|
-
if (S &&
|
|
2689
|
+
if (S && C?.id?.value)
|
|
2617
2690
|
try {
|
|
2618
2691
|
w = await r.commerce.masterData.getContractById({
|
|
2619
|
-
contractId:
|
|
2692
|
+
contractId: C.id.value
|
|
2620
2693
|
});
|
|
2621
2694
|
} catch {
|
|
2622
2695
|
console.error(
|
|
2623
|
-
`Error while getting contract data for profile ID (${
|
|
2696
|
+
`Error while getting contract data for profile ID (${C.id.value}).
|
|
2624
2697
|
`
|
|
2625
2698
|
);
|
|
2626
2699
|
}
|
|
2627
|
-
const
|
|
2700
|
+
const F = await $i(
|
|
2628
2701
|
r,
|
|
2629
2702
|
g,
|
|
2630
2703
|
p,
|
|
2631
2704
|
I,
|
|
2632
2705
|
f,
|
|
2633
|
-
u.get("sc") ??
|
|
2634
|
-
),
|
|
2706
|
+
u.get("sc") ?? P?.channel?.value ?? g.salesChannel
|
|
2707
|
+
), J = zi(C), oe = (n.person?.id ?? null) === (J?.id ?? null) ? Ln(n.channel) : void 0, B = {
|
|
2635
2708
|
...n,
|
|
2636
2709
|
currency: {
|
|
2637
|
-
code:
|
|
2638
|
-
symbol:
|
|
2710
|
+
code: P?.currencyCode?.value ?? n.currency.code,
|
|
2711
|
+
symbol: P?.currencySymbol?.value ?? n.currency.symbol
|
|
2639
2712
|
},
|
|
2640
|
-
country:
|
|
2641
|
-
channel:
|
|
2713
|
+
country: P?.countryCode?.value ?? f,
|
|
2714
|
+
channel: ei(
|
|
2642
2715
|
g,
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2716
|
+
P?.channel?.value,
|
|
2717
|
+
E?.regionId?.value,
|
|
2718
|
+
F,
|
|
2719
|
+
T,
|
|
2647
2720
|
A ?? oe
|
|
2648
2721
|
),
|
|
2649
2722
|
/**
|
|
@@ -2652,53 +2725,53 @@ const Ti = (e) => e instanceof J && (e.extensions.status === 401 || e.extensions
|
|
|
2652
2725
|
* - Unit data: `authentication` namespace
|
|
2653
2726
|
* - Contract data: `profile` namespace (those info will be available inside Faststore's Session `person` object)
|
|
2654
2727
|
*/
|
|
2655
|
-
b2b:
|
|
2728
|
+
b2b: Mi({
|
|
2656
2729
|
isRepresentative: S,
|
|
2657
|
-
authentication:
|
|
2658
|
-
shopper:
|
|
2730
|
+
authentication: _,
|
|
2731
|
+
shopper: D,
|
|
2659
2732
|
publicData: R,
|
|
2660
|
-
profile:
|
|
2733
|
+
profile: C,
|
|
2661
2734
|
contract: w,
|
|
2662
2735
|
customerId: v,
|
|
2663
2736
|
unitId: b
|
|
2664
2737
|
}),
|
|
2665
2738
|
marketingData: m,
|
|
2666
|
-
person:
|
|
2739
|
+
person: J,
|
|
2667
2740
|
geoCoordinates: I?.latitude && I?.longitude && I || null,
|
|
2668
2741
|
city: h
|
|
2669
2742
|
};
|
|
2670
|
-
return
|
|
2671
|
-
},
|
|
2672
|
-
validateCart:
|
|
2673
|
-
validateSession:
|
|
2674
|
-
subscribeToNewsletter:
|
|
2675
|
-
cancelOrder:
|
|
2676
|
-
processOrderAuthorization:
|
|
2677
|
-
uploadFileToOrderEntry:
|
|
2678
|
-
startOrderEntryOperation:
|
|
2679
|
-
startRecommendationSession:
|
|
2743
|
+
return Re(n, B) ? null : B;
|
|
2744
|
+
}, Hi = {
|
|
2745
|
+
validateCart: Di,
|
|
2746
|
+
validateSession: Wi,
|
|
2747
|
+
subscribeToNewsletter: Kr,
|
|
2748
|
+
cancelOrder: xr,
|
|
2749
|
+
processOrderAuthorization: Wr,
|
|
2750
|
+
uploadFileToOrderEntry: Jr,
|
|
2751
|
+
startOrderEntryOperation: Hr,
|
|
2752
|
+
startRecommendationSession: Gr
|
|
2680
2753
|
};
|
|
2681
2754
|
var ke;
|
|
2682
2755
|
(function(e) {
|
|
2683
2756
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
2684
2757
|
})(ke || (ke = {}));
|
|
2685
|
-
const
|
|
2686
|
-
function
|
|
2758
|
+
const Gi = (e) => typeof e == "string" ? Xn(e) : null;
|
|
2759
|
+
function Xn(e) {
|
|
2687
2760
|
try {
|
|
2688
2761
|
return JSON.parse(e);
|
|
2689
2762
|
} catch {
|
|
2690
2763
|
return e;
|
|
2691
2764
|
}
|
|
2692
2765
|
}
|
|
2693
|
-
const
|
|
2766
|
+
const Xi = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string" ? e : null, Yi = new rt({
|
|
2694
2767
|
name: "ObjectOrString",
|
|
2695
2768
|
description: "A string or the string representation of an object (a stringified object).",
|
|
2696
|
-
parseValue:
|
|
2697
|
-
serialize:
|
|
2769
|
+
parseValue: Gi,
|
|
2770
|
+
serialize: Xi,
|
|
2698
2771
|
parseLiteral(e) {
|
|
2699
|
-
return e.kind === ke.STRING ?
|
|
2772
|
+
return e.kind === ke.STRING ? Xn(e.value) : null;
|
|
2700
2773
|
}
|
|
2701
|
-
}),
|
|
2774
|
+
}), U = (e) => "Price" in e && "seller" in e && "product" in e, N = (e) => "skuName" in e, Ki = {
|
|
2702
2775
|
priceCurrency: async (e, n, t) => {
|
|
2703
2776
|
const {
|
|
2704
2777
|
loaders: { salesChannelLoader: r },
|
|
@@ -2706,36 +2779,36 @@ const zi = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2706
2779
|
} = t;
|
|
2707
2780
|
return (await r.load(i.salesChannel)).CurrencyCode ?? "";
|
|
2708
2781
|
},
|
|
2709
|
-
priceValidUntil: (e) =>
|
|
2782
|
+
priceValidUntil: (e) => U(e) ? e.PriceValidUntil ?? "" : N(e) ? e.priceValidUntil ?? "" : null,
|
|
2710
2783
|
itemCondition: () => "https://schema.org/NewCondition",
|
|
2711
|
-
availability: async (e) =>
|
|
2712
|
-
seller: (e, n, t) =>
|
|
2784
|
+
availability: async (e) => U(e) ? We(M(e)) : N(e) ? We(Er(e.availability)) : null,
|
|
2785
|
+
seller: (e, n, t) => U(e) ? {
|
|
2713
2786
|
identifier: t.storage.channel?.seller || e.seller.sellerId || ""
|
|
2714
|
-
} :
|
|
2787
|
+
} : N(e) ? {
|
|
2715
2788
|
identifier: e.seller
|
|
2716
2789
|
} : null,
|
|
2717
|
-
price: (e) =>
|
|
2718
|
-
priceWithTaxes: (e) =>
|
|
2790
|
+
price: (e) => U(e) ? Y(e) : N(e) ? e.sellingPrice / 100 : null,
|
|
2791
|
+
priceWithTaxes: (e) => U(e) ? G(Y(e), e?.Tax, e.product.unitMultiplier) : N(e) ? G(
|
|
2719
2792
|
e.sellingPrice / 100,
|
|
2720
2793
|
e.tax / 100,
|
|
2721
2794
|
e.unitMultiplier
|
|
2722
2795
|
) : null,
|
|
2723
|
-
sellingPrice: (e) =>
|
|
2724
|
-
listPrice: (e) =>
|
|
2725
|
-
listPriceWithTaxes: (e) =>
|
|
2796
|
+
sellingPrice: (e) => U(e) ? Dr(e) : N(e) ? e.sellingPrice / 100 : null,
|
|
2797
|
+
listPrice: (e) => U(e) ? e.ListPrice ?? 0 : N(e) ? e.listPrice / 100 : null,
|
|
2798
|
+
listPriceWithTaxes: (e) => U(e) ? G(
|
|
2726
2799
|
e.ListPrice ?? 0,
|
|
2727
2800
|
e?.Tax,
|
|
2728
2801
|
e.product.unitMultiplier
|
|
2729
|
-
) :
|
|
2730
|
-
itemOffered: (e) =>
|
|
2802
|
+
) : N(e) ? G(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
|
|
2803
|
+
itemOffered: (e) => U(e) ? e.product : N(e) ? {
|
|
2731
2804
|
...e.product,
|
|
2732
2805
|
attachmentsValues: e.attachments,
|
|
2733
2806
|
servicesValues: e.bundleItems ?? []
|
|
2734
2807
|
} : null,
|
|
2735
|
-
quantity: (e) =>
|
|
2736
|
-
isGift: (e) =>
|
|
2737
|
-
priceToken: (e) =>
|
|
2738
|
-
},
|
|
2808
|
+
quantity: (e) => U(e) ? e.AvailableQuantity ?? 0 : N(e) ? e.quantity : null,
|
|
2809
|
+
isGift: (e) => N(e) ? e.isGift ?? !1 : null,
|
|
2810
|
+
priceToken: (e) => U(e) ? e.PriceToken ?? null : null
|
|
2811
|
+
}, Ji = ({ linkText: e }) => `/${e}/p`, Qi = ({
|
|
2739
2812
|
offer: e,
|
|
2740
2813
|
seller: n,
|
|
2741
2814
|
product: t
|
|
@@ -2743,15 +2816,15 @@ const zi = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
|
|
|
2743
2816
|
...e,
|
|
2744
2817
|
product: t,
|
|
2745
2818
|
seller: n
|
|
2746
|
-
}),
|
|
2819
|
+
}), Zi = {
|
|
2747
2820
|
imageText: "image",
|
|
2748
2821
|
imageUrl: "https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg",
|
|
2749
2822
|
imageLabel: "label"
|
|
2750
|
-
},
|
|
2751
|
-
function
|
|
2823
|
+
}, pe = (e, n) => `${e}-${n}`, dn = (e, n) => `/${pe(e, n)}/p`, ea = (e) => Array.isArray(e) && e.length > 0 ? e : null;
|
|
2824
|
+
function _e(e) {
|
|
2752
2825
|
return e.replace(/^\/+|\/+$/g, "");
|
|
2753
2826
|
}
|
|
2754
|
-
async function
|
|
2827
|
+
async function ge(e, n, t) {
|
|
2755
2828
|
const r = `${n}:${t}`;
|
|
2756
2829
|
e.storage.productTranslationsCache ??= /* @__PURE__ */ new Map();
|
|
2757
2830
|
const i = e.storage.productTranslationsCache, a = i.get(r);
|
|
@@ -2776,18 +2849,18 @@ async function pe(e, n, t) {
|
|
|
2776
2849
|
})();
|
|
2777
2850
|
return i.set(r, o), o;
|
|
2778
2851
|
}
|
|
2779
|
-
const
|
|
2780
|
-
const t = e.findIndex((r) =>
|
|
2852
|
+
const na = (e, n) => {
|
|
2853
|
+
const t = e.findIndex((r) => _e(r).split("/").at(-1) === n);
|
|
2781
2854
|
return t < 0 ? 0 : t;
|
|
2782
|
-
},
|
|
2855
|
+
}, ta = {
|
|
2783
2856
|
productID: ({ itemId: e }) => e,
|
|
2784
2857
|
name: ({ isVariantOf: e, name: n }) => n ?? e.productName,
|
|
2785
|
-
slug: ({ isVariantOf: { linkText: e }, itemId: n }) =>
|
|
2858
|
+
slug: ({ isVariantOf: { linkText: e }, itemId: n }) => pe(e, n),
|
|
2786
2859
|
description: ({ isVariantOf: { description: e } }) => e,
|
|
2787
2860
|
seo: ({ isVariantOf: e }) => ({
|
|
2788
2861
|
title: e.productTitle || e.productName,
|
|
2789
2862
|
description: e.metaTagDescription || e.description,
|
|
2790
|
-
canonical:
|
|
2863
|
+
canonical: Ji(e)
|
|
2791
2864
|
}),
|
|
2792
2865
|
brand: ({ isVariantOf: { brand: e } }) => ({ name: e }),
|
|
2793
2866
|
unitMultiplier: ({ unitMultiplier: e }) => e,
|
|
@@ -2802,12 +2875,12 @@ const Gi = (e, n) => {
|
|
|
2802
2875
|
productId: c
|
|
2803
2876
|
},
|
|
2804
2877
|
itemId: d
|
|
2805
|
-
} = e, g =
|
|
2878
|
+
} = e, g = na(s, o), p = r[g], f = _e(p).split("/"), h = t.storage.locale;
|
|
2806
2879
|
if (X(t) && h) {
|
|
2807
|
-
const I = await
|
|
2880
|
+
const I = await ge(t, c, h);
|
|
2808
2881
|
if (I) {
|
|
2809
2882
|
const l = new Set(
|
|
2810
|
-
|
|
2883
|
+
_e(s[g]).split("/").filter(Boolean)
|
|
2811
2884
|
), u = I.categories.filter((S) => l.has(S.id.toString())).sort(
|
|
2812
2885
|
(S, v) => S.fullPath.split("/").length - v.fullPath.split("/").length
|
|
2813
2886
|
);
|
|
@@ -2823,7 +2896,7 @@ const Gi = (e, n) => {
|
|
|
2823
2896
|
})),
|
|
2824
2897
|
{
|
|
2825
2898
|
name: i,
|
|
2826
|
-
item:
|
|
2899
|
+
item: dn(I.linkId, d),
|
|
2827
2900
|
position: f.length + 1
|
|
2828
2901
|
}
|
|
2829
2902
|
],
|
|
@@ -2834,7 +2907,7 @@ const Gi = (e, n) => {
|
|
|
2834
2907
|
return {
|
|
2835
2908
|
itemListElement: [
|
|
2836
2909
|
...f.map((I, l) => {
|
|
2837
|
-
const u = `/${f.slice(0, l + 1).map(
|
|
2910
|
+
const u = `/${f.slice(0, l + 1).map(me).join("/")}/`;
|
|
2838
2911
|
return {
|
|
2839
2912
|
name: I,
|
|
2840
2913
|
item: u,
|
|
@@ -2843,7 +2916,7 @@ const Gi = (e, n) => {
|
|
|
2843
2916
|
}),
|
|
2844
2917
|
{
|
|
2845
2918
|
name: i,
|
|
2846
|
-
item:
|
|
2919
|
+
item: dn(a, d),
|
|
2847
2920
|
position: f.length + 1
|
|
2848
2921
|
}
|
|
2849
2922
|
],
|
|
@@ -2851,7 +2924,7 @@ const Gi = (e, n) => {
|
|
|
2851
2924
|
};
|
|
2852
2925
|
},
|
|
2853
2926
|
image: ({ images: e }, n) => {
|
|
2854
|
-
const t = (
|
|
2927
|
+
const t = (ea(e) ?? [Zi]).map(
|
|
2855
2928
|
({ imageUrl: s, imageText: c, imageLabel: d }) => ({
|
|
2856
2929
|
alternateName: c ?? "",
|
|
2857
2930
|
url: s.replace("vteximg.com.br", "vtexassets.com"),
|
|
@@ -2874,12 +2947,12 @@ const Gi = (e, n) => {
|
|
|
2874
2947
|
review: () => [],
|
|
2875
2948
|
aggregateRating: () => ({}),
|
|
2876
2949
|
offers: (e) => e.sellers.map(
|
|
2877
|
-
(n) =>
|
|
2950
|
+
(n) => Qi({
|
|
2878
2951
|
offer: n.commertialOffer,
|
|
2879
2952
|
seller: n,
|
|
2880
2953
|
product: e
|
|
2881
2954
|
})
|
|
2882
|
-
).sort(
|
|
2955
|
+
).sort(kn),
|
|
2883
2956
|
isVariantOf: (e) => e,
|
|
2884
2957
|
additionalProperty: ({
|
|
2885
2958
|
// Search uses the name variations for specifications
|
|
@@ -2895,8 +2968,8 @@ const Gi = (e, n) => {
|
|
|
2895
2968
|
valueReference: V.specification
|
|
2896
2969
|
}))
|
|
2897
2970
|
), a = n.map(
|
|
2898
|
-
|
|
2899
|
-
), o = t.map(
|
|
2971
|
+
Bn
|
|
2972
|
+
), o = t.map(ti), s = r.map(Fe);
|
|
2900
2973
|
return [
|
|
2901
2974
|
...i,
|
|
2902
2975
|
...a,
|
|
@@ -2915,35 +2988,35 @@ const Gi = (e, n) => {
|
|
|
2915
2988
|
deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: e } }) => e,
|
|
2916
2989
|
otherLocales: async (e, n, t) => {
|
|
2917
2990
|
if (!X(t)) return null;
|
|
2918
|
-
const r =
|
|
2991
|
+
const r = jt(t);
|
|
2919
2992
|
if (r.length === 0) return null;
|
|
2920
|
-
const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await
|
|
2993
|
+
const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await ge(t, i, o);
|
|
2921
2994
|
if (!s?.availableLinkIds) return null;
|
|
2922
2995
|
const { availableLinkIds: c } = s;
|
|
2923
2996
|
return r.map((d) => {
|
|
2924
2997
|
const g = c[d];
|
|
2925
|
-
return g ? { locale: d, slug:
|
|
2998
|
+
return g ? { locale: d, slug: pe(g, a) } : null;
|
|
2926
2999
|
}).filter((d) => d !== null);
|
|
2927
3000
|
},
|
|
2928
3001
|
defaultLocaleSlug: async (e, n, t) => {
|
|
2929
3002
|
if (!X(t)) return null;
|
|
2930
|
-
const r =
|
|
3003
|
+
const r = Wt(t);
|
|
2931
3004
|
if (!r) return null;
|
|
2932
|
-
const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await
|
|
3005
|
+
const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await ge(
|
|
2933
3006
|
t,
|
|
2934
3007
|
i,
|
|
2935
3008
|
t.storage.locale
|
|
2936
3009
|
))?.availableLinkIds?.[r] ?? a;
|
|
2937
|
-
return
|
|
3010
|
+
return pe(c, o);
|
|
2938
3011
|
}
|
|
2939
|
-
},
|
|
3012
|
+
}, ra = /* @__PURE__ */ new Set(["allSpecifications"]), ia = {
|
|
2940
3013
|
hasVariant: (e) => e.isVariantOf.items.map((n) => L(n, e.isVariantOf)),
|
|
2941
3014
|
productGroupID: ({ isVariantOf: e }) => e.productId,
|
|
2942
3015
|
productClusters: ({ isVariantOf: e }) => e.productClusters ?? [],
|
|
2943
3016
|
name: (e) => e.isVariantOf.productName,
|
|
2944
3017
|
skuVariants: (e) => e,
|
|
2945
3018
|
additionalProperty: ({ isVariantOf: { specificationGroups: e } }) => e.filter(
|
|
2946
|
-
(n) => !
|
|
3019
|
+
(n) => !ra.has(n.name)
|
|
2947
3020
|
).flatMap(
|
|
2948
3021
|
({ specifications: n }) => n.flatMap(
|
|
2949
3022
|
({ name: t, values: r }) => r.map((i) => ({
|
|
@@ -2953,33 +3026,33 @@ const Gi = (e, n) => {
|
|
|
2953
3026
|
}))
|
|
2954
3027
|
)
|
|
2955
3028
|
)
|
|
2956
|
-
},
|
|
2957
|
-
propertyID: (e) => e.propertyID ||
|
|
3029
|
+
}, aa = {
|
|
3030
|
+
propertyID: (e) => e.propertyID || $n(e),
|
|
2958
3031
|
name: ({ name: e }) => e,
|
|
2959
3032
|
value: ({ value: e }) => e,
|
|
2960
3033
|
valueReference: ({ valueReference: e }) => e
|
|
2961
|
-
},
|
|
3034
|
+
}, fe = (e) => {
|
|
2962
3035
|
const n = e.flatMap(
|
|
2963
3036
|
(r) => r.sellers.map((i) => ({
|
|
2964
3037
|
offer: i.commertialOffer,
|
|
2965
3038
|
sku: r
|
|
2966
3039
|
}))
|
|
2967
|
-
), t =
|
|
3040
|
+
), t = Ae(
|
|
2968
3041
|
n,
|
|
2969
|
-
({ offer: r }, { offer: i }) =>
|
|
3042
|
+
({ offer: r }, { offer: i }) => kn(r, i)
|
|
2970
3043
|
);
|
|
2971
3044
|
return t ? t.sku : e[0];
|
|
2972
|
-
},
|
|
3045
|
+
}, Yn = (e) => e !== "" && !Number.isNaN(Number(e)), oa = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, sa = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
|
|
2973
3046
|
const {
|
|
2974
3047
|
clients: { commerce: a }
|
|
2975
3048
|
} = i, { salesChannel: o } = i.storage.channel, s = n?.trim();
|
|
2976
|
-
if (!s || !
|
|
2977
|
-
throw new
|
|
3049
|
+
if (!s || !oa.test(s))
|
|
3050
|
+
throw new k(`Invalid campaignVrn: "${n}"`);
|
|
2978
3051
|
const c = t?.trim();
|
|
2979
3052
|
if (t != null && !c)
|
|
2980
|
-
throw new
|
|
3053
|
+
throw new k("Invalid userId: must be a non-empty string");
|
|
2981
3054
|
if (r != null && (!Array.isArray(r) || r.some((h) => !h?.trim())))
|
|
2982
|
-
throw new
|
|
3055
|
+
throw new k(
|
|
2983
3056
|
"Invalid products: must be an array of non-empty strings"
|
|
2984
3057
|
);
|
|
2985
3058
|
const d = await a.recommendation.recommendations({
|
|
@@ -2991,13 +3064,13 @@ const Gi = (e, n) => {
|
|
|
2991
3064
|
}), { campaign: g, correlationId: p } = d;
|
|
2992
3065
|
return {
|
|
2993
3066
|
products: (d.products ?? []).map((h) => {
|
|
2994
|
-
const I =
|
|
3067
|
+
const I = fe(h.items);
|
|
2995
3068
|
return I ? L(I, h) : null;
|
|
2996
3069
|
}).filter((h) => !!h),
|
|
2997
3070
|
correlationId: p,
|
|
2998
3071
|
campaign: g
|
|
2999
3072
|
};
|
|
3000
|
-
},
|
|
3073
|
+
}, un = {
|
|
3001
3074
|
price_desc: "price:desc",
|
|
3002
3075
|
price_asc: "price:asc",
|
|
3003
3076
|
orders_desc: "orders:desc",
|
|
@@ -3007,19 +3080,19 @@ const Gi = (e, n) => {
|
|
|
3007
3080
|
discount_desc: "discount:desc",
|
|
3008
3081
|
score_desc: ""
|
|
3009
3082
|
};
|
|
3010
|
-
function
|
|
3083
|
+
function ca(e, n) {
|
|
3011
3084
|
let t;
|
|
3012
|
-
if (Object.hasOwn(n, e) ? t = n[e] : Object.hasOwn(
|
|
3013
|
-
throw new
|
|
3085
|
+
if (Object.hasOwn(n, e) ? t = n[e] : Object.hasOwn(un, e) && (t = un[e]), t === void 0)
|
|
3086
|
+
throw new k(`Unknown sort value: ${e}`);
|
|
3014
3087
|
return t;
|
|
3015
3088
|
}
|
|
3016
|
-
const
|
|
3089
|
+
const la = async (e, { operationId: n }, { clients: { commerce: t } }) => {
|
|
3017
3090
|
if (!n)
|
|
3018
|
-
throw new
|
|
3091
|
+
throw new k("Missing operationId");
|
|
3019
3092
|
return t.orderEntry.getOperation({ operationId: n });
|
|
3020
|
-
},
|
|
3093
|
+
}, da = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
|
|
3021
3094
|
if (!n)
|
|
3022
|
-
throw new
|
|
3095
|
+
throw new k("Missing orderFormId");
|
|
3023
3096
|
const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: n });
|
|
3024
3097
|
return (r ?? []).map((i) => ({
|
|
3025
3098
|
id: i.id,
|
|
@@ -3033,19 +3106,19 @@ const na = async (e, { operationId: n }, { clients: { commerce: t } }) => {
|
|
|
3033
3106
|
unitMultiplier: i.unitMultiplier ?? 1
|
|
3034
3107
|
}));
|
|
3035
3108
|
};
|
|
3036
|
-
async function
|
|
3109
|
+
async function ua(e, n, t, r) {
|
|
3037
3110
|
const i = n.slice(0, n.lastIndexOf("-"));
|
|
3038
|
-
return (await
|
|
3111
|
+
return (await ge(e, t, r))?.linkId === i;
|
|
3039
3112
|
}
|
|
3040
|
-
const
|
|
3041
|
-
async function
|
|
3113
|
+
const Kn = "Invalid SkuId", Jn = "Slug was set but the fetched sku does not satisfy the slug condition.", pa = "UseAdHocCard", ga = (e) => ee(e) || e instanceof Error && (e.message === Kn || e.message.startsWith(Jn));
|
|
3114
|
+
async function ma(e, n, t, r) {
|
|
3042
3115
|
const { linkText: i, productId: a } = n.isVariantOf;
|
|
3043
|
-
if (!(!t || !i || t.startsWith(i) || X(e) && r &&
|
|
3044
|
-
throw new Error(`${
|
|
3116
|
+
if (!(!t || !i || t.startsWith(i) || X(e) && r && Yn(t.split("-").pop() ?? "") && await ua(e, t, a, r)))
|
|
3117
|
+
throw new Error(`${Jn} slug: ${t}, linkText: ${i}`);
|
|
3045
3118
|
}
|
|
3046
|
-
async function
|
|
3119
|
+
async function ha(e, n) {
|
|
3047
3120
|
if (n == null)
|
|
3048
|
-
throw new
|
|
3121
|
+
throw new k("Missing slug or id");
|
|
3049
3122
|
const {
|
|
3050
3123
|
clients: { commerce: t, search: r }
|
|
3051
3124
|
} = e, i = await t.catalog.portal.pagetype(`${n}/p`);
|
|
@@ -3057,25 +3130,25 @@ async function sa(e, n) {
|
|
|
3057
3130
|
}).catch(() => null);
|
|
3058
3131
|
if (!a)
|
|
3059
3132
|
throw new z(`No product found for id ${i.id}`);
|
|
3060
|
-
return L(
|
|
3133
|
+
return L(fe(a.items), a);
|
|
3061
3134
|
}
|
|
3062
|
-
const
|
|
3135
|
+
const fa = {
|
|
3063
3136
|
product: async (e, { locator: n }, t) => {
|
|
3064
|
-
const r =
|
|
3065
|
-
r && ne(t, r), i &&
|
|
3137
|
+
const r = Je(n), i = Ke(n), a = $r(n), o = Br(n);
|
|
3138
|
+
r && ne(t, r), i && Pe(t, i);
|
|
3066
3139
|
const {
|
|
3067
3140
|
loaders: { skuLoader: s }
|
|
3068
3141
|
} = t;
|
|
3069
3142
|
try {
|
|
3070
3143
|
const c = a ?? o?.split("-").pop() ?? "";
|
|
3071
|
-
if (!
|
|
3072
|
-
throw new Error(
|
|
3144
|
+
if (!Yn(c))
|
|
3145
|
+
throw new Error(Kn);
|
|
3073
3146
|
const d = await s.load(c);
|
|
3074
|
-
return await
|
|
3147
|
+
return await ma(t, d, o, i), d;
|
|
3075
3148
|
} catch (c) {
|
|
3076
|
-
if (!
|
|
3149
|
+
if (!ga(c))
|
|
3077
3150
|
throw c;
|
|
3078
|
-
return
|
|
3151
|
+
return ha(t, o);
|
|
3079
3152
|
}
|
|
3080
3153
|
},
|
|
3081
3154
|
collection: (e, { slug: n }, t) => {
|
|
@@ -3084,7 +3157,7 @@ const ca = {
|
|
|
3084
3157
|
} = t;
|
|
3085
3158
|
return r.load({
|
|
3086
3159
|
slug: n,
|
|
3087
|
-
locale:
|
|
3160
|
+
locale: wn(t)
|
|
3088
3161
|
});
|
|
3089
3162
|
},
|
|
3090
3163
|
search: async (e, {
|
|
@@ -3095,19 +3168,19 @@ const ca = {
|
|
|
3095
3168
|
selectedFacets: a,
|
|
3096
3169
|
sponsoredCount: o
|
|
3097
3170
|
}, s) => {
|
|
3098
|
-
const c =
|
|
3099
|
-
c && ne(s, c), d &&
|
|
3171
|
+
const c = Je(a), d = Ke(a), g = Lr(a);
|
|
3172
|
+
c && ne(s, c), d && Pe(s, d);
|
|
3100
3173
|
const p = t ? Number(t) : 0, f = {
|
|
3101
3174
|
page: Math.ceil(p / n) || 0,
|
|
3102
3175
|
count: n,
|
|
3103
3176
|
query: i ?? void 0,
|
|
3104
|
-
sort:
|
|
3105
|
-
selectedFacets: a?.flatMap(
|
|
3177
|
+
sort: ca(r ?? "score_desc", s.storage.customSortMap),
|
|
3178
|
+
selectedFacets: a?.flatMap(Xe) ?? [],
|
|
3106
3179
|
sponsoredCount: o ?? void 0
|
|
3107
3180
|
};
|
|
3108
3181
|
if (g) {
|
|
3109
3182
|
const l = (await s.clients.commerce.catalog.products.crossselling({
|
|
3110
|
-
type:
|
|
3183
|
+
type: Tn[g.key],
|
|
3111
3184
|
productId: g.value
|
|
3112
3185
|
})).map((m) => m.productId).slice(0, n), u = s.clients.search.productsByIdentifier({ field: "id", values: l }).then((m) => ({
|
|
3113
3186
|
products: m,
|
|
@@ -3185,7 +3258,7 @@ const ca = {
|
|
|
3185
3258
|
id: h.id,
|
|
3186
3259
|
name: h.name,
|
|
3187
3260
|
fatherCategoryId: I,
|
|
3188
|
-
linkId:
|
|
3261
|
+
linkId: me(h.name),
|
|
3189
3262
|
title: h.Title,
|
|
3190
3263
|
description: null,
|
|
3191
3264
|
metaTagDescription: h.MetaTagDescription,
|
|
@@ -3201,13 +3274,13 @@ const ca = {
|
|
|
3201
3274
|
const f = [...o.filter((h) => h.isActive).map((h) => ({
|
|
3202
3275
|
id: h.id,
|
|
3203
3276
|
name: h.name,
|
|
3204
|
-
linkId:
|
|
3277
|
+
linkId: me(h.name),
|
|
3205
3278
|
title: h.title,
|
|
3206
3279
|
description: null,
|
|
3207
3280
|
metaTagDescription: h.metaTagDescription,
|
|
3208
3281
|
availableLinkIds: null,
|
|
3209
3282
|
entityType: "brand"
|
|
3210
|
-
})), ...c].filter((h) => !!
|
|
3283
|
+
})), ...c].filter((h) => !!_n.slug(h, null, r, null));
|
|
3211
3284
|
return {
|
|
3212
3285
|
pageInfo: {
|
|
3213
3286
|
hasNextPage: f.length - a > n,
|
|
@@ -3242,7 +3315,7 @@ const ca = {
|
|
|
3242
3315
|
page: 1,
|
|
3243
3316
|
count: 1,
|
|
3244
3317
|
query: n ?? void 0,
|
|
3245
|
-
selectedFacets: t?.flatMap(
|
|
3318
|
+
selectedFacets: t?.flatMap(Xe) ?? [],
|
|
3246
3319
|
allowRedirect: !0
|
|
3247
3320
|
});
|
|
3248
3321
|
return {
|
|
@@ -3285,7 +3358,7 @@ const ca = {
|
|
|
3285
3358
|
userOrder: async (e, { orderId: n }, t) => {
|
|
3286
3359
|
try {
|
|
3287
3360
|
if (!n)
|
|
3288
|
-
throw new
|
|
3361
|
+
throw new k("Missing orderId");
|
|
3289
3362
|
const {
|
|
3290
3363
|
clients: { commerce: r }
|
|
3291
3364
|
} = t, i = await r.oms.userOrder({ orderId: n });
|
|
@@ -3294,7 +3367,7 @@ const ca = {
|
|
|
3294
3367
|
let a = null;
|
|
3295
3368
|
try {
|
|
3296
3369
|
const c = await r.oms.getCommercialAuthorizationsByOrderId({ orderId: n });
|
|
3297
|
-
a =
|
|
3370
|
+
a = Rn(c);
|
|
3298
3371
|
} catch {
|
|
3299
3372
|
}
|
|
3300
3373
|
const s = (await r.masterData.getShopperById({
|
|
@@ -3333,7 +3406,7 @@ const ca = {
|
|
|
3333
3406
|
a = { message: i };
|
|
3334
3407
|
}
|
|
3335
3408
|
const o = a?.message || i;
|
|
3336
|
-
throw ee(r) ? new z(`No order found for id ${n}. ${o}.`) :
|
|
3409
|
+
throw ee(r) ? new z(`No order found for id ${n}. ${o}.`) : Dt(r) ? new te(
|
|
3337
3410
|
`You are forbidden to interact with order with id ${n}. ${o}.`
|
|
3338
3411
|
) : r;
|
|
3339
3412
|
}
|
|
@@ -3384,7 +3457,7 @@ const ca = {
|
|
|
3384
3457
|
} = t, s = H($(i?.cookie ?? "", r))?.userId ?? "";
|
|
3385
3458
|
if (!s)
|
|
3386
3459
|
return !0;
|
|
3387
|
-
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey:
|
|
3460
|
+
const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey: pa }).catch(() => null);
|
|
3388
3461
|
return typeof c == "boolean" ? c : !0;
|
|
3389
3462
|
},
|
|
3390
3463
|
listUserQuotes: async (e, n, t) => {
|
|
@@ -3466,7 +3539,7 @@ const ca = {
|
|
|
3466
3539
|
const c = await a.session("").catch(() => null);
|
|
3467
3540
|
if (!c)
|
|
3468
3541
|
return null;
|
|
3469
|
-
const d = c.namespaces.profile ?? null, g = c.namespaces.shopper ?? null, p = c.namespaces.authentication ?? null, f =
|
|
3542
|
+
const d = c.namespaces.profile ?? null, g = c.namespaces.shopper ?? null, p = c.namespaces.authentication ?? null, f = cn(c) || o?.customerId?.trim() || "";
|
|
3470
3543
|
let h = null;
|
|
3471
3544
|
if (f)
|
|
3472
3545
|
try {
|
|
@@ -3479,7 +3552,7 @@ const ca = {
|
|
|
3479
3552
|
}
|
|
3480
3553
|
const I = `${(g?.firstName?.value ?? "").trim()} ${(g?.lastName?.value ?? "").trim()}`.trim();
|
|
3481
3554
|
return {
|
|
3482
|
-
name:
|
|
3555
|
+
name: Gn(h, d) || I || "",
|
|
3483
3556
|
email: d?.email?.value || p?.storeUserEmail?.value || "",
|
|
3484
3557
|
id: d?.id?.value || p?.customerId?.value || o?.customerId?.trim() || ""
|
|
3485
3558
|
// createdAt: '',
|
|
@@ -3499,7 +3572,7 @@ const ca = {
|
|
|
3499
3572
|
// Contract list from VTEX session `shopper.availableContracts`.
|
|
3500
3573
|
availableContracts: async (e, { orgUnitId: n }, t) => {
|
|
3501
3574
|
if (!n)
|
|
3502
|
-
throw new
|
|
3575
|
+
throw new k("Missing orgUnitId");
|
|
3503
3576
|
const {
|
|
3504
3577
|
account: r,
|
|
3505
3578
|
headers: i,
|
|
@@ -3516,13 +3589,13 @@ const ca = {
|
|
|
3516
3589
|
throw new te(
|
|
3517
3590
|
"You are not allowed to list contracts for this organization unit"
|
|
3518
3591
|
);
|
|
3519
|
-
const g =
|
|
3592
|
+
const g = _i(
|
|
3520
3593
|
o?.namespaces.shopper
|
|
3521
|
-
), p =
|
|
3594
|
+
), p = cn(o) || c?.customerId?.trim() || "", f = await a.storeFront.attachedContracts(n).catch((I) => (console.warn(
|
|
3522
3595
|
"availableContracts: default contract lookup failed",
|
|
3523
3596
|
I
|
|
3524
|
-
), null)), h =
|
|
3525
|
-
return
|
|
3597
|
+
), null)), h = Ri(f?.contracts);
|
|
3598
|
+
return Ui(
|
|
3526
3599
|
g,
|
|
3527
3600
|
p,
|
|
3528
3601
|
h
|
|
@@ -3543,10 +3616,10 @@ const ca = {
|
|
|
3543
3616
|
pickupPointsHash: null
|
|
3544
3617
|
};
|
|
3545
3618
|
},
|
|
3546
|
-
orderEntryOperation:
|
|
3547
|
-
orderFormItems:
|
|
3548
|
-
recommendations:
|
|
3549
|
-
},
|
|
3619
|
+
orderEntryOperation: la,
|
|
3620
|
+
orderFormItems: da,
|
|
3621
|
+
recommendations: sa
|
|
3622
|
+
}, Sa = {
|
|
3550
3623
|
reviewRating: () => ({
|
|
3551
3624
|
ratingValue: 5,
|
|
3552
3625
|
bestRating: 5
|
|
@@ -3554,7 +3627,7 @@ const ca = {
|
|
|
3554
3627
|
author: () => ({
|
|
3555
3628
|
name: ""
|
|
3556
3629
|
})
|
|
3557
|
-
},
|
|
3630
|
+
}, ya = (e, n, t) => n ? e.key === "category-1" : t ? e.key === "brand" : !1, Ia = {
|
|
3558
3631
|
suggestions: async (e, n, t) => {
|
|
3559
3632
|
const {
|
|
3560
3633
|
clients: { search: r }
|
|
@@ -3571,7 +3644,7 @@ const ca = {
|
|
|
3571
3644
|
r.suggestedTerms(i),
|
|
3572
3645
|
a
|
|
3573
3646
|
]), c = s.products.map((g) => {
|
|
3574
|
-
const p =
|
|
3647
|
+
const p = fe(g.items);
|
|
3575
3648
|
return p && L(p, g);
|
|
3576
3649
|
}).filter((g) => !!g), { searches: d } = o;
|
|
3577
3650
|
return {
|
|
@@ -3581,7 +3654,7 @@ const ca = {
|
|
|
3581
3654
|
},
|
|
3582
3655
|
products: async ({ productSearchPromise: e }) => {
|
|
3583
3656
|
const n = await e, t = n.products.map((r) => {
|
|
3584
|
-
const i =
|
|
3657
|
+
const i = fe(r.items);
|
|
3585
3658
|
return i && L(i, r);
|
|
3586
3659
|
}).filter((r) => !!r);
|
|
3587
3660
|
return {
|
|
@@ -3605,7 +3678,7 @@ const ca = {
|
|
|
3605
3678
|
t.storage.searchArgs = e;
|
|
3606
3679
|
const { facets: i = [] } = await r.facets(e), a = !e.query, o = e.selectedFacets?.length ? e.selectedFacets[0].key === "category-1" : !1, s = e.selectedFacets?.length ? e.selectedFacets[0].key === "brand" : !1;
|
|
3607
3680
|
return i.filter(
|
|
3608
|
-
(d) => !a || !
|
|
3681
|
+
(d) => !a || !ya(d, o, s)
|
|
3609
3682
|
);
|
|
3610
3683
|
},
|
|
3611
3684
|
metadata: async ({ productSearchPromise: e }) => {
|
|
@@ -3617,12 +3690,12 @@ const ca = {
|
|
|
3617
3690
|
};
|
|
3618
3691
|
},
|
|
3619
3692
|
searchId: async ({ productSearchPromise: e }) => (await e).searchId
|
|
3620
|
-
},
|
|
3693
|
+
}, va = {
|
|
3621
3694
|
title: ({ title: e }) => e ?? "",
|
|
3622
3695
|
description: ({ description: e }) => e ?? "",
|
|
3623
3696
|
canonical: ({ canonical: e }) => e ?? "",
|
|
3624
3697
|
titleTemplate: () => ""
|
|
3625
|
-
},
|
|
3698
|
+
}, Oa = ["bd", "d", "h", "m"], Ca = (e) => Oa.includes(e), ba = {
|
|
3626
3699
|
bd: {
|
|
3627
3700
|
0: "Today",
|
|
3628
3701
|
1: "In 1 business day",
|
|
@@ -3643,29 +3716,29 @@ const ca = {
|
|
|
3643
3716
|
1: "In 1 minute",
|
|
3644
3717
|
other: "Up to # minutes"
|
|
3645
3718
|
}
|
|
3646
|
-
},
|
|
3647
|
-
const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i =
|
|
3719
|
+
}, Qn = (e) => {
|
|
3720
|
+
const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i = Ca(t);
|
|
3648
3721
|
if (!r || !i)
|
|
3649
3722
|
return "";
|
|
3650
3723
|
const a = Number(n) < 2 ? Number(n) : "other";
|
|
3651
|
-
return
|
|
3652
|
-
},
|
|
3724
|
+
return ba[t][a].replace("#", n) ?? "";
|
|
3725
|
+
}, wa = {
|
|
3653
3726
|
carrier: (e) => e?.friendlyName ?? e?.name ?? "",
|
|
3654
3727
|
price: (e) => e?.price ? e.price / 100 : e?.price,
|
|
3655
|
-
localizedEstimates: (e) => e?.shippingEstimate ?
|
|
3656
|
-
},
|
|
3657
|
-
function
|
|
3658
|
-
const t = `${
|
|
3728
|
+
localizedEstimates: (e) => e?.shippingEstimate ? Qn(e.shippingEstimate) : ""
|
|
3729
|
+
}, pn = "skuvariation";
|
|
3730
|
+
function gn(e, n) {
|
|
3731
|
+
const t = `${pn}${n}`.toLowerCase(), r = e.find(
|
|
3659
3732
|
(a) => a.imageLabel === t
|
|
3660
3733
|
);
|
|
3661
3734
|
if (r)
|
|
3662
3735
|
return r;
|
|
3663
3736
|
const i = e.find(
|
|
3664
|
-
(a) => a.imageLabel ===
|
|
3737
|
+
(a) => a.imageLabel === pn
|
|
3665
3738
|
);
|
|
3666
3739
|
return i || e[0];
|
|
3667
3740
|
}
|
|
3668
|
-
function
|
|
3741
|
+
function Aa(e, n, t) {
|
|
3669
3742
|
const r = {};
|
|
3670
3743
|
return e.forEach((i) => {
|
|
3671
3744
|
const a = i.variations;
|
|
@@ -3677,30 +3750,30 @@ function Sa(e, n, t) {
|
|
|
3677
3750
|
r[s] = `${t}-${i.itemId}`;
|
|
3678
3751
|
}), r;
|
|
3679
3752
|
}
|
|
3680
|
-
function
|
|
3753
|
+
function mn(e) {
|
|
3681
3754
|
const n = {};
|
|
3682
3755
|
return e.forEach((t) => {
|
|
3683
3756
|
n[t.name] = t.values[0];
|
|
3684
3757
|
}), n;
|
|
3685
3758
|
}
|
|
3686
|
-
function
|
|
3759
|
+
function Pa(e) {
|
|
3687
3760
|
const n = {};
|
|
3688
3761
|
return e?.forEach((t) => {
|
|
3689
3762
|
n[t.field.originalName ?? t.field.name] = t.values.map((r) => r.originalName ?? r.name);
|
|
3690
3763
|
}), n;
|
|
3691
3764
|
}
|
|
3692
|
-
function
|
|
3765
|
+
function Da(e, n) {
|
|
3693
3766
|
return Number.isNaN(Number(e) - Number(n)) ? e < n ? -1 : e > n ? 1 : 0 : Number(e) - Number(n);
|
|
3694
3767
|
}
|
|
3695
|
-
function
|
|
3768
|
+
function Ea(e) {
|
|
3696
3769
|
const n = e;
|
|
3697
3770
|
for (const t in e)
|
|
3698
3771
|
e[t].every(
|
|
3699
3772
|
(i) => !Number.isNaN(Number(i.value))
|
|
3700
|
-
) && e[t].sort((i, a) =>
|
|
3773
|
+
) && e[t].sort((i, a) => Da(i.value, a.value));
|
|
3701
3774
|
return n;
|
|
3702
3775
|
}
|
|
3703
|
-
function
|
|
3776
|
+
function ka(e, n, t) {
|
|
3704
3777
|
const r = {}, i = /* @__PURE__ */ new Set();
|
|
3705
3778
|
return e.forEach((a) => {
|
|
3706
3779
|
if (a.variations.length === 0)
|
|
@@ -3713,7 +3786,7 @@ function Oa(e, n, t) {
|
|
|
3713
3786
|
if (!o || i.has(c))
|
|
3714
3787
|
return;
|
|
3715
3788
|
i.add(c);
|
|
3716
|
-
const d =
|
|
3789
|
+
const d = gn(
|
|
3717
3790
|
a.images,
|
|
3718
3791
|
n
|
|
3719
3792
|
), g = {
|
|
@@ -3730,7 +3803,7 @@ function Oa(e, n, t) {
|
|
|
3730
3803
|
if (i.has(d))
|
|
3731
3804
|
return;
|
|
3732
3805
|
i.add(d);
|
|
3733
|
-
const g =
|
|
3806
|
+
const g = gn(
|
|
3734
3807
|
a.images,
|
|
3735
3808
|
c.name
|
|
3736
3809
|
), p = {
|
|
@@ -3741,40 +3814,40 @@ function Oa(e, n, t) {
|
|
|
3741
3814
|
};
|
|
3742
3815
|
r[c.name] ? r[c.name].push(p) : r[c.name] = [p];
|
|
3743
3816
|
});
|
|
3744
|
-
}),
|
|
3817
|
+
}), Ea(r);
|
|
3745
3818
|
}
|
|
3746
|
-
const
|
|
3747
|
-
activeVariations: (e) =>
|
|
3748
|
-
allVariantsByName: (e) =>
|
|
3749
|
-
slugsMap: (e, n) =>
|
|
3819
|
+
const _a = {
|
|
3820
|
+
activeVariations: (e) => mn(e.variations),
|
|
3821
|
+
allVariantsByName: (e) => Pa(e.isVariantOf.skuSpecifications),
|
|
3822
|
+
slugsMap: (e, n) => Aa(
|
|
3750
3823
|
e.isVariantOf.items,
|
|
3751
3824
|
n.dominantVariantName ?? e.variations[0]?.name,
|
|
3752
3825
|
e.isVariantOf.linkText
|
|
3753
3826
|
),
|
|
3754
3827
|
availableVariations: (e, n) => {
|
|
3755
|
-
const t = n.dominantVariantName ?? e.variations[0]?.name, i =
|
|
3756
|
-
return
|
|
3828
|
+
const t = n.dominantVariantName ?? e.variations[0]?.name, i = mn(e.variations)[t];
|
|
3829
|
+
return ka(
|
|
3757
3830
|
e.isVariantOf.items,
|
|
3758
3831
|
t,
|
|
3759
3832
|
i
|
|
3760
3833
|
);
|
|
3761
3834
|
},
|
|
3762
3835
|
allVariantProducts: (e) => e.isVariantOf.items.map((n) => L(n, e.isVariantOf))
|
|
3763
|
-
},
|
|
3836
|
+
}, Ta = {
|
|
3764
3837
|
"pickup-in-point": "Pickup",
|
|
3765
3838
|
delivery: "Delivery",
|
|
3766
3839
|
pickup: "Pickup",
|
|
3767
3840
|
"take-away": "Take away",
|
|
3768
3841
|
"": ""
|
|
3769
|
-
},
|
|
3842
|
+
}, Ra = {
|
|
3770
3843
|
deliveryOptionsData: (e) => {
|
|
3771
3844
|
const { shippingData: n, items: t } = e, r = n?.logisticsInfo || [], i = n?.selectedAddresses || n?.availableAddresses || [n?.address], a = r.reduce(
|
|
3772
3845
|
(d, g) => {
|
|
3773
|
-
const p = g?.selectedSla || "", f = g?.selectedDeliveryChannel || g?.deliveryChannel || "", h = g?.deliveryCompany || "", I = g?.deliveryWindow, l = g?.pickupStoreInfo, u = g?.shippingEstimate || "", m = g?.shippingEstimate ?
|
|
3846
|
+
const p = g?.selectedSla || "", f = g?.selectedDeliveryChannel || g?.deliveryChannel || "", h = g?.deliveryCompany || "", I = g?.deliveryWindow, l = g?.pickupStoreInfo, u = g?.shippingEstimate || "", m = g?.shippingEstimate ? Qn(g?.shippingEstimate) : "", S = g?.shippingEstimateDate || "", v = g?.addressId || "", b = g?.itemIndex ?? 0, O = t?.[b], T = O?.seller || "", A = `${p}|${f}|${h}|${T}|${u}|${S}|${v}|${I?.startDateUtc}|${I?.endDateUtc}`, C = i?.find(
|
|
3774
3847
|
(R) => R?.addressId === v
|
|
3775
|
-
),
|
|
3776
|
-
|
|
3777
|
-
),
|
|
3848
|
+
), D = `${Ta[f] || ""} ${m} ${C?.neighborhood ? `to ${C?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: P, taxPriceTags: _ } = Ua(
|
|
3849
|
+
O?.priceTags ?? []
|
|
3850
|
+
), E = (O?.sellingPrice ?? 0) * (O?.quantity ?? 0) + (O?.tax ?? 0) + (P ?? 0);
|
|
3778
3851
|
return d[A] || (d[A] = {
|
|
3779
3852
|
// static fields
|
|
3780
3853
|
selectedSla: p,
|
|
@@ -3783,28 +3856,28 @@ const Ca = {
|
|
|
3783
3856
|
deliveryWindow: I,
|
|
3784
3857
|
shippingEstimate: u,
|
|
3785
3858
|
shippingEstimateDate: S,
|
|
3786
|
-
seller:
|
|
3859
|
+
seller: T,
|
|
3787
3860
|
friendlyShippingEstimate: m,
|
|
3788
|
-
friendlyDeliveryOptionName:
|
|
3789
|
-
address:
|
|
3861
|
+
friendlyDeliveryOptionName: D,
|
|
3862
|
+
address: C,
|
|
3790
3863
|
pickupStoreInfo: l,
|
|
3791
3864
|
// dynamic fields
|
|
3792
3865
|
quantityOfDifferentItems: 0,
|
|
3793
3866
|
total: 0,
|
|
3794
3867
|
items: []
|
|
3795
3868
|
}), d[A] && (d[A].items?.push({
|
|
3796
|
-
id:
|
|
3797
|
-
uniqueId:
|
|
3798
|
-
name:
|
|
3799
|
-
quantity:
|
|
3800
|
-
price:
|
|
3801
|
-
sellingPrice:
|
|
3802
|
-
imageUrl:
|
|
3803
|
-
taxPriceTags:
|
|
3804
|
-
taxPriceTagsTotal:
|
|
3805
|
-
tax:
|
|
3806
|
-
total:
|
|
3807
|
-
}), d[A].quantityOfDifferentItems = (d[A].quantityOfDifferentItems ?? 0) + 1, d[A].total = (d[A].total ?? 0) +
|
|
3869
|
+
id: O?.id || "",
|
|
3870
|
+
uniqueId: O?.uniqueId || "",
|
|
3871
|
+
name: O?.name || "",
|
|
3872
|
+
quantity: O?.quantity || 0,
|
|
3873
|
+
price: O?.price || 0,
|
|
3874
|
+
sellingPrice: O?.sellingPrice || 0,
|
|
3875
|
+
imageUrl: O?.imageUrl || "",
|
|
3876
|
+
taxPriceTags: _ ?? [],
|
|
3877
|
+
taxPriceTagsTotal: P ?? 0,
|
|
3878
|
+
tax: O?.tax || 0,
|
|
3879
|
+
total: E
|
|
3880
|
+
}), d[A].quantityOfDifferentItems = (d[A].quantityOfDifferentItems ?? 0) + 1, d[A].total = (d[A].total ?? 0) + E), d;
|
|
3808
3881
|
},
|
|
3809
3882
|
{}
|
|
3810
3883
|
), o = Object.values(a), s = n?.contactInformation?.[0], c = {
|
|
@@ -3830,7 +3903,7 @@ const Ca = {
|
|
|
3830
3903
|
) || [];
|
|
3831
3904
|
}
|
|
3832
3905
|
};
|
|
3833
|
-
function
|
|
3906
|
+
function Ua(e) {
|
|
3834
3907
|
const t = e.filter(
|
|
3835
3908
|
(i) => i?.name?.includes("TAX")
|
|
3836
3909
|
), r = t.reduce(
|
|
@@ -3842,28 +3915,28 @@ function Aa(e) {
|
|
|
3842
3915
|
taxPriceTagsTotal: r
|
|
3843
3916
|
};
|
|
3844
3917
|
}
|
|
3845
|
-
const
|
|
3846
|
-
StoreCollection:
|
|
3847
|
-
StoreAggregateOffer:
|
|
3848
|
-
StoreProduct:
|
|
3849
|
-
StoreSeo:
|
|
3850
|
-
StoreFacet:
|
|
3851
|
-
StoreFacetBoolean:
|
|
3852
|
-
StoreFacetRange:
|
|
3853
|
-
StoreFacetValueBoolean:
|
|
3854
|
-
StoreOffer:
|
|
3855
|
-
StoreAggregateRating:
|
|
3856
|
-
StoreReview:
|
|
3857
|
-
StoreProductGroup:
|
|
3858
|
-
StoreSearchResult:
|
|
3859
|
-
StorePropertyValue:
|
|
3860
|
-
SkuVariants:
|
|
3861
|
-
ShippingSLA:
|
|
3862
|
-
UserOrderResult:
|
|
3863
|
-
ObjectOrString:
|
|
3864
|
-
Query:
|
|
3865
|
-
Mutation:
|
|
3866
|
-
},
|
|
3918
|
+
const Na = {
|
|
3919
|
+
StoreCollection: _n,
|
|
3920
|
+
StoreAggregateOffer: _r,
|
|
3921
|
+
StoreProduct: ta,
|
|
3922
|
+
StoreSeo: va,
|
|
3923
|
+
StoreFacet: Mr,
|
|
3924
|
+
StoreFacetBoolean: zr,
|
|
3925
|
+
StoreFacetRange: Vr,
|
|
3926
|
+
StoreFacetValueBoolean: qr,
|
|
3927
|
+
StoreOffer: Ki,
|
|
3928
|
+
StoreAggregateRating: Tr,
|
|
3929
|
+
StoreReview: Sa,
|
|
3930
|
+
StoreProductGroup: ia,
|
|
3931
|
+
StoreSearchResult: Ia,
|
|
3932
|
+
StorePropertyValue: aa,
|
|
3933
|
+
SkuVariants: _a,
|
|
3934
|
+
ShippingSLA: wa,
|
|
3935
|
+
UserOrderResult: Ra,
|
|
3936
|
+
ObjectOrString: Yi,
|
|
3937
|
+
Query: fa,
|
|
3938
|
+
Mutation: Hi
|
|
3939
|
+
}, Fa = () => Na, La = `"""
|
|
3867
3940
|
Address information.
|
|
3868
3941
|
"""
|
|
3869
3942
|
type Address {
|
|
@@ -3908,7 +3981,7 @@ type Address {
|
|
|
3908
3981
|
"""
|
|
3909
3982
|
geoCoordinates: [Float]
|
|
3910
3983
|
}
|
|
3911
|
-
`,
|
|
3984
|
+
`, Ba = `"""
|
|
3912
3985
|
Advertisement information about a specific product in a campaign
|
|
3913
3986
|
"""
|
|
3914
3987
|
type Advertisement {
|
|
@@ -3933,7 +4006,7 @@ type Advertisement {
|
|
|
3933
4006
|
"""
|
|
3934
4007
|
adResponseId: String!
|
|
3935
4008
|
}
|
|
3936
|
-
`,
|
|
4009
|
+
`, $a = `"""
|
|
3937
4010
|
Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.
|
|
3938
4011
|
"""
|
|
3939
4012
|
type StoreAggregateOffer {
|
|
@@ -3962,7 +4035,7 @@ type StoreAggregateOffer {
|
|
|
3962
4035
|
"""
|
|
3963
4036
|
offers: [StoreOffer!]!
|
|
3964
4037
|
}
|
|
3965
|
-
`,
|
|
4038
|
+
`, Ma = `"""
|
|
3966
4039
|
Average rating, based on multiple ratings or reviews.
|
|
3967
4040
|
"""
|
|
3968
4041
|
type StoreAggregateRating {
|
|
@@ -3975,7 +4048,7 @@ type StoreAggregateRating {
|
|
|
3975
4048
|
"""
|
|
3976
4049
|
reviewCount: Int!
|
|
3977
4050
|
}
|
|
3978
|
-
`,
|
|
4051
|
+
`, za = `"""
|
|
3979
4052
|
information about the author of a product review or rating.
|
|
3980
4053
|
"""
|
|
3981
4054
|
type StoreAuthor {
|
|
@@ -3984,7 +4057,7 @@ type StoreAuthor {
|
|
|
3984
4057
|
"""
|
|
3985
4058
|
name: String!
|
|
3986
4059
|
}
|
|
3987
|
-
`,
|
|
4060
|
+
`, Va = `"""
|
|
3988
4061
|
Brand of a given product.
|
|
3989
4062
|
"""
|
|
3990
4063
|
type StoreBrand {
|
|
@@ -3993,7 +4066,7 @@ type StoreBrand {
|
|
|
3993
4066
|
"""
|
|
3994
4067
|
name: String!
|
|
3995
4068
|
}
|
|
3996
|
-
`,
|
|
4069
|
+
`, qa = `"""
|
|
3997
4070
|
Item of a list.
|
|
3998
4071
|
"""
|
|
3999
4072
|
type StoreListItem {
|
|
@@ -4024,7 +4097,7 @@ type StoreBreadcrumbList {
|
|
|
4024
4097
|
"""
|
|
4025
4098
|
numberOfItems: Int!
|
|
4026
4099
|
}
|
|
4027
|
-
`,
|
|
4100
|
+
`, xa = `"""
|
|
4028
4101
|
Shopping cart message.
|
|
4029
4102
|
"""
|
|
4030
4103
|
type StoreCartMessage {
|
|
@@ -4061,7 +4134,7 @@ input IStoreCart {
|
|
|
4061
4134
|
"""
|
|
4062
4135
|
order: IStoreOrder!
|
|
4063
4136
|
}
|
|
4064
|
-
`,
|
|
4137
|
+
`, ja = `"""
|
|
4065
4138
|
Product collection type. Possible values are \`Department\`, \`Category\`, \`Brand\` or \`Collection\`.
|
|
4066
4139
|
|
|
4067
4140
|
\`SubCategory\` and \`Cluster\` are still declared for backward compatibility but are
|
|
@@ -4187,7 +4260,7 @@ type StoreCollectionLocale {
|
|
|
4187
4260
|
"""
|
|
4188
4261
|
slug: String!
|
|
4189
4262
|
}
|
|
4190
|
-
`,
|
|
4263
|
+
`, Wa = `"""
|
|
4191
4264
|
Delivery Promise badge.
|
|
4192
4265
|
"""
|
|
4193
4266
|
type DeliveryPromiseBadge {
|
|
@@ -4196,7 +4269,7 @@ type DeliveryPromiseBadge {
|
|
|
4196
4269
|
"""
|
|
4197
4270
|
typeName: String
|
|
4198
4271
|
}
|
|
4199
|
-
`,
|
|
4272
|
+
`, Ha = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
|
|
4200
4273
|
|
|
4201
4274
|
"""
|
|
4202
4275
|
Search facet range information.
|
|
@@ -4273,7 +4346,7 @@ type StoreFacetValueBoolean {
|
|
|
4273
4346
|
"""
|
|
4274
4347
|
quantity: Int
|
|
4275
4348
|
}
|
|
4276
|
-
`,
|
|
4349
|
+
`, Ga = `"""
|
|
4277
4350
|
Image.
|
|
4278
4351
|
"""
|
|
4279
4352
|
type StoreImage {
|
|
@@ -4300,7 +4373,7 @@ input IStoreImage {
|
|
|
4300
4373
|
"""
|
|
4301
4374
|
alternateName: String!
|
|
4302
4375
|
}
|
|
4303
|
-
`,
|
|
4376
|
+
`, Xa = `type Mutation {
|
|
4304
4377
|
"""
|
|
4305
4378
|
Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns \`null\`.
|
|
4306
4379
|
"""
|
|
@@ -4342,7 +4415,7 @@ input IStoreImage {
|
|
|
4342
4415
|
"""
|
|
4343
4416
|
startRecommendationSession: Boolean!
|
|
4344
4417
|
}
|
|
4345
|
-
`,
|
|
4418
|
+
`, Ya = `"""
|
|
4346
4419
|
Newsletter information.
|
|
4347
4420
|
"""
|
|
4348
4421
|
type PersonNewsletter {
|
|
@@ -4365,8 +4438,8 @@ input IPersonNewsletter {
|
|
|
4365
4438
|
"""
|
|
4366
4439
|
email: String!
|
|
4367
4440
|
}
|
|
4368
|
-
`,
|
|
4369
|
-
`,
|
|
4441
|
+
`, Ka = `scalar ObjectOrString
|
|
4442
|
+
`, Ja = `"""
|
|
4370
4443
|
Offer information.
|
|
4371
4444
|
"""
|
|
4372
4445
|
type StoreOffer {
|
|
@@ -4459,7 +4532,7 @@ input IStoreOffer {
|
|
|
4459
4532
|
"""
|
|
4460
4533
|
priceToken: String
|
|
4461
4534
|
}
|
|
4462
|
-
`,
|
|
4535
|
+
`, Qa = `"""
|
|
4463
4536
|
Information of a specific order.
|
|
4464
4537
|
"""
|
|
4465
4538
|
type StoreOrder {
|
|
@@ -4500,7 +4573,7 @@ input IStoreOrder {
|
|
|
4500
4573
|
"""
|
|
4501
4574
|
shouldSplitItem: Boolean
|
|
4502
4575
|
}
|
|
4503
|
-
`,
|
|
4576
|
+
`, Za = `"""
|
|
4504
4577
|
Commercial Authorization response.
|
|
4505
4578
|
"""
|
|
4506
4579
|
type CommercialAuthorizationResponse {
|
|
@@ -4899,7 +4972,7 @@ type ProcessOrderAuthorizationRule {
|
|
|
4899
4972
|
"""
|
|
4900
4973
|
rule: CommercialAuthorizationRule!
|
|
4901
4974
|
}
|
|
4902
|
-
`,
|
|
4975
|
+
`, eo = `"""
|
|
4903
4976
|
Input for uploading a file to the Order Entry Service.
|
|
4904
4977
|
The file is transmitted as a Base64-encoded string so it can travel
|
|
4905
4978
|
through the standard GraphQL JSON pipeline without multipart support.
|
|
@@ -4960,7 +5033,7 @@ type StoreOrderFormCartItem {
|
|
|
4960
5033
|
seller: String!
|
|
4961
5034
|
unitMultiplier: Float
|
|
4962
5035
|
}
|
|
4963
|
-
`,
|
|
5036
|
+
`, no = `"""
|
|
4964
5037
|
Organization.
|
|
4965
5038
|
"""
|
|
4966
5039
|
type StoreOrganization {
|
|
@@ -5001,7 +5074,7 @@ type StoreContract {
|
|
|
5001
5074
|
"""
|
|
5002
5075
|
isDefault: Boolean!
|
|
5003
5076
|
}
|
|
5004
|
-
`,
|
|
5077
|
+
`, to = `"""
|
|
5005
5078
|
Whenever you make a query that allows for pagination, such as \`allProducts\` or \`allCollections\`, you can check \`StorePageInfo\` to learn more about the complete set of items and use it to paginate your queries.
|
|
5006
5079
|
"""
|
|
5007
5080
|
type StorePageInfo {
|
|
@@ -5026,7 +5099,7 @@ type StorePageInfo {
|
|
|
5026
5099
|
"""
|
|
5027
5100
|
totalCount: Int!
|
|
5028
5101
|
}
|
|
5029
|
-
`,
|
|
5102
|
+
`, ro = `"""
|
|
5030
5103
|
Input type for setting a new password.
|
|
5031
5104
|
"""
|
|
5032
5105
|
input ISetPassword {
|
|
@@ -5069,7 +5142,7 @@ type SetPasswordResponse {
|
|
|
5069
5142
|
"""
|
|
5070
5143
|
message: String
|
|
5071
5144
|
}
|
|
5072
|
-
`,
|
|
5145
|
+
`, io = `"""
|
|
5073
5146
|
Client profile data.
|
|
5074
5147
|
"""
|
|
5075
5148
|
type StorePerson {
|
|
@@ -5112,7 +5185,7 @@ input IStorePerson {
|
|
|
5112
5185
|
"""
|
|
5113
5186
|
familyName: String!
|
|
5114
5187
|
}
|
|
5115
|
-
`,
|
|
5188
|
+
`, ao = `type PickupPointAddress {
|
|
5116
5189
|
"""
|
|
5117
5190
|
Address city.
|
|
5118
5191
|
"""
|
|
@@ -5194,7 +5267,7 @@ type PickupPoints {
|
|
|
5194
5267
|
reason: "Not returned by Intelligent Search pickup-point-availability. Always null."
|
|
5195
5268
|
)
|
|
5196
5269
|
}
|
|
5197
|
-
`,
|
|
5270
|
+
`, oo = `"""
|
|
5198
5271
|
Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
5199
5272
|
"""
|
|
5200
5273
|
type StoreProduct {
|
|
@@ -5370,7 +5443,7 @@ input IStoreProduct {
|
|
|
5370
5443
|
"""
|
|
5371
5444
|
additionalProperty: [IStorePropertyValue!]
|
|
5372
5445
|
}
|
|
5373
|
-
`,
|
|
5446
|
+
`, so = `"""
|
|
5374
5447
|
Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
|
|
5375
5448
|
"""
|
|
5376
5449
|
type StoreProductGroup {
|
|
@@ -5415,7 +5488,7 @@ type StoreProductCluster {
|
|
|
5415
5488
|
"""
|
|
5416
5489
|
name: String!
|
|
5417
5490
|
}
|
|
5418
|
-
`,
|
|
5491
|
+
`, co = `type Profile {
|
|
5419
5492
|
"""
|
|
5420
5493
|
Collection of user's address
|
|
5421
5494
|
"""
|
|
@@ -5476,7 +5549,7 @@ type ProfileAddress {
|
|
|
5476
5549
|
"""
|
|
5477
5550
|
geoCoordinate: [Float]
|
|
5478
5551
|
}
|
|
5479
|
-
`,
|
|
5552
|
+
`, lo = `"""
|
|
5480
5553
|
Properties that can be associated with products and products groups.
|
|
5481
5554
|
"""
|
|
5482
5555
|
type StorePropertyValue {
|
|
@@ -5516,7 +5589,7 @@ input IStorePropertyValue {
|
|
|
5516
5589
|
"""
|
|
5517
5590
|
valueReference: ObjectOrString!
|
|
5518
5591
|
}
|
|
5519
|
-
`,
|
|
5592
|
+
`, uo = `"""
|
|
5520
5593
|
Each product edge contains a \`node\`, with product information, and a \`cursor\`, that can be used as a reference for pagination.
|
|
5521
5594
|
"""
|
|
5522
5595
|
type StoreProductEdge {
|
|
@@ -6177,7 +6250,7 @@ type StoreAccountProfile {
|
|
|
6177
6250
|
email: String
|
|
6178
6251
|
id: String
|
|
6179
6252
|
}
|
|
6180
|
-
`,
|
|
6253
|
+
`, po = `"""
|
|
6181
6254
|
Summary of a quote returned in list results.
|
|
6182
6255
|
"""
|
|
6183
6256
|
type UserQuoteSummary {
|
|
@@ -6242,7 +6315,7 @@ type UserQuoteListPaging {
|
|
|
6242
6315
|
"""
|
|
6243
6316
|
perPage: Int!
|
|
6244
6317
|
}
|
|
6245
|
-
`,
|
|
6318
|
+
`, go = `type RecommendationResponse {
|
|
6246
6319
|
products: [StoreProduct!]!
|
|
6247
6320
|
correlationId: String!
|
|
6248
6321
|
campaign: RecommendationCampaign!
|
|
@@ -6253,7 +6326,7 @@ type RecommendationCampaign {
|
|
|
6253
6326
|
title: String
|
|
6254
6327
|
type: String!
|
|
6255
6328
|
}
|
|
6256
|
-
`,
|
|
6329
|
+
`, mo = `"""
|
|
6257
6330
|
Information of a given review rating.
|
|
6258
6331
|
"""
|
|
6259
6332
|
type StoreReviewRating {
|
|
@@ -6280,7 +6353,7 @@ type StoreReview {
|
|
|
6280
6353
|
"""
|
|
6281
6354
|
author: StoreAuthor!
|
|
6282
6355
|
}
|
|
6283
|
-
`,
|
|
6356
|
+
`, ho = `"""
|
|
6284
6357
|
Whether a saved card is personally owned by the buyer or shared by their
|
|
6285
6358
|
Organization/Contract. Resolved server-side by the Saved-cards service from
|
|
6286
6359
|
the buyer's \`useAdHocCard\` role — never inferred client-side.
|
|
@@ -6344,7 +6417,7 @@ type SavedCardListResult {
|
|
|
6344
6417
|
"""
|
|
6345
6418
|
list: [SavedCard!]
|
|
6346
6419
|
}
|
|
6347
|
-
`,
|
|
6420
|
+
`, fo = `"""
|
|
6348
6421
|
Search Engine Optimization (SEO) tags data.
|
|
6349
6422
|
"""
|
|
6350
6423
|
type StoreSeo {
|
|
@@ -6365,7 +6438,7 @@ type StoreSeo {
|
|
|
6365
6438
|
"""
|
|
6366
6439
|
canonical: String!
|
|
6367
6440
|
}
|
|
6368
|
-
`,
|
|
6441
|
+
`, So = `"""
|
|
6369
6442
|
Currency information.
|
|
6370
6443
|
"""
|
|
6371
6444
|
type StoreCurrency {
|
|
@@ -6640,7 +6713,7 @@ input IStoreSession {
|
|
|
6640
6713
|
"""
|
|
6641
6714
|
refreshAfter: String
|
|
6642
6715
|
}
|
|
6643
|
-
`,
|
|
6716
|
+
`, yo = `"""
|
|
6644
6717
|
Shipping Simulation item input.
|
|
6645
6718
|
"""
|
|
6646
6719
|
input IShippingItem {
|
|
@@ -6971,7 +7044,7 @@ type MessageFields {
|
|
|
6971
7044
|
"""
|
|
6972
7045
|
skuName: String
|
|
6973
7046
|
}
|
|
6974
|
-
`,
|
|
7047
|
+
`, Io = `type SkuVariants {
|
|
6975
7048
|
"""
|
|
6976
7049
|
SKU property values for the current SKU.
|
|
6977
7050
|
"""
|
|
@@ -7066,7 +7139,7 @@ Example:
|
|
|
7066
7139
|
\`\`\`
|
|
7067
7140
|
"""
|
|
7068
7141
|
scalar FormattedVariants
|
|
7069
|
-
`,
|
|
7142
|
+
`, vo = `"""
|
|
7070
7143
|
Status used to indicate a message type. For instance, a shopping cart informative or error message.
|
|
7071
7144
|
"""
|
|
7072
7145
|
enum StoreStatus {
|
|
@@ -7074,7 +7147,7 @@ enum StoreStatus {
|
|
|
7074
7147
|
WARNING
|
|
7075
7148
|
ERROR
|
|
7076
7149
|
}
|
|
7077
|
-
`,
|
|
7150
|
+
`, Oo = `scalar JSONObject
|
|
7078
7151
|
|
|
7079
7152
|
type UserOrder {
|
|
7080
7153
|
orderId: String
|
|
@@ -7898,99 +7971,99 @@ type UserOrderBudgetAllocationLinkedEntity {
|
|
|
7898
7971
|
type: String
|
|
7899
7972
|
id: String
|
|
7900
7973
|
}
|
|
7901
|
-
`,
|
|
7902
|
-
"./address.graphql":
|
|
7903
|
-
"./advertisement.graphql":
|
|
7904
|
-
"./aggregateOffer.graphql":
|
|
7905
|
-
"./aggregateRating.graphql":
|
|
7906
|
-
"./author.graphql":
|
|
7907
|
-
"./brand.graphql":
|
|
7908
|
-
"./breadcrumb.graphql":
|
|
7909
|
-
"./cart.graphql":
|
|
7910
|
-
"./collection.graphql":
|
|
7911
|
-
"./deliveryPromisesBadge.graphql":
|
|
7912
|
-
"./facet.graphql":
|
|
7913
|
-
"./image.graphql":
|
|
7914
|
-
"./mutation.graphql":
|
|
7915
|
-
"./newsletter.graphql":
|
|
7916
|
-
"./objectOrString.graphql":
|
|
7917
|
-
"./offer.graphql":
|
|
7918
|
-
"./order.graphql":
|
|
7919
|
-
"./orderCommercialAuthorizaton.graphql":
|
|
7920
|
-
"./orderEntry.graphql":
|
|
7921
|
-
"./organization.graphql":
|
|
7922
|
-
"./pageInfo.graphql":
|
|
7923
|
-
"./password.graphql":
|
|
7924
|
-
"./person.graphql":
|
|
7925
|
-
"./pickupPoints.graphql":
|
|
7926
|
-
"./product.graphql":
|
|
7927
|
-
"./productGroup.graphql":
|
|
7928
|
-
"./profile.graphql":
|
|
7929
|
-
"./propertyValue.graphql":
|
|
7930
|
-
"./query.graphql":
|
|
7931
|
-
"./quote.graphql":
|
|
7932
|
-
"./recommendation.graphql":
|
|
7933
|
-
"./review.graphql":
|
|
7934
|
-
"./savedCard.graphql":
|
|
7935
|
-
"./seo.graphql":
|
|
7936
|
-
"./session.graphql":
|
|
7937
|
-
"./shipping.graphql":
|
|
7938
|
-
"./skuVariants.graphql":
|
|
7939
|
-
"./status.graphql":
|
|
7940
|
-
"./userOrder.graphql":
|
|
7941
|
-
}),
|
|
7942
|
-
Object.values(
|
|
7943
|
-
(e, n) =>
|
|
7974
|
+
`, Co = /* @__PURE__ */ Object.assign({
|
|
7975
|
+
"./address.graphql": La,
|
|
7976
|
+
"./advertisement.graphql": Ba,
|
|
7977
|
+
"./aggregateOffer.graphql": $a,
|
|
7978
|
+
"./aggregateRating.graphql": Ma,
|
|
7979
|
+
"./author.graphql": za,
|
|
7980
|
+
"./brand.graphql": Va,
|
|
7981
|
+
"./breadcrumb.graphql": qa,
|
|
7982
|
+
"./cart.graphql": xa,
|
|
7983
|
+
"./collection.graphql": ja,
|
|
7984
|
+
"./deliveryPromisesBadge.graphql": Wa,
|
|
7985
|
+
"./facet.graphql": Ha,
|
|
7986
|
+
"./image.graphql": Ga,
|
|
7987
|
+
"./mutation.graphql": Xa,
|
|
7988
|
+
"./newsletter.graphql": Ya,
|
|
7989
|
+
"./objectOrString.graphql": Ka,
|
|
7990
|
+
"./offer.graphql": Ja,
|
|
7991
|
+
"./order.graphql": Qa,
|
|
7992
|
+
"./orderCommercialAuthorizaton.graphql": Za,
|
|
7993
|
+
"./orderEntry.graphql": eo,
|
|
7994
|
+
"./organization.graphql": no,
|
|
7995
|
+
"./pageInfo.graphql": to,
|
|
7996
|
+
"./password.graphql": ro,
|
|
7997
|
+
"./person.graphql": io,
|
|
7998
|
+
"./pickupPoints.graphql": ao,
|
|
7999
|
+
"./product.graphql": oo,
|
|
8000
|
+
"./productGroup.graphql": so,
|
|
8001
|
+
"./profile.graphql": co,
|
|
8002
|
+
"./propertyValue.graphql": lo,
|
|
8003
|
+
"./query.graphql": uo,
|
|
8004
|
+
"./quote.graphql": po,
|
|
8005
|
+
"./recommendation.graphql": go,
|
|
8006
|
+
"./review.graphql": mo,
|
|
8007
|
+
"./savedCard.graphql": ho,
|
|
8008
|
+
"./seo.graphql": fo,
|
|
8009
|
+
"./session.graphql": So,
|
|
8010
|
+
"./shipping.graphql": yo,
|
|
8011
|
+
"./skuVariants.graphql": Io,
|
|
8012
|
+
"./status.graphql": vo,
|
|
8013
|
+
"./userOrder.graphql": Oo
|
|
8014
|
+
}), bo = it(
|
|
8015
|
+
Object.values(Co).map((e) => at(e)).reduce(
|
|
8016
|
+
(e, n) => hn([e, n], { sort: !0 })
|
|
7944
8017
|
)
|
|
7945
|
-
),
|
|
8018
|
+
), wo = bo, qo = async (e) => (n) => (n.storage = {
|
|
7946
8019
|
channel: ae.parse(e.channel),
|
|
7947
8020
|
flags: e.flags ?? {},
|
|
7948
8021
|
locale: e.locale,
|
|
7949
8022
|
customSortMap: e.customSortMap ?? {},
|
|
7950
8023
|
cookies: /* @__PURE__ */ new Map()
|
|
7951
|
-
}, n.account = e.account, n.OTEL_ENABLED = e.OTEL_ENABLED, n.discoveryConfig = e.discoveryConfig, n.clients =
|
|
7952
|
-
function
|
|
7953
|
-
const e =
|
|
8024
|
+
}, n.account = e.account, n.OTEL_ENABLED = e.OTEL_ENABLED, n.discoveryConfig = e.discoveryConfig, n.clients = fr(e, n), n.loaders = Pr(e, n), n);
|
|
8025
|
+
function Ao() {
|
|
8026
|
+
const e = Fa(), n = {};
|
|
7954
8027
|
for (const [t, r] of Object.entries(e))
|
|
7955
8028
|
n[t] = Object.fromEntries(
|
|
7956
|
-
Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i,
|
|
8029
|
+
Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, Pt(a, `${t}(${i})`)])
|
|
7957
8030
|
);
|
|
7958
8031
|
return n;
|
|
7959
8032
|
}
|
|
7960
|
-
function
|
|
7961
|
-
const t =
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
])(
|
|
7965
|
-
return e &&
|
|
8033
|
+
function xo(e) {
|
|
8034
|
+
const t = At([
|
|
8035
|
+
wt,
|
|
8036
|
+
Ot
|
|
8037
|
+
])(Ao(), wo);
|
|
8038
|
+
return e && ot(e) ? tt({
|
|
7966
8039
|
schemas: [t, e]
|
|
7967
8040
|
}) : t;
|
|
7968
8041
|
}
|
|
7969
8042
|
export {
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
8043
|
+
Ot as AuthDirective,
|
|
8044
|
+
k as BadRequestError,
|
|
8045
|
+
wt as CacheControlDirective,
|
|
8046
|
+
ut as CardOrigin,
|
|
8047
|
+
pt as CommercialAuthorizationStatus,
|
|
8048
|
+
K as FastStoreError,
|
|
7976
8049
|
te as ForbiddenError,
|
|
7977
|
-
|
|
7978
|
-
|
|
8050
|
+
qo as GraphqlVtexContextFactory,
|
|
8051
|
+
xo as GraphqlVtexSchema,
|
|
7979
8052
|
z as NotFoundError,
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
8053
|
+
gt as StoreCollectionType,
|
|
8054
|
+
mt as StoreFacetType,
|
|
8055
|
+
ht as StoreSort,
|
|
8056
|
+
ft as StoreStatus,
|
|
8057
|
+
ue as UnauthorizedError,
|
|
8058
|
+
St as UserOrderInvoiceType,
|
|
7986
8059
|
$ as getAuthCookie,
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
8060
|
+
zo as isBadRequestError,
|
|
8061
|
+
Mo as isFastStoreError,
|
|
8062
|
+
Dt as isForbiddenError,
|
|
7990
8063
|
ee as isNotFoundError,
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
8064
|
+
Vo as isUnauthorizedError,
|
|
8065
|
+
$o as stringifyCacheControl,
|
|
8066
|
+
wo as typeDefs,
|
|
8067
|
+
It as validateUserAuthentication,
|
|
8068
|
+
At as withDirectives
|
|
7996
8069
|
};
|