@soma-vertical-web/multi-lib 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contexts/index.d.ts +0 -2
- package/data/helpers/product/orderSizes.d.ts +3 -0
- package/index-ASRiF3PD.js +1 -0
- package/index-BRfMTuMz.mjs +405 -0
- package/index-BzNV29ol.mjs +402 -0
- package/index-C5zOWvXN.js +1 -0
- package/index-CbOiLJQX.mjs +403 -0
- package/index-CiBRnp7U.js +1 -0
- package/index-D3ONVIla.mjs +412 -0
- package/index-DD12Nl4r.mjs +412 -0
- package/index-DJR4CcKO.mjs +398 -0
- package/index-DJeLEsRl.js +1 -0
- package/index-D__YfUie.js +1 -0
- package/index-drKDwA8_.js +1 -0
- package/index.js +28 -27
- package/index.mjs +7440 -5960
- package/index2.js +1 -1
- package/index2.mjs +545 -529
- package/layout/index.d.ts +1 -1
- package/layout/team-component/Header/index.d.ts +1 -1
- package/layout/team-component/ImageZoom/Composite/ButtonClose.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Common/BlurImage.d.ts +3 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/ImageDesktop.d.ts +5 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/ImagesThumbs.d.ts +5 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/WrapperDesktop.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/Carousel.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ImageMobile.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ImageZoom.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/WrapperMobile.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ZoomPopup.d.ts +7 -0
- package/layout/team-component/ImageZoom/ImageZoom.d.ts +7 -0
- package/layout/team-component/ImageZoom/index.d.ts +1 -0
- package/layout/team-component/Notify/Composite/Controls.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Form.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Loading.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Selector.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Status.d.ts +7 -0
- package/layout/team-component/Notify/helpers.d.ts +3 -0
- package/layout/team-component/Notify/index.d.ts +7 -0
- package/layout/team-component/Table/Composite/Head.d.ts +4 -0
- package/layout/team-component/Table/Composite/Root.d.ts +4 -0
- package/layout/team-component/Table/Composite/Rows.d.ts +4 -0
- package/layout/team-component/Table/Table.d.ts +6 -0
- package/layout/team-component/Table/index.d.ts +1 -0
- package/layout/template/PDP/Composite/BreadCrumb/index.d.ts +7 -0
- package/layout/template/PDP/Composite/Containers/Gallery.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/Main.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/PDP.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/Secondary.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/index.d.ts +6 -0
- package/layout/template/PDP/Composite/Credits/index.d.ts +7 -0
- package/layout/template/PDP/Composite/Gallery/Wrapper.d.ts +2 -2
- package/layout/template/PDP/Composite/Gallery/index.d.ts +1 -1
- package/layout/template/PDP/Composite/Info/Divider.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToCart.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToCartObserver.d.ts +6 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToWishlist.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/BottomNavigation/Actions.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/BottomNavigation/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Header/index.d.ts +8 -0
- package/layout/template/PDP/Composite/Info/MainContent/Links/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Price/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/ProductMeasurements/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Root.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/AccessibilityInfo.d.ts +2 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/Items.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/ToggleWrapper.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/index.d.ts +3 -0
- package/layout/template/PDP/Composite/Info/MainContent/Sizes/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/SubSectionWrapper.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/Root.d.ts +6 -0
- package/layout/template/PDP/Composite/Info/SecondaryContent/DescriptionsTabs.d.ts +2 -0
- package/layout/template/PDP/Composite/Info/SecondaryContent/Freight.d.ts +4 -0
- package/layout/template/PDP/index.d.ts +18 -1
- package/layout/template/QuickShop/Composite/Body.d.ts +4 -0
- package/layout/template/QuickShop/Composite/Header.d.ts +3 -0
- package/layout/template/QuickShop/Composite/Similars.d.ts +7 -0
- package/layout/template/QuickShop/index.d.ts +3 -0
- package/package.json +1 -1
- package/server.d.ts +8 -1
- package/style.css +1 -1
- package/types/constants.d.ts +72 -7
- package/types/contexts/contexts/global.d.ts +1 -0
- package/types/contexts/contexts/pdp.d.ts +5 -46
- package/types/data/helpers/index.d.ts +6 -1
- package/types/layout/team-components/Header/index.d.ts +3 -2
- package/types/layout/team-components/ImageZoom/index.d.ts +36 -3
- package/types/layout/team-components/Notify/index.d.ts +22 -2
- package/types/layout/team-components/Table/index.d.ts +22 -0
- package/types/layout/templates/PDP/index.d.ts +144 -4
- package/types/layout/templates/QuickShop/index.d.ts +21 -0
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as S, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Utils as $ } from "@soma-vertical-web/core-components";
|
|
3
|
+
const b = (e, t = !0) => Intl.NumberFormat("pt-BR", {
|
|
4
|
+
style: "currency",
|
|
5
|
+
currency: "BRL",
|
|
6
|
+
minimumFractionDigits: t ? 2 : 0
|
|
7
|
+
}).format(e), R = ({ valueInCents: e, hasFree: t, freeTaxMessage: n }) => e === 0 ? t ? n : b(0) : b(e / 100), y = (e, t) => {
|
|
8
|
+
const [n, s] = e.split(t);
|
|
9
|
+
return { name: n.trim(), size: s ? s.trim() : "" };
|
|
10
|
+
}, T = (e, t) => {
|
|
11
|
+
if (!e)
|
|
12
|
+
return {};
|
|
13
|
+
const [n, s] = e.split(t);
|
|
14
|
+
return { color: n == null ? void 0 : n.trim(), size: s == null ? void 0 : s.trim() };
|
|
15
|
+
}, C = (e, t = "tamanho") => {
|
|
16
|
+
if (e.additionalProperty) {
|
|
17
|
+
const [n] = e.additionalProperty;
|
|
18
|
+
return n != null && n.name ? n.name.toLocaleLowerCase() === t ? n.value : e.name : "";
|
|
19
|
+
}
|
|
20
|
+
return e.name;
|
|
21
|
+
}, O = (e, t) => e.replace(t, "").trim(), N = (e) => e.replace(/\//g, ""), z = ({ items: e, NAME_SPLIT_SYMBOL: t }) => {
|
|
22
|
+
const n = {
|
|
23
|
+
price: 0,
|
|
24
|
+
listPrice: 0,
|
|
25
|
+
installments: {
|
|
26
|
+
count: 0,
|
|
27
|
+
value: 0
|
|
28
|
+
}
|
|
29
|
+
}, s = (a, o) => {
|
|
30
|
+
var _;
|
|
31
|
+
o && (o.sellerId = a.sellerId, o.sellerName = a.sellerName, o.available = !0, o.isSellerDefault = a.sellerDefault);
|
|
32
|
+
const {
|
|
33
|
+
Price: l,
|
|
34
|
+
ListPrice: u,
|
|
35
|
+
PaymentOptions: { installmentOptions: d }
|
|
36
|
+
} = a.commertialOffer;
|
|
37
|
+
n.price = l, n.listPrice = u;
|
|
38
|
+
const c = (_ = d == null ? void 0 : d[0]) == null ? void 0 : _.installments;
|
|
39
|
+
if (c) {
|
|
40
|
+
const { count: m, value: f } = c[c.length - 1];
|
|
41
|
+
n.installments = {
|
|
42
|
+
count: m,
|
|
43
|
+
value: f / 100
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
let r = !0;
|
|
48
|
+
const i = e.reduce((a, o) => {
|
|
49
|
+
var d;
|
|
50
|
+
const l = {
|
|
51
|
+
name: o.name,
|
|
52
|
+
sku: o.itemId,
|
|
53
|
+
value: ((d = o.Tamanho) == null ? void 0 : d[0]) ?? y(o.nameComplete ?? o.name, t).size,
|
|
54
|
+
available: !1,
|
|
55
|
+
sellerId: "",
|
|
56
|
+
sellerName: "",
|
|
57
|
+
isSellerDefault: !1
|
|
58
|
+
}, u = o.sellers.filter((c) => (c.sellerDefault && c.commertialOffer.IsAvailable && (l.available = !0, s(c, l)), c.commertialOffer.IsAvailable));
|
|
59
|
+
return !l.isSellerDefault && u.length > 0 && (l.available = !0, s(u[0], {
|
|
60
|
+
...l,
|
|
61
|
+
sellerId: u[0].sellerId,
|
|
62
|
+
sellerName: u[0].sellerName
|
|
63
|
+
})), l.available === !1 && (r = !1), a.push(l), a;
|
|
64
|
+
}, []);
|
|
65
|
+
return {
|
|
66
|
+
...n,
|
|
67
|
+
sizes: i,
|
|
68
|
+
allSizesAvailable: r
|
|
69
|
+
};
|
|
70
|
+
}, P = (e) => e ? !e.offers.offers.find(({ quantity: t = 0 }) => t > 0) : !1, x = (e, t) => {
|
|
71
|
+
const n = e.find(
|
|
72
|
+
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0 && s.seller.identifier === t
|
|
73
|
+
);
|
|
74
|
+
return n || e.find(
|
|
75
|
+
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0
|
|
76
|
+
);
|
|
77
|
+
}, F = ({ images: e, TEXTURE_IMAGE: t }) => e.find((n) => t.includes(n.imageLabel)) ?? e[0], j = (e, t) => {
|
|
78
|
+
const n = /\/ids\/(\d+)\//, s = e.match(n);
|
|
79
|
+
return s ? e.replace(
|
|
80
|
+
`/${s[1]}/`,
|
|
81
|
+
`/${s[1]}-${t.width}-${t.height}/`
|
|
82
|
+
) : e;
|
|
83
|
+
}, A = (e, t) => {
|
|
84
|
+
const n = /\/ids\/(\d+)-(\d+)-(\d+)\//, s = e.match(n);
|
|
85
|
+
return s ? e.replace(
|
|
86
|
+
`/${s[1]}-${s[2]}-${s[3]}/`,
|
|
87
|
+
`/${s[1]}-${t.width}-${t.height}/`
|
|
88
|
+
) : e;
|
|
89
|
+
}, D = ({
|
|
90
|
+
images: e,
|
|
91
|
+
label: t
|
|
92
|
+
}) => {
|
|
93
|
+
const n = e.filter(
|
|
94
|
+
(s) => s.keywords === t.first || s.keywords === t.second || s.alternateName === t.first || s.alternateName === t.second
|
|
95
|
+
);
|
|
96
|
+
return n.length === 0 ? e.slice(0, 2) : n;
|
|
97
|
+
}, B = (e) => {
|
|
98
|
+
const [t, n] = e.split("/").map(Number);
|
|
99
|
+
if (Number.isNaN(t) || Number.isNaN(n))
|
|
100
|
+
throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
|
|
101
|
+
return n / t;
|
|
102
|
+
}, E = (e, t, n) => {
|
|
103
|
+
t && (e ? (t.getAttribute("src") || (t.src = n ?? ""), t.play()) : t.pause());
|
|
104
|
+
}, Ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
105
|
+
__proto__: null,
|
|
106
|
+
disableSKU: P,
|
|
107
|
+
formatPriceToCurrency: b,
|
|
108
|
+
freightParsePrice: R,
|
|
109
|
+
getAspectRatio: B,
|
|
110
|
+
getColorAndSizeFromSkuName: T,
|
|
111
|
+
getFirstImages: D,
|
|
112
|
+
getProductNameWithoutSku: O,
|
|
113
|
+
getSKUName: C,
|
|
114
|
+
getSkuInfos: z,
|
|
115
|
+
getThumbImage: F,
|
|
116
|
+
getValidOffer: x,
|
|
117
|
+
removeSlashes: N,
|
|
118
|
+
resizingImg: j,
|
|
119
|
+
setVideoPlay: E,
|
|
120
|
+
splitNameAndSizeFromFullName: y,
|
|
121
|
+
updatedResizedImg: A
|
|
122
|
+
}, Symbol.toStringTag, { value: "Module" })), k = "fuzzy", v = "operator", L = (e) => ({
|
|
123
|
+
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
124
|
+
}), we = (e, t) => {
|
|
125
|
+
const n = decodeURIComponent(t ?? "").slice(1).split("/");
|
|
126
|
+
return e.map((s) => {
|
|
127
|
+
if (s.key === "category-2" && s.__typename === "FacetBoolean") {
|
|
128
|
+
const r = s.values;
|
|
129
|
+
return {
|
|
130
|
+
...s,
|
|
131
|
+
values: r.filter(
|
|
132
|
+
(i) => !n.find(
|
|
133
|
+
(a) => a.toLowerCase() === i.value || a.toLowerCase() === i.name.toLowerCase()
|
|
134
|
+
)
|
|
135
|
+
)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return s;
|
|
139
|
+
});
|
|
140
|
+
}, q = (e, t) => t ? e === "category-1" : !1, U = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), M = (e) => e.type === "TEXT", H = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), K = (e) => {
|
|
141
|
+
const { key: t, name: n, values: s } = e;
|
|
142
|
+
return {
|
|
143
|
+
__typename: "FacetBoolean",
|
|
144
|
+
key: t,
|
|
145
|
+
label: n,
|
|
146
|
+
values: s.slice().sort((r, i) => r.name.localeCompare(i.name))
|
|
147
|
+
};
|
|
148
|
+
}, V = ({ key: e, values: t }) => ({
|
|
149
|
+
__typename: "FacetRange",
|
|
150
|
+
key: e,
|
|
151
|
+
values: t
|
|
152
|
+
}), Se = (e, t, n) => {
|
|
153
|
+
if (!(e instanceof Object) || !("facets" in e))
|
|
154
|
+
return [];
|
|
155
|
+
const { facets: s = [] } = e, r = t != null && t.length ? t[0].key === "category-1" : !1;
|
|
156
|
+
return s.filter(
|
|
157
|
+
(a) => !n || !q(a.key, r)
|
|
158
|
+
).map(
|
|
159
|
+
(a) => M(a) ? K(a) : V(a)
|
|
160
|
+
);
|
|
161
|
+
}, $e = (e, t) => {
|
|
162
|
+
const n = e.find(({ key: r }) => r === k) ?? null, s = e.find(({ key: r }) => r === v) ?? null;
|
|
163
|
+
n && H(n) && t.append(k, n.value), s && U(s) && t.append(v, s.value);
|
|
164
|
+
}, Y = (e) => e.map((t) => {
|
|
165
|
+
const [n, s] = t.split("/");
|
|
166
|
+
return { key: n, value: s };
|
|
167
|
+
}), Re = (e, t) => {
|
|
168
|
+
const n = decodeURIComponent(t ?? "").slice(1).split("/"), s = e.filter(({ value: i }) => !n.includes(decodeURIComponent(i))).map((i) => ({
|
|
169
|
+
...i,
|
|
170
|
+
value: decodeURIComponent(i.value)
|
|
171
|
+
})), { isDepartment: r } = L(s);
|
|
172
|
+
return s == null ? void 0 : s.filter((i) => !q(i.key, r));
|
|
173
|
+
}, Te = ({ pathname: e, searchParams: t }, n) => {
|
|
174
|
+
const s = t.get("sort") ?? "", r = t.get("query") ?? null, i = parseInt(t.get("page") ?? "1", 10);
|
|
175
|
+
return {
|
|
176
|
+
sort: s,
|
|
177
|
+
facets: Y(n),
|
|
178
|
+
term: r,
|
|
179
|
+
base: r ? "" : e,
|
|
180
|
+
page: i
|
|
181
|
+
};
|
|
182
|
+
}, Ce = (e) => {
|
|
183
|
+
const t = new URLSearchParams();
|
|
184
|
+
return Object.entries(e).forEach(([n, s]) => {
|
|
185
|
+
Array.isArray(s) ? s.forEach((r) => t.append(n, r)) : s !== void 0 && t.append(n, s);
|
|
186
|
+
}), t;
|
|
187
|
+
}, h = {
|
|
188
|
+
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
189
|
+
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
190
|
+
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
191
|
+
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
192
|
+
}, I = {}, Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
193
|
+
__proto__: null,
|
|
194
|
+
default: I
|
|
195
|
+
}, Symbol.toStringTag, { value: "Module" })), J = "_header_qh6ki_40", W = "_actions_qh6ki_61", G = "_breadcrumb_qh6ki_72", X = "_credits_qh6ki_87", Q = "_pdplinks_qh6ki_115", Z = "_similars_qh6ki_142", ee = "_sizes_qh6ki_181", te = "_measurementTable_qh6ki_197", ne = "_measurementHead_qh6ki_210", se = "_measurementRows_qh6ki_215", ae = "_measurementRowsTitle_qh6ki_232", re = "_measurementRowsText_qh6ki_244", ie = "_measurementImage_qh6ki_255", oe = "_measurementImageContainer_qh6ki_258", ce = "_measurementContent_qh6ki_267", le = "_measurementTitle_qh6ki_271", me = "_measurementClose_qh6ki_282", _e = "_productref_qh6ki_347", ue = "_slideOut_qh6ki_1", de = "_slideIn_qh6ki_1", pe = "_content_qh6ki_327", fe = "_pdp_qh6ki_115", he = "_divider_qh6ki_510", Ne = {
|
|
196
|
+
"bottom-navigation": "_bottom-navigation_qh6ki_1",
|
|
197
|
+
"bottom-navigation__credits-modifier": "_bottom-navigation__credits-modifier_qh6ki_18",
|
|
198
|
+
"bottom-navigation__header": "_bottom-navigation__header_qh6ki_21",
|
|
199
|
+
"bottom-navigation__price-and-promo": "_bottom-navigation__price-and-promo_qh6ki_31",
|
|
200
|
+
header: J,
|
|
201
|
+
actions: W,
|
|
202
|
+
"add-to-cart": "_add-to-cart_qh6ki_68",
|
|
203
|
+
breadcrumb: G,
|
|
204
|
+
"breadcrumb--active": "_breadcrumb--active_qh6ki_77",
|
|
205
|
+
credits: X,
|
|
206
|
+
"gallery-carousel-modifier": "_gallery-carousel-modifier_qh6ki_92",
|
|
207
|
+
pdplinks: Q,
|
|
208
|
+
"links-wrapper": "_links-wrapper_qh6ki_125",
|
|
209
|
+
similars: Z,
|
|
210
|
+
"similars-info": "_similars-info_qh6ki_154",
|
|
211
|
+
"toggle-style-modifier": "_toggle-style-modifier_qh6ki_163",
|
|
212
|
+
"accessibility-info": "_accessibility-info_qh6ki_167",
|
|
213
|
+
sizes: ee,
|
|
214
|
+
"price-wrapper": "_price-wrapper_qh6ki_193",
|
|
215
|
+
measurementTable: te,
|
|
216
|
+
measurementHead: ne,
|
|
217
|
+
measurementRows: se,
|
|
218
|
+
measurementRowsTitle: ae,
|
|
219
|
+
measurementRowsText: re,
|
|
220
|
+
measurementImage: ie,
|
|
221
|
+
measurementImageContainer: oe,
|
|
222
|
+
measurementContent: ce,
|
|
223
|
+
measurementTitle: le,
|
|
224
|
+
measurementClose: me,
|
|
225
|
+
"tabs-root-modifier": "_tabs-root-modifier_qh6ki_288",
|
|
226
|
+
"tabs-list-modifier": "_tabs-list-modifier_qh6ki_306",
|
|
227
|
+
"tabs-item-modifier": "_tabs-item-modifier_qh6ki_323",
|
|
228
|
+
"content-wrapper": "_content-wrapper_qh6ki_327",
|
|
229
|
+
productref: _e,
|
|
230
|
+
"tabs-panel": "_tabs-panel_qh6ki_358",
|
|
231
|
+
"tabs-panel-exit": "_tabs-panel-exit_qh6ki_364",
|
|
232
|
+
slideOut: ue,
|
|
233
|
+
"tabs-panel-enter": "_tabs-panel-enter_qh6ki_368",
|
|
234
|
+
slideIn: de,
|
|
235
|
+
content: pe,
|
|
236
|
+
pdp: fe,
|
|
237
|
+
"pdp-main": "_pdp-main_qh6ki_426",
|
|
238
|
+
"pdp-main__gallery-wrapper": "_pdp-main__gallery-wrapper_qh6ki_431",
|
|
239
|
+
"pdp-main__info": "_pdp-main__info_qh6ki_448",
|
|
240
|
+
"pdp-main__info-main-content": "_pdp-main__info-main-content_qh6ki_468",
|
|
241
|
+
"pdp-main__info-subsection": "_pdp-main__info-subsection_qh6ki_468",
|
|
242
|
+
"subsection-product-info": "_subsection-product-info_qh6ki_479",
|
|
243
|
+
"subsection-similars": "_subsection-similars_qh6ki_482",
|
|
244
|
+
"subsection-sizes": "_subsection-sizes_qh6ki_485",
|
|
245
|
+
"subsection-actions": "_subsection-actions_qh6ki_488",
|
|
246
|
+
"pdp-main__info-secondary-content": "_pdp-main__info-secondary-content_qh6ki_492",
|
|
247
|
+
"sections-title": "_sections-title_qh6ki_498",
|
|
248
|
+
divider: he,
|
|
249
|
+
"breadcrumbs-desktop": "_breadcrumbs-desktop_qh6ki_515",
|
|
250
|
+
"breadcrumbs-mobile": "_breadcrumbs-mobile_qh6ki_524"
|
|
251
|
+
}, ze = ({
|
|
252
|
+
children: e,
|
|
253
|
+
data: t,
|
|
254
|
+
SectionZone: n,
|
|
255
|
+
className: s
|
|
256
|
+
}) => {
|
|
257
|
+
var d, c;
|
|
258
|
+
const r = ((d = t == null ? void 0 : t.filter((_) => {
|
|
259
|
+
var m, f;
|
|
260
|
+
return ((f = (m = _.config) == null ? void 0 : m.responsive) == null ? void 0 : f.deviceType) === "mobile";
|
|
261
|
+
})[0]) == null ? void 0 : d.sections) || [], i = ((c = t == null ? void 0 : t.filter((_) => {
|
|
262
|
+
var m, f;
|
|
263
|
+
return ((f = (m = _.config) == null ? void 0 : m.responsive) == null ? void 0 : f.deviceType) === "desktop";
|
|
264
|
+
})[0]) == null ? void 0 : c.sections) || [], a = r.slice(0, 1), o = r.slice(1, r.length), l = i.slice(0, 1), u = i.slice(1, i.length);
|
|
265
|
+
return /* @__PURE__ */ g(S, { children: [
|
|
266
|
+
/* @__PURE__ */ g("div", { className: s, children: [
|
|
267
|
+
/* @__PURE__ */ p("div", { className: h["responsive-mobile-flex"], children: /* @__PURE__ */ p(n, { data: a ?? [] }) }),
|
|
268
|
+
/* @__PURE__ */ p("div", { className: h["responsive-desktop-flex"], children: /* @__PURE__ */ p(n, { data: l ?? [] }) })
|
|
269
|
+
] }),
|
|
270
|
+
e,
|
|
271
|
+
/* @__PURE__ */ p("div", { className: h["responsive-mobile-flex"], children: /* @__PURE__ */ p(n, { data: o ?? [] }) }),
|
|
272
|
+
/* @__PURE__ */ p("div", { className: h["responsive-desktop-flex"], children: /* @__PURE__ */ p(n, { data: u ?? [] }) }),
|
|
273
|
+
/* @__PURE__ */ p($.Divider, {})
|
|
274
|
+
] });
|
|
275
|
+
};
|
|
276
|
+
async function be({ contentType: e, storeId: t, CMS_PROJECT_NAME: n, NextCookies: s }) {
|
|
277
|
+
const r = await w({
|
|
278
|
+
contentType: e,
|
|
279
|
+
storeId: t,
|
|
280
|
+
CMS_PROJECT_NAME: n,
|
|
281
|
+
NextCookies: s
|
|
282
|
+
});
|
|
283
|
+
if (r.status === 200) {
|
|
284
|
+
const i = {
|
|
285
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
286
|
+
contentType: e,
|
|
287
|
+
data: r.data
|
|
288
|
+
};
|
|
289
|
+
console.log("Resultado da chamada:", r);
|
|
290
|
+
const a = `backup-${e}-${Date.now()}.json`;
|
|
291
|
+
return await I.writeFile(
|
|
292
|
+
`./backups/${a}`,
|
|
293
|
+
JSON.stringify(i, null, 2),
|
|
294
|
+
"utf-8"
|
|
295
|
+
), { success: !0, fileName: a };
|
|
296
|
+
}
|
|
297
|
+
return { success: !1, error: r.error || "No data to backup" };
|
|
298
|
+
}
|
|
299
|
+
async function ge(e) {
|
|
300
|
+
return be(e);
|
|
301
|
+
}
|
|
302
|
+
async function ke({
|
|
303
|
+
contentType: e,
|
|
304
|
+
documentId: t,
|
|
305
|
+
versionId: n,
|
|
306
|
+
storeId: s,
|
|
307
|
+
CMS_PROJECT_NAME: r
|
|
308
|
+
}) {
|
|
309
|
+
const i = t && t.length ? `/${t}` : "", a = n && n.length ? `?versionId=${n}` : "";
|
|
310
|
+
return fetch(
|
|
311
|
+
`https://${s}.myvtex.com/_v/cms/api/${r}/${e}${i}${a}`,
|
|
312
|
+
{ cache: "no-cache" }
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
async function ve({
|
|
316
|
+
contentType: e,
|
|
317
|
+
documents: t,
|
|
318
|
+
NextCookies: n,
|
|
319
|
+
previewId: s,
|
|
320
|
+
CMS_PROJECT_NAME: r,
|
|
321
|
+
storeId: i
|
|
322
|
+
}) {
|
|
323
|
+
var o;
|
|
324
|
+
const a = JSON.parse(
|
|
325
|
+
s ?? ((o = n == null ? void 0 : n().get("cms_preview_data")) == null ? void 0 : o.value) ?? "{}"
|
|
326
|
+
);
|
|
327
|
+
if (a && (a == null ? void 0 : a.contentType) === e) {
|
|
328
|
+
const l = a.documentId && a.documentId.length ? `/${a.documentId}` : "", u = a != null && a.versionId && (a != null && a.versionId.length) ? `?versionId=${a == null ? void 0 : a.versionId}` : "", c = await (await fetch(
|
|
329
|
+
`https://${i}.myvtex.com/_v/cms/api/${r}/${e}${l}${u}`,
|
|
330
|
+
{ cache: "no-store" }
|
|
331
|
+
)).json(), _ = t.filter(
|
|
332
|
+
(m) => c.id !== m.documentId
|
|
333
|
+
);
|
|
334
|
+
return _.unshift(c), _;
|
|
335
|
+
}
|
|
336
|
+
return t;
|
|
337
|
+
}
|
|
338
|
+
async function w({
|
|
339
|
+
contentType: e,
|
|
340
|
+
NextCookies: t,
|
|
341
|
+
CMS_PROJECT_NAME: n,
|
|
342
|
+
storeId: s,
|
|
343
|
+
previewId: r
|
|
344
|
+
}) {
|
|
345
|
+
var d, c;
|
|
346
|
+
const i = JSON.parse(
|
|
347
|
+
r ?? ((d = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : d.value) ?? "{}"
|
|
348
|
+
), a = [];
|
|
349
|
+
let o = 1, l = 0, u = !0;
|
|
350
|
+
try {
|
|
351
|
+
do {
|
|
352
|
+
const m = await (await fetch(
|
|
353
|
+
`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${o}`
|
|
354
|
+
)).json();
|
|
355
|
+
o === 1 && (l = m.totalItems), (c = m == null ? void 0 : m.data) != null && c.length && a.push(...m.data), u = m.hasNextPage, o++;
|
|
356
|
+
} while (u && a.length < l);
|
|
357
|
+
if (i.previewMode && a.length) {
|
|
358
|
+
const _ = await ve({
|
|
359
|
+
contentType: e,
|
|
360
|
+
documents: a,
|
|
361
|
+
NextCookies: t,
|
|
362
|
+
CMS_PROJECT_NAME: n,
|
|
363
|
+
storeId: s
|
|
364
|
+
});
|
|
365
|
+
return {
|
|
366
|
+
status: _.length > 0 ? 200 : 404,
|
|
367
|
+
data: _ ?? []
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
return {
|
|
371
|
+
status: a.length ? 200 : 404,
|
|
372
|
+
data: a
|
|
373
|
+
};
|
|
374
|
+
} catch (_) {
|
|
375
|
+
return { status: "error", data: [], error: _ };
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
const Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
379
|
+
__proto__: null,
|
|
380
|
+
cmsBackup: ge,
|
|
381
|
+
getCMSContentType: ke,
|
|
382
|
+
getContentType: w
|
|
383
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
384
|
+
export {
|
|
385
|
+
ze as S,
|
|
386
|
+
Oe as _,
|
|
387
|
+
z as a,
|
|
388
|
+
F as b,
|
|
389
|
+
Ce as c,
|
|
390
|
+
C as d,
|
|
391
|
+
P as e,
|
|
392
|
+
Ie as f,
|
|
393
|
+
T as g,
|
|
394
|
+
b as h,
|
|
395
|
+
R as i,
|
|
396
|
+
x as j,
|
|
397
|
+
D as k,
|
|
398
|
+
E as l,
|
|
399
|
+
O as m,
|
|
400
|
+
Ne as n,
|
|
401
|
+
j as o,
|
|
402
|
+
Te as p,
|
|
403
|
+
w as q,
|
|
404
|
+
h as r,
|
|
405
|
+
y as s,
|
|
406
|
+
$e as t,
|
|
407
|
+
A as u,
|
|
408
|
+
Se as v,
|
|
409
|
+
we as w,
|
|
410
|
+
Re as x,
|
|
411
|
+
Pe as y
|
|
412
|
+
};
|