@faststore/api 4.5.0-dev.4 → 4.5.0-dev.6

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/es/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
- import { mergeTypeDefs as Ze } from "@graphql-tools/merge";
2
- import { makeExecutableSchema as Un, mergeSchemas as kn } from "@graphql-tools/schema";
3
- import { mapSchema as en, MapperKind as nn, getDirective as tn } from "@graphql-tools/utils";
1
+ import { mergeTypeDefs as en } from "@graphql-tools/merge";
2
+ import { makeExecutableSchema as Un, mergeSchemas as Tn } from "@graphql-tools/schema";
3
+ import { mapSchema as nn, MapperKind as tn, getDirective as rn } from "@graphql-tools/utils";
4
4
  import { OTELAPI as L } from "@faststore/diagnostics";
5
- import { GraphQLScalarType as _n, print as Tn, parse as En, isSchema as Rn } from "graphql";
6
- import Fn from "isomorphic-unfetch";
5
+ import { GraphQLScalarType as _n, print as En, parse as Rn, isSchema as Fn } from "graphql";
6
+ import Nn from "isomorphic-unfetch";
7
7
  import { parse as Z } from "cookie";
8
- import Ae from "p-limit";
8
+ import Pe from "p-limit";
9
9
  import le from "dataloader";
10
- import Nn from "sanitize-html";
11
- import Pe from "fast-deep-equal";
12
- import Ln from "node:crypto";
13
- var Bn = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))(Bn || {}), $n = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))($n || {}), Mn = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(Mn || {}), zn = /* @__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))(zn || {}), Vn = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(Vn || {}), xn = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(xn || {});
14
- const qn = () => function(n = {}) {
10
+ import Ln from "sanitize-html";
11
+ import Ae from "fast-deep-equal";
12
+ import Bn from "node:crypto";
13
+ var $n = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))($n || {}), Mn = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))(Mn || {}), zn = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(zn || {}), Vn = /* @__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))(Vn || {}), xn = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(xn || {}), qn = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(qn || {});
14
+ const jn = () => 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 J("No authentication AppKey and AppToken passed.");
@@ -20,7 +20,7 @@ const qn = () => function(n = {}) {
20
20
  "X-VTEX-API-AppKey": t,
21
21
  "X-VTEX-API-AppToken": r
22
22
  };
23
- }, jn = async (e) => {
23
+ }, Wn = async (e) => {
24
24
  const {
25
25
  clients: { commerce: n }
26
26
  } = e;
@@ -31,45 +31,45 @@ const qn = () => function(n = {}) {
31
31
  const r = t.extensions?.status ?? t.status;
32
32
  throw r === 401 ? new te("Authentication required") : r === 403 ? new J("You are not allowed to access this resource") : new te("Authentication required");
33
33
  }
34
- }, Wn = "auth", Gn = {
34
+ }, Gn = "auth", Hn = {
35
35
  typeDefs: "directive @auth on FIELD_DEFINITION",
36
- transformer: (e) => en(e, {
37
- [nn.OBJECT_FIELD]: (n) => {
38
- if (tn(e, n, Wn)?.[0]) {
36
+ transformer: (e) => nn(e, {
37
+ [tn.OBJECT_FIELD]: (n) => {
38
+ if (rn(e, n, Gn)?.[0]) {
39
39
  const r = n.resolve;
40
- n.resolve = async (i, a, o, s) => (await jn(o), r?.(i, a, o, s));
40
+ n.resolve = async (i, a, o, s) => (await Wn(o), r?.(i, a, o, s));
41
41
  }
42
42
  return n;
43
43
  }
44
44
  })
45
- }, Hn = "cacheControl", Ta = (e, n) => {
45
+ }, Xn = "cacheControl", _a = (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
- }, ke = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, Xn = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, Yn = {
52
+ }, Ue = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, Yn = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, Jn = {
53
53
  typeDefs: "directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",
54
- transformer: (e) => en(e, {
55
- [nn.OBJECT_FIELD]: (n) => {
56
- const t = tn(e, n, Hn)?.[0];
54
+ transformer: (e) => nn(e, {
55
+ [tn.OBJECT_FIELD]: (n) => {
56
+ const t = rn(e, n, Xn)?.[0];
57
57
  if (t) {
58
58
  const { sMaxAge: r, staleWhileRevalidate: i, scope: a } = t, o = n.resolve;
59
- n.resolve = (s, c, l, p) => (l.cacheControl = {
60
- sMaxAge: ke(l.cacheControl?.sMaxAge, r),
61
- staleWhileRevalidate: ke(
59
+ n.resolve = (s, c, l, g) => (l.cacheControl = {
60
+ sMaxAge: Ue(l.cacheControl?.sMaxAge, r),
61
+ staleWhileRevalidate: Ue(
62
62
  l.cacheControl?.staleWhileRevalidate,
63
63
  i
64
64
  ),
65
- scope: Xn(l.cacheControl?.scope, a)
66
- }, o?.(s, c, l, p));
65
+ scope: Yn(l.cacheControl?.scope, a)
66
+ }, o?.(s, c, l, g));
67
67
  }
68
68
  return n;
69
69
  }
70
70
  })
71
- }, Jn = (e) => (n, t) => {
72
- const r = Ze([
71
+ }, Kn = (e) => (n, t) => {
72
+ const r = en([
73
73
  ...(e ?? []).map(({ typeDefs: i }) => i),
74
74
  t
75
75
  ]);
@@ -80,10 +80,10 @@ const qn = () => function(n = {}) {
80
80
  resolvers: n
81
81
  })
82
82
  );
83
- }, pe = "@faststore/api", ge = "4.5.0-dev.3", _e = {
83
+ }, pe = "@faststore/api", ge = "4.5.0-dev.5", Te = {
84
84
  name: pe,
85
85
  version: ge
86
- }, Kn = (e, n) => (t, r, i, a) => {
86
+ }, Qn = (e, n) => (t, r, i, a) => {
87
87
  if ((i?.OTEL?.enabled ?? !1) === !1)
88
88
  return e(t, r, i, a);
89
89
  const o = L.trace.getTracer(pe, ge), s = L.propagation.extract(
@@ -105,7 +105,7 @@ const qn = () => function(n = {}) {
105
105
  if (!c) return e(t, r, i, a);
106
106
  try {
107
107
  const l = e(t, r, i, a);
108
- return l instanceof Promise ? l.then((p) => (c.end(), p)) : (c.end(), l);
108
+ return l instanceof Promise ? l.then((g) => (c.end(), g)) : (c.end(), l);
109
109
  } catch (l) {
110
110
  throw c.end(), console.error(`Error when executing resolver: ${n}`, l), l;
111
111
  }
@@ -116,7 +116,7 @@ class ee extends Error {
116
116
  super(t), this.extensions = n, this.name = "FastStoreError";
117
117
  }
118
118
  }
119
- class T extends ee {
119
+ class _ extends ee {
120
120
  constructor(n) {
121
121
  super({ status: 400, type: "BadRequestError" }, n);
122
122
  }
@@ -136,12 +136,12 @@ class $ extends ee {
136
136
  super({ status: 404, type: "NotFoundError" }, n);
137
137
  }
138
138
  }
139
- const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type === "BadRequestError", Fa = (e) => e?.extensions?.type === "UnauthorizedError", Qn = (e) => e?.extensions?.type === "ForbiddenError", X = (e) => e?.extensions?.type === "NotFoundError", Zn = `${_e.name}@${_e.version}`, I = async (e, n, t) => {
140
- const r = await Fn(e, {
139
+ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type === "BadRequestError", Fa = (e) => e?.extensions?.type === "UnauthorizedError", Zn = (e) => e?.extensions?.type === "ForbiddenError", X = (e) => e?.extensions?.type === "NotFoundError", et = `${Te.name}@${Te.version}`, I = async (e, n, t) => {
140
+ const r = await Nn(e, {
141
141
  ...n,
142
142
  headers: {
143
143
  ...n?.headers ?? {},
144
- "User-Agent": Zn
144
+ "User-Agent": et
145
145
  }
146
146
  });
147
147
  if (r.ok)
@@ -151,7 +151,7 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
151
151
  if (typeof r?.status == "number")
152
152
  switch (r.status) {
153
153
  case 400:
154
- throw new T(i);
154
+ throw new _(i);
155
155
  case 401:
156
156
  throw new te(i);
157
157
  case 403:
@@ -165,7 +165,7 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
165
165
  );
166
166
  }
167
167
  throw new Error(i);
168
- }, et = ({ account: e, environment: n }) => {
168
+ }, nt = ({ account: e, environment: n }) => {
169
169
  const t = `https://${e}.${n}.com.br`;
170
170
  return {
171
171
  getLocalizedProduct: (r, i) => I(`${t}/api/catalog-dataplane/product/${r}`, {
@@ -176,7 +176,7 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
176
176
  }
177
177
  })
178
178
  };
179
- }, rn = (e) => {
179
+ }, an = (e) => {
180
180
  if (!e)
181
181
  return e;
182
182
  const n = /* @__PURE__ */ new Map(), t = e.split(";"), r = [];
@@ -190,8 +190,8 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
190
190
  }
191
191
  }
192
192
  }), r.map((i) => `${i}=${n.get(i)}`).join("; ");
