@nok-integration/storefront-react 0.16.4 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4680,6 +4680,19 @@ function requireOrders() {
4680
4680
  /** Per-unit, for reconciliation and the credit note. We never recompute it. */
4681
4681
  unit_price: money_1.Money,
4682
4682
  line_total: money_1.Money,
4683
+ /**
4684
+ * What the line would have cost undiscounted, per unit. Display only.
4685
+ *
4686
+ * The order screens draw a struck-through price and a discount badge beside the price
4687
+ * paid, and this is the only place that figure can honestly come from. Our catalogue
4688
+ * holds a `compare_at` too, but a receipt read from the catalogue is a receipt that
4689
+ * changes when merchandising does; what the fan was shown at the moment they bought is
4690
+ * DAZN's to state, once, here.
4691
+ *
4692
+ * Optional, and absent means the line was sold at full price. A value equal to or below
4693
+ * `unit_price` is treated the same way rather than drawn as a saving of zero or less.
4694
+ */
4695
+ compare_at_unit_price: money_1.Money.optional(),
4683
4696
  /** Display name as DAZN sold it. Advisory: the picking list shows Odoo's own. */
4684
4697
  title: zod_1.z.string().optional()
4685
4698
  });
@@ -4700,6 +4713,18 @@ function requireOrders() {
4700
4713
  items: money_1.Money,
4701
4714
  shipping: money_1.Money,
4702
4715
  tax: money_1.Money,
4716
+ /**
4717
+ * What came off, as a positive amount. Optional; absent means nothing did.
4718
+ *
4719
+ * Positive rather than signed, and the surfaces that draw it own the minus sign. A
4720
+ * signed field invites the reader to add it to a running total, and nothing here is a
4721
+ * running total: `grand_total` is what DAZN charged and is never derived from the parts.
4722
+ *
4723
+ * Kept out of `items` deliberately. The order screen lists a subtotal and a discount as
4724
+ * two rows because the fan is owed both figures, and folding the saving into the
4725
+ * subtotal loses the one they care about.
4726
+ */
4727
+ discount: money_1.Money.optional(),
4703
4728
  grand_total: money_1.Money
4704
4729
  });
