@soma-vertical-web/multi-lib 0.0.74 → 1.0.0

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