webim-adapter 2.3.0 → 2.4.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.
- package/build/webim-adapter.js +2879 -1561
- package/build/webim-bundle.js +1 -0
- package/build/webim-embed.js +22 -22
- package/build/webim-ssr.js +2110 -792
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -261,12 +261,12 @@ function F(e) {
|
|
|
261
261
|
})), A.length && (t.boxShadow = A.join(", "));
|
|
262
262
|
let j = (e) => e.type === "blur" ? `blur(${N(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(j), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: H } = t;
|
|
263
263
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
264
|
-
let
|
|
265
|
-
R !== void 0 &&
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
let { textStrokeWidth:
|
|
269
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
264
|
+
let U = F(I);
|
|
265
|
+
R !== void 0 && U.push(`blur(${N(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
|
|
266
|
+
let ee = F(L);
|
|
267
|
+
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
268
|
+
let { textStrokeWidth: te, textStrokeColor: ne } = t;
|
|
269
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${N(te ?? 1)} ${ne || "currentColor"}`);
|
|
270
270
|
let { clipText: re } = t;
|
|
271
271
|
delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
272
|
let { transitions: W, transitionDuration: G, transitionEasing: ie, transitionProperty: ae } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
@@ -322,8 +322,8 @@ var I = {
|
|
|
322
322
|
"submit",
|
|
323
323
|
"keydown",
|
|
324
324
|
"inview"
|
|
325
|
-
], V = ["load", "pagescroll"], H = [...B, ...V],
|
|
326
|
-
function
|
|
325
|
+
], V = ["load", "pagescroll"], H = [...B, ...V], U = /^[A-Za-z_$][\w$]*$/;
|
|
326
|
+
function ee(e, t) {
|
|
327
327
|
let n = String(t ?? "").trim();
|
|
328
328
|
if (!n) return [e];
|
|
329
329
|
let r = e.closest?.(".webim-page") ?? e.closest?.(".builder-canvas") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
|
|
@@ -335,15 +335,15 @@ function te(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
return [];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function te(e, t) {
|
|
339
339
|
for (let t of e.__webimEvents ?? []) t();
|
|
340
340
|
let n = [];
|
|
341
341
|
for (let r of t ?? []) {
|
|
342
342
|
let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
|
|
343
|
-
if (!H.includes(t) || (i ? !a.length : !
|
|
343
|
+
if (!H.includes(t) || (i ? !a.length : !U.test(o))) continue;
|
|
344
344
|
let s = (t) => {
|
|
345
345
|
if (i) {
|
|
346
|
-
for (let t of
|
|
346
|
+
for (let t of ee(e, r?.target)) S(t, a);
|
|
347
347
|
return;
|
|
348
348
|
}
|
|
349
349
|
let n = window[o];
|
|
@@ -4990,10 +4990,10 @@ function Hr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4990
4990
|
};
|
|
4991
4991
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4992
4992
|
}, [N, L]);
|
|
4993
|
-
let { tenant: H, apiUrl:
|
|
4993
|
+
let { tenant: H, apiUrl: U } = i(Y), ee = i(nt), te = ee?.[h], ne = C ? rt(ee) : 1, [re, W] = l(null);
|
|
4994
4994
|
if (a(() => {
|
|
4995
|
-
if (!h ||
|
|
4996
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${
|
|
4995
|
+
if (!h || te) return;
|
|
4996
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4997
4997
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4998
4998
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4999
4999
|
return e && W(n);
|
|
@@ -5003,13 +5003,13 @@ function Hr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
5003
5003
|
}, [
|
|
5004
5004
|
h,
|
|
5005
5005
|
H,
|
|
5006
|
-
ee,
|
|
5007
5006
|
U,
|
|
5007
|
+
te,
|
|
5008
5008
|
C,
|
|
5009
5009
|
ne,
|
|
5010
5010
|
g
|
|
5011
5011
|
]), !e.length) return null;
|
|
5012
|
-
let G = Math.max(1, Number(g) || 10), ie = h ? C ?
|
|
5012
|
+
let G = Math.max(1, Number(g) || 10), ie = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * G, ne * G) : (re ?? []).slice(0, G) : (te ?? re ?? []).slice(0, G) : null, ae = ie ? ie.map((t) => e.map((e) => ut(ct(t?.data, e.field)))) : t, oe = !!h && !(h && !te && re === null) && ae.length === 0, se = b ? {
|
|
5013
5013
|
y: 6,
|
|
5014
5014
|
x: 10
|
|
5015
5015
|
} : {
|
|
@@ -5329,19 +5329,19 @@ function Xr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5329
5329
|
title: e.title,
|
|
5330
5330
|
children: n
|
|
5331
5331
|
}, e.key);
|
|
5332
|
-
},
|
|
5332
|
+
}, U = new Intl.DateTimeFormat(V, {
|
|
5333
5333
|
month: "long",
|
|
5334
5334
|
year: "numeric"
|
|
5335
|
-
}).format(new Date(j.year, j.month, 1)),
|
|
5335
|
+
}).format(new Date(j.year, j.month, 1)), ee = (e) => M((t) => {
|
|
5336
5336
|
let n = new Date(t.year, t.month + e, 1);
|
|
5337
5337
|
return {
|
|
5338
5338
|
year: n.getFullYear(),
|
|
5339
5339
|
month: n.getMonth()
|
|
5340
5340
|
};
|
|
5341
|
-
}),
|
|
5341
|
+
}), te = (e, t) => /* @__PURE__ */ f("button", {
|
|
5342
5342
|
type: "button",
|
|
5343
5343
|
"aria-label": e,
|
|
5344
|
-
onClick: () =>
|
|
5344
|
+
onClick: () => ee(t),
|
|
5345
5345
|
style: {
|
|
5346
5346
|
background: "transparent",
|
|
5347
5347
|
border: `1px solid ${I}`,
|
|
@@ -5368,10 +5368,10 @@ function Xr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5368
5368
|
flexGrow: 1,
|
|
5369
5369
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
5370
5370
|
},
|
|
5371
|
-
children:
|
|
5371
|
+
children: U
|
|
5372
5372
|
}),
|
|
5373
|
-
|
|
5374
|
-
|
|
5373
|
+
te("Previous month", -1),
|
|
5374
|
+
te("Next month", 1)
|
|
5375
5375
|
]
|
|
5376
5376
|
});
|
|
5377
5377
|
if (u === "list") {
|
|
@@ -5507,7 +5507,7 @@ function Qr(e, t = {}) {
|
|
|
5507
5507
|
}).filter((e) => e.src);
|
|
5508
5508
|
}
|
|
5509
5509
|
function $r({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "step", size: u = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
5510
|
-
let { tenant: D, apiUrl: O } = i(Y), k = i(nt)?.[t], [A, j] = l(null), M = c(null), N = c(null), [P, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [
|
|
5510
|
+
let { tenant: D, apiUrl: O } = i(Y), k = i(nt)?.[t], [A, j] = l(null), M = c(null), N = c(null), [P, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [te, ne] = l(!1);
|
|
5511
5511
|
a(() => {
|
|
5512
5512
|
if (!t || k) return;
|
|
5513
5513
|
let e = !0;
|
|
@@ -5596,7 +5596,7 @@ function $r({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5596
5596
|
children: C
|
|
5597
5597
|
}) : null
|
|
5598
5598
|
});
|
|
5599
|
-
let me = W.length, he = ae === "step" && me > fe, ge = ae === "slider", _e = he && !E && !
|
|
5599
|
+
let me = W.length, he = ae === "step" && me > fe, ge = ae === "slider", _e = he && !E && !U && !te, ve = v === "right", ye = ve ? me : 0, be = he ? [...W, ...W] : W, xe = he ? z * pe : 0, Se = (e, t, n) => {
|
|
5600
5600
|
let r = /* @__PURE__ */ f("img", {
|
|
5601
5601
|
src: e.src,
|
|
5602
5602
|
alt: e.alt ?? "",
|
|
@@ -5692,8 +5692,8 @@ function $r({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5692
5692
|
overflow: "hidden",
|
|
5693
5693
|
...F(w)
|
|
5694
5694
|
},
|
|
5695
|
-
onMouseEnter: b === !1 ? void 0 : () =>
|
|
5696
|
-
onMouseLeave: b === !1 ? void 0 : () =>
|
|
5695
|
+
onMouseEnter: b === !1 ? void 0 : () => ee(!0),
|
|
5696
|
+
onMouseLeave: b === !1 ? void 0 : () => ee(!1),
|
|
5697
5697
|
children: [
|
|
5698
5698
|
/* @__PURE__ */ f("style", { children: `
|
|
5699
5699
|
.wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
|
|
@@ -6879,7 +6879,8 @@ var ji = {
|
|
|
6879
6879
|
"ShopCartButton",
|
|
6880
6880
|
"ShopCheckout",
|
|
6881
6881
|
"ShopOrderHistory",
|
|
6882
|
-
"ShopCurrencyPicker"
|
|
6882
|
+
"ShopCurrencyPicker",
|
|
6883
|
+
"ShopFavorites"
|
|
6883
6884
|
],
|
|
6884
6885
|
ssr: "shell",
|
|
6885
6886
|
settings: ["shop.enabled"]
|
|
@@ -7118,7 +7119,7 @@ var Ui = {
|
|
|
7118
7119
|
placing: "Placing order…",
|
|
7119
7120
|
required: "Please fill in the required fields.",
|
|
7120
7121
|
noMethods: "This shop has no payment method set up yet.",
|
|
7121
|
-
thanks: "Thank you! Your order
|
|
7122
|
+
thanks: "Thank you! Your order {number} is placed.",
|
|
7122
7123
|
paid: "Your payment was received.",
|
|
7123
7124
|
awaiting: "We are waiting for your payment to be confirmed.",
|
|
7124
7125
|
transfer: "Please transfer the total using the details below:",
|
|
@@ -7193,7 +7194,56 @@ var Ui = {
|
|
|
7193
7194
|
st_cancelled: "Cancelled",
|
|
7194
7195
|
pay_unpaid: "Awaiting payment",
|
|
7195
7196
|
pay_refunded: "Refunded",
|
|
7196
|
-
pay_failed: "Payment failed"
|
|
7197
|
+
pay_failed: "Payment failed",
|
|
7198
|
+
reviewsTitle: "Reviews",
|
|
7199
|
+
reviewsCount: "{n} reviews",
|
|
7200
|
+
reviewsOne: "1 review",
|
|
7201
|
+
qaCount: "{n} Q&A",
|
|
7202
|
+
lovedBy: "Loved! {n} people favorited this",
|
|
7203
|
+
lovedByOne: "1 person favorited this",
|
|
7204
|
+
favorite: "Add to favorites",
|
|
7205
|
+
unfavorite: "Remove from favorites",
|
|
7206
|
+
noReviews: "No reviews yet. Be the first to review this product.",
|
|
7207
|
+
writeReview: "Write a review",
|
|
7208
|
+
editReview: "Edit your review",
|
|
7209
|
+
yourRating: "Your rating",
|
|
7210
|
+
reviewTitle: "Title (optional)",
|
|
7211
|
+
reviewBody: "What did you think?",
|
|
7212
|
+
submitReview: "Submit review",
|
|
7213
|
+
reviewPending: "Thanks! Your review appears here once the shop approves it.",
|
|
7214
|
+
reviewThanks: "Thanks for your review!",
|
|
7215
|
+
awaitingApproval: "Awaiting approval",
|
|
7216
|
+
verified: "Verified purchase",
|
|
7217
|
+
shopReply: "Reply from the shop",
|
|
7218
|
+
signInToReview: "Sign in to write a review",
|
|
7219
|
+
pickRating: "Choose a rating first.",
|
|
7220
|
+
sortNewest: "Newest",
|
|
7221
|
+
sortHighest: "Highest rated",
|
|
7222
|
+
sortLowest: "Lowest rated",
|
|
7223
|
+
sortHelpful: "Most detailed",
|
|
7224
|
+
allRatings: "All ratings",
|
|
7225
|
+
starsN: "{n} stars",
|
|
7226
|
+
loadMore: "Show more",
|
|
7227
|
+
questionsTitle: "Questions & answers",
|
|
7228
|
+
noQuestions: "No questions yet.",
|
|
7229
|
+
askQuestion: "Ask a question",
|
|
7230
|
+
questionPlaceholder: "What would you like to know about this product?",
|
|
7231
|
+
submitQuestion: "Send question",
|
|
7232
|
+
questionPending: "Thanks! Your question appears here once the shop answers it.",
|
|
7233
|
+
signInToAsk: "Sign in to ask a question",
|
|
7234
|
+
answerLabel: "Answer",
|
|
7235
|
+
qMark: "Q:",
|
|
7236
|
+
aMark: "A:",
|
|
7237
|
+
awaitingAnswer: "Waiting for an answer",
|
|
7238
|
+
anonymous: "A customer",
|
|
7239
|
+
myFavorites: "My favorites",
|
|
7240
|
+
noFavorites: "You have no favorites yet.",
|
|
7241
|
+
signInForFavorites: "Sign in to see your favorites",
|
|
7242
|
+
REVIEW_BUYERS_ONLY: "Only customers who bought this product can review it.",
|
|
7243
|
+
QUESTION_LIMIT: "You already have questions waiting for an answer.",
|
|
7244
|
+
specifications: "Specifications",
|
|
7245
|
+
yes: "Yes",
|
|
7246
|
+
no: "No"
|
|
7197
7247
|
},
|
|
7198
7248
|
tr: {
|
|
7199
7249
|
add: "Sepete ekle",
|
|
@@ -7234,7 +7284,7 @@ var Ui = {
|
|
|
7234
7284
|
placing: "Sipariş veriliyor…",
|
|
7235
7285
|
required: "Lütfen zorunlu alanları doldurun.",
|
|
7236
7286
|
noMethods: "Bu mağazada henüz bir ödeme yöntemi tanımlı değil.",
|
|
7237
|
-
thanks: "Teşekkürler!
|
|
7287
|
+
thanks: "Teşekkürler! {number} numaralı siparişiniz alındı.",
|
|
7238
7288
|
paid: "Ödemeniz alındı.",
|
|
7239
7289
|
awaiting: "Ödemenizin onaylanmasını bekliyoruz.",
|
|
7240
7290
|
transfer: "Lütfen toplam tutarı aşağıdaki bilgilere gönderin:",
|
|
@@ -7309,7 +7359,56 @@ var Ui = {
|
|
|
7309
7359
|
st_cancelled: "İptal edildi",
|
|
7310
7360
|
pay_unpaid: "Ödeme bekleniyor",
|
|
7311
7361
|
pay_refunded: "İade edildi",
|
|
7312
|
-
pay_failed: "Ödeme başarısız"
|
|
7362
|
+
pay_failed: "Ödeme başarısız",
|
|
7363
|
+
reviewsTitle: "Değerlendirmeler",
|
|
7364
|
+
reviewsCount: "{n} Değerlendirme",
|
|
7365
|
+
reviewsOne: "1 Değerlendirme",
|
|
7366
|
+
qaCount: "{n} Soru-Cevap",
|
|
7367
|
+
lovedBy: "Sevilen ürün! {n} kişi favoriledi!",
|
|
7368
|
+
lovedByOne: "1 kişi favoriledi",
|
|
7369
|
+
favorite: "Favorilere ekle",
|
|
7370
|
+
unfavorite: "Favorilerden çıkar",
|
|
7371
|
+
noReviews: "Henüz değerlendirme yok. İlk değerlendiren siz olun.",
|
|
7372
|
+
writeReview: "Değerlendirme yaz",
|
|
7373
|
+
editReview: "Değerlendirmenizi düzenleyin",
|
|
7374
|
+
yourRating: "Puanınız",
|
|
7375
|
+
reviewTitle: "Başlık (isteğe bağlı)",
|
|
7376
|
+
reviewBody: "Ürün hakkında ne düşünüyorsunuz?",
|
|
7377
|
+
submitReview: "Değerlendirmeyi gönder",
|
|
7378
|
+
reviewPending: "Teşekkürler! Değerlendirmeniz mağaza onayladıktan sonra burada görünür.",
|
|
7379
|
+
reviewThanks: "Değerlendirmeniz için teşekkürler!",
|
|
7380
|
+
awaitingApproval: "Onay bekliyor",
|
|
7381
|
+
verified: "Doğrulanmış alışveriş",
|
|
7382
|
+
shopReply: "Mağazanın yanıtı",
|
|
7383
|
+
signInToReview: "Değerlendirme yazmak için giriş yapın",
|
|
7384
|
+
pickRating: "Önce bir puan seçin.",
|
|
7385
|
+
sortNewest: "En yeni",
|
|
7386
|
+
sortHighest: "En yüksek puan",
|
|
7387
|
+
sortLowest: "En düşük puan",
|
|
7388
|
+
sortHelpful: "En detaylı",
|
|
7389
|
+
allRatings: "Tüm puanlar",
|
|
7390
|
+
starsN: "{n} yıldız",
|
|
7391
|
+
loadMore: "Daha fazla göster",
|
|
7392
|
+
questionsTitle: "Soru-Cevap",
|
|
7393
|
+
noQuestions: "Henüz soru yok.",
|
|
7394
|
+
askQuestion: "Soru sor",
|
|
7395
|
+
questionPlaceholder: "Bu ürün hakkında ne öğrenmek istersiniz?",
|
|
7396
|
+
submitQuestion: "Soruyu gönder",
|
|
7397
|
+
questionPending: "Teşekkürler! Sorunuz mağaza yanıtladıktan sonra burada görünür.",
|
|
7398
|
+
signInToAsk: "Soru sormak için giriş yapın",
|
|
7399
|
+
answerLabel: "Yanıt",
|
|
7400
|
+
qMark: "S:",
|
|
7401
|
+
aMark: "C:",
|
|
7402
|
+
awaitingAnswer: "Yanıt bekliyor",
|
|
7403
|
+
anonymous: "Bir müşteri",
|
|
7404
|
+
myFavorites: "Favorilerim",
|
|
7405
|
+
noFavorites: "Henüz favoriniz yok.",
|
|
7406
|
+
signInForFavorites: "Favorilerinizi görmek için giriş yapın",
|
|
7407
|
+
REVIEW_BUYERS_ONLY: "Bu ürünü yalnızca satın alan müşteriler değerlendirebilir.",
|
|
7408
|
+
QUESTION_LIMIT: "Yanıt bekleyen sorularınız var.",
|
|
7409
|
+
specifications: "Özellikler",
|
|
7410
|
+
yes: "Evet",
|
|
7411
|
+
no: "Hayır"
|
|
7313
7412
|
}
|
|
7314
7413
|
};
|
|
7315
7414
|
function Wi(e) {
|
|
@@ -7351,419 +7450,1633 @@ function Yi(e, t, n, r) {
|
|
|
7351
7450
|
});
|
|
7352
7451
|
}
|
|
7353
7452
|
//#endregion
|
|
7354
|
-
//#region ../ui/src/components/builder/apps/shop/
|
|
7355
|
-
var
|
|
7453
|
+
//#region ../ui/src/components/builder/apps/shop/engagement.jsx
|
|
7454
|
+
var Xi = "var(--page-muted, rgba(100,116,139,1))", Zi = "1px solid var(--page-border, #d1d5db)", Qi = "var(--page-surface, #f2f2f2)", $i = "#f59e0b", ea = {
|
|
7356
7455
|
...gt,
|
|
7357
7456
|
border: 0,
|
|
7358
7457
|
borderRadius: "8px",
|
|
7359
7458
|
padding: "10px 18px",
|
|
7360
7459
|
fontSize: "14px",
|
|
7361
7460
|
fontWeight: 600,
|
|
7362
|
-
fontFamily: "inherit"
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
...Qi,
|
|
7461
|
+
fontFamily: "inherit"
|
|
7462
|
+
}, ta = {
|
|
7463
|
+
...ea,
|
|
7366
7464
|
backgroundColor: "transparent",
|
|
7367
7465
|
color: "var(--page-text, #111827)",
|
|
7368
|
-
border:
|
|
7466
|
+
border: Zi
|
|
7369
7467
|
};
|
|
7370
|
-
function
|
|
7371
|
-
let { tenant: e, apiUrl: t, locale: n } = i(Y),
|
|
7468
|
+
function na() {
|
|
7469
|
+
let { tenant: e, apiUrl: t, locale: n, settings: r } = i(Y), a = s(() => Wi(n), [n]), o = (e) => r?.[e] !== !1;
|
|
7372
7470
|
return {
|
|
7373
7471
|
tenant: e,
|
|
7374
7472
|
apiUrl: t || "/api",
|
|
7375
7473
|
locale: n,
|
|
7376
|
-
words:
|
|
7474
|
+
words: a,
|
|
7475
|
+
reviewsOn: o("shop.reviews"),
|
|
7476
|
+
questionsOn: o("shop.questions"),
|
|
7477
|
+
favoritesOn: o("shop.favorites"),
|
|
7478
|
+
moderated: r?.["shop.reviewModeration"] !== "auto",
|
|
7479
|
+
loginHref: () => {
|
|
7480
|
+
let e = ci(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
|
|
7481
|
+
return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
|
|
7482
|
+
}
|
|
7377
7483
|
};
|
|
7378
7484
|
}
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7485
|
+
var ra = (e, t) => {
|
|
7486
|
+
try {
|
|
7487
|
+
return new Intl.NumberFormat(t || void 0, {
|
|
7488
|
+
notation: "compact",
|
|
7489
|
+
maximumFractionDigits: 1
|
|
7490
|
+
}).format(e);
|
|
7491
|
+
} catch {
|
|
7492
|
+
return String(e);
|
|
7493
|
+
}
|
|
7494
|
+
}, ia = (e, t) => {
|
|
7495
|
+
try {
|
|
7496
|
+
return new Intl.DateTimeFormat(t || void 0, {
|
|
7497
|
+
day: "numeric",
|
|
7498
|
+
month: "long",
|
|
7499
|
+
year: "numeric"
|
|
7500
|
+
}).format(new Date(e));
|
|
7501
|
+
} catch {
|
|
7502
|
+
return String(e).slice(0, 10);
|
|
7503
|
+
}
|
|
7504
|
+
}, aa = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
|
|
7505
|
+
function oa({ fill: e = 0, size: t = 16, clipId: n }) {
|
|
7506
|
+
return /* @__PURE__ */ p("svg", {
|
|
7507
|
+
width: t,
|
|
7508
|
+
height: t,
|
|
7509
|
+
viewBox: "0 0 24 24",
|
|
7510
|
+
"aria-hidden": "true",
|
|
7511
|
+
style: { display: "block" },
|
|
7512
|
+
children: [
|
|
7513
|
+
/* @__PURE__ */ f("defs", { children: /* @__PURE__ */ f("clipPath", {
|
|
7514
|
+
id: n,
|
|
7515
|
+
children: /* @__PURE__ */ f("rect", {
|
|
7516
|
+
x: "0",
|
|
7517
|
+
y: "0",
|
|
7518
|
+
width: 24 * e,
|
|
7519
|
+
height: "24"
|
|
7520
|
+
})
|
|
7521
|
+
}) }),
|
|
7522
|
+
/* @__PURE__ */ f("path", {
|
|
7523
|
+
d: aa,
|
|
7524
|
+
fill: "var(--page-border, #d1d5db)"
|
|
7525
|
+
}),
|
|
7526
|
+
e > 0 && /* @__PURE__ */ f("path", {
|
|
7527
|
+
d: aa,
|
|
7528
|
+
fill: $i,
|
|
7529
|
+
clipPath: `url(#${n})`
|
|
7530
|
+
})
|
|
7531
|
+
]
|
|
7532
|
+
});
|
|
7387
7533
|
}
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7534
|
+
function sa({ value: e = 0, size: t = 16 }) {
|
|
7535
|
+
let n = o().replace(/:/g, "");
|
|
7536
|
+
return /* @__PURE__ */ f("span", {
|
|
7537
|
+
role: "img",
|
|
7538
|
+
"aria-label": `${e}/5`,
|
|
7539
|
+
style: {
|
|
7540
|
+
display: "inline-flex",
|
|
7541
|
+
gap: "1px",
|
|
7542
|
+
verticalAlign: "middle"
|
|
7543
|
+
},
|
|
7544
|
+
children: [
|
|
7545
|
+
0,
|
|
7546
|
+
1,
|
|
7547
|
+
2,
|
|
7548
|
+
3,
|
|
7549
|
+
4
|
|
7550
|
+
].map((r) => /* @__PURE__ */ f(oa, {
|
|
7551
|
+
fill: Math.max(0, Math.min(1, e - r)),
|
|
7552
|
+
size: t,
|
|
7553
|
+
clipId: `${n}-${r}`
|
|
7554
|
+
}, r))
|
|
7555
|
+
});
|
|
7392
7556
|
}
|
|
7393
|
-
function
|
|
7394
|
-
let i =
|
|
7395
|
-
return /* @__PURE__ */
|
|
7557
|
+
function ca({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
7558
|
+
let i = o().replace(/:/g, ""), [a, s] = l(0), c = a || e;
|
|
7559
|
+
return /* @__PURE__ */ f("span", {
|
|
7560
|
+
role: "radiogroup",
|
|
7561
|
+
"aria-label": r,
|
|
7396
7562
|
style: {
|
|
7397
7563
|
display: "inline-flex",
|
|
7398
|
-
|
|
7399
|
-
gap: "8px",
|
|
7400
|
-
fontSize: `${r}px`
|
|
7564
|
+
gap: "2px"
|
|
7401
7565
|
},
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7566
|
+
onMouseLeave: () => s(0),
|
|
7567
|
+
children: [
|
|
7568
|
+
1,
|
|
7569
|
+
2,
|
|
7570
|
+
3,
|
|
7571
|
+
4,
|
|
7572
|
+
5
|
|
7573
|
+
].map((r) => /* @__PURE__ */ f("button", {
|
|
7574
|
+
type: "button",
|
|
7575
|
+
role: "radio",
|
|
7576
|
+
"aria-checked": e === r,
|
|
7577
|
+
"aria-label": String(r),
|
|
7578
|
+
onMouseEnter: () => s(r),
|
|
7579
|
+
onClick: () => t(r),
|
|
7406
7580
|
style: {
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7581
|
+
background: "none",
|
|
7582
|
+
border: 0,
|
|
7583
|
+
padding: 0,
|
|
7584
|
+
cursor: "pointer",
|
|
7585
|
+
lineHeight: 0
|
|
7410
7586
|
},
|
|
7411
|
-
children:
|
|
7412
|
-
|
|
7587
|
+
children: /* @__PURE__ */ f(oa, {
|
|
7588
|
+
fill: +(c >= r),
|
|
7589
|
+
size: n,
|
|
7590
|
+
clipId: `${i}-${r}`
|
|
7591
|
+
})
|
|
7592
|
+
}, r))
|
|
7413
7593
|
});
|
|
7414
7594
|
}
|
|
7415
|
-
|
|
7416
|
-
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
id: `sample-${e}`,
|
|
7421
|
-
slug: `sample-${e}`,
|
|
7422
|
-
name: `Product ${e}`,
|
|
7423
|
-
price: e * 1990,
|
|
7424
|
-
compare_at_price: e === 2 ? 4990 : null,
|
|
7425
|
-
images: [],
|
|
7426
|
-
variants: [],
|
|
7427
|
-
stock: null,
|
|
7428
|
-
currency: "USD",
|
|
7429
|
-
sample: !0
|
|
7430
|
-
}));
|
|
7431
|
-
function sa({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product?product={slug}", showButton: i = !0, buttonLabel: o = "", emptyText: s = "", style: c, nodeRef: u, inert: d = !1, sample: m = !1, noNavigate: h = !1 }) {
|
|
7432
|
-
let { tenant: g, apiUrl: _, locale: v, words: y } = ea(), [b, x] = l(null), [S, C] = l(null), [w, T] = l(""), [E, D] = l({}), { store: O, currency: k } = ta(_, g, !d);
|
|
7595
|
+
function la(e, { inert: t }) {
|
|
7596
|
+
let { tenant: n, apiUrl: r, favoritesOn: i } = na(), [o, s] = l({
|
|
7597
|
+
favorited: !1,
|
|
7598
|
+
count: null
|
|
7599
|
+
});
|
|
7433
7600
|
a(() => {
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
C(n), x(Array.isArray(t?.data) ? t.data.map((e) => ({
|
|
7439
|
-
...e,
|
|
7440
|
-
currency: r
|
|
7441
|
-
})) : []);
|
|
7442
|
-
}).catch(() => e && x([])), () => {
|
|
7443
|
-
e = !1;
|
|
7601
|
+
if (!e || !i || t) return;
|
|
7602
|
+
let a = !0;
|
|
7603
|
+
return Q(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && s(e)).catch(() => {}), () => {
|
|
7604
|
+
a = !1;
|
|
7444
7605
|
};
|
|
7445
7606
|
}, [
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7607
|
+
r,
|
|
7608
|
+
n,
|
|
7609
|
+
e,
|
|
7610
|
+
i,
|
|
7611
|
+
t
|
|
7450
7612
|
]);
|
|
7451
|
-
let
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
}
|
|
7613
|
+
let c = async () => {
|
|
7614
|
+
let t = !o.favorited;
|
|
7615
|
+
s((e) => ({
|
|
7616
|
+
favorited: t,
|
|
7617
|
+
count: Math.max(0, (e.count ?? 0) + (t ? 1 : -1))
|
|
7618
|
+
}));
|
|
7619
|
+
try {
|
|
7620
|
+
s(await Q(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
|
|
7621
|
+
method: "POST",
|
|
7622
|
+
body: { on: t }
|
|
7623
|
+
}));
|
|
7624
|
+
} catch (e) {
|
|
7625
|
+
throw s((e) => ({
|
|
7626
|
+
favorited: !t,
|
|
7627
|
+
count: Math.max(0, (e.count ?? 0) + (t ? -1 : 1))
|
|
7628
|
+
})), e;
|
|
7467
7629
|
}
|
|
7468
7630
|
};
|
|
7469
|
-
return
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7631
|
+
return {
|
|
7632
|
+
...o,
|
|
7633
|
+
toggle: c
|
|
7634
|
+
};
|
|
7635
|
+
}
|
|
7636
|
+
var ua = (e) => /* @__PURE__ */ f("svg", {
|
|
7637
|
+
width: "20",
|
|
7638
|
+
height: "20",
|
|
7639
|
+
viewBox: "0 0 24 24",
|
|
7640
|
+
"aria-hidden": "true",
|
|
7641
|
+
style: { display: "block" },
|
|
7642
|
+
children: /* @__PURE__ */ f("path", {
|
|
7643
|
+
d: "M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.8 4.5c2.1 0 3.6 1.1 5.2 3 1.6-1.9 3.1-3 5.2-3 3.8 0 5.9 3.9 4.4 7.3C19.5 16.4 12 21 12 21z",
|
|
7644
|
+
fill: e ? "#ef4444" : "none",
|
|
7645
|
+
stroke: e ? "#ef4444" : "currentColor",
|
|
7646
|
+
strokeWidth: "1.8"
|
|
7647
|
+
})
|
|
7648
|
+
});
|
|
7649
|
+
function da({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
7650
|
+
let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = na(), u = e?.sample ? "" : e?.slug || e?.id || "", d = la(u, { inert: t || !u }), [m, h] = l(""), g = n ? 29 : e?.rating_count ?? 0, _ = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : d.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
|
|
7651
|
+
n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
|
|
7652
|
+
behavior: "smooth",
|
|
7653
|
+
block: "start"
|
|
7654
|
+
});
|
|
7655
|
+
}, x = async () => {
|
|
7656
|
+
if (!(t || !u)) try {
|
|
7657
|
+
await d.toggle();
|
|
7658
|
+
} catch (e) {
|
|
7659
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : h(Gi(i, e));
|
|
7660
|
+
}
|
|
7661
|
+
}, S = [];
|
|
7662
|
+
return a && g > 0 && S.push(/* @__PURE__ */ p("span", {
|
|
7663
|
+
style: {
|
|
7664
|
+
display: "inline-flex",
|
|
7665
|
+
alignItems: "center",
|
|
7666
|
+
gap: "6px"
|
|
7667
|
+
},
|
|
7668
|
+
children: [
|
|
7669
|
+
/* @__PURE__ */ f("strong", { children: _.toLocaleString(r || void 0, {
|
|
7670
|
+
minimumFractionDigits: 1,
|
|
7671
|
+
maximumFractionDigits: 1
|
|
7672
|
+
}) }),
|
|
7673
|
+
/* @__PURE__ */ f(sa, { value: _ }),
|
|
7674
|
+
/* @__PURE__ */ f("a", {
|
|
7675
|
+
href: "#reviews",
|
|
7676
|
+
onClick: b("reviews"),
|
|
7677
|
+
style: { color: "inherit" },
|
|
7678
|
+
children: g === 1 ? i("reviewsOne") : i("reviewsCount", { n: ra(g, r) })
|
|
7679
|
+
})
|
|
7680
|
+
]
|
|
7681
|
+
}, "r")), o && v > 0 && S.push(/* @__PURE__ */ f("a", {
|
|
7682
|
+
href: "#questions",
|
|
7683
|
+
onClick: b("questions"),
|
|
7684
|
+
style: { color: "inherit" },
|
|
7685
|
+
children: i("qaCount", { n: ra(v, r) })
|
|
7686
|
+
}, "q")), !S.length && !s ? null : /* @__PURE__ */ p("div", {
|
|
7687
|
+
style: {
|
|
7688
|
+
display: "flex",
|
|
7689
|
+
flexDirection: "column",
|
|
7690
|
+
gap: "8px",
|
|
7691
|
+
fontSize: "14px"
|
|
7692
|
+
},
|
|
7693
|
+
children: [
|
|
7694
|
+
S.length > 0 && /* @__PURE__ */ f("div", {
|
|
7695
|
+
style: {
|
|
7696
|
+
display: "flex",
|
|
7697
|
+
alignItems: "center",
|
|
7698
|
+
gap: "10px",
|
|
7699
|
+
flexWrap: "wrap"
|
|
7700
|
+
},
|
|
7701
|
+
children: S.flatMap((e, t) => t ? [/* @__PURE__ */ f("span", {
|
|
7702
|
+
style: { color: Xi },
|
|
7703
|
+
children: "•"
|
|
7704
|
+
}, `s${t}`), e] : [e])
|
|
7705
|
+
}),
|
|
7706
|
+
s && /* @__PURE__ */ p("div", {
|
|
7707
|
+
style: {
|
|
7708
|
+
display: "flex",
|
|
7709
|
+
alignItems: "center",
|
|
7710
|
+
gap: "10px"
|
|
7711
|
+
},
|
|
7712
|
+
children: [/* @__PURE__ */ f("button", {
|
|
7713
|
+
type: "button",
|
|
7714
|
+
onClick: x,
|
|
7715
|
+
"aria-pressed": d.favorited,
|
|
7716
|
+
"aria-label": d.favorited ? i("unfavorite") : i("favorite"),
|
|
7717
|
+
title: d.favorited ? i("unfavorite") : i("favorite"),
|
|
7487
7718
|
style: {
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7719
|
+
...ta,
|
|
7720
|
+
padding: "7px",
|
|
7721
|
+
borderRadius: "999px",
|
|
7722
|
+
lineHeight: 0
|
|
7491
7723
|
},
|
|
7492
|
-
children:
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
overflow: "hidden",
|
|
7505
|
-
background: Zi
|
|
7506
|
-
},
|
|
7507
|
-
children: e.images?.[0] && /* @__PURE__ */ f("img", {
|
|
7508
|
-
src: e.images[0],
|
|
7509
|
-
alt: e.name,
|
|
7510
|
-
loading: "lazy",
|
|
7511
|
-
style: {
|
|
7512
|
-
width: "100%",
|
|
7513
|
-
height: "100%",
|
|
7514
|
-
objectFit: "cover",
|
|
7515
|
-
display: "block"
|
|
7516
|
-
}
|
|
7517
|
-
})
|
|
7518
|
-
}), /* @__PURE__ */ f("div", {
|
|
7519
|
-
style: {
|
|
7520
|
-
marginTop: "10px",
|
|
7521
|
-
fontWeight: 600
|
|
7522
|
-
},
|
|
7523
|
-
children: e.name
|
|
7524
|
-
})]
|
|
7525
|
-
}),
|
|
7526
|
-
/* @__PURE__ */ f(aa, {
|
|
7527
|
-
product: e,
|
|
7528
|
-
locale: v
|
|
7529
|
-
}),
|
|
7530
|
-
i && (e.variants?.length ? /* @__PURE__ */ f("a", {
|
|
7531
|
-
href: n,
|
|
7532
|
-
onClick: h ? (e) => e.preventDefault() : void 0,
|
|
7533
|
-
style: {
|
|
7534
|
-
...$i,
|
|
7535
|
-
display: "block"
|
|
7536
|
-
},
|
|
7537
|
-
children: y("choose")
|
|
7538
|
-
}) : /* @__PURE__ */ f("button", {
|
|
7539
|
-
type: "button",
|
|
7540
|
-
disabled: t || w === e.id,
|
|
7541
|
-
onClick: () => j(e),
|
|
7542
|
-
style: {
|
|
7543
|
-
...Qi,
|
|
7544
|
-
opacity: t ? .5 : 1
|
|
7545
|
-
},
|
|
7546
|
-
children: t ? y("soldOut") : w === e.id ? y("adding") : o || y("add")
|
|
7547
|
-
})),
|
|
7548
|
-
E[e.id] && /* @__PURE__ */ f("span", {
|
|
7549
|
-
style: {
|
|
7550
|
-
fontSize: "13px",
|
|
7551
|
-
color: $
|
|
7552
|
-
},
|
|
7553
|
-
children: E[e.id]
|
|
7554
|
-
})
|
|
7555
|
-
]
|
|
7556
|
-
}, e.id);
|
|
7724
|
+
children: ua(d.favorited)
|
|
7725
|
+
}), y > 0 && /* @__PURE__ */ f("span", {
|
|
7726
|
+
style: { fontWeight: 600 },
|
|
7727
|
+
children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: ra(y, r) })
|
|
7728
|
+
})]
|
|
7729
|
+
}),
|
|
7730
|
+
m && /* @__PURE__ */ f("span", {
|
|
7731
|
+
style: {
|
|
7732
|
+
color: Xi,
|
|
7733
|
+
fontSize: "13px"
|
|
7734
|
+
},
|
|
7735
|
+
children: m
|
|
7557
7736
|
})
|
|
7558
|
-
|
|
7737
|
+
]
|
|
7559
7738
|
});
|
|
7560
7739
|
}
|
|
7561
|
-
|
|
7562
|
-
|
|
7740
|
+
var fa = {
|
|
7741
|
+
data: [{
|
|
7742
|
+
id: "s1",
|
|
7743
|
+
author: "Ayşe Y.",
|
|
7744
|
+
rating: 5,
|
|
7745
|
+
title: "Harika",
|
|
7746
|
+
body: "Beklediğimden de iyi çıktı.",
|
|
7747
|
+
verified: !0,
|
|
7748
|
+
reply: "",
|
|
7749
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
7750
|
+
}, {
|
|
7751
|
+
id: "s2",
|
|
7752
|
+
author: "Mehmet K.",
|
|
7753
|
+
rating: 4,
|
|
7754
|
+
title: "",
|
|
7755
|
+
body: "Kaliteli, kargo biraz gecikti.",
|
|
7756
|
+
verified: !1,
|
|
7757
|
+
reply: "Geri bildiriminiz için teşekkürler!",
|
|
7758
|
+
created_at: (/* @__PURE__ */ new Date(Date.now() - 864e5 * 3)).toISOString()
|
|
7759
|
+
}],
|
|
7760
|
+
total: {
|
|
7761
|
+
all: 29,
|
|
7762
|
+
filtered: 29
|
|
7763
|
+
},
|
|
7764
|
+
summary: {
|
|
7765
|
+
average: 4.3,
|
|
7766
|
+
count: 29,
|
|
7767
|
+
histogram: [
|
|
7768
|
+
1,
|
|
7769
|
+
1,
|
|
7770
|
+
3,
|
|
7771
|
+
6,
|
|
7772
|
+
18
|
|
7773
|
+
]
|
|
7774
|
+
}
|
|
7775
|
+
};
|
|
7776
|
+
function pa({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
7777
|
+
let { tenant: r, apiUrl: i, locale: o, words: s, reviewsOn: c, moderated: u, loginHref: d } = na(), m = fi(), h = e?.sample ? "" : e?.slug || e?.id || "", [g, _] = l(null), [v, y] = l("newest"), [b, x] = l(0), [S, C] = l(5), [w, T] = l(0), [E, D] = l({
|
|
7778
|
+
rating: 0,
|
|
7779
|
+
title: "",
|
|
7780
|
+
body: ""
|
|
7781
|
+
}), [O, k] = l(!1), [A, j] = l(!1), [M, N] = l("");
|
|
7563
7782
|
if (a(() => {
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7783
|
+
if (!c || !h) return;
|
|
7784
|
+
let e = !0, t = `?limit=${S}&sort=${v}${b ? `&rating=${b}` : ""}`;
|
|
7785
|
+
return Q(i, r, `/store/products/${encodeURIComponent(h)}/reviews${t}`).then((t) => e && _(t)).catch(() => e && _({
|
|
7786
|
+
data: [],
|
|
7787
|
+
total: {
|
|
7788
|
+
all: 0,
|
|
7789
|
+
filtered: 0
|
|
7790
|
+
},
|
|
7791
|
+
summary: {
|
|
7792
|
+
average: 0,
|
|
7793
|
+
count: 0,
|
|
7794
|
+
histogram: [
|
|
7795
|
+
0,
|
|
7796
|
+
0,
|
|
7797
|
+
0,
|
|
7798
|
+
0,
|
|
7799
|
+
0
|
|
7800
|
+
]
|
|
7576
7801
|
}
|
|
7577
|
-
})
|
|
7578
|
-
e && (v(!0), g(o ? oa[0] : null));
|
|
7579
|
-
}), () => {
|
|
7802
|
+
})), () => {
|
|
7580
7803
|
e = !1;
|
|
7581
7804
|
};
|
|
7582
7805
|
}, [
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7806
|
+
i,
|
|
7807
|
+
r,
|
|
7808
|
+
h,
|
|
7809
|
+
v,
|
|
7810
|
+
b,
|
|
7811
|
+
S,
|
|
7812
|
+
w,
|
|
7813
|
+
c
|
|
7814
|
+
]), !c) return null;
|
|
7815
|
+
let P = n || !h ? fa : g, F = P?.summary ?? {
|
|
7816
|
+
average: 0,
|
|
7817
|
+
count: 0,
|
|
7818
|
+
histogram: [
|
|
7819
|
+
0,
|
|
7820
|
+
0,
|
|
7821
|
+
0,
|
|
7822
|
+
0,
|
|
7823
|
+
0
|
|
7824
|
+
]
|
|
7825
|
+
}, I = P?.data?.find((e) => e.mine), L = m.status === "user", R = () => {
|
|
7826
|
+
if (!t) {
|
|
7827
|
+
if (!L) {
|
|
7828
|
+
window.location.assign(d());
|
|
7829
|
+
return;
|
|
7607
7830
|
}
|
|
7831
|
+
D(I ? {
|
|
7832
|
+
rating: I.rating,
|
|
7833
|
+
title: I.title,
|
|
7834
|
+
body: I.body
|
|
7835
|
+
} : {
|
|
7836
|
+
rating: 0,
|
|
7837
|
+
title: "",
|
|
7838
|
+
body: ""
|
|
7839
|
+
}), N(""), k(!0);
|
|
7608
7840
|
}
|
|
7609
|
-
}
|
|
7610
|
-
|
|
7611
|
-
|
|
7841
|
+
}, z = async (e) => {
|
|
7842
|
+
if (e.preventDefault(), !E.rating) {
|
|
7843
|
+
N(s("pickRating"));
|
|
7844
|
+
return;
|
|
7845
|
+
}
|
|
7846
|
+
j(!0), N("");
|
|
7847
|
+
try {
|
|
7848
|
+
await Q(i, r, `/store/products/${encodeURIComponent(h)}/reviews`, {
|
|
7849
|
+
method: "POST",
|
|
7850
|
+
body: E
|
|
7851
|
+
}), k(!1), N(s(u ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
|
|
7852
|
+
} catch (e) {
|
|
7853
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(d()) : N(Gi(s, e));
|
|
7854
|
+
} finally {
|
|
7855
|
+
j(!1);
|
|
7856
|
+
}
|
|
7857
|
+
}, B = Math.max(1, ...F.histogram);
|
|
7858
|
+
return /* @__PURE__ */ p("section", {
|
|
7859
|
+
id: "reviews",
|
|
7612
7860
|
style: {
|
|
7613
|
-
display: "
|
|
7614
|
-
|
|
7615
|
-
gap: "
|
|
7616
|
-
|
|
7861
|
+
display: "flex",
|
|
7862
|
+
flexDirection: "column",
|
|
7863
|
+
gap: "16px",
|
|
7864
|
+
scrollMarginTop: "80px"
|
|
7617
7865
|
},
|
|
7618
|
-
children: [
|
|
7619
|
-
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7866
|
+
children: [
|
|
7867
|
+
/* @__PURE__ */ f("h2", {
|
|
7868
|
+
style: {
|
|
7869
|
+
margin: 0,
|
|
7870
|
+
fontSize: "var(--page-h3, 24px)"
|
|
7871
|
+
},
|
|
7872
|
+
children: s("reviewsTitle")
|
|
7873
|
+
}),
|
|
7874
|
+
/* @__PURE__ */ p("div", {
|
|
7875
|
+
style: {
|
|
7876
|
+
display: "flex",
|
|
7877
|
+
gap: "32px",
|
|
7878
|
+
flexWrap: "wrap",
|
|
7879
|
+
alignItems: "center"
|
|
7880
|
+
},
|
|
7881
|
+
children: [
|
|
7882
|
+
/* @__PURE__ */ p("div", {
|
|
7883
|
+
style: {
|
|
7884
|
+
display: "flex",
|
|
7885
|
+
flexDirection: "column",
|
|
7886
|
+
alignItems: "flex-start",
|
|
7887
|
+
gap: "4px"
|
|
7888
|
+
},
|
|
7889
|
+
children: [
|
|
7890
|
+
/* @__PURE__ */ f("span", {
|
|
7891
|
+
style: {
|
|
7892
|
+
fontSize: "40px",
|
|
7893
|
+
fontWeight: 700,
|
|
7894
|
+
lineHeight: 1
|
|
7895
|
+
},
|
|
7896
|
+
children: F.count ? F.average.toLocaleString(o || void 0, {
|
|
7897
|
+
minimumFractionDigits: 1,
|
|
7898
|
+
maximumFractionDigits: 1
|
|
7899
|
+
}) : "–"
|
|
7900
|
+
}),
|
|
7901
|
+
/* @__PURE__ */ f(sa, {
|
|
7902
|
+
value: F.average,
|
|
7903
|
+
size: 18
|
|
7904
|
+
}),
|
|
7905
|
+
/* @__PURE__ */ f("span", {
|
|
7906
|
+
style: {
|
|
7907
|
+
color: Xi,
|
|
7908
|
+
fontSize: "13px"
|
|
7909
|
+
},
|
|
7910
|
+
children: F.count === 1 ? s("reviewsOne") : s("reviewsCount", { n: F.count })
|
|
7911
|
+
})
|
|
7912
|
+
]
|
|
7913
|
+
}),
|
|
7914
|
+
/* @__PURE__ */ f("div", {
|
|
7915
|
+
style: {
|
|
7916
|
+
display: "flex",
|
|
7917
|
+
flexDirection: "column",
|
|
7918
|
+
gap: "4px",
|
|
7919
|
+
minWidth: "220px",
|
|
7920
|
+
flex: "1 1 220px",
|
|
7921
|
+
maxWidth: "360px"
|
|
7922
|
+
},
|
|
7923
|
+
children: [
|
|
7924
|
+
5,
|
|
7925
|
+
4,
|
|
7926
|
+
3,
|
|
7927
|
+
2,
|
|
7928
|
+
1
|
|
7929
|
+
].map((e) => {
|
|
7930
|
+
let n = F.histogram[e - 1] ?? 0, r = b === e;
|
|
7931
|
+
return /* @__PURE__ */ p("button", {
|
|
7932
|
+
type: "button",
|
|
7933
|
+
disabled: !n && !r,
|
|
7934
|
+
onClick: () => !t && x(r ? 0 : e),
|
|
7935
|
+
title: s("starsN", { n: e }),
|
|
7936
|
+
style: {
|
|
7937
|
+
display: "grid",
|
|
7938
|
+
gridTemplateColumns: "28px 1fr 32px",
|
|
7939
|
+
alignItems: "center",
|
|
7940
|
+
gap: "8px",
|
|
7941
|
+
background: "none",
|
|
7942
|
+
border: 0,
|
|
7943
|
+
padding: "2px 0",
|
|
7944
|
+
cursor: n ? "pointer" : "default",
|
|
7945
|
+
color: "inherit",
|
|
7946
|
+
fontFamily: "inherit",
|
|
7947
|
+
fontSize: "13px",
|
|
7948
|
+
fontWeight: r ? 700 : 400
|
|
7949
|
+
},
|
|
7950
|
+
children: [
|
|
7951
|
+
/* @__PURE__ */ p("span", { children: [e, "★"] }),
|
|
7952
|
+
/* @__PURE__ */ f("span", {
|
|
7953
|
+
style: {
|
|
7954
|
+
height: "8px",
|
|
7955
|
+
borderRadius: "4px",
|
|
7956
|
+
background: Qi,
|
|
7957
|
+
overflow: "hidden"
|
|
7958
|
+
},
|
|
7959
|
+
children: /* @__PURE__ */ f("span", { style: {
|
|
7960
|
+
display: "block",
|
|
7961
|
+
height: "100%",
|
|
7962
|
+
width: `${n / B * 100}%`,
|
|
7963
|
+
background: $i
|
|
7964
|
+
} })
|
|
7965
|
+
}),
|
|
7966
|
+
/* @__PURE__ */ f("span", {
|
|
7967
|
+
style: {
|
|
7968
|
+
color: Xi,
|
|
7969
|
+
textAlign: "right"
|
|
7970
|
+
},
|
|
7971
|
+
children: n
|
|
7972
|
+
})
|
|
7973
|
+
]
|
|
7974
|
+
}, e);
|
|
7975
|
+
})
|
|
7976
|
+
}),
|
|
7977
|
+
/* @__PURE__ */ f("div", {
|
|
7978
|
+
style: { marginLeft: "auto" },
|
|
7979
|
+
children: /* @__PURE__ */ f("button", {
|
|
7980
|
+
type: "button",
|
|
7981
|
+
onClick: R,
|
|
7982
|
+
style: ea,
|
|
7983
|
+
children: s(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
|
|
7984
|
+
})
|
|
7985
|
+
})
|
|
7986
|
+
]
|
|
7987
|
+
}),
|
|
7988
|
+
O && /* @__PURE__ */ p("form", {
|
|
7989
|
+
onSubmit: z,
|
|
7990
|
+
style: {
|
|
7991
|
+
display: "flex",
|
|
7992
|
+
flexDirection: "column",
|
|
7993
|
+
gap: "10px",
|
|
7994
|
+
padding: "16px",
|
|
7995
|
+
border: Zi,
|
|
7996
|
+
borderRadius: "12px"
|
|
7997
|
+
},
|
|
7998
|
+
children: [
|
|
7999
|
+
/* @__PURE__ */ p("label", {
|
|
8000
|
+
style: {
|
|
8001
|
+
display: "flex",
|
|
8002
|
+
alignItems: "center",
|
|
8003
|
+
gap: "12px",
|
|
8004
|
+
fontWeight: 600
|
|
8005
|
+
},
|
|
8006
|
+
children: [s("yourRating"), /* @__PURE__ */ f(ca, {
|
|
8007
|
+
value: E.rating,
|
|
8008
|
+
label: s("yourRating"),
|
|
8009
|
+
onChange: (e) => D((t) => ({
|
|
8010
|
+
...t,
|
|
8011
|
+
rating: e
|
|
8012
|
+
}))
|
|
8013
|
+
})]
|
|
8014
|
+
}),
|
|
8015
|
+
/* @__PURE__ */ f("input", {
|
|
8016
|
+
value: E.title,
|
|
8017
|
+
maxLength: 150,
|
|
8018
|
+
placeholder: s("reviewTitle"),
|
|
8019
|
+
onChange: (e) => D((t) => ({
|
|
8020
|
+
...t,
|
|
8021
|
+
title: e.target.value
|
|
8022
|
+
})),
|
|
8023
|
+
style: X
|
|
8024
|
+
}),
|
|
8025
|
+
/* @__PURE__ */ f("textarea", {
|
|
8026
|
+
value: E.body,
|
|
8027
|
+
maxLength: 4e3,
|
|
8028
|
+
rows: 4,
|
|
8029
|
+
placeholder: s("reviewBody"),
|
|
8030
|
+
onChange: (e) => D((t) => ({
|
|
8031
|
+
...t,
|
|
8032
|
+
body: e.target.value
|
|
8033
|
+
})),
|
|
8034
|
+
style: {
|
|
8035
|
+
...X,
|
|
8036
|
+
resize: "vertical",
|
|
8037
|
+
fontFamily: "inherit"
|
|
8038
|
+
}
|
|
8039
|
+
}),
|
|
8040
|
+
/* @__PURE__ */ p("div", {
|
|
8041
|
+
style: {
|
|
8042
|
+
display: "flex",
|
|
8043
|
+
gap: "8px"
|
|
8044
|
+
},
|
|
8045
|
+
children: [/* @__PURE__ */ f("button", {
|
|
8046
|
+
type: "submit",
|
|
8047
|
+
disabled: A,
|
|
8048
|
+
style: ea,
|
|
8049
|
+
children: s("submitReview")
|
|
8050
|
+
}), /* @__PURE__ */ f("button", {
|
|
8051
|
+
type: "button",
|
|
8052
|
+
onClick: () => k(!1),
|
|
8053
|
+
style: ta,
|
|
8054
|
+
children: "✕"
|
|
8055
|
+
})]
|
|
8056
|
+
})
|
|
8057
|
+
]
|
|
8058
|
+
}),
|
|
8059
|
+
M && /* @__PURE__ */ f("p", {
|
|
8060
|
+
style: {
|
|
8061
|
+
margin: 0,
|
|
8062
|
+
color: Xi
|
|
8063
|
+
},
|
|
8064
|
+
children: M
|
|
8065
|
+
}),
|
|
8066
|
+
/* @__PURE__ */ p("div", {
|
|
8067
|
+
style: {
|
|
8068
|
+
display: "flex",
|
|
8069
|
+
alignItems: "center",
|
|
8070
|
+
gap: "12px",
|
|
8071
|
+
flexWrap: "wrap"
|
|
8072
|
+
},
|
|
8073
|
+
children: [/* @__PURE__ */ p("select", {
|
|
8074
|
+
value: v,
|
|
8075
|
+
onChange: (e) => y(e.target.value),
|
|
8076
|
+
disabled: t,
|
|
8077
|
+
style: {
|
|
8078
|
+
...X,
|
|
8079
|
+
width: "auto"
|
|
8080
|
+
},
|
|
8081
|
+
children: [
|
|
8082
|
+
/* @__PURE__ */ f("option", {
|
|
8083
|
+
value: "newest",
|
|
8084
|
+
children: s("sortNewest")
|
|
8085
|
+
}),
|
|
8086
|
+
/* @__PURE__ */ f("option", {
|
|
8087
|
+
value: "helpful",
|
|
8088
|
+
children: s("sortHelpful")
|
|
8089
|
+
}),
|
|
8090
|
+
/* @__PURE__ */ f("option", {
|
|
8091
|
+
value: "highest",
|
|
8092
|
+
children: s("sortHighest")
|
|
8093
|
+
}),
|
|
8094
|
+
/* @__PURE__ */ f("option", {
|
|
8095
|
+
value: "lowest",
|
|
8096
|
+
children: s("sortLowest")
|
|
8097
|
+
})
|
|
8098
|
+
]
|
|
8099
|
+
}), b > 0 && /* @__PURE__ */ p("button", {
|
|
8100
|
+
type: "button",
|
|
8101
|
+
onClick: () => x(0),
|
|
8102
|
+
style: {
|
|
8103
|
+
...ta,
|
|
8104
|
+
padding: "6px 12px"
|
|
8105
|
+
},
|
|
8106
|
+
children: [s("starsN", { n: b }), " ✕"]
|
|
8107
|
+
})]
|
|
8108
|
+
}),
|
|
8109
|
+
P && !P.data.length && /* @__PURE__ */ f("p", {
|
|
8110
|
+
style: {
|
|
8111
|
+
margin: 0,
|
|
8112
|
+
color: Xi
|
|
8113
|
+
},
|
|
8114
|
+
children: s("noReviews")
|
|
8115
|
+
}),
|
|
8116
|
+
/* @__PURE__ */ f("div", {
|
|
8117
|
+
style: {
|
|
8118
|
+
display: "flex",
|
|
8119
|
+
flexDirection: "column"
|
|
8120
|
+
},
|
|
8121
|
+
children: (P?.data ?? []).map((e) => /* @__PURE__ */ p("article", {
|
|
8122
|
+
style: {
|
|
8123
|
+
padding: "16px 0",
|
|
8124
|
+
borderTop: Zi,
|
|
8125
|
+
display: "flex",
|
|
8126
|
+
flexDirection: "column",
|
|
8127
|
+
gap: "6px"
|
|
8128
|
+
},
|
|
8129
|
+
children: [
|
|
8130
|
+
/* @__PURE__ */ p("div", {
|
|
8131
|
+
style: {
|
|
8132
|
+
display: "flex",
|
|
8133
|
+
alignItems: "center",
|
|
8134
|
+
gap: "10px",
|
|
8135
|
+
flexWrap: "wrap"
|
|
8136
|
+
},
|
|
8137
|
+
children: [
|
|
8138
|
+
/* @__PURE__ */ f(sa, { value: e.rating }),
|
|
8139
|
+
e.title && /* @__PURE__ */ f("strong", { children: e.title }),
|
|
8140
|
+
e.mine && e.status === "pending" && /* @__PURE__ */ f("span", {
|
|
8141
|
+
style: {
|
|
8142
|
+
fontSize: "12px",
|
|
8143
|
+
padding: "2px 8px",
|
|
8144
|
+
borderRadius: "999px",
|
|
8145
|
+
background: Qi,
|
|
8146
|
+
color: Xi
|
|
8147
|
+
},
|
|
8148
|
+
children: s("awaitingApproval")
|
|
8149
|
+
})
|
|
8150
|
+
]
|
|
8151
|
+
}),
|
|
8152
|
+
e.body && /* @__PURE__ */ f("p", {
|
|
8153
|
+
style: {
|
|
8154
|
+
margin: 0,
|
|
8155
|
+
whiteSpace: "pre-wrap",
|
|
8156
|
+
lineHeight: 1.55
|
|
8157
|
+
},
|
|
8158
|
+
children: e.body
|
|
8159
|
+
}),
|
|
8160
|
+
/* @__PURE__ */ p("span", {
|
|
8161
|
+
style: {
|
|
8162
|
+
fontSize: "13px",
|
|
8163
|
+
color: Xi
|
|
8164
|
+
},
|
|
8165
|
+
children: [
|
|
8166
|
+
e.author || s("anonymous"),
|
|
8167
|
+
" · ",
|
|
8168
|
+
ia(e.created_at, o),
|
|
8169
|
+
e.verified && /* @__PURE__ */ p("span", {
|
|
8170
|
+
style: {
|
|
8171
|
+
color: "#16a34a",
|
|
8172
|
+
fontWeight: 600
|
|
8173
|
+
},
|
|
8174
|
+
children: [" · ✓ ", s("verified")]
|
|
8175
|
+
})
|
|
8176
|
+
]
|
|
8177
|
+
}),
|
|
8178
|
+
e.reply && /* @__PURE__ */ p("div", {
|
|
8179
|
+
style: {
|
|
8180
|
+
marginTop: "4px",
|
|
8181
|
+
padding: "10px 12px",
|
|
8182
|
+
borderRadius: "8px",
|
|
8183
|
+
background: Qi,
|
|
8184
|
+
fontSize: "14px"
|
|
8185
|
+
},
|
|
8186
|
+
children: [/* @__PURE__ */ f("strong", {
|
|
8187
|
+
style: {
|
|
8188
|
+
display: "block",
|
|
8189
|
+
fontSize: "12px",
|
|
8190
|
+
color: Xi,
|
|
8191
|
+
marginBottom: "2px"
|
|
8192
|
+
},
|
|
8193
|
+
children: s("shopReply")
|
|
8194
|
+
}), /* @__PURE__ */ f("span", {
|
|
8195
|
+
style: { whiteSpace: "pre-wrap" },
|
|
8196
|
+
children: e.reply
|
|
8197
|
+
})]
|
|
8198
|
+
})
|
|
8199
|
+
]
|
|
8200
|
+
}, e.id))
|
|
8201
|
+
}),
|
|
8202
|
+
P && P.data.length < (P.total?.filtered ?? 0) && !t && /* @__PURE__ */ f("button", {
|
|
8203
|
+
type: "button",
|
|
8204
|
+
onClick: () => C((e) => e + 10),
|
|
8205
|
+
style: {
|
|
8206
|
+
...ta,
|
|
8207
|
+
alignSelf: "center"
|
|
8208
|
+
},
|
|
8209
|
+
children: s("loadMore")
|
|
8210
|
+
})
|
|
8211
|
+
]
|
|
8212
|
+
});
|
|
8213
|
+
}
|
|
8214
|
+
var ma = {
|
|
8215
|
+
data: [{
|
|
8216
|
+
id: "q1",
|
|
8217
|
+
author: "Can D.",
|
|
8218
|
+
question: "Bulaşık makinesinde yıkanır mı?",
|
|
8219
|
+
answer: "Evet, yıkanabilir.",
|
|
8220
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
8221
|
+
}],
|
|
8222
|
+
total: {
|
|
8223
|
+
all: 1,
|
|
8224
|
+
filtered: 1
|
|
8225
|
+
}
|
|
8226
|
+
};
|
|
8227
|
+
function ha({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
8228
|
+
let { tenant: r, apiUrl: i, locale: o, words: s, questionsOn: c, loginHref: u } = na(), d = fi(), m = e?.sample ? "" : e?.slug || e?.id || "", [h, g] = l(null), [_, v] = l(5), [y, b] = l(0), [x, S] = l(""), [C, w] = l(!1), [T, E] = l("");
|
|
8229
|
+
if (a(() => {
|
|
8230
|
+
if (!c || !m) return;
|
|
8231
|
+
let e = !0;
|
|
8232
|
+
return Q(i, r, `/store/products/${encodeURIComponent(m)}/questions?limit=${_}`).then((t) => e && g(t)).catch(() => e && g({
|
|
8233
|
+
data: [],
|
|
8234
|
+
total: {
|
|
8235
|
+
all: 0,
|
|
8236
|
+
filtered: 0
|
|
8237
|
+
}
|
|
8238
|
+
})), () => {
|
|
8239
|
+
e = !1;
|
|
8240
|
+
};
|
|
8241
|
+
}, [
|
|
8242
|
+
i,
|
|
8243
|
+
r,
|
|
8244
|
+
m,
|
|
8245
|
+
_,
|
|
8246
|
+
y,
|
|
8247
|
+
c
|
|
8248
|
+
]), !c) return null;
|
|
8249
|
+
let D = n || !m ? ma : h, O = d.status === "user";
|
|
8250
|
+
return /* @__PURE__ */ p("section", {
|
|
8251
|
+
id: "questions",
|
|
8252
|
+
style: {
|
|
8253
|
+
display: "flex",
|
|
8254
|
+
flexDirection: "column",
|
|
8255
|
+
gap: "16px",
|
|
8256
|
+
scrollMarginTop: "80px"
|
|
8257
|
+
},
|
|
8258
|
+
children: [
|
|
8259
|
+
/* @__PURE__ */ f("h2", {
|
|
8260
|
+
style: {
|
|
8261
|
+
margin: 0,
|
|
8262
|
+
fontSize: "var(--page-h3, 24px)"
|
|
8263
|
+
},
|
|
8264
|
+
children: s("questionsTitle")
|
|
8265
|
+
}),
|
|
8266
|
+
O || t ? /* @__PURE__ */ p("form", {
|
|
8267
|
+
onSubmit: async (e) => {
|
|
8268
|
+
if (e.preventDefault(), !(t || x.trim().length < 3)) {
|
|
8269
|
+
if (!O) {
|
|
8270
|
+
window.location.assign(u());
|
|
8271
|
+
return;
|
|
8272
|
+
}
|
|
8273
|
+
w(!0), E("");
|
|
8274
|
+
try {
|
|
8275
|
+
await Q(i, r, `/store/products/${encodeURIComponent(m)}/questions`, {
|
|
8276
|
+
method: "POST",
|
|
8277
|
+
body: { question: x.trim() }
|
|
8278
|
+
}), S(""), E(s("questionPending")), b((e) => e + 1);
|
|
8279
|
+
} catch (e) {
|
|
8280
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : E(Gi(s, e));
|
|
8281
|
+
} finally {
|
|
8282
|
+
w(!1);
|
|
8283
|
+
}
|
|
8284
|
+
}
|
|
8285
|
+
},
|
|
8286
|
+
style: {
|
|
8287
|
+
display: "flex",
|
|
8288
|
+
gap: "8px",
|
|
8289
|
+
flexWrap: "wrap"
|
|
8290
|
+
},
|
|
8291
|
+
children: [/* @__PURE__ */ f("input", {
|
|
8292
|
+
value: x,
|
|
8293
|
+
maxLength: 1e3,
|
|
8294
|
+
placeholder: s("questionPlaceholder"),
|
|
8295
|
+
onChange: (e) => S(e.target.value),
|
|
8296
|
+
style: {
|
|
8297
|
+
...X,
|
|
8298
|
+
flex: "1 1 260px"
|
|
8299
|
+
}
|
|
8300
|
+
}), /* @__PURE__ */ f("button", {
|
|
8301
|
+
type: "submit",
|
|
8302
|
+
disabled: C || x.trim().length < 3,
|
|
8303
|
+
style: ea,
|
|
8304
|
+
children: s("submitQuestion")
|
|
8305
|
+
})]
|
|
8306
|
+
}) : /* @__PURE__ */ f("p", {
|
|
8307
|
+
style: { margin: 0 },
|
|
8308
|
+
children: /* @__PURE__ */ f("a", {
|
|
8309
|
+
href: u(),
|
|
8310
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8311
|
+
children: s("signInToAsk")
|
|
8312
|
+
})
|
|
8313
|
+
}),
|
|
8314
|
+
T && /* @__PURE__ */ f("p", {
|
|
8315
|
+
style: {
|
|
8316
|
+
margin: 0,
|
|
8317
|
+
color: Xi
|
|
8318
|
+
},
|
|
8319
|
+
children: T
|
|
8320
|
+
}),
|
|
8321
|
+
D && !D.data.length && /* @__PURE__ */ f("p", {
|
|
8322
|
+
style: {
|
|
8323
|
+
margin: 0,
|
|
8324
|
+
color: Xi
|
|
8325
|
+
},
|
|
8326
|
+
children: s("noQuestions")
|
|
8327
|
+
}),
|
|
8328
|
+
/* @__PURE__ */ f("div", {
|
|
8329
|
+
style: {
|
|
8330
|
+
display: "flex",
|
|
8331
|
+
flexDirection: "column"
|
|
8332
|
+
},
|
|
8333
|
+
children: (D?.data ?? []).map((e) => /* @__PURE__ */ p("article", {
|
|
8334
|
+
style: {
|
|
8335
|
+
padding: "14px 0",
|
|
8336
|
+
borderTop: Zi,
|
|
8337
|
+
display: "flex",
|
|
8338
|
+
flexDirection: "column",
|
|
8339
|
+
gap: "6px"
|
|
8340
|
+
},
|
|
8341
|
+
children: [
|
|
8342
|
+
/* @__PURE__ */ p("div", {
|
|
8343
|
+
style: {
|
|
8344
|
+
display: "flex",
|
|
8345
|
+
gap: "8px",
|
|
8346
|
+
alignItems: "baseline"
|
|
8347
|
+
},
|
|
8348
|
+
children: [/* @__PURE__ */ f("strong", {
|
|
8349
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8350
|
+
children: s("qMark")
|
|
8351
|
+
}), /* @__PURE__ */ f("span", {
|
|
8352
|
+
style: { fontWeight: 600 },
|
|
8353
|
+
children: e.question
|
|
8354
|
+
})]
|
|
8355
|
+
}),
|
|
8356
|
+
e.answer ? /* @__PURE__ */ p("div", {
|
|
8357
|
+
style: {
|
|
8358
|
+
display: "flex",
|
|
8359
|
+
gap: "8px",
|
|
8360
|
+
alignItems: "baseline"
|
|
8361
|
+
},
|
|
8362
|
+
children: [/* @__PURE__ */ f("strong", {
|
|
8363
|
+
style: { color: "#16a34a" },
|
|
8364
|
+
children: s("aMark")
|
|
8365
|
+
}), /* @__PURE__ */ f("span", {
|
|
8366
|
+
style: { whiteSpace: "pre-wrap" },
|
|
8367
|
+
children: e.answer
|
|
8368
|
+
})]
|
|
8369
|
+
}) : /* @__PURE__ */ f("span", {
|
|
8370
|
+
style: {
|
|
8371
|
+
fontSize: "12px",
|
|
8372
|
+
color: Xi
|
|
8373
|
+
},
|
|
8374
|
+
children: s("awaitingAnswer")
|
|
8375
|
+
}),
|
|
8376
|
+
/* @__PURE__ */ p("span", {
|
|
8377
|
+
style: {
|
|
8378
|
+
fontSize: "12px",
|
|
8379
|
+
color: Xi
|
|
8380
|
+
},
|
|
8381
|
+
children: [
|
|
8382
|
+
e.author || s("anonymous"),
|
|
8383
|
+
" · ",
|
|
8384
|
+
ia(e.created_at, o)
|
|
8385
|
+
]
|
|
8386
|
+
})
|
|
8387
|
+
]
|
|
8388
|
+
}, e.id))
|
|
8389
|
+
}),
|
|
8390
|
+
D && D.data.length < (D.total?.filtered ?? 0) && !t && /* @__PURE__ */ f("button", {
|
|
8391
|
+
type: "button",
|
|
8392
|
+
onClick: () => v((e) => e + 10),
|
|
8393
|
+
style: {
|
|
8394
|
+
...ta,
|
|
8395
|
+
alignSelf: "center"
|
|
8396
|
+
},
|
|
8397
|
+
children: s("loadMore")
|
|
8398
|
+
})
|
|
8399
|
+
]
|
|
8400
|
+
});
|
|
8401
|
+
}
|
|
8402
|
+
//#endregion
|
|
8403
|
+
//#region ../ui/src/components/builder/apps/shop/specs.jsx
|
|
8404
|
+
var ga = "1px solid var(--page-border, #d1d5db)", _a = "var(--page-muted, rgba(100,116,139,1))", va = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
|
|
8405
|
+
function ya(e, t, n, r) {
|
|
8406
|
+
let i = n || void 0;
|
|
8407
|
+
switch (e.type) {
|
|
8408
|
+
case "integer":
|
|
8409
|
+
case "number": return Number(t).toLocaleString(i);
|
|
8410
|
+
case "money": try {
|
|
8411
|
+
return new Intl.NumberFormat(i, {
|
|
8412
|
+
style: "currency",
|
|
8413
|
+
currency: t.currency
|
|
8414
|
+
}).format(t.amount);
|
|
8415
|
+
} catch {
|
|
8416
|
+
return `${t.amount} ${t.currency}`;
|
|
8417
|
+
}
|
|
8418
|
+
case "measurement": return `${Number(t.value).toLocaleString(i)} ${String(t.unit).replace("_", " ")}`;
|
|
8419
|
+
case "rating": {
|
|
8420
|
+
let n = Number(e.config?.max ?? 5);
|
|
8421
|
+
return /* @__PURE__ */ p("span", {
|
|
8422
|
+
style: {
|
|
8423
|
+
display: "inline-flex",
|
|
8424
|
+
alignItems: "center",
|
|
8425
|
+
gap: "6px"
|
|
8426
|
+
},
|
|
8427
|
+
children: [
|
|
8428
|
+
n === 5 && /* @__PURE__ */ f(sa, { value: Number(t) }),
|
|
8429
|
+
Number(t).toLocaleString(i),
|
|
8430
|
+
" / ",
|
|
8431
|
+
n
|
|
8432
|
+
]
|
|
8433
|
+
});
|
|
8434
|
+
}
|
|
8435
|
+
case "date":
|
|
8436
|
+
case "datetime": try {
|
|
8437
|
+
return new Intl.DateTimeFormat(i, e.type === "date" ? {
|
|
8438
|
+
day: "numeric",
|
|
8439
|
+
month: "long",
|
|
8440
|
+
year: "numeric"
|
|
8441
|
+
} : {
|
|
8442
|
+
dateStyle: "medium",
|
|
8443
|
+
timeStyle: "short"
|
|
8444
|
+
}).format(new Date(t));
|
|
8445
|
+
} catch {
|
|
8446
|
+
return String(t);
|
|
8447
|
+
}
|
|
8448
|
+
case "switch": return r(t ? "yes" : "no");
|
|
8449
|
+
case "color": return /* @__PURE__ */ p("span", {
|
|
8450
|
+
style: {
|
|
8451
|
+
display: "inline-flex",
|
|
8452
|
+
alignItems: "center",
|
|
8453
|
+
gap: "6px"
|
|
8454
|
+
},
|
|
8455
|
+
children: [/* @__PURE__ */ f("span", { style: {
|
|
8456
|
+
width: "14px",
|
|
8457
|
+
height: "14px",
|
|
8458
|
+
borderRadius: "4px",
|
|
8459
|
+
background: t,
|
|
8460
|
+
border: ga,
|
|
8461
|
+
display: "inline-block"
|
|
8462
|
+
} }), t]
|
|
8463
|
+
});
|
|
8464
|
+
case "link": {
|
|
8465
|
+
let e = va(t);
|
|
8466
|
+
return e ? /* @__PURE__ */ f("a", {
|
|
8467
|
+
href: e,
|
|
8468
|
+
target: "_blank",
|
|
8469
|
+
rel: "noopener noreferrer",
|
|
8470
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8471
|
+
children: t
|
|
8472
|
+
}) : String(t);
|
|
8473
|
+
}
|
|
8474
|
+
case "image": return va(t) ? /* @__PURE__ */ f("img", {
|
|
8475
|
+
src: t,
|
|
8476
|
+
alt: e.name,
|
|
8477
|
+
style: {
|
|
8478
|
+
maxWidth: "160px",
|
|
8479
|
+
maxHeight: "120px",
|
|
8480
|
+
borderRadius: "6px",
|
|
8481
|
+
display: "block"
|
|
8482
|
+
}
|
|
8483
|
+
}) : "";
|
|
8484
|
+
case "video":
|
|
8485
|
+
case "file": return va(t) ? /* @__PURE__ */ f("a", {
|
|
8486
|
+
href: t,
|
|
8487
|
+
target: "_blank",
|
|
8488
|
+
rel: "noopener noreferrer",
|
|
8489
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8490
|
+
children: String(t).split("/").pop()
|
|
8491
|
+
}) : "";
|
|
8492
|
+
case "media": return (Array.isArray(t) ? t : [t]).filter(va).map((e, t) => /* @__PURE__ */ f("a", {
|
|
8493
|
+
href: e,
|
|
8494
|
+
target: "_blank",
|
|
8495
|
+
rel: "noopener noreferrer",
|
|
8496
|
+
style: {
|
|
8497
|
+
color: "var(--page-accent, #111827)",
|
|
8498
|
+
marginRight: "8px"
|
|
8499
|
+
},
|
|
8500
|
+
children: String(e).split("/").pop()
|
|
8501
|
+
}, t));
|
|
8502
|
+
case "language": try {
|
|
8503
|
+
return new Intl.DisplayNames([n || "en"], { type: "language" }).of(t) ?? t;
|
|
8504
|
+
} catch {
|
|
8505
|
+
return String(t);
|
|
8506
|
+
}
|
|
8507
|
+
case "product": return t?.slug ? /* @__PURE__ */ f("a", {
|
|
8508
|
+
href: `/product/${encodeURIComponent(t.slug)}`,
|
|
8509
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8510
|
+
children: t.name
|
|
8511
|
+
}) : "";
|
|
8512
|
+
case "page": return t?.slug ? /* @__PURE__ */ f("a", {
|
|
8513
|
+
href: `/${t.slug}`,
|
|
8514
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8515
|
+
children: t.name
|
|
8516
|
+
}) : "";
|
|
8517
|
+
case "shop_collection": return t?.name ?? "";
|
|
8518
|
+
case "richtext": return Array.isArray(t) ? /* @__PURE__ */ f("div", {
|
|
8519
|
+
style: { lineHeight: 1.55 },
|
|
8520
|
+
children: Rt(t)
|
|
8521
|
+
}) : String(t);
|
|
8522
|
+
case "json": return /* @__PURE__ */ f("code", {
|
|
8523
|
+
style: {
|
|
8524
|
+
fontSize: "12px",
|
|
8525
|
+
whiteSpace: "pre-wrap"
|
|
8526
|
+
},
|
|
8527
|
+
children: JSON.stringify(t)
|
|
8528
|
+
});
|
|
8529
|
+
default: return String(t);
|
|
8530
|
+
}
|
|
8531
|
+
}
|
|
8532
|
+
function ba({ specs: e, locale: t, words: n }) {
|
|
8533
|
+
return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ p("section", {
|
|
8534
|
+
style: {
|
|
8535
|
+
display: "flex",
|
|
8536
|
+
flexDirection: "column",
|
|
8537
|
+
gap: "12px"
|
|
8538
|
+
},
|
|
8539
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
8540
|
+
style: {
|
|
8541
|
+
margin: 0,
|
|
8542
|
+
fontSize: "var(--page-h3, 24px)"
|
|
7623
8543
|
},
|
|
7624
|
-
children:
|
|
8544
|
+
children: n("specifications")
|
|
8545
|
+
}), /* @__PURE__ */ f("div", {
|
|
8546
|
+
role: "table",
|
|
8547
|
+
style: {
|
|
8548
|
+
border: ga,
|
|
8549
|
+
borderRadius: "10px",
|
|
8550
|
+
overflow: "hidden"
|
|
8551
|
+
},
|
|
8552
|
+
children: e.map((e, r) => {
|
|
8553
|
+
let i = e.multiple && Array.isArray(e.value) ? e.value : [e.value];
|
|
8554
|
+
return /* @__PURE__ */ p("div", {
|
|
8555
|
+
role: "row",
|
|
8556
|
+
style: {
|
|
8557
|
+
display: "grid",
|
|
8558
|
+
gridTemplateColumns: "minmax(120px, 34%) 1fr",
|
|
8559
|
+
gap: "16px",
|
|
8560
|
+
padding: "10px 14px",
|
|
8561
|
+
borderTop: r ? ga : 0,
|
|
8562
|
+
fontSize: "14px"
|
|
8563
|
+
},
|
|
8564
|
+
children: [/* @__PURE__ */ f("span", {
|
|
8565
|
+
role: "rowheader",
|
|
8566
|
+
style: { color: _a },
|
|
8567
|
+
children: e.name
|
|
8568
|
+
}), /* @__PURE__ */ f("span", {
|
|
8569
|
+
role: "cell",
|
|
8570
|
+
style: {
|
|
8571
|
+
display: "flex",
|
|
8572
|
+
flexWrap: "wrap",
|
|
8573
|
+
gap: "4px 10px",
|
|
8574
|
+
alignItems: "center"
|
|
8575
|
+
},
|
|
8576
|
+
children: i.map((r, a) => /* @__PURE__ */ p("span", { children: [ya(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
|
|
8577
|
+
})]
|
|
8578
|
+
}, e.key);
|
|
8579
|
+
})
|
|
8580
|
+
})]
|
|
8581
|
+
});
|
|
8582
|
+
}
|
|
8583
|
+
//#endregion
|
|
8584
|
+
//#region ../ui/src/components/builder/apps/shop/views.jsx
|
|
8585
|
+
var $ = "var(--page-muted, rgba(100,116,139,1))", xa = "1px solid var(--page-border, #d1d5db)", Sa = "var(--page-surface, #f2f2f2)", Ca = {
|
|
8586
|
+
...gt,
|
|
8587
|
+
border: 0,
|
|
8588
|
+
borderRadius: "8px",
|
|
8589
|
+
padding: "10px 18px",
|
|
8590
|
+
fontSize: "14px",
|
|
8591
|
+
fontWeight: 600,
|
|
8592
|
+
fontFamily: "inherit",
|
|
8593
|
+
textAlign: "center"
|
|
8594
|
+
}, wa = {
|
|
8595
|
+
...Ca,
|
|
8596
|
+
backgroundColor: "transparent",
|
|
8597
|
+
color: "var(--page-text, #111827)",
|
|
8598
|
+
border: xa
|
|
8599
|
+
};
|
|
8600
|
+
function Ta() {
|
|
8601
|
+
let { tenant: e, apiUrl: t, locale: n, param: a, settings: o } = i(Y), c = s(() => Wi(n), [n]), l = o?.["shop.orderPrefix"], u = o?.["shop.orderSuffix"], d = r((e) => `${typeof l == "string" ? l : "#"}${e}${typeof u == "string" ? u : ""}`, [l, u]);
|
|
8602
|
+
return {
|
|
8603
|
+
tenant: e,
|
|
8604
|
+
apiUrl: t || "/api",
|
|
8605
|
+
locale: n,
|
|
8606
|
+
param: a || "",
|
|
8607
|
+
words: c,
|
|
8608
|
+
orderId: d
|
|
8609
|
+
};
|
|
8610
|
+
}
|
|
8611
|
+
function Ea(e, t, n = !0) {
|
|
8612
|
+
let r = s(() => Ri(e, t), [e, t]), i = u(r.subscribe, r.getState, r.getState);
|
|
8613
|
+
return a(() => {
|
|
8614
|
+
n && !i.loaded && !i.loading && r.load();
|
|
8615
|
+
}, [n, r]), {
|
|
8616
|
+
store: r,
|
|
8617
|
+
...i
|
|
8618
|
+
};
|
|
8619
|
+
}
|
|
8620
|
+
var Da = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "", Oa = "/product/{slug}", ka = (e) => !e || e === "/product?product={slug}" ? Oa : e, Aa = (e, t) => String(ka(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
|
|
8621
|
+
function ja(e) {
|
|
8622
|
+
let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
|
|
8623
|
+
return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
|
|
8624
|
+
}
|
|
8625
|
+
function Ma({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
8626
|
+
let i = e.currency, a = t?.price ?? e.price;
|
|
8627
|
+
return /* @__PURE__ */ p("span", {
|
|
8628
|
+
style: {
|
|
8629
|
+
display: "inline-flex",
|
|
8630
|
+
alignItems: "baseline",
|
|
8631
|
+
gap: "8px",
|
|
8632
|
+
fontSize: `${r}px`
|
|
8633
|
+
},
|
|
8634
|
+
children: [/* @__PURE__ */ f("span", {
|
|
8635
|
+
style: { fontWeight: 700 },
|
|
8636
|
+
children: Hi(a, i, n)
|
|
8637
|
+
}), e.compare_at_price > a && /* @__PURE__ */ f("span", {
|
|
8638
|
+
style: {
|
|
8639
|
+
color: $,
|
|
8640
|
+
textDecoration: "line-through",
|
|
8641
|
+
fontSize: "0.85em"
|
|
8642
|
+
},
|
|
8643
|
+
children: Hi(e.compare_at_price, i, n)
|
|
8644
|
+
})]
|
|
8645
|
+
});
|
|
8646
|
+
}
|
|
8647
|
+
var Na = [
|
|
8648
|
+
1,
|
|
8649
|
+
2,
|
|
8650
|
+
3
|
|
8651
|
+
].map((e) => ({
|
|
8652
|
+
id: `sample-${e}`,
|
|
8653
|
+
slug: `sample-${e}`,
|
|
8654
|
+
name: `Product ${e}`,
|
|
8655
|
+
price: e * 1990,
|
|
8656
|
+
compare_at_price: e === 2 ? 4990 : null,
|
|
8657
|
+
images: [],
|
|
8658
|
+
variants: [],
|
|
8659
|
+
stock: null,
|
|
8660
|
+
currency: "USD",
|
|
8661
|
+
sample: !0
|
|
8662
|
+
}));
|
|
8663
|
+
function Pa({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: o = "", emptyText: s = "", collection: c = "", source: u = "catalog", loginHref: d = "", style: m, nodeRef: h, inert: g = !1, sample: _ = !1, noNavigate: v = !1 }) {
|
|
8664
|
+
let { tenant: y, apiUrl: b, locale: x, words: S } = Ta(), C = na(), [w, T] = l(null), [E, D] = l(null), [O, k] = l(""), [A, j] = l({}), [M, N] = l(!1), { store: P, currency: I } = Ea(b, y, !g), L = u === "favorites";
|
|
8665
|
+
a(() => {
|
|
8666
|
+
let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = I ? `¤cy=${encodeURIComponent(I)}` : "";
|
|
8667
|
+
if (L && g) {
|
|
8668
|
+
T([]);
|
|
8669
|
+
return;
|
|
8670
|
+
}
|
|
8671
|
+
return N(!1), Promise.all([Q(b, y, L ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), Q(b, y, "/store/config")]).then(([t, n]) => {
|
|
8672
|
+
if (!e) return;
|
|
8673
|
+
let r = zi(n, I);
|
|
8674
|
+
D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
|
|
8675
|
+
...e,
|
|
8676
|
+
currency: r
|
|
8677
|
+
})) : []);
|
|
8678
|
+
}).catch((t) => {
|
|
8679
|
+
e && (N(L && t?.code === "LOGIN_REQUIRED"), T([]));
|
|
8680
|
+
}), () => {
|
|
8681
|
+
e = !1;
|
|
8682
|
+
};
|
|
8683
|
+
}, [
|
|
8684
|
+
b,
|
|
8685
|
+
y,
|
|
8686
|
+
t,
|
|
8687
|
+
I,
|
|
8688
|
+
c,
|
|
8689
|
+
L,
|
|
8690
|
+
g
|
|
8691
|
+
]);
|
|
8692
|
+
let R = w?.length || !_ ? w ?? [] : Na, z = async (e) => {
|
|
8693
|
+
if (!(g || e.sample)) {
|
|
8694
|
+
k(e.id);
|
|
8695
|
+
try {
|
|
8696
|
+
await P.add(e.id, null, 1), j((t) => ({
|
|
8697
|
+
...t,
|
|
8698
|
+
[e.id]: S("added")
|
|
8699
|
+
}));
|
|
8700
|
+
} catch (t) {
|
|
8701
|
+
j((n) => ({
|
|
8702
|
+
...n,
|
|
8703
|
+
[e.id]: Gi(S, t)
|
|
8704
|
+
}));
|
|
8705
|
+
} finally {
|
|
8706
|
+
k("");
|
|
8707
|
+
}
|
|
8708
|
+
}
|
|
8709
|
+
};
|
|
8710
|
+
return /* @__PURE__ */ p("div", {
|
|
8711
|
+
ref: h,
|
|
8712
|
+
style: { ...F(m) },
|
|
8713
|
+
children: [
|
|
8714
|
+
L && /* @__PURE__ */ f("h2", {
|
|
7625
8715
|
style: {
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
overflow: "hidden",
|
|
7629
|
-
background: Zi
|
|
8716
|
+
margin: "0 0 12px",
|
|
8717
|
+
fontSize: "22px"
|
|
7630
8718
|
},
|
|
7631
|
-
children:
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
8719
|
+
children: S("myFavorites")
|
|
8720
|
+
}),
|
|
8721
|
+
M && /* @__PURE__ */ f("p", {
|
|
8722
|
+
style: { margin: 0 },
|
|
8723
|
+
children: /* @__PURE__ */ f("a", {
|
|
8724
|
+
href: d || C.loginHref(),
|
|
8725
|
+
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
8726
|
+
style: { color: "var(--page-accent, #111827)" },
|
|
8727
|
+
children: S("signInForFavorites")
|
|
7640
8728
|
})
|
|
7641
|
-
}),
|
|
8729
|
+
}),
|
|
8730
|
+
w !== null && !M && !R.length && /* @__PURE__ */ f("p", {
|
|
7642
8731
|
style: {
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
flexWrap: "wrap"
|
|
8732
|
+
color: $,
|
|
8733
|
+
margin: 0
|
|
7646
8734
|
},
|
|
7647
|
-
children:
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
background: Zi
|
|
7659
|
-
},
|
|
7660
|
-
children: /* @__PURE__ */ f("img", {
|
|
7661
|
-
src: e,
|
|
7662
|
-
alt: "",
|
|
8735
|
+
children: s || (L ? S("noFavorites") : E && !E.enabled ? S("closed") : S("noProducts"))
|
|
8736
|
+
}),
|
|
8737
|
+
/* @__PURE__ */ f("div", {
|
|
8738
|
+
style: {
|
|
8739
|
+
display: "grid",
|
|
8740
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(min(100%, max(160px, calc((100% - ${(Number(e) - 1) * n}px) / ${Number(e) || 3}))), 1fr))`,
|
|
8741
|
+
gap: `${n}px`
|
|
8742
|
+
},
|
|
8743
|
+
children: R.map((e) => {
|
|
8744
|
+
let t = ja(e) === 0, n = Aa(r, e);
|
|
8745
|
+
return /* @__PURE__ */ p("div", {
|
|
7663
8746
|
style: {
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
8747
|
+
display: "flex",
|
|
8748
|
+
flexDirection: "column",
|
|
8749
|
+
gap: "10px"
|
|
8750
|
+
},
|
|
8751
|
+
children: [
|
|
8752
|
+
/* @__PURE__ */ p("a", {
|
|
8753
|
+
href: n,
|
|
8754
|
+
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
8755
|
+
style: {
|
|
8756
|
+
color: "inherit",
|
|
8757
|
+
textDecoration: "none"
|
|
8758
|
+
},
|
|
8759
|
+
children: [/* @__PURE__ */ f("div", {
|
|
8760
|
+
style: {
|
|
8761
|
+
aspectRatio: "1 / 1",
|
|
8762
|
+
borderRadius: "10px",
|
|
8763
|
+
overflow: "hidden",
|
|
8764
|
+
background: Sa
|
|
8765
|
+
},
|
|
8766
|
+
children: e.images?.[0] && /* @__PURE__ */ f("img", {
|
|
8767
|
+
src: e.images[0],
|
|
8768
|
+
alt: e.name,
|
|
8769
|
+
loading: "lazy",
|
|
8770
|
+
style: {
|
|
8771
|
+
width: "100%",
|
|
8772
|
+
height: "100%",
|
|
8773
|
+
objectFit: "cover",
|
|
8774
|
+
display: "block"
|
|
8775
|
+
}
|
|
8776
|
+
})
|
|
8777
|
+
}), /* @__PURE__ */ f("div", {
|
|
8778
|
+
style: {
|
|
8779
|
+
marginTop: "10px",
|
|
8780
|
+
fontWeight: 600
|
|
8781
|
+
},
|
|
8782
|
+
children: e.name
|
|
8783
|
+
})]
|
|
8784
|
+
}),
|
|
8785
|
+
C.reviewsOn && e.rating_count > 0 && /* @__PURE__ */ p("span", {
|
|
8786
|
+
style: {
|
|
8787
|
+
display: "inline-flex",
|
|
8788
|
+
alignItems: "center",
|
|
8789
|
+
gap: "6px",
|
|
8790
|
+
fontSize: "13px",
|
|
8791
|
+
color: $
|
|
8792
|
+
},
|
|
8793
|
+
children: [
|
|
8794
|
+
/* @__PURE__ */ f(sa, {
|
|
8795
|
+
value: Number(e.rating_avg),
|
|
8796
|
+
size: 14
|
|
8797
|
+
}),
|
|
8798
|
+
"(",
|
|
8799
|
+
ra(e.rating_count, x),
|
|
8800
|
+
")"
|
|
8801
|
+
]
|
|
8802
|
+
}),
|
|
8803
|
+
/* @__PURE__ */ f(Ma, {
|
|
8804
|
+
product: e,
|
|
8805
|
+
locale: x
|
|
8806
|
+
}),
|
|
8807
|
+
i && (e.variants?.length ? /* @__PURE__ */ f("a", {
|
|
8808
|
+
href: n,
|
|
8809
|
+
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
8810
|
+
style: {
|
|
8811
|
+
...wa,
|
|
8812
|
+
display: "block"
|
|
8813
|
+
},
|
|
8814
|
+
children: S("choose")
|
|
8815
|
+
}) : /* @__PURE__ */ f("button", {
|
|
8816
|
+
type: "button",
|
|
8817
|
+
disabled: t || O === e.id,
|
|
8818
|
+
onClick: () => z(e),
|
|
8819
|
+
style: {
|
|
8820
|
+
...Ca,
|
|
8821
|
+
opacity: t ? .5 : 1
|
|
8822
|
+
},
|
|
8823
|
+
children: t ? S("soldOut") : O === e.id ? S("adding") : o || S("add")
|
|
8824
|
+
})),
|
|
8825
|
+
A[e.id] && /* @__PURE__ */ f("span", {
|
|
8826
|
+
style: {
|
|
8827
|
+
fontSize: "13px",
|
|
8828
|
+
color: $
|
|
8829
|
+
},
|
|
8830
|
+
children: A[e.id]
|
|
8831
|
+
})
|
|
8832
|
+
]
|
|
8833
|
+
}, e.id);
|
|
8834
|
+
})
|
|
8835
|
+
})
|
|
8836
|
+
]
|
|
8837
|
+
});
|
|
8838
|
+
}
|
|
8839
|
+
function Fa({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: o, nodeRef: s, inert: c = !1, sample: u = !1, noNavigate: d = !1 }) {
|
|
8840
|
+
let { tenant: m, apiUrl: h, locale: g, param: _, words: v } = Ta(), [y, b] = l(null), [x, S] = l(!1), [C, w] = l(0), [T, E] = l(""), [D, O] = l(1), [k, A] = l(!1), [j, M] = l(""), { store: N, currency: P } = Ea(h, m, !c), I = e || _ || Da("product"), L = P ? `?currency=${encodeURIComponent(P)}` : "";
|
|
8841
|
+
if (a(() => {
|
|
8842
|
+
let e = !0;
|
|
8843
|
+
return S(!1), (async () => {
|
|
8844
|
+
let t = await Q(h, m, "/store/config"), n = I ? await Q(h, m, `/store/products/${encodeURIComponent(I)}${L}`) : u || d ? (await Q(h, m, `/store/products?limit=1${P ? `¤cy=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
|
|
8845
|
+
if (e) {
|
|
8846
|
+
if (!n) {
|
|
8847
|
+
S(!0), b(u ? Na[0] : null);
|
|
8848
|
+
return;
|
|
8849
|
+
}
|
|
8850
|
+
b({
|
|
8851
|
+
...n,
|
|
8852
|
+
currency: zi(t, P)
|
|
8853
|
+
}), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
|
|
8854
|
+
}
|
|
8855
|
+
})().catch(() => {
|
|
8856
|
+
e && (S(!0), b(u ? Na[0] : null));
|
|
8857
|
+
}), () => {
|
|
8858
|
+
e = !1;
|
|
8859
|
+
};
|
|
8860
|
+
}, [
|
|
8861
|
+
h,
|
|
8862
|
+
m,
|
|
8863
|
+
I,
|
|
8864
|
+
P
|
|
8865
|
+
]), !y) return /* @__PURE__ */ f("div", {
|
|
8866
|
+
ref: s,
|
|
8867
|
+
style: { ...F(o) },
|
|
8868
|
+
children: x && /* @__PURE__ */ f("p", {
|
|
7673
8869
|
style: {
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
gap: "16px"
|
|
8870
|
+
color: $,
|
|
8871
|
+
margin: 0
|
|
7677
8872
|
},
|
|
7678
|
-
children:
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
borderColor: e.id === x ? "var(--page-accent, #111827)" : void 0,
|
|
7710
|
-
boxShadow: e.id === x ? "inset 0 0 0 1px var(--page-accent, #111827)" : "none"
|
|
7711
|
-
},
|
|
7712
|
-
children: e.title
|
|
7713
|
-
}, e.id);
|
|
7714
|
-
})
|
|
7715
|
-
}),
|
|
7716
|
-
/* @__PURE__ */ p("div", {
|
|
8873
|
+
children: v("noProducts")
|
|
8874
|
+
})
|
|
8875
|
+
});
|
|
8876
|
+
let R = y.variants?.find((e) => e.id === T) ?? null, z = R ? R.stock : y.variants?.length ? null : y.stock, B = z === 0, V = async () => {
|
|
8877
|
+
if (!(c || y.sample)) {
|
|
8878
|
+
A(!0), M("");
|
|
8879
|
+
try {
|
|
8880
|
+
await N.add(y.id, R?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
|
|
8881
|
+
} catch (e) {
|
|
8882
|
+
M(Gi(v, e));
|
|
8883
|
+
} finally {
|
|
8884
|
+
A(!1);
|
|
8885
|
+
}
|
|
8886
|
+
}
|
|
8887
|
+
};
|
|
8888
|
+
return /* @__PURE__ */ p("div", {
|
|
8889
|
+
ref: s,
|
|
8890
|
+
style: {
|
|
8891
|
+
display: "flex",
|
|
8892
|
+
flexDirection: "column",
|
|
8893
|
+
gap: "48px",
|
|
8894
|
+
...F(o)
|
|
8895
|
+
},
|
|
8896
|
+
children: [
|
|
8897
|
+
/* @__PURE__ */ p("div", {
|
|
8898
|
+
style: {
|
|
8899
|
+
display: "grid",
|
|
8900
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 320px), 1fr))",
|
|
8901
|
+
gap: "32px"
|
|
8902
|
+
},
|
|
8903
|
+
children: [/* @__PURE__ */ p("div", {
|
|
7717
8904
|
style: {
|
|
7718
8905
|
display: "flex",
|
|
7719
|
-
|
|
7720
|
-
|
|
8906
|
+
flexDirection: "column",
|
|
8907
|
+
gap: "10px"
|
|
7721
8908
|
},
|
|
7722
|
-
children: [/* @__PURE__ */ f("
|
|
7723
|
-
type: "number",
|
|
7724
|
-
min: 1,
|
|
7725
|
-
"aria-label": m("quantity"),
|
|
7726
|
-
value: C,
|
|
7727
|
-
onChange: (e) => w(e.target.value),
|
|
8909
|
+
children: [/* @__PURE__ */ f("div", {
|
|
7728
8910
|
style: {
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
8911
|
+
aspectRatio: "1 / 1",
|
|
8912
|
+
borderRadius: "12px",
|
|
8913
|
+
overflow: "hidden",
|
|
8914
|
+
background: Sa
|
|
8915
|
+
},
|
|
8916
|
+
children: y.images?.[C] && /* @__PURE__ */ f("img", {
|
|
8917
|
+
src: y.images[C],
|
|
8918
|
+
alt: y.name,
|
|
8919
|
+
style: {
|
|
8920
|
+
width: "100%",
|
|
8921
|
+
height: "100%",
|
|
8922
|
+
objectFit: "cover",
|
|
8923
|
+
display: "block"
|
|
8924
|
+
}
|
|
8925
|
+
})
|
|
8926
|
+
}), y.images?.length > 1 && /* @__PURE__ */ f("div", {
|
|
7736
8927
|
style: {
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
8928
|
+
display: "flex",
|
|
8929
|
+
gap: "8px",
|
|
8930
|
+
flexWrap: "wrap"
|
|
7740
8931
|
},
|
|
7741
|
-
children:
|
|
8932
|
+
children: y.images.map((e, t) => /* @__PURE__ */ f("button", {
|
|
8933
|
+
type: "button",
|
|
8934
|
+
onClick: () => w(t),
|
|
8935
|
+
style: {
|
|
8936
|
+
width: "64px",
|
|
8937
|
+
height: "64px",
|
|
8938
|
+
padding: 0,
|
|
8939
|
+
borderRadius: "8px",
|
|
8940
|
+
overflow: "hidden",
|
|
8941
|
+
cursor: "pointer",
|
|
8942
|
+
border: t === C ? "2px solid var(--page-accent, #111827)" : xa,
|
|
8943
|
+
background: Sa
|
|
8944
|
+
},
|
|
8945
|
+
children: /* @__PURE__ */ f("img", {
|
|
8946
|
+
src: e,
|
|
8947
|
+
alt: "",
|
|
8948
|
+
style: {
|
|
8949
|
+
width: "100%",
|
|
8950
|
+
height: "100%",
|
|
8951
|
+
objectFit: "cover",
|
|
8952
|
+
display: "block"
|
|
8953
|
+
}
|
|
8954
|
+
})
|
|
8955
|
+
}, e))
|
|
7742
8956
|
})]
|
|
7743
|
-
}),
|
|
7744
|
-
P !== null && P > 0 && P <= 5 && /* @__PURE__ */ f("span", {
|
|
7745
|
-
style: {
|
|
7746
|
-
fontSize: "13px",
|
|
7747
|
-
color: "var(--page-accent, #b45309)"
|
|
7748
|
-
},
|
|
7749
|
-
children: m("onlyLeft", { n: P })
|
|
7750
|
-
}),
|
|
7751
|
-
D && /* @__PURE__ */ f("span", {
|
|
8957
|
+
}), /* @__PURE__ */ p("div", {
|
|
7752
8958
|
style: {
|
|
7753
|
-
|
|
7754
|
-
|
|
8959
|
+
display: "flex",
|
|
8960
|
+
flexDirection: "column",
|
|
8961
|
+
gap: "16px"
|
|
7755
8962
|
},
|
|
7756
|
-
children:
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
|
|
8963
|
+
children: [
|
|
8964
|
+
/* @__PURE__ */ f("h1", {
|
|
8965
|
+
style: {
|
|
8966
|
+
margin: 0,
|
|
8967
|
+
fontSize: "var(--page-h2, 32px)"
|
|
8968
|
+
},
|
|
8969
|
+
children: y.name
|
|
8970
|
+
}),
|
|
8971
|
+
/* @__PURE__ */ f(da, {
|
|
8972
|
+
product: y,
|
|
8973
|
+
inert: c,
|
|
8974
|
+
sample: u && !!y.sample
|
|
8975
|
+
}),
|
|
8976
|
+
/* @__PURE__ */ f(Ma, {
|
|
8977
|
+
product: y,
|
|
8978
|
+
variant: R,
|
|
8979
|
+
locale: g,
|
|
8980
|
+
size: 22
|
|
8981
|
+
}),
|
|
8982
|
+
y.variants?.length > 0 && /* @__PURE__ */ f("div", {
|
|
8983
|
+
style: {
|
|
8984
|
+
display: "flex",
|
|
8985
|
+
gap: "8px",
|
|
8986
|
+
flexWrap: "wrap"
|
|
8987
|
+
},
|
|
8988
|
+
children: y.variants.map((e) => {
|
|
8989
|
+
let t = e.stock === 0;
|
|
8990
|
+
return /* @__PURE__ */ f("button", {
|
|
8991
|
+
type: "button",
|
|
8992
|
+
disabled: t,
|
|
8993
|
+
onClick: () => E(e.id),
|
|
8994
|
+
style: {
|
|
8995
|
+
...wa,
|
|
8996
|
+
padding: "8px 14px",
|
|
8997
|
+
opacity: t ? .45 : 1,
|
|
8998
|
+
textDecoration: t ? "line-through" : "none",
|
|
8999
|
+
borderColor: e.id === T ? "var(--page-accent, #111827)" : void 0,
|
|
9000
|
+
boxShadow: e.id === T ? "inset 0 0 0 1px var(--page-accent, #111827)" : "none"
|
|
9001
|
+
},
|
|
9002
|
+
children: e.title
|
|
9003
|
+
}, e.id);
|
|
9004
|
+
})
|
|
9005
|
+
}),
|
|
9006
|
+
/* @__PURE__ */ p("div", {
|
|
9007
|
+
style: {
|
|
9008
|
+
display: "flex",
|
|
9009
|
+
gap: "10px",
|
|
9010
|
+
alignItems: "center"
|
|
9011
|
+
},
|
|
9012
|
+
children: [/* @__PURE__ */ f("input", {
|
|
9013
|
+
type: "number",
|
|
9014
|
+
min: 1,
|
|
9015
|
+
"aria-label": v("quantity"),
|
|
9016
|
+
value: D,
|
|
9017
|
+
onChange: (e) => O(e.target.value),
|
|
9018
|
+
style: {
|
|
9019
|
+
...X,
|
|
9020
|
+
width: "80px"
|
|
9021
|
+
}
|
|
9022
|
+
}), /* @__PURE__ */ f("button", {
|
|
9023
|
+
type: "button",
|
|
9024
|
+
disabled: B || k,
|
|
9025
|
+
onClick: V,
|
|
9026
|
+
style: {
|
|
9027
|
+
...Ca,
|
|
9028
|
+
flex: 1,
|
|
9029
|
+
opacity: B ? .5 : 1
|
|
9030
|
+
},
|
|
9031
|
+
children: B ? v("soldOut") : k ? v("adding") : t || v("add")
|
|
9032
|
+
})]
|
|
9033
|
+
}),
|
|
9034
|
+
z !== null && z > 0 && z <= 5 && /* @__PURE__ */ f("span", {
|
|
9035
|
+
style: {
|
|
9036
|
+
fontSize: "13px",
|
|
9037
|
+
color: "var(--page-accent, #b45309)"
|
|
9038
|
+
},
|
|
9039
|
+
children: v("onlyLeft", { n: z })
|
|
9040
|
+
}),
|
|
9041
|
+
j && /* @__PURE__ */ f("span", {
|
|
9042
|
+
style: {
|
|
9043
|
+
fontSize: "13px",
|
|
9044
|
+
color: $
|
|
9045
|
+
},
|
|
9046
|
+
children: j
|
|
9047
|
+
}),
|
|
9048
|
+
Array.isArray(y.description) && y.description.length > 0 && /* @__PURE__ */ f("div", {
|
|
9049
|
+
style: { lineHeight: 1.6 },
|
|
9050
|
+
children: Rt(y.description)
|
|
9051
|
+
})
|
|
9052
|
+
]
|
|
9053
|
+
})]
|
|
9054
|
+
}),
|
|
9055
|
+
i && /* @__PURE__ */ f(ba, {
|
|
9056
|
+
specs: y.specs,
|
|
9057
|
+
locale: g,
|
|
9058
|
+
words: v
|
|
9059
|
+
}),
|
|
9060
|
+
n && /* @__PURE__ */ f(pa, {
|
|
9061
|
+
product: y,
|
|
9062
|
+
inert: c,
|
|
9063
|
+
sample: u && !!y.sample
|
|
9064
|
+
}),
|
|
9065
|
+
r && /* @__PURE__ */ f(ha, {
|
|
9066
|
+
product: y,
|
|
9067
|
+
inert: c,
|
|
9068
|
+
sample: u && !!y.sample
|
|
9069
|
+
})
|
|
9070
|
+
]
|
|
9071
|
+
});
|
|
9072
|
+
}
|
|
9073
|
+
function Ia(e) {
|
|
9074
|
+
return /* @__PURE__ */ f(Pa, {
|
|
9075
|
+
...e,
|
|
9076
|
+
source: "favorites"
|
|
7764
9077
|
});
|
|
7765
9078
|
}
|
|
7766
|
-
var
|
|
9079
|
+
var La = /* @__PURE__ */ p("svg", {
|
|
7767
9080
|
width: "20",
|
|
7768
9081
|
height: "20",
|
|
7769
9082
|
viewBox: "0 0 24 24",
|
|
@@ -7775,8 +9088,8 @@ var la = /* @__PURE__ */ p("svg", {
|
|
|
7775
9088
|
"aria-hidden": "true",
|
|
7776
9089
|
children: [/* @__PURE__ */ f("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ f("path", { d: "M9 7a3 3 0 0 1 6 0" })]
|
|
7777
9090
|
});
|
|
7778
|
-
function
|
|
7779
|
-
let { tenant: c, apiUrl: l, words: u } =
|
|
9091
|
+
function Ra({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
|
|
9092
|
+
let { tenant: c, apiUrl: l, words: u } = Ta(), { cart: d } = Ea(l, c, !a), m = o && !d.count ? 2 : d.count;
|
|
7780
9093
|
return /* @__PURE__ */ p("a", {
|
|
7781
9094
|
ref: i,
|
|
7782
9095
|
href: e,
|
|
@@ -7793,7 +9106,7 @@ function ua({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
7793
9106
|
...F(r)
|
|
7794
9107
|
},
|
|
7795
9108
|
children: [
|
|
7796
|
-
|
|
9109
|
+
La,
|
|
7797
9110
|
n && /* @__PURE__ */ f("span", { children: t || u("cart") }),
|
|
7798
9111
|
m > 0 && /* @__PURE__ */ f("span", {
|
|
7799
9112
|
style: {
|
|
@@ -7817,7 +9130,7 @@ function ua({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
7817
9130
|
]
|
|
7818
9131
|
});
|
|
7819
9132
|
}
|
|
7820
|
-
function
|
|
9133
|
+
function za(e, t, n) {
|
|
7821
9134
|
if (t === "code") return e;
|
|
7822
9135
|
try {
|
|
7823
9136
|
if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
|
|
@@ -7830,8 +9143,8 @@ function da(e, t, n) {
|
|
|
7830
9143
|
return e;
|
|
7831
9144
|
}
|
|
7832
9145
|
}
|
|
7833
|
-
function
|
|
7834
|
-
let { tenant: o, apiUrl: s, locale: c } =
|
|
9146
|
+
function Ba({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
|
|
9147
|
+
let { tenant: o, apiUrl: s, locale: c } = Ta(), { store: u, currency: d } = Ea(s, o, !i), [m, h] = l(null), g = {
|
|
7835
9148
|
display: "inline-flex",
|
|
7836
9149
|
alignItems: "center",
|
|
7837
9150
|
gap: 8,
|
|
@@ -7877,23 +9190,23 @@ function fa({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
7877
9190
|
},
|
|
7878
9191
|
children: _.map((t) => /* @__PURE__ */ f("option", {
|
|
7879
9192
|
value: t,
|
|
7880
|
-
children:
|
|
9193
|
+
children: za(t, e, c)
|
|
7881
9194
|
}, t))
|
|
7882
9195
|
})]
|
|
7883
9196
|
});
|
|
7884
9197
|
}
|
|
7885
|
-
var
|
|
9198
|
+
var Va = {
|
|
7886
9199
|
display: "flex",
|
|
7887
9200
|
flexDirection: "column",
|
|
7888
9201
|
gap: "6px",
|
|
7889
9202
|
fontSize: "13px"
|
|
7890
|
-
},
|
|
9203
|
+
}, Ha = {
|
|
7891
9204
|
margin: "0 0 12px",
|
|
7892
9205
|
fontSize: "18px"
|
|
7893
9206
|
};
|
|
7894
|
-
function
|
|
9207
|
+
function Ua({ label: e, required: t, children: n }) {
|
|
7895
9208
|
return /* @__PURE__ */ p("label", {
|
|
7896
|
-
style:
|
|
9209
|
+
style: Va,
|
|
7897
9210
|
children: [/* @__PURE__ */ p("span", {
|
|
7898
9211
|
style: { fontWeight: 500 },
|
|
7899
9212
|
children: [e, t && /* @__PURE__ */ f("span", {
|
|
@@ -7903,7 +9216,7 @@ function ha({ label: e, required: t, children: n }) {
|
|
|
7903
9216
|
}), n]
|
|
7904
9217
|
});
|
|
7905
9218
|
}
|
|
7906
|
-
var
|
|
9219
|
+
var Wa = [{
|
|
7907
9220
|
id: "ship:standard",
|
|
7908
9221
|
type: "shipping",
|
|
7909
9222
|
name: "Standard",
|
|
@@ -7919,7 +9232,7 @@ var ga = [{
|
|
|
7919
9232
|
min_days: null,
|
|
7920
9233
|
max_days: null,
|
|
7921
9234
|
detail: "Main Street 1"
|
|
7922
|
-
}],
|
|
9235
|
+
}], Ga = {
|
|
7923
9236
|
name: "",
|
|
7924
9237
|
email: "",
|
|
7925
9238
|
phone: "",
|
|
@@ -7934,55 +9247,55 @@ var ga = [{
|
|
|
7934
9247
|
recipient: "",
|
|
7935
9248
|
gift_message: ""
|
|
7936
9249
|
};
|
|
7937
|
-
function
|
|
7938
|
-
let { tenant: c, apiUrl: u, locale: d, words: m } =
|
|
9250
|
+
function Ka({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: o = !1 }) {
|
|
9251
|
+
let { tenant: c, apiUrl: u, locale: d, words: m, orderId: h } = Ta(), { store: g, cart: _, loaded: v } = Ea(u, c, !r), [y, b] = l(null), [x, S] = l(Ga), [C, w] = l(""), [T, E] = l(!1), [D, O] = l(""), [k, A] = l(null), [j, M] = l(""), [N, P] = l(!1), I = !r && Da("cancelled") === "1", L = (e) => Hi(e, _.currency || y?.currency, d);
|
|
7939
9252
|
a(() => {
|
|
7940
9253
|
Q(u, c, "/store/config").then((e) => {
|
|
7941
|
-
|
|
7942
|
-
}).catch(() =>
|
|
9254
|
+
b(e), w((t) => t || e?.methods?.[0] || "");
|
|
9255
|
+
}).catch(() => b({
|
|
7943
9256
|
enabled: !1,
|
|
7944
9257
|
methods: []
|
|
7945
9258
|
}));
|
|
7946
9259
|
}, [u, c]), a(() => {
|
|
7947
|
-
let e =
|
|
7948
|
-
r || !e ||
|
|
7949
|
-
|
|
7950
|
-
}).catch((e) =>
|
|
9260
|
+
let e = Da("order");
|
|
9261
|
+
r || !e || I || Q(u, c, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
|
|
9262
|
+
A(e), e?.payment_status === "paid" && g.reset();
|
|
9263
|
+
}).catch((e) => O(Gi(m, e)));
|
|
7951
9264
|
}, [u, c]);
|
|
7952
|
-
let
|
|
9265
|
+
let R = (e) => (t) => S((n) => ({
|
|
7953
9266
|
...n,
|
|
7954
9267
|
[e]: t.target.value
|
|
7955
|
-
})),
|
|
9268
|
+
})), z = s(() => Vi(d, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [d, y]);
|
|
7956
9269
|
a(() => {
|
|
7957
|
-
|
|
9270
|
+
_.country && !x.country && S((e) => ({
|
|
7958
9271
|
...e,
|
|
7959
|
-
country:
|
|
9272
|
+
country: _.country
|
|
7960
9273
|
}));
|
|
7961
|
-
}, [
|
|
7962
|
-
let
|
|
9274
|
+
}, [_.country]);
|
|
9275
|
+
let B = async (e) => {
|
|
7963
9276
|
if (!r) {
|
|
7964
|
-
|
|
9277
|
+
P(!0), O("");
|
|
7965
9278
|
try {
|
|
7966
|
-
await
|
|
9279
|
+
await g.setCoupon(e), M("");
|
|
7967
9280
|
} catch (e) {
|
|
7968
|
-
|
|
9281
|
+
O(Gi(m, e));
|
|
7969
9282
|
} finally {
|
|
7970
|
-
|
|
9283
|
+
P(!1);
|
|
7971
9284
|
}
|
|
7972
9285
|
}
|
|
7973
|
-
},
|
|
9286
|
+
}, V = async (e) => {
|
|
7974
9287
|
if (e.preventDefault(), !r) {
|
|
7975
|
-
if ((
|
|
9288
|
+
if ((U && !G ? [
|
|
7976
9289
|
"name",
|
|
7977
9290
|
"email",
|
|
7978
9291
|
"line1",
|
|
7979
9292
|
"city",
|
|
7980
9293
|
"country"
|
|
7981
|
-
] : ["name", "email"]).some((e) => !
|
|
7982
|
-
|
|
9294
|
+
] : ["name", "email"]).some((e) => !x[e].trim())) {
|
|
9295
|
+
O(m("required"));
|
|
7983
9296
|
return;
|
|
7984
9297
|
}
|
|
7985
|
-
|
|
9298
|
+
E(!0), O("");
|
|
7986
9299
|
try {
|
|
7987
9300
|
let e = new URL(window.location.href);
|
|
7988
9301
|
[
|
|
@@ -7993,26 +9306,26 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
7993
9306
|
let t = await Q(u, c, "/store/checkout", {
|
|
7994
9307
|
method: "POST",
|
|
7995
9308
|
body: {
|
|
7996
|
-
cart_id:
|
|
7997
|
-
method:
|
|
9309
|
+
cart_id: g.cartId(),
|
|
9310
|
+
method: C,
|
|
7998
9311
|
customer: {
|
|
7999
|
-
name:
|
|
8000
|
-
email:
|
|
8001
|
-
phone:
|
|
9312
|
+
name: x.name,
|
|
9313
|
+
email: x.email,
|
|
9314
|
+
phone: x.phone
|
|
8002
9315
|
},
|
|
8003
9316
|
address: {
|
|
8004
|
-
name:
|
|
8005
|
-
line1:
|
|
8006
|
-
line2:
|
|
8007
|
-
city:
|
|
8008
|
-
region:
|
|
8009
|
-
postal_code:
|
|
8010
|
-
country:
|
|
9317
|
+
name: x.gift ? x.recipient.trim() : "",
|
|
9318
|
+
line1: x.line1,
|
|
9319
|
+
line2: x.line2,
|
|
9320
|
+
city: x.city,
|
|
9321
|
+
region: x.region,
|
|
9322
|
+
postal_code: x.postal_code,
|
|
9323
|
+
country: x.country
|
|
8011
9324
|
},
|
|
8012
|
-
note:
|
|
8013
|
-
gift:
|
|
8014
|
-
gift_message:
|
|
8015
|
-
delivery:
|
|
9325
|
+
note: x.note,
|
|
9326
|
+
gift: x.gift,
|
|
9327
|
+
gift_message: x.gift ? x.gift_message : "",
|
|
9328
|
+
delivery: _.delivery || "",
|
|
8016
9329
|
return_url: e.toString()
|
|
8017
9330
|
}
|
|
8018
9331
|
});
|
|
@@ -8020,85 +9333,85 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8020
9333
|
window.location.assign(t.redirect_url);
|
|
8021
9334
|
return;
|
|
8022
9335
|
}
|
|
8023
|
-
|
|
9336
|
+
A(t?.order ?? null), g.reset();
|
|
8024
9337
|
} catch (e) {
|
|
8025
|
-
|
|
9338
|
+
O(Gi(m, e));
|
|
8026
9339
|
} finally {
|
|
8027
|
-
|
|
9340
|
+
E(!1);
|
|
8028
9341
|
}
|
|
8029
9342
|
}
|
|
8030
|
-
},
|
|
8031
|
-
r || e ===
|
|
9343
|
+
}, H = { ...F(t) }, U = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], te = ee.filter((e) => e.type !== "shipping"), ne = ee.find((e) => e.type === "shipping") ?? null, re = r && i && !_.lines.length ? Wa : Array.isArray(_.delivery_options) ? _.delivery_options : [], W = re.find((e) => e.id === _.delivery) ?? (r && i ? re[0] : null), G = W?.type === "pickup", ie = (e) => {
|
|
9344
|
+
r || e === _.delivery || (O(""), g.setDelivery(e).catch((e) => O(Gi(m, e))));
|
|
8032
9345
|
};
|
|
8033
|
-
if (
|
|
8034
|
-
let t =
|
|
9346
|
+
if (k) {
|
|
9347
|
+
let t = k.payment_status === "paid";
|
|
8035
9348
|
return /* @__PURE__ */ p("div", {
|
|
8036
9349
|
ref: n,
|
|
8037
9350
|
style: {
|
|
8038
9351
|
display: "flex",
|
|
8039
9352
|
flexDirection: "column",
|
|
8040
9353
|
gap: "12px",
|
|
8041
|
-
...
|
|
9354
|
+
...H
|
|
8042
9355
|
},
|
|
8043
9356
|
children: [
|
|
8044
9357
|
/* @__PURE__ */ f("h2", {
|
|
8045
9358
|
style: { margin: 0 },
|
|
8046
|
-
children: m("thanks", { number:
|
|
9359
|
+
children: m("thanks", { number: h(k.number) })
|
|
8047
9360
|
}),
|
|
8048
9361
|
/* @__PURE__ */ f("p", {
|
|
8049
9362
|
style: { margin: 0 },
|
|
8050
|
-
children:
|
|
9363
|
+
children: k.payment_method === "bank_transfer" ? m("transfer") : k.payment_method === "cash_on_delivery" ? m("cod") : m(t ? "paid" : "awaiting")
|
|
8051
9364
|
}),
|
|
8052
|
-
Array.isArray(
|
|
9365
|
+
Array.isArray(k.instructions_content) && k.instructions_content.length > 0 ? /* @__PURE__ */ f("div", {
|
|
8053
9366
|
style: {
|
|
8054
9367
|
padding: "12px",
|
|
8055
9368
|
borderRadius: "8px",
|
|
8056
|
-
background:
|
|
9369
|
+
background: Sa
|
|
8057
9370
|
},
|
|
8058
|
-
children: Rt(
|
|
8059
|
-
}) :
|
|
9371
|
+
children: Rt(k.instructions_content)
|
|
9372
|
+
}) : k.instructions ? /* @__PURE__ */ f("pre", {
|
|
8060
9373
|
style: {
|
|
8061
9374
|
margin: 0,
|
|
8062
9375
|
padding: "12px",
|
|
8063
9376
|
borderRadius: "8px",
|
|
8064
|
-
background:
|
|
9377
|
+
background: Sa,
|
|
8065
9378
|
whiteSpace: "pre-wrap",
|
|
8066
9379
|
fontFamily: "inherit"
|
|
8067
9380
|
},
|
|
8068
|
-
children:
|
|
9381
|
+
children: k.instructions
|
|
8069
9382
|
}) : null,
|
|
8070
|
-
|
|
9383
|
+
k.delivery && /* @__PURE__ */ p("div", {
|
|
8071
9384
|
style: {
|
|
8072
9385
|
padding: "12px",
|
|
8073
9386
|
borderRadius: "8px",
|
|
8074
|
-
background:
|
|
9387
|
+
background: Sa
|
|
8075
9388
|
},
|
|
8076
9389
|
children: [
|
|
8077
9390
|
/* @__PURE__ */ f("div", {
|
|
8078
9391
|
style: { fontWeight: 600 },
|
|
8079
|
-
children:
|
|
9392
|
+
children: k.delivery.type === "pickup" ? m("pickupAt", { name: k.delivery.name }) : m("deliveredBy", { name: k.delivery.name })
|
|
8080
9393
|
}),
|
|
8081
|
-
|
|
9394
|
+
k.delivery.location && /* @__PURE__ */ p("div", {
|
|
8082
9395
|
style: {
|
|
8083
9396
|
fontSize: "14px",
|
|
8084
9397
|
color: $
|
|
8085
9398
|
},
|
|
8086
9399
|
children: [
|
|
8087
9400
|
[
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
[
|
|
9401
|
+
k.delivery.location.line1,
|
|
9402
|
+
k.delivery.location.line2,
|
|
9403
|
+
[k.delivery.location.postal_code, k.delivery.location.city].filter(Boolean).join(" ")
|
|
8091
9404
|
].filter(Boolean).join(", "),
|
|
8092
|
-
|
|
9405
|
+
k.delivery.location.instructions && /* @__PURE__ */ f("div", { children: k.delivery.location.instructions }),
|
|
8093
9406
|
/* @__PURE__ */ f("div", { children: m("pickupNote") })
|
|
8094
9407
|
]
|
|
8095
9408
|
}),
|
|
8096
|
-
!
|
|
9409
|
+
!k.delivery.location && Yi(m, d, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ f("div", {
|
|
8097
9410
|
style: {
|
|
8098
9411
|
fontSize: "14px",
|
|
8099
9412
|
color: $
|
|
8100
9413
|
},
|
|
8101
|
-
children: Yi(m, d,
|
|
9414
|
+
children: Yi(m, d, k.delivery.min_days, k.delivery.max_days)
|
|
8102
9415
|
})
|
|
8103
9416
|
]
|
|
8104
9417
|
}),
|
|
@@ -8110,15 +9423,15 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8110
9423
|
children: [
|
|
8111
9424
|
m("total"),
|
|
8112
9425
|
": ",
|
|
8113
|
-
Hi(
|
|
9426
|
+
Hi(k.total, k.currency, d)
|
|
8114
9427
|
]
|
|
8115
9428
|
}),
|
|
8116
|
-
!t && /* @__PURE__ */ f(
|
|
8117
|
-
reference:
|
|
9429
|
+
!t && /* @__PURE__ */ f(Za, {
|
|
9430
|
+
reference: k.transfer_reference,
|
|
8118
9431
|
words: m
|
|
8119
9432
|
}),
|
|
8120
|
-
/* @__PURE__ */ f(
|
|
8121
|
-
downloads:
|
|
9433
|
+
/* @__PURE__ */ f(Qa, {
|
|
9434
|
+
downloads: k.downloads,
|
|
8122
9435
|
apiUrl: u,
|
|
8123
9436
|
words: m,
|
|
8124
9437
|
locale: d,
|
|
@@ -8128,7 +9441,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8128
9441
|
href: e,
|
|
8129
9442
|
onClick: o ? (e) => e.preventDefault() : void 0,
|
|
8130
9443
|
style: {
|
|
8131
|
-
|
|
9444
|
+
...wa,
|
|
8132
9445
|
alignSelf: "flex-start"
|
|
8133
9446
|
},
|
|
8134
9447
|
children: m("continue")
|
|
@@ -8136,7 +9449,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8136
9449
|
]
|
|
8137
9450
|
});
|
|
8138
9451
|
}
|
|
8139
|
-
let
|
|
9452
|
+
let ae = r && i && !_.lines.length ? Na.slice(0, 2).map((e) => ({
|
|
8140
9453
|
...e,
|
|
8141
9454
|
product_id: e.id,
|
|
8142
9455
|
variant_id: null,
|
|
@@ -8145,25 +9458,25 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8145
9458
|
total: e.price,
|
|
8146
9459
|
image: "",
|
|
8147
9460
|
variant_title: ""
|
|
8148
|
-
})) :
|
|
8149
|
-
if (
|
|
9461
|
+
})) : _.lines, oe = r && i && !_.lines.length ? ae.reduce((e, t) => e + t.total, 0) : _.subtotal;
|
|
9462
|
+
if (y && !y.enabled && !r) return /* @__PURE__ */ f("div", {
|
|
8150
9463
|
ref: n,
|
|
8151
|
-
style:
|
|
9464
|
+
style: H,
|
|
8152
9465
|
children: /* @__PURE__ */ f("p", {
|
|
8153
9466
|
style: { color: $ },
|
|
8154
9467
|
children: m("closed")
|
|
8155
9468
|
})
|
|
8156
9469
|
});
|
|
8157
|
-
if (
|
|
9470
|
+
if (v && !ae.length && !r) return /* @__PURE__ */ p("div", {
|
|
8158
9471
|
ref: n,
|
|
8159
9472
|
style: {
|
|
8160
9473
|
display: "flex",
|
|
8161
9474
|
flexDirection: "column",
|
|
8162
9475
|
gap: "12px",
|
|
8163
|
-
...
|
|
9476
|
+
...H
|
|
8164
9477
|
},
|
|
8165
9478
|
children: [
|
|
8166
|
-
|
|
9479
|
+
I && /* @__PURE__ */ f("p", {
|
|
8167
9480
|
style: {
|
|
8168
9481
|
margin: 0,
|
|
8169
9482
|
color: $
|
|
@@ -8178,23 +9491,23 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8178
9491
|
href: e,
|
|
8179
9492
|
onClick: o ? (e) => e.preventDefault() : void 0,
|
|
8180
9493
|
style: {
|
|
8181
|
-
|
|
9494
|
+
...wa,
|
|
8182
9495
|
alignSelf: "flex-start"
|
|
8183
9496
|
},
|
|
8184
9497
|
children: m("continue")
|
|
8185
9498
|
})
|
|
8186
9499
|
]
|
|
8187
9500
|
});
|
|
8188
|
-
let
|
|
9501
|
+
let se = y?.methods ?? [];
|
|
8189
9502
|
return /* @__PURE__ */ p("form", {
|
|
8190
9503
|
ref: n,
|
|
8191
|
-
onSubmit:
|
|
9504
|
+
onSubmit: V,
|
|
8192
9505
|
style: {
|
|
8193
9506
|
display: "grid",
|
|
8194
9507
|
gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 340px), 1fr))",
|
|
8195
9508
|
gap: "32px",
|
|
8196
9509
|
alignItems: "start",
|
|
8197
|
-
...
|
|
9510
|
+
...H
|
|
8198
9511
|
},
|
|
8199
9512
|
children: [/* @__PURE__ */ p("div", {
|
|
8200
9513
|
style: {
|
|
@@ -8203,7 +9516,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8203
9516
|
gap: "20px"
|
|
8204
9517
|
},
|
|
8205
9518
|
children: [
|
|
8206
|
-
|
|
9519
|
+
I && /* @__PURE__ */ f("p", {
|
|
8207
9520
|
style: {
|
|
8208
9521
|
margin: 0,
|
|
8209
9522
|
color: $
|
|
@@ -8211,20 +9524,20 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8211
9524
|
children: m("cancelled")
|
|
8212
9525
|
}),
|
|
8213
9526
|
/* @__PURE__ */ p("section", { children: [/* @__PURE__ */ f("h3", {
|
|
8214
|
-
style:
|
|
9527
|
+
style: Ha,
|
|
8215
9528
|
children: m("contact")
|
|
8216
9529
|
}), /* @__PURE__ */ p("div", {
|
|
8217
9530
|
style: {
|
|
8218
9531
|
display: "grid",
|
|
8219
9532
|
gap: "12px"
|
|
8220
9533
|
},
|
|
8221
|
-
children: [/* @__PURE__ */ f(
|
|
9534
|
+
children: [/* @__PURE__ */ f(Ua, {
|
|
8222
9535
|
label: m("name"),
|
|
8223
9536
|
required: !0,
|
|
8224
9537
|
children: /* @__PURE__ */ f("input", {
|
|
8225
9538
|
style: X,
|
|
8226
|
-
value:
|
|
8227
|
-
onChange:
|
|
9539
|
+
value: x.name,
|
|
9540
|
+
onChange: R("name"),
|
|
8228
9541
|
autoComplete: "name"
|
|
8229
9542
|
})
|
|
8230
9543
|
}), /* @__PURE__ */ p("div", {
|
|
@@ -8233,31 +9546,31 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8233
9546
|
gridTemplateColumns: "1fr 1fr",
|
|
8234
9547
|
gap: "12px"
|
|
8235
9548
|
},
|
|
8236
|
-
children: [/* @__PURE__ */ f(
|
|
9549
|
+
children: [/* @__PURE__ */ f(Ua, {
|
|
8237
9550
|
label: m("email"),
|
|
8238
9551
|
required: !0,
|
|
8239
9552
|
children: /* @__PURE__ */ f("input", {
|
|
8240
9553
|
type: "email",
|
|
8241
9554
|
style: X,
|
|
8242
|
-
value:
|
|
8243
|
-
onChange:
|
|
9555
|
+
value: x.email,
|
|
9556
|
+
onChange: R("email"),
|
|
8244
9557
|
autoComplete: "email"
|
|
8245
9558
|
})
|
|
8246
|
-
}), /* @__PURE__ */ f(
|
|
9559
|
+
}), /* @__PURE__ */ f(Ua, {
|
|
8247
9560
|
label: m("phone"),
|
|
8248
9561
|
children: /* @__PURE__ */ f("input", {
|
|
8249
9562
|
type: "tel",
|
|
8250
9563
|
style: X,
|
|
8251
|
-
value:
|
|
8252
|
-
onChange:
|
|
9564
|
+
value: x.phone,
|
|
9565
|
+
onChange: R("phone"),
|
|
8253
9566
|
autoComplete: "tel"
|
|
8254
9567
|
})
|
|
8255
9568
|
})]
|
|
8256
9569
|
})]
|
|
8257
9570
|
})] }),
|
|
8258
|
-
|
|
9571
|
+
U && /* @__PURE__ */ p("section", { children: [
|
|
8259
9572
|
/* @__PURE__ */ f("h3", {
|
|
8260
|
-
style:
|
|
9573
|
+
style: Ha,
|
|
8261
9574
|
children: m("delivery")
|
|
8262
9575
|
}),
|
|
8263
9576
|
/* @__PURE__ */ f("div", {
|
|
@@ -8268,33 +9581,33 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8268
9581
|
gridTemplateColumns: "1fr 1fr",
|
|
8269
9582
|
gap: "12px"
|
|
8270
9583
|
},
|
|
8271
|
-
children: [/* @__PURE__ */ f(
|
|
9584
|
+
children: [/* @__PURE__ */ f(Ua, {
|
|
8272
9585
|
label: m("postal"),
|
|
8273
9586
|
children: /* @__PURE__ */ f("input", {
|
|
8274
9587
|
style: X,
|
|
8275
|
-
value:
|
|
8276
|
-
onChange:
|
|
8277
|
-
onBlur: () => !r &&
|
|
9588
|
+
value: x.postal_code,
|
|
9589
|
+
onChange: R("postal_code"),
|
|
9590
|
+
onBlur: () => !r && x.country && g.setCountry(x.country, x.postal_code).catch((e) => O(Gi(m, e))),
|
|
8278
9591
|
autoComplete: "postal-code"
|
|
8279
9592
|
})
|
|
8280
|
-
}), /* @__PURE__ */ f(
|
|
9593
|
+
}), /* @__PURE__ */ f(Ua, {
|
|
8281
9594
|
label: m("country"),
|
|
8282
|
-
required: !
|
|
9595
|
+
required: !G,
|
|
8283
9596
|
children: /* @__PURE__ */ p("select", {
|
|
8284
9597
|
style: X,
|
|
8285
|
-
value:
|
|
9598
|
+
value: x.country,
|
|
8286
9599
|
autoComplete: "country",
|
|
8287
9600
|
onChange: (e) => {
|
|
8288
9601
|
let t = e.target.value;
|
|
8289
|
-
|
|
9602
|
+
S((e) => ({
|
|
8290
9603
|
...e,
|
|
8291
9604
|
country: t
|
|
8292
|
-
})), r ||
|
|
9605
|
+
})), r || g.setCountry(t, x.postal_code).catch((e) => O(Gi(m, e)));
|
|
8293
9606
|
},
|
|
8294
9607
|
children: [/* @__PURE__ */ f("option", {
|
|
8295
9608
|
value: "",
|
|
8296
9609
|
children: m("chooseCountry")
|
|
8297
|
-
}),
|
|
9610
|
+
}), z.map((e) => /* @__PURE__ */ f("option", {
|
|
8298
9611
|
value: e.code,
|
|
8299
9612
|
children: e.name
|
|
8300
9613
|
}, e.code))]
|
|
@@ -8302,20 +9615,20 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8302
9615
|
})]
|
|
8303
9616
|
})
|
|
8304
9617
|
}),
|
|
8305
|
-
!
|
|
9618
|
+
!re.length && /* @__PURE__ */ f("p", {
|
|
8306
9619
|
style: {
|
|
8307
9620
|
margin: 0,
|
|
8308
9621
|
color: $,
|
|
8309
9622
|
fontSize: "14px"
|
|
8310
9623
|
},
|
|
8311
|
-
children:
|
|
9624
|
+
children: x.country ? m("noShipping") : m("deliveryPick")
|
|
8312
9625
|
}),
|
|
8313
9626
|
/* @__PURE__ */ f("div", {
|
|
8314
9627
|
style: {
|
|
8315
9628
|
display: "grid",
|
|
8316
9629
|
gap: "8px"
|
|
8317
9630
|
},
|
|
8318
|
-
children:
|
|
9631
|
+
children: re.map((e) => {
|
|
8319
9632
|
let t = Yi(m, d, e.min_days, e.max_days);
|
|
8320
9633
|
return /* @__PURE__ */ p("label", {
|
|
8321
9634
|
style: {
|
|
@@ -8324,7 +9637,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8324
9637
|
gap: "10px",
|
|
8325
9638
|
padding: "12px",
|
|
8326
9639
|
borderRadius: "8px",
|
|
8327
|
-
border:
|
|
9640
|
+
border: W?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : xa,
|
|
8328
9641
|
cursor: "pointer"
|
|
8329
9642
|
},
|
|
8330
9643
|
children: [
|
|
@@ -8332,8 +9645,8 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8332
9645
|
type: "radio",
|
|
8333
9646
|
name: "delivery",
|
|
8334
9647
|
value: e.id,
|
|
8335
|
-
checked:
|
|
8336
|
-
onChange: () =>
|
|
9648
|
+
checked: W?.id === e.id,
|
|
9649
|
+
onChange: () => ie(e.id),
|
|
8337
9650
|
style: { marginTop: "3px" }
|
|
8338
9651
|
}),
|
|
8339
9652
|
/* @__PURE__ */ p("span", {
|
|
@@ -8369,15 +9682,15 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8369
9682
|
}),
|
|
8370
9683
|
/* @__PURE__ */ f("span", {
|
|
8371
9684
|
style: { fontWeight: 600 },
|
|
8372
|
-
children: e.amount ?
|
|
9685
|
+
children: e.amount ? L(e.amount) : m("free")
|
|
8373
9686
|
})
|
|
8374
9687
|
]
|
|
8375
9688
|
}, e.id);
|
|
8376
9689
|
})
|
|
8377
9690
|
})
|
|
8378
9691
|
] }),
|
|
8379
|
-
|
|
8380
|
-
style:
|
|
9692
|
+
U && !G && /* @__PURE__ */ p("section", { children: [/* @__PURE__ */ f("h3", {
|
|
9693
|
+
style: Ha,
|
|
8381
9694
|
children: m("address")
|
|
8382
9695
|
}), /* @__PURE__ */ p("div", {
|
|
8383
9696
|
style: {
|
|
@@ -8385,22 +9698,22 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8385
9698
|
gap: "12px"
|
|
8386
9699
|
},
|
|
8387
9700
|
children: [
|
|
8388
|
-
/* @__PURE__ */ f(
|
|
9701
|
+
/* @__PURE__ */ f(Ua, {
|
|
8389
9702
|
label: m("line1"),
|
|
8390
9703
|
required: !0,
|
|
8391
9704
|
children: /* @__PURE__ */ f("input", {
|
|
8392
9705
|
style: X,
|
|
8393
|
-
value:
|
|
8394
|
-
onChange:
|
|
9706
|
+
value: x.line1,
|
|
9707
|
+
onChange: R("line1"),
|
|
8395
9708
|
autoComplete: "address-line1"
|
|
8396
9709
|
})
|
|
8397
9710
|
}),
|
|
8398
|
-
/* @__PURE__ */ f(
|
|
9711
|
+
/* @__PURE__ */ f(Ua, {
|
|
8399
9712
|
label: m("line2"),
|
|
8400
9713
|
children: /* @__PURE__ */ f("input", {
|
|
8401
9714
|
style: X,
|
|
8402
|
-
value:
|
|
8403
|
-
onChange:
|
|
9715
|
+
value: x.line2,
|
|
9716
|
+
onChange: R("line2"),
|
|
8404
9717
|
autoComplete: "address-line2"
|
|
8405
9718
|
})
|
|
8406
9719
|
}),
|
|
@@ -8410,26 +9723,26 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8410
9723
|
gridTemplateColumns: "1fr 1fr",
|
|
8411
9724
|
gap: "12px"
|
|
8412
9725
|
},
|
|
8413
|
-
children: [/* @__PURE__ */ f(
|
|
9726
|
+
children: [/* @__PURE__ */ f(Ua, {
|
|
8414
9727
|
label: m("city"),
|
|
8415
9728
|
required: !0,
|
|
8416
9729
|
children: /* @__PURE__ */ f("input", {
|
|
8417
9730
|
style: X,
|
|
8418
|
-
value:
|
|
8419
|
-
onChange:
|
|
9731
|
+
value: x.city,
|
|
9732
|
+
onChange: R("city"),
|
|
8420
9733
|
autoComplete: "address-level2"
|
|
8421
9734
|
})
|
|
8422
|
-
}), /* @__PURE__ */ f(
|
|
9735
|
+
}), /* @__PURE__ */ f(Ua, {
|
|
8423
9736
|
label: m("region"),
|
|
8424
9737
|
children: /* @__PURE__ */ f("input", {
|
|
8425
9738
|
style: X,
|
|
8426
|
-
value:
|
|
8427
|
-
onChange:
|
|
9739
|
+
value: x.region,
|
|
9740
|
+
onChange: R("region"),
|
|
8428
9741
|
autoComplete: "address-level1"
|
|
8429
9742
|
})
|
|
8430
9743
|
})]
|
|
8431
9744
|
}),
|
|
8432
|
-
/* @__PURE__ */ f(
|
|
9745
|
+
/* @__PURE__ */ f(Ua, {
|
|
8433
9746
|
label: m("note"),
|
|
8434
9747
|
children: /* @__PURE__ */ f("textarea", {
|
|
8435
9748
|
rows: 2,
|
|
@@ -8437,8 +9750,8 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8437
9750
|
...X,
|
|
8438
9751
|
resize: "vertical"
|
|
8439
9752
|
},
|
|
8440
|
-
value:
|
|
8441
|
-
onChange:
|
|
9753
|
+
value: x.note,
|
|
9754
|
+
onChange: R("note")
|
|
8442
9755
|
})
|
|
8443
9756
|
})
|
|
8444
9757
|
]
|
|
@@ -8452,8 +9765,8 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8452
9765
|
},
|
|
8453
9766
|
children: [/* @__PURE__ */ f("input", {
|
|
8454
9767
|
type: "checkbox",
|
|
8455
|
-
checked:
|
|
8456
|
-
onChange: (e) =>
|
|
9768
|
+
checked: x.gift,
|
|
9769
|
+
onChange: (e) => S((t) => ({
|
|
8457
9770
|
...t,
|
|
8458
9771
|
gift: e.target.checked
|
|
8459
9772
|
})),
|
|
@@ -8469,22 +9782,22 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8469
9782
|
},
|
|
8470
9783
|
children: m("giftHint")
|
|
8471
9784
|
})] })]
|
|
8472
|
-
}),
|
|
9785
|
+
}), x.gift && /* @__PURE__ */ p("div", {
|
|
8473
9786
|
style: {
|
|
8474
9787
|
marginTop: "12px",
|
|
8475
9788
|
display: "grid",
|
|
8476
9789
|
gap: "12px"
|
|
8477
9790
|
},
|
|
8478
|
-
children: [
|
|
9791
|
+
children: [U && !G && /* @__PURE__ */ f(Ua, {
|
|
8479
9792
|
label: m("giftRecipient"),
|
|
8480
9793
|
children: /* @__PURE__ */ f("input", {
|
|
8481
9794
|
style: X,
|
|
8482
|
-
value:
|
|
8483
|
-
onChange:
|
|
9795
|
+
value: x.recipient,
|
|
9796
|
+
onChange: R("recipient"),
|
|
8484
9797
|
maxLength: 200,
|
|
8485
9798
|
autoComplete: "off"
|
|
8486
9799
|
})
|
|
8487
|
-
}), /* @__PURE__ */ f(
|
|
9800
|
+
}), /* @__PURE__ */ f(Ua, {
|
|
8488
9801
|
label: m("giftMessage"),
|
|
8489
9802
|
children: /* @__PURE__ */ f("textarea", {
|
|
8490
9803
|
rows: 3,
|
|
@@ -8493,17 +9806,17 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8493
9806
|
...X,
|
|
8494
9807
|
resize: "vertical"
|
|
8495
9808
|
},
|
|
8496
|
-
value:
|
|
8497
|
-
onChange:
|
|
9809
|
+
value: x.gift_message,
|
|
9810
|
+
onChange: R("gift_message")
|
|
8498
9811
|
})
|
|
8499
9812
|
})]
|
|
8500
9813
|
})] }),
|
|
8501
9814
|
/* @__PURE__ */ p("section", { children: [
|
|
8502
9815
|
/* @__PURE__ */ f("h3", {
|
|
8503
|
-
style:
|
|
9816
|
+
style: Ha,
|
|
8504
9817
|
children: m("payment")
|
|
8505
9818
|
}),
|
|
8506
|
-
!
|
|
9819
|
+
!se.length && !r && /* @__PURE__ */ f("p", {
|
|
8507
9820
|
style: {
|
|
8508
9821
|
margin: 0,
|
|
8509
9822
|
color: $
|
|
@@ -8515,23 +9828,23 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8515
9828
|
display: "grid",
|
|
8516
9829
|
gap: "8px"
|
|
8517
9830
|
},
|
|
8518
|
-
children: (r && !
|
|
9831
|
+
children: (r && !se.length ? ["stripe", "bank_transfer"] : se).map((e) => /* @__PURE__ */ p("label", {
|
|
8519
9832
|
style: {
|
|
8520
9833
|
display: "flex",
|
|
8521
9834
|
alignItems: "center",
|
|
8522
9835
|
gap: "10px",
|
|
8523
9836
|
padding: "12px",
|
|
8524
9837
|
borderRadius: "8px",
|
|
8525
|
-
border:
|
|
9838
|
+
border: xa,
|
|
8526
9839
|
cursor: "pointer"
|
|
8527
9840
|
},
|
|
8528
9841
|
children: [/* @__PURE__ */ f("input", {
|
|
8529
9842
|
type: "radio",
|
|
8530
9843
|
name: "method",
|
|
8531
9844
|
value: e,
|
|
8532
|
-
checked:
|
|
8533
|
-
onChange: () =>
|
|
8534
|
-
}), /* @__PURE__ */ f("span", { children:
|
|
9845
|
+
checked: C === e,
|
|
9846
|
+
onChange: () => w(e)
|
|
9847
|
+
}), /* @__PURE__ */ f("span", { children: y?.method_names?.[e] ?? m(e) })]
|
|
8535
9848
|
}, e))
|
|
8536
9849
|
})
|
|
8537
9850
|
] })
|
|
@@ -8543,17 +9856,17 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8543
9856
|
gap: "14px",
|
|
8544
9857
|
padding: "20px",
|
|
8545
9858
|
borderRadius: "12px",
|
|
8546
|
-
background:
|
|
9859
|
+
background: Sa
|
|
8547
9860
|
},
|
|
8548
9861
|
children: [
|
|
8549
9862
|
/* @__PURE__ */ f("h3", {
|
|
8550
9863
|
style: {
|
|
8551
|
-
...
|
|
9864
|
+
...Ha,
|
|
8552
9865
|
margin: 0
|
|
8553
9866
|
},
|
|
8554
9867
|
children: m("cart")
|
|
8555
9868
|
}),
|
|
8556
|
-
|
|
9869
|
+
ae.map((e) => /* @__PURE__ */ p("div", {
|
|
8557
9870
|
style: {
|
|
8558
9871
|
display: "flex",
|
|
8559
9872
|
gap: "12px",
|
|
@@ -8609,7 +9922,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8609
9922
|
min: 1,
|
|
8610
9923
|
"aria-label": m("quantity"),
|
|
8611
9924
|
value: e.quantity,
|
|
8612
|
-
onChange: (t) => !r &&
|
|
9925
|
+
onChange: (t) => !r && g.setLine(e.product_id, e.variant_id, Math.max(1, Number(t.target.value) || 1)).catch((e) => O(Gi(m, e))),
|
|
8613
9926
|
style: {
|
|
8614
9927
|
...X,
|
|
8615
9928
|
width: "64px",
|
|
@@ -8617,7 +9930,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8617
9930
|
}
|
|
8618
9931
|
}), /* @__PURE__ */ f("button", {
|
|
8619
9932
|
type: "button",
|
|
8620
|
-
onClick: () => !r &&
|
|
9933
|
+
onClick: () => !r && g.setLine(e.product_id, e.variant_id, 0).catch((e) => O(Gi(m, e))),
|
|
8621
9934
|
style: {
|
|
8622
9935
|
background: "none",
|
|
8623
9936
|
border: 0,
|
|
@@ -8641,15 +9954,15 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8641
9954
|
color: $,
|
|
8642
9955
|
textDecoration: "line-through"
|
|
8643
9956
|
},
|
|
8644
|
-
children:
|
|
9957
|
+
children: L(e.total)
|
|
8645
9958
|
}), /* @__PURE__ */ f("div", {
|
|
8646
9959
|
style: { fontWeight: 600 },
|
|
8647
|
-
children:
|
|
9960
|
+
children: L(e.total - (e.discount || 0))
|
|
8648
9961
|
})]
|
|
8649
9962
|
})
|
|
8650
9963
|
]
|
|
8651
9964
|
}, `${e.product_id}:${e.variant_id ?? ""}`)),
|
|
8652
|
-
|
|
9965
|
+
_.coupon ? /* @__PURE__ */ p("div", {
|
|
8653
9966
|
style: {
|
|
8654
9967
|
display: "flex",
|
|
8655
9968
|
alignItems: "center",
|
|
@@ -8661,15 +9974,15 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8661
9974
|
style: {
|
|
8662
9975
|
padding: "4px 10px",
|
|
8663
9976
|
borderRadius: "999px",
|
|
8664
|
-
border:
|
|
9977
|
+
border: xa,
|
|
8665
9978
|
fontWeight: 600,
|
|
8666
9979
|
letterSpacing: "0.04em"
|
|
8667
9980
|
},
|
|
8668
|
-
children:
|
|
9981
|
+
children: _.coupon.code
|
|
8669
9982
|
}), /* @__PURE__ */ f("button", {
|
|
8670
9983
|
type: "button",
|
|
8671
|
-
disabled:
|
|
8672
|
-
onClick: () =>
|
|
9984
|
+
disabled: N,
|
|
9985
|
+
onClick: () => B(""),
|
|
8673
9986
|
style: {
|
|
8674
9987
|
background: "none",
|
|
8675
9988
|
border: 0,
|
|
@@ -8690,10 +10003,10 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8690
10003
|
children: [/* @__PURE__ */ f("input", {
|
|
8691
10004
|
"aria-label": m("coupon"),
|
|
8692
10005
|
placeholder: m("coupon"),
|
|
8693
|
-
value:
|
|
8694
|
-
onChange: (e) =>
|
|
10006
|
+
value: j,
|
|
10007
|
+
onChange: (e) => M(e.target.value.toUpperCase()),
|
|
8695
10008
|
onKeyDown: (e) => {
|
|
8696
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
10009
|
+
e.key === "Enter" && (e.preventDefault(), j.trim() && B(j.trim()));
|
|
8697
10010
|
},
|
|
8698
10011
|
style: {
|
|
8699
10012
|
...X,
|
|
@@ -8702,25 +10015,25 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8702
10015
|
}
|
|
8703
10016
|
}), /* @__PURE__ */ f("button", {
|
|
8704
10017
|
type: "button",
|
|
8705
|
-
disabled:
|
|
8706
|
-
onClick: () =>
|
|
10018
|
+
disabled: N || !j.trim(),
|
|
10019
|
+
onClick: () => B(j.trim()),
|
|
8707
10020
|
style: {
|
|
8708
|
-
|
|
10021
|
+
...wa,
|
|
8709
10022
|
padding: "8px 14px"
|
|
8710
10023
|
},
|
|
8711
10024
|
children: m("apply")
|
|
8712
10025
|
})]
|
|
8713
10026
|
}),
|
|
8714
|
-
|
|
10027
|
+
_.coupon_error && /* @__PURE__ */ f("span", {
|
|
8715
10028
|
style: {
|
|
8716
10029
|
fontSize: "13px",
|
|
8717
10030
|
color: $
|
|
8718
10031
|
},
|
|
8719
|
-
children:
|
|
10032
|
+
children: _.coupon_error_code && m.has(_.coupon_error_code) ? m(_.coupon_error_code) : _.coupon_error
|
|
8720
10033
|
}),
|
|
8721
10034
|
/* @__PURE__ */ p("div", {
|
|
8722
10035
|
style: {
|
|
8723
|
-
borderTop:
|
|
10036
|
+
borderTop: xa,
|
|
8724
10037
|
paddingTop: "12px",
|
|
8725
10038
|
display: "grid",
|
|
8726
10039
|
gap: "6px",
|
|
@@ -8732,7 +10045,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8732
10045
|
display: "flex",
|
|
8733
10046
|
justifyContent: "space-between"
|
|
8734
10047
|
},
|
|
8735
|
-
children: [/* @__PURE__ */ f("span", { children: m("subtotal") }), /* @__PURE__ */ f("span", { children:
|
|
10048
|
+
children: [/* @__PURE__ */ f("span", { children: m("subtotal") }), /* @__PURE__ */ f("span", { children: L(oe) })]
|
|
8736
10049
|
}),
|
|
8737
10050
|
te.length ? te.map((e) => /* @__PURE__ */ p("div", {
|
|
8738
10051
|
style: {
|
|
@@ -8744,30 +10057,30 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8744
10057
|
m("discount"),
|
|
8745
10058
|
" · ",
|
|
8746
10059
|
e.title
|
|
8747
|
-
] }), /* @__PURE__ */ p("span", { children: ["−",
|
|
8748
|
-
}, e.id)) :
|
|
10060
|
+
] }), /* @__PURE__ */ p("span", { children: ["−", L(e.amount)] })]
|
|
10061
|
+
}, e.id)) : _.discount_total > 0 && /* @__PURE__ */ p("div", {
|
|
8749
10062
|
style: {
|
|
8750
10063
|
display: "flex",
|
|
8751
10064
|
justifyContent: "space-between"
|
|
8752
10065
|
},
|
|
8753
|
-
children: [/* @__PURE__ */ f("span", { children: m("discount") }), /* @__PURE__ */ p("span", { children: ["−",
|
|
10066
|
+
children: [/* @__PURE__ */ f("span", { children: m("discount") }), /* @__PURE__ */ p("span", { children: ["−", L(_.discount_total)] })]
|
|
8754
10067
|
}),
|
|
8755
|
-
|
|
10068
|
+
U && /* @__PURE__ */ p("div", {
|
|
8756
10069
|
style: {
|
|
8757
10070
|
display: "flex",
|
|
8758
10071
|
justifyContent: "space-between",
|
|
8759
10072
|
gap: "8px"
|
|
8760
10073
|
},
|
|
8761
|
-
children: [/* @__PURE__ */ p("span", { children: [
|
|
10074
|
+
children: [/* @__PURE__ */ p("span", { children: [W?.name ?? m("shipping"), ne ? ` · ${ne.title}` : ""] }), /* @__PURE__ */ p("span", { children: [ne && /* @__PURE__ */ f("span", {
|
|
8762
10075
|
style: {
|
|
8763
10076
|
color: $,
|
|
8764
10077
|
textDecoration: "line-through",
|
|
8765
10078
|
marginRight: "6px"
|
|
8766
10079
|
},
|
|
8767
|
-
children:
|
|
8768
|
-
}), (
|
|
10080
|
+
children: L(_.shipping_before)
|
|
10081
|
+
}), (ne ? _.shipping_total : W?.amount ?? _.shipping_total) ? L(ne ? _.shipping_total : W?.amount ?? _.shipping_total) : m("free")] })]
|
|
8769
10082
|
}),
|
|
8770
|
-
!
|
|
10083
|
+
!_.tax_included && _.tax_total > 0 && /* @__PURE__ */ p("div", {
|
|
8771
10084
|
style: {
|
|
8772
10085
|
display: "flex",
|
|
8773
10086
|
justifyContent: "space-between"
|
|
@@ -8775,9 +10088,9 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8775
10088
|
children: [/* @__PURE__ */ p("span", { children: [
|
|
8776
10089
|
m("tax"),
|
|
8777
10090
|
" (",
|
|
8778
|
-
|
|
10091
|
+
_.tax_rate,
|
|
8779
10092
|
"%)"
|
|
8780
|
-
] }), /* @__PURE__ */ f("span", { children:
|
|
10093
|
+
] }), /* @__PURE__ */ f("span", { children: L(_.tax_total) })]
|
|
8781
10094
|
}),
|
|
8782
10095
|
/* @__PURE__ */ p("div", {
|
|
8783
10096
|
style: {
|
|
@@ -8786,9 +10099,9 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8786
10099
|
fontWeight: 700,
|
|
8787
10100
|
fontSize: "16px"
|
|
8788
10101
|
},
|
|
8789
|
-
children: [/* @__PURE__ */ f("span", { children: m("total") }), /* @__PURE__ */ f("span", { children:
|
|
10102
|
+
children: [/* @__PURE__ */ f("span", { children: m("total") }), /* @__PURE__ */ f("span", { children: L(r && i && !_.lines.length ? oe : _.total) })]
|
|
8790
10103
|
}),
|
|
8791
|
-
|
|
10104
|
+
_.tax_included && _.tax_total > 0 && /* @__PURE__ */ p("div", {
|
|
8792
10105
|
style: {
|
|
8793
10106
|
display: "flex",
|
|
8794
10107
|
justifyContent: "space-between",
|
|
@@ -8798,13 +10111,13 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8798
10111
|
children: [/* @__PURE__ */ p("span", { children: [
|
|
8799
10112
|
m("taxIncluded"),
|
|
8800
10113
|
" (",
|
|
8801
|
-
|
|
10114
|
+
_.tax_rate,
|
|
8802
10115
|
"%)"
|
|
8803
|
-
] }), /* @__PURE__ */ f("span", { children:
|
|
10116
|
+
] }), /* @__PURE__ */ f("span", { children: L(_.tax_total) })]
|
|
8804
10117
|
})
|
|
8805
10118
|
]
|
|
8806
10119
|
}),
|
|
8807
|
-
|
|
10120
|
+
_.shipping_available === !1 && /* @__PURE__ */ f("p", {
|
|
8808
10121
|
style: {
|
|
8809
10122
|
margin: 0,
|
|
8810
10123
|
color: "#dc2626",
|
|
@@ -8812,25 +10125,25 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8812
10125
|
},
|
|
8813
10126
|
children: m("noShipping")
|
|
8814
10127
|
}),
|
|
8815
|
-
|
|
10128
|
+
D && /* @__PURE__ */ f("p", {
|
|
8816
10129
|
style: {
|
|
8817
10130
|
margin: 0,
|
|
8818
10131
|
color: "#dc2626",
|
|
8819
10132
|
fontSize: "13px"
|
|
8820
10133
|
},
|
|
8821
|
-
children:
|
|
10134
|
+
children: D
|
|
8822
10135
|
}),
|
|
8823
10136
|
/* @__PURE__ */ f("button", {
|
|
8824
10137
|
type: "submit",
|
|
8825
|
-
disabled:
|
|
10138
|
+
disabled: T || !C || _.shipping_available === !1,
|
|
8826
10139
|
style: {
|
|
8827
|
-
...
|
|
10140
|
+
...Ca,
|
|
8828
10141
|
width: "100%",
|
|
8829
10142
|
padding: "12px"
|
|
8830
10143
|
},
|
|
8831
|
-
children: m(
|
|
10144
|
+
children: m(T ? "placing" : "placeOrder")
|
|
8832
10145
|
}),
|
|
8833
|
-
/* @__PURE__ */ f(
|
|
10146
|
+
/* @__PURE__ */ f(Ja, {
|
|
8834
10147
|
apiUrl: u,
|
|
8835
10148
|
tenant: c,
|
|
8836
10149
|
words: m,
|
|
@@ -8842,7 +10155,7 @@ function va({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
8842
10155
|
})]
|
|
8843
10156
|
});
|
|
8844
10157
|
}
|
|
8845
|
-
var
|
|
10158
|
+
var qa = [
|
|
8846
10159
|
"refund",
|
|
8847
10160
|
"privacy",
|
|
8848
10161
|
"terms",
|
|
@@ -8853,8 +10166,8 @@ var ya = [
|
|
|
8853
10166
|
fields: {},
|
|
8854
10167
|
updated_at: null
|
|
8855
10168
|
}));
|
|
8856
|
-
function
|
|
8857
|
-
let [s, c] = l(i ?
|
|
10169
|
+
function Ja({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: o }) {
|
|
10170
|
+
let [s, c] = l(i ? qa : []), [u, d] = l(null);
|
|
8858
10171
|
if (a(() => {
|
|
8859
10172
|
if (i) return;
|
|
8860
10173
|
let n = !0;
|
|
@@ -8895,12 +10208,12 @@ function ba({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: o })
|
|
|
8895
10208
|
display: "flex",
|
|
8896
10209
|
flexWrap: "wrap",
|
|
8897
10210
|
gap: "6px 14px",
|
|
8898
|
-
borderTop:
|
|
10211
|
+
borderTop: xa,
|
|
8899
10212
|
paddingTop: "10px"
|
|
8900
10213
|
},
|
|
8901
10214
|
children: s.map(g)
|
|
8902
10215
|
}),
|
|
8903
|
-
u && /* @__PURE__ */ f(
|
|
10216
|
+
u && /* @__PURE__ */ f(Ya, {
|
|
8904
10217
|
policy: u,
|
|
8905
10218
|
words: n,
|
|
8906
10219
|
locale: r,
|
|
@@ -8909,7 +10222,7 @@ function ba({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: o })
|
|
|
8909
10222
|
]
|
|
8910
10223
|
});
|
|
8911
10224
|
}
|
|
8912
|
-
function
|
|
10225
|
+
function Ya({ policy: e, words: t, locale: n, onClose: r }) {
|
|
8913
10226
|
a(() => {
|
|
8914
10227
|
let e = (e) => {
|
|
8915
10228
|
e.key === "Escape" && r();
|
|
@@ -8945,7 +10258,7 @@ function xa({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
8945
10258
|
style: {
|
|
8946
10259
|
background: "var(--page-bg, #fff)",
|
|
8947
10260
|
color: "var(--page-text, #111827)",
|
|
8948
|
-
border:
|
|
10261
|
+
border: xa,
|
|
8949
10262
|
borderRadius: "12px",
|
|
8950
10263
|
width: "min(720px, 100%)",
|
|
8951
10264
|
maxHeight: "85vh",
|
|
@@ -8959,7 +10272,7 @@ function xa({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
8959
10272
|
alignItems: "center",
|
|
8960
10273
|
gap: "12px",
|
|
8961
10274
|
padding: "16px 20px",
|
|
8962
|
-
borderBottom:
|
|
10275
|
+
borderBottom: xa
|
|
8963
10276
|
},
|
|
8964
10277
|
children: [/* @__PURE__ */ f("strong", {
|
|
8965
10278
|
style: {
|
|
@@ -8972,7 +10285,7 @@ function xa({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
8972
10285
|
onClick: r,
|
|
8973
10286
|
"aria-label": t("close"),
|
|
8974
10287
|
style: {
|
|
8975
|
-
|
|
10288
|
+
...wa,
|
|
8976
10289
|
padding: "4px 10px"
|
|
8977
10290
|
},
|
|
8978
10291
|
children: "×"
|
|
@@ -9024,12 +10337,12 @@ function xa({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
9024
10337
|
})
|
|
9025
10338
|
});
|
|
9026
10339
|
}
|
|
9027
|
-
var
|
|
10340
|
+
var Xa = {
|
|
9028
10341
|
year: "numeric",
|
|
9029
10342
|
month: "short",
|
|
9030
10343
|
day: "numeric"
|
|
9031
10344
|
};
|
|
9032
|
-
function
|
|
10345
|
+
function Za({ reference: e, words: t }) {
|
|
9033
10346
|
let [n, r] = l(!1);
|
|
9034
10347
|
return e ? /* @__PURE__ */ p("div", {
|
|
9035
10348
|
style: {
|
|
@@ -9070,7 +10383,7 @@ function Ca({ reference: e, words: t }) {
|
|
|
9070
10383
|
} catch {}
|
|
9071
10384
|
},
|
|
9072
10385
|
style: {
|
|
9073
|
-
|
|
10386
|
+
...wa,
|
|
9074
10387
|
padding: "6px 12px"
|
|
9075
10388
|
},
|
|
9076
10389
|
children: t(n ? "copied" : "copy")
|
|
@@ -9086,7 +10399,7 @@ function Ca({ reference: e, words: t }) {
|
|
|
9086
10399
|
]
|
|
9087
10400
|
}) : null;
|
|
9088
10401
|
}
|
|
9089
|
-
function
|
|
10402
|
+
function Qa({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
9090
10403
|
let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
|
|
9091
10404
|
if (!a.length) return null;
|
|
9092
10405
|
let o = (e) => {
|
|
@@ -9113,7 +10426,7 @@ function wa({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
9113
10426
|
alignItems: "center",
|
|
9114
10427
|
gap: "12px",
|
|
9115
10428
|
padding: "10px 12px",
|
|
9116
|
-
border:
|
|
10429
|
+
border: xa,
|
|
9117
10430
|
borderRadius: "8px"
|
|
9118
10431
|
},
|
|
9119
10432
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -9139,7 +10452,7 @@ function wa({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
9139
10452
|
href: `${t}/store/downloads/${encodeURIComponent(e.token)}`,
|
|
9140
10453
|
onClick: i ? (e) => e.preventDefault() : void 0,
|
|
9141
10454
|
style: {
|
|
9142
|
-
...
|
|
10455
|
+
...Ca,
|
|
9143
10456
|
padding: "6px 14px",
|
|
9144
10457
|
textDecoration: "none",
|
|
9145
10458
|
fontSize: "14px"
|
|
@@ -9156,7 +10469,7 @@ function wa({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
9156
10469
|
})]
|
|
9157
10470
|
});
|
|
9158
10471
|
}
|
|
9159
|
-
function
|
|
10472
|
+
function $a({ tracking: e, words: t, noNavigate: n }) {
|
|
9160
10473
|
let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
|
|
9161
10474
|
return !r && !i && !a ? null : /* @__PURE__ */ p("div", {
|
|
9162
10475
|
style: {
|
|
@@ -9185,13 +10498,13 @@ function Ta({ tracking: e, words: t, noNavigate: n }) {
|
|
|
9185
10498
|
]
|
|
9186
10499
|
});
|
|
9187
10500
|
}
|
|
9188
|
-
function
|
|
9189
|
-
let { tenant: c, apiUrl: u, locale: d, words: m } =
|
|
10501
|
+
function eo({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: o = !1, noNavigate: s = !1 }) {
|
|
10502
|
+
let { tenant: c, apiUrl: u, locale: d, words: m, orderId: h } = Ta(), [g, _] = l(null), [v, y] = l(!1), [b, x] = l("");
|
|
9190
10503
|
a(() => {
|
|
9191
10504
|
if (i) return;
|
|
9192
10505
|
let e = !0;
|
|
9193
|
-
return Q(u, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e &&
|
|
9194
|
-
e && (
|
|
10506
|
+
return Q(u, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && _(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
|
|
10507
|
+
e && (y(t?.code === "LOGIN_REQUIRED"), _([]));
|
|
9195
10508
|
}), () => {
|
|
9196
10509
|
e = !1;
|
|
9197
10510
|
};
|
|
@@ -9201,7 +10514,7 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9201
10514
|
t,
|
|
9202
10515
|
i
|
|
9203
10516
|
]);
|
|
9204
|
-
let
|
|
10517
|
+
let S = i && o ? [{
|
|
9205
10518
|
id: "s1",
|
|
9206
10519
|
number: 1042,
|
|
9207
10520
|
status: "shipped",
|
|
@@ -9219,9 +10532,9 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9219
10532
|
total: 2990,
|
|
9220
10533
|
created_at: (/* @__PURE__ */ new Date(Date.now() - 864e6)).toISOString(),
|
|
9221
10534
|
items: []
|
|
9222
|
-
}] :
|
|
10535
|
+
}] : g ?? [], C = (e) => {
|
|
9223
10536
|
try {
|
|
9224
|
-
return new Intl.DateTimeFormat(d || void 0,
|
|
10537
|
+
return new Intl.DateTimeFormat(d || void 0, Xa).format(new Date(e));
|
|
9225
10538
|
} catch {
|
|
9226
10539
|
return String(e).slice(0, 10);
|
|
9227
10540
|
}
|
|
@@ -9242,7 +10555,7 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9242
10555
|
},
|
|
9243
10556
|
children: m("myOrders")
|
|
9244
10557
|
}),
|
|
9245
|
-
|
|
10558
|
+
v && /* @__PURE__ */ f("p", {
|
|
9246
10559
|
style: { margin: 0 },
|
|
9247
10560
|
children: /* @__PURE__ */ f("a", {
|
|
9248
10561
|
href: e,
|
|
@@ -9251,22 +10564,22 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9251
10564
|
children: m("signInForOrders")
|
|
9252
10565
|
})
|
|
9253
10566
|
}),
|
|
9254
|
-
!
|
|
10567
|
+
!v && (g !== null || i) && !S.length && /* @__PURE__ */ f("p", {
|
|
9255
10568
|
style: {
|
|
9256
10569
|
margin: 0,
|
|
9257
10570
|
color: $
|
|
9258
10571
|
},
|
|
9259
10572
|
children: m("noOrders")
|
|
9260
10573
|
}),
|
|
9261
|
-
|
|
10574
|
+
S.map((e) => /* @__PURE__ */ p("div", {
|
|
9262
10575
|
style: {
|
|
9263
|
-
border:
|
|
10576
|
+
border: xa,
|
|
9264
10577
|
borderRadius: "10px",
|
|
9265
10578
|
overflow: "hidden"
|
|
9266
10579
|
},
|
|
9267
10580
|
children: [/* @__PURE__ */ p("button", {
|
|
9268
10581
|
type: "button",
|
|
9269
|
-
onClick: () =>
|
|
10582
|
+
onClick: () => x((t) => t === e.id ? "" : e.id),
|
|
9270
10583
|
style: {
|
|
9271
10584
|
width: "100%",
|
|
9272
10585
|
display: "grid",
|
|
@@ -9282,26 +10595,26 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9282
10595
|
cursor: "pointer"
|
|
9283
10596
|
},
|
|
9284
10597
|
children: [
|
|
9285
|
-
/* @__PURE__ */ p("span", { children: [/* @__PURE__ */
|
|
10598
|
+
/* @__PURE__ */ p("span", { children: [/* @__PURE__ */ f("strong", { children: h(e.number) }), /* @__PURE__ */ f("span", {
|
|
9286
10599
|
style: {
|
|
9287
10600
|
color: $,
|
|
9288
10601
|
marginLeft: "8px",
|
|
9289
10602
|
fontSize: "13px"
|
|
9290
10603
|
},
|
|
9291
|
-
children:
|
|
10604
|
+
children: C(e.created_at)
|
|
9292
10605
|
})] }),
|
|
9293
10606
|
/* @__PURE__ */ p("span", {
|
|
9294
10607
|
style: {
|
|
9295
10608
|
fontSize: "13px",
|
|
9296
10609
|
padding: "2px 10px",
|
|
9297
10610
|
borderRadius: "999px",
|
|
9298
|
-
background:
|
|
10611
|
+
background: Sa
|
|
9299
10612
|
},
|
|
9300
10613
|
children: [m(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${m(`pay_${e.payment_status}`)}`]
|
|
9301
10614
|
}),
|
|
9302
10615
|
/* @__PURE__ */ f("strong", { children: Hi(e.total, e.currency, d) })
|
|
9303
10616
|
]
|
|
9304
|
-
}),
|
|
10617
|
+
}), b === e.id && e.items?.length > 0 && /* @__PURE__ */ p("div", {
|
|
9305
10618
|
style: {
|
|
9306
10619
|
padding: "0 14px 12px",
|
|
9307
10620
|
display: "grid",
|
|
@@ -9325,16 +10638,16 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9325
10638
|
})
|
|
9326
10639
|
] }), /* @__PURE__ */ f("span", { children: Hi(t.total, e.currency, d) })]
|
|
9327
10640
|
}, t.id)),
|
|
9328
|
-
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ f(
|
|
10641
|
+
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ f(Za, {
|
|
9329
10642
|
reference: e.transfer_reference,
|
|
9330
10643
|
words: m
|
|
9331
10644
|
}),
|
|
9332
|
-
/* @__PURE__ */ f(
|
|
10645
|
+
/* @__PURE__ */ f($a, {
|
|
9333
10646
|
tracking: e.tracking,
|
|
9334
10647
|
words: m,
|
|
9335
10648
|
noNavigate: s
|
|
9336
10649
|
}),
|
|
9337
|
-
/* @__PURE__ */ f(
|
|
10650
|
+
/* @__PURE__ */ f(Qa, {
|
|
9338
10651
|
downloads: e.downloads,
|
|
9339
10652
|
apiUrl: u,
|
|
9340
10653
|
words: m,
|
|
@@ -9349,21 +10662,21 @@ function Ea({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
9349
10662
|
}
|
|
9350
10663
|
//#endregion
|
|
9351
10664
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
9352
|
-
function
|
|
10665
|
+
function to(e) {
|
|
9353
10666
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
9354
10667
|
return [...new Set(n.map((e) => e.trim()))];
|
|
9355
10668
|
}
|
|
9356
|
-
var
|
|
9357
|
-
function
|
|
10669
|
+
var no = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
10670
|
+
function ro(e, t) {
|
|
9358
10671
|
let n = String(e ?? "").toUpperCase();
|
|
9359
10672
|
if (t === "code") return n;
|
|
9360
10673
|
let r = "";
|
|
9361
10674
|
try {
|
|
9362
|
-
r =
|
|
10675
|
+
r = no(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
9363
10676
|
} catch {}
|
|
9364
10677
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
9365
10678
|
}
|
|
9366
|
-
function
|
|
10679
|
+
function io(e, t) {
|
|
9367
10680
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
9368
10681
|
if (typeof window > "u") return n || "?";
|
|
9369
10682
|
try {
|
|
@@ -9373,8 +10686,8 @@ function Aa(e, t) {
|
|
|
9373
10686
|
return n || "/";
|
|
9374
10687
|
}
|
|
9375
10688
|
}
|
|
9376
|
-
function
|
|
9377
|
-
let c = i(Y), l =
|
|
10689
|
+
function ao({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
10690
|
+
let c = i(Y), l = to(c?.settings), u = l[0] ?? "", d = l.includes(c?.locale) ? c.locale : u, m = {
|
|
9378
10691
|
display: "inline-flex",
|
|
9379
10692
|
alignItems: "center",
|
|
9380
10693
|
gap: 8,
|
|
@@ -9409,7 +10722,7 @@ function ja({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
9409
10722
|
style: { opacity: .4 },
|
|
9410
10723
|
children: n ?? "·"
|
|
9411
10724
|
}), /* @__PURE__ */ f("a", {
|
|
9412
|
-
href:
|
|
10725
|
+
href: io(e, e === u),
|
|
9413
10726
|
hrefLang: e,
|
|
9414
10727
|
"aria-current": e === d ? "true" : void 0,
|
|
9415
10728
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -9419,7 +10732,7 @@ function ja({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
9419
10732
|
textDecoration: "none",
|
|
9420
10733
|
cursor: s ? "default" : "pointer"
|
|
9421
10734
|
},
|
|
9422
|
-
children:
|
|
10735
|
+
children: ro(e, t)
|
|
9423
10736
|
})]
|
|
9424
10737
|
}, e))]
|
|
9425
10738
|
}) : /* @__PURE__ */ p("div", {
|
|
@@ -9430,7 +10743,7 @@ function ja({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
9430
10743
|
value: d,
|
|
9431
10744
|
onChange: s ? void 0 : (e) => {
|
|
9432
10745
|
let t = e.target.value;
|
|
9433
|
-
window.location.assign(
|
|
10746
|
+
window.location.assign(io(t, t === u));
|
|
9434
10747
|
},
|
|
9435
10748
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
9436
10749
|
style: {
|
|
@@ -9444,54 +10757,55 @@ function ja({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
9444
10757
|
},
|
|
9445
10758
|
children: l.map((e) => /* @__PURE__ */ f("option", {
|
|
9446
10759
|
value: e,
|
|
9447
|
-
children:
|
|
10760
|
+
children: ro(e, t)
|
|
9448
10761
|
}, e))
|
|
9449
10762
|
})]
|
|
9450
10763
|
});
|
|
9451
10764
|
}
|
|
9452
10765
|
//#endregion
|
|
9453
10766
|
//#region ../ui/src/components/builder/apps/index.js
|
|
9454
|
-
var
|
|
10767
|
+
var oo = [
|
|
9455
10768
|
ai,
|
|
9456
10769
|
wi,
|
|
9457
10770
|
_i,
|
|
9458
10771
|
Ti,
|
|
9459
10772
|
ji
|
|
9460
|
-
],
|
|
10773
|
+
], so = {
|
|
9461
10774
|
SiteLoginForm: hi,
|
|
9462
10775
|
SiteAccountMenu: gi,
|
|
9463
|
-
SiteLanguagePicker:
|
|
10776
|
+
SiteLanguagePicker: ao,
|
|
9464
10777
|
CookieConsent: Ci,
|
|
9465
10778
|
SiteSearch: Ai,
|
|
9466
|
-
ShopProductGrid:
|
|
9467
|
-
ShopProduct:
|
|
9468
|
-
ShopCartButton:
|
|
9469
|
-
ShopCheckout:
|
|
9470
|
-
ShopOrderHistory:
|
|
9471
|
-
ShopCurrencyPicker:
|
|
10779
|
+
ShopProductGrid: Pa,
|
|
10780
|
+
ShopProduct: Fa,
|
|
10781
|
+
ShopCartButton: Ra,
|
|
10782
|
+
ShopCheckout: Ka,
|
|
10783
|
+
ShopOrderHistory: eo,
|
|
10784
|
+
ShopCurrencyPicker: Ba,
|
|
10785
|
+
ShopFavorites: Ia
|
|
9472
10786
|
};
|
|
9473
|
-
new Set(
|
|
10787
|
+
new Set(oo.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
9474
10788
|
//#endregion
|
|
9475
10789
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
9476
|
-
var
|
|
10790
|
+
var co = "0.185.1", lo = "4.2.0", uo = "https://cdn.jsdelivr.net/npm", fo = `${uo}/three@${co}/+esm`, po = `${uo}/@google/model-viewer@${lo}/dist/model-viewer.min.js`, mo = (e) => import(
|
|
9477
10791
|
/* @vite-ignore */
|
|
9478
10792
|
/* webpackIgnore: true */
|
|
9479
10793
|
e
|
|
9480
|
-
),
|
|
9481
|
-
function
|
|
9482
|
-
if (
|
|
10794
|
+
), ho = /* @__PURE__ */ new Map();
|
|
10795
|
+
function go(e) {
|
|
10796
|
+
if (ho.has(e)) return ho.get(e);
|
|
9483
10797
|
if (typeof window > "u") return new Promise(() => {});
|
|
9484
|
-
let t =
|
|
9485
|
-
throw
|
|
10798
|
+
let t = mo(e).catch((t) => {
|
|
10799
|
+
throw ho.delete(e), t;
|
|
9486
10800
|
});
|
|
9487
|
-
return
|
|
10801
|
+
return ho.set(e, t), t;
|
|
9488
10802
|
}
|
|
9489
|
-
var
|
|
9490
|
-
function
|
|
9491
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
10803
|
+
var _o = () => go(fo), vo = (e) => go(`${uo}/three@${co}/examples/jsm/${e}/+esm`);
|
|
10804
|
+
function yo() {
|
|
10805
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : go(po);
|
|
9492
10806
|
}
|
|
9493
|
-
var
|
|
9494
|
-
function
|
|
10807
|
+
var bo = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, xo = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
10808
|
+
function So(e, t) {
|
|
9495
10809
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
9496
10810
|
n = requestAnimationFrame(o), i ||= e;
|
|
9497
10811
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -9510,7 +10824,7 @@ function qa(e, t) {
|
|
|
9510
10824
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
9511
10825
|
};
|
|
9512
10826
|
}
|
|
9513
|
-
function
|
|
10827
|
+
function Co(e, t, n = {}) {
|
|
9514
10828
|
let r = {
|
|
9515
10829
|
radius: n.distance ?? 4,
|
|
9516
10830
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -9559,13 +10873,13 @@ function Ja(e, t, n = {}) {
|
|
|
9559
10873
|
}
|
|
9560
10874
|
//#endregion
|
|
9561
10875
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
9562
|
-
var
|
|
9563
|
-
function
|
|
10876
|
+
var wo = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, To = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Eo = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Do = (e) => typeof e == "string" && !!e.trim();
|
|
10877
|
+
function Oo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
9564
10878
|
return /* @__PURE__ */ p("div", {
|
|
9565
10879
|
ref: r,
|
|
9566
10880
|
style: {
|
|
9567
10881
|
...F(i),
|
|
9568
|
-
minHeight:
|
|
10882
|
+
minHeight: wo(n, 320),
|
|
9569
10883
|
display: "flex",
|
|
9570
10884
|
flexDirection: "column",
|
|
9571
10885
|
alignItems: "center",
|
|
@@ -9593,24 +10907,24 @@ function $a({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
9593
10907
|
}) : null]
|
|
9594
10908
|
});
|
|
9595
10909
|
}
|
|
9596
|
-
function
|
|
10910
|
+
function ko({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: d, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
9597
10911
|
let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
|
|
9598
10912
|
a(() => {
|
|
9599
10913
|
if (y || !e) return;
|
|
9600
10914
|
let t = !0;
|
|
9601
|
-
return
|
|
10915
|
+
return yo().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
9602
10916
|
t = !1;
|
|
9603
10917
|
};
|
|
9604
10918
|
}, [y, e]);
|
|
9605
10919
|
let C = {
|
|
9606
10920
|
display: "block",
|
|
9607
10921
|
width: "100%",
|
|
9608
|
-
minHeight:
|
|
9609
|
-
height:
|
|
10922
|
+
minHeight: wo(r, 360),
|
|
10923
|
+
height: wo(r, 360),
|
|
9610
10924
|
backgroundColor: i || "transparent",
|
|
9611
10925
|
...F(g)
|
|
9612
10926
|
};
|
|
9613
|
-
if (!e) return v ? /* @__PURE__ */ f(
|
|
10927
|
+
if (!e) return v ? /* @__PURE__ */ f(Oo, {
|
|
9614
10928
|
nodeRef: _,
|
|
9615
10929
|
style: g,
|
|
9616
10930
|
height: r,
|
|
@@ -9645,13 +10959,13 @@ function eo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
9645
10959
|
poster: t || void 0,
|
|
9646
10960
|
style: C,
|
|
9647
10961
|
"camera-controls": w(!v && c !== !1),
|
|
9648
|
-
"auto-rotate": w(T && !
|
|
9649
|
-
"auto-rotate-delay": T ? String(
|
|
10962
|
+
"auto-rotate": w(T && !bo()),
|
|
10963
|
+
"auto-rotate-delay": T ? String(wo(s, 0)) : void 0,
|
|
9650
10964
|
"rotation-per-second": "18deg",
|
|
9651
10965
|
ar: w(!v && u === !0),
|
|
9652
10966
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
9653
|
-
"shadow-intensity": String(
|
|
9654
|
-
exposure: String(
|
|
10967
|
+
"shadow-intensity": String(To(p, 100)),
|
|
10968
|
+
exposure: String(To(d, 100)),
|
|
9655
10969
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
9656
10970
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
9657
10971
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -9669,7 +10983,7 @@ function eo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
9669
10983
|
}) : null
|
|
9670
10984
|
});
|
|
9671
10985
|
}
|
|
9672
|
-
var
|
|
10986
|
+
var Ao = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), jo = [
|
|
9673
10987
|
"precision highp float;",
|
|
9674
10988
|
"uniform vec2 u_res;",
|
|
9675
10989
|
"uniform float u_time;",
|
|
@@ -9692,7 +11006,7 @@ var to = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
9692
11006
|
" return v;",
|
|
9693
11007
|
"}",
|
|
9694
11008
|
""
|
|
9695
|
-
].join("\n"),
|
|
11009
|
+
].join("\n"), Mo = {
|
|
9696
11010
|
gradient: [
|
|
9697
11011
|
"void main(){",
|
|
9698
11012
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -9744,7 +11058,7 @@ var to = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
9744
11058
|
"}"
|
|
9745
11059
|
].join("\n")
|
|
9746
11060
|
};
|
|
9747
|
-
function
|
|
11061
|
+
function No(e, t) {
|
|
9748
11062
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
9749
11063
|
if (!n) return t;
|
|
9750
11064
|
let r = parseInt(n[1], 16);
|
|
@@ -9754,7 +11068,7 @@ function io(e, t) {
|
|
|
9754
11068
|
(r & 255) / 255
|
|
9755
11069
|
];
|
|
9756
11070
|
}
|
|
9757
|
-
function
|
|
11071
|
+
function Po(e, t, n) {
|
|
9758
11072
|
let r = e.createShader(t);
|
|
9759
11073
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
9760
11074
|
let t = e.getShaderInfoLog(r);
|
|
@@ -9762,13 +11076,13 @@ function ao(e, t, n) {
|
|
|
9762
11076
|
}
|
|
9763
11077
|
return r;
|
|
9764
11078
|
}
|
|
9765
|
-
function
|
|
11079
|
+
function Fo({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: d, style: m, nodeRef: h, inert: g }) {
|
|
9766
11080
|
let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
|
|
9767
11081
|
a(() => () => {
|
|
9768
11082
|
let e = y.current;
|
|
9769
11083
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
9770
11084
|
}, []);
|
|
9771
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
11085
|
+
let S = typeof t == "string" && t.trim() ? t : Mo[e] ?? Mo.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = To(o, 100), D = Math.max(.05, To(s, 100));
|
|
9772
11086
|
return a(() => {
|
|
9773
11087
|
let e = _.current, t = v.current;
|
|
9774
11088
|
if (!e || !t) return;
|
|
@@ -9783,7 +11097,7 @@ function oo({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
9783
11097
|
}
|
|
9784
11098
|
let r = null;
|
|
9785
11099
|
try {
|
|
9786
|
-
let e =
|
|
11100
|
+
let e = Po(n, n.VERTEX_SHADER, Ao), t = Po(n, n.FRAGMENT_SHADER, jo + S);
|
|
9787
11101
|
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
9788
11102
|
x("");
|
|
9789
11103
|
} catch (e) {
|
|
@@ -9819,28 +11133,28 @@ function oo({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
9819
11133
|
};
|
|
9820
11134
|
d !== !1 && t.addEventListener("pointermove", l);
|
|
9821
11135
|
let u = () => {
|
|
9822
|
-
let r =
|
|
11136
|
+
let r = xo(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
9823
11137
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
9824
11138
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
9825
11139
|
f?.observe(t), u();
|
|
9826
|
-
let p =
|
|
9827
|
-
a:
|
|
11140
|
+
let p = bo(), m = {
|
|
11141
|
+
a: No(C, [
|
|
9828
11142
|
.35,
|
|
9829
11143
|
.4,
|
|
9830
11144
|
.95
|
|
9831
11145
|
]),
|
|
9832
|
-
b:
|
|
11146
|
+
b: No(w, [
|
|
9833
11147
|
.05,
|
|
9834
11148
|
.06,
|
|
9835
11149
|
.16
|
|
9836
11150
|
]),
|
|
9837
|
-
c:
|
|
11151
|
+
c: No(T, [
|
|
9838
11152
|
.95,
|
|
9839
11153
|
.35,
|
|
9840
11154
|
.6
|
|
9841
11155
|
])
|
|
9842
11156
|
}, h = {};
|
|
9843
|
-
return h.stop =
|
|
11157
|
+
return h.stop = So(t, (t, r) => {
|
|
9844
11158
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), p && h.stop?.();
|
|
9845
11159
|
}), () => {
|
|
9846
11160
|
h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -9859,7 +11173,7 @@ function oo({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
9859
11173
|
},
|
|
9860
11174
|
style: {
|
|
9861
11175
|
position: "relative",
|
|
9862
|
-
minHeight:
|
|
11176
|
+
minHeight: wo(u, 320),
|
|
9863
11177
|
overflow: "hidden",
|
|
9864
11178
|
...F(m)
|
|
9865
11179
|
},
|
|
@@ -9891,7 +11205,7 @@ function oo({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
9891
11205
|
}) : null]
|
|
9892
11206
|
});
|
|
9893
11207
|
}
|
|
9894
|
-
function
|
|
11208
|
+
function Io(e, t) {
|
|
9895
11209
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
9896
11210
|
r.deleteAttribute("uv");
|
|
9897
11211
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -9907,23 +11221,23 @@ function so(e, t) {
|
|
|
9907
11221
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
9908
11222
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
9909
11223
|
}
|
|
9910
|
-
var
|
|
9911
|
-
function
|
|
9912
|
-
if (
|
|
9913
|
-
let t =
|
|
11224
|
+
var Lo = /* @__PURE__ */ new Map();
|
|
11225
|
+
function Ro(e) {
|
|
11226
|
+
if (Lo.has(e)) return Lo.get(e);
|
|
11227
|
+
let t = vo("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
9914
11228
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
9915
11229
|
})).catch((t) => {
|
|
9916
|
-
throw
|
|
11230
|
+
throw Lo.delete(e), t;
|
|
9917
11231
|
});
|
|
9918
|
-
return
|
|
11232
|
+
return Lo.set(e, t), t;
|
|
9919
11233
|
}
|
|
9920
|
-
function
|
|
11234
|
+
function zo(e, t) {
|
|
9921
11235
|
let n = new e.Box3().setFromObject(t);
|
|
9922
11236
|
if (n.isEmpty()) return t;
|
|
9923
11237
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
9924
11238
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
9925
11239
|
}
|
|
9926
|
-
var
|
|
11240
|
+
var Bo = {
|
|
9927
11241
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
9928
11242
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
9929
11243
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -9932,50 +11246,50 @@ var fo = {
|
|
|
9932
11246
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
9933
11247
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
9934
11248
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
9935
|
-
},
|
|
9936
|
-
function
|
|
9937
|
-
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
11249
|
+
}, Vo = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
11250
|
+
function Ho({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: d, style: p, nodeRef: m, inert: h }) {
|
|
11251
|
+
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !bo(), S = s !== !1 && !h;
|
|
9938
11252
|
return a(() => {
|
|
9939
11253
|
let e = g.current;
|
|
9940
11254
|
if (!e) return;
|
|
9941
11255
|
let i = !0, a = null;
|
|
9942
|
-
return
|
|
11256
|
+
return _o().then((s) => {
|
|
9943
11257
|
if (!i || !e) return;
|
|
9944
11258
|
let c = new s.WebGLRenderer({
|
|
9945
11259
|
antialias: !0,
|
|
9946
11260
|
alpha: !t
|
|
9947
11261
|
});
|
|
9948
|
-
c.setPixelRatio(
|
|
11262
|
+
c.setPixelRatio(xo()), c.shadowMap.enabled = u !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
9949
11263
|
let l = new s.Scene();
|
|
9950
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
9951
|
-
let d = new s.PerspectiveCamera(
|
|
9952
|
-
distance:
|
|
11264
|
+
t && (l.background = new s.Color(t)), l.environment = Io(s, c);
|
|
11265
|
+
let d = new s.PerspectiveCamera(Vo(r, 45), 1, .1, 400), f = Co(d, c.domElement, {
|
|
11266
|
+
distance: Vo(n, 5),
|
|
9953
11267
|
enableZoom: S
|
|
9954
11268
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
9955
11269
|
p.position.set(4, 7, 5), p.castShadow = u !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
9956
11270
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
9957
|
-
let n =
|
|
9958
|
-
e.position.set(
|
|
11271
|
+
let n = Vo(t.scale, 1);
|
|
11272
|
+
e.position.set(Vo(t.x, 0), Vo(t.y, 0), Vo(t.z, 0)), e.rotation.set(Eo(t.rx), Eo(t.ry), Eo(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Eo(t.spin);
|
|
9959
11273
|
};
|
|
9960
11274
|
for (let e of y) {
|
|
9961
11275
|
if (e.shape === "model") {
|
|
9962
|
-
if (!
|
|
11276
|
+
if (!Do(e.src)) continue;
|
|
9963
11277
|
let t = new s.Group();
|
|
9964
|
-
g(t, e), h.add(t),
|
|
11278
|
+
g(t, e), h.add(t), Ro(e.src).then((e) => {
|
|
9965
11279
|
if (!i) return;
|
|
9966
|
-
let n =
|
|
11280
|
+
let n = zo(s, e.clone(!0));
|
|
9967
11281
|
n.traverse((e) => {
|
|
9968
11282
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
9969
11283
|
}), t.add(n);
|
|
9970
11284
|
}, () => {});
|
|
9971
11285
|
continue;
|
|
9972
11286
|
}
|
|
9973
|
-
let t = (
|
|
11287
|
+
let t = (Bo[e.shape] ?? Bo.box)(s), n = new s.MeshStandardMaterial({
|
|
9974
11288
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
9975
|
-
metalness: Math.min(1, Math.max(0,
|
|
9976
|
-
roughness: Math.min(1, Math.max(0,
|
|
9977
|
-
transparent:
|
|
9978
|
-
opacity: Math.min(1, Math.max(0,
|
|
11289
|
+
metalness: Math.min(1, Math.max(0, To(e.metalness, 10))),
|
|
11290
|
+
roughness: Math.min(1, Math.max(0, To(e.roughness, 35))),
|
|
11291
|
+
transparent: To(e.opacity, 100) < 1,
|
|
11292
|
+
opacity: Math.min(1, Math.max(0, To(e.opacity, 100))),
|
|
9979
11293
|
flatShading: e.flat === !0,
|
|
9980
11294
|
wireframe: e.wireframe === !0,
|
|
9981
11295
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -9986,14 +11300,14 @@ function mo({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
9986
11300
|
let _ = null;
|
|
9987
11301
|
if (u !== !1) {
|
|
9988
11302
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
9989
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
11303
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Vo(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
9990
11304
|
}
|
|
9991
11305
|
let v = () => {
|
|
9992
11306
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
9993
11307
|
c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
9994
11308
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
9995
11309
|
b?.observe(e), v();
|
|
9996
|
-
let C =
|
|
11310
|
+
let C = Eo(Number.isFinite(Number(o)) ? o : 20), w = So(e, (e) => {
|
|
9997
11311
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
9998
11312
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
9999
11313
|
c.render(l, d);
|
|
@@ -10017,7 +11331,7 @@ function mo({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
10017
11331
|
o,
|
|
10018
11332
|
S,
|
|
10019
11333
|
u
|
|
10020
|
-
]), _ && h ? /* @__PURE__ */ f(
|
|
11334
|
+
]), _ && h ? /* @__PURE__ */ f(Oo, {
|
|
10021
11335
|
nodeRef: m,
|
|
10022
11336
|
style: p,
|
|
10023
11337
|
height: d,
|
|
@@ -10028,27 +11342,27 @@ function mo({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
10028
11342
|
g.current = e, typeof m == "function" && m(e);
|
|
10029
11343
|
},
|
|
10030
11344
|
style: {
|
|
10031
|
-
minHeight:
|
|
10032
|
-
height:
|
|
11345
|
+
minHeight: wo(d, 380),
|
|
11346
|
+
height: wo(d, 380),
|
|
10033
11347
|
overflow: "hidden",
|
|
10034
11348
|
touchAction: S ? "pan-y" : void 0,
|
|
10035
11349
|
...F(p)
|
|
10036
11350
|
}
|
|
10037
11351
|
});
|
|
10038
11352
|
}
|
|
10039
|
-
function
|
|
11353
|
+
function Uo({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
|
|
10040
11354
|
let s = c(null), [u, d] = l("");
|
|
10041
11355
|
return a(() => {
|
|
10042
11356
|
let t = s.current;
|
|
10043
11357
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
10044
11358
|
let r = !0, i = null;
|
|
10045
|
-
return
|
|
11359
|
+
return _o().then((a) => {
|
|
10046
11360
|
if (!r || !t) return;
|
|
10047
11361
|
let o = new a.WebGLRenderer({
|
|
10048
11362
|
antialias: !0,
|
|
10049
11363
|
alpha: !n
|
|
10050
11364
|
});
|
|
10051
|
-
o.setPixelRatio(
|
|
11365
|
+
o.setPixelRatio(xo()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
10052
11366
|
let s = new a.Scene();
|
|
10053
11367
|
n && (s.background = new a.Color(n));
|
|
10054
11368
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -10071,7 +11385,7 @@ function ho({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
10071
11385
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
10072
11386
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
10073
11387
|
f?.observe(t), u();
|
|
10074
|
-
let p = !1, m =
|
|
11388
|
+
let p = !1, m = So(t, (e, t) => {
|
|
10075
11389
|
if (!p && typeof l?.frame == "function") try {
|
|
10076
11390
|
l.frame(e, t);
|
|
10077
11391
|
} catch (e) {
|
|
@@ -10093,7 +11407,7 @@ function ho({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
10093
11407
|
e,
|
|
10094
11408
|
o,
|
|
10095
11409
|
n
|
|
10096
|
-
]), o ? /* @__PURE__ */ f(
|
|
11410
|
+
]), o ? /* @__PURE__ */ f(Oo, {
|
|
10097
11411
|
nodeRef: i,
|
|
10098
11412
|
style: r,
|
|
10099
11413
|
height: t,
|
|
@@ -10104,8 +11418,8 @@ function ho({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
10104
11418
|
s.current = e, typeof i == "function" && i(e);
|
|
10105
11419
|
},
|
|
10106
11420
|
style: {
|
|
10107
|
-
minHeight:
|
|
10108
|
-
height:
|
|
11421
|
+
minHeight: wo(t, 380),
|
|
11422
|
+
height: wo(t, 380),
|
|
10109
11423
|
overflow: "hidden",
|
|
10110
11424
|
position: "relative",
|
|
10111
11425
|
touchAction: "pan-y",
|
|
@@ -10128,40 +11442,40 @@ function ho({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
10128
11442
|
}) : null
|
|
10129
11443
|
});
|
|
10130
11444
|
}
|
|
10131
|
-
var
|
|
10132
|
-
ModelViewerBlock:
|
|
10133
|
-
ShaderBlock:
|
|
10134
|
-
SceneBlock:
|
|
10135
|
-
ThreeCanvasBlock:
|
|
10136
|
-
},
|
|
10137
|
-
function
|
|
10138
|
-
if (
|
|
11445
|
+
var Wo = {
|
|
11446
|
+
ModelViewerBlock: ko,
|
|
11447
|
+
ShaderBlock: Fo,
|
|
11448
|
+
SceneBlock: Ho,
|
|
11449
|
+
ThreeCanvasBlock: Uo
|
|
11450
|
+
}, Go = /* @__PURE__ */ new Map();
|
|
11451
|
+
function Ko(e) {
|
|
11452
|
+
if (Go.has(e)) return Go.get(e);
|
|
10139
11453
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
10140
11454
|
/* @vite-ignore */
|
|
10141
11455
|
/* webpackIgnore: true */
|
|
10142
11456
|
t
|
|
10143
11457
|
).finally(() => URL.revokeObjectURL(t));
|
|
10144
|
-
return
|
|
11458
|
+
return Go.set(e, n), n;
|
|
10145
11459
|
}
|
|
10146
|
-
function
|
|
11460
|
+
function qo(e) {
|
|
10147
11461
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
10148
11462
|
return n && typeof n == "object" ? n : {};
|
|
10149
11463
|
}
|
|
10150
11464
|
//#endregion
|
|
10151
11465
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
10152
|
-
async function
|
|
10153
|
-
let n = await
|
|
11466
|
+
async function Jo(e, t) {
|
|
11467
|
+
let n = await Ko(e);
|
|
10154
11468
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
10155
11469
|
}
|
|
10156
|
-
var
|
|
11470
|
+
var Yo = {
|
|
10157
11471
|
padding: "10px 12px",
|
|
10158
11472
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
10159
11473
|
borderRadius: 8,
|
|
10160
11474
|
fontSize: 12,
|
|
10161
11475
|
opacity: .6
|
|
10162
11476
|
};
|
|
10163
|
-
function
|
|
10164
|
-
let s = i(Y), l =
|
|
11477
|
+
function Xo({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
11478
|
+
let s = i(Y), l = qo(s?.settings)[e], u = c(null), d = c(null), m = {
|
|
10165
11479
|
tenant: s?.tenant ?? "",
|
|
10166
11480
|
apiUrl: s?.apiUrl ?? "/api",
|
|
10167
11481
|
locale: s?.locale ?? "",
|
|
@@ -10173,7 +11487,7 @@ function So({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
10173
11487
|
let e = u.current;
|
|
10174
11488
|
if (!l?.code || !e) return;
|
|
10175
11489
|
let n = !0;
|
|
10176
|
-
return
|
|
11490
|
+
return Jo(l.code, t).then((e) => {
|
|
10177
11491
|
if (!(!n || !e || !u.current)) {
|
|
10178
11492
|
d.current = e;
|
|
10179
11493
|
try {
|
|
@@ -10203,7 +11517,7 @@ function So({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
10203
11517
|
}) : /* @__PURE__ */ p("div", {
|
|
10204
11518
|
ref: o,
|
|
10205
11519
|
style: {
|
|
10206
|
-
...
|
|
11520
|
+
...Yo,
|
|
10207
11521
|
...F(r)
|
|
10208
11522
|
},
|
|
10209
11523
|
children: [
|
|
@@ -10215,13 +11529,13 @@ function So({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
10215
11529
|
}
|
|
10216
11530
|
//#endregion
|
|
10217
11531
|
//#region ../ui/src/components/builder/render.jsx
|
|
10218
|
-
var
|
|
11532
|
+
var Zo = {
|
|
10219
11533
|
...ii,
|
|
10220
|
-
...
|
|
10221
|
-
...
|
|
10222
|
-
PluginBlock:
|
|
11534
|
+
...so,
|
|
11535
|
+
...Wo,
|
|
11536
|
+
PluginBlock: Xo
|
|
10223
11537
|
};
|
|
10224
|
-
function
|
|
11538
|
+
function Qo(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
10225
11539
|
let o = n[e];
|
|
10226
11540
|
if (!o || o.hidden) return null;
|
|
10227
11541
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -10229,16 +11543,16 @@ function wo(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
10229
11543
|
let n = o.props?.componentId, s = r?.[n];
|
|
10230
11544
|
if (!s?.template || i.has(n)) return null;
|
|
10231
11545
|
let c = new Set(i).add(n);
|
|
10232
|
-
return /* @__PURE__ */ f(t, { children:
|
|
11546
|
+
return /* @__PURE__ */ f(t, { children: Qo(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
10233
11547
|
}
|
|
10234
|
-
let l =
|
|
11548
|
+
let l = Zo[s];
|
|
10235
11549
|
if (!l) return null;
|
|
10236
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
11550
|
+
let u = (o.nodes ?? []).map((e) => Qo(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), p = d.length ? Object.fromEntries(d.map(([e, t]) => [e, Qo(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ f(l, {
|
|
10237
11551
|
...c,
|
|
10238
11552
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
10239
11553
|
linked: p,
|
|
10240
11554
|
nodeRef: (t) => {
|
|
10241
|
-
t && (t.setAttribute("data-wb", e), ne(t, c),
|
|
11555
|
+
t && (t.setAttribute("data-wb", e), ne(t, c), te(t, a?.events === !1 ? [] : c.events));
|
|
10242
11556
|
},
|
|
10243
11557
|
children: u.length ? u : void 0
|
|
10244
11558
|
}, e);
|
|
@@ -10249,58 +11563,59 @@ function wo(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
10249
11563
|
}
|
|
10250
11564
|
//#endregion
|
|
10251
11565
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
10252
|
-
var
|
|
11566
|
+
var $o = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), es = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ye(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
10253
11567
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(Ye(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
10254
|
-
function
|
|
10255
|
-
let
|
|
11568
|
+
function ts({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: d, locale: m, direction: h, settings: _, siteUser: v, param: y }) {
|
|
11569
|
+
let b = o?.js?.trim();
|
|
10256
11570
|
if (a(() => {
|
|
10257
|
-
if (!
|
|
11571
|
+
if (!b) return;
|
|
10258
11572
|
let e = document.createElement("script");
|
|
10259
|
-
return e.text =
|
|
10260
|
-
}, [
|
|
10261
|
-
let
|
|
11573
|
+
return e.text = b, document.body.appendChild(e), () => e.remove();
|
|
11574
|
+
}, [b]), !e?.ROOT) return null;
|
|
11575
|
+
let x = {
|
|
10262
11576
|
lang: m || void 0,
|
|
10263
11577
|
dir: g(h, m)
|
|
10264
|
-
},
|
|
11578
|
+
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", w = {
|
|
10265
11579
|
minHeight: "100%",
|
|
10266
11580
|
display: "flex",
|
|
10267
11581
|
flexDirection: "column"
|
|
10268
|
-
},
|
|
11582
|
+
}, T = Qo("ROOT", e, n), E = s(() => ({ render: (t, r) => Qo(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = ce(e, n), k = se(e, n), A = o?.css?.trim(), M = C(c), N = Je(t), P = [N.font, N.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ge[e]), F = [.../* @__PURE__ */ new Set([...j(e, n), ...P])].map((e) => /* @__PURE__ */ f("link", {
|
|
10269
11583
|
rel: "stylesheet",
|
|
10270
11584
|
precedence: "default",
|
|
10271
11585
|
href: O(e)
|
|
10272
|
-
}, e)),
|
|
11586
|
+
}, e)), I = es(N);
|
|
10273
11587
|
return r === "auto" ? /* @__PURE__ */ f(Y.Provider, {
|
|
10274
11588
|
value: {
|
|
10275
11589
|
tenant: l || "",
|
|
10276
11590
|
apiUrl: u || "/api",
|
|
10277
11591
|
locale: m || "",
|
|
10278
|
-
settings: _ ?? null
|
|
11592
|
+
settings: _ ?? null,
|
|
11593
|
+
param: y || ""
|
|
10279
11594
|
},
|
|
10280
11595
|
children: /* @__PURE__ */ f(pi, {
|
|
10281
11596
|
initialUser: v,
|
|
10282
11597
|
children: /* @__PURE__ */ f(nt.Provider, {
|
|
10283
11598
|
value: d ?? null,
|
|
10284
11599
|
children: /* @__PURE__ */ f(ot.Provider, {
|
|
10285
|
-
value:
|
|
11600
|
+
value: E,
|
|
10286
11601
|
children: /* @__PURE__ */ p("div", {
|
|
10287
|
-
...
|
|
11602
|
+
...x,
|
|
10288
11603
|
className: "webim-page",
|
|
10289
11604
|
style: {
|
|
10290
|
-
...
|
|
11605
|
+
...w,
|
|
10291
11606
|
...Xe(t),
|
|
10292
11607
|
...i
|
|
10293
11608
|
},
|
|
10294
11609
|
children: [
|
|
10295
|
-
/* @__PURE__ */ f("style", { children: `.webim-page { ${
|
|
10296
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
10297
|
-
/* @__PURE__ */ f("style", { children:
|
|
10298
|
-
|
|
10299
|
-
/* @__PURE__ */ f("style", { children:
|
|
10300
|
-
E && /* @__PURE__ */ f("style", { children: E }),
|
|
11610
|
+
/* @__PURE__ */ f("style", { children: `.webim-page { ${$o(Ye(N.light))} }
|
|
11611
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${$o(Ye(N.dark))} } }` }),
|
|
11612
|
+
/* @__PURE__ */ f("style", { children: I }),
|
|
11613
|
+
F,
|
|
11614
|
+
/* @__PURE__ */ f("style", { children: S }),
|
|
10301
11615
|
D && /* @__PURE__ */ f("style", { children: D }),
|
|
10302
11616
|
k && /* @__PURE__ */ f("style", { children: k }),
|
|
10303
|
-
|
|
11617
|
+
A && /* @__PURE__ */ f("style", { children: A }),
|
|
11618
|
+
T
|
|
10304
11619
|
]
|
|
10305
11620
|
})
|
|
10306
11621
|
})
|
|
@@ -10311,32 +11626,33 @@ function Do({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
10311
11626
|
tenant: l || "",
|
|
10312
11627
|
apiUrl: u || "/api",
|
|
10313
11628
|
locale: m || "",
|
|
10314
|
-
settings: _ ?? null
|
|
11629
|
+
settings: _ ?? null,
|
|
11630
|
+
param: y || ""
|
|
10315
11631
|
},
|
|
10316
11632
|
children: /* @__PURE__ */ f(pi, {
|
|
10317
11633
|
initialUser: v,
|
|
10318
11634
|
children: /* @__PURE__ */ f(nt.Provider, {
|
|
10319
11635
|
value: d ?? null,
|
|
10320
11636
|
children: /* @__PURE__ */ f(ot.Provider, {
|
|
10321
|
-
value:
|
|
11637
|
+
value: E,
|
|
10322
11638
|
children: /* @__PURE__ */ p("div", {
|
|
10323
|
-
...
|
|
11639
|
+
...x,
|
|
10324
11640
|
className: "webim-page",
|
|
10325
11641
|
style: {
|
|
10326
|
-
...
|
|
11642
|
+
...w,
|
|
10327
11643
|
...$e(t, r),
|
|
10328
11644
|
...i
|
|
10329
11645
|
},
|
|
10330
11646
|
children: [
|
|
10331
|
-
|
|
10332
|
-
/* @__PURE__ */ f("style", { children:
|
|
10333
|
-
/* @__PURE__ */ f("style", { children:
|
|
10334
|
-
E && /* @__PURE__ */ f("style", { children: E }),
|
|
11647
|
+
F,
|
|
11648
|
+
/* @__PURE__ */ f("style", { children: I }),
|
|
11649
|
+
/* @__PURE__ */ f("style", { children: S }),
|
|
10335
11650
|
D && /* @__PURE__ */ f("style", { children: D }),
|
|
10336
|
-
A && /* @__PURE__ */ f("style", { children: A }),
|
|
10337
|
-
A && /* @__PURE__ */ f("style", { children: A }),
|
|
10338
11651
|
k && /* @__PURE__ */ f("style", { children: k }),
|
|
10339
|
-
|
|
11652
|
+
M && /* @__PURE__ */ f("style", { children: M }),
|
|
11653
|
+
M && /* @__PURE__ */ f("style", { children: M }),
|
|
11654
|
+
A && /* @__PURE__ */ f("style", { children: A }),
|
|
11655
|
+
T
|
|
10340
11656
|
]
|
|
10341
11657
|
})
|
|
10342
11658
|
})
|
|
@@ -10346,8 +11662,8 @@ function Do({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
10346
11662
|
}
|
|
10347
11663
|
//#endregion
|
|
10348
11664
|
//#region src/WebimContent.jsx
|
|
10349
|
-
function
|
|
10350
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ f(
|
|
11665
|
+
function ns({ bundle: e, mode: t = "auto", style: n }) {
|
|
11666
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ f(ts, {
|
|
10351
11667
|
blocks: e.blocks,
|
|
10352
11668
|
theme: e.theme,
|
|
10353
11669
|
components: e.components,
|
|
@@ -10359,13 +11675,14 @@ function Oo({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
10359
11675
|
locale: e.locale,
|
|
10360
11676
|
direction: e.direction,
|
|
10361
11677
|
settings: e.settings,
|
|
11678
|
+
param: e.param,
|
|
10362
11679
|
mode: tt(t, e.scheme),
|
|
10363
11680
|
style: n
|
|
10364
11681
|
}) : null;
|
|
10365
11682
|
}
|
|
10366
11683
|
//#endregion
|
|
10367
11684
|
//#region src/bundle.js
|
|
10368
|
-
function
|
|
11685
|
+
function rs({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
10369
11686
|
let a = {
|
|
10370
11687
|
...t?.global ?? {},
|
|
10371
11688
|
...t?.tenant ?? {}
|
|
@@ -10374,6 +11691,7 @@ function ko({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
10374
11691
|
schema: 1,
|
|
10375
11692
|
title: e.title,
|
|
10376
11693
|
slug: e.slug,
|
|
11694
|
+
param: e.param ?? "",
|
|
10377
11695
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
10378
11696
|
theme: et(o, a.builder_themes?.themes),
|
|
10379
11697
|
components: a.builder_components?.components ?? {},
|
|
@@ -10391,18 +11709,18 @@ function ko({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
10391
11709
|
}
|
|
10392
11710
|
//#endregion
|
|
10393
11711
|
//#region src/fetchPage.js
|
|
10394
|
-
var
|
|
11712
|
+
var is = async (e) => {
|
|
10395
11713
|
let t = await e.json().catch(() => null);
|
|
10396
11714
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
10397
11715
|
return t?.payload ?? t;
|
|
10398
11716
|
};
|
|
10399
|
-
async function
|
|
11717
|
+
async function as({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
10400
11718
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
10401
11719
|
if (!n) throw Error("fetchPage: slug is required");
|
|
10402
11720
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
10403
11721
|
...t ? { "x-tenant": t } : {},
|
|
10404
11722
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
10405
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
11723
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(is), c(`${l}/settings/public`, { headers: u }).then(is)]), p = rs({
|
|
10406
11724
|
page: d,
|
|
10407
11725
|
settings: f,
|
|
10408
11726
|
tenant: t,
|
|
@@ -10417,7 +11735,7 @@ async function jo({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
10417
11735
|
"LogoCarousel"
|
|
10418
11736
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
10419
11737
|
if (m.length) {
|
|
10420
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
11738
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(is).then((e) => {
|
|
10421
11739
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
10422
11740
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
10423
11741
|
}).catch(() => [[t, []]])));
|
|
@@ -10431,40 +11749,40 @@ async function jo({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
10431
11749
|
}
|
|
10432
11750
|
//#endregion
|
|
10433
11751
|
//#region src/ssr.jsx
|
|
10434
|
-
var
|
|
11752
|
+
var os = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
10435
11753
|
"&": "&",
|
|
10436
11754
|
"<": "<",
|
|
10437
11755
|
">": ">",
|
|
10438
11756
|
"\"": """
|
|
10439
11757
|
})[e]);
|
|
10440
|
-
function
|
|
10441
|
-
return e(/* @__PURE__ */ f(
|
|
11758
|
+
function ss(t, { mode: n = "auto", style: r } = {}) {
|
|
11759
|
+
return e(/* @__PURE__ */ f(ns, {
|
|
10442
11760
|
bundle: t,
|
|
10443
11761
|
mode: n,
|
|
10444
11762
|
style: r
|
|
10445
11763
|
}));
|
|
10446
11764
|
}
|
|
10447
|
-
function
|
|
11765
|
+
function cs(e, { mode: t = "auto", lang: n } = {}) {
|
|
10448
11766
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = g(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
10449
11767
|
"<meta charset=\"utf-8\"/>",
|
|
10450
11768
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
10451
|
-
`<title>${
|
|
10452
|
-
r.description && `<meta name="description" content="${
|
|
10453
|
-
`<meta property="og:title" content="${
|
|
10454
|
-
r.image && `<meta property="og:image" content="${
|
|
11769
|
+
`<title>${os(o)}</title>`,
|
|
11770
|
+
r.description && `<meta name="description" content="${os(r.description)}"/>`,
|
|
11771
|
+
`<meta property="og:title" content="${os(o)}"/>`,
|
|
11772
|
+
r.image && `<meta property="og:image" content="${os(r.image)}"/>`,
|
|
10455
11773
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
10456
11774
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
10457
11775
|
].filter(Boolean).join("\n");
|
|
10458
11776
|
return `<!doctype html>
|
|
10459
|
-
<html lang="${
|
|
11777
|
+
<html lang="${os(i)}"${a ? ` dir="${a}"` : ""}>
|
|
10460
11778
|
<head>
|
|
10461
11779
|
${c}
|
|
10462
11780
|
</head>
|
|
10463
11781
|
<body>
|
|
10464
|
-
${
|
|
11782
|
+
${ss(e, { mode: t })}
|
|
10465
11783
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
10466
11784
|
</body>
|
|
10467
11785
|
</html>`;
|
|
10468
11786
|
}
|
|
10469
11787
|
//#endregion
|
|
10470
|
-
export {
|
|
11788
|
+
export { rs as assembleBundle, as as fetchPage, ss as renderBundleHtml, cs as renderPageDocument };
|