@nok-integration/storefront-react 0.19.10 → 0.19.15

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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
- import { useContext, useEffect, useState, useRef, useCallback, useMemo, createContext, forwardRef } from "react";
3
+ import { useContext, useEffect, useState, useRef, useCallback, useMemo, createContext, forwardRef, Fragment as Fragment$1 } from "react";
4
4
  var client = {};
5
5
  var catalog = {};
6
6
  var zod = {};
@@ -4392,6 +4392,7 @@ function requireContent() {
4392
4392
  cta: zod_1.z.string().min(1),
4393
4393
  target: zod_1.z.string().min(1).optional(),
4394
4394
  image: zod_1.z.string().min(1).optional(),
4395
+ video: zod_1.z.string().min(1).optional(),
4395
4396
  focal_y: zod_1.z.number().int().min(0).max(100).optional()
4396
4397
  });
4397
4398
  exports.HomeContent = zod_1.z.object({
@@ -4673,7 +4674,8 @@ function requireOrderTracking() {
4673
4674
  image: common_1.Url.optional(),
4674
4675
  attributes: common_1.Attributes.optional(),
4675
4676
  cancelled_qty: zod_1.z.number().int().nonnegative(),
4676
- refunded_qty: zod_1.z.number().int().nonnegative()
4677
+ refunded_qty: zod_1.z.number().int().nonnegative(),
4678
+ returned_qty: zod_1.z.number().int().nonnegative().optional()
4677
4679
  });
4678
4680
  exports.OrderSummaryItem = zod_1.z.object({
4679
4681
  order_ref: ids_1.OrderRef,
@@ -5338,6 +5340,64 @@ function ShopImage({ src, alt, fill: fill2 = false, width, height, sizes, classN
5338
5340
  fetchPriority: priority ? "high" : void 0
5339
5341
  });
5340
5342
  }
5343
+ function ShopVideo({ src, poster, fill: fill2 = false, className, style, priority = false }) {
5344
+ const assetUrl = useAssetUrl();
5345
+ const ref = useRef(null);
5346
+ useEffect(() => {
5347
+ const el = ref.current;
5348
+ if (!el || typeof IntersectionObserver === "undefined") return;
5349
+ const reduced = window.matchMedia?.("(prefers-reduced-motion: reduce)");
5350
+ const play = () => {
5351
+ if (reduced?.matches) {
5352
+ el.pause();
5353
+ return;
5354
+ }
5355
+ void el.play().catch(() => {
5356
+ });
5357
+ };
5358
+ const observer = new IntersectionObserver((entries) => {
5359
+ for (const entry of entries) {
5360
+ if (entry.isIntersecting) {
5361
+ if (el.preload === "none") el.preload = "auto";
5362
+ play();
5363
+ } else {
5364
+ el.pause();
5365
+ }
5366
+ }
5367
+ }, {
5368
+ threshold: 0.25
5369
+ });
5370
+ observer.observe(el);
5371
+ reduced?.addEventListener("change", play);
5372
+ return () => {
5373
+ observer.disconnect();
5374
+ reduced?.removeEventListener("change", play);
5375
+ };
5376
+ }, []);
5377
+ const fillStyle = fill2 ? {
5378
+ position: "absolute",
5379
+ inset: 0,
5380
+ width: "100%",
5381
+ height: "100%"
5382
+ } : {};
5383
+ return jsx("video", {
5384
+ ref,
5385
+ src: assetUrl(src),
5386
+ poster: poster ? assetUrl(poster) : void 0,
5387
+ className,
5388
+ style: {
5389
+ ...fillStyle,
5390
+ ...style
5391
+ },
5392
+ autoPlay: true,
5393
+ loop: true,
5394
+ muted: true,
5395
+ playsInline: true,
5396
+ preload: priority ? "auto" : "none",
5397
+ "aria-hidden": true,
5398
+ tabIndex: -1
5399
+ });
5400
+ }
5341
5401
  const badge$5 = "_badge_1bagf_1";
5342
5402
  const neutral$1 = "_neutral_1bagf_12";
5343
5403
  const success$1 = "_success_1bagf_17";
@@ -5555,7 +5615,6 @@ const ES = {
5555
5615
  "Close size guide": "Cerrar la guía de tallas",
5556
5616
  Color: "Color",
5557
5617
  "Color:": "Color:",
5558
- "Complete the look with everyday essentials and finishing details": "Completa tu look con básicos para el día a día y detalles que marcan la diferencia",
5559
5618
  "Continue shopping": "Seguir comprando",
5560
5619
  DAZN: "DAZN",
5561
5620
  "DAZN Shop": "Tienda DAZN",
@@ -5587,6 +5646,7 @@ const ES = {
5587
5646
  "One moment": "Un momento",
5588
5647
  "One or more items just sold out. Adjust your cart to continue.": "Uno o más artículos se han agotado. Ajusta tu carrito para continuar.",
5589
5648
  "Only {0} left": "Solo quedan {0}",
5649
+ "Only {0} left in {1} size": "Solo quedan {0} en talla {1}",
5590
5650
  "Order #{0}": "Pedido n.º {0}",
5591
5651
  "Order already placed": "Pedido ya realizado",
5592
5652
  "Order not found": "Pedido no encontrado",
@@ -5617,7 +5677,6 @@ const ES = {
5617
5677
  "Shipping address": "Dirección de envío",
5618
5678
  "Shipping and returns": "Envíos y devoluciones",
5619
5679
  "Shop menu": "Menú de la tienda",
5620
- "Shop now": "Comprar ahora",
5621
5680
  Size: "Talla",
5622
5681
  "Size guide": "Guía de tallas",
5623
5682
  "Something looks off": "Algo no va bien",
@@ -5625,6 +5684,7 @@ const ES = {
5625
5684
  "Standard or express delivery": "Envío estándar o urgente",
5626
5685
  Subtotal: "Subtotal",
5627
5686
  "Swipe down for more": "Desliza hacia abajo para ver más",
5687
+ "The DAZN Shop collection": "La colección de DAZN Shop",
5628
5688
  "T-Shirts": "Camisetas",
5629
5689
  Tax: "Impuestos",
5630
5690
  "That is not possible right now": "Eso no es posible en este momento",
@@ -6835,426 +6895,130 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
6835
6895
  })
6836
6896
  });
6837
6897
  }
6838
- const page$6 = "_page_1v9my_8";
6839
- const widget = "_widget_1v9my_18";
6840
- const titleRow = "_titleRow_1v9my_26";
6841
- const headline$1 = "_headline_1v9my_42";
6842
- const track$5 = "_track_1v9my_74";
6843
- const rule$1 = "_rule_1v9my_99";
6844
- const help = "_help_1v9my_109";
6845
- const helpTitle = "_helpTitle_1v9my_115";
6846
- const helpRows = "_helpRows_1v9my_122";
6847
- const helpRow = "_helpRow_1v9my_122";
6848
- const cancel = "_cancel_1v9my_180";
6849
- const cancelledHead = "_cancelledHead_1v9my_204";
6850
- const cancelledTitle = "_cancelledTitle_1v9my_210";
6851
- const cancelledMeta = "_cancelledMeta_1v9my_219";
6898
+ const page$6 = "_page_1c7ro_7";
6899
+ const titles$2 = "_titles_1c7ro_15";
6900
+ const title$k = "_title_1c7ro_15";
6901
+ const subtitle$7 = "_subtitle_1c7ro_30";
6902
+ const list$2 = "_list_1c7ro_38";
6903
+ const card$3 = "_card_1c7ro_48";
6904
+ const checkSlot = "_checkSlot_1c7ro_61";
6905
+ const check = "_check_1c7ro_61";
6906
+ const row$6 = "_row_1c7ro_105";
6907
+ const line$1 = "_line_1c7ro_113";
6908
+ const thumb$1 = "_thumb_1c7ro_119";
6909
+ const img$1 = "_img_1c7ro_129";
6910
+ const placeholder$7 = "_placeholder_1c7ro_133";
6911
+ const meta$2 = "_meta_1c7ro_138";
6912
+ const name$2 = "_name_1c7ro_147";
6913
+ const attrs$1 = "_attrs_1c7ro_159";
6914
+ const price$3 = "_price_1c7ro_167";
6915
+ const paid$2 = "_paid_1c7ro_176";
6916
+ const was$3 = "_was_1c7ro_184";
6917
+ const reason = "_reason_1c7ro_199";
6918
+ const reasonSet = "_reasonSet_1c7ro_217";
6852
6919
  const styles$A = {
6853
6920
  page: page$6,
6854
- widget,
6855
- titleRow,
6856
- headline: headline$1,
6857
- track: track$5,
6858
- rule: rule$1,
6859
- help,
6860
- helpTitle,
6861
- helpRows,
6862
- helpRow,
6863
- cancel,
6864
- cancelledHead,
6865
- cancelledTitle,
6866
- cancelledMeta
6921
+ titles: titles$2,
6922
+ title: title$k,
6923
+ subtitle: subtitle$7,
6924
+ list: list$2,
6925
+ card: card$3,
6926
+ checkSlot,
6927
+ check,
6928
+ row: row$6,
6929
+ line: line$1,
6930
+ thumb: thumb$1,
6931
+ img: img$1,
6932
+ placeholder: placeholder$7,
6933
+ meta: meta$2,
6934
+ name: name$2,
6935
+ attrs: attrs$1,
6936
+ price: price$3,
6937
+ paid: paid$2,
6938
+ was: was$3,
6939
+ reason,
6940
+ reasonSet
6867
6941
  };
6868
- function RedirectLink() {
6869
- return jsxs("svg", {
6870
- width: "14",
6871
- height: "14",
6872
- viewBox: "0 0 14 14",
6873
- fill: "none",
6874
- "aria-hidden": "true",
6875
- children: [jsx("path", {
6876
- d: "M3.37413 1.63539C2.84882 1.63539 2.39164 1.90422 2.08646 2.29534C1.78479 2.68228 1.63445 3.17776 1.63445 3.66795V3.67088L1.66569 10.3328C1.66636 10.8221 1.81652 11.3164 2.1177 11.7025C2.42287 12.0935 2.8802 12.3615 3.40537 12.3615L3.4044 12.3625L10.6248 12.3654C11.1499 12.3653 11.6063 12.0965 11.9115 11.7054C12.2134 11.3185 12.3644 10.8232 12.3645 10.3328V8.33347C12.3645 7.94707 12.0508 7.63363 11.6645 7.63349C11.278 7.63349 10.9645 7.94699 10.9645 8.33347V10.3328C10.9644 10.5489 10.8962 10.7317 10.8083 10.8444C10.7238 10.9526 10.6512 10.9654 10.6248 10.9654L3.40537 10.9625C3.37921 10.9625 3.30653 10.9498 3.22184 10.8415C3.13389 10.7287 3.06474 10.5461 3.06466 10.3299V10.327L3.03342 3.66405C3.03416 3.44927 3.10311 3.26759 3.1906 3.15542C3.27527 3.04709 3.34796 3.03436 3.37413 3.03436H5.44477C5.83092 3.03423 6.14439 2.72147 6.14474 2.33537C6.14474 1.94897 5.83113 1.63553 5.44477 1.63539H3.37413Z",
6877
- fill: "currentColor"
6878
- }), jsx("path", {
6879
- d: "M8.683 1.63442C8.29663 1.63442 7.9832 1.94806 7.98303 2.33439C7.98303 2.72087 8.29652 3.03436 8.683 3.03436H9.97458L6.504 6.50495C6.23093 6.77819 6.23093 7.22163 6.504 7.49487C6.77724 7.76794 7.22068 7.76794 7.49392 7.49487L10.9645 4.02331V5.31587C10.9645 5.70233 11.278 6.01582 11.6645 6.01584C12.0508 6.01571 12.3645 5.70226 12.3645 5.31587V2.33439C12.3643 2.04478 12.1878 1.79638 11.9369 1.69006L11.9271 1.68616C11.9116 1.67987 11.8951 1.67664 11.8793 1.67152C11.8526 1.66289 11.8261 1.6535 11.7982 1.64809C11.7924 1.64696 11.7865 1.64711 11.7807 1.64613C11.7428 1.63977 11.7042 1.63443 11.6645 1.63442H8.683Z",
6880
- fill: "currentColor"
6881
- })]
6882
- });
6883
- }
6884
- function ChevronRight$1() {
6942
+ function Chevron$1() {
6885
6943
  return jsx("svg", {
6886
6944
  width: "16",
6887
6945
  height: "16",
6888
6946
  viewBox: "0 0 16 16",
6889
6947
  fill: "none",
6890
6948
  "aria-hidden": "true",
6891
- children: jsx("g", {
6892
- transform: "translate(4.28 1.96)",
6893
- children: jsx("path", {
6894
- d: "M7.42763 6.03763C7.42763 5.83763 7.33763 5.64763 7.18763 5.51763L1.15763 0.177629C0.867628 -0.0823714 0.427629 -0.0523713 0.177629 0.237629C-0.0823713 0.527629 -0.0523714 0.967629 0.237629 1.22763L5.67763 6.04763L0.237629 10.8576C-0.0523709 11.1176 -0.0823709 11.5576 0.177629 11.8476C0.437629 12.1376 0.877629 12.1676 1.16763 11.9076L7.19763 6.56763C7.34763 6.43763 7.43763 6.24763 7.43763 6.04763L7.42763 6.03763Z",
6895
- fill: "currentColor"
6896
- })
6949
+ children: jsx("path", {
6950
+ d: "m6.3 4.1 3.4 3.9-3.4 3.9",
6951
+ stroke: "currentColor",
6952
+ strokeWidth: "1.6",
6953
+ strokeLinecap: "round",
6954
+ strokeLinejoin: "round"
6897
6955
  })
6898
6956
  });
6899
6957
  }
6900
- function OrderTrackingView(props) {
6901
- return jsx(ShopSurface, {
6902
- tone: "light",
6903
- fill: true,
6904
- children: jsx(OrderTrackingContent, {
6905
- ...props
6906
- })
6958
+ function Tick() {
6959
+ return jsxs("svg", {
6960
+ width: "20",
6961
+ height: "20",
6962
+ viewBox: "0 0 20 20",
6963
+ fill: "none",
6964
+ "aria-hidden": "true",
6965
+ children: [jsx("circle", {
6966
+ cx: "10",
6967
+ cy: "10",
6968
+ r: "10",
6969
+ fill: "currentColor"
6970
+ }), jsx("path", {
6971
+ d: "m5.8 10.3 2.7 2.7 5.7-5.7",
6972
+ stroke: "var(--color-text-strong)",
6973
+ strokeWidth: "1.8",
6974
+ strokeLinecap: "round",
6975
+ strokeLinejoin: "round"
6976
+ })]
6907
6977
  });
6908
6978
  }
6909
- function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onContactSupport, onCancelled, onReorder }) {
6910
- const t = useT();
6911
- const { api } = useShop();
6912
- const locale = useLocale(localeProp);
6913
- const [order, setOrder] = useState(null);
6914
- const [state, setState] = useState("loading");
6915
- const [errorCode, setErrorCode] = useState(void 0);
6916
- const [cancelOpen, setCancelOpen] = useState(false);
6917
- const [cancelling, setCancelling] = useState(false);
6918
- const [cancelError, setCancelError] = useState(null);
6919
- const emit = useShopEvent();
6920
- const load = useCallback(async () => {
6921
- setState("loading");
6922
- try {
6923
- setOrder(await api.orders.get(orderRef));
6924
- setState("ready");
6925
- } catch (err) {
6926
- setErrorCode(codeOf(err));
6927
- setState("error");
6928
- }
6929
- }, [api, orderRef]);
6930
- useEffect(() => {
6931
- void load();
6932
- }, [load]);
6933
- if (state === "loading") {
6934
- return jsxs("div", {
6935
- className: styles$A.page,
6936
- children: [jsx(Skeleton, {
6937
- height: 206,
6938
- radius: 8
6939
- }), jsx(Skeleton, {
6940
- height: 48,
6941
- radius: 8
6942
- }), jsx(Skeleton, {
6943
- height: 113,
6944
- radius: 18
6945
- }), jsx(Skeleton, {
6946
- height: 240,
6947
- radius: 18
6948
- })]
6949
- });
6950
- }
6951
- if (state === "error" || !order) {
6952
- return jsx(ErrorState, {
6953
- code: errorCode,
6954
- onRetry: () => void load()
6955
- });
6979
+ const RETURN_REASONS = [{
6980
+ value: "too_large",
6981
+ label: "Too large"
6982
+ }, {
6983
+ value: "too_small",
6984
+ label: "Too small"
6985
+ }, {
6986
+ value: "arrived_too_late",
6987
+ label: "Arrived too late"
6988
+ }, {
6989
+ value: "item_damaged",
6990
+ label: "Item is damaged"
6991
+ }, {
6992
+ value: "not_as_described",
6993
+ label: "Item doesn't match description"
6994
+ }, {
6995
+ value: "changed_my_mind",
6996
+ label: "Changed my mind"
6997
+ }];
6998
+ const REASON_LABEL = new Map(RETURN_REASONS.map((r) => [r.value, r.label]));
6999
+ function unitsLeft(item2) {
7000
+ return item2.qty - item2.cancelled_qty - item2.refunded_qty - (item2.returned_qty ?? 0);
7001
+ }
7002
+ function ReturnItemsView({ order, onSubmit, busy = false }) {
7003
+ const { format } = useMoney();
7004
+ const [chosen, setChosen] = useState({});
7005
+ const [reasonFor, setReasonFor] = useState(null);
7006
+ const returnable = useMemo(() => order.items.filter((i) => unitsLeft(i) > 0), [order.items]);
7007
+ const selected2 = Object.entries(chosen).filter(([, reason2]) => reason2 !== void 0);
7008
+ const canSubmit = selected2.length > 0;
7009
+ function remaining(item2) {
7010
+ return unitsLeft(item2);
6956
7011
  }
6957
- async function confirmCancellation(reason2) {
6958
- setCancelling(true);
6959
- setCancelError(null);
6960
- try {
6961
- const updated = await api.orders.requestCancellation(orderRef, {
6962
- reason: reason2
6963
- });
6964
- setOrder(updated);
6965
- setCancelOpen(false);
6966
- emit({
6967
- type: "order_cancellation_requested",
6968
- orderRef,
6969
- reason: reason2
7012
+ function toggle2(lineRef) {
7013
+ if (lineRef in chosen) {
7014
+ setChosen((prev) => {
7015
+ const next = {
7016
+ ...prev
7017
+ };
7018
+ delete next[lineRef];
7019
+ return next;
6970
7020
  });
6971
- onCancelled?.(updated);
6972
- } catch (err) {
6973
- setCancelError(t(treatmentFor(codeOf(err)).body));
6974
- } finally {
6975
- setCancelling(false);
6976
- }
6977
- }
6978
- if (order.status === "cancelled") {
6979
- return jsxs("div", {
6980
- className: styles$A.page,
6981
- children: [jsxs("div", {
6982
- className: styles$A.cancelledHead,
6983
- children: [jsx("h1", {
6984
- className: styles$A.cancelledTitle,
6985
- children: "Order cancelled"
6986
- }), jsx("p", {
6987
- className: styles$A.cancelledMeta,
6988
- children: `Order #${shortRef$1(order.order_ref)} · Placed ${placedOn(order.placed_at, locale)}`
6989
- })]
6990
- }), onReorder && jsx(Button, {
6991
- variant: "primary",
6992
- fullWidth: true,
6993
- onClick: () => {
6994
- emit({
6995
- type: "reorder_requested",
6996
- orderRef: order.order_ref
6997
- });
6998
- onReorder();
6999
- },
7000
- children: "Reorder"
7001
- }), jsx(OrderLines, {
7002
- order
7003
- }), jsx(ShippingAddressCard, {
7004
- order
7005
- }), jsx(OrderSummaryCard, {
7006
- order
7007
- })]
7008
- });
7009
- }
7010
- return jsxs("div", {
7011
- className: styles$A.page,
7012
- children: [jsxs("section", {
7013
- className: styles$A.widget,
7014
- "aria-label": t("Delivery status"),
7015
- children: [jsxs("div", {
7016
- className: styles$A.titleRow,
7017
- children: [jsx("h1", {
7018
- className: styles$A.headline,
7019
- children: `Order #${shortRef$1(order.order_ref)}`
7020
- }), order.tracking?.url && jsxs("a", {
7021
- className: styles$A.track,
7022
- href: order.tracking.url,
7023
- target: "_blank",
7024
- rel: "noopener noreferrer",
7025
- children: ["Track", jsx("span", {
7026
- className: "visually-hidden",
7027
- children: ` ${order.tracking.carrier}, opens in a new tab`
7028
- }), jsx(RedirectLink, {})]
7029
- })]
7030
- }), jsx(OrderTimeline, {
7031
- progress: order.progress,
7032
- ...order.estimated_delivery ? {
7033
- estimatedDelivery: order.estimated_delivery
7034
- } : {},
7035
- locale
7036
- }), order.can_return && onStartReturn && jsx(Button, {
7037
- variant: "secondary",
7038
- fullWidth: true,
7039
- onClick: onStartReturn,
7040
- children: "Return items"
7041
- })]
7042
- }), jsx("hr", {
7043
- className: styles$A.rule
7044
- }), jsx(OrderLines, {
7045
- order
7046
- }), jsx(ShippingAddressCard, {
7047
- order
7048
- }), jsx(OrderSummaryCard, {
7049
- order
7050
- }), order.can_cancel && jsx("button", {
7051
- type: "button",
7052
- className: styles$A.cancel,
7053
- onClick: () => setCancelOpen(true),
7054
- children: "Cancel order"
7055
- }), jsx(NeedHelp, {
7056
- order,
7057
- ...onStartReturn ? {
7058
- onStartReturn
7059
- } : {},
7060
- ...onContactSupport ? {
7061
- onContactSupport
7062
- } : {}
7063
- }), cancelOpen && jsx(ReasonSheet, {
7064
- title: "Reason for cancelling",
7065
- options: CANCEL_REASONS,
7066
- ctaLabel: "Cancel order",
7067
- closeLabel: "Close reasons",
7068
- busy: cancelling,
7069
- onClose: () => setCancelOpen(false),
7070
- onConfirm: (reason2) => void confirmCancellation(reason2),
7071
- ...cancelError ? {
7072
- error: cancelError
7073
- } : {}
7074
- })]
7075
- });
7076
- }
7077
- const CANCEL_REASONS = [{
7078
- value: "changed_my_mind",
7079
- label: "Changed my mind"
7080
- }, {
7081
- value: "ordered_by_mistake",
7082
- label: "Ordered by mistake"
7083
- }, {
7084
- value: "delivery_too_long",
7085
- label: "Delivery takes too long"
7086
- }];
7087
- function placedOn(iso, locale) {
7088
- const d = new Date(iso);
7089
- const day = d.getUTCDate();
7090
- const month = new Intl.DateTimeFormat(locale, {
7091
- month: "short",
7092
- timeZone: "UTC"
7093
- }).format(d);
7094
- return `${day} ${month}, ${d.getUTCFullYear()}`;
7095
- }
7096
- function NeedHelp({ order, onStartReturn, onContactSupport }) {
7097
- const emit = useShopEvent();
7098
- if (order.status !== "delivered") return null;
7099
- return jsxs("section", {
7100
- className: styles$A.help,
7101
- "aria-labelledby": "order-help",
7102
- children: [jsx("h2", {
7103
- className: styles$A.helpTitle,
7104
- id: "order-help",
7105
- children: "Need help?"
7106
- }), jsxs("div", {
7107
- className: styles$A.helpRows,
7108
- children: [onStartReturn && jsx(HelpRow, {
7109
- label: "Start a return",
7110
- onClick: onStartReturn
7111
- }), jsx(HelpRow, {
7112
- label: "Contact support",
7113
- onClick: () => {
7114
- emit({
7115
- type: "support_requested",
7116
- orderRef: order.order_ref
7117
- });
7118
- onContactSupport?.();
7119
- }
7120
- })]
7121
- })]
7122
- });
7123
- }
7124
- function HelpRow({ label: label2, onClick }) {
7125
- return jsxs("button", {
7126
- type: "button",
7127
- className: styles$A.helpRow,
7128
- onClick,
7129
- children: [jsx("span", {
7130
- children: label2
7131
- }), jsx(ChevronRight$1, {})]
7132
- });
7133
- }
7134
- function shortRef$1(orderRef) {
7135
- return orderRef.replace(/^ord_/, "");
7136
- }
7137
- const page$5 = "_page_1c7ro_7";
7138
- const titles$2 = "_titles_1c7ro_15";
7139
- const title$k = "_title_1c7ro_15";
7140
- const subtitle$7 = "_subtitle_1c7ro_30";
7141
- const list$2 = "_list_1c7ro_38";
7142
- const card$3 = "_card_1c7ro_48";
7143
- const checkSlot = "_checkSlot_1c7ro_61";
7144
- const check = "_check_1c7ro_61";
7145
- const row$6 = "_row_1c7ro_105";
7146
- const line$1 = "_line_1c7ro_113";
7147
- const thumb$1 = "_thumb_1c7ro_119";
7148
- const img$1 = "_img_1c7ro_129";
7149
- const placeholder$7 = "_placeholder_1c7ro_133";
7150
- const meta$2 = "_meta_1c7ro_138";
7151
- const name$2 = "_name_1c7ro_147";
7152
- const attrs$1 = "_attrs_1c7ro_159";
7153
- const price$3 = "_price_1c7ro_167";
7154
- const paid$2 = "_paid_1c7ro_176";
7155
- const was$3 = "_was_1c7ro_184";
7156
- const reason = "_reason_1c7ro_199";
7157
- const reasonSet = "_reasonSet_1c7ro_217";
7158
- const styles$z = {
7159
- page: page$5,
7160
- titles: titles$2,
7161
- title: title$k,
7162
- subtitle: subtitle$7,
7163
- list: list$2,
7164
- card: card$3,
7165
- checkSlot,
7166
- check,
7167
- row: row$6,
7168
- line: line$1,
7169
- thumb: thumb$1,
7170
- img: img$1,
7171
- placeholder: placeholder$7,
7172
- meta: meta$2,
7173
- name: name$2,
7174
- attrs: attrs$1,
7175
- price: price$3,
7176
- paid: paid$2,
7177
- was: was$3,
7178
- reason,
7179
- reasonSet
7180
- };
7181
- function Chevron$1() {
7182
- return jsx("svg", {
7183
- width: "16",
7184
- height: "16",
7185
- viewBox: "0 0 16 16",
7186
- fill: "none",
7187
- "aria-hidden": "true",
7188
- children: jsx("path", {
7189
- d: "m6.3 4.1 3.4 3.9-3.4 3.9",
7190
- stroke: "currentColor",
7191
- strokeWidth: "1.6",
7192
- strokeLinecap: "round",
7193
- strokeLinejoin: "round"
7194
- })
7195
- });
7196
- }
7197
- function Tick() {
7198
- return jsxs("svg", {
7199
- width: "20",
7200
- height: "20",
7201
- viewBox: "0 0 20 20",
7202
- fill: "none",
7203
- "aria-hidden": "true",
7204
- children: [jsx("circle", {
7205
- cx: "10",
7206
- cy: "10",
7207
- r: "10",
7208
- fill: "currentColor"
7209
- }), jsx("path", {
7210
- d: "m5.8 10.3 2.7 2.7 5.7-5.7",
7211
- stroke: "var(--color-text-strong)",
7212
- strokeWidth: "1.8",
7213
- strokeLinecap: "round",
7214
- strokeLinejoin: "round"
7215
- })]
7216
- });
7217
- }
7218
- const RETURN_REASONS = [{
7219
- value: "too_large",
7220
- label: "Too large"
7221
- }, {
7222
- value: "too_small",
7223
- label: "Too small"
7224
- }, {
7225
- value: "arrived_too_late",
7226
- label: "Arrived too late"
7227
- }, {
7228
- value: "item_damaged",
7229
- label: "Item is damaged"
7230
- }, {
7231
- value: "not_as_described",
7232
- label: "Item doesn't match description"
7233
- }, {
7234
- value: "changed_my_mind",
7235
- label: "Changed my mind"
7236
- }];
7237
- const REASON_LABEL = new Map(RETURN_REASONS.map((r) => [r.value, r.label]));
7238
- function ReturnItemsView({ order, onSubmit, busy = false }) {
7239
- const { format } = useMoney();
7240
- const [chosen, setChosen] = useState({});
7241
- const [reasonFor, setReasonFor] = useState(null);
7242
- const returnable = useMemo(() => order.items.filter((i) => i.qty - i.cancelled_qty - i.refunded_qty > 0), [order.items]);
7243
- const selected2 = Object.entries(chosen).filter(([, reason2]) => reason2 !== void 0);
7244
- const canSubmit = selected2.length > 0;
7245
- function remaining(item2) {
7246
- return item2.qty - item2.cancelled_qty - item2.refunded_qty;
7247
- }
7248
- function toggle2(lineRef) {
7249
- if (lineRef in chosen) {
7250
- setChosen((prev) => {
7251
- const next = {
7252
- ...prev
7253
- };
7254
- delete next[lineRef];
7255
- return next;
7256
- });
7257
- return;
7021
+ return;
7258
7022
  }
7259
7023
  setChosen((prev) => ({
7260
7024
  ...prev,
@@ -7271,72 +7035,72 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
7271
7035
  if (items2.length > 0) onSubmit(items2);
7272
7036
  }
7273
7037
  return jsxs("div", {
7274
- className: styles$z.page,
7038
+ className: styles$A.page,
7275
7039
  children: [jsxs("div", {
7276
- className: styles$z.titles,
7040
+ className: styles$A.titles,
7277
7041
  children: [jsx("h1", {
7278
- className: styles$z.title,
7042
+ className: styles$A.title,
7279
7043
  children: "What do you want to return?"
7280
7044
  }), jsx("p", {
7281
- className: styles$z.subtitle,
7045
+ className: styles$A.subtitle,
7282
7046
  children: "Select items you want to return"
7283
7047
  })]
7284
7048
  }), jsx("div", {
7285
- className: styles$z.list,
7049
+ className: styles$A.list,
7286
7050
  children: returnable.map((item2) => {
7287
7051
  const picked = item2.line_ref in chosen;
7288
7052
  const reason2 = chosen[item2.line_ref];
7289
7053
  return jsxs("div", {
7290
- className: styles$z.card,
7054
+ className: styles$A.card,
7291
7055
  children: [jsx("button", {
7292
7056
  type: "button",
7293
7057
  role: "checkbox",
7294
7058
  "aria-checked": picked,
7295
7059
  "aria-label": item2.title ?? item2.sku,
7296
- className: styles$z.checkSlot,
7060
+ className: styles$A.checkSlot,
7297
7061
  onClick: () => toggle2(item2.line_ref),
7298
7062
  children: jsx("span", {
7299
- className: styles$z.check,
7063
+ className: styles$A.check,
7300
7064
  children: picked ? jsx(Tick, {}) : null
7301
7065
  })
7302
7066
  }), jsxs("div", {
7303
- className: styles$z.row,
7067
+ className: styles$A.row,
7304
7068
  children: [jsxs("div", {
7305
- className: styles$z.line,
7069
+ className: styles$A.line,
7306
7070
  children: [jsx("div", {
7307
- className: styles$z.thumb,
7071
+ className: styles$A.thumb,
7308
7072
  children: item2.image ? jsx(ShopImage, {
7309
7073
  src: item2.image,
7310
7074
  alt: "",
7311
7075
  fill: true,
7312
7076
  sizes: "48px",
7313
- className: styles$z.img
7077
+ className: styles$A.img
7314
7078
  }) : jsx("div", {
7315
- className: styles$z.placeholder,
7079
+ className: styles$A.placeholder,
7316
7080
  "aria-hidden": "true"
7317
7081
  })
7318
7082
  }), jsxs("div", {
7319
- className: styles$z.meta,
7083
+ className: styles$A.meta,
7320
7084
  children: [jsx("p", {
7321
- className: styles$z.name,
7085
+ className: styles$A.name,
7322
7086
  children: item2.title ?? item2.sku
7323
7087
  }), item2.attributes?.size && jsx("p", {
7324
- className: styles$z.attrs,
7088
+ className: styles$A.attrs,
7325
7089
  children: `Size: ${item2.attributes.size}`
7326
7090
  })]
7327
7091
  }), jsxs("div", {
7328
- className: styles$z.price,
7092
+ className: styles$A.price,
7329
7093
  children: [jsx("span", {
7330
- className: styles$z.paid,
7094
+ className: styles$A.paid,
7331
7095
  children: format(item2.unit_price)
7332
7096
  }), item2.compare_at_unit_price && jsx("span", {
7333
- className: styles$z.was,
7097
+ className: styles$A.was,
7334
7098
  children: format(item2.compare_at_unit_price)
7335
7099
  })]
7336
7100
  })]
7337
7101
  }), jsxs("button", {
7338
7102
  type: "button",
7339
- className: `${styles$z.reason} ${reason2 ? styles$z.reasonSet : ""}`,
7103
+ className: `${styles$A.reason} ${reason2 ? styles$A.reasonSet : ""}`,
7340
7104
  onClick: () => setReasonFor(item2.line_ref),
7341
7105
  "aria-haspopup": "dialog",
7342
7106
  children: [jsx("span", {
@@ -7372,7 +7136,7 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
7372
7136
  })]
7373
7137
  });
7374
7138
  }
7375
- const page$4 = "_page_1r0ea_7";
7139
+ const page$5 = "_page_1r0ea_7";
7376
7140
  const intro$1 = "_intro_1r0ea_15";
7377
7141
  const title$j = "_title_1r0ea_22";
7378
7142
  const subtitle$6 = "_subtitle_1r0ea_31";
@@ -7386,8 +7150,8 @@ const body$5 = "_body_1r0ea_95";
7386
7150
  const body2 = "_body2_1r0ea_103";
7387
7151
  const download = "_download_1r0ea_121";
7388
7152
  const note$1 = "_note_1r0ea_143";
7389
- const styles$y = {
7390
- page: page$4,
7153
+ const styles$z = {
7154
+ page: page$5,
7391
7155
  intro: intro$1,
7392
7156
  title: title$j,
7393
7157
  subtitle: subtitle$6,
@@ -7404,35 +7168,35 @@ const styles$y = {
7404
7168
  };
7405
7169
  function ReturnLabelView({ ret, onDone }) {
7406
7170
  return jsxs("div", {
7407
- className: styles$y.page,
7171
+ className: styles$z.page,
7408
7172
  children: [jsxs("div", {
7409
- className: styles$y.intro,
7173
+ className: styles$z.intro,
7410
7174
  children: [jsx("h1", {
7411
- className: styles$y.title,
7175
+ className: styles$z.title,
7412
7176
  children: "We’ve generated your return label"
7413
7177
  }), jsx("p", {
7414
- className: styles$y.subtitle,
7178
+ className: styles$z.subtitle,
7415
7179
  children: "Follow the instructions below to complete your return"
7416
7180
  })]
7417
7181
  }), jsxs("div", {
7418
- className: styles$y.card,
7182
+ className: styles$z.card,
7419
7183
  children: [jsxs("section", {
7420
- className: styles$y.step,
7184
+ className: styles$z.step,
7421
7185
  children: [jsxs("div", {
7422
- className: styles$y.stepHead,
7186
+ className: styles$z.stepHead,
7423
7187
  children: [jsx("span", {
7424
- className: styles$y.number,
7188
+ className: styles$z.number,
7425
7189
  "aria-hidden": "true",
7426
7190
  children: "1"
7427
7191
  }), jsx("h2", {
7428
- className: styles$y.stepTitle,
7192
+ className: styles$z.stepTitle,
7429
7193
  children: "Download your return label"
7430
7194
  })]
7431
7195
  }), jsx("p", {
7432
- className: styles$y.body,
7196
+ className: styles$z.body,
7433
7197
  children: "Tap the button below to download your pre-paid return label"
7434
7198
  }), ret.label_url && jsxs("a", {
7435
- className: styles$y.download,
7199
+ className: styles$z.download,
7436
7200
  href: ret.label_url,
7437
7201
  target: "_blank",
7438
7202
  rel: "noopener noreferrer",
@@ -7441,23 +7205,23 @@ function ReturnLabelView({ ret, onDone }) {
7441
7205
  children: " (opens in a new tab)"
7442
7206
  })]
7443
7207
  }), ret.label_email && jsxs("p", {
7444
- className: styles$y.note,
7208
+ className: styles$z.note,
7445
7209
  children: ["You’ll receive a shipping label PDF to your email as well.", jsx("br", {}), ret.label_email]
7446
7210
  })]
7447
7211
  }), jsxs("section", {
7448
- className: styles$y.step2,
7212
+ className: styles$z.step2,
7449
7213
  children: [jsxs("div", {
7450
- className: styles$y.stepHead,
7214
+ className: styles$z.stepHead,
7451
7215
  children: [jsx("span", {
7452
- className: styles$y.number,
7216
+ className: styles$z.number,
7453
7217
  "aria-hidden": "true",
7454
7218
  children: "2"
7455
7219
  }), jsx("h2", {
7456
- className: styles$y.stepTitle,
7220
+ className: styles$z.stepTitle,
7457
7221
  children: "Pack and ship the item"
7458
7222
  })]
7459
7223
  }), jsxs("p", {
7460
- className: styles$y.body2,
7224
+ className: styles$z.body2,
7461
7225
  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."]
7462
7226
  })]
7463
7227
  })]
@@ -7469,7 +7233,7 @@ function ReturnLabelView({ ret, onDone }) {
7469
7233
  })]
7470
7234
  });
7471
7235
  }
7472
- const page$3 = "_page_o44fl_8";
7236
+ const page$4 = "_page_o44fl_8";
7473
7237
  const titles$1 = "_titles_o44fl_15";
7474
7238
  const title$i = "_title_o44fl_15";
7475
7239
  const subtitle$5 = "_subtitle_o44fl_30";
@@ -7484,8 +7248,8 @@ const attrs = "_attrs_o44fl_100";
7484
7248
  const price$2 = "_price_o44fl_115";
7485
7249
  const paid$1 = "_paid_o44fl_124";
7486
7250
  const was$2 = "_was_o44fl_132";
7487
- const styles$x = {
7488
- page: page$3,
7251
+ const styles$y = {
7252
+ page: page$4,
7489
7253
  titles: titles$1,
7490
7254
  title: title$i,
7491
7255
  subtitle: subtitle$5,
@@ -7517,42 +7281,42 @@ function ReturnTrackingView({ ret, locale: localeProp }) {
7517
7281
  tone: "light",
7518
7282
  fill: true,
7519
7283
  children: jsxs("div", {
7520
- className: styles$x.page,
7284
+ className: styles$y.page,
7521
7285
  children: [jsxs("div", {
7522
- className: styles$x.titles,
7286
+ className: styles$y.titles,
7523
7287
  children: [jsx("h1", {
7524
- className: styles$x.title,
7288
+ className: styles$y.title,
7525
7289
  children: "Return in progress"
7526
7290
  }), jsx("p", {
7527
- className: styles$x.subtitle,
7291
+ className: styles$y.subtitle,
7528
7292
  children: `Return #${ret.return_ref} · Reported ${reported}`
7529
7293
  })]
7530
7294
  }), jsx(OrderTimeline, {
7531
7295
  progress: ret.progress,
7532
7296
  locale
7533
7297
  }), jsx("ul", {
7534
- className: styles$x.items,
7298
+ className: styles$y.items,
7535
7299
  children: ret.items.map((item2) => jsxs("li", {
7536
- className: styles$x.item,
7300
+ className: styles$y.item,
7537
7301
  children: [jsx("div", {
7538
- className: styles$x.thumb,
7302
+ className: styles$y.thumb,
7539
7303
  children: item2.image ? jsx(ShopImage, {
7540
7304
  src: item2.image,
7541
7305
  alt: "",
7542
7306
  fill: true,
7543
7307
  sizes: "48px",
7544
- className: styles$x.img
7308
+ className: styles$y.img
7545
7309
  }) : jsx("div", {
7546
- className: styles$x.placeholder,
7310
+ className: styles$y.placeholder,
7547
7311
  "aria-hidden": "true"
7548
7312
  })
7549
7313
  }), jsxs("div", {
7550
- className: styles$x.meta,
7314
+ className: styles$y.meta,
7551
7315
  children: [jsx("p", {
7552
- className: styles$x.name,
7316
+ className: styles$y.name,
7553
7317
  children: item2.title ?? item2.sku
7554
7318
  }), (item2.attributes?.size || pctOff(item2)) && jsxs("p", {
7555
- className: styles$x.attrs,
7319
+ className: styles$y.attrs,
7556
7320
  children: [item2.attributes?.size && jsx("span", {
7557
7321
  children: `Size: ${item2.attributes.size}`
7558
7322
  }), pctOff(item2) !== void 0 && jsx(SaleBadge, {
@@ -7560,12 +7324,12 @@ function ReturnTrackingView({ ret, locale: localeProp }) {
7560
7324
  })]
7561
7325
  })]
7562
7326
  }), jsxs("div", {
7563
- className: styles$x.price,
7327
+ className: styles$y.price,
7564
7328
  children: [jsx("span", {
7565
- className: styles$x.paid,
7329
+ className: styles$y.paid,
7566
7330
  children: format(item2.unit_price)
7567
7331
  }), item2.compare_at_unit_price && jsx("span", {
7568
- className: styles$x.was,
7332
+ className: styles$y.was,
7569
7333
  children: format(item2.compare_at_unit_price)
7570
7334
  })]
7571
7335
  })]
@@ -7612,72 +7376,376 @@ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
7612
7376
  if (!orderRef) return;
7613
7377
  setBusy(true);
7614
7378
  try {
7615
- const created = await api.orders.createReturn(orderRef, {
7616
- items: items2
7379
+ const created = await api.orders.createReturn(orderRef, {
7380
+ items: items2
7381
+ });
7382
+ setRet(created);
7383
+ emit({
7384
+ type: "return_requested",
7385
+ orderRef,
7386
+ returnRef: created.return_ref
7387
+ });
7388
+ } catch (err) {
7389
+ setErrorCode(codeOf(err));
7390
+ setState("error");
7391
+ setBusy(false);
7392
+ }
7393
+ }
7394
+ if (state === "loading") {
7395
+ return jsx("div", {
7396
+ style: {
7397
+ padding: "var(--space-16)",
7398
+ display: "flex",
7399
+ flexDirection: "column",
7400
+ gap: "var(--space-16)"
7401
+ },
7402
+ children: [0, 1, 2].map((i) => jsx(Skeleton, {
7403
+ height: 88,
7404
+ radius: 8
7405
+ }, i))
7406
+ });
7407
+ }
7408
+ if (state === "error") {
7409
+ return jsx(ErrorState, {
7410
+ code: errorCode,
7411
+ onRetry: () => void load()
7412
+ });
7413
+ }
7414
+ if (ret) {
7415
+ return ret.status === "reported" ? jsx(ReturnLabelView, {
7416
+ ret,
7417
+ ...onDone ? {
7418
+ onDone
7419
+ } : {}
7420
+ }) : jsx(ReturnTrackingView, {
7421
+ ret,
7422
+ ...locale ? {
7423
+ locale
7424
+ } : {}
7425
+ });
7426
+ }
7427
+ if (!order) {
7428
+ return jsx(ErrorState, {
7429
+ code: errorCode,
7430
+ onRetry: () => void load()
7431
+ });
7432
+ }
7433
+ if (!order.can_return) {
7434
+ return jsx(ErrorState, {
7435
+ code: "order_not_cancellable",
7436
+ onRetry: () => void load()
7437
+ });
7438
+ }
7439
+ return jsx(ReturnItemsView, {
7440
+ order,
7441
+ onSubmit: (items2) => void submit(items2),
7442
+ busy
7443
+ });
7444
+ }
7445
+ const page$3 = "_page_1v9my_8";
7446
+ const widget = "_widget_1v9my_18";
7447
+ const titleRow = "_titleRow_1v9my_26";
7448
+ const headline$1 = "_headline_1v9my_42";
7449
+ const track$5 = "_track_1v9my_74";
7450
+ const rule$1 = "_rule_1v9my_99";
7451
+ const help = "_help_1v9my_109";
7452
+ const helpTitle = "_helpTitle_1v9my_115";
7453
+ const helpRows = "_helpRows_1v9my_122";
7454
+ const helpRow = "_helpRow_1v9my_122";
7455
+ const cancel = "_cancel_1v9my_180";
7456
+ const cancelledHead = "_cancelledHead_1v9my_204";
7457
+ const cancelledTitle = "_cancelledTitle_1v9my_210";
7458
+ const cancelledMeta = "_cancelledMeta_1v9my_219";
7459
+ const styles$x = {
7460
+ page: page$3,
7461
+ widget,
7462
+ titleRow,
7463
+ headline: headline$1,
7464
+ track: track$5,
7465
+ rule: rule$1,
7466
+ help,
7467
+ helpTitle,
7468
+ helpRows,
7469
+ helpRow,
7470
+ cancel,
7471
+ cancelledHead,
7472
+ cancelledTitle,
7473
+ cancelledMeta
7474
+ };
7475
+ function RedirectLink() {
7476
+ return jsxs("svg", {
7477
+ width: "14",
7478
+ height: "14",
7479
+ viewBox: "0 0 14 14",
7480
+ fill: "none",
7481
+ "aria-hidden": "true",
7482
+ children: [jsx("path", {
7483
+ d: "M3.37413 1.63539C2.84882 1.63539 2.39164 1.90422 2.08646 2.29534C1.78479 2.68228 1.63445 3.17776 1.63445 3.66795V3.67088L1.66569 10.3328C1.66636 10.8221 1.81652 11.3164 2.1177 11.7025C2.42287 12.0935 2.8802 12.3615 3.40537 12.3615L3.4044 12.3625L10.6248 12.3654C11.1499 12.3653 11.6063 12.0965 11.9115 11.7054C12.2134 11.3185 12.3644 10.8232 12.3645 10.3328V8.33347C12.3645 7.94707 12.0508 7.63363 11.6645 7.63349C11.278 7.63349 10.9645 7.94699 10.9645 8.33347V10.3328C10.9644 10.5489 10.8962 10.7317 10.8083 10.8444C10.7238 10.9526 10.6512 10.9654 10.6248 10.9654L3.40537 10.9625C3.37921 10.9625 3.30653 10.9498 3.22184 10.8415C3.13389 10.7287 3.06474 10.5461 3.06466 10.3299V10.327L3.03342 3.66405C3.03416 3.44927 3.10311 3.26759 3.1906 3.15542C3.27527 3.04709 3.34796 3.03436 3.37413 3.03436H5.44477C5.83092 3.03423 6.14439 2.72147 6.14474 2.33537C6.14474 1.94897 5.83113 1.63553 5.44477 1.63539H3.37413Z",
7484
+ fill: "currentColor"
7485
+ }), jsx("path", {
7486
+ d: "M8.683 1.63442C8.29663 1.63442 7.9832 1.94806 7.98303 2.33439C7.98303 2.72087 8.29652 3.03436 8.683 3.03436H9.97458L6.504 6.50495C6.23093 6.77819 6.23093 7.22163 6.504 7.49487C6.77724 7.76794 7.22068 7.76794 7.49392 7.49487L10.9645 4.02331V5.31587C10.9645 5.70233 11.278 6.01582 11.6645 6.01584C12.0508 6.01571 12.3645 5.70226 12.3645 5.31587V2.33439C12.3643 2.04478 12.1878 1.79638 11.9369 1.69006L11.9271 1.68616C11.9116 1.67987 11.8951 1.67664 11.8793 1.67152C11.8526 1.66289 11.8261 1.6535 11.7982 1.64809C11.7924 1.64696 11.7865 1.64711 11.7807 1.64613C11.7428 1.63977 11.7042 1.63443 11.6645 1.63442H8.683Z",
7487
+ fill: "currentColor"
7488
+ })]
7489
+ });
7490
+ }
7491
+ function ChevronRight$1() {
7492
+ return jsx("svg", {
7493
+ width: "16",
7494
+ height: "16",
7495
+ viewBox: "0 0 16 16",
7496
+ fill: "none",
7497
+ "aria-hidden": "true",
7498
+ children: jsx("g", {
7499
+ transform: "translate(4.28 1.96)",
7500
+ children: jsx("path", {
7501
+ d: "M7.42763 6.03763C7.42763 5.83763 7.33763 5.64763 7.18763 5.51763L1.15763 0.177629C0.867628 -0.0823714 0.427629 -0.0523713 0.177629 0.237629C-0.0823713 0.527629 -0.0523714 0.967629 0.237629 1.22763L5.67763 6.04763L0.237629 10.8576C-0.0523709 11.1176 -0.0823709 11.5576 0.177629 11.8476C0.437629 12.1376 0.877629 12.1676 1.16763 11.9076L7.19763 6.56763C7.34763 6.43763 7.43763 6.24763 7.43763 6.04763L7.42763 6.03763Z",
7502
+ fill: "currentColor"
7503
+ })
7504
+ })
7505
+ });
7506
+ }
7507
+ function OrderTrackingView(props) {
7508
+ const [returning, setReturning] = useState(false);
7509
+ if (returning) {
7510
+ return jsx(ReturnFlowView, {
7511
+ orderRef: props.orderRef,
7512
+ onDone: () => setReturning(false)
7513
+ });
7514
+ }
7515
+ return jsx(ShopSurface, {
7516
+ tone: "light",
7517
+ fill: true,
7518
+ children: jsx(OrderTrackingContent, {
7519
+ ...props,
7520
+ onStartReturn: props.onStartReturn ?? (() => setReturning(true))
7521
+ })
7522
+ });
7523
+ }
7524
+ function OrderTrackingContent({ orderRef, locale: localeProp, onStartReturn, onContactSupport, onCancelled, onReorder }) {
7525
+ const t = useT();
7526
+ const { api } = useShop();
7527
+ const locale = useLocale(localeProp);
7528
+ const [order, setOrder] = useState(null);
7529
+ const [state, setState] = useState("loading");
7530
+ const [errorCode, setErrorCode] = useState(void 0);
7531
+ const [cancelOpen, setCancelOpen] = useState(false);
7532
+ const [cancelling, setCancelling] = useState(false);
7533
+ const [cancelError, setCancelError] = useState(null);
7534
+ const emit = useShopEvent();
7535
+ const load = useCallback(async () => {
7536
+ setState("loading");
7537
+ try {
7538
+ setOrder(await api.orders.get(orderRef));
7539
+ setState("ready");
7540
+ } catch (err) {
7541
+ setErrorCode(codeOf(err));
7542
+ setState("error");
7543
+ }
7544
+ }, [api, orderRef]);
7545
+ useEffect(() => {
7546
+ void load();
7547
+ }, [load]);
7548
+ if (state === "loading") {
7549
+ return jsxs("div", {
7550
+ className: styles$x.page,
7551
+ children: [jsx(Skeleton, {
7552
+ height: 206,
7553
+ radius: 8
7554
+ }), jsx(Skeleton, {
7555
+ height: 48,
7556
+ radius: 8
7557
+ }), jsx(Skeleton, {
7558
+ height: 113,
7559
+ radius: 18
7560
+ }), jsx(Skeleton, {
7561
+ height: 240,
7562
+ radius: 18
7563
+ })]
7564
+ });
7565
+ }
7566
+ if (state === "error" || !order) {
7567
+ return jsx(ErrorState, {
7568
+ code: errorCode,
7569
+ onRetry: () => void load()
7570
+ });
7571
+ }
7572
+ const currentStep = order.progress.find((entry) => entry.current)?.step;
7573
+ const inTransit = currentStep === "on_its_way" || currentStep === "out_for_delivery";
7574
+ async function confirmCancellation(reason2) {
7575
+ setCancelling(true);
7576
+ setCancelError(null);
7577
+ try {
7578
+ const updated = await api.orders.requestCancellation(orderRef, {
7579
+ reason: reason2
7617
7580
  });
7618
- setRet(created);
7581
+ setOrder(updated);
7582
+ setCancelOpen(false);
7619
7583
  emit({
7620
- type: "return_requested",
7584
+ type: "order_cancellation_requested",
7621
7585
  orderRef,
7622
- returnRef: created.return_ref
7586
+ reason: reason2
7623
7587
  });
7588
+ onCancelled?.(updated);
7624
7589
  } catch (err) {
7625
- setErrorCode(codeOf(err));
7626
- setState("error");
7627
- setBusy(false);
7590
+ setCancelError(t(treatmentFor(codeOf(err)).body));
7591
+ } finally {
7592
+ setCancelling(false);
7628
7593
  }
7629
7594
  }
7630
- if (state === "loading") {
7631
- return jsx("div", {
7632
- style: {
7633
- padding: "var(--space-16)",
7634
- display: "flex",
7635
- flexDirection: "column",
7636
- gap: "var(--space-16)"
7637
- },
7638
- children: [0, 1, 2].map((i) => jsx(Skeleton, {
7639
- height: 88,
7640
- radius: 8
7641
- }, i))
7642
- });
7643
- }
7644
- if (state === "error") {
7645
- return jsx(ErrorState, {
7646
- code: errorCode,
7647
- onRetry: () => void load()
7595
+ if (order.status === "cancelled") {
7596
+ return jsxs("div", {
7597
+ className: styles$x.page,
7598
+ children: [jsxs("div", {
7599
+ className: styles$x.cancelledHead,
7600
+ children: [jsx("h1", {
7601
+ className: styles$x.cancelledTitle,
7602
+ children: "Order cancelled"
7603
+ }), jsx("p", {
7604
+ className: styles$x.cancelledMeta,
7605
+ children: `Order #${shortRef$1(order.order_ref)} · Placed ${placedOn(order.placed_at, locale)}`
7606
+ })]
7607
+ }), onReorder && jsx(Button, {
7608
+ variant: "primary",
7609
+ fullWidth: true,
7610
+ onClick: () => {
7611
+ emit({
7612
+ type: "reorder_requested",
7613
+ orderRef: order.order_ref
7614
+ });
7615
+ onReorder();
7616
+ },
7617
+ children: "Reorder"
7618
+ }), jsx(OrderLines, {
7619
+ order
7620
+ }), jsx(ShippingAddressCard, {
7621
+ order
7622
+ }), jsx(OrderSummaryCard, {
7623
+ order
7624
+ })]
7648
7625
  });
7649
7626
  }
7650
- if (ret) {
7651
- return ret.status === "reported" ? jsx(ReturnLabelView, {
7652
- ret,
7653
- ...onDone ? {
7654
- onDone
7655
- } : {}
7656
- }) : jsx(ReturnTrackingView, {
7657
- ret,
7658
- ...locale ? {
7627
+ return jsxs("div", {
7628
+ className: styles$x.page,
7629
+ children: [jsxs("section", {
7630
+ className: styles$x.widget,
7631
+ "aria-label": t("Delivery status"),
7632
+ children: [jsxs("div", {
7633
+ className: styles$x.titleRow,
7634
+ children: [jsx("h1", {
7635
+ className: styles$x.headline,
7636
+ children: `Order #${shortRef$1(order.order_ref)}`
7637
+ }), order.tracking?.url && inTransit && jsxs("a", {
7638
+ className: styles$x.track,
7639
+ href: order.tracking.url,
7640
+ target: "_blank",
7641
+ rel: "noopener noreferrer",
7642
+ children: ["Track", jsx("span", {
7643
+ className: "visually-hidden",
7644
+ children: ` ${order.tracking.carrier}, opens in a new tab`
7645
+ }), jsx(RedirectLink, {})]
7646
+ })]
7647
+ }), jsx(OrderTimeline, {
7648
+ progress: order.progress,
7649
+ ...order.estimated_delivery ? {
7650
+ estimatedDelivery: order.estimated_delivery
7651
+ } : {},
7659
7652
  locale
7653
+ })]
7654
+ }), jsx("hr", {
7655
+ className: styles$x.rule
7656
+ }), jsx(OrderLines, {
7657
+ order
7658
+ }), jsx(ShippingAddressCard, {
7659
+ order
7660
+ }), jsx(OrderSummaryCard, {
7661
+ order
7662
+ }), order.can_cancel && jsx("button", {
7663
+ type: "button",
7664
+ className: styles$x.cancel,
7665
+ onClick: () => setCancelOpen(true),
7666
+ children: "Cancel order"
7667
+ }), jsx(NeedHelp, {
7668
+ order,
7669
+ ...onStartReturn ? {
7670
+ onStartReturn
7671
+ } : {},
7672
+ ...onContactSupport ? {
7673
+ onContactSupport
7660
7674
  } : {}
7661
- });
7662
- }
7663
- if (!order) {
7664
- return jsx(ErrorState, {
7665
- code: errorCode,
7666
- onRetry: () => void load()
7667
- });
7668
- }
7669
- if (!order.can_return) {
7670
- return jsx(ErrorState, {
7671
- code: "order_not_cancellable",
7672
- onRetry: () => void load()
7673
- });
7674
- }
7675
- return jsx(ReturnItemsView, {
7676
- order,
7677
- onSubmit: (items2) => void submit(items2),
7678
- busy
7675
+ }), cancelOpen && jsx(ReasonSheet, {
7676
+ title: "Reason for cancelling",
7677
+ options: CANCEL_REASONS,
7678
+ ctaLabel: "Cancel order",
7679
+ closeLabel: "Close reasons",
7680
+ busy: cancelling,
7681
+ onClose: () => setCancelOpen(false),
7682
+ onConfirm: (reason2) => void confirmCancellation(reason2),
7683
+ ...cancelError ? {
7684
+ error: cancelError
7685
+ } : {}
7686
+ })]
7687
+ });
7688
+ }
7689
+ const CANCEL_REASONS = [{
7690
+ value: "changed_my_mind",
7691
+ label: "Changed my mind"
7692
+ }, {
7693
+ value: "ordered_by_mistake",
7694
+ label: "Ordered by mistake"
7695
+ }, {
7696
+ value: "delivery_too_long",
7697
+ label: "Delivery takes too long"
7698
+ }];
7699
+ function placedOn(iso, locale) {
7700
+ const d = new Date(iso);
7701
+ const day = d.getUTCDate();
7702
+ const month = new Intl.DateTimeFormat(locale, {
7703
+ month: "short",
7704
+ timeZone: "UTC"
7705
+ }).format(d);
7706
+ return `${day} ${month}, ${d.getUTCFullYear()}`;
7707
+ }
7708
+ function NeedHelp({ order, onStartReturn, onContactSupport }) {
7709
+ const emit = useShopEvent();
7710
+ if (order.status !== "delivered") return null;
7711
+ return jsxs("section", {
7712
+ className: styles$x.help,
7713
+ "aria-labelledby": "order-help",
7714
+ children: [jsx("h2", {
7715
+ className: styles$x.helpTitle,
7716
+ id: "order-help",
7717
+ children: "Need help?"
7718
+ }), jsxs("div", {
7719
+ className: styles$x.helpRows,
7720
+ children: [order.can_return && onStartReturn && jsx(HelpRow, {
7721
+ label: "Start a return",
7722
+ onClick: onStartReturn
7723
+ }), jsx(HelpRow, {
7724
+ label: "Contact support",
7725
+ onClick: () => {
7726
+ emit({
7727
+ type: "support_requested",
7728
+ orderRef: order.order_ref
7729
+ });
7730
+ onContactSupport?.();
7731
+ }
7732
+ })]
7733
+ })]
7734
+ });
7735
+ }
7736
+ function HelpRow({ label: label2, onClick }) {
7737
+ return jsxs("button", {
7738
+ type: "button",
7739
+ className: styles$x.helpRow,
7740
+ onClick,
7741
+ children: [jsx("span", {
7742
+ children: label2
7743
+ }), jsx(ChevronRight$1, {})]
7679
7744
  });
7680
7745
  }
7746
+ function shortRef$1(orderRef) {
7747
+ return orderRef.replace(/^ord_/, "");
7748
+ }
7681
7749
  const page$2 = "_page_2uqhz_6";
7682
7750
  const confirmed = "_confirmed_2uqhz_16";
7683
7751
  const title$h = "_title_2uqhz_22";
@@ -7846,7 +7914,7 @@ const tile$2 = "_tile_6xodo_133";
7846
7914
  const image$8 = "_image_6xodo_143";
7847
7915
  const placeholder$5 = "_placeholder_6xodo_147";
7848
7916
  const more = "_more_6xodo_154";
7849
- const chevron$3 = "_chevron_6xodo_167";
7917
+ const chevron$2 = "_chevron_6xodo_167";
7850
7918
  const styles$u = {
7851
7919
  page: page$1,
7852
7920
  empty,
@@ -7863,7 +7931,7 @@ const styles$u = {
7863
7931
  image: image$8,
7864
7932
  placeholder: placeholder$5,
7865
7933
  more,
7866
- chevron: chevron$3
7934
+ chevron: chevron$2
7867
7935
  };
7868
7936
  const TILES = 3;
7869
7937
  function Chevron() {
@@ -8652,13 +8720,13 @@ const line = "_line_1s2s6_6";
8652
8720
  const row$5 = "_row_1s2s6_12";
8653
8721
  const pending = "_pending_1s2s6_18";
8654
8722
  const labels = "_labels_1s2s6_24";
8655
- const lowStock = "_lowStock_1s2s6_39";
8723
+ const lowStock$1 = "_lowStock_1s2s6_39";
8656
8724
  const media$1 = "_media_1s2s6_49";
8657
8725
  const image$5 = "_image_1s2s6_59";
8658
8726
  const placeholder$2 = "_placeholder_1s2s6_63";
8659
8727
  const saleBadge = "_saleBadge_1s2s6_76";
8660
8728
  const oos$1 = "_oos_1s2s6_91";
8661
- const info$1 = "_info_1s2s6_104";
8729
+ const info$2 = "_info_1s2s6_104";
8662
8730
  const head = "_head_1s2s6_112";
8663
8731
  const meta = "_meta_1s2s6_119";
8664
8732
  const title$b = "_title_1s2s6_134";
@@ -8672,13 +8740,13 @@ const styles$m = {
8672
8740
  row: row$5,
8673
8741
  pending,
8674
8742
  labels,
8675
- lowStock,
8743
+ lowStock: lowStock$1,
8676
8744
  media: media$1,
8677
8745
  image: image$5,
8678
8746
  placeholder: placeholder$2,
8679
8747
  saleBadge,
8680
8748
  oos: oos$1,
8681
- info: info$1,
8749
+ info: info$2,
8682
8750
  head,
8683
8751
  meta,
8684
8752
  title: title$b,
@@ -8854,13 +8922,13 @@ function ShippingInfo() {
8854
8922
  const bar = "_bar_xqpxa_1";
8855
8923
  const floating$1 = "_floating_xqpxa_31";
8856
8924
  const divider = "_divider_xqpxa_37";
8857
- const info = "_info_xqpxa_41";
8925
+ const info$1 = "_info_xqpxa_41";
8858
8926
  const actions = "_actions_xqpxa_49";
8859
8927
  const styles$k = {
8860
8928
  bar,
8861
8929
  floating: floating$1,
8862
8930
  divider,
8863
- info,
8931
+ info: info$1,
8864
8932
  actions
8865
8933
  };
8866
8934
  function StickyCtaBar({ children, info: info2, variant = "floating" }) {
@@ -9444,16 +9512,17 @@ function SizeGuideSheet({ guide, onClose }) {
9444
9512
  })
9445
9513
  });
9446
9514
  }
9447
- const root$2 = "_root_6sbl9_1";
9448
- const header$3 = "_header_6sbl9_7";
9449
- const title$9 = "_title_6sbl9_12";
9450
- const chips = "_chips_6sbl9_20";
9451
- const chip = "_chip_6sbl9_20";
9452
- const selected$2 = "_selected_6sbl9_44";
9453
- const disabled$1 = "_disabled_6sbl9_56";
9454
- const error = "_error_6sbl9_64";
9455
- const sizeGuide = "_sizeGuide_6sbl9_71";
9456
- const chevron$2 = "_chevron_6sbl9_87";
9515
+ const root$2 = "_root_1q3xe_1";
9516
+ const header$3 = "_header_1q3xe_11";
9517
+ const title$9 = "_title_1q3xe_18";
9518
+ const chips = "_chips_1q3xe_26";
9519
+ const chip = "_chip_1q3xe_26";
9520
+ const selected$2 = "_selected_1q3xe_50";
9521
+ const disabled$1 = "_disabled_1q3xe_62";
9522
+ const lowStock = "_lowStock_1q3xe_74";
9523
+ const error = "_error_1q3xe_84";
9524
+ const sizeGuide = "_sizeGuide_1q3xe_91";
9525
+ const info = "_info_1q3xe_115";
9457
9526
  const styles$g = {
9458
9527
  root: root$2,
9459
9528
  header: header$3,
@@ -9462,23 +9531,55 @@ const styles$g = {
9462
9531
  chip,
9463
9532
  selected: selected$2,
9464
9533
  disabled: disabled$1,
9534
+ lowStock,
9465
9535
  error,
9466
9536
  sizeGuide,
9467
- chevron: chevron$2
9537
+ info
9468
9538
  };
9469
- function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = false, guide }) {
9539
+ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = false, lowStock: lowStock2, guide }) {
9470
9540
  const t = useT();
9471
9541
  const [guideOpen, setGuideOpen] = useState(false);
9472
9542
  return jsxs("section", {
9473
9543
  className: styles$g.root,
9474
9544
  "aria-labelledby": "size-heading",
9475
- children: [jsx("div", {
9545
+ children: [jsxs("div", {
9476
9546
  className: styles$g.header,
9477
- children: jsx("h2", {
9547
+ children: [jsx("h2", {
9478
9548
  id: "size-heading",
9479
9549
  className: styles$g.title,
9480
9550
  children: "Size"
9481
- })
9551
+ }), guide && jsxs("button", {
9552
+ type: "button",
9553
+ className: styles$g.sizeGuide,
9554
+ onClick: () => setGuideOpen(true),
9555
+ "aria-haspopup": "dialog",
9556
+ "aria-expanded": guideOpen,
9557
+ children: ["Size guide", jsxs("svg", {
9558
+ className: styles$g.info,
9559
+ width: "12",
9560
+ height: "12",
9561
+ viewBox: "0 0 12 12",
9562
+ fill: "none",
9563
+ "aria-hidden": "true",
9564
+ children: [jsx("circle", {
9565
+ cx: "6",
9566
+ cy: "6",
9567
+ r: "5",
9568
+ stroke: "currentColor",
9569
+ strokeWidth: "1.2"
9570
+ }), jsx("path", {
9571
+ d: "M6 5.6v2.6",
9572
+ stroke: "currentColor",
9573
+ strokeWidth: "1.2",
9574
+ strokeLinecap: "round"
9575
+ }), jsx("circle", {
9576
+ cx: "6",
9577
+ cy: "3.7",
9578
+ r: "0.7",
9579
+ fill: "currentColor"
9580
+ })]
9581
+ })]
9582
+ })]
9482
9583
  }), jsx("div", {
9483
9584
  className: styles$g.chips,
9484
9585
  role: "radiogroup",
@@ -9505,27 +9606,10 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
9505
9606
  className: styles$g.error,
9506
9607
  role: "alert",
9507
9608
  children: "Please select a size"
9508
- }), guide && jsxs("button", {
9509
- type: "button",
9510
- className: styles$g.sizeGuide,
9511
- onClick: () => setGuideOpen(true),
9512
- "aria-haspopup": "dialog",
9513
- "aria-expanded": guideOpen,
9514
- children: ["Size guide", jsx("svg", {
9515
- className: styles$g.chevron,
9516
- width: "12",
9517
- height: "12",
9518
- viewBox: "0 0 12 12",
9519
- fill: "none",
9520
- "aria-hidden": "true",
9521
- children: jsx("path", {
9522
- d: "m4.6 2.6 3.4 3.4-3.4 3.4",
9523
- stroke: "currentColor",
9524
- strokeWidth: "1.2",
9525
- strokeLinecap: "round",
9526
- strokeLinejoin: "round"
9527
- })
9528
- })]
9609
+ }), lowStock2 && !error2 && jsx("p", {
9610
+ className: styles$g.lowStock,
9611
+ role: "status",
9612
+ children: lowStock2
9529
9613
  }), guide && guideOpen && jsx(SizeGuideSheet, {
9530
9614
  guide,
9531
9615
  onClose: () => setGuideOpen(false)
@@ -10019,7 +10103,8 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10019
10103
  const selectedVariant = hasVariants ? variants.find((v) => v.sku === selectedSku) : void 0;
10020
10104
  const available = selectedVariant?.available ?? inventory2?.available ?? 0;
10021
10105
  const lowStock2 = isLowStock(available);
10022
- const stockNotice = !purchasable || lowStock2;
10106
+ const sizeLowStock = lowStock2 && hasSizes && selectedSize ? t("Only {0} left in {1} size", available, selectedSize) : void 0;
10107
+ const stockNotice = !purchasable || lowStock2 && !sizeLowStock;
10023
10108
  const availabilityLabel = !purchasable ? t("Out of stock") : lowStock2 ? t("Only {0} left", available) : "";
10024
10109
  const cta2 = purchasable ? jsx(Button, {
10025
10110
  variant: "primary",
@@ -10083,6 +10168,9 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10083
10168
  selected: selectedSize,
10084
10169
  onSelect: selectSize,
10085
10170
  error: sizeError,
10171
+ ...sizeLowStock ? {
10172
+ lowStock: sizeLowStock
10173
+ } : {},
10086
10174
  guide: product.size_guide
10087
10175
  })
10088
10176
  }), hasVariants && !structured && jsx(VariantSelector, {
@@ -10101,24 +10189,29 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10101
10189
  })]
10102
10190
  });
10103
10191
  }
10104
- const hero$1 = "_hero_pi6qp_10";
10105
- const image$2 = "_image_pi6qp_37";
10106
- const scrim$1 = "_scrim_pi6qp_51";
10107
- const text$2 = "_text_pi6qp_57";
10108
- const title$5 = "_title_pi6qp_79";
10109
- const subtitle$2 = "_subtitle_pi6qp_90";
10110
- const noImage = "_noImage_pi6qp_105";
10192
+ const hero$1 = "_hero_1glho_10";
10193
+ const image$2 = "_image_1glho_42";
10194
+ const scrim$1 = "_scrim_1glho_70";
10195
+ const fade = "_fade_1glho_94";
10196
+ const text$2 = "_text_1glho_108";
10197
+ const title$5 = "_title_1glho_146";
10198
+ const subtitle$2 = "_subtitle_1glho_157";
10199
+ const noImage = "_noImage_1glho_172";
10111
10200
  const styles$9 = {
10112
10201
  hero: hero$1,
10113
10202
  image: image$2,
10114
10203
  scrim: scrim$1,
10204
+ fade,
10115
10205
  text: text$2,
10116
10206
  title: title$5,
10117
10207
  subtitle: subtitle$2,
10118
10208
  noImage
10119
10209
  };
10120
10210
  function PcpHero({ hero: hero2 }) {
10211
+ const heroRef = useRef(null);
10212
+ useTopOffset(heroRef, "--hero-top");
10121
10213
  return jsxs("section", {
10214
+ ref: heroRef,
10122
10215
  className: [styles$9.hero, hero2.image ? "" : styles$9.noImage].join(" "),
10123
10216
  children: [hero2.image && jsxs(Fragment, {
10124
10217
  children: [jsx("div", {
@@ -10133,6 +10226,9 @@ function PcpHero({ hero: hero2 }) {
10133
10226
  }), jsx("div", {
10134
10227
  className: styles$9.scrim,
10135
10228
  "aria-hidden": "true"
10229
+ }), jsx("div", {
10230
+ className: styles$9.fade,
10231
+ "aria-hidden": "true"
10136
10232
  })]
10137
10233
  }), jsxs("div", {
10138
10234
  className: styles$9.text,
@@ -10567,29 +10663,28 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
10567
10663
  }
10568
10664
  return unavailable;
10569
10665
  }
10570
- const showcase = "_showcase_a0wva_39";
10571
- const panel = "_panel_a0wva_43";
10572
- const image = "_image_a0wva_71";
10573
- const heroImageBox = "_heroImageBox_a0wva_119";
10574
- const hero = "_hero_a0wva_119";
10575
- const heroContent = "_heroContent_a0wva_190";
10576
- const heroText = "_heroText_a0wva_207";
10577
- const logo = "_logo_a0wva_216";
10578
- const heroTitle = "_heroTitle_a0wva_236";
10579
- const heroSub = "_heroSub_a0wva_260";
10580
- const swipe = "_swipe_a0wva_273";
10581
- const swipeLabel = "_swipeLabel_a0wva_281";
10582
- const chevron$1 = "_chevron_a0wva_287";
10583
- const overlay$1 = "_overlay_a0wva_304";
10584
- const copy = "_copy_a0wva_315";
10585
- const title$2 = "_title_a0wva_320";
10586
- const subtitle$1 = "_subtitle_a0wva_327";
10587
- const cta = "_cta_a0wva_333";
10666
+ const showcase = "_showcase_144lm_44";
10667
+ const panel = "_panel_144lm_48";
10668
+ const image = "_image_144lm_76";
10669
+ const hero = "_hero_144lm_116";
10670
+ const heroContent = "_heroContent_144lm_174";
10671
+ const heroText = "_heroText_144lm_197";
10672
+ const logo = "_logo_144lm_206";
10673
+ const heroTitle = "_heroTitle_144lm_226";
10674
+ const heroSub = "_heroSub_144lm_250";
10675
+ const swipe = "_swipe_144lm_269";
10676
+ const swipeLabel = "_swipeLabel_144lm_276";
10677
+ const chevron$1 = "_chevron_144lm_282";
10678
+ const overlay$1 = "_overlay_144lm_11";
10679
+ const copy = "_copy_144lm_315";
10680
+ const title$2 = "_title_144lm_320";
10681
+ const subtitle$1 = "_subtitle_144lm_327";
10682
+ const cta = "_cta_144lm_333";
10683
+ const mosaic = "_mosaic_144lm_377";
10588
10684
  const styles$2 = {
10589
10685
  showcase,
10590
10686
  panel,
10591
10687
  image,
10592
- heroImageBox,
10593
10688
  hero,
10594
10689
  heroContent,
10595
10690
  heroText,
@@ -10603,7 +10698,8 @@ const styles$2 = {
10603
10698
  copy,
10604
10699
  title: title$2,
10605
10700
  subtitle: subtitle$1,
10606
- cta
10701
+ cta,
10702
+ mosaic
10607
10703
  };
10608
10704
  const SETTLE_MS = 150;
10609
10705
  function useDocumentSnap(ref, enabled = true) {
@@ -10636,40 +10732,29 @@ function useDocumentSnap(ref, enabled = true) {
10636
10732
  }, [ref, enabled]);
10637
10733
  }
10638
10734
  const FALLBACK_PANELS = [{
10639
- key: "all-items",
10640
- title: "All items",
10641
- subtitle: "Heavyweight comfort built for training days and off-duty moments",
10642
- cta: "See more",
10643
- to: "/category/t-shirts",
10644
- image: "/figma/home/new.jpg"
10645
- }, {
10646
10735
  key: "hoodies",
10647
10736
  title: "Hoodies",
10648
10737
  subtitle: "Heavyweight comfort built for training days and off-duty moments",
10649
10738
  cta: "See more",
10650
10739
  to: "/category/hoodies",
10651
- image: "/figma/home/hoodies.jpg"
10740
+ video: "/figma/home/hoodies.mp4",
10741
+ image: "/figma/home/hoodies-poster.jpg"
10742
+ }, {
10743
+ key: "zip-ups",
10744
+ title: "Zip Ups",
10745
+ subtitle: "Everyday essentials with sport-inspired fits and minimal branding",
10746
+ cta: "See more",
10747
+ to: "/category/zip-ups",
10748
+ video: "/figma/home/zip-ups.mp4",
10749
+ image: "/figma/home/zip-ups-poster.jpg"
10652
10750
  }, {
10653
10751
  key: "t-shirts",
10654
10752
  title: "T-Shirts",
10655
10753
  subtitle: "Everyday essentials with sport-inspired fits and minimal branding",
10656
- cta: "Explore",
10657
- to: "/category/t-shirts",
10658
- image: "/figma/home/tshirts.jpg"
10659
- }, {
10660
- key: "jackets",
10661
- title: "Jackets",
10662
- subtitle: "Heavyweight comfort built for training days and off-duty moments",
10663
10754
  cta: "See more",
10664
- to: "/category/jackets",
10665
- image: "/figma/home/jackets.jpg"
10666
- }, {
10667
- key: "seasonal",
10668
- title: "Seasonal",
10669
- subtitle: "Complete the look with everyday essentials and finishing details",
10670
- cta: "Shop now",
10671
- to: "/category/summer",
10672
- image: "/figma/home/accessories.jpg"
10755
+ to: "/category/t-shirts",
10756
+ video: "/figma/home/tshirts.mp4",
10757
+ image: "/figma/home/tshirts-poster.jpg"
10673
10758
  }];
10674
10759
  function CategoryPanel({ panel: panel2 }) {
10675
10760
  return jsxs("section", {
@@ -10680,7 +10765,12 @@ function CategoryPanel({ panel: panel2 }) {
10680
10765
  "--slide-focal-y": `${panel2.focalY}%`
10681
10766
  }
10682
10767
  },
10683
- children: [jsx(ShopImage, {
10768
+ children: [panel2.video ? jsx(ShopVideo, {
10769
+ src: panel2.video,
10770
+ poster: panel2.image,
10771
+ fill: true,
10772
+ className: styles$2.image
10773
+ }) : jsx(ShopImage, {
10684
10774
  src: panel2.image,
10685
10775
  alt: "",
10686
10776
  fill: true,
@@ -10706,6 +10796,19 @@ function CategoryPanel({ panel: panel2 }) {
10706
10796
  })]
10707
10797
  });
10708
10798
  }
10799
+ function MosaicPanel() {
10800
+ const t = useT();
10801
+ return jsx("section", {
10802
+ className: `${styles$2.panel} ${styles$2.mosaic}`,
10803
+ "aria-label": t("The DAZN Shop collection"),
10804
+ children: jsx(ShopVideo, {
10805
+ src: "/figma/home/mosaic.mp4",
10806
+ poster: "/figma/home/mosaic-poster.jpg",
10807
+ fill: true,
10808
+ className: styles$2.image
10809
+ })
10810
+ });
10811
+ }
10709
10812
  function useSlides() {
10710
10813
  const t = useT();
10711
10814
  const shop = useShopOptional();
@@ -10729,6 +10832,9 @@ function useSlides() {
10729
10832
  cta: s.cta,
10730
10833
  to: s.target ? `/category/${s.target}` : "/",
10731
10834
  image: s.image ?? "",
10835
+ ...s.video === void 0 ? {} : {
10836
+ video: s.video
10837
+ },
10732
10838
  ...s.focal_y === void 0 ? {} : {
10733
10839
  focalY: s.focal_y
10734
10840
  }
@@ -10756,16 +10862,12 @@ function HomeShowcase() {
10756
10862
  children: [jsxs("section", {
10757
10863
  className: `${styles$2.panel} ${styles$2.hero}`,
10758
10864
  "aria-label": t("DAZN Shop"),
10759
- children: [jsx("div", {
10760
- className: styles$2.heroImageBox,
10761
- children: jsx(ShopImage, {
10762
- src: "/figma/home/hero.jpg",
10763
- alt: "",
10764
- fill: true,
10765
- priority: true,
10766
- sizes: "(max-width: 480px) 100vw, 480px",
10767
- className: styles$2.image
10768
- })
10865
+ children: [jsx(ShopVideo, {
10866
+ src: "/figma/home/hero.mp4",
10867
+ poster: "/figma/home/hero-poster.jpg",
10868
+ fill: true,
10869
+ priority: true,
10870
+ className: styles$2.image
10769
10871
  }), jsxs("div", {
10770
10872
  className: styles$2.heroContent,
10771
10873
  children: [jsxs("div", {
@@ -10801,9 +10903,11 @@ function HomeShowcase() {
10801
10903
  })]
10802
10904
  })]
10803
10905
  })]
10804
- }), panels.map((p) => jsx(CategoryPanel, {
10805
- panel: p
10806
- }, p.key))]
10906
+ }), panels.map((p, i) => jsxs(Fragment$1, {
10907
+ children: [jsx(CategoryPanel, {
10908
+ panel: p
10909
+ }), i === 0 && jsx(MosaicPanel, {})]
10910
+ }, p.key)), panels.length === 0 && jsx(MosaicPanel, {})]
10807
10911
  })
10808
10912
  });
10809
10913
  }
@@ -11319,6 +11423,7 @@ export {
11319
11423
  ShopLink,
11320
11424
  ShopMenuSheet,
11321
11425
  ShopSurface,
11426
+ ShopVideo,
11322
11427
  SizeGuideSheet,
11323
11428
  SizeSelector,
11324
11429
  Skeleton,
@@ -11354,4 +11459,4 @@ export {
11354
11459
  useToast,
11355
11460
  variantLabel
11356
11461
  };
11357
- //# sourceMappingURL=storefront.mjs.map
11462
+