@nok-integration/storefront-react 0.20.11 → 0.20.13
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 +0 -10
- package/dist/index.mjs +215 -115
- package/dist/standalone/storefront.mjs +215 -115
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5175,9 +5175,113 @@ function requireClient() {
|
|
|
5175
5175
|
return client;
|
|
5176
5176
|
}
|
|
5177
5177
|
var clientExports = requireClient();
|
|
5178
|
+
const HOLD_MS = 2500;
|
|
5179
|
+
function withoutRestoration() {
|
|
5180
|
+
const history = typeof window !== "undefined" ? window.history : void 0;
|
|
5181
|
+
if (!history || !("scrollRestoration" in history)) return () => {
|
|
5182
|
+
};
|
|
5183
|
+
const previous = history.scrollRestoration;
|
|
5184
|
+
history.scrollRestoration = "manual";
|
|
5185
|
+
return () => {
|
|
5186
|
+
history.scrollRestoration = previous;
|
|
5187
|
+
};
|
|
5188
|
+
}
|
|
5189
|
+
function scrollToTop(box2) {
|
|
5190
|
+
const target = box2 ?? document.documentElement;
|
|
5191
|
+
const behaviour = target.style.scrollBehavior;
|
|
5192
|
+
target.style.scrollBehavior = "auto";
|
|
5193
|
+
if (box2) box2.scrollTop = 0;
|
|
5194
|
+
else window.scrollTo(0, 0);
|
|
5195
|
+
target.style.scrollBehavior = behaviour;
|
|
5196
|
+
}
|
|
5197
|
+
function scrollerOf(el) {
|
|
5198
|
+
if (!el || typeof getComputedStyle !== "function") return null;
|
|
5199
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
5200
|
+
if (node === document.documentElement) return null;
|
|
5201
|
+
const { overflowY } = getComputedStyle(node);
|
|
5202
|
+
if (overflowY !== "auto" && overflowY !== "scroll" && overflowY !== "overlay") continue;
|
|
5203
|
+
if (node !== document.body) return node;
|
|
5204
|
+
const root2 = getComputedStyle(document.documentElement).overflowY;
|
|
5205
|
+
return root2 === "visible" || root2 === "" ? null : node;
|
|
5206
|
+
}
|
|
5207
|
+
return null;
|
|
5208
|
+
}
|
|
5209
|
+
const RELEASES = ["touchmove", "wheel", "keydown", "pointerdown"];
|
|
5210
|
+
function movesThePage(event) {
|
|
5211
|
+
if (event.type === "pointerdown") return event.pointerType !== "touch";
|
|
5212
|
+
return true;
|
|
5213
|
+
}
|
|
5214
|
+
const holds = /* @__PURE__ */ new Set();
|
|
5215
|
+
function releaseHolds() {
|
|
5216
|
+
for (const end2 of Array.from(holds)) end2();
|
|
5217
|
+
}
|
|
5218
|
+
function anchorTop(onMoved = () => true, onEnd, box2 = null) {
|
|
5219
|
+
let released = false;
|
|
5220
|
+
const top2 = () => {
|
|
5221
|
+
if (released) return;
|
|
5222
|
+
const document_ = window.scrollY || document.documentElement.scrollTop || 0;
|
|
5223
|
+
const pane = box2 ? box2.scrollTop : 0;
|
|
5224
|
+
if (document_ <= 0 && pane <= 0) return;
|
|
5225
|
+
if (!onMoved()) return;
|
|
5226
|
+
if (document_ > 0) scrollToTop();
|
|
5227
|
+
if (box2 && pane > 0) scrollToTop(box2);
|
|
5228
|
+
};
|
|
5229
|
+
const end2 = (how2) => {
|
|
5230
|
+
if (released) return;
|
|
5231
|
+
released = true;
|
|
5232
|
+
holds.delete(moved);
|
|
5233
|
+
if (frame2 !== null && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame2);
|
|
5234
|
+
clearTimeout(timer2);
|
|
5235
|
+
window.removeEventListener("scroll", top2);
|
|
5236
|
+
box2?.removeEventListener("scroll", top2);
|
|
5237
|
+
for (const type of RELEASES) window.removeEventListener(type, release);
|
|
5238
|
+
onEnd?.(how2);
|
|
5239
|
+
};
|
|
5240
|
+
const release = (event) => {
|
|
5241
|
+
if (movesThePage(event)) end2("moved");
|
|
5242
|
+
};
|
|
5243
|
+
const moved = () => end2("moved");
|
|
5244
|
+
top2();
|
|
5245
|
+
const frame2 = typeof requestAnimationFrame === "function" ? requestAnimationFrame(top2) : null;
|
|
5246
|
+
const timer2 = setTimeout(() => end2("lapsed"), HOLD_MS);
|
|
5247
|
+
window.addEventListener("scroll", top2, {
|
|
5248
|
+
passive: true
|
|
5249
|
+
});
|
|
5250
|
+
box2?.addEventListener("scroll", top2, {
|
|
5251
|
+
passive: true
|
|
5252
|
+
});
|
|
5253
|
+
for (const type of RELEASES) window.addEventListener(type, release, {
|
|
5254
|
+
passive: true
|
|
5255
|
+
});
|
|
5256
|
+
holds.add(moved);
|
|
5257
|
+
return () => end2("released");
|
|
5258
|
+
}
|
|
5259
|
+
function onReveal(el, revealed) {
|
|
5260
|
+
if (typeof IntersectionObserver === "undefined") return () => {
|
|
5261
|
+
};
|
|
5262
|
+
let seen = false;
|
|
5263
|
+
let visible = true;
|
|
5264
|
+
const observer = new IntersectionObserver((entries) => {
|
|
5265
|
+
const entry = entries[entries.length - 1];
|
|
5266
|
+
if (!entry) return;
|
|
5267
|
+
const now = entry.isIntersecting;
|
|
5268
|
+
if (seen && now && !visible) revealed();
|
|
5269
|
+
seen = true;
|
|
5270
|
+
visible = now;
|
|
5271
|
+
});
|
|
5272
|
+
observer.observe(el);
|
|
5273
|
+
return () => observer.disconnect();
|
|
5274
|
+
}
|
|
5275
|
+
function onResize(el, resized) {
|
|
5276
|
+
if (typeof ResizeObserver === "undefined") return () => {
|
|
5277
|
+
};
|
|
5278
|
+
const observer = new ResizeObserver(() => resized());
|
|
5279
|
+
observer.observe(el);
|
|
5280
|
+
return () => observer.disconnect();
|
|
5281
|
+
}
|
|
5178
5282
|
function anchorToTop() {
|
|
5179
5283
|
if (typeof window === "undefined") return;
|
|
5180
|
-
const top2 = () =>
|
|
5284
|
+
const top2 = () => scrollToTop();
|
|
5181
5285
|
top2();
|
|
5182
5286
|
if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(top2);
|
|
5183
5287
|
}
|
|
@@ -5702,65 +5806,6 @@ function useTopOffset(ref, property, enabled = true) {
|
|
|
5702
5806
|
};
|
|
5703
5807
|
}, [ref, property, enabled]);
|
|
5704
5808
|
}
|
|
5705
|
-
const HOLD_MS = 2500;
|
|
5706
|
-
function withoutRestoration() {
|
|
5707
|
-
const history = typeof window !== "undefined" ? window.history : void 0;
|
|
5708
|
-
if (!history || !("scrollRestoration" in history)) return () => {
|
|
5709
|
-
};
|
|
5710
|
-
const previous = history.scrollRestoration;
|
|
5711
|
-
history.scrollRestoration = "manual";
|
|
5712
|
-
return () => {
|
|
5713
|
-
history.scrollRestoration = previous;
|
|
5714
|
-
};
|
|
5715
|
-
}
|
|
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) {
|
|
5722
|
-
let released = false;
|
|
5723
|
-
const top2 = () => {
|
|
5724
|
-
if (released) return;
|
|
5725
|
-
const scrolled2 = window.scrollY || document.documentElement.scrollTop || 0;
|
|
5726
|
-
if (scrolled2 > 0 && onMoved()) window.scrollTo(0, 0);
|
|
5727
|
-
};
|
|
5728
|
-
const release = (event) => {
|
|
5729
|
-
if (released) return;
|
|
5730
|
-
if (event && !movesThePage(event)) return;
|
|
5731
|
-
released = true;
|
|
5732
|
-
if (frame2 !== null && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame2);
|
|
5733
|
-
clearTimeout(timer2);
|
|
5734
|
-
window.removeEventListener("scroll", top2);
|
|
5735
|
-
for (const type of RELEASES) window.removeEventListener(type, release);
|
|
5736
|
-
};
|
|
5737
|
-
top2();
|
|
5738
|
-
const frame2 = typeof requestAnimationFrame === "function" ? requestAnimationFrame(top2) : null;
|
|
5739
|
-
const timer2 = setTimeout(release, HOLD_MS);
|
|
5740
|
-
window.addEventListener("scroll", top2, {
|
|
5741
|
-
passive: true
|
|
5742
|
-
});
|
|
5743
|
-
for (const type of RELEASES) window.addEventListener(type, release, {
|
|
5744
|
-
passive: true
|
|
5745
|
-
});
|
|
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();
|
|
5763
|
-
}
|
|
5764
5809
|
const useMountEffect$1 = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
5765
5810
|
function documentTop(el) {
|
|
5766
5811
|
let top2 = 0;
|
|
@@ -5777,12 +5822,24 @@ function useScreenAnchor(ref, enabled = true) {
|
|
|
5777
5822
|
const el = ref.current;
|
|
5778
5823
|
if (!el || !enabled) return;
|
|
5779
5824
|
const restore = withoutRestoration();
|
|
5780
|
-
let
|
|
5781
|
-
const
|
|
5825
|
+
let moved = false;
|
|
5826
|
+
const hold = () => anchorTop(() => beginsOnTheFirstViewport(el), (end2) => {
|
|
5827
|
+
if (end2 === "moved") moved = true;
|
|
5828
|
+
}, scrollerOf(el));
|
|
5829
|
+
let release = hold();
|
|
5830
|
+
const again = () => {
|
|
5782
5831
|
release();
|
|
5783
|
-
release =
|
|
5832
|
+
release = hold();
|
|
5833
|
+
};
|
|
5834
|
+
const unobserve = onReveal(el, () => {
|
|
5835
|
+
moved = false;
|
|
5836
|
+
again();
|
|
5837
|
+
});
|
|
5838
|
+
const settled = onResize(el, () => {
|
|
5839
|
+
if (!moved) again();
|
|
5784
5840
|
});
|
|
5785
5841
|
return () => {
|
|
5842
|
+
settled();
|
|
5786
5843
|
unobserve();
|
|
5787
5844
|
release();
|
|
5788
5845
|
restore();
|
|
@@ -6053,7 +6110,20 @@ const ES = {
|
|
|
6053
6110
|
"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
6111
|
"{0} photographs": "{0} fotografías",
|
|
6055
6112
|
"{0}, opens in a new tab": "{0}, se abre en una pestaña nueva",
|
|
6056
|
-
"Zip Ups": "Sudaderas con cremalleras"
|
|
6113
|
+
"Zip Ups": "Sudaderas con cremalleras",
|
|
6114
|
+
"Added to cart": "Añadido a la cesta",
|
|
6115
|
+
"Order placed": "Pedido realizado",
|
|
6116
|
+
"On its way": "En camino",
|
|
6117
|
+
"Out for delivery": "En reparto",
|
|
6118
|
+
"Estimated delivery": "Entrega estimada",
|
|
6119
|
+
"Nothing matches these filters.": "Nada coincide con estos filtros.",
|
|
6120
|
+
"Your items will show up here once you've added to your cart.": "Sus artículos aparecerán aquí cuando los añada a la cesta.",
|
|
6121
|
+
"Complete your DAZN sign-up to check out. Your cart is saved.": "Complete su registro en DAZN para finalizar la compra. Su cesta está guardada.",
|
|
6122
|
+
"Your orders will show up here once you've shopped.": "Sus pedidos aparecerán aquí cuando haya comprado.",
|
|
6123
|
+
"We'll let you know": "Le avisaremos",
|
|
6124
|
+
"{0} — as soon as it is back": "{0} — en cuanto vuelva a estar disponible",
|
|
6125
|
+
"Size {0}": "Talla {0}",
|
|
6126
|
+
"On the way": "En camino"
|
|
6057
6127
|
};
|
|
6058
6128
|
const CATALOGUES = {
|
|
6059
6129
|
es: ES
|
|
@@ -6653,8 +6723,23 @@ const styles$H = {
|
|
|
6653
6723
|
future,
|
|
6654
6724
|
date: date$1
|
|
6655
6725
|
};
|
|
6726
|
+
const STEP_LABELS = {
|
|
6727
|
+
packing: "Order placed",
|
|
6728
|
+
on_its_way: "On its way",
|
|
6729
|
+
out_for_delivery: "Out for delivery",
|
|
6730
|
+
delivered: "Delivered",
|
|
6731
|
+
cancelled: "Order cancelled"
|
|
6732
|
+
};
|
|
6733
|
+
const PENDING_LABELS = {
|
|
6734
|
+
delivered: "Estimated delivery"
|
|
6735
|
+
};
|
|
6736
|
+
function labelFor(entry) {
|
|
6737
|
+
if (entry.label) return entry.label;
|
|
6738
|
+
return (entry.at ? void 0 : PENDING_LABELS[entry.step]) ?? STEP_LABELS[entry.step] ?? "";
|
|
6739
|
+
}
|
|
6656
6740
|
function OrderTimeline({ progress: progress2, estimatedDelivery, locale: localeProp }) {
|
|
6657
6741
|
const locale = useLocale(localeProp);
|
|
6742
|
+
const t = useT();
|
|
6658
6743
|
const currentIndex = progress2.findIndex((e) => e.current);
|
|
6659
6744
|
return jsx("ol", {
|
|
6660
6745
|
className: styles$H.timeline,
|
|
@@ -6678,7 +6763,7 @@ function OrderTimeline({ progress: progress2, estimatedDelivery, locale: localeP
|
|
|
6678
6763
|
className: styles$H.text,
|
|
6679
6764
|
children: [jsx("span", {
|
|
6680
6765
|
className: [styles$H.label, styles$H[state]].join(" "),
|
|
6681
|
-
children: entry
|
|
6766
|
+
children: t(labelFor(entry))
|
|
6682
6767
|
}), entry.at ? jsx("time", {
|
|
6683
6768
|
className: styles$H.date,
|
|
6684
6769
|
dateTime: entry.at,
|
|
@@ -7043,7 +7128,7 @@ function OrderItemsCard({ order }) {
|
|
|
7043
7128
|
className: styles$F.itemsHeader,
|
|
7044
7129
|
children: [jsx("h2", {
|
|
7045
7130
|
className: styles$F.itemsTitle,
|
|
7046
|
-
children: "Items"
|
|
7131
|
+
children: t("Items")
|
|
7047
7132
|
}), jsx("span", {
|
|
7048
7133
|
className: styles$F.itemsCount,
|
|
7049
7134
|
children: itemCount
|
|
@@ -7063,7 +7148,7 @@ function ShippingAddressCard({ order }) {
|
|
|
7063
7148
|
"aria-label": t("Shipping address"),
|
|
7064
7149
|
children: [jsx("h2", {
|
|
7065
7150
|
className: styles$F.cardTitle,
|
|
7066
|
-
children: "Shipping address"
|
|
7151
|
+
children: t("Shipping address")
|
|
7067
7152
|
}), jsx("p", {
|
|
7068
7153
|
className: styles$F.cardBody,
|
|
7069
7154
|
children: formatAddress(order.ship_to)
|
|
@@ -8015,9 +8100,10 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8015
8100
|
void load();
|
|
8016
8101
|
}, [load]);
|
|
8017
8102
|
const cancelled = order?.status === "cancelled";
|
|
8103
|
+
const cancelledPage = useRef(null);
|
|
8018
8104
|
useBrowserLayoutEffect(() => {
|
|
8019
8105
|
if (!cancelled) return;
|
|
8020
|
-
return anchorTop();
|
|
8106
|
+
return anchorTop(void 0, void 0, scrollerOf(cancelledPage.current));
|
|
8021
8107
|
}, [cancelled]);
|
|
8022
8108
|
if (state === "loading") {
|
|
8023
8109
|
return jsxs("div", {
|
|
@@ -8100,6 +8186,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onO
|
|
|
8100
8186
|
if (order.status === "cancelled") {
|
|
8101
8187
|
return jsxs("div", {
|
|
8102
8188
|
className: styles$y.page,
|
|
8189
|
+
ref: cancelledPage,
|
|
8103
8190
|
children: [jsxs("div", {
|
|
8104
8191
|
className: styles$y.cancelledHead,
|
|
8105
8192
|
children: [jsx("h1", {
|
|
@@ -8561,13 +8648,13 @@ function OrderListContent({ onOpenOrder, onOpenReturn, onStartShopping, locale:
|
|
|
8561
8648
|
className: styles$v.empty,
|
|
8562
8649
|
children: jsx(EmptyState, {
|
|
8563
8650
|
title: t("Nothing here yet"),
|
|
8564
|
-
body: "Your orders will show up here once you've shopped.",
|
|
8651
|
+
body: t("Your orders will show up here once you've shopped."),
|
|
8565
8652
|
...onStartShopping ? {
|
|
8566
8653
|
action: jsx("button", {
|
|
8567
8654
|
type: "button",
|
|
8568
8655
|
className: styles$v.cta,
|
|
8569
8656
|
onClick: onStartShopping,
|
|
8570
|
-
children: "Continue shopping"
|
|
8657
|
+
children: t("Continue shopping")
|
|
8571
8658
|
})
|
|
8572
8659
|
} : {}
|
|
8573
8660
|
})
|
|
@@ -8832,6 +8919,7 @@ function ProductTile({ product, priority, size = "default" }) {
|
|
|
8832
8919
|
const anyInStock = product.variants.length === 0 ? true : product.variants.some((v) => v.in_stock);
|
|
8833
8920
|
const topBadge2 = product.badges?.[0];
|
|
8834
8921
|
const pct = discountPct(product.price, product.compare_at);
|
|
8922
|
+
const t = useT();
|
|
8835
8923
|
return jsxs(ShopLink, {
|
|
8836
8924
|
to: `/product/${encodeURIComponent(product.sku)}`,
|
|
8837
8925
|
className: [styles$t.tile, size === "large" ? styles$t.large : ""].join(" "),
|
|
@@ -8857,7 +8945,7 @@ function ProductTile({ product, priority, size = "default" }) {
|
|
|
8857
8945
|
})
|
|
8858
8946
|
}), !anyInStock && jsx("span", {
|
|
8859
8947
|
className: styles$t.oos,
|
|
8860
|
-
children: "Out of stock"
|
|
8948
|
+
children: t("Out of stock")
|
|
8861
8949
|
})]
|
|
8862
8950
|
}), jsxs("div", {
|
|
8863
8951
|
className: styles$t.bottom,
|
|
@@ -8952,7 +9040,7 @@ function ProductGallery({ title: title2, product }) {
|
|
|
8952
9040
|
})
|
|
8953
9041
|
}), i === 0 && !inStock && jsx("span", {
|
|
8954
9042
|
className: styles$s.oos,
|
|
8955
|
-
children: "Out of stock"
|
|
9043
|
+
children: t("Out of stock")
|
|
8956
9044
|
})]
|
|
8957
9045
|
}, src ?? i))
|
|
8958
9046
|
}), jsxs("div", {
|
|
@@ -9018,7 +9106,7 @@ function FilterBar({ options: options2, active, onToggle, onClear }) {
|
|
|
9018
9106
|
type: "button",
|
|
9019
9107
|
className: styles$r.clear,
|
|
9020
9108
|
onClick: onClear,
|
|
9021
|
-
children: "Clear"
|
|
9109
|
+
children: t("Clear")
|
|
9022
9110
|
})]
|
|
9023
9111
|
});
|
|
9024
9112
|
}
|
|
@@ -9078,11 +9166,11 @@ function ProductGrid({ category, initialProducts, initialCursor, filters = [] })
|
|
|
9078
9166
|
onClear: () => setActive([])
|
|
9079
9167
|
}), visible.length === 0 ? jsx(EmptyState, {
|
|
9080
9168
|
title: t("No products"),
|
|
9081
|
-
body: "Nothing matches these filters.",
|
|
9169
|
+
body: t("Nothing matches these filters."),
|
|
9082
9170
|
action: active.length > 0 ? jsx(Button, {
|
|
9083
9171
|
variant: "secondary",
|
|
9084
9172
|
onClick: () => setActive([]),
|
|
9085
|
-
children: "Clear filters"
|
|
9173
|
+
children: t("Clear filters")
|
|
9086
9174
|
}) : void 0
|
|
9087
9175
|
}) : jsx("ul", {
|
|
9088
9176
|
className: styles$q.grid,
|
|
@@ -9122,6 +9210,7 @@ const styles$p = {
|
|
|
9122
9210
|
inset
|
|
9123
9211
|
};
|
|
9124
9212
|
function RailCarousel({ title: title2, products, seeAllTo, inset: inset2 }) {
|
|
9213
|
+
const t = useT();
|
|
9125
9214
|
if (products.length === 0) return null;
|
|
9126
9215
|
return jsxs("section", {
|
|
9127
9216
|
className: [styles$p.rail, inset2 ? styles$p.inset : ""].join(" "),
|
|
@@ -9134,7 +9223,7 @@ function RailCarousel({ title: title2, products, seeAllTo, inset: inset2 }) {
|
|
|
9134
9223
|
}), seeAllTo && jsx(ShopLink, {
|
|
9135
9224
|
className: styles$p.seeAll,
|
|
9136
9225
|
to: seeAllTo,
|
|
9137
|
-
children: "See all"
|
|
9226
|
+
children: t("See all")
|
|
9138
9227
|
})]
|
|
9139
9228
|
}), jsx("ul", {
|
|
9140
9229
|
className: styles$p.track,
|
|
@@ -9456,7 +9545,7 @@ function CartLineItem({ item: item2, title: title2, image: image2, compareAt: co
|
|
|
9456
9545
|
}), soldOut ? jsx("span", {
|
|
9457
9546
|
className: styles$m.oos,
|
|
9458
9547
|
id: noticeId,
|
|
9459
|
-
children: "Out of stock"
|
|
9548
|
+
children: t("Out of stock")
|
|
9460
9549
|
}) : pct !== void 0 && jsx("span", {
|
|
9461
9550
|
className: styles$m.saleBadge,
|
|
9462
9551
|
children: jsx(SaleBadge, {
|
|
@@ -9555,7 +9644,7 @@ function ShippingInfo() {
|
|
|
9555
9644
|
})]
|
|
9556
9645
|
}), jsx("p", {
|
|
9557
9646
|
className: styles$l.label,
|
|
9558
|
-
children: "Standard or express delivery"
|
|
9647
|
+
children: t("Standard or express delivery")
|
|
9559
9648
|
})]
|
|
9560
9649
|
}), jsx("div", {
|
|
9561
9650
|
className: styles$l.divider,
|
|
@@ -9584,7 +9673,7 @@ function ShippingInfo() {
|
|
|
9584
9673
|
})]
|
|
9585
9674
|
}), jsx("p", {
|
|
9586
9675
|
className: styles$l.label,
|
|
9587
|
-
children: "14 days returns"
|
|
9676
|
+
children: t("14 days returns")
|
|
9588
9677
|
})]
|
|
9589
9678
|
})]
|
|
9590
9679
|
});
|
|
@@ -9767,16 +9856,16 @@ function CartViewContent({ onContinueShopping, checkoutLabel } = {}) {
|
|
|
9767
9856
|
if (state === "empty" || !cart2) {
|
|
9768
9857
|
return jsx(EmptyState, {
|
|
9769
9858
|
title: t("Nothing here yet"),
|
|
9770
|
-
body: "Your items will show up here once you've added to your cart.",
|
|
9859
|
+
body: t("Your items will show up here once you've added to your cart."),
|
|
9771
9860
|
action: onContinueShopping ? jsx(Button, {
|
|
9772
9861
|
variant: "primary",
|
|
9773
9862
|
onClick: onContinueShopping,
|
|
9774
|
-
children: "Continue shopping"
|
|
9863
|
+
children: t("Continue shopping")
|
|
9775
9864
|
}) : jsx(ShopLink, {
|
|
9776
9865
|
to: "/",
|
|
9777
9866
|
children: jsx(Button, {
|
|
9778
9867
|
variant: "primary",
|
|
9779
|
-
children: "Continue shopping"
|
|
9868
|
+
children: t("Continue shopping")
|
|
9780
9869
|
})
|
|
9781
9870
|
})
|
|
9782
9871
|
});
|
|
@@ -10195,14 +10284,14 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
|
|
|
10195
10284
|
children: [jsx("h2", {
|
|
10196
10285
|
id: "size-heading",
|
|
10197
10286
|
className: styles$g.title,
|
|
10198
|
-
children: "Size"
|
|
10287
|
+
children: t("Size")
|
|
10199
10288
|
}), showGuide && jsxs("button", {
|
|
10200
10289
|
type: "button",
|
|
10201
10290
|
className: styles$g.sizeGuide,
|
|
10202
10291
|
onClick: () => setGuideOpen(true),
|
|
10203
10292
|
"aria-haspopup": "dialog",
|
|
10204
10293
|
"aria-expanded": guideOpen,
|
|
10205
|
-
children: ["Size guide", jsxs("svg", {
|
|
10294
|
+
children: [t("Size guide"), jsxs("svg", {
|
|
10206
10295
|
className: styles$g.info,
|
|
10207
10296
|
width: "12",
|
|
10208
10297
|
height: "12",
|
|
@@ -10253,7 +10342,7 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
|
|
|
10253
10342
|
}), error2 && jsx("p", {
|
|
10254
10343
|
className: styles$g.error,
|
|
10255
10344
|
role: "alert",
|
|
10256
|
-
children: "Please select a size"
|
|
10345
|
+
children: t("Please select a size")
|
|
10257
10346
|
}), lowStock2 && !error2 && jsx("p", {
|
|
10258
10347
|
className: styles$g.lowStock,
|
|
10259
10348
|
role: "status",
|
|
@@ -10335,7 +10424,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
|
|
|
10335
10424
|
}), soldOut && jsx("span", {
|
|
10336
10425
|
className: styles$f.scrim,
|
|
10337
10426
|
"aria-hidden": "true",
|
|
10338
|
-
children: "Out of stock"
|
|
10427
|
+
children: t("Out of stock")
|
|
10339
10428
|
})]
|
|
10340
10429
|
}), lowStock2 && jsx("span", {
|
|
10341
10430
|
className: styles$f.stockBadge,
|
|
@@ -10363,7 +10452,7 @@ const styles$e = {
|
|
|
10363
10452
|
};
|
|
10364
10453
|
function VariantSelector({ variants, selectedSku, onSelect, labelAttribute }) {
|
|
10365
10454
|
const t = useT();
|
|
10366
|
-
function
|
|
10455
|
+
function labelFor2(variant) {
|
|
10367
10456
|
if (labelAttribute && variant.attributes[labelAttribute]) {
|
|
10368
10457
|
return variant.attributes[labelAttribute];
|
|
10369
10458
|
}
|
|
@@ -10374,7 +10463,7 @@ function VariantSelector({ variants, selectedSku, onSelect, labelAttribute }) {
|
|
|
10374
10463
|
className: styles$e.fieldset,
|
|
10375
10464
|
children: [jsx("legend", {
|
|
10376
10465
|
className: styles$e.legend,
|
|
10377
|
-
children: "Select an option"
|
|
10466
|
+
children: t("Select an option")
|
|
10378
10467
|
}), jsx("div", {
|
|
10379
10468
|
className: styles$e.options,
|
|
10380
10469
|
role: "radiogroup",
|
|
@@ -10390,7 +10479,7 @@ function VariantSelector({ variants, selectedSku, onSelect, labelAttribute }) {
|
|
|
10390
10479
|
disabled: disabled2,
|
|
10391
10480
|
className: [styles$e.option, selected2 ? styles$e.selected : "", disabled2 ? styles$e.disabled : ""].filter(Boolean).join(" "),
|
|
10392
10481
|
onClick: () => !disabled2 && onSelect(variant.sku),
|
|
10393
|
-
children: [
|
|
10482
|
+
children: [labelFor2(variant), disabled2 && jsx("span", {
|
|
10394
10483
|
className: "visually-hidden",
|
|
10395
10484
|
children: " (out of stock)"
|
|
10396
10485
|
})]
|
|
@@ -10441,6 +10530,7 @@ function ProductDetails({ description: description2 }) {
|
|
|
10441
10530
|
observer?.disconnect();
|
|
10442
10531
|
};
|
|
10443
10532
|
}, [expanded, description2]);
|
|
10533
|
+
const t = useT();
|
|
10444
10534
|
if (paragraphs.length === 0) return null;
|
|
10445
10535
|
return jsxs("section", {
|
|
10446
10536
|
className: styles$d.root,
|
|
@@ -10450,7 +10540,7 @@ function ProductDetails({ description: description2 }) {
|
|
|
10450
10540
|
children: [jsx("h2", {
|
|
10451
10541
|
id: "details-heading",
|
|
10452
10542
|
className: styles$d.title,
|
|
10453
|
-
children: "Product details"
|
|
10543
|
+
children: t("Product details")
|
|
10454
10544
|
}), jsx("div", {
|
|
10455
10545
|
ref: bodyRef,
|
|
10456
10546
|
className: [styles$d.body, expanded ? "" : styles$d.clamped].join(" "),
|
|
@@ -10699,8 +10789,8 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
|
|
|
10699
10789
|
type: "stock_alert_requested",
|
|
10700
10790
|
sku: alertSku
|
|
10701
10791
|
});
|
|
10702
|
-
toast2.show("We'll let you know", {
|
|
10703
|
-
description:
|
|
10792
|
+
toast2.show(t("We'll let you know"), {
|
|
10793
|
+
description: t("{0} — as soon as it is back", product.title),
|
|
10704
10794
|
image: product.media[0]
|
|
10705
10795
|
});
|
|
10706
10796
|
} catch (err) {
|
|
@@ -10725,6 +10815,7 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
|
|
|
10725
10815
|
function ensureSelection() {
|
|
10726
10816
|
if (needsSize) {
|
|
10727
10817
|
setSizeError(true);
|
|
10818
|
+
releaseHolds();
|
|
10728
10819
|
sizeRef.current?.scrollIntoView({
|
|
10729
10820
|
behavior: "smooth",
|
|
10730
10821
|
block: "center"
|
|
@@ -10732,6 +10823,7 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
|
|
|
10732
10823
|
return false;
|
|
10733
10824
|
}
|
|
10734
10825
|
if (needsColour) {
|
|
10826
|
+
releaseHolds();
|
|
10735
10827
|
colourRef.current?.scrollIntoView({
|
|
10736
10828
|
behavior: "smooth",
|
|
10737
10829
|
block: "center"
|
|
@@ -10751,8 +10843,8 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
|
|
|
10751
10843
|
const variant = variants.find((v) => v.sku === sku);
|
|
10752
10844
|
const size = variant?.attributes.size ?? selectedSize;
|
|
10753
10845
|
setAdded((current2) => current2.includes(sku) ? current2 : [...current2, sku]);
|
|
10754
|
-
toast2.show("Added to cart", {
|
|
10755
|
-
description: [product.title, size &&
|
|
10846
|
+
toast2.show(t("Added to cart"), {
|
|
10847
|
+
description: [product.title, size && t("Size {0}", size)].filter(Boolean).join(" · "),
|
|
10756
10848
|
image: variant?.image ?? product.media[0],
|
|
10757
10849
|
action: cartSheet || navigate ? {
|
|
10758
10850
|
label: t("View cart"),
|
|
@@ -10879,6 +10971,7 @@ const styles$9 = {
|
|
|
10879
10971
|
function PcpHero({ hero: hero2 }) {
|
|
10880
10972
|
const heroRef = useRef(null);
|
|
10881
10973
|
useTopOffset(heroRef, "--hero-top");
|
|
10974
|
+
const t = useT();
|
|
10882
10975
|
return jsxs("section", {
|
|
10883
10976
|
ref: heroRef,
|
|
10884
10977
|
className: [styles$9.hero, hero2.image ? "" : styles$9.noImage].join(" "),
|
|
@@ -10903,10 +10996,10 @@ function PcpHero({ hero: hero2 }) {
|
|
|
10903
10996
|
className: styles$9.text,
|
|
10904
10997
|
children: [jsx("h1", {
|
|
10905
10998
|
className: styles$9.title,
|
|
10906
|
-
children: hero2.title
|
|
10999
|
+
children: t(hero2.title)
|
|
10907
11000
|
}), hero2.subtitle && jsx("p", {
|
|
10908
11001
|
className: styles$9.subtitle,
|
|
10909
|
-
children: hero2.subtitle
|
|
11002
|
+
children: t(hero2.subtitle)
|
|
10910
11003
|
})]
|
|
10911
11004
|
})]
|
|
10912
11005
|
});
|
|
@@ -11086,6 +11179,7 @@ const styles$4 = {
|
|
|
11086
11179
|
row: row$1
|
|
11087
11180
|
};
|
|
11088
11181
|
function ExploreList({ title: title2, links }) {
|
|
11182
|
+
const t = useT();
|
|
11089
11183
|
return jsxs("section", {
|
|
11090
11184
|
className: styles$4.section,
|
|
11091
11185
|
"aria-label": title2,
|
|
@@ -11099,7 +11193,7 @@ function ExploreList({ title: title2, links }) {
|
|
|
11099
11193
|
to: `/category/${encodeURIComponent(l.code)}`,
|
|
11100
11194
|
className: styles$4.row,
|
|
11101
11195
|
children: [jsx("span", {
|
|
11102
|
-
children: l.label
|
|
11196
|
+
children: t(l.label)
|
|
11103
11197
|
}), jsx("svg", {
|
|
11104
11198
|
width: "16",
|
|
11105
11199
|
height: "16",
|
|
@@ -11134,10 +11228,11 @@ const styles$3 = {
|
|
|
11134
11228
|
grid
|
|
11135
11229
|
};
|
|
11136
11230
|
function Block({ block }) {
|
|
11231
|
+
const t = useT();
|
|
11137
11232
|
switch (block.kind) {
|
|
11138
11233
|
case "rail":
|
|
11139
11234
|
return jsx(RailCarousel, {
|
|
11140
|
-
title: block.title,
|
|
11235
|
+
title: t(block.title),
|
|
11141
11236
|
products: block.products
|
|
11142
11237
|
});
|
|
11143
11238
|
case "lifestyle_text":
|
|
@@ -11150,7 +11245,7 @@ function Block({ block }) {
|
|
|
11150
11245
|
className: styles$3.featured,
|
|
11151
11246
|
children: [block.title && jsx("h2", {
|
|
11152
11247
|
className: styles$3.blockTitle,
|
|
11153
|
-
children: block.title
|
|
11248
|
+
children: t(block.title)
|
|
11154
11249
|
}), jsx(ProductTile, {
|
|
11155
11250
|
product: block.product,
|
|
11156
11251
|
priority: true,
|
|
@@ -11159,7 +11254,7 @@ function Block({ block }) {
|
|
|
11159
11254
|
});
|
|
11160
11255
|
case "product_gallery":
|
|
11161
11256
|
return jsx(ProductGallery, {
|
|
11162
|
-
title: block.title,
|
|
11257
|
+
title: t(block.title),
|
|
11163
11258
|
product: block.product
|
|
11164
11259
|
});
|
|
11165
11260
|
case "lifestyle_image":
|
|
@@ -11172,7 +11267,7 @@ function Block({ block }) {
|
|
|
11172
11267
|
className: styles$3.gridBlock,
|
|
11173
11268
|
children: [block.title && jsx("h2", {
|
|
11174
11269
|
className: styles$3.blockTitle,
|
|
11175
|
-
children: block.title
|
|
11270
|
+
children: t(block.title)
|
|
11176
11271
|
}), jsx("ul", {
|
|
11177
11272
|
className: styles$3.grid,
|
|
11178
11273
|
children: block.products.map((p) => jsx("li", {
|
|
@@ -11192,7 +11287,7 @@ function Block({ block }) {
|
|
|
11192
11287
|
});
|
|
11193
11288
|
case "explore":
|
|
11194
11289
|
return jsx(ExploreList, {
|
|
11195
|
-
title: block.title,
|
|
11290
|
+
title: t(block.title),
|
|
11196
11291
|
links: block.links
|
|
11197
11292
|
});
|
|
11198
11293
|
default:
|
|
@@ -11424,7 +11519,8 @@ function useDocumentSnap(ref, enabled = true) {
|
|
|
11424
11519
|
useMountEffect(() => {
|
|
11425
11520
|
const el = ref.current;
|
|
11426
11521
|
if (!el || !enabled || typeof document === "undefined") return;
|
|
11427
|
-
const
|
|
11522
|
+
const pane = scrollerOf(el);
|
|
11523
|
+
const root2 = pane ?? document.documentElement;
|
|
11428
11524
|
const previousType = root2.style.scrollSnapType;
|
|
11429
11525
|
const previousPadding = root2.style.scrollPaddingTop;
|
|
11430
11526
|
root2.style.scrollPaddingTop = "0px";
|
|
@@ -11446,7 +11542,10 @@ function useDocumentSnap(ref, enabled = true) {
|
|
|
11446
11542
|
passive: true
|
|
11447
11543
|
});
|
|
11448
11544
|
};
|
|
11449
|
-
const top2 = () =>
|
|
11545
|
+
const top2 = () => {
|
|
11546
|
+
scrollToTop();
|
|
11547
|
+
if (pane) scrollToTop(pane);
|
|
11548
|
+
};
|
|
11450
11549
|
let frame2 = null;
|
|
11451
11550
|
let release = () => {
|
|
11452
11551
|
};
|
|
@@ -11467,7 +11566,7 @@ function useDocumentSnap(ref, enabled = true) {
|
|
|
11467
11566
|
snapOnAtTouch();
|
|
11468
11567
|
}
|
|
11469
11568
|
return true;
|
|
11470
|
-
});
|
|
11569
|
+
}, void 0, pane);
|
|
11471
11570
|
};
|
|
11472
11571
|
anchor2();
|
|
11473
11572
|
const history = window.history;
|
|
@@ -11518,9 +11617,10 @@ const FALLBACK_PANELS = [{
|
|
|
11518
11617
|
image: "/figma/home/tshirts-poster.jpg"
|
|
11519
11618
|
}];
|
|
11520
11619
|
function CategoryPanel({ panel: panel2 }) {
|
|
11620
|
+
const t = useT();
|
|
11521
11621
|
return jsxs("section", {
|
|
11522
11622
|
className: styles$2.panel,
|
|
11523
|
-
"aria-label": panel2.title,
|
|
11623
|
+
"aria-label": t(panel2.title),
|
|
11524
11624
|
...panel2.focalY === void 0 ? {} : {
|
|
11525
11625
|
style: {
|
|
11526
11626
|
"--slide-focal-y": `${panel2.focalY}%`
|
|
@@ -11543,16 +11643,16 @@ function CategoryPanel({ panel: panel2 }) {
|
|
|
11543
11643
|
className: styles$2.copy,
|
|
11544
11644
|
children: [jsx("h2", {
|
|
11545
11645
|
className: styles$2.title,
|
|
11546
|
-
children: panel2.title
|
|
11646
|
+
children: t(panel2.title)
|
|
11547
11647
|
}), jsx("p", {
|
|
11548
11648
|
className: styles$2.subtitle,
|
|
11549
|
-
children: panel2.subtitle
|
|
11649
|
+
children: t(panel2.subtitle)
|
|
11550
11650
|
})]
|
|
11551
11651
|
}), jsx(ShopLink, {
|
|
11552
11652
|
to: panel2.to,
|
|
11553
11653
|
className: styles$2.cta,
|
|
11554
|
-
"aria-label": `${panel2.title} — ${panel2.cta}`,
|
|
11555
|
-
children: panel2.cta
|
|
11654
|
+
"aria-label": `${t(panel2.title)} — ${t(panel2.cta)}`,
|
|
11655
|
+
children: t(panel2.cta)
|
|
11556
11656
|
})]
|
|
11557
11657
|
})]
|
|
11558
11658
|
});
|
|
@@ -11648,16 +11748,16 @@ function HomeShowcase() {
|
|
|
11648
11748
|
className: styles$2.logo
|
|
11649
11749
|
}), jsx("h1", {
|
|
11650
11750
|
className: styles$2.heroTitle,
|
|
11651
|
-
children: "DAZN SHOP"
|
|
11751
|
+
children: t("DAZN SHOP")
|
|
11652
11752
|
}), jsx("p", {
|
|
11653
11753
|
className: styles$2.heroSub,
|
|
11654
|
-
children: "Fresh drops inspired by sport, culture, and everyday movement"
|
|
11754
|
+
children: t("Fresh drops inspired by sport, culture, and everyday movement")
|
|
11655
11755
|
})]
|
|
11656
11756
|
}), jsxs("div", {
|
|
11657
11757
|
className: styles$2.swipe,
|
|
11658
11758
|
children: [jsx("p", {
|
|
11659
11759
|
className: styles$2.swipeLabel,
|
|
11660
|
-
children: "Swipe down for more"
|
|
11760
|
+
children: t("Swipe down for more")
|
|
11661
11761
|
}), jsx("svg", {
|
|
11662
11762
|
className: styles$2.chevron,
|
|
11663
11763
|
viewBox: "0 0 24 24",
|
|
@@ -11706,13 +11806,13 @@ function IdentityGate({ returnTo }) {
|
|
|
11706
11806
|
const emit = useShopEvent();
|
|
11707
11807
|
return jsx(EmptyState, {
|
|
11708
11808
|
title: t("Finish signing up"),
|
|
11709
|
-
body: "Complete your DAZN sign-up to check out. Your cart is saved.",
|
|
11809
|
+
body: t("Complete your DAZN sign-up to check out. Your cart is saved."),
|
|
11710
11810
|
action: jsx(Button, {
|
|
11711
11811
|
onClick: () => emit({
|
|
11712
11812
|
type: "session_required",
|
|
11713
11813
|
action: `sign_in:${returnTo}`
|
|
11714
11814
|
}),
|
|
11715
|
-
children: "Finish signing up"
|
|
11815
|
+
children: t("Finish signing up")
|
|
11716
11816
|
})
|
|
11717
11817
|
});
|
|
11718
11818
|
}
|