@nok-integration/storefront-react 0.20.8 → 0.20.10
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/dist/index.d.ts +3 -0
- package/dist/index.mjs +201 -73
- package/dist/standalone/storefront.mjs +201 -73
- package/dist/standalone/styles.css +8 -4
- package/dist/styles.css +8 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5580,13 +5580,13 @@ function ShopVideo({ src, poster, fill: fill2 = false, className, style, priorit
|
|
|
5580
5580
|
});
|
|
5581
5581
|
}
|
|
5582
5582
|
const badge$5 = "_badge_1bagf_1";
|
|
5583
|
-
const neutral$
|
|
5583
|
+
const neutral$2 = "_neutral_1bagf_12";
|
|
5584
5584
|
const success$1 = "_success_1bagf_17";
|
|
5585
5585
|
const critical$2 = "_critical_1bagf_22";
|
|
5586
5586
|
const promo = "_promo_1bagf_27";
|
|
5587
5587
|
const styles$R = {
|
|
5588
5588
|
badge: badge$5,
|
|
5589
|
-
neutral: neutral$
|
|
5589
|
+
neutral: neutral$2,
|
|
5590
5590
|
success: success$1,
|
|
5591
5591
|
critical: critical$2,
|
|
5592
5592
|
promo
|
|
@@ -5713,16 +5713,21 @@ function withoutRestoration() {
|
|
|
5713
5713
|
history.scrollRestoration = previous;
|
|
5714
5714
|
};
|
|
5715
5715
|
}
|
|
5716
|
-
const RELEASES = ["
|
|
5717
|
-
function
|
|
5716
|
+
const RELEASES = ["touchmove", "wheel", "keydown", "pointerdown"];
|
|
5717
|
+
function movesThePage(event) {
|
|
5718
|
+
if (event.type === "pointerdown") return event.pointerType !== "touch";
|
|
5719
|
+
return true;
|
|
5720
|
+
}
|
|
5721
|
+
function anchorTop(onMoved = () => true) {
|
|
5718
5722
|
let released = false;
|
|
5719
5723
|
const top2 = () => {
|
|
5720
5724
|
if (released) return;
|
|
5721
5725
|
const scrolled2 = window.scrollY || document.documentElement.scrollTop || 0;
|
|
5722
|
-
if (scrolled2 > 0 &&
|
|
5726
|
+
if (scrolled2 > 0 && onMoved()) window.scrollTo(0, 0);
|
|
5723
5727
|
};
|
|
5724
|
-
const release = () => {
|
|
5728
|
+
const release = (event) => {
|
|
5725
5729
|
if (released) return;
|
|
5730
|
+
if (event && !movesThePage(event)) return;
|
|
5726
5731
|
released = true;
|
|
5727
5732
|
if (frame2 !== null && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame2);
|
|
5728
5733
|
clearTimeout(timer2);
|
|
@@ -5738,7 +5743,23 @@ function anchorTop(shouldHold = () => true) {
|
|
|
5738
5743
|
for (const type of RELEASES) window.addEventListener(type, release, {
|
|
5739
5744
|
passive: true
|
|
5740
5745
|
});
|
|
5741
|
-
return release;
|
|
5746
|
+
return () => release();
|
|
5747
|
+
}
|
|
5748
|
+
function onReveal(el, revealed) {
|
|
5749
|
+
if (typeof IntersectionObserver === "undefined") return () => {
|
|
5750
|
+
};
|
|
5751
|
+
let seen = false;
|
|
5752
|
+
let visible = true;
|
|
5753
|
+
const observer = new IntersectionObserver((entries) => {
|
|
5754
|
+
const entry = entries[entries.length - 1];
|
|
5755
|
+
if (!entry) return;
|
|
5756
|
+
const now = entry.isIntersecting;
|
|
5757
|
+
if (seen && now && !visible) revealed();
|
|
5758
|
+
seen = true;
|
|
5759
|
+
visible = now;
|
|
5760
|
+
});
|
|
5761
|
+
observer.observe(el);
|
|
5762
|
+
return () => observer.disconnect();
|
|
5742
5763
|
}
|
|
5743
5764
|
const useMountEffect$1 = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
5744
5765
|
function documentTop(el) {
|
|
@@ -5756,8 +5777,13 @@ function useScreenAnchor(ref, enabled = true) {
|
|
|
5756
5777
|
const el = ref.current;
|
|
5757
5778
|
if (!el || !enabled) return;
|
|
5758
5779
|
const restore = withoutRestoration();
|
|
5759
|
-
|
|
5780
|
+
let release = anchorTop(() => beginsOnTheFirstViewport(el));
|
|
5781
|
+
const unobserve = onReveal(el, () => {
|
|
5782
|
+
release();
|
|
5783
|
+
release = anchorTop(() => beginsOnTheFirstViewport(el));
|
|
5784
|
+
});
|
|
5760
5785
|
return () => {
|
|
5786
|
+
unobserve();
|
|
5761
5787
|
release();
|
|
5762
5788
|
restore();
|
|
5763
5789
|
};
|
|
@@ -5972,11 +5998,62 @@ const ES = {
|
|
|
5972
5998
|
Refunded: "Reembolsado",
|
|
5973
5999
|
"In progress": "En curso",
|
|
5974
6000
|
Return: "Devolución",
|
|
5975
|
-
|
|
6001
|
+
Reported: "Notificada",
|
|
5976
6002
|
Received: "Recibida",
|
|
5977
6003
|
Completed: "Completada",
|
|
5978
6004
|
item: "artículo",
|
|
5979
|
-
items: "artículos"
|
|
6005
|
+
items: "artículos",
|
|
6006
|
+
"(opens in a new tab)": "(se abre en nueva pestaña)",
|
|
6007
|
+
"Arrived too late": "Llegó demasiado tarde",
|
|
6008
|
+
"Cancel order": "Cancelar pedido",
|
|
6009
|
+
"Changed my mind": "Cambié de opinión",
|
|
6010
|
+
"Contact support": "Contactar atención al cliente",
|
|
6011
|
+
"Delivery takes too long": "Demora en la entrega",
|
|
6012
|
+
Discount: "Descuento",
|
|
6013
|
+
Done: "Listo",
|
|
6014
|
+
"Download return label": "Descargar etiqueta de devolución",
|
|
6015
|
+
"Download your return label": "Descargar tu etiqueta de devolución",
|
|
6016
|
+
"Drop it off at your local carrier or post office.": "Entréguelo en su transportista local o oficina de correos.",
|
|
6017
|
+
"Every item on this order has already been returned or cancelled.": "Todos los artículos de este pedido ya han sido devueltos o cancelados.",
|
|
6018
|
+
Fabric: "Tela",
|
|
6019
|
+
"Follow the instructions below to complete your return": "Siga las instrucciones a continuación para completar su devolución",
|
|
6020
|
+
"How to measure": "Cómo medir",
|
|
6021
|
+
"Item doesn't match description": "El artículo no coincide con la descripción",
|
|
6022
|
+
"Item is damaged": "El artículo está dañado",
|
|
6023
|
+
"Measurement unit": "Unidad de medida",
|
|
6024
|
+
"Need help?": "¿Necesita ayuda?",
|
|
6025
|
+
"Nothing left to return": "No queda nada por devolver",
|
|
6026
|
+
"Order #{0} · Placed {1}": "Pedido n.º {0} · Realizado el {1}",
|
|
6027
|
+
"Order cancelled": "Pedido cancelado",
|
|
6028
|
+
"Order confirmation": "Confirmación del pedido",
|
|
6029
|
+
"Ordered by mistake": "Pedido por error",
|
|
6030
|
+
"Pack and ship the item": "Empaque y envíe el artículo",
|
|
6031
|
+
"Reason for cancelling": "Motivo de la cancelación",
|
|
6032
|
+
"Reason for return": "Motivo de la devolución",
|
|
6033
|
+
Reorder: "Volver a pedir",
|
|
6034
|
+
"Repackage the item securely and attach the return label to the outside of the package.": "Vuelva a empaquetar el artículo de forma segura y pegue la etiqueta de devolución en el exterior del paquete.",
|
|
6035
|
+
"Request not found": "Solicitud no encontrada",
|
|
6036
|
+
"Return #{0} · Reported {1}": "Devolución n.º {0} · Notificada el {1}",
|
|
6037
|
+
"Return in progress": "Devolución en curso",
|
|
6038
|
+
"Return selected items": "Devolver artículos seleccionados",
|
|
6039
|
+
"Select items you want to return": "Seleccione los artículos que desea devolver",
|
|
6040
|
+
"Size guide unavailable": "Guía de tallas no disponible",
|
|
6041
|
+
"Size: {0}": "Talla: {0}",
|
|
6042
|
+
"Start a return": "Iniciar una devolución",
|
|
6043
|
+
"Tap the button below to download your pre-paid return label": "Toque el botón de abajo para descargar su etiqueta de devolución prepagada",
|
|
6044
|
+
"Too large": "Demasiado grande",
|
|
6045
|
+
"Too small": "Demasiado pequeño",
|
|
6046
|
+
Track: "Seguir envío",
|
|
6047
|
+
"We could not find that support request.": "No pudimos encontrar esa solicitud de ayuda.",
|
|
6048
|
+
"We could not load the size guide for this item.": "No pudimos cargar la guía de tallas de este artículo.",
|
|
6049
|
+
"We’ve generated your return label": "Hemos generado su etiqueta de devolución",
|
|
6050
|
+
"We’ve sent a confirmation to {0}": "Hemos enviado una confirmación a {0}",
|
|
6051
|
+
"What do you want to return?": "¿Qué desea devolver?",
|
|
6052
|
+
"Your order is confirmed": "Su pedido está confirmado",
|
|
6053
|
+
"You’ll receive a shipping label PDF to your email as well.": "Recibirá un PDF de la etiqueta de envío en su correo electrónico.",
|
|
6054
|
+
"{0} photographs": "{0} fotografías",
|
|
6055
|
+
"{0}, opens in a new tab": "{0}, se abre en una pestaña nueva",
|
|
6056
|
+
"Zip Ups": "Sudaderas con cremalleras"
|
|
5980
6057
|
};
|
|
5981
6058
|
const CATALOGUES = {
|
|
5982
6059
|
es: ES
|
|
@@ -6251,7 +6328,7 @@ const toast = "_toast_oz4st_82";
|
|
|
6251
6328
|
const text$4 = "_text_oz4st_111";
|
|
6252
6329
|
const message$1 = "_message_oz4st_120";
|
|
6253
6330
|
const action = "_action_oz4st_133";
|
|
6254
|
-
const neutral = "_neutral_oz4st_158";
|
|
6331
|
+
const neutral$1 = "_neutral_oz4st_158";
|
|
6255
6332
|
const success = "_success_oz4st_163";
|
|
6256
6333
|
const critical$1 = "_critical_oz4st_168";
|
|
6257
6334
|
const rich = "_rich_oz4st_183";
|
|
@@ -6266,7 +6343,7 @@ const styles$K = {
|
|
|
6266
6343
|
text: text$4,
|
|
6267
6344
|
message: message$1,
|
|
6268
6345
|
action,
|
|
6269
|
-
neutral,
|
|
6346
|
+
neutral: neutral$1,
|
|
6270
6347
|
success,
|
|
6271
6348
|
critical: critical$1,
|
|
6272
6349
|
rich,
|
|
@@ -6482,6 +6559,7 @@ const styles$I = {
|
|
|
6482
6559
|
};
|
|
6483
6560
|
function PriceBlock({ price: price2, compareAt: compareAt2, discountPct: discountPct$1, size = "md", variant = "strikethrough", align = "baseline" }) {
|
|
6484
6561
|
const { format } = useMoney();
|
|
6562
|
+
const t = useT();
|
|
6485
6563
|
const pct = discountPct$1 ?? discountPct(price2, compareAt2);
|
|
6486
6564
|
const hasCompare = compareAt2 && compareAt2.amount > price2.amount;
|
|
6487
6565
|
return jsxs("div", {
|
|
@@ -6493,7 +6571,7 @@ function PriceBlock({ price: price2, compareAt: compareAt2, discountPct: discoun
|
|
|
6493
6571
|
className: styles$I.compareAt,
|
|
6494
6572
|
children: [jsx("span", {
|
|
6495
6573
|
className: "visually-hidden",
|
|
6496
|
-
children:
|
|
6574
|
+
children: t("Was {0}", format(compareAt2))
|
|
6497
6575
|
}), jsx("span", {
|
|
6498
6576
|
"aria-hidden": "true",
|
|
6499
6577
|
children: format(compareAt2)
|
|
@@ -6891,7 +6969,7 @@ function OrderLine({ item: item2 }) {
|
|
|
6891
6969
|
className: styles$F.was,
|
|
6892
6970
|
children: [jsx("span", {
|
|
6893
6971
|
className: "visually-hidden",
|
|
6894
|
-
children:
|
|
6972
|
+
children: t("Was {0}", format(compareAt2))
|
|
6895
6973
|
}), jsx("span", {
|
|
6896
6974
|
"aria-hidden": "true",
|
|
6897
6975
|
children: format(compareAt2)
|
|
@@ -6955,7 +7033,7 @@ function OrderSummaryCard({ order }) {
|
|
|
6955
7033
|
"aria-label": t("Order summary"),
|
|
6956
7034
|
children: [jsx("h2", {
|
|
6957
7035
|
className: styles$F.cardTitle,
|
|
6958
|
-
children: "Order summary"
|
|
7036
|
+
children: t("Order summary")
|
|
6959
7037
|
}), jsx(OrderSummary, {
|
|
6960
7038
|
pricing: toPricing(order),
|
|
6961
7039
|
rows: rowsFor(order),
|
|
@@ -7106,6 +7184,7 @@ const styles$D = {
|
|
|
7106
7184
|
function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: selected2, onConfirm, onClose, closeLabel, busy = false, error: error2 }) {
|
|
7107
7185
|
const sheetRef = useRef(null);
|
|
7108
7186
|
const [choice, setChoice] = useState(selected2);
|
|
7187
|
+
const t = useT();
|
|
7109
7188
|
useModalDialog(true, onClose, sheetRef);
|
|
7110
7189
|
return jsx("div", {
|
|
7111
7190
|
className: styles$D.scrim,
|
|
@@ -7126,7 +7205,7 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
|
|
|
7126
7205
|
children: [jsx("h2", {
|
|
7127
7206
|
id: "reason-sheet-title",
|
|
7128
7207
|
className: styles$D.title,
|
|
7129
|
-
children: title2
|
|
7208
|
+
children: t(title2)
|
|
7130
7209
|
}), jsx("div", {
|
|
7131
7210
|
className: styles$D.options,
|
|
7132
7211
|
role: "radiogroup",
|
|
@@ -7160,7 +7239,7 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
|
|
|
7160
7239
|
})
|
|
7161
7240
|
}), jsx("span", {
|
|
7162
7241
|
className: styles$D.label,
|
|
7163
|
-
children: o.label
|
|
7242
|
+
children: t(o.label)
|
|
7164
7243
|
})]
|
|
7165
7244
|
}, o.value))
|
|
7166
7245
|
})]
|
|
@@ -7176,7 +7255,7 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
|
|
|
7176
7255
|
disabled: !choice,
|
|
7177
7256
|
loading: busy,
|
|
7178
7257
|
onClick: () => choice && onConfirm(choice),
|
|
7179
|
-
children: ctaLabel
|
|
7258
|
+
children: t(ctaLabel)
|
|
7180
7259
|
})]
|
|
7181
7260
|
})]
|
|
7182
7261
|
})
|
|
@@ -7206,6 +7285,7 @@ const styles$C = {
|
|
|
7206
7285
|
};
|
|
7207
7286
|
function ReturnItemRow({ item: item2, className }) {
|
|
7208
7287
|
const { format } = useMoney();
|
|
7288
|
+
const t = useT();
|
|
7209
7289
|
return jsxs("div", {
|
|
7210
7290
|
className: [styles$C.line, className ?? ""].join(" ").trim(),
|
|
7211
7291
|
children: [jsx("div", {
|
|
@@ -7227,7 +7307,7 @@ function ReturnItemRow({ item: item2, className }) {
|
|
|
7227
7307
|
children: item2.title ?? item2.sku
|
|
7228
7308
|
}), item2.attributes?.size && jsx("p", {
|
|
7229
7309
|
className: styles$C.attrs,
|
|
7230
|
-
children:
|
|
7310
|
+
children: t("Size: {0}", item2.attributes.size)
|
|
7231
7311
|
})]
|
|
7232
7312
|
}), jsxs("div", {
|
|
7233
7313
|
className: styles$C.price,
|
|
@@ -7238,7 +7318,7 @@ function ReturnItemRow({ item: item2, className }) {
|
|
|
7238
7318
|
className: styles$C.was,
|
|
7239
7319
|
children: [jsx("span", {
|
|
7240
7320
|
className: "visually-hidden",
|
|
7241
|
-
children:
|
|
7321
|
+
children: t("Was {0}", format(item2.compare_at_unit_price))
|
|
7242
7322
|
}), jsx("span", {
|
|
7243
7323
|
"aria-hidden": "true",
|
|
7244
7324
|
children: format(item2.compare_at_unit_price)
|
|
@@ -7334,6 +7414,7 @@ function unitsLeft(item2) {
|
|
|
7334
7414
|
function ReturnItemsView({ order, onSubmit, busy = false }) {
|
|
7335
7415
|
const [chosen, setChosen] = useState({});
|
|
7336
7416
|
const [reasonFor, setReasonFor] = useState(null);
|
|
7417
|
+
const t = useT();
|
|
7337
7418
|
const returnable = useMemo(() => order.items.filter((i) => unitsLeft(i) > 0), [order.items]);
|
|
7338
7419
|
const selected2 = Object.entries(chosen).filter(([, reason2]) => reason2 !== void 0);
|
|
7339
7420
|
const canSubmit = selected2.length > 0;
|
|
@@ -7372,10 +7453,10 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
|
|
|
7372
7453
|
className: styles$B.titles,
|
|
7373
7454
|
children: [jsx("h1", {
|
|
7374
7455
|
className: styles$B.title,
|
|
7375
|
-
children: "Nothing left to return"
|
|
7456
|
+
children: t("Nothing left to return")
|
|
7376
7457
|
}), jsx("p", {
|
|
7377
7458
|
className: styles$B.subtitle,
|
|
7378
|
-
children: "Every item on this order has already been returned or cancelled."
|
|
7459
|
+
children: t("Every item on this order has already been returned or cancelled.")
|
|
7379
7460
|
})]
|
|
7380
7461
|
})
|
|
7381
7462
|
});
|
|
@@ -7386,10 +7467,10 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
|
|
|
7386
7467
|
className: styles$B.titles,
|
|
7387
7468
|
children: [jsx("h1", {
|
|
7388
7469
|
className: styles$B.title,
|
|
7389
|
-
children: "What do you want to return?"
|
|
7470
|
+
children: t("What do you want to return?")
|
|
7390
7471
|
}), jsx("p", {
|
|
7391
7472
|
className: styles$B.subtitle,
|
|
7392
|
-
children: "Select items you want to return"
|
|
7473
|
+
children: t("Select items you want to return")
|
|
7393
7474
|
})]
|
|
7394
7475
|
}), jsx("div", {
|
|
7395
7476
|
className: styles$B.list,
|
|
@@ -7419,7 +7500,7 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
|
|
|
7419
7500
|
onClick: () => setReasonFor(item2.line_ref),
|
|
7420
7501
|
"aria-haspopup": "dialog",
|
|
7421
7502
|
children: [jsx("span", {
|
|
7422
|
-
children: reason2 ? REASON_LABEL.get(reason2) : "Select reason"
|
|
7503
|
+
children: t(reason2 ? REASON_LABEL.get(reason2) ?? reason2 : "Select reason")
|
|
7423
7504
|
}), jsx(Chevron$1, {})]
|
|
7424
7505
|
})]
|
|
7425
7506
|
})]
|
|
@@ -7431,7 +7512,7 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
|
|
|
7431
7512
|
disabled: !canSubmit,
|
|
7432
7513
|
loading: busy,
|
|
7433
7514
|
onClick: submit,
|
|
7434
|
-
children: "Return selected items"
|
|
7515
|
+
children: t("Return selected items")
|
|
7435
7516
|
}), reasonFor && jsx(ReasonSheet, {
|
|
7436
7517
|
title: "Reason for return",
|
|
7437
7518
|
options: RETURN_REASONS,
|
|
@@ -7486,6 +7567,7 @@ const styles$A = {
|
|
|
7486
7567
|
note: note$1
|
|
7487
7568
|
};
|
|
7488
7569
|
function ReturnLabelView({ ret, onDone }) {
|
|
7570
|
+
const t = useT();
|
|
7489
7571
|
return jsxs("div", {
|
|
7490
7572
|
className: styles$A.page,
|
|
7491
7573
|
children: [jsxs("div", {
|
|
@@ -7499,10 +7581,10 @@ function ReturnLabelView({ ret, onDone }) {
|
|
|
7499
7581
|
className: styles$A.intro,
|
|
7500
7582
|
children: [jsx("h1", {
|
|
7501
7583
|
className: styles$A.title,
|
|
7502
|
-
children: "We’ve generated your return label"
|
|
7584
|
+
children: t("We’ve generated your return label")
|
|
7503
7585
|
}), jsx("p", {
|
|
7504
7586
|
className: styles$A.subtitle,
|
|
7505
|
-
children: "Follow the instructions below to complete your return"
|
|
7587
|
+
children: t("Follow the instructions below to complete your return")
|
|
7506
7588
|
})]
|
|
7507
7589
|
}), jsxs("div", {
|
|
7508
7590
|
className: styles$A.card,
|
|
@@ -7516,23 +7598,23 @@ function ReturnLabelView({ ret, onDone }) {
|
|
|
7516
7598
|
children: "1"
|
|
7517
7599
|
}), jsx("h2", {
|
|
7518
7600
|
className: styles$A.stepTitle,
|
|
7519
|
-
children: "Download your return label"
|
|
7601
|
+
children: t("Download your return label")
|
|
7520
7602
|
})]
|
|
7521
7603
|
}), jsx("p", {
|
|
7522
7604
|
className: styles$A.body,
|
|
7523
|
-
children: "Tap the button below to download your pre-paid return label"
|
|
7605
|
+
children: t("Tap the button below to download your pre-paid return label")
|
|
7524
7606
|
}), ret.label_url && jsxs("a", {
|
|
7525
7607
|
className: styles$A.download,
|
|
7526
7608
|
href: ret.label_url,
|
|
7527
7609
|
target: "_blank",
|
|
7528
7610
|
rel: "noopener noreferrer",
|
|
7529
|
-
children: ["Download return label", jsx("span", {
|
|
7611
|
+
children: [t("Download return label"), jsx("span", {
|
|
7530
7612
|
className: "visually-hidden",
|
|
7531
|
-
children:
|
|
7613
|
+
children: ` ${t("(opens in a new tab)")}`
|
|
7532
7614
|
})]
|
|
7533
7615
|
}), ret.label_email && jsxs("p", {
|
|
7534
7616
|
className: styles$A.note,
|
|
7535
|
-
children: ["You’ll receive a shipping label PDF to your email as well.", jsx("br", {}), ret.label_email]
|
|
7617
|
+
children: [t("You’ll receive a shipping label PDF to your email as well."), jsx("br", {}), ret.label_email]
|
|
7536
7618
|
})]
|
|
7537
7619
|
}), jsxs("section", {
|
|
7538
7620
|
className: styles$A.step2,
|
|
@@ -7544,11 +7626,11 @@ function ReturnLabelView({ ret, onDone }) {
|
|
|
7544
7626
|
children: "2"
|
|
7545
7627
|
}), jsx("h2", {
|
|
7546
7628
|
className: styles$A.stepTitle,
|
|
7547
|
-
children: "Pack and ship the item"
|
|
7629
|
+
children: t("Pack and ship the item")
|
|
7548
7630
|
})]
|
|
7549
7631
|
}), jsxs("p", {
|
|
7550
7632
|
className: styles$A.body2,
|
|
7551
|
-
children: ["Repackage the item securely and attach the return label to the outside of the package.", jsx("br", {}), "Drop it off at your local carrier or post office."]
|
|
7633
|
+
children: [t("Repackage the item securely and attach the return label to the outside of the package."), jsx("br", {}), t("Drop it off at your local carrier or post office.")]
|
|
7552
7634
|
})]
|
|
7553
7635
|
})]
|
|
7554
7636
|
})]
|
|
@@ -7556,7 +7638,7 @@ function ReturnLabelView({ ret, onDone }) {
|
|
|
7556
7638
|
variant: "primary",
|
|
7557
7639
|
fullWidth: true,
|
|
7558
7640
|
onClick: onDone,
|
|
7559
|
-
children: "Done"
|
|
7641
|
+
children: t("Done")
|
|
7560
7642
|
})]
|
|
7561
7643
|
});
|
|
7562
7644
|
}
|
|
@@ -7598,6 +7680,7 @@ function pctOff(item2) {
|
|
|
7598
7680
|
function ReturnTrackingView({ ret, locale: localeProp }) {
|
|
7599
7681
|
const locale = useLocale(localeProp);
|
|
7600
7682
|
const { format } = useMoney();
|
|
7683
|
+
const t = useT();
|
|
7601
7684
|
const reported = new Date(ret.reported_at).toLocaleDateString(locale, {
|
|
7602
7685
|
day: "numeric",
|
|
7603
7686
|
month: "short",
|
|
@@ -7613,10 +7696,10 @@ function ReturnTrackingView({ ret, locale: localeProp }) {
|
|
|
7613
7696
|
className: styles$z.titles,
|
|
7614
7697
|
children: [jsx("h1", {
|
|
7615
7698
|
className: styles$z.title,
|
|
7616
|
-
children: "Return in progress"
|
|
7699
|
+
children: t("Return in progress")
|
|
7617
7700
|
}), jsx("p", {
|
|
7618
7701
|
className: styles$z.subtitle,
|
|
7619
|
-
children:
|
|
7702
|
+
children: t("Return #{0} · Reported {1}", ret.return_ref, reported)
|
|
7620
7703
|
})]
|
|
7621
7704
|
}), jsx(OrderTimeline, {
|
|
7622
7705
|
progress: ret.progress,
|
|
@@ -7645,7 +7728,7 @@ function ReturnTrackingView({ ret, locale: localeProp }) {
|
|
|
7645
7728
|
}), (item2.attributes?.size || pctOff(item2)) && jsxs("p", {
|
|
7646
7729
|
className: styles$z.attrs,
|
|
7647
7730
|
children: [item2.attributes?.size && jsx("span", {
|
|
7648
|
-
children:
|
|
7731
|
+
children: t("Size: {0}", item2.attributes.size)
|
|
7649
7732
|
}), pctOff(item2) !== void 0 && jsx(SaleBadge, {
|
|
7650
7733
|
pct: pctOff(item2)
|
|
7651
7734
|
})]
|
|
@@ -7971,17 +8054,17 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
7971
8054
|
className: styles$y.cancelledHead,
|
|
7972
8055
|
children: [jsx("h1", {
|
|
7973
8056
|
className: styles$y.cancelledTitle,
|
|
7974
|
-
children: "Order cancelled"
|
|
8057
|
+
children: t("Order cancelled")
|
|
7975
8058
|
}), jsx("p", {
|
|
7976
8059
|
className: styles$y.cancelledMeta,
|
|
7977
|
-
children:
|
|
8060
|
+
children: t("Order #{0} · Placed {1}", shortRef$1(order.order_ref), placedOn(order.placed_at, locale))
|
|
7978
8061
|
})]
|
|
7979
8062
|
}), jsx(Button, {
|
|
7980
8063
|
variant: "primary",
|
|
7981
8064
|
fullWidth: true,
|
|
7982
8065
|
loading: reordering,
|
|
7983
8066
|
onClick: () => void reorder(order),
|
|
7984
|
-
children: "Reorder"
|
|
8067
|
+
children: t("Reorder")
|
|
7985
8068
|
}), jsx(OrderItemsCard, {
|
|
7986
8069
|
order
|
|
7987
8070
|
}), jsx(ShippingAddressCard, {
|
|
@@ -8000,15 +8083,15 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8000
8083
|
className: styles$y.titleRow,
|
|
8001
8084
|
children: [jsx("h1", {
|
|
8002
8085
|
className: styles$y.headline,
|
|
8003
|
-
children:
|
|
8086
|
+
children: t("Order #{0}", shortRef$1(order.order_ref))
|
|
8004
8087
|
}), order.tracking?.url && inTransit && jsxs("a", {
|
|
8005
8088
|
className: styles$y.track,
|
|
8006
8089
|
href: order.tracking.url,
|
|
8007
8090
|
target: "_blank",
|
|
8008
8091
|
rel: "noopener noreferrer",
|
|
8009
|
-
children: ["Track", jsx("span", {
|
|
8092
|
+
children: [t("Track"), jsx("span", {
|
|
8010
8093
|
className: "visually-hidden",
|
|
8011
|
-
children: ` ${
|
|
8094
|
+
children: ` ${t("{0}, opens in a new tab", order.tracking.carrier)}`
|
|
8012
8095
|
}), jsx(RedirectLink, {})]
|
|
8013
8096
|
})]
|
|
8014
8097
|
}), jsx(OrderTimeline, {
|
|
@@ -8030,7 +8113,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8030
8113
|
type: "button",
|
|
8031
8114
|
className: styles$y.cancel,
|
|
8032
8115
|
onClick: () => setCancelOpen(true),
|
|
8033
|
-
children: "Cancel order"
|
|
8116
|
+
children: t("Cancel order")
|
|
8034
8117
|
}), jsx(NeedHelp, {
|
|
8035
8118
|
order,
|
|
8036
8119
|
...onStartReturn ? {
|
|
@@ -8077,6 +8160,7 @@ function placedOn(iso, locale) {
|
|
|
8077
8160
|
}
|
|
8078
8161
|
function NeedHelp({ order, onStartReturn, onOpenReturn, onContactSupport }) {
|
|
8079
8162
|
const emit = useShopEvent();
|
|
8163
|
+
const t = useT();
|
|
8080
8164
|
if (order.status !== "delivered") return null;
|
|
8081
8165
|
const returns = order.returns ?? [];
|
|
8082
8166
|
return jsxs("section", {
|
|
@@ -8085,11 +8169,11 @@ function NeedHelp({ order, onStartReturn, onOpenReturn, onContactSupport }) {
|
|
|
8085
8169
|
children: [jsx("h2", {
|
|
8086
8170
|
className: styles$y.helpTitle,
|
|
8087
8171
|
id: "order-help",
|
|
8088
|
-
children: "Need help?"
|
|
8172
|
+
children: t("Need help?")
|
|
8089
8173
|
}), jsxs("div", {
|
|
8090
8174
|
className: styles$y.helpRows,
|
|
8091
8175
|
children: [returns.map((ret) => jsx(HelpRow, {
|
|
8092
|
-
label: returns.length > 1 ?
|
|
8176
|
+
label: returns.length > 1 ? t("Track return {0}", ret.return_ref) : "Track your return",
|
|
8093
8177
|
status: RETURN_STATUS[ret.status] ?? ret.status.replace(/_/g, " "),
|
|
8094
8178
|
onClick: () => onOpenReturn?.(ret.return_ref)
|
|
8095
8179
|
}, ret.return_ref)), order.can_return && onStartReturn && jsx(HelpRow, {
|
|
@@ -8120,7 +8204,7 @@ function HelpRow({ label: label2, status, onClick }) {
|
|
|
8120
8204
|
className: styles$y.helpRow,
|
|
8121
8205
|
onClick,
|
|
8122
8206
|
children: [jsx("span", {
|
|
8123
|
-
children: label2
|
|
8207
|
+
children: t(label2)
|
|
8124
8208
|
}), jsxs("span", {
|
|
8125
8209
|
className: styles$y.helpRowEnd,
|
|
8126
8210
|
children: [status && jsx("span", {
|
|
@@ -8173,6 +8257,7 @@ function confirmationProgress(progress2) {
|
|
|
8173
8257
|
});
|
|
8174
8258
|
}
|
|
8175
8259
|
function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
|
|
8260
|
+
const t = useT();
|
|
8176
8261
|
const { api } = useShop();
|
|
8177
8262
|
const locale = useLocale(localeProp);
|
|
8178
8263
|
const [order, setOrder] = useState(null);
|
|
@@ -8219,15 +8304,15 @@ function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
|
|
|
8219
8304
|
className: styles$x.page,
|
|
8220
8305
|
children: [jsxs("section", {
|
|
8221
8306
|
className: styles$x.confirmed,
|
|
8222
|
-
"aria-label": "Order confirmation",
|
|
8307
|
+
"aria-label": t("Order confirmation"),
|
|
8223
8308
|
children: [jsxs("div", {
|
|
8224
8309
|
className: styles$x.title,
|
|
8225
8310
|
children: [jsx("h1", {
|
|
8226
8311
|
className: styles$x.headline,
|
|
8227
|
-
children: "Your order is confirmed"
|
|
8312
|
+
children: t("Your order is confirmed")
|
|
8228
8313
|
}), order.email && jsx("p", {
|
|
8229
8314
|
className: styles$x.subtitle,
|
|
8230
|
-
children:
|
|
8315
|
+
children: t("We’ve sent a confirmation to {0}", order.email)
|
|
8231
8316
|
})]
|
|
8232
8317
|
}), jsx(OrderTimeline, {
|
|
8233
8318
|
progress: confirmationProgress(order.progress),
|
|
@@ -8249,18 +8334,20 @@ function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
|
|
|
8249
8334
|
fullWidth: true,
|
|
8250
8335
|
className: styles$x.done,
|
|
8251
8336
|
onClick: onDone,
|
|
8252
|
-
children: "Done"
|
|
8337
|
+
children: t("Done")
|
|
8253
8338
|
})]
|
|
8254
8339
|
});
|
|
8255
8340
|
}
|
|
8256
|
-
const badge$2 = "
|
|
8257
|
-
const progress = "
|
|
8258
|
-
const delivered = "
|
|
8259
|
-
const
|
|
8341
|
+
const badge$2 = "_badge_u46qd_6";
|
|
8342
|
+
const progress = "_progress_u46qd_22";
|
|
8343
|
+
const delivered = "_delivered_u46qd_27";
|
|
8344
|
+
const neutral = "_neutral_u46qd_34";
|
|
8345
|
+
const critical = "_critical_u46qd_43";
|
|
8260
8346
|
const styles$w = {
|
|
8261
8347
|
badge: badge$2,
|
|
8262
8348
|
progress,
|
|
8263
8349
|
delivered,
|
|
8350
|
+
neutral,
|
|
8264
8351
|
critical
|
|
8265
8352
|
};
|
|
8266
8353
|
const LABEL = {
|
|
@@ -8280,26 +8367,26 @@ const TONE = {
|
|
|
8280
8367
|
function OrderStatusBadge({ status }) {
|
|
8281
8368
|
const t = useT();
|
|
8282
8369
|
const label2 = LABEL[status] ?? status.replace(/_/g, " ");
|
|
8283
|
-
const tone = TONE[status] ?? "
|
|
8370
|
+
const tone = TONE[status] ?? "neutral";
|
|
8284
8371
|
return jsx("span", {
|
|
8285
8372
|
className: [styles$w.badge, styles$w[tone]].join(" "),
|
|
8286
8373
|
children: t(label2)
|
|
8287
8374
|
});
|
|
8288
8375
|
}
|
|
8289
8376
|
const RETURN_LABEL = {
|
|
8290
|
-
reported: "
|
|
8377
|
+
reported: "Reported",
|
|
8291
8378
|
package_received: "Received",
|
|
8292
8379
|
completed: "Completed"
|
|
8293
8380
|
};
|
|
8294
8381
|
const RETURN_TONE = {
|
|
8295
|
-
reported: "
|
|
8296
|
-
package_received: "
|
|
8297
|
-
completed: "
|
|
8382
|
+
reported: "neutral",
|
|
8383
|
+
package_received: "neutral",
|
|
8384
|
+
completed: "neutral"
|
|
8298
8385
|
};
|
|
8299
8386
|
function ReturnStatusBadge({ status }) {
|
|
8300
8387
|
const t = useT();
|
|
8301
8388
|
const label2 = RETURN_LABEL[status] ?? status.replace(/_/g, " ");
|
|
8302
|
-
const tone = RETURN_TONE[status] ?? "
|
|
8389
|
+
const tone = RETURN_TONE[status] ?? "neutral";
|
|
8303
8390
|
return jsx("span", {
|
|
8304
8391
|
className: [styles$w.badge, styles$w[tone]].join(" "),
|
|
8305
8392
|
children: t(label2)
|
|
@@ -8777,6 +8864,7 @@ const styles$s = {
|
|
|
8777
8864
|
};
|
|
8778
8865
|
function ProductGallery({ title: title2, product }) {
|
|
8779
8866
|
const { format } = useMoney();
|
|
8867
|
+
const t = useT();
|
|
8780
8868
|
const pct = product.compare_at ? discountPct(product.price, product.compare_at) : void 0;
|
|
8781
8869
|
const inStock = product.variants.some((v) => v.in_stock);
|
|
8782
8870
|
const images = product.media.length > 0 ? product.media : [void 0];
|
|
@@ -8792,7 +8880,7 @@ function ProductGallery({ title: title2, product }) {
|
|
|
8792
8880
|
className: styles$s.link,
|
|
8793
8881
|
children: [jsx("ul", {
|
|
8794
8882
|
className: styles$s.track,
|
|
8795
|
-
"aria-label":
|
|
8883
|
+
"aria-label": t("{0} photographs", product.title),
|
|
8796
8884
|
children: images.map((src, i) => jsxs("li", {
|
|
8797
8885
|
className: styles$s.frame,
|
|
8798
8886
|
children: [src ? jsx(ShopImage, {
|
|
@@ -8831,7 +8919,7 @@ function ProductGallery({ title: title2, product }) {
|
|
|
8831
8919
|
className: styles$s.was,
|
|
8832
8920
|
children: [jsx("span", {
|
|
8833
8921
|
className: "visually-hidden",
|
|
8834
|
-
children:
|
|
8922
|
+
children: t("Was {0}", format(product.compare_at))
|
|
8835
8923
|
}), jsx("span", {
|
|
8836
8924
|
"aria-hidden": "true",
|
|
8837
8925
|
children: format(product.compare_at)
|
|
@@ -9944,7 +10032,7 @@ function SizeGuideSheet({ guide, onClose }) {
|
|
|
9944
10032
|
}), hasTable && authored && unit2 && jsx("div", {
|
|
9945
10033
|
className: styles$h.units,
|
|
9946
10034
|
role: "radiogroup",
|
|
9947
|
-
"aria-label": "Measurement unit",
|
|
10035
|
+
"aria-label": t("Measurement unit"),
|
|
9948
10036
|
children: [authored, otherUnit(authored)].map((u) => jsx("button", {
|
|
9949
10037
|
type: "button",
|
|
9950
10038
|
role: "radio",
|
|
@@ -9988,7 +10076,7 @@ function SizeGuideSheet({ guide, onClose }) {
|
|
|
9988
10076
|
children: [jsx("h3", {
|
|
9989
10077
|
id: "size-guide-how",
|
|
9990
10078
|
className: styles$h.howTitle,
|
|
9991
|
-
children: "How to measure"
|
|
10079
|
+
children: t("How to measure")
|
|
9992
10080
|
}), jsx("dl", {
|
|
9993
10081
|
className: styles$h.howList,
|
|
9994
10082
|
children: measurements.map((m) => jsxs("div", {
|
|
@@ -10006,7 +10094,7 @@ function SizeGuideSheet({ guide, onClose }) {
|
|
|
10006
10094
|
className: styles$h.fabric,
|
|
10007
10095
|
children: [jsx("p", {
|
|
10008
10096
|
className: styles$h.fabricLabel,
|
|
10009
|
-
children: "Fabric"
|
|
10097
|
+
children: t("Fabric")
|
|
10010
10098
|
}), jsx("p", {
|
|
10011
10099
|
className: styles$h.fabricText,
|
|
10012
10100
|
children: guide.fabric
|
|
@@ -11289,24 +11377,64 @@ function useDocumentSnap(ref, enabled = true) {
|
|
|
11289
11377
|
const root2 = document.documentElement;
|
|
11290
11378
|
const previousType = root2.style.scrollSnapType;
|
|
11291
11379
|
const previousPadding = root2.style.scrollPaddingTop;
|
|
11292
|
-
root2.style.scrollSnapType = "y mandatory";
|
|
11293
11380
|
root2.style.scrollPaddingTop = "0px";
|
|
11381
|
+
let snapping = false;
|
|
11382
|
+
let awaitingTouch = false;
|
|
11383
|
+
const snapOn = () => {
|
|
11384
|
+
root2.style.scrollSnapType = "y mandatory";
|
|
11385
|
+
snapping = true;
|
|
11386
|
+
};
|
|
11387
|
+
const snapOff = () => {
|
|
11388
|
+
root2.style.scrollSnapType = "none";
|
|
11389
|
+
snapping = false;
|
|
11390
|
+
};
|
|
11391
|
+
const snapOnAtTouch = () => {
|
|
11392
|
+
if (awaitingTouch) return;
|
|
11393
|
+
awaitingTouch = true;
|
|
11394
|
+
window.addEventListener("touchstart", snapOn, {
|
|
11395
|
+
once: true,
|
|
11396
|
+
passive: true
|
|
11397
|
+
});
|
|
11398
|
+
};
|
|
11294
11399
|
const top2 = () => window.scrollTo(0, 0);
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11400
|
+
let frame2 = null;
|
|
11401
|
+
let release = () => {
|
|
11402
|
+
};
|
|
11403
|
+
const anchor2 = () => {
|
|
11404
|
+
release();
|
|
11405
|
+
if (frame2 !== null && typeof window.cancelAnimationFrame === "function") {
|
|
11406
|
+
window.cancelAnimationFrame(frame2);
|
|
11407
|
+
}
|
|
11408
|
+
snapOff();
|
|
11409
|
+
top2();
|
|
11410
|
+
frame2 = typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame(() => {
|
|
11411
|
+
top2();
|
|
11412
|
+
snapOn();
|
|
11413
|
+
}) : null;
|
|
11414
|
+
release = anchorTop(() => {
|
|
11415
|
+
if (snapping) {
|
|
11416
|
+
snapOff();
|
|
11417
|
+
snapOnAtTouch();
|
|
11418
|
+
}
|
|
11419
|
+
return true;
|
|
11420
|
+
});
|
|
11421
|
+
};
|
|
11422
|
+
anchor2();
|
|
11298
11423
|
const history = window.history;
|
|
11299
11424
|
const previousRestoration = history && "scrollRestoration" in history ? history.scrollRestoration : null;
|
|
11300
11425
|
if (previousRestoration !== null) history.scrollRestoration = "manual";
|
|
11301
11426
|
const onPageShow = (event) => {
|
|
11302
|
-
if (event.persisted)
|
|
11427
|
+
if (event.persisted) anchor2();
|
|
11303
11428
|
};
|
|
11304
11429
|
window.addEventListener("pageshow", onPageShow);
|
|
11430
|
+
const unobserve = onReveal(el, anchor2);
|
|
11305
11431
|
return () => {
|
|
11432
|
+
unobserve();
|
|
11306
11433
|
release();
|
|
11307
11434
|
if (frame2 !== null && typeof window.cancelAnimationFrame === "function") {
|
|
11308
11435
|
window.cancelAnimationFrame(frame2);
|
|
11309
11436
|
}
|
|
11437
|
+
window.removeEventListener("touchstart", snapOn);
|
|
11310
11438
|
window.removeEventListener("pageshow", onPageShow);
|
|
11311
11439
|
if (previousRestoration !== null) history.scrollRestoration = previousRestoration;
|
|
11312
11440
|
root2.style.scrollSnapType = previousType;
|