@soma-vertical-web/multi-lib 1.0.15 → 1.0.16

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.
Files changed (38) hide show
  1. package/cms/ContentTypes/LPLojas/LPLojaClientWrapper.d.ts +3 -0
  2. package/cms/ContentTypes/LPLojas/LPLojasContent.d.ts +3 -0
  3. package/cms/ContentTypes/LPLojas/helpers.d.ts +12 -0
  4. package/cms/ContentTypes/LPLojas/typing.d.ts +32 -0
  5. package/cms/index.d.ts +1 -0
  6. package/cms/server.d.ts +1 -0
  7. package/contexts/contexts/lplojas/Context.d.ts +6 -0
  8. package/contexts/index.d.ts +4 -0
  9. package/data/api/master-data/search/index.d.ts +1 -1
  10. package/index.js +14 -14
  11. package/index.mjs +3709 -3465
  12. package/index2.js +1 -1
  13. package/index2.mjs +729 -651
  14. package/layout/index.d.ts +34 -0
  15. package/layout/template/LPLojas/Composite/Content/Content.d.ts +12 -0
  16. package/layout/template/LPLojas/Composite/Content/index.d.ts +1 -0
  17. package/layout/template/LPLojas/Composite/Details/Details.d.ts +7 -0
  18. package/layout/template/LPLojas/Composite/Details/Item.d.ts +7 -0
  19. package/layout/template/LPLojas/Composite/Details/Vendor.d.ts +7 -0
  20. package/layout/template/LPLojas/Composite/Details/index.d.ts +1 -0
  21. package/layout/template/LPLojas/Composite/Details/interfaces.d.ts +18 -0
  22. package/layout/template/LPLojas/Composite/DropDown/DropDown.d.ts +7 -0
  23. package/layout/template/LPLojas/Composite/DropDown/index.d.ts +1 -0
  24. package/layout/template/LPLojas/Composite/DropDown/interfaces.d.ts +10 -0
  25. package/layout/template/LPLojas/Composite/ReturnButton/ReturnButton.d.ts +11 -0
  26. package/layout/template/LPLojas/Composite/ReturnButton/index.d.ts +1 -0
  27. package/layout/template/LPLojas/Composite/Root.d.ts +7 -0
  28. package/layout/template/LPLojas/Composite/Section/Section.d.ts +12 -0
  29. package/layout/template/LPLojas/Composite/Section/index.d.ts +1 -0
  30. package/layout/template/LPLojas/Composite/Select/Select.d.ts +10 -0
  31. package/layout/template/LPLojas/Composite/Select/index.d.ts +1 -0
  32. package/layout/template/LPLojas/Composite/Title/Title.d.ts +7 -0
  33. package/layout/template/LPLojas/Composite/Title/index.d.ts +1 -0
  34. package/layout/template/LPLojas/constant.d.ts +1 -0
  35. package/layout/template/LPLojas/index.d.ts +35 -0
  36. package/layout/template/LPLojas/interfaces.d.ts +18 -0
  37. package/package.json +1 -1
  38. package/style.css +1 -1
package/index2.mjs CHANGED
@@ -1,68 +1,68 @@
1
- import { jsx as b, jsxs as N, Fragment as L } from "react/jsx-runtime";
2
- import { x as E, r as j, S as ce, y as le, z as ue, a as de, v as pe, t as me, A as fe, p as ge, o as M, B as he, C as ye, D as be, e as Ie } from "./index-CkpbvnLx.mjs";
1
+ import { jsx as b, jsxs as N, Fragment as B } from "react/jsx-runtime";
2
+ import { x as S, r as j, S as ce, y as le, z as ue, a as de, v as pe, t as me, A as fe, p as ge, o as M, B as he, C as ye, D as be, e as Ie } from "./index-Dj1bg0lu.mjs";
3
3
  import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
4
4
  import * as a from "yup";
5
5
  import Ce from "sanitize-html";