4705
4730
  exports.OrderPaymentSummary = zod_1.z.object({
@@ -4827,6 +4852,14 @@ function requireOrderTracking() {
4827
4852
  qty: zod_1.z.number().int().positive(),
4828
4853
  unit_price: money_1.Money,
4829
4854
  line_total: money_1.Money,
4855
+ /**
4856
+ * The undiscounted per-unit price, echoed from intake. Display only.
4857
+ *
4858
+ * Drawn as a struck-through price with a saving badge beside what was paid. Absent
4859
+ * means the line was sold at full price, which is the ordinary case; see `OrderLine`
4860
+ * for why this is DAZN's figure and not our catalogue's.
4861
+ */
4862
+ compare_at_unit_price: money_1.Money.optional(),
4830
4863
  title: zod_1.z.string().optional(),
4831
4864
  image: common_1.Url.optional(),
4832
4865
  /** Variant attributes, e.g. `{ size: 'M' }`. Same shape as everywhere else. */
@@ -4869,6 +4902,18 @@ function requireOrderTracking() {
4869
4902
  order_ref: ids_1.OrderRef,
4870
4903
  placed_at: common_1.Timestamp,
4871
4904
  currency: money_1.Currency,
4905
+ /**
4906
+ * Where the order confirmation went, for the confirmation screen's "We've sent a
4907
+ * confirmation to ..." line. The address DAZN gave us at intake, echoed back.
4908
+ *
4909
+ * Returned only on the detail read, which is already scoped to the order's own owner,
4910
+ * and never on the list. It is PII: render it, and keep it out of logs and analytics
4911
+ * like every other address in this package.
4912
+ *
4913
+ * Optional because intake's is: a market whose carrier takes no email places orders
4914
+ * without one. Absent means the line is not drawn, never that a placeholder is.
4915
+ */
4916
+ email: zod_1.z.string().email().optional(),
4872
4917
  status: exports.OrderProgressStep,
4873
4918
  headline: zod_1.z.string().min(1),
4874
4919
  estimated_delivery: zod_1.z.object({ from: common_1.Timestamp, to: common_1.Timestamp }).optional(),
@@ -4908,6 +4953,54 @@ function requireStockAlerts() {
4908
4953
  });
4909
4954
  return stockAlerts;
4910
4955
  }
4956
+ var support = {};
4957
+ var hasRequiredSupport;
4958
+ function requireSupport() {
4959
+ if (hasRequiredSupport) return support;
4960
+ hasRequiredSupport = 1;
4961
+ (function(exports) {
4962
+ Object.defineProperty(exports, "__esModule", { value: true });
4963
+ exports.SupportAttachment = exports.SupportTicket = exports.SupportTicketRequest = exports.SupportCategory = void 0;
4964
+ const zod_1 = /* @__PURE__ */ requireZod();
4965
+ const common_1 = requireCommon();
4966
+ exports.SupportCategory = zod_1.z.string().trim().min(1).max(120);
4967
+ exports.SupportTicketRequest = zod_1.z.object({
4968
+ /**
4969
+ * Where the fan wants the reply. Pre-filled from the account in the design, and
4970
+ * editable — so this is a contact address, not proof of identity.
4971
+ */
4972
+ email: zod_1.z.string().email().max(254),
4973
+ category: exports.SupportCategory,
4974
+ /**
4975
+ * The fan's own words. Bounded at 4000 characters because an unbounded text column
4976
+ * reachable from the open internet is a storage-exhaustion vector, not because CS
4977
+ * asked for a limit — they have not, and this is the one number here we chose. It is
4978
+ * roughly two pages, and it is configuration away from being different.
4979
+ */
4980
+ description: zod_1.z.string().trim().min(1).max(4e3),
4981
+ /**
4982
+ * One attachment, as a URL — the shape CS specified.
4983
+ *
4984
+ * The URL is not free-form: it must be one the engine issued from
4985
+ * `POST /v1/support/attachments`. A ticket carrying an arbitrary address would have a
4986
+ * CS agent's browser fetch whatever a stranger typed, from inside DAZN's network, on
4987
+ * a page showing another customer's data.
4988
+ */
4989
+ image_url: zod_1.z.string().url().max(2048).optional()
4990
+ }).strict();
4991
+ exports.SupportTicket = zod_1.z.object({
4992
+ reference: zod_1.z.string().min(1),
4993
+ category: exports.SupportCategory,
4994
+ created_at: common_1.Timestamp
4995
+ });
4996
+ exports.SupportAttachment = zod_1.z.object({
4997
+ url: zod_1.z.string().url(),
4998
+ content_type: zod_1.z.string().min(1),
4999
+ bytes: zod_1.z.number().int().positive()
5000
+ });
5001
+ })(support);
5002
+ return support;
5003
+ }
4911
5004
  var errors = {};
4912
5005
  var hasRequiredErrors;
4913
5006
  function requireErrors() {
@@ -4938,6 +5031,11 @@ function requireErrors() {
4938
5031
  // "this fan has an empty cart" are the same fact to a caller about to charge for it, and
4939
5032
  // neither should be checked out. One answer, and it is not a success.
4940
5033
  "cart_not_found",
5034
+ // A Help Center ticket reference the engine does not hold (ADR-0021). Distinct from
5035
+ // `invalid_request` because nothing about the request is malformed, and distinct from
5036
+ // `order_not_found` because saying "unknown order" about a support ticket sends whoever
5037
+ // reads it looking in the wrong table.
5038
+ "support_ticket_not_found",
4941
5039
  // Admin/CMS (`/admin/v1`). The error OBJECT is shared infrastructure — one shape, one
4942
5040
  // `code` vocabulary, one filter — so admin failures name themselves here rather than in
4943
5041
  // a second enum. `forbidden` is authenticated-but-not-permitted, which `unauthorized`
@@ -4961,6 +5059,7 @@ function requireErrors() {
4961
5059
  order_not_found: 404,
4962
5060
  order_not_cancellable: 409,
4963
5061
  cart_not_found: 404,
5062
+ support_ticket_not_found: 404,
4964
5063
  forbidden: 403,
4965
5064
  invalid_transition: 409,
4966
5065
  rate_limited: 429,
@@ -4992,6 +5091,7 @@ function requireClient() {
4992
5091
  const session_1 = requireSession();
4993
5092
  const order_tracking_1 = requireOrderTracking();
4994
5093
  const stock_alerts_1 = requireStockAlerts();
5094
+ const support_1 = requireSupport();
4995
5095
  const errors_1 = requireErrors();
4996
5096
  class DaznApiError extends Error {
4997
5097
  status;
@@ -5054,6 +5154,33 @@ function requireClient() {
5054
5154
  }
5055
5155
  return config.schema.parse(await res.json());
5056
5156
  }
5157
+ async function upload(path, file, schema) {
5158
+ const token = await options2.getToken?.();
5159
+ const headers = {
5160
+ accept: "application/json",
5161
+ ...options2.defaultHeaders
5162
+ };
5163
+ if (token)
5164
+ headers["authorization"] = `Bearer ${token}`;
5165
+ const form = new FormData();
5166
+ form.append("file", file);
5167
+ const res = await doFetch(`${base}${path}`, {
5168
+ method: "POST",
5169
+ headers,
5170
+ credentials: options2.credentials ?? "include",
5171
+ body: form
5172
+ });
5173
+ if (!res.ok) {
5174
+ let parsed;
5175
+ try {
5176
+ parsed = errors_1.ErrorResponse.parse(await res.json());
5177
+ } catch {
5178
+ parsed = void 0;
5179
+ }
5180
+ throw new DaznApiError(res.status, parsed);
5181
+ }
5182
+ return schema.parse(await res.json());
5183
+ }
5057
5184
  return {
5058
5185
  catalog: {
5059
5186
  listProducts: (query = {}) => request({
@@ -5147,6 +5274,22 @@ function requireClient() {
5147
5274
  schema: order_tracking_1.OrderDetail
5148
5275
  })
5149
5276
  },
5277
+ /**
5278
+ * The Help Center form (ADR-0021). Session-scoped: the ticket is filed against the
5279
+ * fan already signed in, and there is no parameter that names a different one.
5280
+ */
5281
+ support: {
5282
+ /**
5283
+ * Upload the one attachment and get the URL to put on the ticket.
5284
+ *
5285
+ * Call this first, then pass the returned `url` as `image_url`. Uploading nothing is
5286
+ * the normal case — the field is optional and the form's Send button does not wait
5287
+ * on it.
5288
+ */
5289
+ uploadAttachment: (file) => upload("/support/attachments", file, support_1.SupportAttachment),
5290
+ /** File the ticket. Repeating an identical one within a few minutes returns the first. */
5291
+ createTicket: (body2) => request({ method: "POST", path: "/support/tickets", body: body2, schema: support_1.SupportTicket })
5292
+ },
5150
5293
  auth: {
5151
5294
  /** Exchange a single-use DAZN identity JWT for a session (sets the cookie). */
5152
5295
  exchangeSession: (body2) => request({
@@ -5397,7 +5540,7 @@ const neutral$1 = "_neutral_1bagf_12";
5397
5540
  const success$1 = "_success_1bagf_17";
5398
5541
  const critical$1 = "_critical_1bagf_22";
5399
5542
  const promo = "_promo_1bagf_27";
5400
- const styles$H = {
5543
+ const styles$I = {
5401
5544
  badge: badge$4,
5402
5545
  neutral: neutral$1,
5403
5546
  success: success$1,
@@ -5405,25 +5548,23 @@ const styles$H = {
5405
5548
  promo
5406
5549
  };
5407
5550
  function Badge({ tone = "neutral", children }) {
5408
- return /* @__PURE__ */ jsx("span", { className: [styles$H.badge, styles$H[tone]].join(" "), children });
5409
- }
5410
- const button$1 = "_button_vvcmd_1";
5411
- const fullWidth = "_fullWidth_vvcmd_23";
5412
- const primary = "_primary_vvcmd_27";
5413
- const secondary = "_secondary_vvcmd_32";
5414
- const ghost = "_ghost_vvcmd_38";
5415
- const spinner = "_spinner_vvcmd_54";
5416
- const spin = "_spin_vvcmd_54";
5417
- const labelLoading = "_labelLoading_vvcmd_63";
5418
- const styles$G = {
5551
+ return /* @__PURE__ */ jsx("span", { className: [styles$I.badge, styles$I[tone]].join(" "), children });
5552
+ }
5553
+ const button$1 = "_button_tdhm8_1";
5554
+ const fullWidth = "_fullWidth_tdhm8_25";
5555
+ const primary = "_primary_tdhm8_29";
5556
+ const secondary = "_secondary_tdhm8_34";
5557
+ const ghost = "_ghost_tdhm8_40";
5558
+ const spinner = "_spinner_tdhm8_62";
5559
+ const spin = "_spin_tdhm8_62";
5560
+ const styles$H = {
5419
5561
  button: button$1,
5420
5562
  fullWidth,
5421
5563
  primary,
5422
5564
  secondary,
5423
5565
  ghost,
5424
5566
  spinner,
5425
- spin,
5426
- labelLoading
5567
+ spin
5427
5568
  };
5428
5569
  const Button = forwardRef(function Button2({
5429
5570
  variant = "primary",
@@ -5442,23 +5583,23 @@ const Button = forwardRef(function Button2({
5442
5583
  ref,
5443
5584
  type,
5444
5585
  className: [
5445
- styles$G.button,
5446
- styles$G[variant],
5447
- fullWidth2 ? styles$G.fullWidth : "",
5586
+ styles$H.button,
5587
+ styles$H[variant],
5588
+ fullWidth2 ? styles$H.fullWidth : "",
5448
5589
  className ?? ""
5449
5590
  ].filter(Boolean).join(" "),
5450
5591
  disabled: isDisabled,
5451
5592
  "aria-busy": loading || void 0,
5452
5593
  ...rest,
5453
5594
  children: [
5454
- loading && /* @__PURE__ */ jsx("span", { className: styles$G.spinner, "aria-hidden": "true" }),
5455
- /* @__PURE__ */ jsx("span", { className: loading ? styles$G.labelLoading : void 0, children })
5595
+ loading && /* @__PURE__ */ jsx("span", { className: styles$H.spinner, "aria-hidden": "true" }),
5596
+ /* @__PURE__ */ jsx("span", { children })
5456
5597
  ]
5457
5598
  }
5458
5599
  );
5459
5600
  });
5460
5601
  const skeleton = "_skeleton_1nxz7_1";
5461
- const styles$F = {
5602
+ const styles$G = {
5462
5603
  skeleton
5463
5604
  };
5464
5605
  function Skeleton({ width, height, radius, className, circle }) {
@@ -5471,14 +5612,14 @@ function Skeleton({ width, height, radius, className, circle }) {
5471
5612
  "span",
5472
5613
  {
5473
5614
  "aria-hidden": "true",
5474
- className: [styles$F.skeleton, className ?? ""].filter(Boolean).join(" "),
5615
+ className: [styles$G.skeleton, className ?? ""].filter(Boolean).join(" "),
5475
5616
  style
5476
5617
  }
5477
5618
  );
5478
5619
  }
5479
5620
  const surface$1 = "_surface_cfqo9_10";
5480
5621
  const fill = "_fill_cfqo9_35";
5481
- const styles$E = {
5622
+ const styles$F = {
5482
5623
  surface: surface$1,
5483
5624
  fill
5484
5625
  };
@@ -5519,7 +5660,7 @@ const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false
5519
5660
  ...rest,
5520
5661
  ref: attach,
5521
5662
  "data-shop-theme": tone,
5522
- className: [styles$E.surface, fill2 ? styles$E.fill : "", className ?? ""].filter(Boolean).join(" "),
5663
+ className: [styles$F.surface, fill2 ? styles$F.fill : "", className ?? ""].filter(Boolean).join(" "),
5523
5664
  children
5524
5665
  }
5525
5666
  );
@@ -5527,17 +5668,17 @@ const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false
5527
5668
  const root$6 = "_root_ney0g_1";
5528
5669
  const inner = "_inner_ney0g_6";
5529
5670
  const media$3 = "_media_ney0g_20";
5530
- const lines$2 = "_lines_ney0g_32";
5671
+ const lines$3 = "_lines_ney0g_32";
5531
5672
  const lineWide = "_lineWide_ney0g_41";
5532
5673
  const lineMid = "_lineMid_ney0g_45";
5533
5674
  const lineNarrow = "_lineNarrow_ney0g_49";
5534
5675
  const row$8 = "_row_ney0g_53";
5535
5676
  const action$2 = "_action_ney0g_57";
5536
- const styles$D = {
5677
+ const styles$E = {
5537
5678
  root: root$6,
5538
5679
  inner,
5539
5680
  media: media$3,
5540
- lines: lines$2,
5681
+ lines: lines$3,
5541
5682
  lineWide,
5542
5683
  lineMid,
5543
5684
  lineNarrow,
@@ -5545,34 +5686,34 @@ const styles$D = {
5545
5686
  action: action$2
5546
5687
  };
5547
5688
  function ScreenSkeleton({ tone, shape = "media" }) {
5548
- return /* @__PURE__ */ jsx(ShopSurface, { tone, fill: true, className: styles$D.root, children: /* @__PURE__ */ jsx("div", { className: styles$D.inner, role: "status", "aria-label": "Loading", children: shape === "media" ? /* @__PURE__ */ jsxs(Fragment, { children: [
5549
- /* @__PURE__ */ jsx(Skeleton, { className: styles$D.media }),
5550
- /* @__PURE__ */ jsxs("div", { className: styles$D.lines, children: [
5551
- /* @__PURE__ */ jsx(Skeleton, { height: 22, className: styles$D.lineWide }),
5552
- /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$D.lineMid }),
5553
- /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$D.lineNarrow })
5689
+ return /* @__PURE__ */ jsx(ShopSurface, { tone, fill: true, className: styles$E.root, children: /* @__PURE__ */ jsx("div", { className: styles$E.inner, role: "status", "aria-label": "Loading", children: shape === "media" ? /* @__PURE__ */ jsxs(Fragment, { children: [
5690
+ /* @__PURE__ */ jsx(Skeleton, { className: styles$E.media }),
5691
+ /* @__PURE__ */ jsxs("div", { className: styles$E.lines, children: [
5692
+ /* @__PURE__ */ jsx(Skeleton, { height: 22, className: styles$E.lineWide }),
5693
+ /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$E.lineMid }),
5694
+ /* @__PURE__ */ jsx(Skeleton, { height: 16, className: styles$E.lineNarrow })
5554
5695
  ] }),
5555
- /* @__PURE__ */ jsx(Skeleton, { height: 48, radius: 8, className: styles$D.action })
5556
- ] }) : /* @__PURE__ */ jsx("div", { className: styles$D.lines, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { height: 72, className: styles$D.row }, i)) }) }) });
5696
+ /* @__PURE__ */ jsx(Skeleton, { height: 48, radius: 8, className: styles$E.action })
5697
+ ] }) : /* @__PURE__ */ jsx("div", { className: styles$E.lines, children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx(Skeleton, { height: 72, className: styles$E.row }, i)) }) }) });
5557
5698
  }
5558
5699
  const root$5 = "_root_1u83t_1";
5559
5700
  const icon$4 = "_icon_1u83t_10";
5560
- const title$h = "_title_1u83t_15";
5701
+ const title$j = "_title_1u83t_15";
5561
5702
  const body$5 = "_body_1u83t_20";
5562
5703
  const action$1 = "_action_1u83t_33";
5563
- const styles$C = {
5704
+ const styles$D = {
5564
5705
  root: root$5,
5565
5706
  icon: icon$4,
5566
- title: title$h,
5707
+ title: title$j,
5567
5708
  body: body$5,
5568
5709
  action: action$1
5569
5710
  };
5570
5711
  function EmptyState({ title: title2, body: body2, action: action2, icon: icon2 }) {
5571
- return /* @__PURE__ */ jsxs("div", { className: styles$C.root, role: "status", children: [
5572
- icon2 && /* @__PURE__ */ jsx("div", { className: styles$C.icon, children: icon2 }),
5573
- /* @__PURE__ */ jsx("h2", { className: styles$C.title, children: title2 }),
5574
- body2 && /* @__PURE__ */ jsx("p", { className: styles$C.body, children: body2 }),
5575
- action2 && /* @__PURE__ */ jsx("div", { className: styles$C.action, children: action2 })
5712
+ return /* @__PURE__ */ jsxs("div", { className: styles$D.root, role: "status", children: [
5713
+ icon2 && /* @__PURE__ */ jsx("div", { className: styles$D.icon, children: icon2 }),
5714
+ /* @__PURE__ */ jsx("h2", { className: styles$D.title, children: title2 }),
5715
+ body2 && /* @__PURE__ */ jsx("p", { className: styles$D.body, children: body2 }),
5716
+ action2 && /* @__PURE__ */ jsx("div", { className: styles$D.action, children: action2 })
5576
5717
  ] });
5577
5718
  }
5578
5719
  const TREATMENTS = {
@@ -5658,6 +5799,14 @@ const TREATMENTS = {
5658
5799
  body: "We could not find that order.",
5659
5800
  retriable: false
5660
5801
  },
5802
+ support_ticket_not_found: {
5803
+ title: "Request not found",
5804
+ // "Request", not "ticket": the fan sent a message from the Help Center and has no
5805
+ // reason to know we filed it as a ticket anywhere. Not retriable, because the same
5806
+ // reference answers the same way every time.
5807
+ body: "We could not find that support request.",
5808
+ retriable: false
5809
+ },
5661
5810
  order_not_cancellable: {
5662
5811
  title: "Too late to change this",
5663
5812
  body: "This order has already been despatched.",
@@ -5701,19 +5850,19 @@ function isDuplicateOrder(err) {
5701
5850
  return codeOf(err) === "duplicate_order";
5702
5851
  }
5703
5852
  const root$4 = "_root_1lbpx_1";
5704
- const title$g = "_title_1lbpx_10";
5853
+ const title$i = "_title_1lbpx_10";
5705
5854
  const body$4 = "_body_1lbpx_15";
5706
- const styles$B = {
5855
+ const styles$C = {
5707
5856
  root: root$4,
5708
- title: title$g,
5857
+ title: title$i,
5709
5858
  body: body$4
5710
5859
  };
5711
5860
  function ErrorState({ code, title: title2, body: body2, onRetry, retryLabel }) {
5712
5861
  const treatment = treatmentFor(code);
5713
5862
  const showRetry = Boolean(onRetry) && treatment.retriable;
5714
- return /* @__PURE__ */ jsxs("div", { className: styles$B.root, role: "alert", children: [
5715
- /* @__PURE__ */ jsx("h2", { className: styles$B.title, children: title2 ?? treatment.title }),
5716
- /* @__PURE__ */ jsx("p", { className: styles$B.body, children: body2 ?? treatment.body }),
5863
+ return /* @__PURE__ */ jsxs("div", { className: styles$C.root, role: "alert", children: [
5864
+ /* @__PURE__ */ jsx("h2", { className: styles$C.title, children: title2 ?? treatment.title }),
5865
+ /* @__PURE__ */ jsx("p", { className: styles$C.body, children: body2 ?? treatment.body }),
5717
5866
  showRetry && /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onRetry, children: retryLabel ?? "Try again" })
5718
5867
  ] });
5719
5868
  }
@@ -5738,20 +5887,24 @@ function StatusBadge({ status: status2 }) {
5738
5887
  const label2 = STATUS_LABEL[status2] ?? status2;
5739
5888
  return /* @__PURE__ */ jsx(Badge, { tone, children: label2 });
5740
5889
  }
5741
- const viewport = "_viewport_1lt9i_1";
5742
- const toast = "_toast_1lt9i_15";
5743
- const text$4 = "_text_1lt9i_32";
5744
- const message$1 = "_message_1lt9i_39";
5745
- const action = "_action_1lt9i_44";
5746
- const neutral = "_neutral_1lt9i_63";
5747
- const success = "_success_1lt9i_68";
5748
- const critical = "_critical_1lt9i_73";
5749
- const rich = "_rich_1lt9i_81";
5750
- const description = "_description_1lt9i_96";
5751
- const thumb$1 = "_thumb_1lt9i_113";
5752
- const thumbImage = "_thumbImage_1lt9i_124";
5753
- const styles$A = {
5890
+ const viewport = "_viewport_5aafz_14";
5891
+ const anchor = "_anchor_5aafz_41";
5892
+ const caret = "_caret_5aafz_59";
5893
+ const toast = "_toast_5aafz_82";
5894
+ const text$4 = "_text_5aafz_111";
5895
+ const message$1 = "_message_5aafz_120";
5896
+ const action = "_action_5aafz_133";
5897
+ const neutral = "_neutral_5aafz_158";
5898
+ const success = "_success_5aafz_163";
5899
+ const critical = "_critical_5aafz_168";
5900
+ const rich = "_rich_5aafz_183";
5901
+ const description = "_description_5aafz_198";
5902
+ const thumb$2 = "_thumb_5aafz_216";
5903
+ const thumbImage = "_thumbImage_5aafz_227";
5904
+ const styles$B = {
5754
5905
  viewport,
5906
+ anchor,
5907
+ caret,
5755
5908
  toast,
5756
5909
  text: text$4,
5757
5910
  message: message$1,
@@ -5761,10 +5914,14 @@ const styles$A = {
5761
5914
  critical,
5762
5915
  rich,
5763
5916
  description,
5764
- thumb: thumb$1,
5917
+ thumb: thumb$2,
5765
5918
  thumbImage
5766
5919
  };
5767
5920
  const ToastContext = createContext(null);
5921
+ const CART_TRIGGER_SELECTOR = "[data-shop-cart-trigger]";
5922
+ const CARET_GAP = 32;
5923
+ const EDGE_GAP = 12;
5924
+ const CARET_MIN_INSET = 24;
5768
5925
  function useToast() {
5769
5926
  const ctx = useContext(ToastContext);
5770
5927
  const emit = useShopOptional()?.emit;
@@ -5781,9 +5938,19 @@ function useToast() {
5781
5938
  function normalise(toneOrOptions) {
5782
5939
  return typeof toneOrOptions === "string" ? { tone: toneOrOptions } : toneOrOptions ?? {};
5783
5940
  }
5941
+ function Caret() {
5942
+ return /* @__PURE__ */ jsx("svg", { width: "24", height: "10", viewBox: "0 0 24 10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
5943
+ "path",
5944
+ {
5945
+ d: "M0 10L10.8906 0.280023C11.5624 -0.0933413 12.4376 -0.0933413 13.1094 0.280025L24 10H0Z",
5946
+ fill: "#080E12"
5947
+ }
5948
+ ) });
5949
+ }
5784
5950
  let nextId = 0;
5785
5951
  function ToastProvider({ children }) {
5786
5952
  const [toasts, setToasts] = useState([]);
5953
+ const viewportRef = useRef(null);
5787
5954
  const dismiss = useCallback((id) => {
5788
5955
  setToasts((prev) => prev.filter((t) => t.id !== id));
5789
5956
  }, []);
@@ -5811,38 +5978,79 @@ function ToastProvider({ children }) {
5811
5978
  },
5812
5979
  [dismiss, hostOwnsNotifications, emit]
5813
5980
  );
5981
+ useEffect(() => {
5982
+ const el = viewportRef.current;
5983
+ if (!el || toasts.length === 0) return;
5984
+ const measure = () => {
5985
+ const trigger = document.querySelector(CART_TRIGGER_SELECTOR);
5986
+ const icon2 = trigger ? trigger.getBoundingClientRect() : null;
5987
+ if (!icon2 || icon2.width === 0 || icon2.bottom <= 0 || icon2.top >= window.innerHeight) {
5988
+ el.style.setProperty("--toast-top", `${EDGE_GAP}px`);
5989
+ el.style.removeProperty("--toast-caret-right");
5990
+ return;
5991
+ }
5992
+ el.style.setProperty("--toast-top", `${Math.round(icon2.bottom + CARET_GAP)}px`);
5993
+ const card2 = el.firstElementChild;
5994
+ if (!card2) return;
5995
+ const box2 = card2.getBoundingClientRect();
5996
+ const centre = icon2.left + icon2.width / 2;
5997
+ const inset2 = Math.min(
5998
+ Math.max(box2.right - centre, CARET_MIN_INSET),
5999
+ Math.max(box2.width - CARET_MIN_INSET, CARET_MIN_INSET)
6000
+ );
6001
+ el.style.setProperty("--toast-caret-right", `${Math.round(inset2)}px`);
6002
+ };
6003
+ measure();
6004
+ window.addEventListener("resize", measure);
6005
+ window.addEventListener("orientationchange", measure);
6006
+ return () => {
6007
+ window.removeEventListener("resize", measure);
6008
+ window.removeEventListener("orientationchange", measure);
6009
+ };
6010
+ }, [toasts.length]);
5814
6011
  const api = useMemo(() => ({ show }), [show]);
5815
6012
  return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: api, children: [
5816
6013
  children,
5817
- /* @__PURE__ */ jsx("div", { className: styles$A.viewport, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((t) => {
6014
+ /* @__PURE__ */ jsx("div", { className: styles$B.viewport, ref: viewportRef, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((t) => {
5818
6015
  const rich2 = Boolean(t.description || t.image);
5819
- return /* @__PURE__ */ jsxs(
5820
- "div",
5821
- {
5822
- className: [styles$A.toast, rich2 ? styles$A.rich : styles$A[t.tone]].join(" "),
5823
- role: "status",
5824
- children: [
5825
- t.image && /* @__PURE__ */ jsx("span", { className: styles$A.thumb, children: /* @__PURE__ */ jsx(ShopImage, { src: t.image, alt: "", fill: true, sizes: "40px", className: styles$A.thumbImage }) }),
5826
- /* @__PURE__ */ jsxs("span", { className: styles$A.text, children: [
5827
- /* @__PURE__ */ jsx("span", { className: styles$A.message, children: t.message }),
5828
- t.description && /* @__PURE__ */ jsx("span", { className: styles$A.description, children: t.description })
5829
- ] }),
5830
- t.action && /* @__PURE__ */ jsx(
5831
- "button",
5832
- {
5833
- type: "button",
5834
- className: styles$A.action,
5835
- onClick: () => {
5836
- t.action?.onAction();
5837
- dismiss(t.id);
5838
- },
5839
- children: t.action.label
5840
- }
5841
- )
5842
- ]
5843
- },
5844
- t.id
5845
- );
6016
+ return /* @__PURE__ */ jsxs("div", { className: styles$B.anchor, children: [
6017
+ t.anchor === "cart" && /* @__PURE__ */ jsx("span", { className: styles$B.caret, children: /* @__PURE__ */ jsx(Caret, {}) }),
6018
+ /* @__PURE__ */ jsxs(
6019
+ "div",
6020
+ {
6021
+ className: [styles$B.toast, rich2 ? styles$B.rich : styles$B[t.tone]].join(" "),
6022
+ role: "status",
6023
+ children: [
6024
+ t.image && /* @__PURE__ */ jsx("span", { className: styles$B.thumb, children: /* @__PURE__ */ jsx(
6025
+ ShopImage,
6026
+ {
6027
+ src: t.image,
6028
+ alt: "",
6029
+ fill: true,
6030
+ sizes: "40px",
6031
+ className: styles$B.thumbImage
6032
+ }
6033
+ ) }),
6034
+ /* @__PURE__ */ jsxs("span", { className: styles$B.text, children: [
6035
+ /* @__PURE__ */ jsx("span", { className: styles$B.message, children: t.message }),
6036
+ t.description && /* @__PURE__ */ jsx("span", { className: styles$B.description, children: t.description })
6037
+ ] }),
6038
+ t.action && /* @__PURE__ */ jsx(
6039
+ "button",
6040
+ {
6041
+ type: "button",
6042
+ className: styles$B.action,
6043
+ onClick: () => {
6044
+ t.action?.onAction();
6045
+ dismiss(t.id);
6046
+ },
6047
+ children: t.action.label
6048
+ }
6049
+ )
6050
+ ]
6051
+ }
6052
+ )
6053
+ ] }, t.id);
5846
6054
  }) })
5847
6055
  ] });
5848
6056
  }
@@ -5894,13 +6102,13 @@ function useLocale(override) {
5894
6102
  }
5895
6103
  const badge$3 = "_badge_156ya_2";
5896
6104
  const icon$3 = "_icon_156ya_18";
5897
- const styles$z = {
6105
+ const styles$A = {
5898
6106
  badge: badge$3,
5899
6107
  icon: icon$3
5900
6108
  };
5901
6109
  function SaleBadge({ pct }) {
5902
- return /* @__PURE__ */ jsxs("span", { className: styles$z.badge, children: [
5903
- /* @__PURE__ */ jsxs("svg", { className: styles$z.icon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
6110
+ return /* @__PURE__ */ jsxs("span", { className: styles$A.badge, children: [
6111
+ /* @__PURE__ */ jsxs("svg", { className: styles$A.icon, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
5904
6112
  /* @__PURE__ */ jsx(
5905
6113
  "path",
5906
6114
  {
@@ -5926,7 +6134,7 @@ const lg = "_lg_n3nm5_27";
5926
6134
  const price$1 = "_price_n3nm5_31";
5927
6135
  const compareAt = "_compareAt_n3nm5_36";
5928
6136
  const strikethrough = "_strikethrough_n3nm5_44";
5929
- const styles$y = {
6137
+ const styles$z = {
5930
6138
  root: root$3,
5931
6139
  center: center$1,
5932
6140
  end,
@@ -5948,11 +6156,11 @@ function PriceBlock({
5948
6156
  const { format } = useMoney();
5949
6157
  const pct = discountPct$1 ?? discountPct(price2, compareAt2);
5950
6158
  const hasCompare = compareAt2 && compareAt2.amount > price2.amount;
5951
- return /* @__PURE__ */ jsxs("div", { className: [styles$y.root, styles$y[size], styles$y[align], styles$y[variant]].join(" "), children: [
5952
- /* @__PURE__ */ jsx("span", { className: styles$y.price, children: format(price2) }),
5953
- hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$y.compareAt, children: [
5954
- /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: "Was " }),
5955
- format(compareAt2)
6159
+ return /* @__PURE__ */ jsxs("div", { className: [styles$z.root, styles$z[size], styles$z[align], styles$z[variant]].join(" "), children: [
6160
+ /* @__PURE__ */ jsx("span", { className: styles$z.price, children: format(price2) }),
6161
+ hasCompare && /* @__PURE__ */ jsxs("span", { className: styles$z.compareAt, children: [
6162
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
6163
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
5956
6164
  ] }),
5957
6165
  hasCompare && variant === "badge" && pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
5958
6166
  ] });
@@ -6045,23 +6253,23 @@ const SWATCH_HEX = {
6045
6253
  function swatchColour(name) {
6046
6254
  return SWATCH_HEX[name.toLowerCase().trim()] ?? "#c9cdd0";
6047
6255
  }
6048
- const timeline = "_timeline_1j37h_7";
6049
- const row$7 = "_row_1j37h_15";
6050
- const line$1 = "_line_1j37h_20";
6051
- const marker = "_marker_1j37h_27";
6052
- const tick = "_tick_1j37h_35";
6053
- const pending$2 = "_pending_1j37h_44";
6054
- const connector = "_connector_1j37h_68";
6055
- const text$3 = "_text_1j37h_84";
6056
- const label$1 = "_label_1j37h_101";
6057
- const past = "_past_1j37h_113";
6058
- const current = "_current_1j37h_118";
6059
- const future = "_future_1j37h_123";
6060
- const date$1 = "_date_1j37h_128";
6061
- const styles$x = {
6256
+ const timeline = "_timeline_1cum7_7";
6257
+ const row$7 = "_row_1cum7_15";
6258
+ const line$2 = "_line_1cum7_20";
6259
+ const marker = "_marker_1cum7_27";
6260
+ const tick = "_tick_1cum7_35";
6261
+ const pending$2 = "_pending_1cum7_44";
6262
+ const connector = "_connector_1cum7_68";
6263
+ const text$3 = "_text_1cum7_84";
6264
+ const label$1 = "_label_1cum7_101";
6265
+ const past = "_past_1cum7_113";
6266
+ const current = "_current_1cum7_118";
6267
+ const future = "_future_1cum7_133";
6268
+ const date$1 = "_date_1cum7_138";
6269
+ const styles$y = {
6062
6270
  timeline,
6063
6271
  row: row$7,
6064
- line: line$1,
6272
+ line: line$2,
6065
6273
  marker,
6066
6274
  tick,
6067
6275
  pending: pending$2,
@@ -6076,22 +6284,22 @@ const styles$x = {
6076
6284
  function OrderTimeline({ progress: progress2, locale: localeProp }) {
6077
6285
  const locale = useLocale(localeProp);
6078
6286
  const currentIndex = progress2.findIndex((e) => e.current);
6079
- return /* @__PURE__ */ jsx("ol", { className: styles$x.timeline, children: progress2.map((entry, i) => {
6287
+ return /* @__PURE__ */ jsx("ol", { className: styles$y.timeline, children: progress2.map((entry, i) => {
6080
6288
  const state = stateOf(entry, i, currentIndex);
6081
6289
  return /* @__PURE__ */ jsxs(
6082
6290
  "li",
6083
6291
  {
6084
- className: styles$x.row,
6292
+ className: styles$y.row,
6085
6293
  "aria-current": entry.current ? "step" : void 0,
6086
6294
  children: [
6087
- /* @__PURE__ */ jsxs("div", { className: styles$x.line, children: [
6088
- /* @__PURE__ */ jsx("span", { className: styles$x.marker, children: state === "future" ? /* @__PURE__ */ jsx("span", { className: styles$x.pending, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(StepTick, { tone: state }) }),
6089
- /* @__PURE__ */ jsxs("span", { className: styles$x.text, children: [
6090
- /* @__PURE__ */ jsx("span", { className: [styles$x.label, styles$x[state]].join(" "), children: entry.label }),
6091
- entry.at && /* @__PURE__ */ jsx("time", { className: styles$x.date, dateTime: entry.at, children: formatStepDate(entry.at, locale) })
6295
+ /* @__PURE__ */ jsxs("div", { className: styles$y.line, children: [
6296
+ /* @__PURE__ */ jsx("span", { className: styles$y.marker, children: state === "future" ? /* @__PURE__ */ jsx("span", { className: styles$y.pending, "aria-hidden": "true" }) : /* @__PURE__ */ jsx(StepTick, { tone: state }) }),
6297
+ /* @__PURE__ */ jsxs("span", { className: styles$y.text, children: [
6298
+ /* @__PURE__ */ jsx("span", { className: [styles$y.label, styles$y[state]].join(" "), children: entry.label }),
6299
+ entry.at && /* @__PURE__ */ jsx("time", { className: styles$y.date, dateTime: entry.at, children: formatStepDate(entry.at, locale) })
6092
6300
  ] })
6093
6301
  ] }),
6094
- i < progress2.length - 1 && /* @__PURE__ */ jsx("span", { className: styles$x.connector, "aria-hidden": "true" })
6302
+ i < progress2.length - 1 && /* @__PURE__ */ jsx("span", { className: styles$y.connector, "aria-hidden": "true" })
6095
6303
  ]
6096
6304
  },
6097
6305
  entry.step
@@ -6107,7 +6315,7 @@ function StepTick({ tone }) {
6107
6315
  return /* @__PURE__ */ jsxs(
6108
6316
  "svg",
6109
6317
  {
6110
- className: styles$x.tick,
6318
+ className: styles$y.tick,
6111
6319
  width: "28",
6112
6320
  height: "28",
6113
6321
  viewBox: "0 0 28 28",
@@ -6140,15 +6348,17 @@ function formatStepDate(iso, locale) {
6140
6348
  const dayMonth = date2.toLocaleDateString(locale, { day: "numeric", month: "short" });
6141
6349
  return `${weekday}, ${dayMonth}`;
6142
6350
  }
6143
- const summary = "_summary_1h18y_2";
6144
- const row$6 = "_row_1h18y_8";
6145
- const free = "_free_1h18y_36";
6146
- const pending$1 = "_pending_1h18y_42";
6147
- const styles$w = {
6351
+ const summary = "_summary_1hsxt_2";
6352
+ const row$6 = "_row_1hsxt_16";
6353
+ const free = "_free_1hsxt_53";
6354
+ const pending$1 = "_pending_1hsxt_59";
6355
+ const discount = "_discount_1hsxt_69";
6356
+ const styles$x = {
6148
6357
  summary,
6149
6358
  row: row$6,
6150
6359
  free,
6151
- pending: pending$1
6360
+ pending: pending$1,
6361
+ discount
6152
6362
  };
6153
6363
  const CART_ROWS = [
6154
6364
  { label: "Subtotal", key: "subtotal" },
@@ -6160,49 +6370,56 @@ function OrderSummary({
6160
6370
  pricing,
6161
6371
  deferred = [],
6162
6372
  hidden = [],
6163
- rows = CART_ROWS
6373
+ rows = CART_ROWS,
6374
+ discount: discount2
6164
6375
  }) {
6165
6376
  const { format } = useMoney();
6166
6377
  const isDeferred = (key) => deferred.includes(key);
6167
6378
  const anyDeferred = deferred.length > 0;
6168
- const visible = rows.filter((row2) => !hidden.includes(row2.key)).filter((row2) => row2.key !== "total" || !anyDeferred);
6169
- return /* @__PURE__ */ jsx("dl", { className: styles$w.summary, children: visible.map(({ label: label2, key }) => {
6379
+ const visible = rows.filter((row2) => !hidden.includes(row2.key)).filter((row2) => row2.key !== "total" || !anyDeferred).filter((row2) => row2.key !== "discount" || discount2 !== void 0);
6380
+ return /* @__PURE__ */ jsx("dl", { className: styles$x.summary, children: visible.map(({ label: label2, key }) => {
6381
+ if (key === "discount" && discount2) {
6382
+ return /* @__PURE__ */ jsxs("div", { className: [styles$x.row, styles$x.discount].join(" "), children: [
6383
+ /* @__PURE__ */ jsx("dt", { children: label2 }),
6384
+ /* @__PURE__ */ jsx("dd", { children: `−${format(discount2)}` })
6385
+ ] }, key);
6386
+ }
6170
6387
  const pending2 = key !== "total" && isDeferred(key);
6171
- return /* @__PURE__ */ jsxs("div", { className: styles$w.row, children: [
6388
+ return /* @__PURE__ */ jsxs("div", { className: styles$x.row, children: [
6172
6389
  /* @__PURE__ */ jsx("dt", { children: label2 }),
6173
- /* @__PURE__ */ jsx("dd", { className: pending2 ? styles$w.pending : void 0, children: pending2 ? "Calculated at checkout" : renderValue(key, pricing, format) })
6390
+ /* @__PURE__ */ jsx("dd", { className: pending2 ? styles$x.pending : void 0, children: pending2 ? "Calculated at checkout" : renderValue(key, pricing, format) })
6174
6391
  ] }, key);
6175
6392
  }) });
6176
6393
  }
6177
6394
  function renderValue(key, pricing, format) {
6178
6395
  if (key === "shipping" && pricing.shipping.amount === 0) {
6179
- return /* @__PURE__ */ jsx("span", { className: styles$w.free, children: "Free" });
6396
+ return /* @__PURE__ */ jsx("span", { className: styles$x.free, children: "Free" });
6180
6397
  }
6181
- return format(pricing[key]);
6398
+ return key === "discount" ? null : format(pricing[key]);
6182
6399
  }
6183
- const page$2 = "_page_1eqkm_1";
6400
+ const page$3 = "_page_1eqkm_1";
6184
6401
  const status = "_status_1eqkm_10";
6185
6402
  const widget = "_widget_1eqkm_18";
6186
- const title$f = "_title_1eqkm_24";
6187
- const headline = "_headline_1eqkm_30";
6188
- const subtitle$3 = "_subtitle_1eqkm_37";
6403
+ const title$h = "_title_1eqkm_24";
6404
+ const headline$1 = "_headline_1eqkm_30";
6405
+ const subtitle$4 = "_subtitle_1eqkm_37";
6189
6406
  const dot$3 = "_dot_1eqkm_48";
6190
6407
  const trackButton = "_trackButton_1eqkm_58";
6191
6408
  const srOnly = "_srOnly_1eqkm_78";
6192
6409
  const itemsCard = "_itemsCard_1eqkm_92";
6193
6410
  const cardHeader = "_cardHeader_1eqkm_100";
6194
- const cardTitle = "_cardTitle_1eqkm_108";
6411
+ const cardTitle$1 = "_cardTitle_1eqkm_108";
6195
6412
  const count$1 = "_count_1eqkm_115";
6196
- const lines$1 = "_lines_1eqkm_130";
6197
- const line = "_line_1eqkm_130";
6198
- const thumb = "_thumb_1eqkm_152";
6199
- const image$8 = "_image_1eqkm_162";
6200
- const placeholder$5 = "_placeholder_1eqkm_166";
6201
- const lineBody = "_lineBody_1eqkm_172";
6202
- const lineText = "_lineText_1eqkm_180";
6203
- const lineTitle = "_lineTitle_1eqkm_189";
6413
+ const lines$2 = "_lines_1eqkm_130";
6414
+ const line$1 = "_line_1eqkm_130";
6415
+ const thumb$1 = "_thumb_1eqkm_152";
6416
+ const image$9 = "_image_1eqkm_162";
6417
+ const placeholder$6 = "_placeholder_1eqkm_166";
6418
+ const lineBody$1 = "_lineBody_1eqkm_172";
6419
+ const lineText$1 = "_lineText_1eqkm_180";
6420
+ const lineTitle$1 = "_lineTitle_1eqkm_189";
6204
6421
  const lineDetails = "_lineDetails_1eqkm_197";
6205
- const linePrice = "_linePrice_1eqkm_205";
6422
+ const linePrice$1 = "_linePrice_1eqkm_205";
6206
6423
  const details$1 = "_details_1eqkm_215";
6207
6424
  const detailBlock = "_detailBlock_1eqkm_228";
6208
6425
  const payment = "_payment_1eqkm_235";
@@ -6211,31 +6428,31 @@ const detailValue = "_detailValue_1eqkm_245";
6211
6428
  const last4 = "_last4_1eqkm_256";
6212
6429
  const brand = "_brand_1eqkm_262";
6213
6430
  const divider$2 = "_divider_1eqkm_268";
6214
- const summaryCard = "_summaryCard_1eqkm_275";
6215
- const styles$v = {
6216
- page: page$2,
6431
+ const summaryCard$1 = "_summaryCard_1eqkm_275";
6432
+ const styles$w = {
6433
+ page: page$3,
6217
6434
  status,
6218
6435
  widget,
6219
- title: title$f,
6220
- headline,
6221
- subtitle: subtitle$3,
6436
+ title: title$h,
6437
+ headline: headline$1,
6438
+ subtitle: subtitle$4,
6222
6439
  dot: dot$3,
6223
6440
  trackButton,
6224
6441
  srOnly,
6225
6442
  itemsCard,
6226
6443
  cardHeader,
6227
- cardTitle,
6444
+ cardTitle: cardTitle$1,
6228
6445
  count: count$1,
6229
- lines: lines$1,
6230
- line,
6231
- thumb,
6232
- image: image$8,
6233
- placeholder: placeholder$5,
6234
- lineBody,
6235
- lineText,
6236
- lineTitle,
6446
+ lines: lines$2,
6447
+ line: line$1,
6448
+ thumb: thumb$1,
6449
+ image: image$9,
6450
+ placeholder: placeholder$6,
6451
+ lineBody: lineBody$1,
6452
+ lineText: lineText$1,
6453
+ lineTitle: lineTitle$1,
6237
6454
  lineDetails,
6238
- linePrice,
6455
+ linePrice: linePrice$1,
6239
6456
  details: details$1,
6240
6457
  detailBlock,
6241
6458
  payment,
@@ -6244,9 +6461,9 @@ const styles$v = {
6244
6461
  last4,
6245
6462
  brand,
6246
6463
  divider: divider$2,
6247
- summaryCard
6464
+ summaryCard: summaryCard$1
6248
6465
  };
6249
- const SUMMARY_ROWS = [
6466
+ const SUMMARY_ROWS$1 = [
6250
6467
  { label: "Subtotal", key: "subtotal" },
6251
6468
  { label: "Tax", key: "tax" },
6252
6469
  { label: "Shipping", key: "shipping" },
@@ -6275,7 +6492,7 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
6275
6492
  void load();
6276
6493
  }, [load]);
6277
6494
  if (state === "loading") {
6278
- return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
6495
+ return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
6279
6496
  /* @__PURE__ */ jsx(Skeleton, { height: 120, radius: 8 }),
6280
6497
  /* @__PURE__ */ jsx(Skeleton, { height: 220, radius: 18 }),
6281
6498
  /* @__PURE__ */ jsx(Skeleton, { height: 140, radius: 18 })
@@ -6284,56 +6501,46 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
6284
6501
  if (state === "error" || !order) {
6285
6502
  return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
6286
6503
  }
6287
- return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
6288
- /* @__PURE__ */ jsxs("section", { className: styles$v.status, "aria-label": "Delivery status", children: [
6289
- /* @__PURE__ */ jsxs("div", { className: styles$v.title, children: [
6290
- /* @__PURE__ */ jsx("h1", { className: styles$v.headline, children: order.headline }),
6291
- /* @__PURE__ */ jsxs("p", { className: styles$v.subtitle, children: [
6292
- /* @__PURE__ */ jsxs("span", { children: [
6293
- "Order #",
6294
- shortRef$1(order.order_ref)
6295
- ] }),
6296
- /* @__PURE__ */ jsx("span", { className: styles$v.dot, "aria-hidden": "true" }),
6297
- /* @__PURE__ */ jsxs("span", { children: [
6298
- "Placed ",
6299
- formatPlaced$1(order.placed_at, locale)
6300
- ] })
6504
+ return /* @__PURE__ */ jsxs("div", { className: styles$w.page, children: [
6505
+ /* @__PURE__ */ jsxs("section", { className: styles$w.status, "aria-label": "Delivery status", children: [
6506
+ /* @__PURE__ */ jsxs("div", { className: styles$w.title, children: [
6507
+ /* @__PURE__ */ jsx("h1", { className: styles$w.headline, children: order.headline }),
6508
+ /* @__PURE__ */ jsxs("p", { className: styles$w.subtitle, children: [
6509
+ /* @__PURE__ */ jsx("span", { children: `Order #${shortRef$1(order.order_ref)}` }),
6510
+ /* @__PURE__ */ jsx("span", { className: styles$w.dot, "aria-hidden": "true" }),
6511
+ /* @__PURE__ */ jsx("span", { children: `Placed ${formatPlaced$1(order.placed_at, locale)}` })
6301
6512
  ] })
6302
6513
  ] }),
6303
- /* @__PURE__ */ jsxs("div", { className: styles$v.widget, children: [
6514
+ /* @__PURE__ */ jsxs("div", { className: styles$w.widget, children: [
6304
6515
  /* @__PURE__ */ jsx(OrderTimeline, { progress: order.progress, locale }),
6305
6516
  order.tracking?.url && /* @__PURE__ */ jsxs(
6306
6517
  "a",
6307
6518
  {
6308
- className: styles$v.trackButton,
6519
+ className: styles$w.trackButton,
6309
6520
  href: order.tracking.url,
6310
6521
  target: "_blank",
6311
6522
  rel: "noopener noreferrer",
6312
6523
  children: [
6313
6524
  "Track order",
6314
- /* @__PURE__ */ jsxs("span", { className: styles$v.srOnly, children: [
6315
- " (opens ",
6316
- order.tracking.carrier,
6317
- " in a new tab)"
6318
- ] })
6525
+ /* @__PURE__ */ jsx("span", { className: styles$w.srOnly, children: ` (opens ${order.tracking.carrier} in a new tab)` })
6319
6526
  ]
6320
6527
  }
6321
6528
  )
6322
6529
  ] })
6323
6530
  ] }),
6324
6531
  /* @__PURE__ */ jsx(ItemsCard, { order }),
6325
- /* @__PURE__ */ jsxs("section", { className: styles$v.details, "aria-label": "Delivery and payment", children: [
6326
- /* @__PURE__ */ jsxs("div", { className: styles$v.detailBlock, children: [
6327
- /* @__PURE__ */ jsx("h2", { className: styles$v.detailLabel, children: "Shipping address" }),
6328
- /* @__PURE__ */ jsx("p", { className: styles$v.detailValue, children: formatAddress(order.ship_to) })
6532
+ /* @__PURE__ */ jsxs("section", { className: styles$w.details, "aria-label": "Delivery and payment", children: [
6533
+ /* @__PURE__ */ jsxs("div", { className: styles$w.detailBlock, children: [
6534
+ /* @__PURE__ */ jsx("h2", { className: styles$w.detailLabel, children: "Shipping address" }),
6535
+ /* @__PURE__ */ jsx("p", { className: styles$w.detailValue, children: formatAddress$1(order.ship_to) })
6329
6536
  ] }),
6330
6537
  order.payment && /* @__PURE__ */ jsxs(Fragment, { children: [
6331
- /* @__PURE__ */ jsx("div", { className: styles$v.divider, role: "presentation" }),
6332
- /* @__PURE__ */ jsxs("div", { className: [styles$v.detailBlock, styles$v.payment].join(" "), children: [
6333
- /* @__PURE__ */ jsx("h2", { className: styles$v.detailLabel, children: "Payment" }),
6334
- /* @__PURE__ */ jsxs("p", { className: styles$v.detailValue, children: [
6335
- /* @__PURE__ */ jsx("span", { className: styles$v.brand, children: order.payment.brand }),
6336
- order.payment.last4 && /* @__PURE__ */ jsxs("span", { className: styles$v.last4, children: [
6538
+ /* @__PURE__ */ jsx("div", { className: styles$w.divider, role: "presentation" }),
6539
+ /* @__PURE__ */ jsxs("div", { className: [styles$w.detailBlock, styles$w.payment].join(" "), children: [
6540
+ /* @__PURE__ */ jsx("h2", { className: styles$w.detailLabel, children: "Payment" }),
6541
+ /* @__PURE__ */ jsxs("p", { className: styles$w.detailValue, children: [
6542
+ /* @__PURE__ */ jsx("span", { className: styles$w.brand, children: order.payment.brand }),
6543
+ order.payment.last4 && /* @__PURE__ */ jsxs("span", { className: styles$w.last4, children: [
6337
6544
  "•••• ",
6338
6545
  order.payment.last4
6339
6546
  ] })
@@ -6341,36 +6548,36 @@ function OrderTrackingContent({ orderRef, locale: localeProp }) {
6341
6548
  ] })
6342
6549
  ] })
6343
6550
  ] }),
6344
- /* @__PURE__ */ jsxs("section", { className: styles$v.summaryCard, "aria-label": "Order summary", children: [
6345
- /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Order summary" }),
6346
- /* @__PURE__ */ jsx(OrderSummary, { pricing: toPricing(order), rows: SUMMARY_ROWS })
6551
+ /* @__PURE__ */ jsxs("section", { className: styles$w.summaryCard, "aria-label": "Order summary", children: [
6552
+ /* @__PURE__ */ jsx("h2", { className: styles$w.cardTitle, children: "Order summary" }),
6553
+ /* @__PURE__ */ jsx(OrderSummary, { pricing: toPricing$1(order), rows: SUMMARY_ROWS$1 })
6347
6554
  ] })
6348
6555
  ] });
6349
6556
  }
6350
6557
  function ItemsCard({ order }) {
6351
6558
  const { format } = useMoney();
6352
- return /* @__PURE__ */ jsxs("section", { className: styles$v.itemsCard, "aria-label": "Items", children: [
6353
- /* @__PURE__ */ jsxs("div", { className: styles$v.cardHeader, children: [
6354
- /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Items" }),
6355
- /* @__PURE__ */ jsx("span", { className: styles$v.count, children: order.items.reduce((n, i) => n + i.qty, 0) })
6559
+ return /* @__PURE__ */ jsxs("section", { className: styles$w.itemsCard, "aria-label": "Items", children: [
6560
+ /* @__PURE__ */ jsxs("div", { className: styles$w.cardHeader, children: [
6561
+ /* @__PURE__ */ jsx("h2", { className: styles$w.cardTitle, children: "Items" }),
6562
+ /* @__PURE__ */ jsx("span", { className: styles$w.count, children: order.items.reduce((n, i) => n + i.qty, 0) })
6356
6563
  ] }),
6357
- /* @__PURE__ */ jsx("ul", { className: styles$v.lines, children: order.items.map((item2) => /* @__PURE__ */ jsxs("li", { className: styles$v.line, children: [
6358
- /* @__PURE__ */ jsx("div", { className: styles$v.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$v.image }) : /* @__PURE__ */ jsx("div", { className: styles$v.placeholder, "aria-hidden": "true" }) }),
6359
- /* @__PURE__ */ jsxs("div", { className: styles$v.lineBody, children: [
6360
- /* @__PURE__ */ jsxs("div", { className: styles$v.lineText, children: [
6361
- /* @__PURE__ */ jsx("span", { className: styles$v.lineTitle, children: item2.title ?? item2.sku }),
6362
- detailsOf(item2).length > 0 && /* @__PURE__ */ jsx("span", { className: styles$v.lineDetails, children: detailsOf(item2).map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)) })
6564
+ /* @__PURE__ */ jsx("ul", { className: styles$w.lines, children: order.items.map((item2) => /* @__PURE__ */ jsxs("li", { className: styles$w.line, children: [
6565
+ /* @__PURE__ */ jsx("div", { className: styles$w.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$w.image }) : /* @__PURE__ */ jsx("div", { className: styles$w.placeholder, "aria-hidden": "true" }) }),
6566
+ /* @__PURE__ */ jsxs("div", { className: styles$w.lineBody, children: [
6567
+ /* @__PURE__ */ jsxs("div", { className: styles$w.lineText, children: [
6568
+ /* @__PURE__ */ jsx("span", { className: styles$w.lineTitle, children: item2.title ?? item2.sku }),
6569
+ detailsOf$1(item2).length > 0 && /* @__PURE__ */ jsx("span", { className: styles$w.lineDetails, children: detailsOf$1(item2).map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)) })
6363
6570
  ] }),
6364
- /* @__PURE__ */ jsx("span", { className: styles$v.linePrice, children: format(item2.line_total) })
6571
+ /* @__PURE__ */ jsx("span", { className: styles$w.linePrice, children: format(item2.line_total) })
6365
6572
  ] })
6366
6573
  ] }, item2.line_ref)) })
6367
6574
  ] });
6368
6575
  }
6369
- function detailsOf(item2) {
6576
+ function detailsOf$1(item2) {
6370
6577
  const pairs = variantPairs(item2.attributes).map((p) => `${p.label}: ${p.value}`);
6371
6578
  return item2.qty > 1 ? [...pairs, `Qty: ${item2.qty}`] : pairs;
6372
6579
  }
6373
- function toPricing(order) {
6580
+ function toPricing$1(order) {
6374
6581
  return {
6375
6582
  subtotal: order.totals.items,
6376
6583
  shipping: order.totals.shipping,
@@ -6388,6 +6595,164 @@ function formatPlaced$1(iso, locale) {
6388
6595
  year: "numeric"
6389
6596
  });
6390
6597
  }
6598
+ function formatAddress$1(address) {
6599
+ return [address.line1, address.line2, address.postcode, address.city, address.country].filter(Boolean).join(", ");
6600
+ }
6601
+ const page$2 = "_page_8yxu9_6";
6602
+ const confirmed = "_confirmed_8yxu9_16";
6603
+ const title$g = "_title_8yxu9_22";
6604
+ const headline = "_headline_8yxu9_47";
6605
+ const subtitle$3 = "_subtitle_8yxu9_65";
6606
+ const lines$1 = "_lines_8yxu9_88";
6607
+ const line = "_line_8yxu9_88";
6608
+ const thumb = "_thumb_8yxu9_103";
6609
+ const image$8 = "_image_8yxu9_113";
6610
+ const placeholder$5 = "_placeholder_8yxu9_117";
6611
+ const lineBody = "_lineBody_8yxu9_122";
6612
+ const lineText = "_lineText_8yxu9_131";
6613
+ const lineTitle = "_lineTitle_8yxu9_141";
6614
+ const lineMeta = "_lineMeta_8yxu9_160";
6615
+ const linePrice = "_linePrice_8yxu9_175";
6616
+ const paid = "_paid_8yxu9_187";
6617
+ const was$1 = "_was_8yxu9_193";
6618
+ const card$2 = "_card_8yxu9_213";
6619
+ const cardTitle = "_cardTitle_8yxu9_221";
6620
+ const cardBody = "_cardBody_8yxu9_233";
6621
+ const summaryCard = "_summaryCard_8yxu9_205";
6622
+ const done = "_done_8yxu9_261";
6623
+ const styles$v = {
6624
+ page: page$2,
6625
+ confirmed,
6626
+ title: title$g,
6627
+ headline,
6628
+ subtitle: subtitle$3,
6629
+ lines: lines$1,
6630
+ line,
6631
+ thumb,
6632
+ image: image$8,
6633
+ placeholder: placeholder$5,
6634
+ lineBody,
6635
+ lineText,
6636
+ lineTitle,
6637
+ lineMeta,
6638
+ linePrice,
6639
+ paid,
6640
+ was: was$1,
6641
+ card: card$2,
6642
+ cardTitle,
6643
+ cardBody,
6644
+ summaryCard,
6645
+ done
6646
+ };
6647
+ const SUMMARY_ROWS = [
6648
+ { label: "Subtotal", key: "subtotal" },
6649
+ { label: "Discount", key: "discount" },
6650
+ { label: "Shipping", key: "shipping" },
6651
+ { label: "Total", key: "total" }
6652
+ ];
6653
+ function OrderConfirmationView(props) {
6654
+ return /* @__PURE__ */ jsx(ShopSurface, { tone: "light", fill: true, children: /* @__PURE__ */ jsx(OrderConfirmationContent, { ...props }) });
6655
+ }
6656
+ function OrderConfirmationContent({ orderRef, locale: localeProp, onDone }) {
6657
+ const { api } = useShop();
6658
+ const locale = useLocale(localeProp);
6659
+ const [order, setOrder] = useState(null);
6660
+ const [state, setState] = useState("loading");
6661
+ const [errorCode, setErrorCode] = useState(void 0);
6662
+ const load = useCallback(async () => {
6663
+ setState("loading");
6664
+ try {
6665
+ setOrder(await api.orders.get(orderRef));
6666
+ setState("ready");
6667
+ } catch (err) {
6668
+ setErrorCode(codeOf(err));
6669
+ setState("error");
6670
+ }
6671
+ }, [api, orderRef]);
6672
+ useEffect(() => {
6673
+ void load();
6674
+ }, [load]);
6675
+ if (state === "loading") {
6676
+ return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
6677
+ /* @__PURE__ */ jsx(Skeleton, { height: 140, radius: 8 }),
6678
+ /* @__PURE__ */ jsx(Skeleton, { height: 72, radius: 8 }),
6679
+ /* @__PURE__ */ jsx(Skeleton, { height: 120, radius: 18 }),
6680
+ /* @__PURE__ */ jsx(Skeleton, { height: 240, radius: 18 })
6681
+ ] });
6682
+ }
6683
+ if (state === "error" || !order) {
6684
+ return /* @__PURE__ */ jsx(ErrorState, { code: errorCode, onRetry: () => void load() });
6685
+ }
6686
+ return /* @__PURE__ */ jsxs("div", { className: styles$v.page, children: [
6687
+ /* @__PURE__ */ jsxs("section", { className: styles$v.confirmed, "aria-label": "Order confirmation", children: [
6688
+ /* @__PURE__ */ jsxs("div", { className: styles$v.title, children: [
6689
+ /* @__PURE__ */ jsx("h1", { className: styles$v.headline, children: "Your order is confirmed" }),
6690
+ order.email && /* @__PURE__ */ jsx("p", { className: styles$v.subtitle, children: `We’ve sent a confirmation to ${order.email}` })
6691
+ ] }),
6692
+ /* @__PURE__ */ jsx(OrderTimeline, { progress: order.progress, locale })
6693
+ ] }),
6694
+ /* @__PURE__ */ jsx("ul", { className: styles$v.lines, "aria-label": "Items", children: order.items.map((item2) => /* @__PURE__ */ jsx(ConfirmationLine, { item: item2 }, item2.line_ref)) }),
6695
+ /* @__PURE__ */ jsxs("section", { className: styles$v.card, "aria-label": "Shipping address", children: [
6696
+ /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Shipping address" }),
6697
+ /* @__PURE__ */ jsx("p", { className: styles$v.cardBody, children: formatAddress(order.ship_to) })
6698
+ ] }),
6699
+ /* @__PURE__ */ jsxs("section", { className: [styles$v.card, styles$v.summaryCard].join(" "), "aria-label": "Order summary", children: [
6700
+ /* @__PURE__ */ jsx("h2", { className: styles$v.cardTitle, children: "Order summary" }),
6701
+ /* @__PURE__ */ jsx(
6702
+ OrderSummary,
6703
+ {
6704
+ pricing: toPricing(order),
6705
+ rows: rowsFor(order),
6706
+ discount: order.totals.discount
6707
+ }
6708
+ )
6709
+ ] }),
6710
+ onDone && /* @__PURE__ */ jsx(Button, { variant: "secondary", fullWidth: true, className: styles$v.done, onClick: onDone, children: "Done" })
6711
+ ] });
6712
+ }
6713
+ function ConfirmationLine({ item: item2 }) {
6714
+ const { format } = useMoney();
6715
+ const compareAt2 = item2.compare_at_unit_price;
6716
+ const pct = compareAt2 ? discountPct(item2.unit_price, compareAt2) : void 0;
6717
+ const details2 = detailsOf(item2);
6718
+ return /* @__PURE__ */ jsxs("li", { className: styles$v.line, children: [
6719
+ /* @__PURE__ */ jsx("div", { className: styles$v.thumb, children: item2.image ? /* @__PURE__ */ jsx(ShopImage, { src: item2.image, alt: "", fill: true, sizes: "48px", className: styles$v.image }) : /* @__PURE__ */ jsx("div", { className: styles$v.placeholder, "aria-hidden": "true" }) }),
6720
+ /* @__PURE__ */ jsxs("div", { className: styles$v.lineBody, children: [
6721
+ /* @__PURE__ */ jsxs("div", { className: styles$v.lineText, children: [
6722
+ /* @__PURE__ */ jsx("span", { className: styles$v.lineTitle, children: item2.title ?? item2.sku }),
6723
+ /* @__PURE__ */ jsxs("span", { className: styles$v.lineMeta, children: [
6724
+ details2.map((detail2) => /* @__PURE__ */ jsx("span", { children: detail2 }, detail2)),
6725
+ pct !== void 0 && /* @__PURE__ */ jsx(SaleBadge, { pct })
6726
+ ] })
6727
+ ] }),
6728
+ /* @__PURE__ */ jsxs("span", { className: styles$v.linePrice, children: [
6729
+ /* @__PURE__ */ jsx("span", { className: styles$v.paid, children: format(item2.line_total) }),
6730
+ compareAt2 && /* @__PURE__ */ jsxs("span", { className: styles$v.was, children: [
6731
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `Was ${format(compareAt2)}` }),
6732
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: format(compareAt2) })
6733
+ ] })
6734
+ ] })
6735
+ ] })
6736
+ ] });
6737
+ }
6738
+ function detailsOf(item2) {
6739
+ const pairs = variantPairs(item2.attributes).map((p) => `${p.label}: ${p.value}`);
6740
+ return item2.qty > 1 ? [...pairs, `Qty: ${item2.qty}`] : pairs;
6741
+ }
6742
+ function rowsFor(order) {
6743
+ if (order.totals.tax.amount === 0) return SUMMARY_ROWS;
6744
+ return SUMMARY_ROWS.flatMap(
6745
+ (row2) => row2.key === "shipping" ? [row2, { label: "Tax", key: "tax" }] : [row2]
6746
+ );
6747
+ }
6748
+ function toPricing(order) {
6749
+ return {
6750
+ subtotal: order.totals.items,
6751
+ shipping: order.totals.shipping,
6752
+ tax: order.totals.tax,
6753
+ total: order.totals.grand_total
6754
+ };
6755
+ }
6391
6756
  function formatAddress(address) {
6392
6757
  return [address.line1, address.line2, address.postcode, address.city, address.country].filter(Boolean).join(", ");
6393
6758
  }
@@ -6427,7 +6792,7 @@ const card$1 = "_card_y686q_45";
6427
6792
  const tappable = "_tappable_y686q_60";
6428
6793
  const head$1 = "_head_y686q_69";
6429
6794
  const heading = "_heading_y686q_77";
6430
- const title$e = "_title_y686q_86";
6795
+ const title$f = "_title_y686q_86";
6431
6796
  const date = "_date_y686q_97";
6432
6797
  const bottom$1 = "_bottom_y686q_102";
6433
6798
  const strip = "_strip_y686q_110";
@@ -6444,7 +6809,7 @@ const styles$t = {
6444
6809
  tappable,
6445
6810
  head: head$1,
6446
6811
  heading,
6447
- title: title$e,
6812
+ title: title$f,
6448
6813
  date,
6449
6814
  bottom: bottom$1,
6450
6815
  strip,
@@ -6529,10 +6894,7 @@ function OrderCard({
6529
6894
  const body2 = /* @__PURE__ */ jsxs(Fragment, { children: [
6530
6895
  /* @__PURE__ */ jsxs("div", { className: styles$t.head, children: [
6531
6896
  /* @__PURE__ */ jsxs("div", { className: styles$t.heading, children: [
6532
- /* @__PURE__ */ jsxs("span", { className: styles$t.title, children: [
6533
- "Order #",
6534
- shortRef(order.order_ref)
6535
- ] }),
6897
+ /* @__PURE__ */ jsx("span", { className: styles$t.title, children: `Order #${shortRef(order.order_ref)}` }),
6536
6898
  /* @__PURE__ */ jsx("span", { className: styles$t.date, children: formatPlaced(order.placed_at, locale) })
6537
6899
  ] }),
6538
6900
  /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.status })
@@ -6570,11 +6932,7 @@ function Thumbnails({ order }) {
6570
6932
  "+",
6571
6933
  overflow
6572
6934
  ] }),
6573
- /* @__PURE__ */ jsxs("span", { className: "visually-hidden", children: [
6574
- "and ",
6575
- overflow,
6576
- " more items"
6577
- ] })
6935
+ /* @__PURE__ */ jsx("span", { className: "visually-hidden", children: `and ${overflow} more items` })
6578
6936
  ] })
6579
6937
  ] }, `${src}-${i}`);
6580
6938
  }) });
@@ -6596,7 +6954,7 @@ const saleBadge$1 = "_saleBadge_1u9l8_56";
6596
6954
  const oos$2 = "_oos_1u9l8_63";
6597
6955
  const bottom = "_bottom_1u9l8_88";
6598
6956
  const titlePrice$1 = "_titlePrice_1u9l8_1";
6599
- const title$d = "_title_1u9l8_1";
6957
+ const title$e = "_title_1u9l8_1";
6600
6958
  const swatches = "_swatches_1u9l8_119";
6601
6959
  const swatch = "_swatch_1u9l8_119";
6602
6960
  const swatchActive = "_swatchActive_1u9l8_132";
@@ -6612,7 +6970,7 @@ const styles$s = {
6612
6970
  oos: oos$2,
6613
6971
  bottom,
6614
6972
  titlePrice: titlePrice$1,
6615
- title: title$d,
6973
+ title: title$e,
6616
6974
  swatches,
6617
6975
  swatch,
6618
6976
  swatchActive,
@@ -6777,7 +7135,7 @@ function ProductGrid({
6777
7135
  }
6778
7136
  const rail = "_rail_5z5e9_2";
6779
7137
  const header$6 = "_header_5z5e9_9";
6780
- const title$c = "_title_5z5e9_16";
7138
+ const title$d = "_title_5z5e9_16";
6781
7139
  const seeAll = "_seeAll_5z5e9_22";
6782
7140
  const track$3 = "_track_5z5e9_28";
6783
7141
  const item = "_item_5z5e9_45";
@@ -6785,7 +7143,7 @@ const inset = "_inset_5z5e9_57";
6785
7143
  const styles$p = {
6786
7144
  rail,
6787
7145
  header: header$6,
6788
- title: title$c,
7146
+ title: title$d,
6789
7147
  seeAll,
6790
7148
  track: track$3,
6791
7149
  item,
@@ -6852,7 +7210,7 @@ const sheet$2 = "_sheet_s4eai_16";
6852
7210
  const grabArea = "_grabArea_s4eai_41";
6853
7211
  const grabber$1 = "_grabber_s4eai_51";
6854
7212
  const header$5 = "_header_s4eai_59";
6855
- const title$b = "_title_s4eai_67";
7213
+ const title$c = "_title_s4eai_67";
6856
7214
  const close$2 = "_close_s4eai_71";
6857
7215
  const body$3 = "_body_s4eai_84";
6858
7216
  const footer = "_footer_s4eai_90";
@@ -6863,7 +7221,7 @@ const styles$o = {
6863
7221
  grabArea,
6864
7222
  grabber: grabber$1,
6865
7223
  header: header$5,
6866
- title: title$b,
7224
+ title: title$c,
6867
7225
  close: close$2,
6868
7226
  body: body$3,
6869
7227
  footer
@@ -7043,7 +7401,7 @@ const oos$1 = "_oos_1xbbn_45";
7043
7401
  const info$1 = "_info_1xbbn_58";
7044
7402
  const head = "_head_1xbbn_66";
7045
7403
  const meta = "_meta_1xbbn_73";
7046
- const title$a = "_title_1xbbn_80";
7404
+ const title$b = "_title_1xbbn_80";
7047
7405
  const details = "_details_1xbbn_92";
7048
7406
  const detail = "_detail_1xbbn_92";
7049
7407
  const price = "_price_1xbbn_106";
@@ -7060,7 +7418,7 @@ const styles$m = {
7060
7418
  info: info$1,
7061
7419
  head,
7062
7420
  meta,
7063
- title: title$a,
7421
+ title: title$b,
7064
7422
  details,
7065
7423
  detail,
7066
7424
  price,
@@ -7170,15 +7528,15 @@ function ShippingInfo() {
7170
7528
  }
7171
7529
  )
7172
7530
  ] }),
7173
- /* @__PURE__ */ jsx("p", { className: styles$l.label, children: "30 days returns" })
7531
+ /* @__PURE__ */ jsx("p", { className: styles$l.label, children: "14 days returns" })
7174
7532
  ] })
7175
7533
  ] });
7176
7534
  }
7177
- const bar = "_bar_1aly7_1";
7178
- const floating$1 = "_floating_1aly7_16";
7179
- const divider = "_divider_1aly7_22";
7180
- const info = "_info_1aly7_26";
7181
- const actions = "_actions_1aly7_33";
7535
+ const bar = "_bar_xqpxa_1";
7536
+ const floating$1 = "_floating_xqpxa_31";
7537
+ const divider = "_divider_xqpxa_37";
7538
+ const info = "_info_xqpxa_41";
7539
+ const actions = "_actions_xqpxa_49";
7182
7540
  const styles$k = {
7183
7541
  bar,
7184
7542
  floating: floating$1,
@@ -7498,7 +7856,7 @@ const scrim$3 = "_scrim_8wz6r_6";
7498
7856
  const sheet$1 = "_sheet_8wz6r_17";
7499
7857
  const grabber = "_grabber_8wz6r_29";
7500
7858
  const header$4 = "_header_8wz6r_37";
7501
- const title$9 = "_title_8wz6r_45";
7859
+ const title$a = "_title_8wz6r_45";
7502
7860
  const close$1 = "_close_8wz6r_51";
7503
7861
  const tableWrap = "_tableWrap_8wz6r_71";
7504
7862
  const table = "_table_8wz6r_71";
@@ -7508,7 +7866,7 @@ const styles$h = {
7508
7866
  sheet: sheet$1,
7509
7867
  grabber,
7510
7868
  header: header$4,
7511
- title: title$9,
7869
+ title: title$a,
7512
7870
  close: close$1,
7513
7871
  tableWrap,
7514
7872
  table,
@@ -7573,7 +7931,7 @@ function SizeGuideSheet({ guide, onClose }) {
7573
7931
  }
7574
7932
  const root$2 = "_root_9zj90_1";
7575
7933
  const header$3 = "_header_9zj90_7";
7576
- const title$8 = "_title_9zj90_12";
7934
+ const title$9 = "_title_9zj90_12";
7577
7935
  const chips = "_chips_9zj90_20";
7578
7936
  const chip = "_chip_9zj90_20";
7579
7937
  const selected$2 = "_selected_9zj90_44";
@@ -7584,7 +7942,7 @@ const chevron$2 = "_chevron_9zj90_85";
7584
7942
  const styles$g = {
7585
7943
  root: root$2,
7586
7944
  header: header$3,
7587
- title: title$8,
7945
+ title: title$9,
7588
7946
  chips,
7589
7947
  chip,
7590
7948
  selected: selected$2,
@@ -7664,7 +8022,7 @@ function SizeSelector({
7664
8022
  }
7665
8023
  const root$1 = "_root_1j4n8_1";
7666
8024
  const header$2 = "_header_1j4n8_7";
7667
- const title$7 = "_title_1j4n8_14";
8025
+ const title$8 = "_title_1j4n8_14";
7668
8026
  const value = "_value_1j4n8_19";
7669
8027
  const tiles = "_tiles_1j4n8_24";
7670
8028
  const tile = "_tile_1j4n8_24";
@@ -7677,7 +8035,7 @@ const stockBadge = "_stockBadge_1j4n8_91";
7677
8035
  const styles$f = {
7678
8036
  root: root$1,
7679
8037
  header: header$2,
7680
- title: title$7,
8038
+ title: title$8,
7681
8039
  value,
7682
8040
  tiles,
7683
8041
  tile,
@@ -7713,10 +8071,7 @@ function ColorSelector({ colours, selected: selected2, onSelect }) {
7713
8071
  c.image ? /* @__PURE__ */ jsx(ShopImage, { src: c.image, alt: "", fill: true, sizes: "79px", className: styles$f.image }) : /* @__PURE__ */ jsx("span", { className: styles$f.placeholder, "aria-hidden": "true" }),
7714
8072
  soldOut && /* @__PURE__ */ jsx("span", { className: styles$f.scrim, "aria-hidden": "true", children: "Out of stock" })
7715
8073
  ] }),
7716
- lowStock && /* @__PURE__ */ jsxs("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: [
7717
- c.remaining,
7718
- " left"
7719
- ] })
8074
+ lowStock && /* @__PURE__ */ jsx("span", { className: styles$f.stockBadge, "aria-hidden": "true", children: `${c.remaining} left` })
7720
8075
  ]
7721
8076
  },
7722
8077
  c.value
@@ -7782,7 +8137,7 @@ function VariantSelector({
7782
8137
  }
7783
8138
  const root = "_root_t4qba_2";
7784
8139
  const group = "_group_t4qba_8";
7785
- const title$6 = "_title_t4qba_14";
8140
+ const title$7 = "_title_t4qba_14";
7786
8141
  const body$1 = "_body_t4qba_22";
7787
8142
  const paragraph = "_paragraph_t4qba_26";
7788
8143
  const clamped = "_clamped_t4qba_46";
@@ -7790,7 +8145,7 @@ const toggle = "_toggle_t4qba_51";
7790
8145
  const styles$d = {
7791
8146
  root,
7792
8147
  group,
7793
- title: title$6,
8148
+ title: title$7,
7794
8149
  body: body$1,
7795
8150
  paragraph,
7796
8151
  clamped,
@@ -7880,7 +8235,7 @@ const content = "_content_1hv16_14";
7880
8235
  const intro = "_intro_1hv16_21";
7881
8236
  const productInfo = "_productInfo_1hv16_28";
7882
8237
  const titlePrice = "_titlePrice_1hv16_34";
7883
- const title$5 = "_title_1hv16_34";
8238
+ const title$6 = "_title_1hv16_34";
7884
8239
  const availability = "_availability_1hv16_55";
7885
8240
  const low = "_low_1hv16_62";
7886
8241
  const oos = "_oos_1hv16_66";
@@ -7890,7 +8245,7 @@ const styles$a = {
7890
8245
  intro,
7891
8246
  productInfo,
7892
8247
  titlePrice,
7893
- title: title$5,
8248
+ title: title$6,
7894
8249
  availability,
7895
8250
  low,
7896
8251
  oos
@@ -7926,6 +8281,7 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
7926
8281
  const [busy, setBusy] = useState(null);
7927
8282
  const [sizeError, setSizeError] = useState(false);
7928
8283
  const [reminded, setReminded] = useState([]);
8284
+ const [added, setAdded] = useState([]);
7929
8285
  const sizeRef = useRef(null);
7930
8286
  const colourRef = useRef(null);
7931
8287
  const selectedSku = structured ? resolveSku(variants, selectedSize, selectedColour) : hasVariants ? genericSku : product.sku;
@@ -7950,15 +8306,15 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
7950
8306
  if (!selectedSku) return false;
7951
8307
  try {
7952
8308
  const cart2 = await api.cart.addItem({ sku: selectedSku, qty: 1 });
7953
- const added = variants.find((v) => v.sku === selectedSku);
8309
+ const added2 = variants.find((v) => v.sku === selectedSku);
7954
8310
  emit({
7955
8311
  type: "add_to_cart",
7956
8312
  sku: selectedSku,
7957
8313
  qty: 1,
7958
8314
  title: product.title,
7959
- size: added?.attributes.size ?? selectedSize ?? void 0,
7960
- attributes: added?.attributes,
7961
- image: added?.image ?? product.media[0]
8315
+ size: added2?.attributes.size ?? selectedSize ?? void 0,
8316
+ attributes: added2?.attributes,
8317
+ image: added2?.image ?? product.media[0]
7962
8318
  });
7963
8319
  emit({
7964
8320
  type: "cart_updated",
@@ -8015,24 +8371,61 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
8015
8371
  }
8016
8372
  async function handleAdd() {
8017
8373
  if (!ensureSelection()) return;
8374
+ const sku = selectedSku;
8375
+ if (!sku) return;
8018
8376
  setBusy("add");
8019
8377
  const ok = await add();
8020
8378
  setBusy(null);
8021
8379
  if (!ok) return;
8022
- const added = variants.find((v) => v.sku === selectedSku);
8023
- const size = added?.attributes.size ?? selectedSize;
8380
+ const variant = variants.find((v) => v.sku === sku);
8381
+ const size = variant?.attributes.size ?? selectedSize;
8382
+ setAdded((current2) => current2.includes(sku) ? current2 : [...current2, sku]);
8024
8383
  toast2.show("Added to cart", {
8025
8384
  description: [product.title, size && `Size ${size}`].filter(Boolean).join(" · "),
8026
- image: added?.image ?? product.media[0],
8385
+ image: variant?.image ?? product.media[0],
8027
8386
  // Falls back to the /cart route where the sheet provider isn't mounted.
8028
- action: cartSheet || navigate ? { label: "View cart", onAction: openCart } : void 0
8387
+ action: cartSheet || navigate ? { label: "View cart", onAction: openCart } : void 0,
8388
+ // Points the caret at the cart icon this just landed in.
8389
+ anchor: "cart"
8029
8390
  });
8030
8391
  }
8392
+ const inCart = selectedSku !== null && added.includes(selectedSku);
8031
8393
  const selectedVariant = hasVariants ? variants.find((v) => v.sku === selectedSku) : void 0;
8032
8394
  const available = selectedVariant?.available ?? inventory2?.available ?? 0;
8033
8395
  const lowStock = available > 0 && available <= 5;
8034
8396
  const stockNotice = !purchasable || lowStock;
8035
8397
  const availabilityLabel = !purchasable ? "Out of stock" : lowStock ? `Only ${available} left` : "";
8398
+ const cta2 = purchasable ? (
8399
+ /*
8400
+ * Three labels, one button (5241:71382 / 5295:75115 / 5268:72907). "Adding to cart"
8401
+ * is the wait, and "Go to cart" is what the button becomes once the thing is in
8402
+ * there — it stays that way after the toast has gone, so the confirmation is not the
8403
+ * only trace of what happened.
8404
+ *
8405
+ * The added state changes what the button DOES, not just what it says. A second
8406
+ * press would otherwise add a second one, which is not what a fan reading "Go to
8407
+ * cart" is agreeing to.
8408
+ */
8409
+ /* @__PURE__ */ jsx(
8410
+ Button,
8411
+ {
8412
+ variant: "primary",
8413
+ onClick: inCart ? openCart : handleAdd,
8414
+ loading: busy === "add",
8415
+ disabled: busy !== null,
8416
+ children: busy === "add" ? "Adding to cart" : inCart ? "Go to cart" : "Add to cart"
8417
+ }
8418
+ )
8419
+ ) : /* @__PURE__ */ jsx(
8420
+ Button,
8421
+ {
8422
+ variant: "primary",
8423
+ onClick: handleRemind,
8424
+ loading: busy === "remind",
8425
+ disabled: alerted || busy !== null,
8426
+ children: alerted ? "We'll remind you" : "Remind me when available"
8427
+ }
8428
+ );
8036
8429
  return /* @__PURE__ */ jsxs(ShopSurface, { tone: "light", fill: true, className: styles$a.page, children: [
8037
8430
  /* @__PURE__ */ jsx(MediaGallery, { media: media2, alt: product.title }),
8038
8431
  /* @__PURE__ */ jsxs("div", { className: styles$a.content, children: [
@@ -8063,7 +8456,14 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
8063
8456
  children: availabilityLabel
8064
8457
  }
8065
8458
  ),
8066
- product.description && /* @__PURE__ */ jsx(ProductDetails, { description: product.description }),
8459
+ hasColours && /* @__PURE__ */ jsx("div", { ref: colourRef, children: /* @__PURE__ */ jsx(
8460
+ ColorSelector,
8461
+ {
8462
+ colours,
8463
+ selected: selectedColour,
8464
+ onSelect: setSelectedColour
8465
+ }
8466
+ ) }),
8067
8467
  hasSizes && /* @__PURE__ */ jsx("div", { ref: sizeRef, children: /* @__PURE__ */ jsx(
8068
8468
  SizeSelector,
8069
8469
  {
@@ -8074,59 +8474,34 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
8074
8474
  guide: product.size_guide
8075
8475
  }
8076
8476
  ) }),
8077
- hasColours && /* @__PURE__ */ jsx("div", { ref: colourRef, children: /* @__PURE__ */ jsx(
8078
- ColorSelector,
8079
- {
8080
- colours,
8081
- selected: selectedColour,
8082
- onSelect: setSelectedColour
8083
- }
8084
- ) }),
8085
8477
  hasVariants && !structured && /* @__PURE__ */ jsx(VariantSelector, { variants, selectedSku: genericSku, onSelect: setGenericSku }),
8086
8478
  /* @__PURE__ */ jsx(ShippingInfo, {}),
8479
+ product.description && /* @__PURE__ */ jsx(ProductDetails, { description: product.description }),
8087
8480
  /* @__PURE__ */ jsx(
8088
8481
  RailCarousel,
8089
8482
  {
8090
- title: "You may like it",
8483
+ title: "You may also like",
8091
8484
  products: recommendations.filter((p) => p.sku !== product.sku),
8092
8485
  inset: true
8093
8486
  }
8094
8487
  )
8095
8488
  ] }),
8096
- /* @__PURE__ */ jsx(StickyCtaBar, { children: purchasable ? /* @__PURE__ */ jsx(
8097
- Button,
8098
- {
8099
- variant: "primary",
8100
- onClick: handleAdd,
8101
- loading: busy === "add",
8102
- disabled: busy !== null,
8103
- children: "Add to cart"
8104
- }
8105
- ) : /* @__PURE__ */ jsx(
8106
- Button,
8107
- {
8108
- variant: "primary",
8109
- onClick: handleRemind,
8110
- loading: busy === "remind",
8111
- disabled: alerted || busy !== null,
8112
- children: alerted ? "We'll remind you" : "Remind me when available"
8113
- }
8114
- ) })
8489
+ /* @__PURE__ */ jsx(StickyCtaBar, { children: cta2 })
8115
8490
  ] });
8116
8491
  }
8117
- const hero$1 = "_hero_2mcnp_10";
8118
- const image$2 = "_image_2mcnp_37";
8119
- const scrim$1 = "_scrim_2mcnp_51";
8120
- const text$2 = "_text_2mcnp_57";
8121
- const title$4 = "_title_2mcnp_72";
8122
- const subtitle$2 = "_subtitle_2mcnp_81";
8123
- const noImage = "_noImage_2mcnp_94";
8492
+ const hero$1 = "_hero_pi6qp_10";
8493
+ const image$2 = "_image_pi6qp_37";
8494
+ const scrim$1 = "_scrim_pi6qp_51";
8495
+ const text$2 = "_text_pi6qp_57";
8496
+ const title$5 = "_title_pi6qp_79";
8497
+ const subtitle$2 = "_subtitle_pi6qp_90";
8498
+ const noImage = "_noImage_pi6qp_105";
8124
8499
  const styles$9 = {
8125
8500
  hero: hero$1,
8126
8501
  image: image$2,
8127
8502
  scrim: scrim$1,
8128
8503
  text: text$2,
8129
- title: title$4,
8504
+ title: title$5,
8130
8505
  subtitle: subtitle$2,
8131
8506
  noImage
8132
8507
  };
@@ -8257,12 +8632,12 @@ function ReviewCarousel({ quotes, disclaimer: disclaimer2 }) {
8257
8632
  }
8258
8633
  const section$1 = "_section_145t0_1";
8259
8634
  const row$2 = "_row_145t0_9";
8260
- const title$3 = "_title_145t0_21";
8635
+ const title$4 = "_title_145t0_21";
8261
8636
  const body = "_body_145t0_29";
8262
8637
  const styles$5 = {
8263
8638
  section: section$1,
8264
8639
  row: row$2,
8265
- title: title$3,
8640
+ title: title$4,
8266
8641
  body
8267
8642
  };
8268
8643
  function WhyUs({ items: items2 }) {
@@ -8272,12 +8647,12 @@ function WhyUs({ items: items2 }) {
8272
8647
  ] }, i)) });
8273
8648
  }
8274
8649
  const section = "_section_opjfc_1";
8275
- const title$2 = "_title_opjfc_8";
8650
+ const title$3 = "_title_opjfc_8";
8276
8651
  const list$1 = "_list_opjfc_15";
8277
8652
  const row$1 = "_row_opjfc_26";
8278
8653
  const styles$4 = {
8279
8654
  section,
8280
- title: title$2,
8655
+ title: title$3,
8281
8656
  list: list$1,
8282
8657
  row: row$1
8283
8658
  };
@@ -8419,24 +8794,24 @@ function ProductView({
8419
8794
  }
8420
8795
  return unavailable;
8421
8796
  }
8422
- const showcase = "_showcase_ems17_30";
8423
- const panel = "_panel_ems17_49";
8424
- const image = "_image_ems17_59";
8425
- const heroImageBox = "_heroImageBox_ems17_79";
8426
- const hero = "_hero_ems17_79";
8427
- const heroContent = "_heroContent_ems17_84";
8428
- const heroText = "_heroText_ems17_95";
8429
- const logo = "_logo_ems17_103";
8430
- const heroTitle = "_heroTitle_ems17_107";
8431
- const heroSub = "_heroSub_ems17_115";
8432
- const swipe = "_swipe_ems17_122";
8433
- const swipeLabel = "_swipeLabel_ems17_131";
8434
- const chevron$1 = "_chevron_ems17_137";
8435
- const overlay$1 = "_overlay_ems17_154";
8436
- const copy = "_copy_ems17_165";
8437
- const title$1 = "_title_ems17_170";
8438
- const subtitle$1 = "_subtitle_ems17_177";
8439
- const cta = "_cta_ems17_183";
8797
+ const showcase = "_showcase_1sarz_31";
8798
+ const panel = "_panel_1sarz_50";
8799
+ const image = "_image_1sarz_60";
8800
+ const heroImageBox = "_heroImageBox_1sarz_108";
8801
+ const hero = "_hero_1sarz_108";
8802
+ const heroContent = "_heroContent_1sarz_179";
8803
+ const heroText = "_heroText_1sarz_196";
8804
+ const logo = "_logo_1sarz_205";
8805
+ const heroTitle = "_heroTitle_1sarz_225";
8806
+ const heroSub = "_heroSub_1sarz_249";
8807
+ const swipe = "_swipe_1sarz_262";
8808
+ const swipeLabel = "_swipeLabel_1sarz_270";
8809
+ const chevron$1 = "_chevron_1sarz_276";
8810
+ const overlay$1 = "_overlay_1sarz_293";
8811
+ const copy = "_copy_1sarz_304";
8812
+ const title$2 = "_title_1sarz_309";
8813
+ const subtitle$1 = "_subtitle_1sarz_316";
8814
+ const cta = "_cta_1sarz_322";
8440
8815
  const styles$2 = {
8441
8816
  showcase,
8442
8817
  panel,
@@ -8453,7 +8828,7 @@ const styles$2 = {
8453
8828
  chevron: chevron$1,
8454
8829
  overlay: overlay$1,
8455
8830
  copy,
8456
- title: title$1,
8831
+ title: title$2,
8457
8832
  subtitle: subtitle$1,
8458
8833
  cta
8459
8834
  };
@@ -8610,9 +8985,19 @@ function HomeShowcase() {
8610
8985
  function CartTrigger({ className, children, ...rest }) {
8611
8986
  const sheet2 = useCartSheet();
8612
8987
  if (!sheet2) {
8613
- return /* @__PURE__ */ jsx(ShopLink, { to: "/cart", className, ...rest, children });
8988
+ return /* @__PURE__ */ jsx(ShopLink, { to: "/cart", className, "data-shop-cart-trigger": "", ...rest, children });
8614
8989
  }
8615
- return /* @__PURE__ */ jsx("button", { type: "button", className, onClick: sheet2.open, ...rest, children });
8990
+ return /* @__PURE__ */ jsx(
8991
+ "button",
8992
+ {
8993
+ type: "button",
8994
+ className,
8995
+ "data-shop-cart-trigger": "",
8996
+ onClick: sheet2.open,
8997
+ ...rest,
8998
+ children
8999
+ }
9000
+ );
8616
9001
  }
8617
9002
  function IdentityGate({ returnTo }) {
8618
9003
  const emit = useShopEvent();
@@ -8650,21 +9035,29 @@ function useCartCount() {
8650
9035
  }, [subscribe]);
8651
9036
  return count2;
8652
9037
  }
8653
- const header$1 = "_header_7rinq_6";
8654
- const floating = "_floating_7rinq_26";
8655
- const right = "_right_7rinq_35";
8656
- const spacer = "_spacer_7rinq_48";
8657
- const iconBtn = "_iconBtn_7rinq_53";
8658
- const menuBtn = "_menuBtn_7rinq_80";
8659
- const badge = "_badge_7rinq_104";
9038
+ const header$1 = "_header_1hcuj_25";
9039
+ const floating = "_floating_1hcuj_65";
9040
+ const scrolled = "_scrolled_1hcuj_72";
9041
+ const title$1 = "_title_1hcuj_121";
9042
+ const right = "_right_1hcuj_134";
9043
+ const spacer = "_spacer_1hcuj_147";
9044
+ const iconBtn = "_iconBtn_1hcuj_152";
9045
+ const menuBtn = "_menuBtn_1hcuj_179";
9046
+ const badge = "_badge_1hcuj_207";
9047
+ const closeSlot = "_closeSlot_1hcuj_234";
9048
+ const centred = "_centred_1hcuj_249";
8660
9049
  const styles$1 = {
8661
9050
  header: header$1,
8662
9051
  floating,
9052
+ scrolled,
9053
+ title: title$1,
8663
9054
  right,
8664
9055
  spacer,
8665
9056
  iconBtn,
8666
9057
  menuBtn,
8667
- badge
9058
+ badge,
9059
+ closeSlot,
9060
+ centred
8668
9061
  };
8669
9062
  function ChevronLeft() {
8670
9063
  return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(6.48 2.988)", children: /* @__PURE__ */ jsx(
@@ -8700,20 +9093,79 @@ function MenuIcon() {
8700
9093
  }
8701
9094
  ) }) });
8702
9095
  }
8703
- function ShopHeader({
9096
+ function useScrolledUnder(enabled) {
9097
+ const [scrolled2, setScrolled] = useState(false);
9098
+ useEffect(() => {
9099
+ if (!enabled) return;
9100
+ const read = (event) => {
9101
+ const target = event?.target;
9102
+ const top = target && target !== document && target instanceof HTMLElement ? target.scrollTop : window.scrollY || document.documentElement.scrollTop;
9103
+ setScrolled(top > 0);
9104
+ };
9105
+ read();
9106
+ document.addEventListener("scroll", read, { capture: true, passive: true });
9107
+ return () => document.removeEventListener("scroll", read, { capture: true });
9108
+ }, [enabled]);
9109
+ return enabled ? scrolled2 : false;
9110
+ }
9111
+ function CloseMedium() {
9112
+ return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(5.03 5.03)", children: /* @__PURE__ */ jsx(
9113
+ "path",
9114
+ {
9115
+ d: "M12.233 0.292847C12.6235 -0.0975851 13.2566 -0.0976464 13.6471 0.292847C14.0375 0.683347 14.0375 1.3164 13.6471 1.70691L8.38437 6.9696L13.6471 12.2323C14.0376 12.6228 14.0376 13.2558 13.6471 13.6464C13.2565 14.0369 12.6235 14.0369 12.233 13.6464L6.96933 8.38367L1.70761 13.6464C1.31711 14.0369 0.684078 14.0368 0.293548 13.6464C-0.0969764 13.2558 -0.0969764 12.6228 0.293548 12.2323L5.55527 6.9696L0.292571 1.70691C-0.0976189 1.31653 -0.0974286 0.683349 0.292571 0.292847C0.683065 -0.0976464 1.31708 -0.0975851 1.70761 0.292847L6.97031 5.55554L12.233 0.292847Z",
9116
+ fill: "currentColor"
9117
+ }
9118
+ ) }) });
9119
+ }
9120
+ function ShopHeader(props) {
9121
+ return props.context === "checkout" ? /* @__PURE__ */ jsx(CheckoutBar, { ...props }) : /* @__PURE__ */ jsx(ShopBar, { ...props });
9122
+ }
9123
+ function CheckoutBar({
9124
+ title: title2,
9125
+ onClose,
9126
+ closeLabel = "Close",
9127
+ className
9128
+ }) {
9129
+ const classes = [styles$1.header, className ?? ""].filter(Boolean).join(" ");
9130
+ return /* @__PURE__ */ jsxs("header", { className: classes, children: [
9131
+ /* @__PURE__ */ jsx("span", { className: styles$1.closeSlot, "aria-hidden": "true" }),
9132
+ title2 ? /* @__PURE__ */ jsx("span", { className: [styles$1.title, styles$1.centred].join(" "), children: title2 }) : null,
9133
+ onClose ? /* @__PURE__ */ jsx(
9134
+ "button",
9135
+ {
9136
+ type: "button",
9137
+ className: [styles$1.iconBtn, styles$1.closeSlot].join(" "),
9138
+ "aria-label": closeLabel,
9139
+ onClick: onClose,
9140
+ children: /* @__PURE__ */ jsx(CloseMedium, {})
9141
+ }
9142
+ ) : /* @__PURE__ */ jsx("span", { className: styles$1.closeSlot, "aria-hidden": "true" })
9143
+ ] });
9144
+ }
9145
+ function ShopBar({
8704
9146
  onBack,
8705
9147
  onMenu,
9148
+ title: title2,
8706
9149
  showCart = true,
8707
9150
  floating: floating2 = false,
9151
+ scrolled: scrolled2,
8708
9152
  backLabel = "Back",
8709
9153
  menuLabel = "More options",
8710
9154
  className
8711
9155
  }) {
8712
9156
  const cartCount = useCartCount();
9157
+ const atTop = useScrolledUnder(floating2 && scrolled2 === void 0);
9158
+ const isScrolled = scrolled2 ?? atTop;
8713
9159
  const cartLabel = cartCount === null ? "Cart" : cartCount === 0 ? "Cart, empty" : `Cart, ${cartCount} item${cartCount === 1 ? "" : "s"}`;
8714
- const classes = [styles$1.header, floating2 ? styles$1.floating : "", className ?? ""].filter(Boolean).join(" ");
9160
+ const classes = [
9161
+ styles$1.header,
9162
+ floating2 ? styles$1.floating : "",
9163
+ floating2 && isScrolled ? styles$1.scrolled : "",
9164
+ className ?? ""
9165
+ ].filter(Boolean).join(" ");
8715
9166
  return /* @__PURE__ */ jsxs("header", { className: classes, children: [
8716
9167
  onBack ? /* @__PURE__ */ jsx("button", { type: "button", className: styles$1.iconBtn, "aria-label": backLabel, onClick: onBack, children: /* @__PURE__ */ jsx(ChevronLeft, {}) }) : /* @__PURE__ */ jsx("span", { className: styles$1.spacer, "aria-hidden": "true" }),
9168
+ title2 ? /* @__PURE__ */ jsx("span", { className: styles$1.title, children: title2 }) : null,
8717
9169
  /* @__PURE__ */ jsxs("div", { className: styles$1.right, children: [
8718
9170
  showCart ? /* @__PURE__ */ jsxs(CartTrigger, { className: styles$1.iconBtn, "aria-label": cartLabel, children: [
8719
9171
  /* @__PURE__ */ jsx(CartIcon, {}),
@@ -8732,18 +9184,18 @@ function ShopHeader({
8732
9184
  ] })
8733
9185
  ] });
8734
9186
  }
8735
- const overlay = "_overlay_lm5qk_5";
8736
- const scrim = "_scrim_lm5qk_17";
8737
- const sheet = "_sheet_lm5qk_23";
8738
- const header = "_header_lm5qk_56";
8739
- const close = "_close_lm5qk_62";
8740
- const list = "_list_lm5qk_81";
8741
- const row = "_row_lm5qk_89";
8742
- const icon = "_icon_lm5qk_119";
8743
- const text = "_text_lm5qk_127";
8744
- const title = "_title_lm5qk_135";
8745
- const subtitle = "_subtitle_lm5qk_142";
8746
- const chevron = "_chevron_lm5qk_148";
9187
+ const overlay = "_overlay_1i5ok_5";
9188
+ const scrim = "_scrim_1i5ok_21";
9189
+ const sheet = "_sheet_1i5ok_31";
9190
+ const header = "_header_1i5ok_73";
9191
+ const close = "_close_1i5ok_79";
9192
+ const list = "_list_1i5ok_98";
9193
+ const row = "_row_1i5ok_113";
9194
+ const icon = "_icon_1i5ok_142";
9195
+ const text = "_text_1i5ok_150";
9196
+ const title = "_title_1i5ok_158";
9197
+ const subtitle = "_subtitle_1i5ok_165";
9198
+ const chevron = "_chevron_1i5ok_171";
8747
9199
  const styles = {
8748
9200
  overlay,
8749
9201
  scrim,
@@ -8792,17 +9244,6 @@ function OrderIcon() {
8792
9244
  ) })
8793
9245
  ] });
8794
9246
  }
8795
- function GiftIcon() {
8796
- return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("g", { transform: "translate(1.94 2.995)", children: /* @__PURE__ */ jsx(
8797
- "path",
8798
- {
8799
- fillRule: "evenodd",
8800
- clipRule: "evenodd",
8801
- d: "M13.751 0.00124025C14.5259 0.00509296 15.2681 0.313462 15.8164 0.861592C16.368 1.41322 16.6786 2.16162 16.6787 2.94167C16.6787 3.33886 16.5962 3.72712 16.4443 4.0862L18.21 4.08425C19.2573 4.08425 20.1182 4.92951 20.1182 5.98464V7.98464C20.118 8.77361 19.6366 9.44353 18.9561 9.73171V15.011C18.9561 15.8024 18.6451 16.5636 18.0889 17.1272C17.6018 17.6207 16.9612 17.9275 16.2773 17.9964L15.9814 18.011L4.14355 18.0051C3.35071 18.005 2.59271 17.6863 2.03613 17.1223C1.47995 16.5588 1.16992 15.7965 1.16992 15.0051V9.76198C0.48514 9.4754 0.000197787 8.80207 0 8.01003V6.01003C3.22233e-05 4.95527 0.859419 4.11117 1.90625 4.11062L3.68457 4.10671C3.52717 3.74203 3.44242 3.34633 3.44238 2.94167C3.4425 2.16158 3.7531 1.41323 4.30469 0.861592C4.85271 0.313663 5.59461 0.00439982 6.36914 0.000263685C6.37301 0.000209284 6.377 0.00129387 6.38086 0.00124025C6.38214 0.00120826 6.38348 0.00124029 6.38477 0.00124025C7.48869 -0.0127605 8.48921 0.527887 9.26953 1.39479C9.56436 1.7224 9.82868 2.09657 10.0605 2.50612C10.2924 2.09651 10.5567 1.72244 10.8516 1.39479C11.6319 0.527865 12.6324 -0.0136996 13.7363 0.000263685L13.7393 0.00124025C13.7435 0.0012842 13.7477 0.000190595 13.752 0.000263685L13.751 0.00124025ZM3.16992 9.90749V15.0051C3.16992 15.2745 3.2759 15.5305 3.45996 15.7171C3.64354 15.9031 3.88967 16.005 4.14355 16.0051L15.9814 16.01C16.2355 16.01 16.4823 15.909 16.666 15.7229C16.8271 15.5597 16.9284 15.3435 16.9512 15.1116L16.9561 15.011V9.88601L3.16992 9.90749ZM1.9082 5.91042C1.84343 5.91045 1.80082 5.96063 1.80078 6.01003V8.01003C1.80105 8.05904 1.84222 8.10813 1.90625 8.10866L18.21 8.08425C18.2746 8.08425 18.3181 8.03392 18.3184 7.98464V5.98464C18.3184 5.9352 18.2758 5.88503 18.2109 5.88503L1.9082 5.91042ZM6.38477 1.80007C6.0819 1.8001 5.79131 1.92087 5.57715 2.13503C5.36332 2.34907 5.24329 2.63912 5.24316 2.94167C5.24323 3.24435 5.3632 3.53519 5.57715 3.74929C5.79129 3.96335 6.08197 4.08422 6.38477 4.08425C6.44761 4.08425 6.50914 4.08955 6.56836 4.10183L8.83203 4.09792C8.58292 3.48766 8.27452 2.97992 7.93164 2.5989C7.4044 2.01319 6.86607 1.79198 6.40039 1.80007C6.39524 1.80016 6.38992 1.80007 6.38477 1.80007ZM13.7207 1.80007C13.255 1.79196 12.7167 2.0131 12.1895 2.5989C11.847 2.9794 11.538 3.48583 11.2891 4.09499L13.6289 4.09108C13.6641 4.08689 13.7 4.08425 13.7363 4.08425C14.0392 4.08423 14.3298 3.9634 14.5439 3.74929C14.758 3.53518 14.8788 3.2444 14.8789 2.94167C14.8788 2.63911 14.7578 2.34907 14.5439 2.13503C14.3298 1.92086 14.0392 1.80009 13.7363 1.80007C13.7312 1.80007 13.7259 1.80016 13.7207 1.80007Z",
8802
- fill: "currentColor"
8803
- }
8804
- ) }) });
8805
- }
8806
9247
  function HelpIcon() {
8807
9248
  return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("g", { transform: "translate(1.93 1.93)", children: [
8808
9249
  /* @__PURE__ */ jsx(
@@ -8846,7 +9287,6 @@ function ShopMenuSheet({
8846
9287
  open,
8847
9288
  onClose,
8848
9289
  onManageOrders,
8849
- onRedeemCode,
8850
9290
  onHelp,
8851
9291
  closeLabel = "Close",
8852
9292
  label: label2 = "Shop menu"
@@ -8862,13 +9302,6 @@ function ShopMenuSheet({
8862
9302
  subtitle: "View your order history and track shipments",
8863
9303
  ...onManageOrders ? { onSelect: onManageOrders } : {}
8864
9304
  },
8865
- {
8866
- key: "redeem",
8867
- icon: /* @__PURE__ */ jsx(GiftIcon, {}),
8868
- title: "Redeem a code",
8869
- subtitle: "Got a code for DAZN shop? Claim it here",
8870
- ...onRedeemCode ? { onSelect: onRedeemCode } : {}
8871
- },
8872
9305
  {
8873
9306
  key: "help",
8874
9307
  icon: /* @__PURE__ */ jsx(HelpIcon, {}),
@@ -8934,6 +9367,7 @@ export {
8934
9367
  LifestyleImage,
8935
9368
  LifestyleText,
8936
9369
  MediaGallery,
9370
+ OrderConfirmationView,
8937
9371
  OrderListView,
8938
9372
  OrderStatusBadge,
8939
9373
  OrderSummary,