193
- }, nt = /^([^=]+)=([^;]*)/, tt = (e, n) => {
194
- const t = n.match(nt);
193
+ }, tt = /^([^=]+)=([^;]*)/, rt = (e, n) => {
194
+ const t = n.match(tt);
195
195
  if (t) {
196
196
  const r = t[1], i = t[2];
197
197
  e.storage.cookies.set(r, {
@@ -199,32 +199,32 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
199
199
  setCookie: n
200
200
  });
201
201
  }
202
- }, rt = (e, n) => {
202
+ }, it = (e, n) => {
203
203
  n.getSetCookie().forEach(
204
- (t) => tt(e, t)
204
+ (t) => rt(e, t)
205
205
  );
206
- }, it = (e) => (n) => rt(e, n), me = (e) => {
206
+ }, at = (e) => (n) => it(e, n), me = (e) => {
207
207
  if (!e.headers?.cookie)
208
208
  return null;
209
- const n = rn(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
209
+ const n = an(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
210
210
  return t.length === 0 ? n : t.reduce(
211
- (r, [i, { value: a }]) => at(
211
+ (r, [i, { value: a }]) => ot(
212
212
  r,
213
213
  i,
214
214
  a
215
215
  ),
216
216
  n
217
217
  );
218
- }, an = (e) => function(t) {
218
+ }, on = (e) => function(t) {
219
219
  const r = me(e);
220
220
  return r ? {
221
221
  ...t,
222
222
  cookie: r
223
223
  } : t;
224
224
  }, z = (e, n) => {
225
- const t = rn(e);
225
+ const t = an(e);
226
226
  return Z(t)[`VtexIdclientAutCookie_${n}`] || "";
227
- }, at = (e, n, t) => {
227
+ }, ot = (e, n, t) => {
228
228
  const r = new RegExp(`(${n})=([^;]*)`), i = e.match(r);
229
229
  return i ? e.replace(
230
230
  i[0],
@@ -234,12 +234,12 @@ const Ea = (e) => e?.name === "FastStoreError", Ra = (e) => e?.extensions?.type
234
234
  function Y(e) {
235
235
  return e ? JSON.parse(Buffer.from(e.split(".")[1], "base64").toString()) : null;
236
236
  }
237
- const ot = "storefront/faststore.recommendation-shelf@v4", j = {
237
+ const st = "storefront/faststore.recommendation-shelf@v4", j = {
238
238
  method: "POST",
239
239
  headers: {
240
240
  "content-type": "application/json"
241
241
  }
242
- }, st = (e) => e.split("/").map(encodeURIComponent).join("/"), ue = (e) => e ? { headers: { "Accept-Language": e } } : void 0, ct = /^\d{4}-\d{2}-\d{2}$/, lt = /* @__PURE__ */ new Set([
242
+ }, ct = (e) => e.split("/").map(encodeURIComponent).join("/"), ue = (e) => e ? { headers: { "Accept-Language": e } } : void 0, lt = /^\d{4}-\d{2}-\d{2}$/, dt = /* @__PURE__ */ new Set([
243
243
  "Draft",
244
244
  "Requested",
245
245
  "InReview",
@@ -250,7 +250,7 @@ const ot = "storefront/faststore.recommendation-shelf@v4", j = {
250
250
  "ConvertedToCart",
251
251
  "ConvertedToOrder"
252
252
  ]);
253
- function dt({
253
+ function ut({
254
254
  page: e,
255
255
  perPage: n,
256
256
  status: t,
@@ -273,19 +273,19 @@ function dt({
273
273
  ["expiresAtFrom", a],
274
274
  ["expiresAtTo", o]
275
275
  ])
276
- if (c && !ct.test(c))
276
+ if (c && !lt.test(c))
277
277
  throw new Error(
278
278
  `listUserQuotes: invalid ${s} "${c}" — must be YYYY-MM-DD`
279
279
  );
280
280
  if (t && t.length > 0) {
281
- const s = t.filter((c) => !lt.has(c));
281
+ const s = t.filter((c) => !dt.has(c));
282
282
  if (s.length > 0)
283
283
  throw new Error(
284
284
  `listUserQuotes: invalid status values: ${s.join(", ")}`
285
285
  );
286
286
  }
287
287
  }
288
- function ut({
288
+ function pt({
289
289
  page: e,
290
290
  perPage: n,
291
291
  status: t,
@@ -298,17 +298,17 @@ function ut({
298
298
  const c = new URLSearchParams();
299
299
  return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((l) => c.append("status", l)), 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;
300
300
  }
301
- const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
302
- const a = `https://${e}.${n}.com.br`, o = it(i), s = an(i), c = qn(), l = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", p = r && r.map((d) => d + ".").find((d) => l.includes(d)) || "", u = l.replace(p, ""), h = `${a}/api/recommend-bff/v2`, f = s({
301
+ const gt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
302
+ const a = `https://${e}.${n}.com.br`, o = at(i), s = on(i), c = jn(), l = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", g = r && r.map((d) => d + ".").find((d) => l.includes(d)) || "", u = l.replace(g, ""), h = `${a}/api/recommend-bff/v2`, f = s({
303
303
  accept: "application/json",
304
304
  "content-type": "application/json",
305
- "x-vtex-rec-origin": `${e}/${ot}`
305
+ "x-vtex-rec-origin": `${e}/${st}`
306
306
  }), v = (d = {}) => {
307
- const g = z(me(i) ?? "", e);
307
+ const p = z(me(i) ?? "", e);
308
308
  return s({
309
309
  ...d,
310
310
  "X-FORWARDED-HOST": u,
311
- ...g ? { [`VtexIdclientAutCookie_${e}`]: g } : {}
311
+ ...p ? { [`VtexIdclientAutCookie_${e}`]: p } : {}
312
312
  });
313
313
  };
314
314
  return {
@@ -341,33 +341,33 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
341
341
  // The by-linkid endpoints resolve a slug to a single catalog entity
342
342
  // (or 404 when there is no match). We surface a 404 as `null` so the
343
343
  // loader can cascade category → brand → collection.
344
- category: async (d, g) => {
344
+ category: async (d, p) => {
345
345
  try {
346
346
  return await I(
347
- `${a}/api/catalog_system/pub/category/by-linkid/${st(d)}`,
348
- ue(g)
347
+ `${a}/api/catalog_system/pub/category/by-linkid/${ct(d)}`,
348
+ ue(p)
349
349
  );
350
350
  } catch (m) {
351
351
  if (X(m)) return null;
352
352
  throw m;
353
353
  }
354
354
  },
355
- brand: async (d, g) => {
355
+ brand: async (d, p) => {
356
356
  try {
357
357
  return await I(
358
358
  `${a}/api/catalog_system/pub/brand/by-linkid/${encodeURIComponent(d)}`,
359
- ue(g)
359
+ ue(p)
360
360
  );
361
361
  } catch (m) {
362
362
  if (X(m)) return null;
363
363
  throw m;
364
364
  }
365
365
  },
366
- collection: async (d, g) => {
366
+ collection: async (d, p) => {
367
367
  try {
368
368
  return await I(
369
369
  `${a}/api/catalog_system/pub/collection/by-linkid/${encodeURIComponent(d)}`,
370
- ue(g)
370
+ ue(p)
371
371
  );
372
372
  } catch (m) {
373
373
  if (X(m)) return null;
@@ -378,7 +378,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
378
378
  products: {
379
379
  crossselling: ({
380
380
  type: d,
381
- productId: g,
381
+ productId: p,
382
382
  groupByProduct: m = !0
383
383
  }) => {
384
384
  const y = new URLSearchParams({
@@ -386,7 +386,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
386
386
  groupByProduct: m.toString()
387
387
  });
388
388
  return I(
389
- `${a}/api/catalog_system/pub/products/crossselling/${d}/${g}?${y}`,
389
+ `${a}/api/catalog_system/pub/products/crossselling/${d}/${p}?${y}`,
390
390
  void 0,
391
391
  { storeCookies: o }
392
392
  );
@@ -394,9 +394,9 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
394
394
  }
395
395
  },
396
396
  checkout: {
397
- simulation: (d, { salesChannel: g } = i.storage.channel) => {
397
+ simulation: (d, { salesChannel: p } = i.storage.channel) => {
398
398
  const m = new URLSearchParams({
399
- sc: g
399
+ sc: p
400
400
  }), y = s({
401
401
  "content-type": "application/json",
402
402
  "X-FORWARDED-HOST": u
@@ -413,7 +413,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
413
413
  },
414
414
  shippingData: ({
415
415
  id: d,
416
- index: g,
416
+ index: p,
417
417
  deliveryMode: m,
418
418
  selectedAddresses: y
419
419
  }, O) => {
@@ -421,7 +421,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
421
421
  startDateUtc: m?.deliveryWindow?.startDate,
422
422
  endDateUtc: m?.deliveryWindow?.endDate
423
423
  } : null, C = {
424
- logisticsInfo: Array.from({ length: g }, (S, D) => ({
424
+ logisticsInfo: Array.from({ length: p }, (S, D) => ({
425
425
  itemIndex: D,
426
426
  selectedDeliveryChannel: m?.deliveryChannel || null,
427
427
  selectedSla: m?.deliveryMethod || null,
@@ -429,7 +429,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
429
429
  })),
430
430
  selectedAddresses: y,
431
431
  clearAddressIfPostalCodeNotFound: t
432
- }, P = s({
432
+ }, A = s({
433
433
  "content-type": "application/json",
434
434
  "X-FORWARDED-HOST": u
435
435
  });
@@ -437,7 +437,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
437
437
  `${a}/api/checkout/pub/orderForm/${d}/attachments/shippingData`,
438
438
  {
439
439
  ...j,
440
- headers: P,
440
+ headers: A,
441
441
  body: JSON.stringify(C)
442
442
  },
443
443
  { storeCookies: o }
@@ -445,7 +445,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
445
445
  },
446
446
  marketingData: ({
447
447
  id: d,
448
- marketingData: g
448
+ marketingData: p
449
449
  }) => {
450
450
  const m = s({
451
451
  "content-type": "application/json",
@@ -455,7 +455,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
455
455
  `${a}/api/checkout/pub/orderForm/${d}/attachments/marketingData`,
456
456
  {
457
457
  headers: m,
458
- body: JSON.stringify(g),
458
+ body: JSON.stringify(p),
459
459
  method: "POST"
460
460
  },
461
461
  { storeCookies: o }
@@ -463,7 +463,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
463
463
  },
464
464
  clientPreferencesData: ({
465
465
  id: d,
466
- clientPreferencesData: g
466
+ clientPreferencesData: p
467
467
  }) => {
468
468
  const m = s({
469
469
  "content-type": "application/json",
@@ -473,7 +473,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
473
473
  `${a}/api/checkout/pub/orderForm/${d}/attachments/clientPreferencesData`,
474
474
  {
475
475
  headers: m,
476
- body: JSON.stringify(g),
476
+ body: JSON.stringify(p),
477
477
  method: "POST"
478
478
  },
479
479
  { storeCookies: o }
@@ -481,14 +481,14 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
481
481
  },
482
482
  orderForm: ({
483
483
  id: d,
484
- refreshOutdatedData: g = !0,
484
+ refreshOutdatedData: p = !0,
485
485
  channel: m = i.storage.channel
486
486
  }) => {
487
487
  const { salesChannel: y } = m, O = s({
488
488
  "content-type": "application/json",
489
489
  "X-FORWARDED-HOST": u
490
490
  }), w = new URLSearchParams({ sc: y });
491
- d && w.set("refreshOutdatedData", g.toString());
491
+ d && w.set("refreshOutdatedData", p.toString());
492
492
  const C = `${a}/api/checkout/pub/orderForm${d ? `/${d}` : ""}?${w.toString()}`;
493
493
  return I(
494
494
  C,
@@ -501,7 +501,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
501
501
  );
502
502
  },
503
503
  clearOrderFormMessages: ({ id: d }) => {
504
- const g = s({
504
+ const p = s({
505
505
  "content-type": "application/json",
506
506
  "X-FORWARDED-HOST": u
507
507
  });
@@ -509,14 +509,14 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
509
509
  `${a}/api/checkout/pub/orderForm/${d}/messages/clear`,
510
510
  {
511
511
  ...j,
512
- headers: g,
512
+ headers: p,
513
513
  body: "{}"
514
514
  }
515
515
  );
516
516
  },
517
517
  updateOrderFormItems: ({
518
518
  id: d,
519
- orderItems: g,
519
+ orderItems: p,
520
520
  allowOutdatedData: m = "paymentData",
521
521
  salesChannel: y = i.storage.channel.salesChannel,
522
522
  shouldSplitItem: O = !0
@@ -533,7 +533,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
533
533
  {
534
534
  headers: C,
535
535
  body: JSON.stringify({
536
- orderItems: g,
536
+ orderItems: p,
537
537
  noSplitItem: !O
538
538
  }),
539
539
  method: "PATCH"
@@ -543,7 +543,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
543
543
  },
544
544
  setCustomData: ({
545
545
  id: d,
546
- appId: g,
546
+ appId: p,
547
547
  key: m,
548
548
  value: y
549
549
  }) => {
@@ -552,7 +552,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
552
552
  "X-FORWARDED-HOST": u
553
553
  });
554
554
  return I(
555
- `${a}/api/checkout/pub/orderForm/${d}/customData/${g}/${m}`,
555
+ `${a}/api/checkout/pub/orderForm/${d}/customData/${p}/${m}`,
556
556
  {
557
557
  headers: O,
558
558
  body: JSON.stringify({ value: y }),
@@ -562,7 +562,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
562
562
  },
563
563
  region: async ({
564
564
  postalCode: d,
565
- geoCoordinates: g,
565
+ geoCoordinates: p,
566
566
  country: m,
567
567
  salesChannel: y
568
568
  }) => {
@@ -572,7 +572,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
572
572
  });
573
573
  d ? O.append("postalCode", d) : O.append(
574
574
  "geoCoordinates",
575
- `${g?.longitude};${g?.latitude}`
575
+ `${p?.longitude};${p?.latitude}`
576
576
  );
577
577
  const w = `${a}/api/checkout/pub/regions/?${O.toString()}`, C = s({
578
578
  "content-type": "application/json",
@@ -588,14 +588,14 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
588
588
  },
589
589
  address: async ({
590
590
  postalCode: d,
591
- country: g
591
+ country: p
592
592
  }) => {
593
593
  const m = s({
594
594
  "content-type": "application/json",
595
595
  "X-FORWARDED-HOST": u
596
596
  });
597
597
  return I(
598
- `${a}/api/checkout/pub/postal-code/${g}/${d}`,
598
+ `${a}/api/checkout/pub/postal-code/${p}/${d}`,
599
599
  {
600
600
  headers: m
601
601
  },
@@ -604,7 +604,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
604
604
  },
605
605
  cancelOrder: ({
606
606
  orderId: d,
607
- customerEmail: g,
607
+ customerEmail: p,
608
608
  reason: m
609
609
  }) => {
610
610
  const y = s({
@@ -617,7 +617,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
617
617
  method: "POST",
618
618
  headers: y,
619
619
  body: JSON.stringify({
620
- customerEmail: g,
620
+ customerEmail: p,
621
621
  reason: m
622
622
  })
623
623
  },
@@ -631,7 +631,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
631
631
  throw new Error(
632
632
  "Missing required parameter for listing pickup points."
633
633
  );
634
- const g = s({
634
+ const p = s({
635
635
  "content-type": "application/json",
636
636
  "X-FORWARDED-HOST": u
637
637
  });
@@ -639,7 +639,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
639
639
  `${a}/api/logistics-shipping/pickuppoints/_search`,
640
640
  {
641
641
  method: "POST",
642
- headers: g,
642
+ headers: p,
643
643
  body: JSON.stringify({ coordinate: d })
644
644
  },
645
645
  { storeCookies: o }
@@ -647,8 +647,8 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
647
647
  }
648
648
  },
649
649
  session: (d) => {
650
- const g = new URLSearchParams(d);
651
- g.set(
650
+ const p = new URLSearchParams(d);
651
+ p.set(
652
652
  "items",
653
653
  "profile.id,profile.email,profile.firstName,profile.lastName,profile.phone,shopper.firstName,shopper.lastName,shopper.organizationManager,shopper.availableContracts,shopper.activeContractId,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol,authentication.customerId,authentication.storeUserId,authentication.storeUserEmail,authentication.unitId,authentication.unitName,checkout.regionId,public.postalCode"
654
654
  );
@@ -656,7 +656,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
656
656
  "content-type": "application/json"
657
657
  }), y = Z(i?.headers?.cookie ?? "")?.vtex_session;
658
658
  return I(
659
- `${a}/api/sessions?${g.toString()}`,
659
+ `${a}/api/sessions?${p.toString()}`,
660
660
  {
661
661
  method: y ? "PATCH" : "POST",
662
662
  headers: m,
@@ -676,20 +676,20 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
676
676
  ),
677
677
  profile: {
678
678
  addresses: async (d) => {
679
- const g = s({
679
+ const p = s({
680
680
  "content-type": "application/json",
681
681
  "X-FORWARDED-HOST": u
682
682
  });
683
683
  return I(
684
684
  `${a}/api/profile-system/pvt/profiles/${d}/addresses`,
685
- { headers: g },
685
+ { headers: p },
686
686
  { storeCookies: o }
687
687
  );
688
688
  }
689
689
  },
690
690
  oms: {
691
691
  userOrder: ({ orderId: d }) => {
692
- const g = s({
692
+ const p = s({
693
693
  "content-type": "application/json",
694
694
  "X-FORWARDED-HOST": u
695
695
  });
@@ -697,44 +697,44 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
697
697
  `${a}/api/oms/user/orders/${d}`,
698
698
  {
699
699
  method: "GET",
700
- headers: g
700
+ headers: p
701
701
  },
702
702
  { storeCookies: o }
703
703
  );
704
704
  },
705
705
  listUserOrders: ({
706
706
  page: d,
707
- status: g,
707
+ status: p,
708
708
  dateInitial: m,
709
709
  dateFinal: y,
710
710
  text: O,
711
711
  clientEmail: w,
712
712
  perPage: C,
713
- pendingMyApproval: P
713
+ pendingMyApproval: A
714
714
  }) => {
715
715
  const S = new URLSearchParams();
716
716
  if (m) {
717
- const A = new Date(m).setHours(
717
+ const P = new Date(m).setHours(
718
718
  0,
719
719
  0,
720
720
  0,
721
721
  0
722
722
  );
723
- m = new Date(A).toISOString();
723
+ m = new Date(P).toISOString();
724
724
  }
725
725
  if (y) {
726
- const A = new Date(y).setHours(
726
+ const P = new Date(y).setHours(
727
727
  23,
728
728
  59,
729
729
  59,
730
730
  999
731
731
  );
732
- y = new Date(A).toISOString();
732
+ y = new Date(P).toISOString();
733
733
  }
734
- O && S.append("text", O), g && g.length > 0 && S.append("status", g.filter(Boolean).join(",")), m && y ? S.append(
734
+ O && S.append("text", O), p && p.length > 0 && S.append("status", p.filter(Boolean).join(",")), m && y ? S.append(
735
735
  "creation_date",
736
736
  `creationDate:[${m} TO ${y}]`
737
- ) : m ? S.append("creation_date", `creationDate:[${m} TO *]`) : y && S.append("creation_date", `creationDate:[* TO ${y}]`), w && S.append("clientEmail", w), d && S.append("page", d.toString()), C && S.append("per_page", C.toString()), P && S.append("my_pending_approvals", String(!0));
737
+ ) : m ? S.append("creation_date", `creationDate:[${m} TO *]`) : y && S.append("creation_date", `creationDate:[* TO ${y}]`), w && S.append("clientEmail", w), d && S.append("page", d.toString()), C && S.append("per_page", C.toString()), A && S.append("my_pending_approvals", String(!0));
738
738
  const D = s({
739
739
  "content-type": "application/json",
740
740
  "X-FORWARDED-HOST": u
@@ -751,7 +751,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
751
751
  getCommercialAuthorizationsByOrderId: ({
752
752
  orderId: d
753
753
  }) => {
754
- const g = s({
754
+ const p = s({
755
755
  "content-type": "application/json",
756
756
  "X-FORWARDED-HOST": u
757
757
  });
@@ -759,24 +759,24 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
759
759
  `${a}/${e}/commercial-authorizations/order/${d}`,
760
760
  {
761
761
  method: "GET",
762
- headers: g
762
+ headers: p
763
763
  },
764
764
  { storeCookies: o }
765
765
  );
766
766
  },
767
767
  processOrderAuthorization: async ({
768
768
  orderAuthorizationId: d,
769
- dimensionId: g,
769
+ dimensionId: p,
770
770
  ruleId: m,
771
771
  approved: y
772
772
  }) => {
773
773
  const O = s({
774
774
  "content-type": "application/json",
775
775
  "X-FORWARDED-HOST": u
776
- }), P = {
776
+ }), A = {
777
777
  params: {
778
778
  ruleId: m,
779
- dimensionId: g,
779
+ dimensionId: p,
780
780
  score: y ? 100 : 0
781
781
  }
782
782
  };
@@ -785,7 +785,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
785
785
  {
786
786
  method: "POST",
787
787
  headers: O,
788
- body: JSON.stringify(P)
788
+ body: JSON.stringify(A)
789
789
  },
790
790
  { storeCookies: o }
791
791
  );
@@ -795,7 +795,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
795
795
  getUnitByUserId: ({
796
796
  userId: d
797
797
  }) => {
798
- const g = s({
798
+ const p = s({
799
799
  "content-type": "application/json",
800
800
  "X-FORWARDED-HOST": u
801
801
  });
@@ -803,7 +803,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
803
803
  `${a}/api/units/v1/${d}/unit`,
804
804
  {
805
805
  method: "GET",
806
- headers: g
806
+ headers: p
807
807
  },
808
808
  {}
809
809
  );
@@ -811,7 +811,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
811
811
  getOrgUnitById: ({
812
812
  orgUnitId: d
813
813
  }) => {
814
- const g = s({
814
+ const p = s({
815
815
  "content-type": "application/json",
816
816
  "X-FORWARDED-HOST": u
817
817
  });
@@ -819,7 +819,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
819
819
  `${a}/api/units/v1/${d}`,
820
820
  {
821
821
  method: "GET",
822
- headers: g
822
+ headers: p
823
823
  },
824
824
  {}
825
825
  );
@@ -827,7 +827,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
827
827
  getScopesByOrgUnit: ({
828
828
  orgUnitId: d
829
829
  }) => {
830
- const g = s({
830
+ const p = s({
831
831
  "content-type": "application/json",
832
832
  "X-FORWARDED-HOST": u
833
833
  });
@@ -835,7 +835,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
835
835
  `${a}/api/units/v1/${d}/scopes`,
836
836
  {
837
837
  method: "GET",
838
- headers: g
838
+ headers: p
839
839
  },
840
840
  {}
841
841
  );
@@ -845,7 +845,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
845
845
  getUserById: ({
846
846
  userId: d
847
847
  }) => {
848
- const g = s({
848
+ const p = s({
849
849
  "content-type": "application/json",
850
850
  "X-FORWARDED-HOST": u
851
851
  });
@@ -853,7 +853,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
853
853
  `${a}/api/license-manager/users/${d}`,
854
854
  {
855
855
  method: "GET",
856
- headers: g
856
+ headers: p
857
857
  },
858
858
  {}
859
859
  );
@@ -861,7 +861,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
861
861
  getUserByEmail: ({
862
862
  email: d
863
863
  }) => {
864
- const g = s({
864
+ const p = s({
865
865
  "content-type": "application/json",
866
866
  "X-FORWARDED-HOST": u
867
867
  });
@@ -869,7 +869,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
869
869
  `${a}/api/license-manager/pvt/users/${d}`,
870
870
  {
871
871
  method: "GET",
872
- headers: g
872
+ headers: p
873
873
  },
874
874
  {}
875
875
  );
@@ -877,7 +877,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
877
877
  getUserRoles: ({
878
878
  userId: d
879
879
  }) => {
880
- const g = s({
880
+ const p = s({
881
881
  "content-type": "application/json",
882
882
  "X-FORWARDED-HOST": u
883
883
  });
@@ -885,7 +885,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
885
885
  `${a}/api/license-manager/storefront/users/${d}/roles`,
886
886
  {
887
887
  method: "GET",
888
- headers: g
888
+ headers: p
889
889
  },
890
890
  {}
891
891
  );
@@ -896,8 +896,8 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
896
896
  contractId: d
897
897
  }) => {
898
898
  if (!d)
899
- throw new T("Missing contractId to fetch CL fields.");
900
- const g = v({
899
+ throw new _("Missing contractId to fetch CL fields.");
900
+ const p = v({
901
901
  Accept: "application/json",
902
902
  "content-type": "application/json"
903
903
  });
@@ -905,7 +905,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
905
905
  `${a}/api/dataentities/CL/documents/${d}?_fields=_all`,
906
906
  {
907
907
  method: "GET",
908
- headers: g
908
+ headers: p
909
909
  },
910
910
  {}
911
911
  );
@@ -914,8 +914,8 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
914
914
  userId: d
915
915
  }) => {
916
916
  if (!d)
917
- throw new T("Missing userId to fetch shopper name.");
918
- const g = c({
917
+ throw new _("Missing userId to fetch shopper name.");
918
+ const p = c({
919
919
  Accept: "application/json",
920
920
  "content-type": "application/json",
921
921
  "X-FORWARDED-HOST": u
@@ -924,7 +924,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
924
924
  `${a}/api/dataentities/shopper/search?_where=(userId=${m} OR userId=${d})&_fields=_all&_schema=v1`,
925
925
  {
926
926
  method: "GET",
927
- headers: g
927
+ headers: p
928
928
  },
929
929
  {}
930
930
  );
@@ -932,13 +932,13 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
932
932
  },
933
933
  quotes: {
934
934
  listUserQuotes: (d) => {
935
- dt(d);
936
- const g = ut(d), m = s({
935
+ ut(d);
936
+ const p = pt(d), m = s({
937
937
  "content-type": "application/json",
938
938
  "X-FORWARDED-HOST": u
939
939
  });
940
940
  return I(
941
- `${a}/api/quoting/quotes?${g.toString()}`,
941
+ `${a}/api/quoting/quotes?${p.toString()}`,
942
942
  {
943
943
  method: "GET",
944
944
  headers: m
@@ -952,12 +952,12 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
952
952
  const d = s({
953
953
  "content-type": "application/json",
954
954
  "X-FORWARDED-HOST": u
955
- }), g = z(me(i) ?? "", e);
955
+ }), p = z(me(i) ?? "", e);
956
956
  return I(
957
957
  `${a}/api/vtexid/credential/validate`,
958
958
  {
959
959
  headers: d,
960
- body: JSON.stringify({ token: g }),
960
+ body: JSON.stringify({ token: p }),
961
961
  method: "POST"
962
962
  },
963
963
  { storeCookies: o }
@@ -967,24 +967,24 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
967
967
  orderEntry: {
968
968
  uploadFile: ({
969
969
  fileBuffer: d,
970
- fileName: g,
970
+ fileName: p,
971
971
  mimeType: m
972
972
  }) => {
973
973
  const y = s({
974
974
  "content-type": "application/json",
975
975
  "X-FORWARDED-HOST": u
976
976
  }), O = `----FastStoreUploadBoundary${Date.now()}`, w = `\r
977
- `, P = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", S = g.replaceAll(/[\r\n"]/g, "_"), D = [
977
+ `, A = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", S = p.replaceAll(/[\r\n"]/g, "_"), D = [
978
978
  `--${O}`,
979
979
  `Content-Disposition: form-data; name="file"; filename="${S}"`,
980
- `Content-Type: ${P}`,
980
+ `Content-Type: ${A}`,
981
981
  "",
982
982
  ""
983
- ].join(w), A = `${w}--${O}--${w}`, U = Buffer.from(D), b = Buffer.from(A), k = new Uint8Array(
984
- U.byteLength + d.byteLength + b.byteLength
983
+ ].join(w), P = `${w}--${O}--${w}`, k = Buffer.from(D), b = Buffer.from(P), U = new Uint8Array(
984
+ k.byteLength + d.byteLength + b.byteLength
985
985
  );
986
- let _ = 0;
987
- return k.set(U, _), _ += U.byteLength, k.set(d, _), _ += d.byteLength, k.set(b, _), I(
986
+ let T = 0;
987
+ return U.set(k, T), T += k.byteLength, U.set(d, T), T += d.byteLength, U.set(b, T), I(
988
988
  `${a}/api/order-entry/upload?an=${e}`,
989
989
  {
990
990
  method: "POST",
@@ -992,14 +992,14 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
992
992
  ...y,
993
993
  "content-type": `multipart/form-data; boundary=${O}`
994
994
  },
995
- body: k.buffer
995
+ body: U.buffer
996
996
  },
997
997
  {}
998
998
  );
999
999
  },
1000
1000
  startOperation: ({
1001
1001
  objectKey: d,
1002
- orderFormId: g,
1002
+ orderFormId: p,
1003
1003
  sessionToken: m
1004
1004
  }) => {
1005
1005
  const y = s({
@@ -1007,7 +1007,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1007
1007
  "X-FORWARDED-HOST": u
1008
1008
  }), O = JSON.stringify({
1009
1009
  objectKey: d,
1010
- orderFormId: g,
1010
+ orderFormId: p,
1011
1011
  operation: "CreateCart",
1012
1012
  ...m ? { sessionToken: m } : {}
1013
1013
  });
@@ -1024,7 +1024,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1024
1024
  getOperation: ({
1025
1025
  operationId: d
1026
1026
  }) => {
1027
- const g = s({
1027
+ const p = s({
1028
1028
  "content-type": "application/json",
1029
1029
  "X-FORWARDED-HOST": u
1030
1030
  });
@@ -1032,7 +1032,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1032
1032
  `${a}/api/order-entry/operation/${d}?an=${e}`,
1033
1033
  {
1034
1034
  method: "GET",
1035
- headers: g
1035
+ headers: p
1036
1036
  },
1037
1037
  {}
1038
1038
  );
@@ -1055,7 +1055,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1055
1055
  getOrderFormItems: ({
1056
1056
  orderFormId: d
1057
1057
  }) => {
1058
- const g = s({
1058
+ const p = s({
1059
1059
  "content-type": "application/json",
1060
1060
  "X-FORWARDED-HOST": u
1061
1061
  });
@@ -1063,7 +1063,7 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1063
1063
  `${a}/api/checkout/pub/orderForm/${d}`,
1064
1064
  {
1065
1065
  method: "GET",
1066
- headers: g
1066
+ headers: p
1067
1067
  },
1068
1068
  {}
1069
1069
  );
@@ -1076,13 +1076,13 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1076
1076
  recommendation: {
1077
1077
  recommendations: ({
1078
1078
  campaignVrn: d,
1079
- userId: g,
1079
+ userId: p,
1080
1080
  products: m = [],
1081
1081
  salesChannel: y,
1082
1082
  locale: O
1083
1083
  }) => {
1084
1084
  const w = new URLSearchParams({ an: e, campaignVrn: d });
1085
- return g && w.append("userId", g), m.length > 0 && w.append("products", m.join(",")), y && w.append("salesChannel", y), O && w.append("locale", O), I(
1085
+ return p && w.append("userId", p), m.length > 0 && w.append("products", m.join(",")), y && w.append("salesChannel", y), O && w.append("locale", O), I(
1086
1086
  `${h}/recommendations?${w.toString()}`,
1087
1087
  { headers: f },
1088
1088
  { storeCookies: o }
@@ -1098,23 +1098,23 @@ const pt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1098
1098
  }
1099
1099
  }
1100
1100
  };
1101
- }, K = (e) => e.discoveryConfig?.localization ?? {}, Q = (e) => K(e).enabled === !0, gt = (e) => Object.keys(K(e).locales ?? {}), mt = (e) => K(e).defaultLocale, re = (e) => Q(e) && e.storage.locale || void 0, he = "fuzzy", fe = "operator", Se = "pickupPoint", Te = "shipping", Ee = "delivery-options", ht = "in-stock", ft = "trade-policy", St = "region-id", yt = /* @__PURE__ */ new Set([
1102
- ft,
1101
+ }, K = (e) => e.discoveryConfig?.localization ?? {}, Q = (e) => K(e).enabled === !0, mt = (e) => Object.keys(K(e).locales ?? {}), ht = (e) => K(e).defaultLocale, re = (e) => Q(e) && e.storage.locale || void 0, he = "fuzzy", fe = "operator", Se = "pickupPoint", _e = "shipping", Ee = "delivery-options", ft = "in-stock", St = "trade-policy", yt = "region-id", It = /* @__PURE__ */ new Set([
1103
1102
  St,
1103
+ yt,
1104
1104
  he,
1105
1105
  fe,
1106
1106
  Se
1107
- ]), It = /* @__PURE__ */ new Set([
1107
+ ]), vt = /* @__PURE__ */ new Set([
1108
1108
  "zip-code",
1109
1109
  "pickupPoint",
1110
1110
  "country",
1111
1111
  "coordinates",
1112
1112
  "deliveryZonesHash",
1113
1113
  "pickupPointsHash"
1114
- ]), vt = /* @__PURE__ */ new Set(["productClusterIds"]), Re = (e) => encodeURI(decodeURI(e)), Ot = (e) => encodeURIComponent(
1114
+ ]), Ot = /* @__PURE__ */ new Set(["productClusterIds"]), Re = (e) => encodeURI(decodeURI(e)), Ct = (e) => encodeURIComponent(
1115
1115
  decodeURIComponent(e).normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "")
1116
- ), Ct = /^pickup-in-point-(.+)$/;
1117
- function on(e) {
1116
+ ), bt = /^pickup-in-point-(.+)$/;
1117
+ function sn(e) {
1118
1118
  if (!e)
1119
1119
  return {};
1120
1120
  try {
@@ -1127,18 +1127,18 @@ function on(e) {
1127
1127
  return {};
1128
1128
  }
1129
1129
  }
1130
- function bt(e) {
1130
+ function wt(e) {
1131
1131
  const n = {}, t = {}, r = [];
1132
1132
  for (const i of e.split(";")) {
1133
1133
  const a = i.indexOf("=");
1134
1134
  if (a < 0) continue;
1135
1135
  const o = i.slice(0, a), s = i.slice(a + 1);
1136
- !o || !s || (It.has(o) ? n[o] = s : vt.has(o) ? t[o] = s : r.push({ key: o, value: s }));
1136
+ !o || !s || (vt.has(o) ? n[o] = s : Ot.has(o) ? t[o] = s : r.push({ key: o, value: s }));
1137
1137
  }
1138
1138
  return { shipping: n, queryParams: t, extraFacets: r };
1139
1139
  }
1140
- function wt(e) {
1141
- const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, queryParams: r, extraFacets: i } = bt(n);
1140
+ function Dt(e) {
1141
+ const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, queryParams: r, extraFacets: i } = wt(n);
1142
1142
  return {
1143
1143
  segmentParams: {
1144
1144
  sc: e.channel,
@@ -1160,7 +1160,7 @@ function wt(e) {
1160
1160
  extraFacets: i
1161
1161
  };
1162
1162
  }
1163
- function sn(e, n) {
1163
+ function cn(e, n) {
1164
1164
  const t = [
1165
1165
  ["sc", n.sc],
1166
1166
  ["regionId", n.regionId],
@@ -1181,11 +1181,11 @@ function sn(e, n) {
1181
1181
  for (const [r, i] of t)
1182
1182
  i != null && i !== "" && e.append(r, String(i));
1183
1183
  }
1184
- function cn(e) {
1185
- return Ct.exec(e)?.[1];
1184
+ function ln(e) {
1185
+ return bt.exec(e)?.[1];
1186
1186
  }
1187
- function Dt(e) {
1188
- const n = e.find((r) => r.key === "shipping"), t = n ? cn(n.value) : void 0;
1187
+ function Pt(e) {
1188
+ const n = e.find((r) => r.key === "shipping"), t = n ? ln(n.value) : void 0;
1189
1189
  if (t !== void 0)
1190
1190
  try {
1191
1191
  return decodeURIComponent(t);
@@ -1194,7 +1194,7 @@ function Dt(e) {
1194
1194
  }
1195
1195
  }
1196
1196
  function At(e, n) {
1197
- const t = Dt(
1197
+ const t = Pt(
1198
1198
  n
1199
1199
  );
1200
1200
  return t === void 0 ? e : {
@@ -1202,25 +1202,25 @@ function At(e, n) {
1202
1202
  pickupPoint: t
1203
1203
  };
1204
1204
  }
1205
- function Pt(e) {
1206
- return e.map((n) => n.key !== "shipping" || cn(n.value) === void 0 ? n : { ...n, value: "pickup-in-point" });
1205
+ function kt(e) {
1206
+ return e.map((n) => n.key !== "shipping" || ln(n.value) === void 0 ? n : { ...n, value: "pickup-in-point" });
1207
1207
  }
1208
1208
  function Ut(e, n) {
1209
1209
  let t = [...e];
1210
1210
  const r = t.some((i) => i.key === "shipping");
1211
1211
  for (const i of n)
1212
1212
  (!r || i.key !== "shipping") && t.push(i);
1213
- return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")), Pt(t);
1213
+ return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")), kt(t);
1214
1214
  }
1215
- function kt(e) {
1215
+ function Tt(e) {
1216
1216
  return e.reduce((n, t) => {
1217
1217
  let { key: r, value: i } = t;
1218
- return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Re(r)}/${Ot(Re(i)).replaceAll(/ |%20/g, "-")}/`;
1218
+ return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Re(r)}/${Ct(Re(i)).replaceAll(/ |%20/g, "-")}/`;
1219
1219
  }, "");
1220
1220
  }
1221
- const _t = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), Tt = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
1222
- function Et(e, n) {
1223
- const { segmentParams: t, extraFacets: r } = wt(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
1221
+ const _t = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), Et = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
1222
+ function Rt(e, n) {
1223
+ const { segmentParams: t, extraFacets: r } = Dt(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
1224
1224
  return {
1225
1225
  segmentParams: {
1226
1226
  ...t,
@@ -1231,21 +1231,21 @@ function Et(e, n) {
1231
1231
  extraFacets: r
1232
1232
  };
1233
1233
  }
1234
- function Rt(e, n) {
1235
- const t = e.filter(({ key: c }) => !yt.has(c)), r = e.find(
1236
- ({ key: c, value: l }) => c === Te && l !== "all-delivery-methods"
1234
+ function Ft(e, n) {
1235
+ const t = e.filter(({ key: c }) => !It.has(c)), r = e.find(
1236
+ ({ key: c, value: l }) => c === _e && l !== "all-delivery-methods"
1237
1237
  ) ?? null, i = e.find(
1238
1238
  ({ key: c, value: l }) => c === Ee && l !== "all-delivery-options"
1239
1239
  ) ?? null, a = [...t], o = a.some(
1240
- ({ key: c }) => c === Te
1240
+ ({ key: c }) => c === _e
1241
1241
  ), s = a.some(
1242
1242
  ({ key: c }) => c === Ee
1243
1243
  );
1244
1244
  return r !== null && !o && a.push(r), i !== null && !s && a.push(i), Ut(a, n);
1245
1245
  }
1246
- function Ft(e, n) {
1246
+ function Nt(e, n) {
1247
1247
  const t = e.find(({ key: a }) => a === he) ?? null, r = e.find(({ key: a }) => a === fe) ?? null, i = e.find(({ key: a }) => a === Se) ?? null;
1248
- t && _t(t) && n.append(he, t.value), r && Tt(r) && n.append(fe, r.value), i && n.append(Se, i.value);
1248
+ t && _t(t) && n.append(he, t.value), r && Et(r) && n.append(fe, r.value), i && n.append(Se, i.value);
1249
1249
  }
1250
1250
  function Fe(e, n, t, r) {
1251
1251
  const {
@@ -1255,35 +1255,35 @@ function Fe(e, n, t, r) {
1255
1255
  sort: s,
1256
1256
  selectedFacets: c = [],
1257
1257
  showInvisibleItems: l,
1258
- sponsoredCount: p,
1258
+ sponsoredCount: g,
1259
1259
  hideUnavailableItems: u,
1260
1260
  allowRedirect: h = !1
1261
1261
  } = e, f = new URLSearchParams();
1262
1262
  if (r.includePagination && a !== void 0 && o !== void 0) {
1263
- const g = a * o, m = o === 0 ? g : g + o - 1;
1264
- f.append("from", g.toString()), f.append("to", m.toString());
1263
+ const p = a * o, m = o === 0 ? p : p + o - 1;
1264
+ f.append("from", p.toString()), f.append("to", m.toString());
1265
1265
  }
1266
1266
  i && f.append("query", i), r.includeSort && s && f.append("sort", s);
1267
1267
  const v = At(
1268
1268
  t.segmentParams,
1269
1269
  c
1270
1270
  );
1271
- if (sn(f, v ?? t.segmentParams), Ft(c, f), l && f.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
1272
- const g = c.find(({ key: y }) => y === ht), m = g ? g.value : u?.toString() ?? n.hideUnavailableItems.toString();
1271
+ if (cn(f, v ?? t.segmentParams), Nt(c, f), l && f.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
1272
+ const p = c.find(({ key: y }) => y === ft), m = p ? p.value : u?.toString() ?? n.hideUnavailableItems.toString();
1273
1273
  f.append("hideUnavailableItems", m);
1274
1274
  }
1275
- n?.simulationBehavior !== void 0 && f.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && f.append("showSponsored", n.showSponsored.toString()), p !== void 0 && f.append("sponsoredCount", p.toString()), h !== void 0 && f.append("allowRedirect", h.toString());
1276
- const d = kt(
1277
- Rt(c, t.extraFacets)
1275
+ n?.simulationBehavior !== void 0 && f.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && f.append("showSponsored", n.showSponsored.toString()), g !== void 0 && f.append("sponsoredCount", g.toString()), h !== void 0 && f.append("allowRedirect", h.toString());
1276
+ const d = Tt(
1277
+ Ft(c, t.extraFacets)
1278
1278
  );
1279
1279
  return { params: f, path: d };
1280
1280
  }
1281
- function Nt(e, n) {
1281
+ function Lt(e, n) {
1282
1282
  const { field: t, value: r, hideUnavailableItems: i, showInvisibleItems: a } = e, o = new URLSearchParams({
1283
1283
  field: t ?? "",
1284
1284
  value: r ?? ""
1285
1285
  });
1286
- return sn(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
1286
+ return cn(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
1287
1287
  }
1288
1288
  function W(e, n) {
1289
1289
  return {
@@ -1296,7 +1296,7 @@ function W(e, n) {
1296
1296
  };
1297
1297
  }
1298
1298
  function G(e) {
1299
- const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = Et(t, r);
1299
+ const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = Rt(t, r);
1300
1300
  switch (n) {
1301
1301
  case "product-search":
1302
1302
  case "facets": {
@@ -1318,7 +1318,7 @@ function G(e) {
1318
1318
  return W(s, o);
1319
1319
  }
1320
1320
  case "products": {
1321
- const o = Nt(i, a.segmentParams);
1321
+ const o = Lt(i, a.segmentParams);
1322
1322
  return W("", o);
1323
1323
  }
1324
1324
  case "search-suggestions": {
@@ -1340,16 +1340,16 @@ function G(e) {
1340
1340
  }
1341
1341
  }
1342
1342
  }
1343
- const Lt = 10;
1344
- function Bt(e) {
1343
+ const Bt = 10;
1344
+ function $t(e) {
1345
1345
  const { regionId: n, seller: t } = e.storage.channel;
1346
1346
  return (t ? Buffer.from(`SW#${t}`).toString("base64") : void 0) ?? (n || void 0);
1347
1347
  }
1348
- function $t(e) {
1349
- const t = on(e.headers?.cookie).cultureInfo || "";
1348
+ function Mt(e) {
1349
+ const t = sn(e.headers?.cookie).cultureInfo || "";
1350
1350
  return Q(e) ? e.storage.locale || t : t || e.storage.locale || "";
1351
1351
  }
1352
- const Mt = ({
1352
+ const zt = ({
1353
1353
  account: e,
1354
1354
  environment: n,
1355
1355
  hideUnavailableItems: t,
@@ -1357,10 +1357,10 @@ const Mt = ({
1357
1357
  showSponsored: i,
1358
1358
  subDomainPrefix: a
1359
1359
  }, o) => {
1360
- const s = `https://${e}.${n}.com.br`, c = an(o), l = on(o.headers?.cookie), p = () => ({
1360
+ const s = `https://${e}.${n}.com.br`, c = on(o), l = sn(o.headers?.cookie), g = () => ({
1361
1361
  salesChannel: o.storage.channel.salesChannel,
1362
- regionId: Bt(o),
1363
- locale: $t(o),
1362
+ regionId: $t(o),
1363
+ locale: Mt(o),
1364
1364
  hideUnavailableItems: t,
1365
1365
  simulationBehavior: r,
1366
1366
  showSponsored: i
@@ -1368,31 +1368,31 @@ const Mt = ({
1368
1368
  "content-type": "application/json",
1369
1369
  "X-FORWARDED-HOST": f
1370
1370
  }), d = ({ type: S, ...D }) => {
1371
- const A = S === "facets" ? "facets" : "product-search", U = G({
1372
- endpoint: A,
1371
+ const P = S === "facets" ? "facets" : "product-search", k = G({
1372
+ endpoint: P,
1373
1373
  segment: l,
1374
- defaults: p(),
1374
+ defaults: g(),
1375
1375
  args: D
1376
1376
  });
1377
1377
  return I(
1378
- `${s}/api/intelligent-search/v1/${A}/${U.path}?${U.params.toString()}`,
1378
+ `${s}/api/intelligent-search/v1/${P}/${k.path}?${k.params.toString()}`,
1379
1379
  { headers: v }
1380
1380
  );
1381
- }, g = (S) => d({ ...S, type: "product_search" }), m = ({
1381
+ }, p = (S) => d({ ...S, type: "product_search" }), m = ({
1382
1382
  field: S,
1383
1383
  value: D,
1384
- hideUnavailableItems: A,
1385
- showInvisibleItems: U
1384
+ hideUnavailableItems: P,
1385
+ showInvisibleItems: k
1386
1386
  }) => {
1387
1387
  const b = G({
1388
1388
  endpoint: "products",
1389
1389
  segment: l,
1390
- defaults: p(),
1390
+ defaults: g(),
1391
1391
  args: {
1392
1392
  field: S,
1393
1393
  value: D,
1394
- hideUnavailableItems: A,
1395
- showInvisibleItems: U
1394
+ hideUnavailableItems: P,
1395
+ showInvisibleItems: k
1396
1396
  }
1397
1397
  });
1398
1398
  return I(
@@ -1402,24 +1402,24 @@ const Mt = ({
1402
1402
  };
1403
1403
  return {
1404
1404
  facets: (S) => d({ ...S, type: "facets" }),
1405
- products: g,
1405
+ products: p,
1406
1406
  fetchProduct: m,
1407
1407
  productsByIdentifier: async ({
1408
1408
  field: S,
1409
1409
  values: D,
1410
- showInvisibleItems: A,
1411
- hideUnavailableItems: U
1410
+ showInvisibleItems: P,
1411
+ hideUnavailableItems: k
1412
1412
  }) => {
1413
- const b = Ae(Lt);
1413
+ const b = Pe(Bt);
1414
1414
  return (await Promise.all(
1415
1415
  D.map(
1416
- (_) => b(async () => {
1416
+ (T) => b(async () => {
1417
1417
  try {
1418
1418
  return await m({
1419
1419
  field: S,
1420
- value: _,
1421
- hideUnavailableItems: U,
1422
- showInvisibleItems: A
1420
+ value: T,
1421
+ hideUnavailableItems: k,
1422
+ showInvisibleItems: P
1423
1423
  });
1424
1424
  } catch {
1425
1425
  return null;
@@ -1427,14 +1427,14 @@ const Mt = ({
1427
1427
  })
1428
1428
  )
1429
1429
  )).filter(
1430
- (_) => _ !== null
1430
+ (T) => T !== null
1431
1431
  );
1432
1432
  },
1433
1433
  suggestedTerms: (S) => {
1434
1434
  const D = G({
1435
1435
  endpoint: "search-suggestions",
1436
1436
  segment: l,
1437
- defaults: p(),
1437
+ defaults: g(),
1438
1438
  args: { query: S.query }
1439
1439
  });
1440
1440
  return I(
@@ -1446,7 +1446,7 @@ const Mt = ({
1446
1446
  const S = G({
1447
1447
  endpoint: "top-searches",
1448
1448
  segment: l,
1449
- defaults: p()
1449
+ defaults: g()
1450
1450
  });
1451
1451
  return I(
1452
1452
  `${s}/api/intelligent-search/v1/top-searches?${S.params.toString()}`,
@@ -1457,7 +1457,7 @@ const Mt = ({
1457
1457
  const D = G({
1458
1458
  endpoint: "catalog-count",
1459
1459
  segment: l,
1460
- defaults: p(),
1460
+ defaults: g(),
1461
1461
  args: S
1462
1462
  });
1463
1463
  return I(
@@ -1466,15 +1466,15 @@ const Mt = ({
1466
1466
  );
1467
1467
  }
1468
1468
  };
1469
- }, zt = (e, n) => {
1470
- const t = Mt(e, n), r = pt(e, n), i = et(e);
1469
+ }, Vt = (e, n) => {
1470
+ const t = zt(e, n), r = gt(e, n), i = nt(e);
1471
1471
  return {
1472
1472
  search: t,
1473
1473
  commerce: r,
1474
1474
  catalog: i
1475
1475
  };
1476
- }, Vt = 20, xt = (e) => e.entityType === "category", ye = (e) => e.entityType === "brand", Ne = (e) => e.entityType === "collection", qt = (e, n) => {
1477
- const t = Ae(Vt), r = async (i) => Promise.all(
1476
+ }, xt = 20, qt = (e) => e.entityType === "category", ye = (e) => e.entityType === "brand", Ne = (e) => e.entityType === "collection", jt = (e, n) => {
1477
+ const t = Pe(xt), r = async (i) => Promise.all(
1478
1478
  i.map(
1479
1479
  (a) => t(async () => {
1480
1480
  const o = a.slug.toLowerCase(), s = a.locale, c = await n.commerce.catalog.byLinkId.category(
@@ -1493,12 +1493,12 @@ const Mt = ({
1493
1493
  );
1494
1494
  if (l)
1495
1495
  return { ...l, entityType: "brand" };
1496
- const p = await n.commerce.catalog.byLinkId.collection(
1496
+ const g = await n.commerce.catalog.byLinkId.collection(
1497
1497
  o,
1498
1498
  s
1499
1499
  );
1500
- if (p)
1501
- return { ...p, entityType: "collection" };
1500
+ if (g)
1501
+ return { ...g, entityType: "collection" };
1502
1502
  throw new $(
1503
1503
  `No catalog entity found for slug: ${a.slug}. Cascade exhausted (category → brand → collection).`
1504
1504
  );
@@ -1512,11 +1512,11 @@ const Mt = ({
1512
1512
  // entry while same-slug / different-locale loads stay isolated.
1513
1513
  cacheKeyFn: ({ slug: i, locale: a }) => `${i.toLowerCase()}::${a ?? ""}`
1514
1514
  });
1515
- }, jt = (e, n) => {
1515
+ }, Wt = (e, n) => {
1516
1516
  const t = async (r) => Promise.all(r.map((i) => n.commerce.catalog.salesChannel(i)));
1517
1517
  return new le(t);
1518
- }, Wt = 1, Gt = (e, n) => {
1519
- const t = Ae(Wt), r = async (a) => {
1518
+ }, Gt = 1, Ht = (e, n) => {
1519
+ const t = Pe(Gt), r = async (a) => {
1520
1520
  const o = a.reduce((u, { items: h }) => [...u, h], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
1521
1521
  country: a[0].country,
1522
1522
  postalCode: a[0].postalCode,
@@ -1527,32 +1527,32 @@ const Mt = ({
1527
1527
  return typeof f == "number" && f < u.length && (u[f] = h), u;
1528
1528
  },
1529
1529
  Array(s.length).fill(null)
1530
- ), p = o.reduce(
1530
+ ), g = o.reduce(
1531
1531
  (u, h) => [...u, h.length + u[u.length - 1]],
1532
1532
  [0]
1533
1533
  );
1534
1534
  return o.map((u, h) => ({
1535
1535
  ...c,
1536
- items: l.slice(p[h], p[h + 1]).filter((f) => !!f)
1536
+ items: l.slice(g[h], g[h + 1]).filter((f) => !!f)
1537
1537
  }));
1538
1538
  }, i = async (a) => t(r, a);
1539
1539
  return new le(i, {
1540
1540
  maxBatchSize: 50
1541
1541
  });
1542
- }, Ht = (e, n) => Nn(e, n);
1543
- function Xt(e) {
1542
+ }, Xt = (e, n) => Ln(e, n);
1543
+ function Yt(e) {
1544
1544
  return {
1545
1545
  ...e,
1546
- description: e.description ? Ht(e.description) : e.description
1546
+ description: e.description ? Xt(e.description) : e.description
1547
1547
  };
1548
1548
  }
1549
1549
  const N = (e, n) => ({
1550
1550
  ...e,
1551
- isVariantOf: Xt(n)
1552
- }), Yt = ({ flags: e }, n) => {
1551
+ isVariantOf: Yt(n)
1552
+ }), Jt = ({ flags: e }, n) => {
1553
1553
  const t = async (r) => {
1554
- const i = r.map((p) => p.split("-")[0]), a = r.some(
1555
- (p) => p.split("-")[1] === "invisibleItems"
1554
+ const i = r.map((g) => g.split("-")[0]), a = r.some(
1555
+ (g) => g.split("-")[1] === "invisibleItems"
1556
1556
  ), s = (await n.search.productsByIdentifier({
1557
1557
  field: "sku",
1558
1558
  values: i,
@@ -1561,13 +1561,13 @@ const N = (e, n) => ({
1561
1561
  hideUnavailableItems: !1
1562
1562
  }
1563
1563
  })).reduce(
1564
- (p, u) => {
1564
+ (g, u) => {
1565
1565
  for (const h of u.items)
1566
- p[h.itemId] = N(h, u);
1567
- return p;
1566
+ g[h.itemId] = N(h, u);
1567
+ return g;
1568
1568
  },
1569
1569
  {}
1570
- ), c = i.map((p) => s[p]), l = i.filter((p) => !s[p]);
1570
+ ), c = i.map((g) => s[g]), l = i.filter((g) => !s[g]);
1571
1571
  if (l.length > 0)
1572
1572
  throw new $(
1573
1573
  `Search API did not found the following skus: ${l.join(",")}`
@@ -1578,25 +1578,25 @@ const N = (e, n) => ({
1578
1578
  maxBatchSize: 99
1579
1579
  // Max allowed batch size of Search API
1580
1580
  });
1581
- }, Jt = (e, n) => {
1582
- const { clients: t } = n, r = Yt(e, t), i = Gt(e, t), a = qt(e, t), o = jt(e, t);
1581
+ }, Kt = (e, n) => {
1582
+ const { clients: t } = n, r = Jt(e, t), i = Ht(e, t), a = jt(e, t), o = Wt(e, t);
1583
1583
  return {
1584
1584
  skuLoader: r,
1585
1585
  simulationLoader: i,
1586
1586
  collectionLoader: a,
1587
1587
  salesChannelLoader: o
1588
1588
  };
1589
- }, B = (e) => e.AvailableQuantity > 0, V = (e) => e.spotPrice ?? 0, Kt = (e) => e.Price ?? 0, Le = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", ln = (e, n) => B(e) && !B(n) ? -1 : !B(e) && B(n) ? 1 : V(e) - V(n), Qt = (e) => e === "available", M = (e, n = 0, t = 1) => {
1589
+ }, B = (e) => e.AvailableQuantity > 0, V = (e) => e.spotPrice ?? 0, Qt = (e) => e.Price ?? 0, Le = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", dn = (e, n) => B(e) && !B(n) ? -1 : !B(e) && B(n) ? 1 : V(e) - V(n), Zt = (e) => e === "available", M = (e, n = 0, t = 1) => {
1590
1590
  const r = n / t;
1591
1591
  return Math.round((e + r) * 100) / 100;
1592
- }, Zt = (e, n = { includeTaxes: !1 }) => {
1592
+ }, er = (e, n = { includeTaxes: !1 }) => {
1593
1593
  const t = e.filter(B), r = t[t.length - 1], i = r ? V(r) : 0;
1594
1594
  return n.includeTaxes ? M(i, r?.Tax, r?.product?.unitMultiplier) : i;
1595
1595
  }, Be = (e, n = { includeTaxes: !1 }) => {
1596
1596
  const [t] = e.filter(B), r = t ? V(t) : 0;
1597
1597
  return n.includeTaxes ? M(r, t?.Tax, t?.product?.unitMultiplier) : r;
1598
- }, er = {
1599
- highPrice: (e) => Zt(e),
1598
+ }, nr = {
1599
+ highPrice: (e) => er(e),
1600
1600
  lowPrice: (e) => Be(e),
1601
1601
  lowPriceWithTaxes: (e) => Be(e, { includeTaxes: !0 }),
1602
1602
  offerCount: (e) => e.length,
@@ -1608,20 +1608,20 @@ const N = (e, n) => ({
1608
1608
  return (await r.load(i.salesChannel)).CurrencyCode ?? "";
1609
1609
  },
1610
1610
  offers: (e) => e
1611
- }, nr = {
1611
+ }, tr = {
1612
1612
  ratingValue: () => 5,
1613
1613
  reviewCount: () => 0
1614
- }, $e = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", tr = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", rr = (e) => {
1614
+ }, $e = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", rr = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", ir = (e) => {
1615
1615
  let n = e.slice(0);
1616
1616
  for (let t = 0; t < $e.length; t++)
1617
- n = n.replace(new RegExp($e.charAt(t), "g"), tr.charAt(t));
1617
+ n = n.replace(new RegExp($e.charAt(t), "g"), rr.charAt(t));
1618
1618
  return n;
1619
- }, ir = (e) => e.replace(/[·/_,:]/, "-");
1619
+ }, ar = (e) => e.replace(/[·/_,:]/, "-");
1620
1620
  function ae(e) {
1621
1621
  const t = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}><=_^]/g, "-");
1622
- return ir(rr(t)).toLowerCase();
1622
+ return ar(ir(t)).toLowerCase();
1623
1623
  }
1624
- const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn = {
1624
+ const H = (e) => qt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), un = {
1625
1625
  id: ({ id: e }) => e.toString(),
1626
1626
  slug: (e) => H(e),
1627
1627
  seo: (e) => ({
@@ -1639,7 +1639,7 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1639
1639
  if (Ne(e))
1640
1640
  return { selectedFacets: [{ key: "productclusterids", value: e.id }] };
1641
1641
  const { defaultLocale: i } = K(t), a = r.split("/").filter(Boolean), o = a.map(
1642
- (l, p) => a.slice(0, p + 1).join("/")
1642
+ (l, g) => a.slice(0, g + 1).join("/")
1643
1643
  ), {
1644
1644
  loaders: { collectionLoader: s }
1645
1645
  } = t;
@@ -1648,8 +1648,8 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1648
1648
  o.map(
1649
1649
  (l) => s.load({ slug: l, locale: re(t) })
1650
1650
  )
1651
- )).map((l, p) => ({
1652
- key: `category-${p + 1}`,
1651
+ )).map((l, g) => ({
1652
+ key: `category-${g + 1}`,
1653
1653
  value: i && l.availableLinkIds?.[i] || l.linkId
1654
1654
  }))
1655
1655
  };
@@ -1685,9 +1685,9 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1685
1685
  } = t, l = s.map(
1686
1686
  (u, h) => s.slice(0, h + 1).join("/")
1687
1687
  );
1688
- let p;
1688
+ let g;
1689
1689
  try {
1690
- p = await Promise.all(
1690
+ g = await Promise.all(
1691
1691
  l.map(
1692
1692
  (u) => c.load({ slug: u, locale: re(t) })
1693
1693
  )
@@ -1699,7 +1699,7 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1699
1699
  if (u === a)
1700
1700
  return { locale: u, slug: o };
1701
1701
  const h = [];
1702
- for (const f of p) {
1702
+ for (const f of g) {
1703
1703
  const v = f.availableLinkIds?.[u];
1704
1704
  if (!v) return null;
1705
1705
  h.push(v);
@@ -1707,7 +1707,7 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1707
1707
  return h.length > 0 ? { locale: u, slug: h.join("/") } : null;
1708
1708
  }).filter((u) => u !== null);
1709
1709
  }
1710
- }, un = {
1710
+ }, pn = {
1711
1711
  buy: "whoboughtalsobought",
1712
1712
  view: "whosawalsosaw",
1713
1713
  similars: "similars",
@@ -1733,27 +1733,27 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1733
1733
  }, ze = (e) => {
1734
1734
  const n = e.split(":").map(Number);
1735
1735
  return n.length !== 2 || Number.isNaN(n[0]) || Number.isNaN(n[1]) ? null : n;
1736
- }, ar = (e) => typeof un[e] == "string", or = (e) => {
1736
+ }, or = (e) => typeof pn[e] == "string", sr = (e) => {
1737
1737
  const n = e?.filter(
1738
- (t) => ar(t.key)
1738
+ (t) => or(t.key)
1739
1739
  );
1740
1740
  if (Array.isArray(n) && n.length > 1)
1741
- throw new T(
1741
+ throw new _(
1742
1742
  `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(",")}`
1743
1743
  );
1744
1744
  return n?.[0] ?? null;
1745
- }, sr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, cr = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ve = (e) => e?.find((n) => n.key === "locale")?.value ?? null, xe = (e) => e?.find((n) => n.key === "channel")?.value ?? null, Ie = (e, n) => {
1745
+ }, cr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, lr = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ve = (e) => e?.find((n) => n.key === "locale")?.value ?? null, xe = (e) => e?.find((n) => n.key === "channel")?.value ?? null, Ie = (e, n) => {
1746
1746
  let t = 0;
1747
1747
  for (let r = 1; r < e.length; r++)
1748
1748
  n(e[t], e[r]) > 0 && (t = r);
1749
1749
  return e[t];
1750
- }, lr = {
1751
- __resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
1752
1750
  }, dr = {
1751
+ __resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
1752
+ }, ur = {
1753
1753
  key: ({ key: e }) => e,
1754
1754
  label: ({ name: e }) => e,
1755
1755
  values: ({ values: e }) => e.sort((n, t) => n.name.localeCompare(t.name))
1756
- }, ur = {
1756
+ }, pr = {
1757
1757
  key: ({ key: e }) => e,
1758
1758
  label: ({ name: e }) => e,
1759
1759
  min: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
@@ -1774,17 +1774,17 @@ const H = (e) => xt(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? ae(e.name), dn
1774
1774
  absolute: o
1775
1775
  };
1776
1776
  }
1777
- }, pr = {
1777
+ }, gr = {
1778
1778
  value: ({ value: e }) => e,
1779
1779
  label: ({ name: e }) => e || "unknown",
1780
1780
  selected: ({ selected: e }) => e,
1781
1781
  quantity: ({ quantity: e }) => e
1782
- }, gr = async (e, { data: n }, { clients: { commerce: t } }) => {
1782
+ }, mr = async (e, { data: n }, { clients: { commerce: t } }) => {
1783
1783
  if (!n?.orderId)
1784
- throw new T("Missing orderId");
1784
+ throw new _("Missing orderId");
1785
1785
  return { data: (await t.checkout.cancelOrder(n))?.data };
1786
1786
  };
1787
- function pn(e) {
1787
+ function gn(e) {
1788
1788
  if (!e || e.status !== "pending")
1789
1789
  return null;
1790
1790
  for (const n of e.dimensionStatus) {
@@ -1802,48 +1802,48 @@ function pn(e) {
1802
1802
  }
1803
1803
  return null;
1804
1804
  }
1805
- function mr(e) {
1805
+ function hr(e) {
1806
1806
  if (!e || e.status !== "pending") return !1;
1807
1807
  const n = e.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
1808
1808
  return n.length === 0 ? !1 : n.every((t) => !t.isUserNextAuthorizer);
1809
1809
  }
1810
- const hr = async (e, { data: n }, { clients: { commerce: t } }) => {
1811
- const r = await t.oms.processOrderAuthorization(n), i = pn(r);
1810
+ const fr = async (e, { data: n }, { clients: { commerce: t } }) => {
1811
+ const r = await t.oms.processOrderAuthorization(n), i = gn(r);
1812
1812
  return {
1813
- isPendingForOtherAuthorizer: !i && mr(r),
1813
+ isPendingForOtherAuthorizer: !i && hr(r),
1814
1814
  ruleForAuthorization: i
1815
1815
  };
1816
- }, fr = async (e, { data: n }, { clients: { commerce: t } }) => {
1816
+ }, Sr = async (e, { data: n }, { clients: { commerce: t } }) => {
1817
1817
  if (!n?.objectKey)
1818
- throw new T("Missing objectKey");
1818
+ throw new _("Missing objectKey");
1819
1819
  const r = n.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
1820
1820
  return t.orderEntry.startOperation({
1821
1821
  objectKey: n.objectKey,
1822
1822
  orderFormId: r,
1823
1823
  sessionToken: n.sessionToken ?? void 0
1824
1824
  });
1825
- }, Sr = async (e, n, t) => {
1825
+ }, yr = async (e, n, t) => {
1826
1826
  if (!(await t.clients.commerce.recommendation.startRecommendationSession())?.recommendationsUserId)
1827
1827
  throw new Error(
1828
1828
  "Failed to start recommendation session: no session data returned"
1829
1829
  );
1830
1830
  return !0;
1831
- }, yr = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), Ir = async (e, { data: n }, { clients: { commerce: t } }) => {
1831
+ }, Ir = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), vr = async (e, { data: n }, { clients: { commerce: t } }) => {
1832
1832
  const { fileContent: r, fileName: i, mimeType: a } = n;
1833
1833
  if (!r || !i || !a)
1834
- throw new T(
1834
+ throw new _(
1835
1835
  "Missing required fields: fileContent, fileName, mimeType"
1836
1836
  );
1837
1837
  const o = r.replaceAll(/\s/g, ""), s = 5 * 1024 * 1024;
1838
1838
  if (Math.floor(o.length * 3 / 4) > s)
1839
- throw new T("File exceeds maximum allowed size of 5MB");
1839
+ throw new _("File exceeds maximum allowed size of 5MB");
1840
1840
  if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
1841
1841
  o
1842
1842
  ))
1843
- throw new T("Invalid Base64 fileContent");
1844
- const p = Buffer.from(o, "base64");
1843
+ throw new _("Invalid Base64 fileContent");
1844
+ const g = Buffer.from(o, "base64");
1845
1845
  return await t.orderEntry.uploadFile({
1846
- fileBuffer: p,
1846
+ fileBuffer: g,
1847
1847
  fileName: i,
1848
1848
  mimeType: a
1849
1849
  });
@@ -1870,19 +1870,19 @@ const ve = (e, n) => {
1870
1870
  e.storage.channel = oe.parse(n);
1871
1871
  }, Oe = (e, n) => {
1872
1872
  e.storage.locale = n;
1873
- }, gn = (e) => Ln.createHash("md5").update(e).digest("hex"), ne = {
1873
+ }, mn = (e) => Bn.createHash("md5").update(e).digest("hex"), ne = {
1874
1874
  attachment: "ATTACHMENT",
1875
1875
  specification: "SPECIFICATION",
1876
1876
  attribute: "ATTRIBUTE"
1877
1877
  };
1878
- function mn(e) {
1878
+ function hn(e) {
1879
1879
  return {
1880
1880
  name: e.name,
1881
1881
  value: e.content,
1882
1882
  valueReference: ne.attachment
1883
1883
  };
1884
1884
  }
1885
- function vr(e) {
1885
+ function Or(e) {
1886
1886
  return {
1887
1887
  propertyID: e.id,
1888
1888
  name: e.name,
@@ -1893,12 +1893,12 @@ function vr(e) {
1893
1893
  }
1894
1894
  };
1895
1895
  }
1896
- function hn(e) {
1897
- return gn(
1896
+ function fn(e) {
1897
+ return mn(
1898
1898
  `${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`
1899
1899
  );
1900
1900
  }
1901
- const Or = (e) => {
1901
+ const Cr = (e) => {
1902
1902
  const n = e.postalCode, t = e.geoCoordinates, r = {
1903
1903
  addressType: e.addressType || null,
1904
1904
  postalCode: n || null,
@@ -1917,7 +1917,7 @@ const Or = (e) => {
1917
1917
  r.geoCoordinates = i !== null && a !== null ? [a, i] : [];
1918
1918
  }
1919
1919
  return [r];
1920
- }, Cr = (e, n, t) => {
1920
+ }, br = (e, n, t) => {
1921
1921
  const r = n.postalCode, i = n.geoCoordinates, a = e?.shippingData?.availableAddresses ?? [], o = e?.shippingData?.selectedAddresses ?? [];
1922
1922
  if (!t && o.length > 0)
1923
1923
  return [o[0]];
@@ -1931,31 +1931,31 @@ const Or = (e) => {
1931
1931
  return [s];
1932
1932
  }
1933
1933
  return null;
1934
- }, fn = (e, n) => {
1935
- if (!br(n))
1934
+ }, Sn = (e, n) => {
1935
+ if (!wr(n))
1936
1936
  return { updateShipping: !1, addressChanged: !1 };
1937
- if (!Pr(e))
1937
+ if (!kr(e))
1938
1938
  return { updateShipping: !1, addressChanged: !1 };
1939
1939
  const [t] = e?.shippingData?.selectedAddresses ?? [];
1940
- if (wr(t, n.postalCode) || Dr(t, n.geoCoordinates) || Ar(t, n.addressType))
1940
+ if (Dr(t, n.postalCode) || Pr(t, n.geoCoordinates) || Ar(t, n.addressType))
1941
1941
  return { updateShipping: !0, addressChanged: !0 };
1942
1942
  const { logisticsInfo: r } = e.shippingData;
1943
1943
  return Ur(r, n) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
1944
- }, br = (e) => !!e.postalCode || e.geoCoordinates?.latitude && e.geoCoordinates?.longitude, wr = (e, n) => typeof n == "string" && e?.postalCode !== n, Dr = (e, n) => typeof n?.latitude == "number" && typeof n?.longitude == "number" && (e?.geoCoordinates[0] !== n?.longitude || e?.geoCoordinates[1] !== n?.latitude), Ar = (e, n) => typeof n == "string" && e?.addressType !== n, Pr = (e) => e.items.length !== 0, Ur = (e, n) => {
1944
+ }, wr = (e) => !!e.postalCode || e.geoCoordinates?.latitude && e.geoCoordinates?.longitude, Dr = (e, n) => typeof n == "string" && e?.postalCode !== n, Pr = (e, n) => typeof n?.latitude == "number" && typeof n?.longitude == "number" && (e?.geoCoordinates[0] !== n?.longitude || e?.geoCoordinates[1] !== n?.latitude), Ar = (e, n) => typeof n == "string" && e?.addressType !== n, kr = (e) => e.items.length !== 0, Ur = (e, n) => {
1945
1945
  const t = n?.deliveryMode?.deliveryChannel, r = n?.deliveryMode?.deliveryMethod, { startDate: i, endDate: a } = n?.deliveryMode?.deliveryWindow || {};
1946
1946
  return e.some(
1947
1947
  ({ selectedDeliveryChannel: o, selectedSla: s, slas: c }) => {
1948
- const l = t && o !== t, p = r && s !== r;
1949
- return c?.some((u) => l && u.deliveryChannel === t || p && u.id === r ? !0 : i && a && u.deliveryChannel === t && u.id === r && (!u?.deliveryWindow || u?.deliveryWindow?.startDateUtc !== i || u?.deliveryWindow?.endDateUtc !== a) && u.availableDeliveryWindows?.some(
1948
+ const l = t && o !== t, g = r && s !== r;
1949
+ return c?.some((u) => l && u.deliveryChannel === t || g && u.id === r ? !0 : i && a && u.deliveryChannel === t && u.id === r && (!u?.deliveryWindow || u?.deliveryWindow?.startDateUtc !== i || u?.deliveryWindow?.endDateUtc !== a) && u.availableDeliveryWindows?.some(
1950
1950
  (h) => h?.startDateUtc === i && h?.endDateUtc === a
1951
1951
  ));
1952
1952
  }
1953
1953
  );
1954
- }, Sn = (e) => e.valueReference === ne.attachment, Ce = (e) => [
1954
+ }, yn = (e) => e.valueReference === ne.attachment, Ce = (e) => [
1955
1955
  e.itemOffered.sku,
1956
1956
  e.seller.identifier,
1957
1957
  e.price < 0.01 ? "Gift" : void 0,
1958
- e.itemOffered.additionalProperty?.filter(Sn).map(hn).join("-")
1958
+ e.itemOffered.additionalProperty?.filter(yn).map(fn).join("-")
1959
1959
  ].filter(Boolean).join("::"), se = (e, n) => ({
1960
1960
  listPrice: e.listPrice / 100,
1961
1961
  price: e.sellingPrice / 100,
@@ -1965,37 +1965,38 @@ const Or = (e) => {
1965
1965
  sku: e.id,
1966
1966
  image: [],
1967
1967
  name: e.name,
1968
- additionalProperty: e.attachments.map(mn)
1968
+ additionalProperty: e.attachments.map(hn)
1969
1969
  },
1970
1970
  index: n
1971
- }), kr = (e) => ({
1971
+ }), Tr = (e) => ({
1972
1972
  quantity: e.quantity,
1973
1973
  seller: e.seller.identifier,
1974
1974
  id: e.itemOffered.sku,
1975
1975
  index: e.index,
1976
- attachments: (e.itemOffered.additionalProperty?.filter(Sn) ?? []).map((n) => ({
1976
+ attachments: (e.itemOffered.additionalProperty?.filter(yn) ?? []).map((n) => ({
1977
1977
  name: n.name,
1978
1978
  content: n.value
1979
- }))
1979
+ })),
1980
+ ...e.priceToken ? { priceToken: e.priceToken } : {}
1980
1981
  }), qe = (e) => e.reduce((n, t) => {
1981
1982
  const r = Ce(t);
1982
1983
  return n.has(r) || n.set(r, []), n.get(r)?.push(t), n;
1983
1984
  }, /* @__PURE__ */ new Map()), _r = (e, n) => {
1984
- const t = (s, c) => ({
1985
- ...s,
1985
+ const t = ({ priceToken: s, ...c }, l) => ({
1986
+ ...c,
1986
1987
  itemOffered: {
1987
- sku: s.itemOffered.sku
1988
+ sku: c.itemOffered.sku
1988
1989
  },
1989
- index: c
1990
- }), r = n.items.map(se).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = Pe(r, i);
1990
+ index: l
1991
+ }), r = n.items.map(se).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = Ae(r, i);
1991
1992
  return a && o;
1992
1993
  };
1993
- function yn(e, n) {
1994
+ function In(e, n) {
1994
1995
  return e?.some(
1995
1996
  (t) => t.parentItemIndex !== null && t.parentItemIndex !== void 0 && e[t.parentItemIndex]?.id === n
1996
1997
  );
1997
1998
  }
1998
- function In(e, n) {
1999
+ function vn(e, n) {
1999
2000
  return e?.some(
2000
2001
  (t) => t.id === n && t.parentItemIndex !== null
2001
2002
  );
@@ -2003,7 +2004,7 @@ function In(e, n) {
2003
2004
  const je = (e) => {
2004
2005
  const n = e.items.reduce(
2005
2006
  (t, r, i) => {
2006
- const a = In(e.items, r.id) || yn(e.items, r.id) ? `${Ce(se(r))}::${i}` : Ce(se(r));
2007
+ const a = vn(e.items, r.id) || In(e.items, r.id) ? `${Ce(se(r))}::${i}` : Ce(se(r));
2007
2008
  return t[a] || (t[a] = []), t[a].push(r), t;
2008
2009
  },
2009
2010
  {}
@@ -2035,7 +2036,7 @@ const je = (e) => {
2035
2036
  text: r,
2036
2037
  status: i.toUpperCase()
2037
2038
  }))
2038
- }), vn = ({ items: e }, n) => {
2039
+ }), On = ({ items: e }, n) => {
2039
2040
  const t = e.map((r) => ({
2040
2041
  id: r.id,
2041
2042
  quantity: r.quantity,
@@ -2043,7 +2044,7 @@ const je = (e) => {
2043
2044
  attachments: r.attachments
2044
2045
  // customizations
2045
2046
  }));
2046
- return gn(
2047
+ return mn(
2047
2048
  JSON.stringify({ sessionId: n?.id ?? "", items: t })
2048
2049
  );
2049
2050
  }, Ge = async (e, n, t) => {
@@ -2052,7 +2053,7 @@ const je = (e) => {
2052
2053
  id: e.orderFormId,
2053
2054
  appId: "faststore",
2054
2055
  key: "cartEtag",
2055
- value: vn(e, t)
2056
+ value: On(e, t)
2056
2057
  });
2057
2058
  } catch (r) {
2058
2059
  throw console.error(
@@ -2062,22 +2063,22 @@ const je = (e) => {
2062
2063
  More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api`
2063
2064
  ), r;
2064
2065
  }
2065
- }, Tr = (e, n) => {
2066
+ }, Er = (e, n) => {
2066
2067
  const r = e.customData?.customApps.find(
2067
2068
  (a) => a.id === "faststore"
2068
2069
  )?.fields?.cartEtag;
2069
- return r == null ? !0 : vn(e, n) !== r;
2070
- }, Er = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
2070
+ return r == null ? !0 : On(e, n) !== r;
2071
+ }, Rr = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
2071
2072
  id: e
2072
2073
  }), He = async (e, n, { clients: { commerce: t } }) => {
2073
2074
  if (!n)
2074
2075
  return e;
2075
- const { updateShipping: r, addressChanged: i } = fn(
2076
+ const { updateShipping: r, addressChanged: i } = Sn(
2076
2077
  e,
2077
2078
  n
2078
2079
  );
2079
2080
  if (r) {
2080
- const a = Cr(e, n, i), s = a || Or(n);
2081
+ const a = br(e, n, i), s = a || Cr(n);
2081
2082
  return !!n.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
2082
2083
  {
2083
2084
  id: e.orderFormId,
@@ -2097,13 +2098,13 @@ const je = (e) => {
2097
2098
  );
2098
2099
  }
2099
2100
  return e;
2100
- }, Rr = (e, n) => {
2101
+ }, Fr = (e, n) => {
2101
2102
  if (!e)
2102
2103
  return "";
2103
2104
  const r = Z(e)[n];
2104
2105
  return r ? r.split("=")[1] : "";
2105
- }, Fr = async (e, { cart: { order: n }, session: t }, r) => {
2106
- const i = Rr(
2106
+ }, Nr = async (e, { cart: { order: n }, session: t }, r) => {
2107
+ const i = Fr(
2107
2108
  r.headers.cookie,
2108
2109
  "checkout.vtex.com"
2109
2110
  ), {
@@ -2114,61 +2115,61 @@ const je = (e) => {
2114
2115
  const l = await a.checkout.orderForm({
2115
2116
  id: i || void 0,
2116
2117
  channel: r.storage.channel
2117
- }), p = l.orderFormId;
2118
- l.messages.length !== 0 && await Er(p, r);
2118
+ }), g = l.orderFormId;
2119
+ l.messages.length !== 0 && await Rr(g, r);
2119
2120
  const u = Z(r?.headers?.cookie ?? "")?.vtex_session, h = Y(u), { acceptedOffer: f, shouldSplitItem: v } = n;
2120
- if (Tr(l, h)) {
2121
+ if (Er(l, h)) {
2121
2122
  const b = await Ge(
2122
2123
  l,
2123
2124
  a,
2124
2125
  h
2125
2126
  ).then(je);
2126
- if (p)
2127
+ if (g)
2127
2128
  return We(b, o, v);
2128
2129
  }
2129
- const g = qe(f), m = qe(l.items.map(se)), y = Array.from(m.entries()), O = Array.from(g.entries()), { itemsToAdd: w, itemsToUpdate: C } = O.reduce(
2130
- (b, [k, _]) => {
2131
- const x = m.get(k);
2130
+ const p = qe(f), m = qe(l.items.map(se)), y = Array.from(m.entries()), O = Array.from(p.entries()), { itemsToAdd: w, itemsToUpdate: C } = O.reduce(
2131
+ (b, [U, T]) => {
2132
+ const x = m.get(U);
2132
2133
  if (!x)
2133
- return _.forEach((q) => b.itemsToAdd.push(q)), b;
2134
- const [E, ...Ue] = x;
2135
- if (In(l.items, E.itemOffered.sku) || yn(l.items, E.itemOffered.sku))
2134
+ return T.forEach((q) => b.itemsToAdd.push(q)), b;
2135
+ const [E, ...ke] = x;
2136
+ if (vn(l.items, E.itemOffered.sku) || In(l.items, E.itemOffered.sku))
2136
2137
  return b.itemsToUpdate.push(E), b;
2137
- const de = _.reduce((q, Pn) => q + Pn.quantity, 0);
2138
+ const de = T.reduce((q, kn) => q + kn.quantity, 0);
2138
2139
  return b.itemsToUpdate.push({
2139
2140
  ...E,
2140
2141
  quantity: de
2141
- }), Ue.forEach((q) => b.itemsToUpdate.push({ ...q, quantity: 0 })), b;
2142
+ }), ke.forEach((q) => b.itemsToUpdate.push({ ...q, quantity: 0 })), b;
2142
2143
  },
2143
2144
  {
2144
2145
  itemsToAdd: [],
2145
2146
  itemsToUpdate: []
2146
2147
  }
2147
- ), P = y.filter(([b]) => !g.has(b)).flatMap(([, b]) => b.map((k) => ({ ...k, quantity: 0 }))), S = [...w, ...C, ...P].map(
2148
- kr
2149
- ), { updateShipping: D } = t ? fn(l, t) : { updateShipping: !1 };
2148
+ ), A = y.filter(([b]) => !p.has(b)).flatMap(([, b]) => b.map((U) => ({ ...U, quantity: 0 }))), S = [...w, ...C, ...A].map(
2149
+ Tr
2150
+ ), { updateShipping: D } = t ? Sn(l, t) : { updateShipping: !1 };
2150
2151
  if (S.length === 0 && !D)
2151
2152
  return null;
2152
- let A;
2153
- S.length > 0 ? A = await a.checkout.updateOrderFormItems({
2153
+ let P;
2154
+ S.length > 0 ? P = await a.checkout.updateOrderFormItems({
2154
2155
  id: l.orderFormId,
2155
2156
  orderItems: S,
2156
2157
  shouldSplitItem: v
2157
2158
  }).then(
2158
2159
  (b) => He(b, t, r)
2159
- ) : A = await He(
2160
+ ) : P = await He(
2160
2161
  l,
2161
2162
  t,
2162
2163
  r
2163
- ), A = await Promise.resolve(A).then((b) => {
2164
+ ), P = await Promise.resolve(P).then((b) => {
2164
2165
  if (t?.marketingData) {
2165
- const k = {
2166
+ const U = {
2166
2167
  ...b.marketingData,
2167
2168
  ...t.marketingData
2168
2169
  };
2169
2170
  return a.checkout.marketingData({
2170
2171
  id: l.orderFormId,
2171
- marketingData: k
2172
+ marketingData: U
2172
2173
  });
2173
2174
  }
2174
2175
  return b;
@@ -2179,31 +2180,31 @@ const je = (e) => {
2179
2180
  locale: c
2180
2181
  }
2181
2182
  }) : b).then((b) => Ge(b, a, h)).then(je);
2182
- const U = Pe(
2183
+ const k = Ae(
2183
2184
  l.messages,
2184
- A.messages
2185
+ P.messages
2185
2186
  );
2186
- return _r(n, A) && U ? null : We(A, o, v);
2187
- }, Nr = (e) => {
2187
+ return _r(n, P) && k ? null : We(P, o, v);
2188
+ }, Lr = (e) => {
2188
2189
  const n = (e?.corporateName ?? "").trim();
2189
2190
  return n || (e?.firstName ?? "").trim();
2190
- }, Lr = (e) => {
2191
+ }, Br = (e) => {
2191
2192
  if (!e || typeof e != "object")
2192
2193
  return !1;
2193
2194
  const n = e;
2194
2195
  return typeof n.customerId == "string" && n.customerId.trim() !== "" && typeof n.contractName == "string" && typeof n.isActive == "boolean" && typeof n.isCurrent == "boolean";
2195
- }, Br = (e) => {
2196
+ }, $r = (e) => {
2196
2197
  const n = e?.availableContracts?.value;
2197
- return Array.isArray(n) ? n.filter(Lr) : [];
2198
- }, $r = (e) => e?.customerId ? !!((e.contractName ?? "").trim() && e.isActive) : !1, Mr = (e) => e?.namespaces?.shopper?.activeContractId?.value?.trim() ?? e?.namespaces?.authentication?.customerId?.value?.trim() ?? e?.namespaces?.profile?.id?.value?.trim() ?? "", zr = (e, n = "") => {
2198
+ return Array.isArray(n) ? n.filter(Br) : [];
2199
+ }, Mr = (e) => e?.customerId ? !!((e.contractName ?? "").trim() && e.isActive) : !1, Xe = (e) => e?.namespaces?.shopper?.activeContractId?.value?.trim() ?? e?.namespaces?.authentication?.customerId?.value?.trim() ?? e?.namespaces?.profile?.id?.value?.trim() ?? "", zr = (e, n = "") => {
2199
2200
  const t = n.trim();
2200
- return e.filter($r).map((r) => ({
2201
+ return e.filter(Mr).map((r) => ({
2201
2202
  id: r.customerId,
2202
2203
  corporateName: r.contractName.trim(),
2203
2204
  isActive: t ? r.customerId === t : r.isCurrent
2204
2205
  }));
2205
- }, On = (e, n) => {
2206
- const t = Nr(e);
2206
+ }, Cn = (e, n) => {
2207
+ const t = Lr(e);
2207
2208
  return t || (n?.firstName?.value ?? "").trim();
2208
2209
  };
2209
2210
  async function Vr(e, n, t) {
@@ -2225,21 +2226,21 @@ async function Vr(e, n, t) {
2225
2226
  }
2226
2227
  const xr = async (e, { session: n, search: t }, { clients: r, headers: i, account: a }) => {
2227
2228
  const o = oe.parse(n.channel ?? ""), s = String(n.postalCode ?? ""), c = n.country ?? "";
2228
- let l = n.city ?? null, p = n.geoCoordinates ?? null;
2229
- if ((!l || !p) && s !== "" && c !== "") {
2229
+ let l = n.city ?? null, g = n.geoCoordinates ?? null;
2230
+ if ((!l || !g) && s !== "" && c !== "") {
2230
2231
  const E = await Vr(
2231
2232
  r,
2232
2233
  c,
2233
2234
  s
2234
2235
  );
2235
- l = E.city, p = E.geoCoordinates;
2236
+ l = E.city, g = E.geoCoordinates;
2236
2237
  }
2237
2238
  const h = new URLSearchParams(t);
2238
2239
  h.has("facets") && h.delete("facets");
2239
2240
  const f = h.get("sc") ?? o.salesChannel;
2240
- h.set("sc", f), s && h.set("postalCode", s), c && h.set("country", c), p && h.set(
2241
+ h.set("sc", f), s && h.set("postalCode", s), c && h.set("country", c), g && h.set(
2241
2242
  "geoCoordinates",
2242
- `${p.longitude},${p.latitude}`
2243
+ `${g.longitude},${g.latitude}`
2243
2244
  // long,lat is the format expected
2244
2245
  ), h.set("locale", n.locale);
2245
2246
  const { marketingData: v } = n, d = {
@@ -2249,31 +2250,31 @@ const xr = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
2249
2250
  utmiCampaign: h.get("utmi_cp") ?? v?.utmiCampaign ?? "",
2250
2251
  utmiPage: h.get("utmi_p") ?? v?.utmiPage ?? "",
2251
2252
  utmiPart: h.get("utmi_pc") ?? v?.utmiPart ?? ""
2252
- }, g = Y(z(i?.cookie ?? "", a));
2253
+ }, p = Y(z(i?.cookie ?? "", a));
2253
2254
  let m = !1;
2254
- if (g)
2255
+ if (p)
2255
2256
  try {
2256
2257
  m = (await r.commerce.vtexid.validate())?.authStatus?.toLowerCase() === "success";
2257
2258
  } catch (E) {
2258
2259
  console.warn("JWT validation failed:", E), m = !1;
2259
2260
  }
2260
- const y = m ? g?.isRepresentative : !1, O = m ? g?.customerId : void 0, w = m ? g?.unitId : void 0, C = await r.commerce.session(h.toString()).catch(() => null), P = C?.namespaces.profile ?? null, S = C?.namespaces.shopper ?? null, D = C?.namespaces.store ?? null, A = C?.namespaces.authentication ?? null, U = C?.namespaces.checkout ?? null, b = C?.namespaces.public ?? null;
2261
- let k = null;
2262
- if (y && P?.id?.value)
2261
+ const y = m ? p?.isRepresentative : !1, O = m ? p?.customerId : void 0, w = m ? p?.unitId : void 0, C = await r.commerce.session(h.toString()).catch(() => null), A = C?.namespaces.profile ?? null, S = C?.namespaces.shopper ?? null, D = C?.namespaces.store ?? null, P = C?.namespaces.authentication ?? null, k = C?.namespaces.checkout ?? null, b = C?.namespaces.public ?? null;
2262
+ let U = null;
2263
+ if (y && A?.id?.value)
2263
2264
  try {
2264
- k = await r.commerce.masterData.getContractById({
2265
- contractId: P.id.value
2265
+ U = await r.commerce.masterData.getContractById({
2266
+ contractId: A.id.value
2266
2267
  });
2267
2268
  } catch {
2268
2269
  console.error(
2269
- `Error while getting contract data for profile ID (${P.id.value}).
2270
+ `Error while getting contract data for profile ID (${A.id.value}).
2270
2271
  `
2271
2272
  );
2272
2273
  }
2273
- let _;
2274
- o.seller && (s || p) && (_ = (await r.commerce.checkout.region({
2274
+ let T;
2275
+ o.seller && (s || g) && (T = (await r.commerce.checkout.region({
2275
2276
  postalCode: s,
2276
- geoCoordinates: p,
2277
+ geoCoordinates: g,
2277
2278
  country: c,
2278
2279
  salesChannel: f
2279
2280
  }))?.[0]?.sellers.find((de) => o.seller === de.id));
@@ -2286,8 +2287,8 @@ const xr = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
2286
2287
  country: D?.countryCode?.value ?? c,
2287
2288
  channel: oe.stringify({
2288
2289
  salesChannel: D?.channel?.value ?? o.salesChannel,
2289
- regionId: U?.regionId?.value ?? o.regionId,
2290
- seller: _?.id,
2290
+ regionId: k?.regionId?.value ?? o.regionId,
2291
+ seller: T?.id,
2291
2292
  hasOnlyDefaultSalesChannel: !D?.channel?.value
2292
2293
  }),
2293
2294
  /**
@@ -2298,44 +2299,44 @@ const xr = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
2298
2299
  */
2299
2300
  b2b: y ? {
2300
2301
  isRepresentative: y ?? !1,
2301
- customerId: A?.customerId?.value ?? O ?? "",
2302
- unitName: A?.unitName?.value ?? "",
2303
- unitId: A?.unitId?.value ?? w ?? "",
2302
+ customerId: P?.customerId?.value ?? O ?? "",
2303
+ unitName: P?.unitName?.value ?? "",
2304
+ unitId: P?.unitId?.value ?? w ?? "",
2304
2305
  firstName: typeof S?.firstName?.value == "string" ? S.firstName.value : "",
2305
2306
  lastName: typeof S?.lastName?.value == "string" ? S.lastName.value : "",
2306
2307
  userName: `${typeof S?.firstName?.value == "string" ? S.firstName.value : ""} ${typeof S?.lastName?.value == "string" ? S.lastName.value : ""}`.trim(),
2307
- userEmail: A?.storeUserEmail.value ?? "",
2308
+ userEmail: P?.storeUserEmail.value ?? "",
2308
2309
  savedPostalCode: b?.postalCode?.value ?? "",
2309
- contractName: On(k, P),
2310
+ contractName: Cn(U, A),
2310
2311
  organizationManager: S?.organizationManager?.value ?? !1
2311
2312
  } : null,
2312
2313
  marketingData: d,
2313
- person: P?.id ? {
2314
- id: P.id?.value ?? "",
2315
- email: P.email?.value ?? "",
2316
- givenName: P.firstName?.value ?? "",
2317
- familyName: P.lastName?.value ?? ""
2314
+ person: A?.id ? {
2315
+ id: A.id?.value ?? "",
2316
+ email: A.email?.value ?? "",
2317
+ givenName: A.firstName?.value ?? "",
2318
+ familyName: A.lastName?.value ?? ""
2318
2319
  } : null,
2319
- geoCoordinates: p?.latitude && p?.longitude && p || null,
2320
+ geoCoordinates: g?.latitude && g?.longitude && g || null,
2320
2321
  city: l
2321
2322
  };
2322
- return Pe(n, x) ? null : x;
2323
+ return Ae(n, x) ? null : x;
2323
2324
  }, qr = {
2324
- validateCart: Fr,
2325
+ validateCart: Nr,
2325
2326
  validateSession: xr,
2326
- subscribeToNewsletter: yr,
2327
- cancelOrder: gr,
2328
- processOrderAuthorization: hr,
2329
- uploadFileToOrderEntry: Ir,
2330
- startOrderEntryOperation: fr,
2331
- startRecommendationSession: Sr
2327
+ subscribeToNewsletter: Ir,
2328
+ cancelOrder: mr,
2329
+ processOrderAuthorization: fr,
2330
+ uploadFileToOrderEntry: vr,
2331
+ startOrderEntryOperation: Sr,
2332
+ startRecommendationSession: yr
2332
2333
  };
2333
2334
  var be;
2334
2335
  (function(e) {
2335
2336
  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";
2336
2337
  })(be || (be = {}));
2337
- const jr = (e) => typeof e == "string" ? Cn(e) : null;
2338
- function Cn(e) {
2338
+ const jr = (e) => typeof e == "string" ? bn(e) : null;
2339
+ function bn(e) {
2339
2340
  try {
2340
2341
  return JSON.parse(e);
2341
2342
  } catch {
@@ -2348,9 +2349,9 @@ const Wr = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
2348
2349
  parseValue: jr,
2349
2350
  serialize: Wr,
2350
2351
  parseLiteral(e) {
2351
- return e.kind === be.STRING ? Cn(e.value) : null;
2352
+ return e.kind === be.STRING ? bn(e.value) : null;
2352
2353
  }
2353
- }), F = (e) => "Price" in e && "seller" in e && "product" in e, R = (e) => "skuName" in e, Hr = {
2354
+ }), R = (e) => "Price" in e && "seller" in e && "product" in e, F = (e) => "skuName" in e, Hr = {
2354
2355
  priceCurrency: async (e, n, t) => {
2355
2356
  const {
2356
2357
  loaders: { salesChannelLoader: r },
@@ -2358,33 +2359,34 @@ const Wr = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
2358
2359
  } = t;
2359
2360
  return (await r.load(i.salesChannel)).CurrencyCode ?? "";
2360
2361
  },
2361
- priceValidUntil: (e) => F(e) ? e.PriceValidUntil ?? "" : R(e) ? e.priceValidUntil ?? "" : null,
2362
+ priceValidUntil: (e) => R(e) ? e.PriceValidUntil ?? "" : F(e) ? e.priceValidUntil ?? "" : null,
2362
2363
  itemCondition: () => "https://schema.org/NewCondition",
2363
- availability: async (e) => F(e) ? Le(B(e)) : R(e) ? Le(Qt(e.availability)) : null,
2364
- seller: (e, n, t) => F(e) ? {
2364
+ availability: async (e) => R(e) ? Le(B(e)) : F(e) ? Le(Zt(e.availability)) : null,
2365
+ seller: (e, n, t) => R(e) ? {
2365
2366
  identifier: t.storage.channel?.seller || e.seller.sellerId || ""
2366
- } : R(e) ? {
2367
+ } : F(e) ? {
2367
2368
  identifier: e.seller
2368
2369
  } : null,
2369
- price: (e) => F(e) ? V(e) : R(e) ? e.sellingPrice / 100 : null,
2370
- priceWithTaxes: (e) => F(e) ? M(V(e), e?.Tax, e.product.unitMultiplier) : R(e) ? M(
2370
+ price: (e) => R(e) ? V(e) : F(e) ? e.sellingPrice / 100 : null,
2371
+ priceWithTaxes: (e) => R(e) ? M(V(e), e?.Tax, e.product.unitMultiplier) : F(e) ? M(
2371
2372
  e.sellingPrice / 100,
2372
2373
  e.tax / 100,
2373
2374
  e.unitMultiplier
2374
2375
  ) : null,
2375
- sellingPrice: (e) => F(e) ? Kt(e) : R(e) ? e.sellingPrice / 100 : null,
2376
- listPrice: (e) => F(e) ? e.ListPrice ?? 0 : R(e) ? e.listPrice / 100 : null,
2377
- listPriceWithTaxes: (e) => F(e) ? M(
2376
+ sellingPrice: (e) => R(e) ? Qt(e) : F(e) ? e.sellingPrice / 100 : null,
2377
+ listPrice: (e) => R(e) ? e.ListPrice ?? 0 : F(e) ? e.listPrice / 100 : null,
2378
+ listPriceWithTaxes: (e) => R(e) ? M(
2378
2379
  e.ListPrice ?? 0,
2379
2380
  e?.Tax,
2380
2381
  e.product.unitMultiplier
2381
- ) : R(e) ? M(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
2382
- itemOffered: (e) => F(e) ? e.product : R(e) ? {
2382
+ ) : F(e) ? M(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
2383
+ itemOffered: (e) => R(e) ? e.product : F(e) ? {
2383
2384
  ...e.product,
2384
2385
  attachmentsValues: e.attachments
2385
2386
  } : null,
2386
- quantity: (e) => F(e) ? e.AvailableQuantity ?? 0 : R(e) ? e.quantity : null,
2387
- isGift: (e) => R(e) ? e.isGift ?? !1 : null
2387
+ quantity: (e) => R(e) ? e.AvailableQuantity ?? 0 : F(e) ? e.quantity : null,
2388
+ isGift: (e) => F(e) ? e.isGift ?? !1 : null,
2389
+ priceToken: (e) => R(e) ? e.PriceToken ?? null : null
2388
2390
  }, Xr = ({ linkText: e }) => `/${e}/p`, Yr = ({
2389
2391
  offer: e,
2390
2392
  seller: n,
@@ -2397,7 +2399,7 @@ const Wr = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
2397
2399
  imageText: "image",
2398
2400
  imageUrl: "https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg",
2399
2401
  imageLabel: "label"
2400
- }, ie = (e, n) => `${e}-${n}`, Xe = (e, n) => `/${ie(e, n)}/p`, Kr = (e) => Array.isArray(e) && e.length > 0 ? e : null;
2402
+ }, ie = (e, n) => `${e}-${n}`, Ye = (e, n) => `/${ie(e, n)}/p`, Kr = (e) => Array.isArray(e) && e.length > 0 ? e : null;
2401
2403
  function we(e) {
2402
2404
  return e.replace(/^\/+|\/+$/g, "");
2403
2405
  }
@@ -2449,28 +2451,28 @@ const Qr = (e, n) => {
2449
2451
  productId: c
2450
2452
  },
2451
2453
  itemId: l
2452
- } = e, p = Qr(s, o), u = r[p], h = we(u).split("/"), f = t.storage.locale;
2454
+ } = e, g = Qr(s, o), u = r[g], h = we(u).split("/"), f = t.storage.locale;
2453
2455
  if (Q(t) && f) {
2454
2456
  const v = await De(t, c, f);
2455
2457
  if (v) {
2456
2458
  const d = new Set(
2457
- we(s[p]).split("/").filter(Boolean)
2458
- ), g = v.categories.filter((y) => d.has(y.id.toString())).sort(
2459
+ we(s[g]).split("/").filter(Boolean)
2460
+ ), p = v.categories.filter((y) => d.has(y.id.toString())).sort(
2459
2461
  (y, O) => y.fullPath.split("/").length - O.fullPath.split("/").length
2460
2462
  );
2461
- if (g.length === h.length)
2463
+ if (p.length === h.length)
2462
2464
  return {
2463
2465
  itemListElement: [
2464
2466
  // Category items: both name and slug come from Catalog Dataplane, ensuring
2465
2467
  // they are always consistent with each other for the requested locale.
2466
- ...g.map((y, O) => ({
2468
+ ...p.map((y, O) => ({
2467
2469
  name: y.name,
2468
2470
  item: `/${y.fullPathUriName}/`,
2469
2471
  position: O + 1
2470
2472
  })),
2471
2473
  {
2472
2474
  name: i,
2473
- item: Xe(v.linkId, l),
2475
+ item: Ye(v.linkId, l),
2474
2476
  position: h.length + 1
2475
2477
  }
2476
2478
  ],
@@ -2481,16 +2483,16 @@ const Qr = (e, n) => {
2481
2483
  return {
2482
2484
  itemListElement: [
2483
2485
  ...h.map((v, d) => {
2484
- const g = `/${h.slice(0, d + 1).map(ae).join("/")}/`;
2486
+ const p = `/${h.slice(0, d + 1).map(ae).join("/")}/`;
2485
2487
  return {
2486
2488
  name: v,
2487
- item: g,
2489
+ item: p,
2488
2490
  position: d + 1
2489
2491
  };
2490
2492
  }),
2491
2493
  {
2492
2494
  name: i,
2493
- item: Xe(a, l),
2495
+ item: Ye(a, l),
2494
2496
  position: h.length + 1
2495
2497
  }
2496
2498
  ],
@@ -2526,7 +2528,7 @@ const Qr = (e, n) => {
2526
2528
  seller: n,
2527
2529
  product: e
2528
2530
  })
2529
- ).sort(ln),
2531
+ ).sort(dn),
2530
2532
  isVariantOf: (e) => e,
2531
2533
  additionalProperty: ({
2532
2534
  // Search uses the name variations for specifications
@@ -2541,8 +2543,8 @@ const Qr = (e, n) => {
2541
2543
  valueReference: ne.specification
2542
2544
  }))
2543
2545
  ), i = n.map(
2544
- mn
2545
- ), a = t.map(vr);
2546
+ hn
2547
+ ), a = t.map(Or);
2546
2548
  return [
2547
2549
  ...r,
2548
2550
  ...i,
@@ -2557,14 +2559,14 @@ const Qr = (e, n) => {
2557
2559
  deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: e } }) => e,
2558
2560
  otherLocales: async (e, n, t) => {
2559
2561
  if (!Q(t)) return null;
2560
- const r = gt(t);
2562
+ const r = mt(t);
2561
2563
  if (r.length === 0) return null;
2562
- const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = mt(t), c = await De(t, i, o);
2564
+ const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = ht(t), c = await De(t, i, o);
2563
2565
  if (!c?.availableLinkIds) return null;
2564
- const { availableLinkIds: l } = c, { linkText: p } = e.isVariantOf;
2566
+ const { availableLinkIds: l } = c, { linkText: g } = e.isVariantOf;
2565
2567
  return r.map((u) => {
2566
2568
  if (u === s)
2567
- return { locale: u, slug: ie(p, a) };
2569
+ return { locale: u, slug: ie(g, a) };
2568
2570
  const h = l[u];
2569
2571
  return h ? { locale: u, slug: ie(h, a) } : null;
2570
2572
  }).filter((u) => u !== null);
@@ -2586,7 +2588,7 @@ const Qr = (e, n) => {
2586
2588
  )
2587
2589
  )
2588
2590
  }, ti = {
2589
- propertyID: (e) => e.propertyID || hn(e),
2591
+ propertyID: (e) => e.propertyID || fn(e),
2590
2592
  name: ({ name: e }) => e,
2591
2593
  value: ({ value: e }) => e,
2592
2594
  valueReference: ({ valueReference: e }) => e
@@ -2598,20 +2600,20 @@ const Qr = (e, n) => {
2598
2600
  }))
2599
2601
  ), t = Ie(
2600
2602
  n,
2601
- ({ offer: r }, { offer: i }) => ln(r, i)
2603
+ ({ offer: r }, { offer: i }) => dn(r, i)
2602
2604
  );
2603
2605
  return t ? t.sku : e[0];
2604
- }, bn = (e) => e !== "" && !Number.isNaN(Number(e)), ri = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, ii = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
2606
+ }, wn = (e) => e !== "" && !Number.isNaN(Number(e)), ri = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, ii = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
2605
2607
  const {
2606
2608
  clients: { commerce: a }
2607
2609
  } = i, { salesChannel: o } = i.storage.channel, s = n?.trim();
2608
2610
  if (!s || !ri.test(s))
2609
- throw new T(`Invalid campaignVrn: "${n}"`);
2611
+ throw new _(`Invalid campaignVrn: "${n}"`);
2610
2612
  const c = t?.trim();
2611
2613
  if (t != null && !c)
2612
- throw new T("Invalid userId: must be a non-empty string");
2614
+ throw new _("Invalid userId: must be a non-empty string");
2613
2615
  if (r != null && (!Array.isArray(r) || r.some((f) => !f?.trim())))
2614
- throw new T(
2616
+ throw new _(
2615
2617
  "Invalid products: must be an array of non-empty strings"
2616
2618
  );
2617
2619
  const l = await a.recommendation.recommendations({
@@ -2620,16 +2622,16 @@ const Qr = (e, n) => {
2620
2622
  products: r ?? [],
2621
2623
  salesChannel: o ?? void 0,
2622
2624
  locale: i.storage.locale
2623
- }), { campaign: p, correlationId: u } = l;
2625
+ }), { campaign: g, correlationId: u } = l;
2624
2626
  return {
2625
2627
  products: (l.products ?? []).map((f) => {
2626
2628
  const v = ce(f.items);
2627
2629
  return v ? N(v, f) : null;
2628
2630
  }).filter((f) => !!f),
2629
2631
  correlationId: u,
2630
- campaign: p
2632
+ campaign: g
2631
2633
  };
2632
- }, Ye = {
2634
+ }, Je = {
2633
2635
  price_desc: "price:desc",
2634
2636
  price_asc: "price:asc",
2635
2637
  orders_desc: "orders:desc",
@@ -2640,11 +2642,11 @@ const Qr = (e, n) => {
2640
2642
  score_desc: ""
2641
2643
  }, ai = async (e, { operationId: n }, { clients: { commerce: t } }) => {
2642
2644
  if (!n)
2643
- throw new T("Missing operationId");
2645
+ throw new _("Missing operationId");
2644
2646
  return t.orderEntry.getOperation({ operationId: n });
2645
2647
  }, oi = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
2646
2648
  if (!n)
2647
- throw new T("Missing orderFormId");
2649
+ throw new _("Missing orderFormId");
2648
2650
  const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: n });
2649
2651
  return (r ?? []).map((i) => ({
2650
2652
  id: i.id,
@@ -2662,15 +2664,15 @@ async function si(e, n, t, r) {
2662
2664
  const i = n.slice(0, n.lastIndexOf("-"));
2663
2665
  return (await De(e, t, r))?.linkId === i;
2664
2666
  }
2665
- const wn = "Invalid SkuId", Dn = "Slug was set but the fetched sku does not satisfy the slug condition.", ci = (e) => X(e) || e instanceof Error && (e.message === wn || e.message.startsWith(Dn));
2667
+ const Dn = "Invalid SkuId", Pn = "Slug was set but the fetched sku does not satisfy the slug condition.", ci = (e) => X(e) || e instanceof Error && (e.message === Dn || e.message.startsWith(Pn));
2666
2668
  async function li(e, n, t, r) {
2667
2669
  const { linkText: i, productId: a } = n.isVariantOf;
2668
- if (!(!t || !i || t.startsWith(i) || Q(e) && r && bn(t.split("-").pop() ?? "") && await si(e, t, a, r)))
2669
- throw new Error(`${Dn} slug: ${t}, linkText: ${i}`);
2670
+ if (!(!t || !i || t.startsWith(i) || Q(e) && r && wn(t.split("-").pop() ?? "") && await si(e, t, a, r)))
2671
+ throw new Error(`${Pn} slug: ${t}, linkText: ${i}`);
2670
2672
  }
2671
2673
  async function di(e, n) {
2672
2674
  if (n == null)
2673
- throw new T("Missing slug or id");
2675
+ throw new _("Missing slug or id");
2674
2676
  const {
2675
2677
  clients: { commerce: t, search: r }
2676
2678
  } = e, i = await t.catalog.portal.pagetype(`${n}/p`);
@@ -2686,15 +2688,15 @@ async function di(e, n) {
2686
2688
  }
2687
2689
  const ui = {
2688
2690
  product: async (e, { locator: n }, t) => {
2689
- const r = xe(n), i = Ve(n), a = cr(n), o = sr(n);
2691
+ const r = xe(n), i = Ve(n), a = lr(n), o = cr(n);
2690
2692
  r && ve(t, r), i && Oe(t, i);
2691
2693
  const {
2692
2694
  loaders: { skuLoader: s }
2693
2695
  } = t;
2694
2696
  try {
2695
2697
  const c = a ?? o?.split("-").pop() ?? "";
2696
- if (!bn(c))
2697
- throw new Error(wn);
2698
+ if (!wn(c))
2699
+ throw new Error(Dn);
2698
2700
  const l = await s.load(c);
2699
2701
  return await li(t, l, o, i), l;
2700
2702
  } catch (c) {
@@ -2720,21 +2722,21 @@ const ui = {
2720
2722
  selectedFacets: a,
2721
2723
  sponsoredCount: o
2722
2724
  }, s) => {
2723
- const c = xe(a), l = Ve(a), p = or(a);
2725
+ const c = xe(a), l = Ve(a), g = sr(a);
2724
2726
  c && ve(s, c), l && Oe(s, l);
2725
2727
  const u = t ? Number(t) : 0, h = {
2726
2728
  page: Math.ceil(u / n) || 0,
2727
2729
  count: n,
2728
2730
  query: i ?? void 0,
2729
- sort: Ye[r ?? "score_desc"] ?? Ye.score_desc,
2731
+ sort: Je[r ?? "score_desc"] ?? Je.score_desc,
2730
2732
  selectedFacets: a?.flatMap(Me) ?? [],
2731
2733
  sponsoredCount: o ?? void 0
2732
2734
  };
2733
- if (p) {
2735
+ if (g) {
2734
2736
  const d = (await s.clients.commerce.catalog.products.crossselling({
2735
- type: un[p.key],
2736
- productId: p.value
2737
- })).map((m) => m.productId).slice(0, n), g = s.clients.search.productsByIdentifier({ field: "id", values: d }).then((m) => ({
2737
+ type: pn[g.key],
2738
+ productId: g.value
2739
+ })).map((m) => m.productId).slice(0, n), p = s.clients.search.productsByIdentifier({ field: "id", values: d }).then((m) => ({
2738
2740
  products: m,
2739
2741
  recordsFiltered: m.length,
2740
2742
  pagination: {
@@ -2757,7 +2759,7 @@ const ui = {
2757
2759
  fuzzy: "0",
2758
2760
  searchId: ""
2759
2761
  }));
2760
- return { searchArgs: h, productSearchPromise: g };
2762
+ return { searchArgs: h, productSearchPromise: p };
2761
2763
  }
2762
2764
  const f = s.clients.search.products(h);
2763
2765
  return { searchArgs: h, productSearchPromise: f };
@@ -2832,7 +2834,7 @@ const ui = {
2832
2834
  metaTagDescription: f.metaTagDescription,
2833
2835
  availableLinkIds: null,
2834
2836
  entityType: "brand"
2835
- })), ...c].filter((f) => !!dn.slug(f, null, r, null));
2837
+ })), ...c].filter((f) => !!un.slug(f, null, r, null));
2836
2838
  return {
2837
2839
  pageInfo: {
2838
2840
  hasNextPage: h.length - a > n,
@@ -2882,10 +2884,10 @@ const ui = {
2882
2884
  geoCoordinates: t,
2883
2885
  country: r,
2884
2886
  salesChannel: i
2885
- }))?.[0], { id: l, sellers: p } = c;
2887
+ }))?.[0], { id: l, sellers: g } = c;
2886
2888
  return {
2887
2889
  id: l,
2888
- sellers: p
2890
+ sellers: g
2889
2891
  };
2890
2892
  },
2891
2893
  profile: async (e, { id: n }, t) => {
@@ -2910,7 +2912,7 @@ const ui = {
2910
2912
  userOrder: async (e, { orderId: n }, t) => {
2911
2913
  try {
2912
2914
  if (!n)
2913
- throw new T("Missing orderId");
2915
+ throw new _("Missing orderId");
2914
2916
  const {
2915
2917
  clients: { commerce: r }
2916
2918
  } = t, i = await r.oms.userOrder({ orderId: n });
@@ -2919,7 +2921,7 @@ const ui = {
2919
2921
  let a = null;
2920
2922
  try {
2921
2923
  const c = await r.oms.getCommercialAuthorizationsByOrderId({ orderId: n });
2922
- a = pn(c);
2924
+ a = gn(c);
2923
2925
  } catch {
2924
2926
  }
2925
2927
  const s = (await r.masterData.getShopperById({
@@ -2958,7 +2960,7 @@ const ui = {
2958
2960
  a = { message: i };
2959
2961
  }
2960
2962
  const o = a?.message || i;
2961
- throw X(r) ? new $(`No order found for id ${n}. ${o}.`) : Qn(r) ? new J(
2963
+ throw X(r) ? new $(`No order found for id ${n}. ${o}.`) : Zn(r) ? new J(
2962
2964
  `You are forbidden to interact with order with id ${n}. ${o}.`
2963
2965
  ) : r;
2964
2966
  }
@@ -2996,8 +2998,8 @@ const ui = {
2996
2998
  userId: c
2997
2999
  });
2998
3000
  if (l) {
2999
- const p = [l.firstName, l.lastName].filter(Boolean).join(" ");
3000
- p && o.set(c, p);
3001
+ const g = [l.firstName, l.lastName].filter(Boolean).join(" ");
3002
+ g && o.set(c, g);
3001
3003
  }
3002
3004
  } catch {
3003
3005
  }
@@ -3034,7 +3036,7 @@ const ui = {
3034
3036
  account: r,
3035
3037
  headers: i,
3036
3038
  clients: { commerce: a }
3037
- } = t, s = Y(z(i?.cookie ?? "", r))?.userId ?? "", [c, l, p] = await Promise.all([
3039
+ } = t, s = Y(z(i?.cookie ?? "", r))?.userId ?? "", [c, l, g] = await Promise.all([
3038
3040
  a.session("").catch(() => null),
3039
3041
  s ? a.masterData.getShopperById({ userId: s }).catch(() => null) : Promise.resolve(null),
3040
3042
  s ? a.licenseManager.getUserRoles({ userId: s }).catch(() => null) : Promise.resolve(null)
@@ -3044,7 +3046,7 @@ const ui = {
3044
3046
  name: f,
3045
3047
  email: h?.storeUserEmail?.value ?? "",
3046
3048
  phone: u?.phone ?? "",
3047
- role: p?.Roles?.map((v) => v.Name) ?? [],
3049
+ role: g?.Roles?.map((v) => v.Name) ?? [],
3048
3050
  orgUnit: h?.unitName?.value ?? ""
3049
3051
  };
3050
3052
  },
@@ -3062,13 +3064,22 @@ const ui = {
3062
3064
  const c = await a.session("").catch(() => null);
3063
3065
  if (!c)
3064
3066
  return null;
3065
- const l = c.namespaces.profile ?? null, p = await a.masterData.getContractById({
3066
- contractId: l?.id?.value ?? ""
3067
- });
3067
+ const l = c.namespaces.profile ?? null, g = c.namespaces.shopper ?? null, u = c.namespaces.authentication ?? null, h = Xe(c) || o?.customerId?.trim() || "";
3068
+ let f = null;
3069
+ if (h)
3070
+ try {
3071
+ f = await a.masterData.getContractById({ contractId: h });
3072
+ } catch (p) {
3073
+ console.error(
3074
+ `Error while getting contract data for contract ID (${h}).`,
3075
+ p
3076
+ );
3077
+ }
3078
+ const v = `${(g?.firstName?.value ?? "").trim()} ${(g?.lastName?.value ?? "").trim()}`.trim();
3068
3079
  return {
3069
- name: On(p, l) || "",
3070
- email: l?.email?.value || "",
3071
- id: l?.id?.value || ""
3080
+ name: Cn(f, l) || v || "",
3081
+ email: l?.email?.value || u?.storeUserEmail?.value || "",
3082
+ id: l?.id?.value || u?.customerId?.value || o?.customerId?.trim() || ""
3072
3083
  // createdAt: '',
3073
3084
  };
3074
3085
  }
@@ -3086,7 +3097,7 @@ const ui = {
3086
3097
  // Contract list from VTEX session `shopper.availableContracts`.
3087
3098
  availableContracts: async (e, { orgUnitId: n }, t) => {
3088
3099
  if (!n)
3089
- throw new T("Missing orgUnitId");
3100
+ throw new _("Missing orgUnitId");
3090
3101
  const {
3091
3102
  account: r,
3092
3103
  headers: i,
@@ -3103,10 +3114,10 @@ const ui = {
3103
3114
  throw new J(
3104
3115
  "You are not allowed to list contracts for this organization unit"
3105
3116
  );
3106
- const p = Br(
3117
+ const g = $r(
3107
3118
  o?.namespaces.shopper
3108
- ), u = Mr(o) || c?.customerId?.trim() || "";
3109
- return zr(p, u);
3119
+ ), u = Xe(o) || c?.customerId?.trim() || "";
3120
+ return zr(g, u);
3110
3121
  },
3111
3122
  pickupPoints: async (e, { geoCoordinates: n }, t) => {
3112
3123
  const {
@@ -3143,12 +3154,12 @@ const ui = {
3143
3154
  const { productSearchPromise: a } = e, [o, s] = await Promise.all([
3144
3155
  r.suggestedTerms(i),
3145
3156
  a
3146
- ]), c = s.products.map((p) => {
3147
- const u = ce(p.items);
3148
- return u && N(u, p);
3149
- }).filter((p) => !!p), { searches: l } = o;
3157
+ ]), c = s.products.map((g) => {
3158
+ const u = ce(g.items);
3159
+ return u && N(u, g);
3160
+ }).filter((g) => !!g), { searches: l } = o;
3150
3161
  return {
3151
- terms: l.map((p) => ({ value: p.term, count: p.count })),
3162
+ terms: l.map((g) => ({ value: g.term, count: g.count })),
3152
3163
  products: c
3153
3164
  };
3154
3165
  },
@@ -3226,15 +3237,15 @@ const ui = {
3226
3237
  carrier: (e) => e?.friendlyName ?? e?.name ?? "",
3227
3238
  price: (e) => e?.price ? e.price / 100 : e?.price,
3228
3239
  localizedEstimates: (e) => e?.shippingEstimate ? An(e.shippingEstimate) : ""
3229
- }, Je = "skuvariation";
3230
- function Ke(e, n) {
3231
- const t = `${Je}${n}`.toLowerCase(), r = e.find(
3240
+ }, Ke = "skuvariation";
3241
+ function Qe(e, n) {
3242
+ const t = `${Ke}${n}`.toLowerCase(), r = e.find(
3232
3243
  (a) => a.imageLabel === t
3233
3244
  );
3234
3245
  if (r)
3235
3246
  return r;
3236
3247
  const i = e.find(
3237
- (a) => a.imageLabel === Je
3248
+ (a) => a.imageLabel === Ke
3238
3249
  );
3239
3250
  return i || e[0];
3240
3251
  }
@@ -3250,7 +3261,7 @@ function vi(e, n, t) {
3250
3261
  r[s] = `${t}-${i.itemId}`;
3251
3262
  }), r;
3252
3263
  }
3253
- function Qe(e) {
3264
+ function Ze(e) {
3254
3265
  const n = {};
3255
3266
  return e.forEach((t) => {
3256
3267
  n[t.name] = t.values[0];
@@ -3286,16 +3297,16 @@ function wi(e, n, t) {
3286
3297
  if (!o || i.has(c))
3287
3298
  return;
3288
3299
  i.add(c);
3289
- const l = Ke(
3300
+ const l = Qe(
3290
3301
  a.images,
3291
3302
  n
3292
- ), p = {
3303
+ ), g = {
3293
3304
  src: l.imageUrl,
3294
3305
  alt: l.imageLabel ?? "",
3295
3306
  label: `${n}: ${o.values[0]}`,
3296
3307
  value: o.values[0]
3297
3308
  };
3298
- r[o.name] ? r[o.name].push(p) : r[o.name] = [p];
3309
+ r[o.name] ? r[o.name].push(g) : r[o.name] = [g];
3299
3310
  return;
3300
3311
  }
3301
3312
  a.variations.forEach((c) => {
@@ -3303,12 +3314,12 @@ function wi(e, n, t) {
3303
3314
  if (i.has(l))
3304
3315
  return;
3305
3316
  i.add(l);
3306
- const p = Ke(
3317
+ const g = Qe(
3307
3318
  a.images,
3308
3319
  c.name
3309
3320
  ), u = {
3310
- src: p.imageUrl,
3311
- alt: p.imageText ?? "",
3321
+ src: g.imageUrl,
3322
+ alt: g.imageText ?? "",
3312
3323
  label: `${c.name}: ${c.values[0]}`,
3313
3324
  value: c.values[0]
3314
3325
  };
@@ -3317,7 +3328,7 @@ function wi(e, n, t) {
3317
3328
  }), bi(r);
3318
3329
  }
3319
3330
  const Di = {
3320
- activeVariations: (e) => Qe(e.variations),
3331
+ activeVariations: (e) => Ze(e.variations),
3321
3332
  allVariantsByName: (e) => Oi(e.isVariantOf.skuSpecifications),
3322
3333
  slugsMap: (e, n) => vi(
3323
3334
  e.isVariantOf.items,
@@ -3325,7 +3336,7 @@ const Di = {
3325
3336
  e.isVariantOf.linkText
3326
3337
  ),
3327
3338
  availableVariations: (e, n) => {
3328
- const t = n.dominantVariantName ?? e.variations[0]?.name, i = Qe(e.variations)[t];
3339
+ const t = n.dominantVariantName ?? e.variations[0]?.name, i = Ze(e.variations)[t];
3329
3340
  return wi(
3330
3341
  e.isVariantOf.items,
3331
3342
  t,
@@ -3333,32 +3344,32 @@ const Di = {
3333
3344
  );
3334
3345
  },
3335
3346
  allVariantProducts: (e) => e.isVariantOf.items.map((n) => N(n, e.isVariantOf))
3336
- }, Ai = {
3347
+ }, Pi = {
3337
3348
  "pickup-in-point": "Pickup",
3338
3349
  delivery: "Delivery",
3339
3350
  pickup: "Pickup",
3340
3351
  "take-away": "Take away",
3341
3352
  "": ""
3342
- }, Pi = {
3353
+ }, Ai = {
3343
3354
  deliveryOptionsData: (e) => {
3344
3355
  const { shippingData: n, items: t } = e, r = n?.logisticsInfo || [], i = n?.selectedAddresses || n?.availableAddresses || [n?.address], a = r.reduce(
3345
- (l, p) => {
3346
- const u = p?.selectedSla || "", h = p?.selectedDeliveryChannel || p?.deliveryChannel || "", f = p?.deliveryCompany || "", v = p?.deliveryWindow, d = p?.pickupStoreInfo, g = p?.shippingEstimate || "", m = p?.shippingEstimate ? An(p?.shippingEstimate) : "", y = p?.shippingEstimateDate || "", O = p?.addressId || "", w = p?.itemIndex ?? 0, C = t?.[w], P = C?.seller || "", S = `${u}|${h}|${f}|${P}|${g}|${y}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, D = i?.find(
3347
- (_) => _?.addressId === O
3348
- ), A = `${Ai[h] || ""} ${m} ${D?.neighborhood ? `to ${D?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: U, taxPriceTags: b } = Ui(
3356
+ (l, g) => {
3357
+ const u = g?.selectedSla || "", h = g?.selectedDeliveryChannel || g?.deliveryChannel || "", f = g?.deliveryCompany || "", v = g?.deliveryWindow, d = g?.pickupStoreInfo, p = g?.shippingEstimate || "", m = g?.shippingEstimate ? An(g?.shippingEstimate) : "", y = g?.shippingEstimateDate || "", O = g?.addressId || "", w = g?.itemIndex ?? 0, C = t?.[w], A = C?.seller || "", S = `${u}|${h}|${f}|${A}|${p}|${y}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, D = i?.find(
3358
+ (T) => T?.addressId === O
3359
+ ), P = `${Pi[h] || ""} ${m} ${D?.neighborhood ? `to ${D?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: k, taxPriceTags: b } = ki(
3349
3360
  C?.priceTags ?? []
3350
- ), k = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (U ?? 0);
3361
+ ), U = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (k ?? 0);
3351
3362
  return l[S] || (l[S] = {
3352
3363
  // static fields
3353
3364
  selectedSla: u,
3354
3365
  deliveryChannel: h,
3355
3366
  deliveryCompany: f,
3356
3367
  deliveryWindow: v,
3357
- shippingEstimate: g,
3368
+ shippingEstimate: p,
3358
3369
  shippingEstimateDate: y,
3359
- seller: P,
3370
+ seller: A,
3360
3371
  friendlyShippingEstimate: m,
3361
- friendlyDeliveryOptionName: A,
3372
+ friendlyDeliveryOptionName: P,
3362
3373
  address: D,
3363
3374
  pickupStoreInfo: d,
3364
3375
  // dynamic fields
@@ -3374,10 +3385,10 @@ const Di = {
3374
3385
  sellingPrice: C?.sellingPrice || 0,
3375
3386
  imageUrl: C?.imageUrl || "",
3376
3387
  taxPriceTags: b ?? [],
3377
- taxPriceTagsTotal: U ?? 0,
3388
+ taxPriceTagsTotal: k ?? 0,
3378
3389
  tax: C?.tax || 0,
3379
- total: k
3380
- }), l[S].quantityOfDifferentItems = (l[S].quantityOfDifferentItems ?? 0) + 1, l[S].total = (l[S].total ?? 0) + k), l;
3390
+ total: U
3391
+ }), l[S].quantityOfDifferentItems = (l[S].quantityOfDifferentItems ?? 0) + 1, l[S].total = (l[S].total ?? 0) + U), l;
3381
3392
  },
3382
3393
  {}
3383
3394
  ), o = Object.values(a), s = n?.contactInformation?.[0], c = {
@@ -3403,7 +3414,7 @@ const Di = {
3403
3414
  ) || [];
3404
3415
  }
3405
3416
  };
3406
- function Ui(e) {
3417
+ function ki(e) {
3407
3418
  const t = e.filter(
3408
3419
  (i) => i?.name?.includes("TAX")
3409
3420
  ), r = t.reduce(
@@ -3415,28 +3426,28 @@ function Ui(e) {
3415
3426
  taxPriceTagsTotal: r
3416
3427
  };
3417
3428
  }
3418
- const ki = {
3419
- StoreCollection: dn,
3420
- StoreAggregateOffer: er,
3429
+ const Ui = {
3430
+ StoreCollection: un,
3431
+ StoreAggregateOffer: nr,
3421
3432
  StoreProduct: Zr,
3422
3433
  StoreSeo: hi,
3423
- StoreFacet: lr,
3424
- StoreFacetBoolean: dr,
3425
- StoreFacetRange: ur,
3426
- StoreFacetValueBoolean: pr,
3434
+ StoreFacet: dr,
3435
+ StoreFacetBoolean: ur,
3436
+ StoreFacetRange: pr,
3437
+ StoreFacetValueBoolean: gr,
3427
3438
  StoreOffer: Hr,
3428
- StoreAggregateRating: nr,
3439
+ StoreAggregateRating: tr,
3429
3440
  StoreReview: pi,
3430
3441
  StoreProductGroup: ni,
3431
3442
  StoreSearchResult: mi,
3432
3443
  StorePropertyValue: ti,
3433
3444
  SkuVariants: Di,
3434
3445
  ShippingSLA: Ii,
3435
- UserOrderResult: Pi,
3446
+ UserOrderResult: Ai,
3436
3447
  ObjectOrString: Gr,
3437
3448
  Query: ui,
3438
3449
  Mutation: qr
3439
- }, _i = () => ki, Ti = `"""
3450
+ }, Ti = () => Ui, _i = `"""
3440
3451
  Address information.
3441
3452
  """
3442
3453
  type Address {
@@ -3984,6 +3995,12 @@ type StoreOffer {
3984
3995
  Whether this offer is a gift (e.g. free promotional item).
3985
3996
  """
3986
3997
  isGift: Boolean
3998
+ """
3999
+ Signed price token (JWT) used by the Pricing Fallback feature. When present, it should be
4000
+ forwarded to Checkout on add-to-cart so the platform can trust the offer's price even if
4001
+ the Pricing System is unavailable. May be null when the signing step fails or the feature is disabled.
4002
+ """
4003
+ priceToken: String
3987
4004
  }
3988
4005
 
3989
4006
  """
@@ -4010,6 +4027,10 @@ input IStoreOffer {
4010
4027
  Number of items offered.
4011
4028
  """
4012
4029
  quantity: Int!
4030
+ """
4031
+ Signed price token (JWT) from the Pricing Fallback feature, forwarded to Checkout on add-to-cart.
4032
+ """
4033
+ priceToken: String
4013
4034
  }
4014
4035
  `, Hi = `"""
4015
4036
  Information of a specific order.
@@ -7317,7 +7338,7 @@ type UserOrderBudgetAllocationLinkedEntity {
7317
7338
  id: String
7318
7339
  }
7319
7340
  `, ha = /* @__PURE__ */ Object.assign({
7320
- "./address.graphql": Ti,
7341
+ "./address.graphql": _i,
7321
7342
  "./advertisement.graphql": Ei,
7322
7343
  "./aggregateOffer.graphql": Ri,
7323
7344
  "./aggregateRating.graphql": Fi,
@@ -7355,9 +7376,9 @@ type UserOrderBudgetAllocationLinkedEntity {
7355
7376
  "./skuVariants.graphql": pa,
7356
7377
  "./status.graphql": ga,
7357
7378
  "./userOrder.graphql": ma
7358
- }), fa = Tn(
7359
- Object.values(ha).map((e) => En(e)).reduce(
7360
- (e, n) => Ze([e, n], { sort: !0 })
7379
+ }), fa = En(
7380
+ Object.values(ha).map((e) => Rn(e)).reduce(
7381
+ (e, n) => en([e, n], { sort: !0 })
7361
7382
  )
7362
7383
  ), Sa = fa, Na = async (e) => L.context.with(
7363
7384
  L.propagation.extract(L.context.active(), e.OTEL),
@@ -7366,47 +7387,47 @@ type UserOrderBudgetAllocationLinkedEntity {
7366
7387
  flags: e.flags ?? {},
7367
7388
  locale: e.locale,
7368
7389
  cookies: /* @__PURE__ */ new Map()
7369
- }, n.account = e.account, n.OTEL = e.OTEL, n.discoveryConfig = e.discoveryConfig, n.clients = zt(e, n), n.loaders = Jt(e, n), n)
7390
+ }, n.account = e.account, n.OTEL = e.OTEL, n.discoveryConfig = e.discoveryConfig, n.clients = Vt(e, n), n.loaders = Kt(e, n), n)
7370
7391
  );
7371
7392
  function ya() {
7372
- const e = _i(), n = {};
7393
+ const e = Ti(), n = {};
7373
7394
  for (const [t, r] of Object.entries(e))
7374
7395
  n[t] = Object.fromEntries(
7375
- Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, Kn(a, `${t}(${i})`)])
7396
+ Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, Qn(a, `${t}(${i})`)])
7376
7397
  );
7377
7398
  return n;
7378
7399
  }
7379
7400
  function La(e) {
7380
- const t = Jn([
7381
- Yn,
7382
- Gn
7401
+ const t = Kn([
7402
+ Jn,
7403
+ Hn
7383
7404
  ])(ya(), Sa);
7384
- return e && Rn(e) ? kn({
7405
+ return e && Fn(e) ? Tn({
7385
7406
  schemas: [t, e]
7386
7407
  }) : t;
7387
7408
  }
7388
7409
  export {
7389
- Gn as AuthDirective,
7390
- T as BadRequestError,
7391
- Yn as CacheControlDirective,
7392
- Bn as CommercialAuthorizationStatus,
7410
+ Hn as AuthDirective,
7411
+ _ as BadRequestError,
7412
+ Jn as CacheControlDirective,
7413
+ $n as CommercialAuthorizationStatus,
7393
7414
  ee as FastStoreError,
7394
7415
  J as ForbiddenError,
7395
7416
  Na as GraphqlVtexContextFactory,
7396
7417
  La as GraphqlVtexSchema,
7397
7418
  $ as NotFoundError,
7398
- $n as StoreCollectionType,
7399
- Mn as StoreFacetType,
7400
- zn as StoreSort,
7401
- Vn as StoreStatus,
7419
+ Mn as StoreCollectionType,
7420
+ zn as StoreFacetType,
7421
+ Vn as StoreSort,
7422
+ xn as StoreStatus,
7402
7423
  te as UnauthorizedError,
7403
- xn as UserOrderInvoiceType,
7424
+ qn as UserOrderInvoiceType,
7404
7425
  Ra as isBadRequestError,
7405
7426
  Ea as isFastStoreError,
7406
- Qn as isForbiddenError,
7427
+ Zn as isForbiddenError,
7407
7428
  X as isNotFoundError,
7408
7429
  Fa as isUnauthorizedError,
7409
- Ta as stringifyCacheControl,
7430
+ _a as stringifyCacheControl,
7410
7431
  Sa as typeDefs,
7411
- Jn as withDirectives
7432
+ Kn as withDirectives
7412
7433
  };