6
6
  const Re = async ({
7
7
  children: t,
8
8
  ClientCartProvider: e,
9
- ...n
9
+ ...r
10
10
  }) => {
11
- const { data: r } = await E(
11
+ const { data: n } = await S(
12
12
  "mini_cart",
13
- n
13
+ r
14
14
  );
15
- return /* @__PURE__ */ b(e, { ...r ? Array.isArray(r) ? { data: r[0] } : { data: r } : {}, children: t });
15
+ return /* @__PURE__ */ b(e, { ...n ? Array.isArray(n) ? { data: n[0] } : { data: n } : {}, children: t });
16
16
  }, ve = ({
17
17
  slug: t,
18
18
  data: e,
19
- SectionZone: n,
20
- COMMON_PAGE_COLUMN_GAP: r,
19
+ SectionZone: r,
20
+ COMMON_PAGE_COLUMN_GAP: n,
21
21
  identifyWhoIsFirst: s
22
22
  }) => {
23
23
  const o = e == null ? void 0 : e.find(
24
24
  (d) => {
25
- var C, m, p, y;
26
- return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.deviceType) === "desktop" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
25
+ var I, f, m, y;
26
+ return ((f = (I = d.config) == null ? void 0 : I.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
27
27
  }
28
- ), i = o == null ? void 0 : o.config.responsive.gapCustom, c = o == null ? void 0 : o.config.responsive.gapSections, l = e == null ? void 0 : e.find(
28
+ ), i = o == null ? void 0 : o.config.responsive.gapCustom, u = o == null ? void 0 : o.config.responsive.gapSections, c = e == null ? void 0 : e.find(
29
29
  (d) => {
30
- var C, m, p, y;
31
- return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.deviceType) === "mobile" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
30
+ var I, f, m, y;
31
+ return ((f = (I = d.config) == null ? void 0 : I.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
32
32
  }
33
- ), f = l == null ? void 0 : l.config.responsive.gapCustom, u = l == null ? void 0 : l.config.responsive.gapSections;
34
- return /* @__PURE__ */ N(L, { children: [
33
+ ), p = c == null ? void 0 : c.config.responsive.gapCustom, l = c == null ? void 0 : c.config.responsive.gapSections;
34
+ return /* @__PURE__ */ N(B, { children: [
35
35
  /* @__PURE__ */ b(
36
36
  D.Column,
37
37
  {
38
- gap: i && c ? c : r,
38
+ gap: i && u ? u : n,
39
39
  className: _.classNameConcat(
40
40
  j["responsive-desktop-flex"],
41
41
  "utils-column-modifier"
42
42
  ),
43
- children: /* @__PURE__ */ b(n, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
43
+ children: /* @__PURE__ */ b(r, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
44
44
  }
45
45
  ),
46
46
  /* @__PURE__ */ b(
47
47
  D.Column,
48
48
  {
49
- gap: f && u ? u : r,
49
+ gap: p && l ? l : n,
50
50
  className: _.classNameConcat(
51
51
  j["responsive-mobile-flex"],
52
52
  "utils-column-modifier"
53
53
  ),
54
- children: /* @__PURE__ */ b(n, { data: (l == null ? void 0 : l.sections) ?? [], identifyWhoIsFirst: s })
54
+ children: /* @__PURE__ */ b(r, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
55
55
  }
56
56
  )
57
57
  ] });
58
58
  }, Se = async ({
59
59
  slug: t,
60
60
  SectionZone: e,
61
- COMMON_PAGE_COLUMN_GAP: n,
62
- identifyWhoIsFirst: r = !1,
61
+ COMMON_PAGE_COLUMN_GAP: r,
62
+ identifyWhoIsFirst: n = !1,
63
63
  ...s
64
64
  }) => {
65
- const { data: o } = await E(
65
+ const { data: o } = await S(
66
66
  "common_page",
67
67
  s
68
68
  );
@@ -72,38 +72,38 @@ const Re = async ({
72
72
  data: o,
73
73
  slug: t,
74
74
  SectionZone: e,
75
- COMMON_PAGE_COLUMN_GAP: n,
76
- identifyWhoIsFirst: r
75
+ COMMON_PAGE_COLUMN_GAP: r,
76
+ identifyWhoIsFirst: n
77
77
  }
78
78
  );
79
79
  }, Ee = async ({
80
80
  children: t,
81
81
  ClientFlagsAndTagsProvider: e,
82
- ...n
82
+ ...r
83
83
  }) => {
84
- const { data: r } = await E(
84
+ const { data: n } = await S(
85
85
  "flags_and_tags",
86
- n
86
+ r
87
87
  );
88
- return !r || !Array.isArray(r) ? null : /* @__PURE__ */ b(e, { data: r[0], children: t });
88
+ return !n || !Array.isArray(n) ? null : /* @__PURE__ */ b(e, { data: n[0], children: t });
89
89
  }, Te = async ({
90
90
  className: t,
91
91
  PAYMENT_FLAGS_DICTIONARY: e,
92
- PAYMENT_FLAGS: n,
93
- LEGAL_INFORMATION_TEXT: r,
92
+ PAYMENT_FLAGS: r,
93
+ LEGAL_INFORMATION_TEXT: n,
94
94
  ICONS: s,
95
95
  SectionZone: o,
96
96
  Footer: i,
97
- FooterSupport: c,
98
- hasFooterStamps: l,
99
- ...f
97
+ FooterSupport: u,
98
+ hasFooterStamps: c,
99
+ ...p
100
100
  }) => {
101
- var m, p, y, I, F, O, $, g, S, R, T;
102
- const { data: u } = await E("footer", f), d = Array.isArray(u) && ((m = u[0]) == null ? void 0 : m.type) === "footer" ? u[0] : null, C = {
103
- ...(p = d == null ? void 0 : d.paymentInfo) == null ? void 0 : p.paymentInfo,
101
+ var f, m, y, C, F, O, $, g, E, R, T;
102
+ const { data: l } = await S("footer", p), d = Array.isArray(l) && ((f = l[0]) == null ? void 0 : f.type) === "footer" ? l[0] : null, I = {
103
+ ...(m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo,
104
104
  acceptedFlags: Array.isArray(
105
105
  (y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
106
- ) ? (I = d == null ? void 0 : d.paymentInfo) == null ? void 0 : I.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
106
+ ) ? (C = d == null ? void 0 : d.paymentInfo) == null ? void 0 : C.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
107
107
  (v) => e[v]
108
108
  ) : []
109
109
  };
@@ -114,17 +114,17 @@ const Re = async ({
114
114
  data: { ...d },
115
115
  socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
116
116
  socialMedias: ($ = (O = d.socialMedia) == null ? void 0 : O.socialMedia) == null ? void 0 : $.medias,
117
- payments: C,
118
- hasFooterStamps: l,
117
+ payments: I,
118
+ hasFooterStamps: c,
119
119
  adornment: {
120
- ...(S = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && S.content ? {
120
+ ...(E = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && E.content ? {
121
121
  bottom: /* @__PURE__ */ b(
122
- c,
122
+ u,
123
123
  {
124
124
  content: (T = (R = d.supportInfo) == null ? void 0 : R.supportInfo) == null ? void 0 : T.content,
125
125
  CONSTANTS: {
126
126
  ICONS: s,
127
- PAYMENT_FLAGS: n,
127
+ PAYMENT_FLAGS: r,
128
128
  PAYMENT_FLAGS_DICTIONARY: e
129
129
  }
130
130
  }
@@ -132,70 +132,70 @@ const Re = async ({
132
132
  } : {},
133
133
  ...d.sections.length ? { top: /* @__PURE__ */ b(o, { data: d.sections }) } : {}
134
134
  },
135
- LEGAL_INFORMATION_TEXT: r,
135
+ LEGAL_INFORMATION_TEXT: n,
136
136
  ICONS: s
137
137
  }
138
138
  ) : null;
139
139
  }, Fe = async ({
140
140
  children: t,
141
141
  ClientHeaderProvider: e,
142
- ...n
142
+ ...r
143
143
  }) => {
144
- var o, i, c, l, f, u;
145
- const { data: r } = await E(
144
+ var o, i, u, c, p, l;
145
+ const { data: n } = await S(
146
146
  "header",
147
- n
148
- ), s = Array.isArray(r) ? r[0] : void 0;
147
+ r
148
+ ), s = Array.isArray(n) ? n[0] : void 0;
149
149
  return /* @__PURE__ */ b(
150
150
  e,
151
151
  {
152
152
  headerData: {
153
153
  ...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
154
154
  subMenus: ((i = s == null ? void 0 : s.sections) == null ? void 0 : i.map((d) => d.data)) ?? [],
155
- categories: ((l = (c = s == null ? void 0 : s.categories) == null ? void 0 : c.categories) == null ? void 0 : l.items) ?? [],
156
- navigationLinks: ((u = (f = s == null ? void 0 : s.navigationLinks) == null ? void 0 : f.navigationLinks) == null ? void 0 : u.items) ?? []
155
+ categories: ((c = (u = s == null ? void 0 : s.categories) == null ? void 0 : u.categories) == null ? void 0 : c.items) ?? [],
156
+ navigationLinks: ((l = (p = s == null ? void 0 : s.navigationLinks) == null ? void 0 : p.navigationLinks) == null ? void 0 : l.items) ?? []
157
157
  },
158
158
  children: t
159
159
  }
160
160
  );
161
161
  }, Oe = (t) => {
162
- var i, c;
163
- const e = (c = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : c.items;
162
+ var i, u;
163
+ const e = (u = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : u.items;
164
164
  if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
165
165
  return {
166
166
  iconLabel: "",
167
167
  label: "",
168
168
  content: []
169
169
  };
170
- const n = e == null ? void 0 : e.iconLabel, r = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
171
- (l, f) => ({
172
- type: l.type,
173
- id: `${f.toString()}-${l.title.toLowerCase()}`,
174
- title: l.title,
175
- subtitle: l.subtitle,
176
- description: l.description,
177
- buttonLabel: l.buttonLabel,
178
- buttonHref: l.buttonHref,
179
- buttonMode: l.buttonMode,
180
- buttonSize: l.buttonSize,
181
- buttonIcon: l.buttonIcon
170
+ const r = e == null ? void 0 : e.iconLabel, n = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
171
+ (c, p) => ({
172
+ type: c.type,
173
+ id: `${p.toString()}-${c.title.toLowerCase()}`,
174
+ title: c.title,
175
+ subtitle: c.subtitle,
176
+ description: c.description,
177
+ buttonLabel: c.buttonLabel,
178
+ buttonHref: c.buttonHref,
179
+ buttonMode: c.buttonMode,
180
+ buttonSize: c.buttonSize,
181
+ buttonIcon: c.buttonIcon
182
182
  })
183
183
  );
184
184
  return {
185
- iconLabel: n,
186
- label: r,
185
+ iconLabel: r,
186
+ label: n,
187
187
  helpButtonSize: s,
188
188
  content: o
189
189
  };
190
190
  }, $e = async ({
191
191
  HelpButton: t,
192
192
  ICONS: e,
193
- className: n,
194
- ...r
193
+ className: r,
194
+ ...n
195
195
  }) => {
196
- const { data: s } = await E(
196
+ const { data: s } = await S(
197
197
  "helpbutton",
198
- r
198
+ n
199
199
  );
200
200
  if (!s || !Array.isArray(s) || s.length === 0)
201
201
  return null;
@@ -205,35 +205,98 @@ const Re = async ({
205
205
  {
206
206
  data: o,
207
207
  ICONS: e,
208
- className: n
208
+ className: r
209
209
  }
210
210
  );
211
- }, qe = async ({
211
+ }, Ae = async ({
212
212
  SectionZone: t,
213
213
  LPCadastro: e,
214
- ...n
214
+ ...r
215
215
  }) => {
216
- var l;
217
- const { data: r } = await E(
216
+ var c;
217
+ const { data: n } = await S(
218
218
  "lp_cadastro",
219
- n
219
+ r
220
220
  );
221
- if (!r || !Array.isArray(r) || r.length === 0)
221
+ if (!n || !Array.isArray(n) || n.length === 0)
222
222
  return null;
223
- const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((l = s == null ? void 0 : s.content) == null ? void 0 : l.conteúdo) || {}, c = s == null ? void 0 : s.sections;
224
- return /* @__PURE__ */ N(L, { children: [
223
+ const [s] = n, o = (s == null ? void 0 : s.sections) || [], i = ((c = s == null ? void 0 : s.content) == null ? void 0 : c.conteúdo) || {}, u = s == null ? void 0 : s.sections;
224
+ return /* @__PURE__ */ N(B, { children: [
225
225
  /* @__PURE__ */ b(e, { sections: o, content: i }),
226
- /* @__PURE__ */ b(t, { data: c })
226
+ /* @__PURE__ */ b(t, { data: u })
227
227
  ] });
228
- }, Ae = async ({
228
+ }, qe = (t) => {
229
+ const e = Ne(we(t));
230
+ return Pe(e);
231
+ }, Pe = (t) => {
232
+ const e = [];
233
+ for (const r in t)
234
+ e.push(...t[r]);
235
+ return e;
236
+ }, we = (t) => !t || !Array.isArray(t) ? {} : t == null ? void 0 : t.reduce((e, r) => {
237
+ if (r != null && r.cidade) {
238
+ let n = e[r == null ? void 0 : r.cidade];
239
+ n === void 0 && (n = e[r == null ? void 0 : r.cidade] = []), n.push(r);
240
+ }
241
+ return e;
242
+ }, {}), Ne = (t) => {
243
+ if (!t || !Object.keys(t).length)
244
+ return {};
245
+ const e = Object.keys(t).sort((n, s) => n.localeCompare(s)), r = {};
246
+ for (const n of e)
247
+ r[n] = t[n];
248
+ return r;
249
+ }, ke = async ({
250
+ LPLOJAS_TEMPLATE_RETURN_BUTTON: t,
251
+ ICONS: e,
252
+ entity: r,
253
+ showVendor: n,
254
+ LPStoresClientWrapper: s,
255
+ ...o
256
+ }) => {
257
+ var I;
258
+ const { data: i } = await S("lp_lojas", o), u = Array.isArray(i) ? i : [], c = process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000", p = await fetch(`${c}/api/master-data/search`, {
259
+ method: "POST",
260
+ headers: {
261
+ "Content-Type": "application/json"
262
+ },
263
+ body: JSON.stringify({
264
+ masterDataEntity: r,
265
+ searchFields: {
266
+ _fields: "_all"
267
+ },
268
+ headers: {
269
+ "REST-Range": "resources=0-1000"
270
+ }
271
+ })
272
+ });
273
+ if (!p.ok)
274
+ throw new Error(
275
+ `[LPLojasContent] MasterData error ${p.status}`
276
+ );
277
+ const l = await p.json();
278
+ console.log("Quantidade de lojas:", l.length);
279
+ const d = (I = u[0]) == null ? void 0 : I.config.config;
280
+ return /* @__PURE__ */ b(
281
+ s,
282
+ {
283
+ stores: qe(l),
284
+ content: d,
285
+ data: i,
286
+ showVendor: n,
287
+ ICONS: e,
288
+ LPLOJAS_TEMPLATE_RETURN_BUTTON: t
289
+ }
290
+ );
291
+ }, je = async ({
229
292
  children: t,
230
293
  productId: e,
231
- COMMON_PAGE_COLUMN_GAP: n,
232
- SectionZone: r,
294
+ COMMON_PAGE_COLUMN_GAP: r,
295
+ SectionZone: n,
233
296
  PDPContentProvider: s,
234
297
  ...o
235
298
  }) => {
236
- const { data: i } = await E(
299
+ const { data: i } = await S(
237
300
  "product_page",
238
301
  o
239
302
  );
@@ -242,56 +305,56 @@ const Re = async ({
242
305
  {
243
306
  data: i[0],
244
307
  productId: e,
245
- COMMON_PAGE_COLUMN_GAP: n,
246
- SectionZone: r,
308
+ COMMON_PAGE_COLUMN_GAP: r,
309
+ SectionZone: n,
247
310
  children: t
248
311
  }
249
312
  );
250
- }, Pe = {
313
+ }, De = {
251
314
  "column-modifier": "_column-modifier_1tqap_1"
252
- }, we = async ({
315
+ }, _e = async ({
253
316
  className: t,
254
317
  children: e,
255
- slug: n,
256
- SectionZone: r,
318
+ slug: r,
319
+ SectionZone: n,
257
320
  COMMON_PAGE_COLUMN_GAP_PDC: s,
258
321
  PLPContentProvider: o,
259
322
  ...i
260
323
  }) => {
261
- const { data: c } = await E(
324
+ const { data: u } = await S(
262
325
  "categories_page",
263
326
  i
264
327
  );
265
- if (!c || !Array.isArray(c))
328
+ if (!u || !Array.isArray(u))
266
329
  return null;
267
- const l = c.find(
268
- (m) => {
269
- var p, y, I;
270
- return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
330
+ const c = u.find(
331
+ (f) => {
332
+ var m, y, C;
333
+ return ((m = f.config) == null ? void 0 : m.seo.slug) === r && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "desktop";
271
334
  }
272
- ), f = c.find(
273
- (m) => {
274
- var p, y, I;
275
- return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
335
+ ), p = u.find(
336
+ (f) => {
337
+ var m, y, C;
338
+ return ((m = f.config) == null ? void 0 : m.seo.slug) === r && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "mobile";
276
339
  }
277
- ), u = c.find(
278
- (m) => {
279
- var p, y, I;
280
- return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
340
+ ), l = u.find(
341
+ (f) => {
342
+ var m, y, C;
343
+ return ((m = f.config) == null ? void 0 : m.seo.slug) === "default" && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "desktop";
281
344
  }
282
- ), d = c.find(
283
- (m) => {
284
- var p, y, I;
285
- return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
345
+ ), d = u.find(
346
+ (f) => {
347
+ var m, y, C;
348
+ return ((m = f.config) == null ? void 0 : m.seo.slug) === "default" && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "mobile";
286
349
  }
287
- ), C = Array.isArray(t) ? t : [t];
288
- return /* @__PURE__ */ N(L, { children: [
350
+ ), I = Array.isArray(t) ? t : [t];
351
+ return /* @__PURE__ */ N(B, { children: [
289
352
  /* @__PURE__ */ b(
290
353
  D.Column,
291
354
  {
292
355
  className: _.classNameConcat(
293
356
  j["responsive-desktop-flex"],
294
- [Pe["column-modifier"], ...C]
357
+ [De["column-modifier"], ...I]
295
358
  ),
296
359
  style: {
297
360
  minHeight: "100vh"
@@ -299,9 +362,9 @@ const Re = async ({
299
362
  children: /* @__PURE__ */ b(
300
363
  o,
301
364
  {
302
- data: l ?? u,
365
+ data: c ?? l,
303
366
  device: "desktop",
304
- SectionZone: r,
367
+ SectionZone: n,
305
368
  COMMON_PAGE_COLUMN_GAP_PDC: s,
306
369
  children: e
307
370
  }
@@ -311,37 +374,37 @@ const Re = async ({
311
374
  /* @__PURE__ */ b(D.Column, { className: _.classNameConcat(j["responsive-mobile-flex"], t), children: /* @__PURE__ */ b(
312
375
  o,
313
376
  {
314
- data: f ?? d,
377
+ data: p ?? d,
315
378
  device: "mobile",
316
- SectionZone: r,
379
+ SectionZone: n,
317
380
  COMMON_PAGE_COLUMN_GAP_PDC: s,
318
381
  children: e
319
382
  }
320
383
  ) })
321
384
  ] });
322
- }, Ne = async ({ slug: t, ...e }) => {
323
- var i, c, l;
324
- const { data: n } = await E(
385
+ }, Le = async ({ slug: t, ...e }) => {
386
+ var i, u, c;
387
+ const { data: r } = await S(
325
388
  "redirect_to_search",
326
389
  e
327
390
  );
328
- if (!n || !Array.isArray(n))
391
+ if (!r || !Array.isArray(r))
329
392
  return {
330
393
  slug: t,
331
394
  query: null,
332
395
  redirect: !1
333
396
  };
334
- const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
335
- if (!!!r.length)
397
+ const n = ((c = (u = (i = r[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
398
+ if (!!!n.length)
336
399
  return {
337
400
  slug: t,
338
401
  query: null,
339
402
  redirect: !1
340
403
  };
341
- const o = r.find(
342
- (f) => {
343
- var u, d;
344
- return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
404
+ const o = n.find(
405
+ (p) => {
406
+ var l, d;
407
+ return ((l = p.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
345
408
  }
346
409
  );
347
410
  return o ? {
@@ -359,21 +422,21 @@ const Re = async ({
359
422
  filters: null,
360
423
  sort: null
361
424
  };
362
- }, ke = async ({ slug: t, ...e }) => {
363
- var i, c, l;
364
- const { data: n } = await E(
425
+ }, He = async ({ slug: t, ...e }) => {
426
+ var i, u, c;
427
+ const { data: r } = await S(
365
428
  "redirect_to_search",
366
429
  e
367
430
  );
368
- if (!n || !Array.isArray(n))
431
+ if (!r || !Array.isArray(r))
369
432
  return null;
370
- const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
371
- if (!!!r.length)
433
+ const n = ((c = (u = (i = r[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
434
+ if (!!!n.length)
372
435
  return null;
373
- const o = r.find(
374
- (f) => {
375
- var u, d;
376
- return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
436
+ const o = n.find(
437
+ (p) => {
438
+ var l, d;
439
+ return ((l = p.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
377
440
  }
378
441
  );
379
442
  return o ? {
@@ -381,52 +444,53 @@ const Re = async ({
381
444
  title: o.pageTitle,
382
445
  description: o.pageDescription
383
446
  } : null;
384
- }, je = async ({
447
+ }, Be = async ({
385
448
  children: t,
386
449
  SectionZone: e,
387
- className: n,
388
- ...r
450
+ className: r,
451
+ ...n
389
452
  }) => {
390
- const { data: s } = await E(
453
+ const { data: s } = await S(
391
454
  "search_page",
392
- r
455
+ n
393
456
  );
394
457
  return Array.isArray(s) && s.length > 0 ? /* @__PURE__ */ b(
395
458
  ce,
396
459
  {
397
460
  data: s,
398
461
  SectionZone: e,
399
- className: n,
462
+ className: r,
400
463
  children: t
401
464
  }
402
- ) : /* @__PURE__ */ b(L, { children: "children" });
403
- }, De = async ({
465
+ ) : /* @__PURE__ */ b(B, { children: "children" });
466
+ }, Ge = async ({
404
467
  ClientTipbarContent: t,
405
468
  ...e
406
469
  }) => {
407
- const { data: n } = await E(
470
+ const { data: r } = await S(
408
471
  "tipbar",
409
472
  e
410
473
  );
411
- return /* @__PURE__ */ b(t, { data: n });
412
- }, _e = {
474
+ return /* @__PURE__ */ b(t, { data: r });
475
+ }, Me = {
413
476
  CommonPageContent: Se,
414
477
  CartContent: Re,
415
478
  FlagsAndTagsContent: Ee,
416
479
  HeaderContent: Fe,
417
- TipbarContent: De,
480
+ TipbarContent: Ge,
418
481
  FooterContent: Te,
419
- PLPContent: we,
420
- PDPContent: Ae,
421
- getRedirectData: Ne,
422
- getPLPSynteticMetaData: ke,
423
- SearchPageContent: je,
482
+ PLPContent: _e,
483
+ PDPContent: je,
484
+ getRedirectData: Le,
485
+ getPLPSynteticMetaData: He,
486
+ SearchPageContent: Be,
424
487
  HelpButtonContent: $e,
425
- LPCadastroContent: qe
426
- }, Fr = { Components: _e }, h = async (t, e = {}) => {
427
- const { method: n = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
488
+ LPCadastroContent: Ae,
489
+ LPLojasContent: ke
490
+ }, Pr = { Components: Me }, h = async (t, e = {}) => {
491
+ const { method: r = "GET", body: n, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
428
492
  return fetch(t, {
429
- method: n,
493
+ method: r,
430
494
  headers: {
431
495
  ...s,
432
496
  Accept: "application/json",
@@ -434,51 +498,51 @@ const Re = async ({
434
498
  },
435
499
  priority: o,
436
500
  cache: i,
437
- ...r ? { body: JSON.stringify(r) } : {}
501
+ ...n ? { body: JSON.stringify(n) } : {}
438
502
  // not body in get
439
- }).then((c) => c.json()).catch((c) => {
440
- console.error("[ERROR FETCH VTEX]", c);
503
+ }).then((u) => u.json()).catch((u) => {
504
+ console.error("[ERROR FETCH VTEX]", u);
441
505
  });
442
506
  }, w = /* @__PURE__ */ new Map();
443
- async function He(t, e = {}) {
444
- var n;
507
+ async function Ue(t, e = {}) {
508
+ var r;
445
509
  try {
446
- const { abort: r = !1 } = e, s = new AbortController();
447
- r && (w.has(t) && ((n = w.get(t)) == null || n.abort(), w.delete(t)), w.set(t, s));
510
+ const { abort: n = !1 } = e, s = new AbortController();
511
+ n && (w.has(t) && ((r = w.get(t)) == null || r.abort(), w.delete(t)), w.set(t, s));
448
512
  const o = h(t, {
449
513
  ...e,
450
- ...r ? { signal: s.signal } : {}
514
+ ...n ? { signal: s.signal } : {}
451
515
  });
452
- return r && w.delete(t), o;
453
- } catch (r) {
454
- if (r.name === "AbortError") {
516
+ return n && w.delete(t), o;
517
+ } catch (n) {
518
+ if (n.name === "AbortError") {
455
519
  console.log(`[REQUEST CANCELLED]: ${t}`);
456
520
  return;
457
521
  }
458
- throw console.error(`[ERROR API]: ${r.message}`), r;
522
+ throw console.error(`[ERROR API]: ${n.message}`), n;
459
523
  }
460
524
  }
461
- const Be = a.object({
525
+ const Ve = a.object({
462
526
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
463
527
  postalCode: a.string().nullable()
464
528
  });
465
- async function Le({ apiUrl: t, body: e, fetchOptions: n }) {
529
+ async function ze({ apiUrl: t, body: e, fetchOptions: r }) {
466
530
  if (!e) {
467
531
  console.error("[ERROR FETCHING] Body is required");
468
532
  return;
469
533
  }
470
- await Be.validate(e);
471
- const { country: r, postalCode: s } = e;
534
+ await Ve.validate(e);
535
+ const { country: n, postalCode: s } = e;
472
536
  return await h(
473
- `${t}/api/checkout/pub/postal-code/${r}/${s}`,
537
+ `${t}/api/checkout/pub/postal-code/${n}/${s}`,
474
538
  {
475
539
  method: "POST",
476
540
  body: e,
477
- ...n
541
+ ...r
478
542
  }
479
543
  );
480
544
  }
481
- const Ge = a.object({
545
+ const xe = a.object({
482
546
  orderFormId: a.string().nullable(),
483
547
  sellerCode: a.string().nullable(),
484
548
  sellerName: a.string().nullable()
@@ -486,26 +550,26 @@ const Ge = a.object({
486
550
  async function K({
487
551
  apiUrl: t,
488
552
  body: e,
489
- fetchOptions: n
553
+ fetchOptions: r
490
554
  }) {
491
555
  if (!e) {
492
556
  console.error("[ERROR FETCHING] Body is required");
493
557
  return;
494
558
  }
495
- await Ge.validate(e);
496
- const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
559
+ await xe.validate(e);
560
+ const { orderFormId: n, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
497
561
  return h(
498
- `${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
562
+ `${t}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,
499
563
  {
500
564
  method: "POST",
501
565
  body: {
502
566
  value: i
503
567
  },
504
- ...n
568
+ ...r
505
569
  }
506
570
  );
507
571
  }
508
- const Me = a.object({
572
+ const Qe = a.object({
509
573
  orderFormId: a.string().nullable(),
510
574
  sellerCode: a.string().nullable(),
511
575
  marketingData: a.object()
@@ -513,17 +577,17 @@ const Me = a.object({
513
577
  async function J({
514
578
  apiUrl: t,
515
579
  body: e,
516
- extraData: n = {},
517
- fetchOptions: r
580
+ extraData: r = {},
581
+ fetchOptions: n
518
582
  }) {
519
583
  if (!e) {
520
584
  console.error("[ERROR FETCHING] Body is required");
521
585
  return;
522
586
  }
523
- await Me.validate(e);
524
- const { orderFormId: s, sellerCode: o, marketingData: i } = e, c = o ? {
587
+ await Qe.validate(e);
588
+ const { orderFormId: s, sellerCode: o, marketingData: i } = e, u = o ? {
525
589
  utmCampaign: o ? o.toUpperCase() : "",
526
- utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
590
+ utmiCampaign: o ? `${r.VENDOR_CODE}` : "semcodigo"
527
591
  } : {};
528
592
  return h(
529
593
  `${t}/api/checkout/pub/orderForm/${s}/attachments/marketingData`,
@@ -531,239 +595,239 @@ async function J({
531
595
  method: "POST",
532
596
  body: {
533
597
  ...i,
534
- ...c
598
+ ...u
535
599
  },
536
- ...r
600
+ ...n
537
601
  }
538
602
  );
539
603
  }
540
- const Ue = a.object({
604
+ const Ke = a.object({
541
605
  orderFormId: a.string().nullable(),
542
606
  sellerCode: a.string().nullable(),
543
607
  sellerName: a.string().nullable()
544
608
  });
545
- async function Ve({ apiUrl: t, body: e, fetchOptions: n, extraData: r }) {
609
+ async function Je({ apiUrl: t, body: e, fetchOptions: r, extraData: n }) {
546
610
  if (!e) {
547
611
  console.error("[ERROR FETCHING] Body is required");
548
612
  return;
549
613
  }
550
- await Ue.validate(e);
551
- const s = await K({ apiUrl: t, body: e, fetchOptions: n });
614
+ await Ke.validate(e);
615
+ const s = await K({ apiUrl: t, body: e, fetchOptions: r });
552
616
  return J({
553
617
  apiUrl: t,
554
618
  body: {
555
619
  ...e,
556
620
  marketingData: s == null ? void 0 : s.marketingData
557
621
  },
558
- extraData: r,
559
- fetchOptions: n
622
+ extraData: n,
623
+ fetchOptions: r
560
624
  });
561
625
  }
562
- const ze = a.object({
626
+ const Xe = a.object({
563
627
  orderFormId: a.string().nullable(),
564
628
  coupon: a.string().nullable()
565
629
  });
566
- async function xe({
630
+ async function Ye({
567
631
  apiUrl: t,
568
632
  body: e,
569
- fetchOptions: n
633
+ fetchOptions: r
570
634
  }) {
571
635
  if (!e) {
572
636
  console.error("[ERROR FETCHING] Body is required");
573
637
  return;
574
638
  }
575
- await ze.validate(e);
576
- const { coupon: r = "", orderFormId: s } = e;
639
+ await Xe.validate(e);
640
+ const { coupon: n = "", orderFormId: s } = e;
577
641
  return h(
578
642
  `${t}/api/checkout/pub/orderForm/${s}/coupons`,
579
643
  {
580
644
  method: "POST",
581
- body: { text: r },
582
- ...n
645
+ body: { text: n },
646
+ ...r
583
647
  }
584
648
  );
585
649
  }
586
- const Qe = a.object({
650
+ const We = a.object({
587
651
  appId: a.string().required("App ID is required"),
588
652
  orderFormId: a.string().nullable(),
589
653
  key: a.array().of(a.string())
590
654
  });
591
- async function Ke({
655
+ async function Ze({
592
656
  apiUrl: t,
593
657
  body: e,
594
- fetchOptions: n
658
+ fetchOptions: r
595
659
  }) {
596
660
  if (!e) {
597
661
  console.error("[ERROR FETCHING] Body is required");
598
662
  return;
599
663
  }
600
- await Qe.validate(e);
601
- const { appId: r = "faststore", orderFormId: s, key: o } = e;
664
+ await We.validate(e);
665
+ const { appId: n = "faststore", orderFormId: s, key: o } = e;
602
666
  return h(
603
- `${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
667
+ `${t}/api/checkout/pub/orderForm/${s}/customData/${n}/${o}`,
604
668
  {
605
669
  method: "PUT",
606
- ...n
670
+ ...r
607
671
  }
608
672
  );
609
673
  }
610
- const Je = a.object().shape({
674
+ const et = a.object().shape({
611
675
  name: a.string().required("Attachment name is required"),
612
676
  content: a.object().nullable()
613
677
  });
614
678
  var x;
615
- const Ye = a.object().shape({
616
- attachments: (x = a.array().of(Je)) == null ? void 0 : x.nullable(),
679
+ const tt = a.object().shape({
680
+ attachments: (x = a.array().of(et)) == null ? void 0 : x.nullable(),
617
681
  id: a.string().required("ID of SKU is required"),
618
682
  index: a.number().integer().nullable(),
619
683
  quantity: a.number().integer().nullable(),
620
684
  seller: a.string().required("Seller is required"),
621
685
  price: a.number().integer()
622
- }), We = a.object({
686
+ }), rt = a.object({
623
687
  orderFormId: a.string().required("OrderFormId is required"),
624
- orderItems: a.array().of(Ye)
688
+ orderItems: a.array().of(tt)
625
689
  });
626
- async function Xe({
690
+ async function nt({
627
691
  apiUrl: t,
628
692
  body: e,
629
- fetchOptions: n
693
+ fetchOptions: r
630
694
  }) {
631
695
  if (!e) {
632
696
  console.error("[ERROR FETCHING] Body is required");
633
697
  return;
634
698
  }
635
- await We.validate(e);
636
- const { orderFormId: r, orderItems: s } = e;
699
+ await rt.validate(e);
700
+ const { orderFormId: n, orderItems: s } = e;
637
701
  return h(
638
- `${t}/api/checkout/pub/orderForm/${r}/items`,
702
+ `${t}/api/checkout/pub/orderForm/${n}/items`,
639
703
  {
640
704
  method: "POST",
641
705
  body: { orderItems: s },
642
- ...n
706
+ ...r
643
707
  }
644
708
  );
645
709
  }
646
- const Ze = a.object({
710
+ const at = a.object({
647
711
  orderFormId: a.string().nullable()
648
712
  });
649
- async function et({
713
+ async function st({
650
714
  apiUrl: t,
651
715
  body: e,
652
- fetchOptions: n
716
+ fetchOptions: r
653
717
  }) {
654
718
  if (!e) {
655
719
  console.error("[ERROR FETCHING] Body is required");
656
720
  return;
657
721
  }
658
- await Ze.validate(e);
659
- const { orderFormId: r } = e;
722
+ await at.validate(e);
723
+ const { orderFormId: n } = e;
660
724
  return h(
661
- `${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
725
+ `${t}/api/checkout/pub/orderForm/${n}/items/removeAll`,
662
726
  {
663
727
  method: "POST",
664
- ...n
728
+ ...r
665
729
  }
666
730
  );
667
731
  }
668
- const tt = a.object().shape({
732
+ const ot = a.object().shape({
669
733
  name: a.string().required("Attachment name is required"),
670
734
  content: a.object().nullable()
671
735
  });
672
736
  var Q;
673
- const rt = a.object().shape({
674
- attachments: (Q = a.array().of(tt)) == null ? void 0 : Q.nullable(),
737
+ const it = a.object().shape({
738
+ attachments: (Q = a.array().of(ot)) == null ? void 0 : Q.nullable(),
675
739
  id: a.string().required("ID of SKU is required"),
676
740
  index: a.number().integer().nullable(),
677
741
  quantity: a.number().integer().nullable(),
678
742
  seller: a.string().required("Seller is required"),
679
743
  price: a.number().integer()
680
- }), nt = a.object({
744
+ }), ct = a.object({
681
745
  orderFormId: a.string().nullable(),
682
- orderItems: a.array().of(rt)
746
+ orderItems: a.array().of(it)
683
747
  });
684
- async function at({
748
+ async function lt({
685
749
  apiUrl: t,
686
750
  body: e,
687
- fetchOptions: n
751
+ fetchOptions: r
688
752
  }) {
689
753
  if (!e) {
690
754
  console.error("[ERROR FETCHING] Body is required");
691
755
  return;
692
756
  }
693
- await nt.validate(e);
694
- const { orderFormId: r, orderItems: s } = e;
757
+ await ct.validate(e);
758
+ const { orderFormId: n, orderItems: s } = e;
695
759
  return h(
696
- `${t}/api/checkout/pub/orderForm/${r}/items/update`,
760
+ `${t}/api/checkout/pub/orderForm/${n}/items/update`,
697
761
  {
698
762
  method: "POST",
699
763
  body: { orderItems: s },
700
- ...n
764
+ ...r
701
765
  }
702
766
  );
703
767
  }
704
- const st = a.object({
768
+ const ut = a.object({
705
769
  orderFormId: a.string().nullable()
706
770
  });
707
- async function ot({
771
+ async function dt({
708
772
  apiUrl: t,
709
773
  body: e,
710
- fetchOptions: n
774
+ fetchOptions: r
711
775
  }) {
712
776
  if (!e) {
713
777
  console.error("[ERROR FETCHING] Body is required");
714
778
  return;
715
779
  }
716
- await st.validate(e);
717
- const { orderFormId: r } = e;
780
+ await ut.validate(e);
781
+ const { orderFormId: n } = e;
718
782
  return h(
719
- `${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
783
+ `${t}/api/checkout/pub/orderForm/${n}/messages/clear`,
720
784
  {
721
785
  method: "POST",
722
- ...n
786
+ ...r
723
787
  }
724
788
  );
725
789
  }
726
- const it = a.object({
790
+ const pt = a.object({
727
791
  id: a.string().nullable(),
728
792
  // id offering
729
793
  itemIndex: a.number().nullable(),
730
794
  orderFormId: a.string().nullable(),
731
795
  remove: a.boolean().nullable()
732
796
  });
733
- async function ct({ apiUrl: t, body: e, fetchOptions: n }) {
797
+ async function mt({ apiUrl: t, body: e, fetchOptions: r }) {
734
798
  if (!e) {
735
799
  console.error("[ERROR FETCHING] Body is required");
736
800
  return;
737
801
  }
738
- await it.validate(e);
739
- const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, c = i ? `/${o}/remove` : "", l = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${c}`;
740
- return h(l, {
802
+ await pt.validate(e);
803
+ const { itemIndex: n, orderFormId: s, id: o, remove: i } = e, u = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${n}/offerings${u}`;
804
+ return h(c, {
741
805
  method: "POST",
742
806
  body: { id: o },
743
- ...n
807
+ ...r
744
808
  });
745
809
  }
746
- const lt = a.object({
810
+ const ft = a.object({
747
811
  orderFormId: a.string().nullable()
748
812
  });
749
- async function ut({
813
+ async function gt({
750
814
  apiUrl: t,
751
815
  body: e,
752
- fetchOptions: n,
753
- extraData: r
816
+ fetchOptions: r,
817
+ extraData: n
754
818
  }) {
755
819
  var i;
756
820
  if (!e) {
757
821
  console.error("[ERROR FETCHING] Body is required");
758
822
  return;
759
823
  }
760
- await lt.validate(e);
824
+ await ft.validate(e);
761
825
  const s = new URLSearchParams({
762
826
  refreshOutdatedData: "true"
763
- }), o = e.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
764
- return h(o, { method: "GET", ...n });
827
+ }), o = e.orderFormId && ((i = n.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
828
+ return h(o, { method: "GET", ...r });
765
829
  }
766
- const dt = a.object({
830
+ const ht = a.object({
767
831
  orderFormId: a.string().nullable(),
768
832
  email: a.string().email().required(),
769
833
  firstName: a.string().required(),
@@ -772,72 +836,72 @@ const dt = a.object({
772
836
  document: a.string().required(),
773
837
  phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
774
838
  });
775
- async function pt({
839
+ async function yt({
776
840
  apiUrl: t,
777
841
  body: e,
778
- fetchOptions: n
842
+ fetchOptions: r
779
843
  }) {
780
844
  if (!e) {
781
845
  console.error("[ERROR FETCHING] Body is required");
782
846
  return;
783
847
  }
784
- await dt.validate(e);
785
- const { orderFormId: r, ...s } = e;
848
+ await ht.validate(e);
849
+ const { orderFormId: n, ...s } = e;
786
850
  return h(
787
- `${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
851
+ `${t}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,
788
852
  {
789
853
  method: "POST",
790
854
  body: { ...s },
791
- ...n
855
+ ...r
792
856
  }
793
857
  );
794
858
  }
795
- const mt = a.object({
859
+ const bt = a.object({
796
860
  sellerCode: a.string().nullable()
797
861
  });
798
- async function ft({
862
+ async function It({
799
863
  apiUrl: t,
800
864
  body: e,
801
- extraData: n,
802
- fetchOptions: r
865
+ extraData: r,
866
+ fetchOptions: n
803
867
  }) {
804
868
  if (!e) {
805
869
  console.error("[ERROR FETCHING] Body is required");
806
870
  return;
807
871
  }
808
- await mt.validate(e);
872
+ await bt.validate(e);
809
873
  const { sellerCode: s = "" } = e;
810
874
  return h(
811
- `${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${s}`,
875
+ `${t}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${s}`,
812
876
  {
813
877
  method: "GET",
814
878
  headers: {
815
879
  Accept: "application/vnd.vtex.ds.v10+json"
816
880
  },
817
- ...r
881
+ ...n
818
882
  }
819
883
  );
820
884
  }
821
- const gt = a.object().shape({
885
+ const Ct = a.object().shape({
822
886
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
823
887
  orderFormId: a.string().nullable(),
824
888
  postalCode: a.string().nullable()
825
889
  });
826
- async function ht({
890
+ async function Rt({
827
891
  apiUrl: t,
828
892
  body: e,
829
- fetchOptions: n
893
+ fetchOptions: r
830
894
  }) {
831
895
  if (!e) {
832
896
  console.error("[ERROR FETCHING] Body is required");
833
897
  return;
834
898
  }
835
- await gt.validate(e);
836
- const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
899
+ await Ct.validate(e);
900
+ const { country: n, orderFormId: s, postalCode: o } = e, i = o ? {
837
901
  address: {
838
902
  addressType: "residential",
839
903
  postalCode: o,
840
- country: r
904
+ country: n
841
905
  }
842
906
  } : {
843
907
  logisticsInfo: [],
@@ -848,11 +912,11 @@ async function ht({
848
912
  {
849
913
  method: "POST",
850
914
  body: i,
851
- ...n
915
+ ...r
852
916
  }
853
917
  );
854
918
  }
855
- const yt = a.object().shape({
919
+ const vt = a.object().shape({
856
920
  orderFormId: a.string().nullable(),
857
921
  options: a.array().of(
858
922
  a.object().shape({
@@ -880,15 +944,15 @@ const yt = a.object().shape({
880
944
  })
881
945
  )
882
946
  });
883
- async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
947
+ async function St({ apiUrl: t, body: e, fetchOptions: r }) {
884
948
  if (!e) {
885
949
  console.error("[ERROR FETCHING] Body is required");
886
950
  return;
887
951
  }
888
- await yt.validate(e);
889
- const { orderFormId: r, options: s, selectedAddresses: o } = e;
952
+ await vt.validate(e);
953
+ const { orderFormId: n, options: s, selectedAddresses: o } = e;
890
954
  return h(
891
- `${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
955
+ `${t}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,
892
956
  {
893
957
  method: "POST",
894
958
  body: {
@@ -896,11 +960,11 @@ async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
896
960
  clearAddressIfPostalCodeNotFound: !1,
897
961
  logisticsInfo: s
898
962
  },
899
- ...n
963
+ ...r
900
964
  }
901
965
  );
902
966
  }
903
- const It = a.object({
967
+ const Et = a.object({
904
968
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
905
969
  postalCode: a.string().nullable(),
906
970
  geoCoordinates: a.object().shape({
@@ -908,13 +972,13 @@ const It = a.object({
908
972
  latitude: a.number().required()
909
973
  })
910
974
  });
911
- async function Ct({ apiUrl: t, body: e, fetchOptions: n }) {
975
+ async function Tt({ apiUrl: t, body: e, fetchOptions: r }) {
912
976
  if (!e) {
913
977
  console.error("[ERROR FETCHING] Body is required");
914
978
  return;
915
979
  }
916
- await It.validate(e);
917
- const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
980
+ await Et.validate(e);
981
+ const { country: n = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(n) });
918
982
  return o ? i.append("postalCode", o) : i.append(
919
983
  "geoCoordinates",
920
984
  `${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
@@ -922,234 +986,234 @@ async function Ct({ apiUrl: t, body: e, fetchOptions: n }) {
922
986
  `${t}/api/checkout/pub/regions/?${i.toString()}`,
923
987
  {
924
988
  method: "GET",
925
- ...n
989
+ ...r
926
990
  }
927
991
  );
928
992
  }
929
- const Rt = a.object({
993
+ const Ft = a.object({
930
994
  id: a.string().required("ID of SKU is required"),
931
995
  quantity: a.number().integer().required("Quantity of item is required"),
932
996
  seller: a.string()
933
- }), vt = a.object({
934
- items: a.array().of(Rt),
997
+ }), Ot = a.object({
998
+ items: a.array().of(Ft),
935
999
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
936
1000
  postalCode: a.string().nullable(),
937
1001
  geoCoordinates: a.array().nullable().of(a.number()).length(2)
938
1002
  });
939
- async function St({ apiUrl: t, body: e, fetchOptions: n }) {
1003
+ async function $t({ apiUrl: t, body: e, fetchOptions: r }) {
940
1004
  if (!e) {
941
1005
  console.error("[ERROR FETCHING] Body is required");
942
1006
  return;
943
1007
  }
944
- return await vt.validate(e), h(
1008
+ return await Ot.validate(e), h(
945
1009
  `${t}/api/checkout/pub/orderForms/simulation`,
946
1010
  {
947
1011
  method: "POST",
948
1012
  body: e,
949
- ...n
1013
+ ...r
950
1014
  }
951
1015
  );
952
1016
  }
953
- const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1017
+ const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
954
1018
  __proto__: null,
955
- getMasterDataSellerCode: ft,
956
- getOrderForm: ut,
957
- postOrderFormAddCoupon: xe,
958
- postOrderFormAttachClientProfileData: pt,
959
- postOrderFormAttachOrderFormData: Ve,
960
- postOrderFormAttachShippingData: ht,
1019
+ getMasterDataSellerCode: It,
1020
+ getOrderForm: gt,
1021
+ postOrderFormAddCoupon: Ye,
1022
+ postOrderFormAttachClientProfileData: yt,
1023
+ postOrderFormAttachOrderFormData: Je,
1024
+ postOrderFormAttachShippingData: Rt,
961
1025
  postOrderFormAttachmentsMarketingData: J,
962
1026
  postOrderFormAttachmentsOpenTextField: K,
963
- postOrderFormClearMessages: ot,
964
- postOrderFormFreightSimulation: St,
965
- postOrderFormItems: Xe,
966
- postOrderFormRegion: Ct,
967
- postOrderFormRemoveAllItems: et,
968
- postOrderFormUpdateItems: at,
969
- postOrderFormUpdateShippingData: bt,
970
- postOrderformAddress: Le,
971
- putOrderFormCustomData: Ke,
972
- updateOrderFormOffering: ct
973
- }, Symbol.toStringTag, { value: "Module" })), Tt = a.object({
1027
+ postOrderFormClearMessages: dt,
1028
+ postOrderFormFreightSimulation: $t,
1029
+ postOrderFormItems: nt,
1030
+ postOrderFormRegion: Tt,
1031
+ postOrderFormRemoveAllItems: st,
1032
+ postOrderFormUpdateItems: lt,
1033
+ postOrderFormUpdateShippingData: St,
1034
+ postOrderformAddress: ze,
1035
+ putOrderFormCustomData: Ze,
1036
+ updateOrderFormOffering: mt
1037
+ }, Symbol.toStringTag, { value: "Module" })), qt = a.object({
974
1038
  skuId: a.string()
975
1039
  });
976
- async function Ft({ apiUrl: t, body: e, fetchOptions: n }) {
1040
+ async function Pt({ apiUrl: t, body: e, fetchOptions: r }) {
977
1041
  if (!e) {
978
1042
  console.error("[ERROR FETCHING] Body is required");
979
1043
  return;
980
1044
  }
981
- await Tt.validate(e);
982
- const { skuId: r } = e;
1045
+ await qt.validate(e);
1046
+ const { skuId: n } = e;
983
1047
  return h(
984
- `${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
1048
+ `${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,
985
1049
  {
986
- ...n
1050
+ ...r
987
1051
  }
988
1052
  );
989
1053
  }
990
- const Ot = a.object({
1054
+ const wt = a.object({
991
1055
  ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
992
1056
  });
993
- async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
1057
+ async function Nt({ apiUrl: t, body: e, fetchOptions: r }) {
994
1058
  if (!e) {
995
1059
  console.error("[ERROR FETCHING] Body is required");
996
1060
  return;
997
1061
  }
998
- await Ot.validate(e);
999
- const { ids: r } = e;
1062
+ await wt.validate(e);
1063
+ const { ids: n } = e;
1000
1064
  return h(
1001
- `${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
1065
+ `${t}/api/catalog_system/pub/products/search?fq=${n.map((s) => `productId:${s}`).join("&fq=")}`,
1002
1066
  {
1003
- ...n
1067
+ ...r
1004
1068
  }
1005
1069
  );
1006
1070
  }
1007
- const qt = a.object({
1071
+ const kt = a.object({
1008
1072
  productId: a.number().required("Product ID is required")
1009
1073
  });
1010
- async function At({ apiUrl: t, body: e, fetchOptions: n }) {
1074
+ async function jt({ apiUrl: t, body: e, fetchOptions: r }) {
1011
1075
  if (!e) {
1012
1076
  console.error("[ERROR FETCHING] Body is required");
1013
1077
  return;
1014
1078
  }
1015
- await qt.validate(e);
1016
- const { productId: r } = e;
1079
+ await kt.validate(e);
1080
+ const { productId: n } = e;
1017
1081
  return h(
1018
- `${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
1082
+ `${t}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,
1019
1083
  {
1020
- ...n
1084
+ ...r
1021
1085
  }
1022
1086
  );
1023
1087
  }
1024
- const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1088
+ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1025
1089
  __proto__: null,
1026
- getCatalogKitProducts: Ft,
1027
- getCatalogProducts: $t,
1028
- getCatalogSimilars: At
1029
- }, Symbol.toStringTag, { value: "Module" })), wt = a.object({
1090
+ getCatalogKitProducts: Pt,
1091
+ getCatalogProducts: Nt,
1092
+ getCatalogSimilars: jt
1093
+ }, Symbol.toStringTag, { value: "Module" })), _t = a.object({
1030
1094
  query: a.string()
1031
1095
  });
1032
- async function Nt({
1096
+ async function Lt({
1033
1097
  apiUrl: t,
1034
1098
  body: e,
1035
- fetchOptions: n
1099
+ fetchOptions: r
1036
1100
  }) {
1037
1101
  if (!e) {
1038
1102
  console.error("[ERROR FETCHING] Body is required");
1039
1103
  return;
1040
1104
  }
1041
- await wt.validate(e);
1042
- const { query: r = "" } = e, s = new URLSearchParams({ query: r });
1105
+ await _t.validate(e);
1106
+ const { query: n = "" } = e, s = new URLSearchParams({ query: n });
1043
1107
  return h(
1044
1108
  `${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
1045
1109
  {
1046
- ...n
1110
+ ...r
1047
1111
  }
1048
1112
  );
1049
1113
  }
1050
- const kt = (t, e) => Ce(t, e), jt = (t) => ({
1114
+ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1051
1115
  ...t,
1052
- description: t.description ? kt(t.description) : t.description
1053
- }), Dt = ({
1116
+ description: t.description ? Ht(t.description) : t.description
1117
+ }), Gt = ({
1054
1118
  offer: t,
1055
1119
  seller: e,
1056
- product: n
1120
+ product: r
1057
1121
  }) => ({
1058
1122
  ...t,
1059
- product: n,
1123
+ product: r,
1060
1124
  seller: e
1061
- }), Y = (t, e) => ({
1125
+ }), X = (t, e) => ({
1062
1126
  ...t,
1063
- isVariantOf: jt(e)
1064
- }), _t = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Ht = (t) => t.Price ?? 0, W = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), Bt = (t, e) => {
1065
- let n = 0;
1066
- for (let r = 1; r < t.length; r++)
1067
- e(t[n], t[r]) > 0 && (n = r);
1068
- return t[n];
1069
- }, X = (t) => {
1127
+ isVariantOf: Bt(e)
1128
+ }), Mt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Ut = (t) => t.Price ?? 0, Y = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), Vt = (t, e) => {
1129
+ let r = 0;
1130
+ for (let n = 1; n < t.length; n++)
1131
+ e(t[r], t[n]) > 0 && (r = n);
1132
+ return t[r];
1133
+ }, W = (t) => {
1070
1134
  const e = t.flatMap(
1071
- (r) => r.sellers.map((s) => ({
1135
+ (n) => n.sellers.map((s) => ({
1072
1136
  offer: s.commertialOffer,
1073
- sku: r
1137
+ sku: n
1074
1138
  }))
1075
- ), n = Bt(
1139
+ ), r = Vt(
1076
1140
  e,
1077
- ({ offer: r }, { offer: s }) => W(r, s)
1141
+ ({ offer: n }, { offer: s }) => Y(n, s)
1078
1142
  );
1079
- return n ? n.sku : t[0];
1143
+ return r ? r.sku : t[0];
1080
1144
  }, Z = (t) => t.map(
1081
- ({ imageUrl: e, imageText: n, imageLabel: r }) => ({
1082
- alternateName: n ?? "",
1145
+ ({ imageUrl: e, imageText: r, imageLabel: n }) => ({
1146
+ alternateName: r ?? "",
1083
1147
  url: e.replace("vteximg.com.br", "vtexassets.com"),
1084
- keywords: r
1148
+ keywords: n
1085
1149
  })
1086
- ), H = {
1150
+ ), L = {
1087
1151
  attachment: "ATTACHMENT",
1088
1152
  specification: "SPECIFICATION",
1089
1153
  attribute: "ATTRIBUTE"
1090
- }, Lt = (t) => ({
1154
+ }, zt = (t) => ({
1091
1155
  name: t.name,
1092
1156
  value: t.content,
1093
- valueReference: H.attachment
1094
- }), Gt = (t) => ({
1157
+ valueReference: L.attachment
1158
+ }), xt = (t) => ({
1095
1159
  propertyID: t.id,
1096
1160
  name: t.name,
1097
1161
  value: t.value,
1098
1162
  valueReference: {
1099
- valueReference: H.attribute,
1163
+ valueReference: L.attribute,
1100
1164
  visible: t.visible
1101
1165
  }
1102
- }), B = (t, e, n) => {
1103
- const r = t.flatMap(({ name: i, values: c }) => c ? c.map((l) => ({
1166
+ }), H = (t, e, r) => {
1167
+ const n = t.flatMap(({ name: i, values: u }) => u ? u.map((c) => ({
1104
1168
  name: i,
1105
- value: l,
1106
- valueReference: H.specification
1169
+ value: c,
1170
+ valueReference: L.specification
1107
1171
  })) : {
1108
1172
  name: i,
1109
1173
  value: "",
1110
- valueReference: H.specification
1111
- }), s = Array.isArray(n) ? n.map(Lt) : [], o = e ? e.map(Gt) : [];
1174
+ valueReference: L.specification
1175
+ }), s = Array.isArray(r) ? r.map(zt) : [], o = e ? e.map(xt) : [];
1112
1176
  return [
1113
- ...r,
1177
+ ...n,
1114
1178
  ...s,
1115
1179
  ...o
1116
1180
  ];
1117
- }, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Mt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ut = (t) => {
1181
+ }, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Qt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Kt = (t) => {
1118
1182
  let e = t.slice(0);
1119
- for (let n = 0; n < V.length; n++)
1183
+ for (let r = 0; r < V.length; r++)
1120
1184
  e = e.replace(
1121
- new RegExp(V.charAt(n), "g"),
1122
- Mt.charAt(n)
1185
+ new RegExp(V.charAt(r), "g"),
1186
+ Qt.charAt(r)
1123
1187
  );
1124
1188
  return e;
1125
- }, Vt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
1126
- const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1127
- return Vt(Ut(n)).toLowerCase();
1189
+ }, Jt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
1190
+ const r = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1191
+ return Jt(Kt(r)).toLowerCase();
1128
1192
  }, te = (t) => `/${t}/p`, re = (t) => {
1129
1193
  const e = Math.max(
1130
- ...t.map((r) => r.NumberOfInstallments)
1131
- ), n = t.find(
1132
- (r) => r.NumberOfInstallments === e
1194
+ ...t.map((n) => n.NumberOfInstallments)
1195
+ ), r = t.find(
1196
+ (n) => n.NumberOfInstallments === e
1133
1197
  );
1134
1198
  return {
1135
- count: (n == null ? void 0 : n.NumberOfInstallments) ?? 0,
1136
- value: (n == null ? void 0 : n.Value) ?? 0
1199
+ count: (r == null ? void 0 : r.NumberOfInstallments) ?? 0,
1200
+ value: (r == null ? void 0 : r.Value) ?? 0
1137
1201
  };
1138
1202
  }, ne = (t, e) => {
1139
- const n = {
1203
+ const r = {
1140
1204
  price: 0,
1141
1205
  listPrice: 0,
1142
1206
  sellerDefault: !1
1143
1207
  }, s = t.map(
1144
- (o) => Dt({
1208
+ (o) => Gt({
1145
1209
  offer: o.commertialOffer,
1146
1210
  seller: o,
1147
1211
  product: e
1148
1212
  })
1149
- ).sort(W).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (n.price = o.Price, n.listPrice = o.ListPrice, n.sellerDefault = !0), {
1213
+ ).sort(Y).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (r.price = o.Price, r.listPrice = o.ListPrice, r.sellerDefault = !0), {
1150
1214
  availability: o.AvailableQuantity > 0,
1151
1215
  listPrice: o.ListPrice,
1152
- price: Ht(o),
1216
+ price: Ut(o),
1153
1217
  priceValidUntil: o.PriceValidUntil,
1154
1218
  priceCurrency: "BRL",
1155
1219
  installments: o.Installments,
@@ -1160,81 +1224,81 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
1160
1224
  }
1161
1225
  }));
1162
1226
  return {
1163
- lowPrice: n.sellerDefault ? n.price : s[0].price,
1164
- highPrice: n.sellerDefault ? n.listPrice : s[0].listPrice,
1227
+ lowPrice: r.sellerDefault ? r.price : s[0].price,
1228
+ highPrice: r.sellerDefault ? r.listPrice : s[0].listPrice,
1165
1229
  offers: s
1166
1230
  };
1167
1231
  }, ae = (t) => {
1168
- const { attributes: e, itemId: n, name: r, sellers: s, variations: o } = t;
1232
+ const { attributes: e, itemId: r, name: n, sellers: s, variations: o } = t;
1169
1233
  return {
1170
- additionalProperty: B(o, e, []),
1171
- name: r,
1234
+ additionalProperty: H(o, e, []),
1235
+ name: n,
1172
1236
  offers: {
1173
- offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: c }) => ({
1174
- availability: _t(c.AvailableQuantity > 0),
1175
- listPrice: c.ListPrice,
1176
- price: c.Price,
1177
- quantity: c.AvailableQuantity,
1237
+ offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: u }) => ({
1238
+ availability: Mt(u.AvailableQuantity > 0),
1239
+ listPrice: u.ListPrice,
1240
+ price: u.Price,
1241
+ quantity: u.AvailableQuantity,
1178
1242
  seller: {
1179
1243
  identifier: i
1180
1244
  }
1181
1245
  }))
1182
1246
  },
1183
- sku: n
1247
+ sku: r
1184
1248
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1185
1249
  };
1186
- }, zt = (t) => {
1250
+ }, Xt = (t) => {
1187
1251
  var v;
1188
1252
  const {
1189
1253
  attributes: e,
1190
- referenceId: n,
1191
- isVariantOf: r,
1254
+ referenceId: r,
1255
+ isVariantOf: n,
1192
1256
  images: s,
1193
1257
  itemId: o,
1194
1258
  name: i,
1195
- sellers: c,
1196
- videos: l,
1197
- variations: f
1259
+ sellers: u,
1260
+ videos: c,
1261
+ variations: p
1198
1262
  } = t, {
1199
- brand: u,
1263
+ brand: l,
1200
1264
  categories: d,
1201
- categoriesIds: C,
1202
- description: m,
1203
- linkText: p,
1265
+ categoriesIds: I,
1266
+ description: f,
1267
+ linkText: m,
1204
1268
  productClusters: y,
1205
- clusterHighlights: I,
1269
+ clusterHighlights: C,
1206
1270
  productName: F,
1207
1271
  properties: O,
1208
1272
  productId: $,
1209
1273
  productReference: g
1210
- } = r, S = d.slice().reverse(), R = ne(c, t.isVariantOf), T = re(R.offers[0].installments);
1274
+ } = n, E = d.slice().reverse(), R = ne(u, t.isVariantOf), T = re(R.offers[0].installments);
1211
1275
  return {
1212
1276
  sku: o,
1213
- gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
1277
+ gtin: ((v = r == null ? void 0 : r[0]) == null ? void 0 : v.Value) ?? g ?? "",
1214
1278
  name: F ?? i,
1215
- description: m,
1216
- releaseDate: r.releaseDate ?? "",
1217
- slug: p,
1218
- video: l[0],
1279
+ description: f,
1280
+ releaseDate: n.releaseDate ?? "",
1281
+ slug: m,
1282
+ video: c[0],
1219
1283
  categories: d,
1220
- categoriesIds: C,
1284
+ categoriesIds: I,
1221
1285
  id: $,
1222
- brand: { name: u, brandName: u },
1286
+ brand: { name: l, brandName: l },
1223
1287
  seo: {
1224
- description: m,
1288
+ description: f,
1225
1289
  title: F,
1226
- canonical: te(p)
1290
+ canonical: te(m)
1227
1291
  },
1228
1292
  cluster: {
1229
1293
  generals: y,
1230
- highlights: I
1294
+ highlights: C
1231
1295
  },
1232
1296
  properties: O,
1233
1297
  availability: { status: R.offers[0].availability },
1234
1298
  breadcrumbList: {
1235
1299
  itemListElement: [
1236
- ...S.map((A, P) => {
1237
- const q = A.split("/"), G = q[q.length - 2], ie = q.map(ee).join("/");
1300
+ ...E.map((q, P) => {
1301
+ const A = q.split("/"), G = A[A.length - 2], ie = A.map(ee).join("/");
1238
1302
  return {
1239
1303
  name: G,
1240
1304
  item: ie,
@@ -1242,8 +1306,8 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
1242
1306
  };
1243
1307
  }),
1244
1308
  {
1245
- name: r.productName,
1246
- item: p,
1309
+ name: n.productName,
1310
+ item: m,
1247
1311
  position: d.length + 1
1248
1312
  }
1249
1313
  ],
@@ -1251,93 +1315,93 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
1251
1315
  },
1252
1316
  image: Z(s),
1253
1317
  offers: R,
1254
- additionalProperty: B(f, e, []),
1318
+ additionalProperty: H(p, e, []),
1255
1319
  isVariantOf: {
1256
- productGroupID: r.productId,
1257
- hasVariant: r.items.map((A) => ae(A))
1320
+ productGroupID: n.productId,
1321
+ hasVariant: n.items.map((q) => ae(q))
1258
1322
  },
1259
1323
  installments: T
1260
1324
  };
1261
- }, xt = (t) => {
1325
+ }, Yt = (t) => {
1262
1326
  var T;
1263
1327
  const {
1264
1328
  attributes: e,
1265
- referenceId: n,
1266
- isVariantOf: r,
1329
+ referenceId: r,
1330
+ isVariantOf: n,
1267
1331
  images: s,
1268
1332
  itemId: o,
1269
1333
  name: i,
1270
- sellers: c,
1271
- Videos: l,
1272
- variations: f
1334
+ sellers: u,
1335
+ Videos: c,
1336
+ variations: p
1273
1337
  } = t, {
1274
- brand: u,
1338
+ brand: l,
1275
1339
  categories: d,
1276
- categoriesIds: C,
1277
- description: m,
1278
- linkText: p,
1340
+ categoriesIds: I,
1341
+ description: f,
1342
+ linkText: m,
1279
1343
  productClusters: y,
1280
- productName: I,
1344
+ productName: C,
1281
1345
  Coleção: F,
1282
1346
  "ID Coleção": O,
1283
1347
  productId: $
1284
- } = r, g = d.slice().reverse(), S = ne(c, t.isVariantOf), R = re(S.offers[0].installments);
1348
+ } = n, g = d.slice().reverse(), E = ne(u, t.isVariantOf), R = re(E.offers[0].installments);
1285
1349
  return {
1286
1350
  sku: o,
1287
- gtin: ((T = n[0]) == null ? void 0 : T.Value) ?? "",
1288
- name: I ?? i,
1289
- description: m,
1290
- releaseDate: r.releaseDate ?? "",
1291
- slug: p,
1292
- video: l[0],
1351
+ gtin: ((T = r[0]) == null ? void 0 : T.Value) ?? "",
1352
+ name: C ?? i,
1353
+ description: f,
1354
+ releaseDate: n.releaseDate ?? "",
1355
+ slug: m,
1356
+ video: c[0],
1293
1357
  categories: d,
1294
- categoriesIds: C,
1358
+ categoriesIds: I,
1295
1359
  collection: F,
1296
1360
  collectionId: O,
1297
1361
  id: $,
1298
- brand: { name: u, brandName: u },
1362
+ brand: { name: l, brandName: l },
1299
1363
  seo: {
1300
- description: m,
1301
- title: I,
1302
- canonical: te(p)
1364
+ description: f,
1365
+ title: C,
1366
+ canonical: te(m)
1303
1367
  },
1304
1368
  cluster: {
1305
1369
  generals: y,
1306
1370
  highlights: []
1307
1371
  // TODO: add highlights
1308
1372
  },
1309
- availability: { status: S.offers[0].availability },
1373
+ availability: { status: E.offers[0].availability },
1310
1374
  breadcrumbList: {
1311
1375
  itemListElement: [
1312
- ...g.map((v, A) => {
1313
- const P = v.split("/"), q = P[P.length - 2], G = P.map(ee).join("/");
1376
+ ...g.map((v, q) => {
1377
+ const P = v.split("/"), A = P[P.length - 2], G = P.map(ee).join("/");
1314
1378
  return {
1315
- name: q,
1379
+ name: A,
1316
1380
  item: G,
1317
- position: A + 1
1381
+ position: q + 1
1318
1382
  };
1319
1383
  }),
1320
1384
  {
1321
- name: r.productName,
1322
- item: p,
1385
+ name: n.productName,
1386
+ item: m,
1323
1387
  position: d.length + 1
1324
1388
  }
1325
1389
  ],
1326
1390
  numberOfItems: d.length
1327
1391
  },
1328
1392
  image: Z(s),
1329
- offers: S,
1330
- additionalProperty: B(f, e, []),
1393
+ offers: E,
1394
+ additionalProperty: H(p, e, []),
1331
1395
  isVariantOf: {
1332
- productGroupID: r.productId,
1333
- hasVariant: r.items.map((v) => {
1334
- const { variations: A } = v, P = A.map((q) => ({
1335
- name: q,
1336
- values: v[q]
1396
+ productGroupID: n.productId,
1397
+ hasVariant: n.items.map((v) => {
1398
+ const { variations: q } = v, P = q.map((A) => ({
1399
+ name: A,
1400
+ values: v[A]
1337
1401
  }));
1338
1402
  return {
1339
1403
  ...ae(v),
1340
- additionalProperty: B(
1404
+ additionalProperty: H(
1341
1405
  P,
1342
1406
  e,
1343
1407
  []
@@ -1347,34 +1411,34 @@ const kt = (t, e) => Ce(t, e), jt = (t) => ({
1347
1411
  },
1348
1412
  installments: R
1349
1413
  };
1350
- }, Qt = a.array().of(a.object({
1414
+ }, Wt = a.array().of(a.object({
1351
1415
  key: a.string().required(),
1352
1416
  value: a.string().required()
1353
1417
  })).required("Facets are required");
1354
- async function Kt({ apiUrl: t, body: e, fetchOptions: n }) {
1418
+ async function Zt({ apiUrl: t, body: e, fetchOptions: r }) {
1355
1419
  if (!e) {
1356
1420
  console.error("[ERROR FETCHING] Body is required");
1357
1421
  return;
1358
1422
  }
1359
- await Qt.validate(e);
1360
- const r = new URLSearchParams({}), s = e.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
1361
- le(e, r);
1423
+ await Wt.validate(e);
1424
+ const n = new URLSearchParams({}), s = e.map(({ key: i, value: u }) => `${i}/${u}`).join("/");
1425
+ le(e, n);
1362
1426
  const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
1363
1427
  return h(o, {
1364
1428
  cache: "no-store",
1365
- ...n
1366
- }).then((i) => i.map((l) => {
1367
- const f = X(l.items);
1368
- return f && Y(f, l);
1369
- }).filter((l) => !!l).map((l) => ({
1370
- node: xt(l)
1429
+ ...r
1430
+ }).then((i) => i.map((c) => {
1431
+ const p = W(c.items);
1432
+ return p && X(p, c);
1433
+ }).filter((c) => !!c).map((c) => ({
1434
+ node: Yt(c)
1371
1435
  })));
1372
1436
  }
1373
1437
  const se = ({
1374
1438
  apiUrl: t,
1375
1439
  body: e,
1376
- fetchOptions: n,
1377
- extraData: r
1440
+ fetchOptions: r,
1441
+ extraData: n
1378
1442
  }) => {
1379
1443
  if (!e) {
1380
1444
  console.error("[ERROR FETCHING] Body is required");
@@ -1384,50 +1448,50 @@ const se = ({
1384
1448
  query: s = "",
1385
1449
  page: o = 1,
1386
1450
  count: i,
1387
- sort: c = "",
1388
- facets: l = [],
1389
- type: f,
1390
- hideUnavailableItems: u = !0,
1451
+ sort: u = "",
1452
+ facets: c = [],
1453
+ type: p,
1454
+ hideUnavailableItems: l = !0,
1391
1455
  locale: d = ""
1392
- } = e, C = new URLSearchParams({
1456
+ } = e, I = new URLSearchParams({
1393
1457
  page: o.toString(),
1394
- count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1458
+ count: (i == null ? void 0 : i.toString()) ?? (n == null ? void 0 : n.ITEMS_PER_PAGE) ?? 24,
1395
1459
  query: s,
1396
- sort: c,
1460
+ sort: u,
1397
1461
  locale: d
1398
1462
  });
1399
- u !== void 0 && C.append("hideUnavailableItems", u.toString());
1400
- const m = l.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
1401
- return He(
1402
- `${t}/api/io/_v/api/intelligent-search/${f}/${m}?${C.toString()}`,
1463
+ l !== void 0 && I.append("hideUnavailableItems", l.toString());
1464
+ const f = c.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
1465
+ return Ue(
1466
+ `${t}/api/io/_v/api/intelligent-search/${p}/${f}?${I.toString()}`,
1403
1467
  {
1404
1468
  headers: {
1405
1469
  Accept: "application/json",
1406
1470
  "content-type": "application/json"
1407
1471
  },
1408
- ...n
1472
+ ...r
1409
1473
  }
1410
1474
  );
1411
1475
  };
1412
- async function Jt({ body: t, extraData: e, ...n }) {
1476
+ async function er({ body: t, extraData: e, ...r }) {
1413
1477
  if (!t) {
1414
1478
  console.error("[ERROR FETCHING] Body is required");
1415
1479
  return;
1416
1480
  }
1417
- const r = await se({
1481
+ const n = await se({
1418
1482
  body: {
1419
1483
  ...t,
1420
1484
  type: "product_search"
1421
1485
  },
1422
1486
  extraData: e,
1423
- ...n
1424
- }), s = (r == null ? void 0 : r.products.map((c) => {
1425
- const l = X(c.items);
1426
- return l && Y(l, c);
1427
- }).filter((c) => !!c)) ?? [], {
1487
+ ...r
1488
+ }), s = (n == null ? void 0 : n.products.map((u) => {
1489
+ const c = W(u.items);
1490
+ return c && X(c, u);
1491
+ }).filter((u) => !!u)) ?? [], {
1428
1492
  pagination: o,
1429
1493
  recordsFiltered: i
1430
- } = r;
1494
+ } = n;
1431
1495
  return {
1432
1496
  data: {
1433
1497
  pagination: {
@@ -1438,234 +1502,248 @@ async function Jt({ body: t, extraData: e, ...n }) {
1438
1502
  count: i,
1439
1503
  total: o.count
1440
1504
  },
1441
- products: s.map((c, l) => ({
1442
- node: zt(c),
1443
- cursor: l.toString()
1505
+ products: s.map((u, c) => ({
1506
+ node: Xt(u),
1507
+ cursor: c.toString()
1444
1508
  }))
1445
1509
  }
1446
1510
  };
1447
1511
  }
1448
- async function Yt({ body: t, extraData: e, ...n }) {
1512
+ async function tr({ body: t, extraData: e, ...r }) {
1449
1513
  if (!t) {
1450
1514
  console.error("[ERROR FETCHING] Body is required");
1451
1515
  return;
1452
1516
  }
1453
- const r = await se({
1517
+ const n = await se({
1454
1518
  body: {
1455
1519
  ...t,
1456
1520
  type: "facets"
1457
1521
  },
1458
1522
  extraData: e,
1459
- ...n
1523
+ ...r
1460
1524
  });
1461
- return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1525
+ return !n || !n.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1462
1526
  data: {
1463
- ...r,
1464
- facets: ue(r, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
1527
+ ...n,
1528
+ facets: ue(n, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
1465
1529
  }
1466
1530
  };
1467
1531
  }
1468
- const Wt = a.object({
1532
+ const rr = a.object({
1469
1533
  query: a.string().optional(),
1470
1534
  locale: a.string().optional()
1471
1535
  });
1472
- async function Xt({ apiUrl: t, body: e, fetchOptions: n }) {
1536
+ async function nr({ apiUrl: t, body: e, fetchOptions: r }) {
1473
1537
  if (!e) {
1474
1538
  console.error("[ERROR FETCHING] Body is required");
1475
1539
  return;
1476
1540
  }
1477
- await Wt.validate(e);
1478
- const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
1541
+ await rr.validate(e);
1542
+ const { query: n = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: n, locale: s });
1479
1543
  return h(
1480
1544
  `${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
1481
1545
  {
1482
- ...n
1546
+ ...r
1483
1547
  }
1484
1548
  );
1485
1549
  }
1486
- async function Zt({ apiUrl: t }) {
1550
+ async function ar({ apiUrl: t }) {
1487
1551
  return h(`${t}/api/io/_v/api/intelligent-search/top_searches`);
1488
1552
  }
1489
- const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1553
+ const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1490
1554
  __proto__: null,
1491
- getSearchAutoCompleteSuggestions: Nt,
1492
- getSearchCrossellingProducts: Kt,
1493
- getSearchFacets: Yt,
1494
- getSearchProducts: Jt,
1495
- getSearchSuggestedTerms: Xt,
1496
- getSearchTopSearchs: Zt
1497
- }, Symbol.toStringTag, { value: "Module" })), tr = a.object({
1555
+ getSearchAutoCompleteSuggestions: Lt,
1556
+ getSearchCrossellingProducts: Zt,
1557
+ getSearchFacets: tr,
1558
+ getSearchProducts: er,
1559
+ getSearchSuggestedTerms: nr,
1560
+ getSearchTopSearchs: ar
1561
+ }, Symbol.toStringTag, { value: "Module" })), or = a.object({
1498
1562
  masterDataEntity: a.string().nonNullable(),
1499
1563
  payload: a.object().shape({}).nullable()
1500
1564
  });
1501
- async function rr({
1565
+ async function ir({
1502
1566
  apiUrl: t,
1503
1567
  body: e,
1504
- fetchOptions: n
1568
+ fetchOptions: r
1505
1569
  }) {
1506
1570
  if (!e) {
1507
1571
  console.error("[ERROR FETCHING] Body is required");
1508
1572
  return;
1509
1573
  }
1510
- await tr.validate(e);
1511
- const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
1574
+ await or.validate(e);
1575
+ const { masterDataEntity: n, payload: s } = e, o = `${t}/api/dataentities/${n}/documents`;
1512
1576
  return h(o, {
1513
1577
  method: "POST",
1514
1578
  body: {
1515
1579
  payload: s
1516
1580
  },
1517
- ...n
1581
+ ...r
1518
1582
  });
1519
1583
  }
1520
- const nr = a.object().shape({
1584
+ const cr = a.object().shape({
1521
1585
  _where: a.string().optional(),
1522
1586
  _fields: a.string().optional(),
1523
1587
  _sort: a.string().optional(),
1524
1588
  _from: a.number().integer().min(0).optional(),
1525
1589
  _to: a.number().integer().min(0).optional(),
1526
1590
  _keyword: a.string().optional()
1527
- }), ar = a.object({
1591
+ }), lr = a.object({
1528
1592
  masterDataEntity: a.string().required(),
1529
- searchFields: nr,
1593
+ searchFields: cr,
1530
1594
  headers: a.object().shape({
1531
1595
  "REST-Range": a.string().notRequired()
1532
1596
  })
1533
1597
  });
1534
- async function sr({
1598
+ async function ur({
1535
1599
  apiUrl: t,
1536
1600
  body: e,
1537
- fetchOptions: n
1601
+ fetchOptions: r
1538
1602
  }) {
1539
1603
  if (!e) {
1540
1604
  console.error("[ERROR FETCHING] Body is required");
1541
1605
  return;
1542
1606
  }
1543
- const r = new URLSearchParams();
1544
- await ar.validate(e);
1607
+ const n = new URLSearchParams();
1608
+ await lr.validate(e);
1545
1609
  const { masterDataEntity: s, searchFields: o, headers: i } = e;
1546
- o && Object.entries(o).forEach(([l, f]) => {
1547
- r.append(l, String(f));
1548
- }), "_fields" in o || r == null || r.append("_fields", "_all");
1549
- const c = `${t}/api/dataentities/${s}/search?${r.toString()}`;
1550
- return h(c, {
1551
- headers: {
1552
- "REST-Range": i["REST-Range"] ?? "resources=0-20"
1553
- },
1554
- method: "GET",
1555
- ...n
1556
- });
1610
+ o && Object.entries(o).forEach(([p, l]) => {
1611
+ n.append(p, String(l));
1612
+ }), "_fields" in o || n == null || n.append("_fields", "_all");
1613
+ let u = [], c = null;
1614
+ do {
1615
+ c && n.set("_scroll", c);
1616
+ const p = await fetch(
1617
+ `${t}/api/dataentities/${s}/search?${n.toString()}`,
1618
+ {
1619
+ method: "GET",
1620
+ headers: {
1621
+ "REST-Range": (i == null ? void 0 : i["REST-Range"]) ?? "resources=0-100",
1622
+ ...r == null ? void 0 : r.headers
1623
+ },
1624
+ cache: "no-store"
1625
+ }
1626
+ );
1627
+ if (!p.ok)
1628
+ throw new Error(
1629
+ `[MasterData] ${p.status} - ${p.statusText}`
1630
+ );
1631
+ const l = await p.json();
1632
+ u.push(...l), c = p.headers.get("x-vtex-md-scroll");
1633
+ } while (c);
1634
+ return u;
1557
1635
  }
1558
- const or = a.object({
1636
+ const dr = a.object({
1559
1637
  dataEntityName: a.string().required(),
1560
1638
  id: a.string().required(),
1561
1639
  fieldsToBeUpdated: a.object().shape({})
1562
1640
  });
1563
- async function ir({
1641
+ async function pr({
1564
1642
  apiUrl: t,
1565
1643
  body: e,
1566
- fetchOptions: n
1644
+ fetchOptions: r
1567
1645
  }) {
1568
1646
  if (!e) {
1569
1647
  console.error("[ERROR FETCHING] Body is required");
1570
1648
  return;
1571
1649
  }
1572
- await or.validate(e);
1573
- const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
1650
+ await dr.validate(e);
1651
+ const { dataEntityName: n, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${n}/documents/${s}`;
1574
1652
  return h(i, {
1575
1653
  body: {
1576
1654
  fieldsToBeUpdated: o
1577
1655
  },
1578
1656
  method: "PATCH",
1579
- ...n
1657
+ ...r
1580
1658
  });
1581
1659
  }
1582
- const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1660
+ const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1583
1661
  __proto__: null,
1584
- getSearchMasterdata: sr,
1585
- patchUpdateMasterdata: ir,
1586
- postMasterdata: rr
1662
+ getSearchMasterdata: ur,
1663
+ patchUpdateMasterdata: pr,
1664
+ postMasterdata: ir
1587
1665
  }, Symbol.toStringTag, { value: "Module" }));
1588
- async function lr({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
1666
+ async function fr({ body: t, apiUrl: e, extraData: r, fetchOptions: n }) {
1589
1667
  const { productIds: s } = t;
1590
1668
  if (!s)
1591
1669
  return console.error("[ERROR FETCHING] productIds is required"), [];
1592
- const { NAME_SPLIT_SYMBOL: o } = n;
1670
+ const { NAME_SPLIT_SYMBOL: o } = r;
1593
1671
  if (!o)
1594
1672
  return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
1595
- const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), c = await h(
1673
+ const i = s.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), u = await h(
1596
1674
  `${e}/api/catalog_system/pub/products/search?fq=${i}`,
1597
1675
  {
1598
- ...r
1676
+ ...n
1599
1677
  }
1600
- ), l = (u) => Object.keys(u).map((d) => ({ id: d, name: u[d] }));
1601
- return c.map((u, d) => {
1678
+ ), c = (l) => Object.keys(l).map((d) => ({ id: d, name: l[d] }));
1679
+ return u.map((l, d) => {
1602
1680
  var $;
1603
- const { installments: C, price: m, listPrice: p, sizes: y, allSizesAvailable: I } = de({ items: u.items, NAME_SPLIT_SYMBOL: o }), F = I ? !0 : y.some((g) => g.available), O = u.items[0].sellers[0].commertialOffer;
1681
+ const { installments: I, price: f, listPrice: m, sizes: y, allSizesAvailable: C } = de({ items: l.items, NAME_SPLIT_SYMBOL: o }), F = C ? !0 : y.some((g) => g.available), O = l.items[0].sellers[0].commertialOffer;
1604
1682
  return {
1605
1683
  node: {
1606
- sku: u.items[0].itemId,
1607
- gtin: u.productReference,
1608
- name: u.productName,
1609
- description: u.description,
1610
- releaseDate: u.releaseDate,
1611
- slug: u.linkText,
1612
- categories: u.categories,
1613
- categoriesIds: u.categoriesIds,
1614
- id: u.items[0].itemId,
1684
+ sku: l.items[0].itemId,
1685
+ gtin: l.productReference,
1686
+ name: l.productName,
1687
+ description: l.description,
1688
+ releaseDate: l.releaseDate,
1689
+ slug: l.linkText,
1690
+ categories: l.categories,
1691
+ categoriesIds: l.categoriesIds,
1692
+ id: l.items[0].itemId,
1615
1693
  brand: {
1616
- name: u.brand,
1617
- brandName: u.brand
1694
+ name: l.brand,
1695
+ brandName: l.brand
1618
1696
  },
1619
1697
  seo: {
1620
- description: u.description,
1621
- title: u.productName,
1622
- canonical: `/${u.linkText}/p`
1698
+ description: l.description,
1699
+ title: l.productName,
1700
+ canonical: `/${l.linkText}/p`
1623
1701
  },
1624
1702
  cluster: {
1625
- generals: l(u.productClusters),
1626
- highlights: l(u.clusterHighlights)
1703
+ generals: c(l.productClusters),
1704
+ highlights: c(l.clusterHighlights)
1627
1705
  },
1628
1706
  availability: {
1629
1707
  status: F
1630
1708
  },
1631
- image: u.items[0].images.map(
1709
+ image: l.items[0].images.map(
1632
1710
  ({
1633
1711
  imageLabel: g,
1634
- imageUrl: S
1712
+ imageUrl: E
1635
1713
  }) => ({
1636
1714
  alternateName: g,
1637
- url: S,
1715
+ url: E,
1638
1716
  keywords: g
1639
1717
  })
1640
1718
  ),
1641
1719
  offers: {
1642
- lowPrice: m,
1643
- highPrice: p,
1720
+ lowPrice: f,
1721
+ highPrice: m,
1644
1722
  offers: [
1645
1723
  {
1646
1724
  availability: F,
1647
- listPrice: p,
1648
- price: m,
1725
+ listPrice: m,
1726
+ price: f,
1649
1727
  priceValidUntil: O.PriceValidUntil,
1650
1728
  priceCurrency: "BRL",
1651
1729
  installments: O.Installments,
1652
- lowPrice: m,
1730
+ lowPrice: f,
1653
1731
  quantity: O.AvailableQuantity,
1654
1732
  seller: {
1655
- identifier: u.items[0].sellers[0].sellerId
1733
+ identifier: l.items[0].sellers[0].sellerId
1656
1734
  }
1657
1735
  }
1658
1736
  ]
1659
1737
  },
1660
- additionalProperty: ($ = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : $.map((g) => ({
1661
- name: u == null ? void 0 : u.skuSpecifications[0].field.name,
1738
+ additionalProperty: ($ = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : $.map((g) => ({
1739
+ name: l == null ? void 0 : l.skuSpecifications[0].field.name,
1662
1740
  value: g,
1663
1741
  valueReference: "SPECIFICATION"
1664
1742
  })),
1665
1743
  isVariantOf: {
1666
- productGroupID: u.productId,
1667
- hasVariant: u.items.map((g) => {
1668
- var S;
1744
+ productGroupID: l.productId,
1745
+ hasVariant: l.items.map((g) => {
1746
+ var E;
1669
1747
  return {
1670
1748
  additionalProperty: g == null ? void 0 : g.variations.map(() => {
1671
1749
  var R, T, v;
@@ -1677,7 +1755,7 @@ async function lr({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
1677
1755
  }),
1678
1756
  name: g.name,
1679
1757
  offers: {
1680
- offers: (S = g.sellers) == null ? void 0 : S.map(
1758
+ offers: (E = g.sellers) == null ? void 0 : E.map(
1681
1759
  ({ commertialOffer: R, sellerId: T }) => ({
1682
1760
  availability: "https://schema.org/InStock",
1683
1761
  listPrice: R.ListPrice,
@@ -1694,122 +1772,122 @@ async function lr({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
1694
1772
  };
1695
1773
  })
1696
1774
  },
1697
- installments: C
1775
+ installments: I
1698
1776
  },
1699
1777
  cursor: d.toString()
1700
1778
  };
1701
1779
  });
1702
1780
  }
1703
- const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1781
+ const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1704
1782
  __proto__: null,
1705
- getWishlistProducts: lr
1706
- }, Symbol.toStringTag, { value: "Module" })), dr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), z = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(dr).join(e), pr = ({ canonical: t, seo: e, slug: n }) => {
1707
- const r = Array.isArray(n) ? n.join(", ") : n;
1783
+ getWishlistProducts: fr
1784
+ }, Symbol.toStringTag, { value: "Module" })), hr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), z = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(hr).join(e), yr = ({ canonical: t, seo: e, slug: r }) => {
1785
+ const n = Array.isArray(r) ? r.join(", ") : r;
1708
1786
  return {
1709
1787
  id: 0,
1710
- Title: `${Array.isArray(n) ? n.map((o) => z(o)).join(",") : z(n)} - ${e.title}`,
1788
+ Title: `${Array.isArray(r) ? r.map((o) => z(o)).join(",") : z(r)} - ${e.title}`,
1711
1789
  MetaTagDescription: e.description,
1712
- name: r,
1790
+ name: n,
1713
1791
  hasChildren: !1,
1714
1792
  url: t,
1715
1793
  children: []
1716
1794
  };
1717
- }, mr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
1795
+ }, br = ({ canonical: t, category: e, previousImages: r, seo: n }) => ({
1718
1796
  category: String(e == null ? void 0 : e.id),
1719
- title: (e == null ? void 0 : e.Title) ?? r.title,
1720
- description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
1797
+ title: (e == null ? void 0 : e.Title) ?? n.title,
1798
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
1721
1799
  alternates: { canonical: t },
1722
1800
  openGraph: {
1723
1801
  type: "website",
1724
- title: (e == null ? void 0 : e.Title) ?? r.title,
1725
- description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
1726
- images: Array.isArray(n) ? [...n] : []
1802
+ title: (e == null ? void 0 : e.Title) ?? n.title,
1803
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
1804
+ images: Array.isArray(r) ? [...r] : []
1727
1805
  }
1728
- }), fr = ({ items: t, parent: e, apiUrl: n, find: r }) => {
1806
+ }), Ir = ({ items: t, parent: e, apiUrl: r, find: n }) => {
1729
1807
  const s = t.find(
1730
- (i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
1808
+ (i) => i.url.replace(r, "") === decodeURIComponent(e.toLowerCase())
1731
1809
  );
1732
1810
  return (s == null ? void 0 : s.children.find(
1733
- (i) => i.name.toLowerCase() === decodeURIComponent(String(r))
1811
+ (i) => i.name.toLowerCase() === decodeURIComponent(String(n))
1734
1812
  )) ?? s;
1735
- }, gr = (t) => {
1813
+ }, Cr = (t) => {
1736
1814
  t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
1737
- }, hr = /* @__PURE__ */ new Set([
1815
+ }, Rr = /* @__PURE__ */ new Set([
1738
1816
  "brand",
1739
1817
  "category",
1740
1818
  "department",
1741
1819
  "subcategory",
1742
1820
  "collection",
1743
1821
  "cluster"
1744
- ]), yr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && hr.has(t == null ? void 0 : t.pageType.toLowerCase()), br = (t) => ({
1822
+ ]), vr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && Rr.has(t == null ? void 0 : t.pageType.toLowerCase()), Sr = (t) => ({
1745
1823
  collection: t.Coleção,
1746
1824
  categoryId: t.categoryId,
1747
1825
  current_collection: t["Coleção Atual"],
1748
1826
  items: t.items
1749
- }), oe = (t, e) => t.reduce((n, r) => {
1750
- if (r.items.filter(
1751
- (i) => i.sellers.find((c) => c.commertialOffer.IsAvailable)
1752
- ).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
1753
- return n;
1754
- const o = r.items[0].images.find(
1827
+ }), oe = (t, e) => t.reduce((r, n) => {
1828
+ if (n.items.filter(
1829
+ (i) => i.sellers.find((u) => u.commertialOffer.IsAvailable)
1830
+ ).length === 0 || (r == null ? void 0 : r.find((i) => (i == null ? void 0 : i.productId) === (n == null ? void 0 : n.productId))) !== void 0)
1831
+ return r;
1832
+ const o = n.items[0].images.find(
1755
1833
  (i) => e.includes(i.imageLabel)
1756
1834
  );
1757
- return n.push({
1758
- slug: `/${r.linkText}/p`,
1759
- productId: r == null ? void 0 : r.productId,
1835
+ return r.push({
1836
+ slug: `/${n.linkText}/p`,
1837
+ productId: n == null ? void 0 : n.productId,
1760
1838
  textureImage: (o == null ? void 0 : o.imageUrl) ?? "",
1761
1839
  textureAlt: (o == null ? void 0 : o.imageText) ?? ""
1762
- }), n;
1763
- }, []), Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1840
+ }), r;
1841
+ }, []), Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1764
1842
  __proto__: null,
1765
- createEmptySeoCategory: pr,
1766
- createSeoCategory: mr,
1767
- findCategory: fr,
1843
+ createEmptySeoCategory: yr,
1844
+ createSeoCategory: br,
1845
+ findCategory: Ir,
1768
1846
  formattedSimilars: oe,
1769
- isCollectionPageType: yr,
1770
- notFindCategoryError: gr,
1771
- responseAdapter: br
1772
- }, Symbol.toStringTag, { value: "Module" })), Cr = {
1847
+ isCollectionPageType: vr,
1848
+ notFindCategoryError: Cr,
1849
+ responseAdapter: Sr
1850
+ }, Symbol.toStringTag, { value: "Module" })), Tr = {
1773
1851
  parseSearchState: ge,
1774
1852
  convertSearchParams: fe,
1775
1853
  filterNonRootFacets: me,
1776
1854
  filterNonCategorySelected: pe
1777
- }, Rr = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
1778
- const c = await fetch(
1779
- `${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
1780
- ).then((f) => f.json()), l = oe(c, o);
1855
+ }, Fr = async ({ children: t, apiUrl: e, productId: r, ClientItems: n, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
1856
+ const u = await fetch(
1857
+ `${e}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`
1858
+ ).then((p) => p.json()), c = oe(u, o);
1781
1859
  return /* @__PURE__ */ N("div", { className: M.similars, children: [
1782
1860
  /* @__PURE__ */ N("div", { className: M["similars-info"], children: [
1783
1861
  /* @__PURE__ */ b("span", { className: M["sections-title"], children: s.product.color_title }),
1784
1862
  t
1785
1863
  ] }),
1786
- /* @__PURE__ */ b(r, { productId: n, similars: l, TOGGLE_STYLE_MODIFIER: i })
1864
+ /* @__PURE__ */ b(n, { productId: r, similars: c, TOGGLE_STYLE_MODIFIER: i })
1787
1865
  ] });
1788
- }, Or = {
1789
- checkout: Et,
1790
- catalog: Pt,
1866
+ }, wr = {
1867
+ checkout: At,
1868
+ catalog: Dt,
1791
1869
  cms: he,
1792
- search: er,
1793
- masterdata: cr,
1870
+ search: sr,
1871
+ masterdata: mr,
1794
1872
  wishlist: {
1795
- ...ur
1873
+ ...gr
1796
1874
  }
1797
- }, $r = {
1798
- catalog: Ir,
1799
- search: Cr,
1875
+ }, Nr = {
1876
+ catalog: Er,
1877
+ search: Tr,
1800
1878
  product: Ie,
1801
1879
  cms: {
1802
1880
  ...be,
1803
1881
  ...ye
1804
1882
  }
1805
- }, qr = {
1883
+ }, kr = {
1806
1884
  template: {
1807
- pdp: { PDPSimilars: Rr }
1885
+ pdp: { PDPSimilars: Fr }
1808
1886
  }
1809
1887
  };
1810
1888
  export {
1811
- Or as serverAPIs,
1812
- Fr as serverCMS,
1813
- qr as serverComponents,
1814
- $r as serverHelpers
1889
+ wr as serverAPIs,
1890
+ Pr as serverCMS,
1891
+ kr as serverComponents,
1892
+ Nr as serverHelpers
1815
1893
  };