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