efficient-storefront-blocks 0.125.7 → 0.125.9

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/chunks/{CustomHtmlCodeWindow-KAHNIUZO.js → CustomHtmlCodeWindow-ZSVS5DI6.js} +1 -1
  3. package/dist/chunks/{EditorPreviewCheckout-M5LLO3H2.js → EditorPreviewCheckout-NDZUORUC.js} +1 -1
  4. package/dist/chunks/SiteEditorProvider-CIZSA67M.js +1 -0
  5. package/dist/chunks/{chunk-UREPZPIT.js → chunk-3LWDFU5Y.js} +1 -1
  6. package/dist/chunks/{chunk-FD3ICZTF.js → chunk-HOKKFWPX.js} +1 -1
  7. package/dist/chunks/{chunk-L6MXM22Q.js → chunk-ICWPUDN3.js} +1 -1
  8. package/dist/chunks/{chunk-SQ6D33WV.js → chunk-R3WKYZOZ.js} +1 -1
  9. package/dist/chunks/{chunk-7ARO3R4C.js → chunk-RCOLM57Z.js} +1 -1
  10. package/dist/chunks/chunk-SPLS5ZLA.js +337 -0
  11. package/dist/chunks/{chunk-COR5IL6E.js → chunk-Y7DFVCVM.js} +1 -1
  12. package/dist/chunks/{chunk-4SIPG47B.js → chunk-YU4MIT6K.js} +1 -1
  13. package/dist/chunks/{fitment-data-BQFU5HN3.js → fitment-data-ANJWNG4T.js} +1 -1
  14. package/dist/chunks/{section-css-style-VF2FOE3B.js → section-css-style-7ROA6NKG.js} +1 -1
  15. package/dist/index.js +26 -26
  16. package/dist/render/built-with.json +1 -1
  17. package/dist/render/components/BoxHeaderBar.js +1 -1
  18. package/dist/routine-index.json +1 -1
  19. package/dist/value-index.json +1 -1
  20. package/package.json +2 -2
  21. package/dist/chunks/SiteEditorProvider-6P7LYLL2.js +0 -1
  22. package/dist/chunks/chunk-7SLHEYYR.js +0 -337
  23. /package/dist/chunks/{chunk-ECMYL3O7.js → chunk-3DDOV7FZ.js} +0 -0
  24. /package/dist/chunks/{chunk-UREPZPIT.js.LEGAL.txt → chunk-3LWDFU5Y.js.LEGAL.txt} +0 -0
  25. /package/dist/chunks/{chunk-SB3V6PTJ.js → chunk-RJM55KDO.js} +0 -0
  26. /package/dist/chunks/{chunk-7SLHEYYR.js.LEGAL.txt → chunk-SPLS5ZLA.js.LEGAL.txt} +0 -0
  27. /package/dist/chunks/{chunk-VYXOE5FY.js → chunk-SRHU2S3G.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.125.9 — 2026-11-24 — The header logo takes the custom top ink
4
+
5
+ **For hosts:** no peer change. The storefront re-vendors `src/` with
6
+ `node scripts/sync-storefront-blocks.mjs`, then runs `just check`.
7
+
8
+ - **The header logo draws in the custom top ink**: while the Box header is
9
+ see-through and its "Text color at the top" is Custom, a logo whose own
10
+ colour is Auto contrast draws in that ink, like the links and words. A
11
+ logo's own Custom colour still wins; the solid bar and an unset ink keep
12
+ today's logo.
13
+
14
+ ## 0.125.8 — 2026-11-24 — Take efficient-web-builder 74.10
15
+
16
+ **For hosts:** the `efficient-web-builder` peer is now `^74.10.0`. A host moves
17
+ its own builder pin to 74.10.0 or later first. The storefront then re-vendors
18
+ `src/` with `node scripts/sync-storefront-blocks.mjs` and runs `just check`.
19
+
20
+ - **Look change: the "®" mark draws in its words' colour, on their line, at
21
+ their size** (efficient-web-builder #849). Before, it was a gold, raised
22
+ `<sup>`. Every blocks section that draws a ® (product hero, spec table,
23
+ listings, filter bar, galleries) changes with it.
24
+ - **The Hero panel has Words space rows** (top and bottom, Desktop and Tablet;
25
+ efficient-web-builder #850). Unset draws what it drew.
26
+ - The Hero poster asks for its real frame on a phone, capped at 1280 device px
27
+ (efficient-web-builder #851). No blocks byte moves for it.
28
+
3
29
  ## 0.125.7 — 2026-11-24 — The Box header takes a custom top text colour and a link opacity
4
30
 
5
31
  **For hosts:** no step. The storefront re-vendors `src/` with
@@ -1,4 +1,4 @@
1
- "use client";import{b as ee,d as te,e as se}from"./chunk-UREPZPIT.js";import{Ae as re,Bh as ie,Ok as ce,Pb as oe,Rk as de,Xk as me,de as ne,fe as I,g as i,he as ae,rl as ue,sl as fe,tl as he,xl as pe}from"./chunk-7ARO3R4C.js";import{d as Z}from"./chunk-COR5IL6E.js";import{Kf as J,Sg as B,bg as Y,la as X,li as le,xb as K}from"./chunk-SQ6D33WV.js";import"./chunk-SB3V6PTJ.js";import"./chunk-ECMYL3O7.js";import"./chunk-Y6SLVHK3.js";import{jsx as n,jsxs as w,Fragment as Ue}from"react/jsx-runtime";import{Suspense as We,useContext as Ve,useEffect as Te,useMemo as _,useRef as Ne,useState as S}from"react";import{AccordionHeading as H,Banner as qe,Button as D,Card as Qe,Dialog as Xe,DropdownMenu as Ke,Segmented as Je,Text as b,buttonClasses as Ye,colorFill as Ze,colorSwatchClasses as et,fitFrameStyle as tt,fitScale as st}from"efficient-shell/ui";import{CodeEditor as ot}from"efficient-shell/code";import{ChevronDownIcon as nt}from"efficient-shell/icons/efficient";import{AlignSeparateIcon as at}from"efficient-easel/icons";import{ScreenDocumentContext as rt}from"efficient-easel/screen/components/ScreenDocumentContext";var ye=".my-part";function ve(e,t,o,s){let a=De(e,t);if(a)return Pe(e,t,o,s,a);let r=je(e,t);return r?Be(e,t,o,s,r):A(e,t,we(s))}function De(e,t){let o=/<style\b[^>]*>/gi;for(let s=o.exec(e);s;s=o.exec(e)){let a=s.index+s[0].length,r=e.toLowerCase().indexOf("</style",a),c=r<0?e.length:r;if(t>=a&&t<=c)return{start:a,end:c,close:r};o.lastIndex=c}return null}function Le(e){return e.replace(/\/\*[\s\S]*?(\*\/|$)/g,t=>" ".repeat(t.length))}function Pe(e,t,o,s,a){let r=Le(e.slice(a.start,a.end)),c=t-a.start,m=r[c-1]===" "&&e.slice(a.start,a.end)[c-1]!==" ",d=0,u="";for(let v=0;v<c;v++){let k=r[v];k==="{"?(d++,u=k):k==="}"?(d=Math.max(0,d-1),u=k):(k===";"||k===":")&&(u=k)}let f=r.slice(r.lastIndexOf(":",c-1)+1,c).trim();if(s.kind==="value"&&d>0&&u===":"&&!m&&(f===""||o>t))return{from:t,to:o,insert:s.value,selectFrom:t,selectTo:t+s.value.length};if(s.kind!=="value"){let v=a.close<0?e.length:e.indexOf(">",a.close)+1;return A(e,v-1,s.kind==="class"?we(s):s.code)}let h=-1;if(d>0)h=ge(r,c,d);else{let v=r.slice(c).search(/[{}]/);v>=0&&r[c+v]==="{"&&(h=ge(r,c+v+1,1))}let p=h<0?t:a.start+h,g=h<0?-1:Fe(r,h),x=g<0?ye:Re(r,g)||ye,$=be(e,g<0?p:a.start+g);return A(e,p,`${$}${x} { ${s.property}: ${s.value}; }`,!0)}function ge(e,t,o){for(let s=t;s<e.length;s++)if(e[s]==="{")o++;else if(e[s]==="}"&&--o===0)return s;return-1}function Fe(e,t){let o=0;for(let s=t;s>=0;s--)if(e[s]==="}")o++;else if(e[s]==="{"&&--o===0)return s;return-1}function Re(e,t){let o=Math.max(e.lastIndexOf("}",t-1),e.lastIndexOf(";",t-1),e.lastIndexOf("{",t-1))+1;return e.slice(o,t).replace(/\s+/g," ").trim()}function je(e,t){let o=e.lastIndexOf("<",t-1);if(o<0||e.lastIndexOf(">",t-1)>o||/[/!?]/.test(e[o+1]??""))return null;let s=e.indexOf(">",t);return s<0?null:{lt:o,gt:s}}function Be(e,t,o,s,a){if(s.kind==="block")return A(e,a.gt,s.code);let r=s.kind==="value"?"style":"class",c=e.slice(a.lt,a.gt),m=new RegExp(`\\s${r}\\s*=\\s*(["'])([\\s\\S]*?)\\1`,"i").exec(c);if(m){let f=a.lt+m.index+m[0].length-1-m[2].length,h=f+m[2].length;if(t>=f&&t<=h){let $=e.slice(f,t);if(s.kind==="value"&&(/:\s*$/.test($)||o>t&&/:[^;]*$/.test($)))return M(t,o,s.value);if(s.kind==="class"&&!(/\S$/.test($)&&/^\S/.test(e.slice(t,h)))){let v=`${/\S$/.test($)?" ":""}${s.className}${/^\S/.test(e.slice(t,h))?" ":""}`;return M(t,t,v)}}let p=m[2].trimEnd(),g=s.kind==="value"?`${p&&!p.endsWith(";")?";":""}${p?" ":""}${s.property}: ${s.value}`:`${p?" ":""}${s.className}`,x=f+p.length;return M(x,x,g)}let d=e[a.gt-1]==="/"?a.gt-1:a.gt,u=s.kind==="value"?` style="${s.property}: ${s.value}"`:` class="${s.className}"`;return M(d,d,u)}function we(e){return e.kind==="block"?e.code:e.kind==="class"?`<p class="${e.className}">Text</p>`:`<div style="${e.property}: ${e.value}">Text</div>`}function M(e,t,o){return{from:e,to:t,insert:o,selectFrom:e,selectTo:e+o.length}}function be(e,t){let o=e.lastIndexOf(`
1
+ "use client";import{b as ee,d as te,e as se}from"./chunk-3LWDFU5Y.js";import{Ae as re,Bh as ie,Ok as ce,Pb as oe,Rk as de,Xk as me,de as ne,fe as I,g as i,he as ae,rl as ue,sl as fe,tl as he,xl as pe}from"./chunk-RCOLM57Z.js";import{d as Z}from"./chunk-Y7DFVCVM.js";import{Kf as J,Sg as B,bg as Y,la as X,li as le,xb as K}from"./chunk-R3WKYZOZ.js";import"./chunk-RJM55KDO.js";import"./chunk-3DDOV7FZ.js";import"./chunk-Y6SLVHK3.js";import{jsx as n,jsxs as w,Fragment as Ue}from"react/jsx-runtime";import{Suspense as We,useContext as Ve,useEffect as Te,useMemo as _,useRef as Ne,useState as S}from"react";import{AccordionHeading as H,Banner as qe,Button as D,Card as Qe,Dialog as Xe,DropdownMenu as Ke,Segmented as Je,Text as b,buttonClasses as Ye,colorFill as Ze,colorSwatchClasses as et,fitFrameStyle as tt,fitScale as st}from"efficient-shell/ui";import{CodeEditor as ot}from"efficient-shell/code";import{ChevronDownIcon as nt}from"efficient-shell/icons/efficient";import{AlignSeparateIcon as at}from"efficient-easel/icons";import{ScreenDocumentContext as rt}from"efficient-easel/screen/components/ScreenDocumentContext";var ye=".my-part";function ve(e,t,o,s){let a=De(e,t);if(a)return Pe(e,t,o,s,a);let r=je(e,t);return r?Be(e,t,o,s,r):A(e,t,we(s))}function De(e,t){let o=/<style\b[^>]*>/gi;for(let s=o.exec(e);s;s=o.exec(e)){let a=s.index+s[0].length,r=e.toLowerCase().indexOf("</style",a),c=r<0?e.length:r;if(t>=a&&t<=c)return{start:a,end:c,close:r};o.lastIndex=c}return null}function Le(e){return e.replace(/\/\*[\s\S]*?(\*\/|$)/g,t=>" ".repeat(t.length))}function Pe(e,t,o,s,a){let r=Le(e.slice(a.start,a.end)),c=t-a.start,m=r[c-1]===" "&&e.slice(a.start,a.end)[c-1]!==" ",d=0,u="";for(let v=0;v<c;v++){let k=r[v];k==="{"?(d++,u=k):k==="}"?(d=Math.max(0,d-1),u=k):(k===";"||k===":")&&(u=k)}let f=r.slice(r.lastIndexOf(":",c-1)+1,c).trim();if(s.kind==="value"&&d>0&&u===":"&&!m&&(f===""||o>t))return{from:t,to:o,insert:s.value,selectFrom:t,selectTo:t+s.value.length};if(s.kind!=="value"){let v=a.close<0?e.length:e.indexOf(">",a.close)+1;return A(e,v-1,s.kind==="class"?we(s):s.code)}let h=-1;if(d>0)h=ge(r,c,d);else{let v=r.slice(c).search(/[{}]/);v>=0&&r[c+v]==="{"&&(h=ge(r,c+v+1,1))}let p=h<0?t:a.start+h,g=h<0?-1:Fe(r,h),x=g<0?ye:Re(r,g)||ye,$=be(e,g<0?p:a.start+g);return A(e,p,`${$}${x} { ${s.property}: ${s.value}; }`,!0)}function ge(e,t,o){for(let s=t;s<e.length;s++)if(e[s]==="{")o++;else if(e[s]==="}"&&--o===0)return s;return-1}function Fe(e,t){let o=0;for(let s=t;s>=0;s--)if(e[s]==="}")o++;else if(e[s]==="{"&&--o===0)return s;return-1}function Re(e,t){let o=Math.max(e.lastIndexOf("}",t-1),e.lastIndexOf(";",t-1),e.lastIndexOf("{",t-1))+1;return e.slice(o,t).replace(/\s+/g," ").trim()}function je(e,t){let o=e.lastIndexOf("<",t-1);if(o<0||e.lastIndexOf(">",t-1)>o||/[/!?]/.test(e[o+1]??""))return null;let s=e.indexOf(">",t);return s<0?null:{lt:o,gt:s}}function Be(e,t,o,s,a){if(s.kind==="block")return A(e,a.gt,s.code);let r=s.kind==="value"?"style":"class",c=e.slice(a.lt,a.gt),m=new RegExp(`\\s${r}\\s*=\\s*(["'])([\\s\\S]*?)\\1`,"i").exec(c);if(m){let f=a.lt+m.index+m[0].length-1-m[2].length,h=f+m[2].length;if(t>=f&&t<=h){let $=e.slice(f,t);if(s.kind==="value"&&(/:\s*$/.test($)||o>t&&/:[^;]*$/.test($)))return M(t,o,s.value);if(s.kind==="class"&&!(/\S$/.test($)&&/^\S/.test(e.slice(t,h)))){let v=`${/\S$/.test($)?" ":""}${s.className}${/^\S/.test(e.slice(t,h))?" ":""}`;return M(t,t,v)}}let p=m[2].trimEnd(),g=s.kind==="value"?`${p&&!p.endsWith(";")?";":""}${p?" ":""}${s.property}: ${s.value}`:`${p?" ":""}${s.className}`,x=f+p.length;return M(x,x,g)}let d=e[a.gt-1]==="/"?a.gt-1:a.gt,u=s.kind==="value"?` style="${s.property}: ${s.value}"`:` class="${s.className}"`;return M(d,d,u)}function we(e){return e.kind==="block"?e.code:e.kind==="class"?`<p class="${e.className}">Text</p>`:`<div style="${e.property}: ${e.value}">Text</div>`}function M(e,t,o){return{from:e,to:t,insert:o,selectFrom:e,selectTo:e+o.length}}function be(e,t){let o=e.lastIndexOf(`
2
2
  `,t-1)+1;return/^[ \t]*/.exec(e.slice(o))[0]}function A(e,t,o,s=!1){let a=e.lastIndexOf(`
3
3
  `,t-1)+1,r=e.indexOf(`
4
4
  `,t);r<0&&(r=e.length);let c=be(e,t),m=s?o:o.split(`
@@ -1,4 +1,4 @@
1
- "use client";import{Aa as Fr,Ba as _r,Ca as Mr,Da as Kr,Ea as Dr,Fa as ye,Ha as mt,Ia as jr,Ja as Ur,Ka as _t,La as Wr,Na as yn,Oa as ne,Ra as $r,Sa as Yr,Xa as Br,Ya as de,Za as Hr,_a as zr,b as Tr,c as fn,d as qr,db as Gr,e as Tt,eb as ft,hb as gn,jb as ie,ka as qt,la as Ft}from"./chunk-4SIPG47B.js";import{S as ue,Y as Ze,da as $,o as Lr,p as Ir}from"./chunk-FD3ICZTF.js";import{fa as Rr,ha as Ue}from"./chunk-L6MXM22Q.js";import{i as Ar,j as pt,k as Ie}from"./chunk-VYXOE5FY.js";import{li as Or}from"./chunk-SQ6D33WV.js";import"./chunk-SB3V6PTJ.js";import"./chunk-ECMYL3O7.js";import{a as mn,b as hi}from"./chunk-Y6SLVHK3.js";var Zr=mn((Gs,Xr)=>{"use strict";var ki="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Xr.exports=ki});var no=mn((Vs,to)=>{"use strict";var xi=Zr();function Qr(){}function eo(){}eo.resetWarningCache=Qr;to.exports=function(){function e(r,a,s,d,y,f){if(f!==xi){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eo,resetWarningCache:Qr};return n.PropTypes=n,n}});var oo=mn((Zs,ro)=>{"use strict";ro.exports=no()();var Js,Xs});import{useEffect as Aa,useMemo as Ea,useRef as tt,useState as Ye}from"react";import{formatTime as bi}from"efficient-shell/format";function Vr(e,t){let n=Ir(t);return!n||Number.isNaN(new Date(e).getTime())?"":bi(e,{locale:Lr(),timeZone:n})}import{rootIsDark as vi}from"efficient-shell/format";function Jr(){if(typeof document>"u")return;let e=getComputedStyle(document.documentElement),t=(r,a)=>e.getPropertyValue(r).trim()||a,n=vi({whenUnset:!0});return{theme:n?"night":"stripe",variables:{colorPrimary:t("--accent",n?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",n?"#131313":"#ffffff"),colorText:t("--fg",n?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}import{userZone as Rs,parseOption as Os}from"efficient-shell/format";var M=hi(oo(),1);import I from"react";function ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ci(e){if(Array.isArray(e))return e}function uo(e,t,n){return(t=Ri(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pi(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,d,y=[],f=!0,p=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(r=s.call(n)).done)&&(y.push(r.value),y.length!==t);f=!0);}catch(k){p=!0,a=k}finally{try{if(!f&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(p)throw a}}return y}}function Ni(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ "use client";import{Aa as Fr,Ba as _r,Ca as Mr,Da as Kr,Ea as Dr,Fa as ye,Ha as mt,Ia as jr,Ja as Ur,Ka as _t,La as Wr,Na as yn,Oa as ne,Ra as $r,Sa as Yr,Xa as Br,Ya as de,Za as Hr,_a as zr,b as Tr,c as fn,d as qr,db as Gr,e as Tt,eb as ft,hb as gn,jb as ie,ka as qt,la as Ft}from"./chunk-YU4MIT6K.js";import{S as ue,Y as Ze,da as $,o as Lr,p as Ir}from"./chunk-HOKKFWPX.js";import{fa as Rr,ha as Ue}from"./chunk-ICWPUDN3.js";import{i as Ar,j as pt,k as Ie}from"./chunk-SRHU2S3G.js";import{li as Or}from"./chunk-R3WKYZOZ.js";import"./chunk-RJM55KDO.js";import"./chunk-3DDOV7FZ.js";import{a as mn,b as hi}from"./chunk-Y6SLVHK3.js";var Zr=mn((Gs,Xr)=>{"use strict";var ki="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Xr.exports=ki});var no=mn((Vs,to)=>{"use strict";var xi=Zr();function Qr(){}function eo(){}eo.resetWarningCache=Qr;to.exports=function(){function e(r,a,s,d,y,f){if(f!==xi){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:eo,resetWarningCache:Qr};return n.PropTypes=n,n}});var oo=mn((Zs,ro)=>{"use strict";ro.exports=no()();var Js,Xs});import{useEffect as Aa,useMemo as Ea,useRef as tt,useState as Ye}from"react";import{formatTime as bi}from"efficient-shell/format";function Vr(e,t){let n=Ir(t);return!n||Number.isNaN(new Date(e).getTime())?"":bi(e,{locale:Lr(),timeZone:n})}import{rootIsDark as vi}from"efficient-shell/format";function Jr(){if(typeof document>"u")return;let e=getComputedStyle(document.documentElement),t=(r,a)=>e.getPropertyValue(r).trim()||a,n=vi({whenUnset:!0});return{theme:n?"night":"stripe",variables:{colorPrimary:t("--accent",n?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",n?"#131313":"#ffffff"),colorText:t("--fg",n?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}import{userZone as Rs,parseOption as Os}from"efficient-shell/format";var M=hi(oo(),1);import I from"react";function ao(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ci(e){if(Array.isArray(e))return e}function uo(e,t,n){return(t=Ri(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pi(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,s,d,y=[],f=!0,p=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(f=(r=s.call(n)).done)&&(y.push(r.value),y.length!==t);f=!0);}catch(k){p=!0,a=k}finally{try{if(!f&&n.return!=null&&(d=n.return(),Object(d)!==d))return}finally{if(p)throw a}}return y}}function Ni(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?io(Object(n),!0).forEach(function(r){uo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):io(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Si(e,t){if(e==null)return{};var n,r,a=wi(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function wi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function po(e,t){return Ci(e)||Pi(e,t)||Oi(e,t)||Ni()}function Ei(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ri(e){var t=Ei(e,"string");return typeof t=="symbol"?t:t+""}function hn(e){"@babel/helpers - typeof";return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(e)}function Oi(e,t){if(e){if(typeof e=="string")return ao(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(e,t):void 0}}var X=function(t,n,r){var a=!!r,s=I.useRef(r);I.useEffect(function(){s.current=r},[r]),I.useEffect(function(){if(!a||!t)return function(){};var d=function(){if(s.current)return s.current.apply(s,arguments)};return t.on(n,d),function(){t.off(n,d)}},[a,n,t,s])},bn=function(t){var n=I.useRef(t);return I.useEffect(function(){n.current=t},[t]),n.current},Qe=function(t){return t!==null&&hn(t)==="object"},Ai=function(t){return Qe(t)&&typeof t.then=="function"},Li=function(t){return Qe(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},co="[object Object]",Ii=function e(t,n){if(t===n)return!0;if(!Qe(t)||!Qe(n))return t===n;var r=Array.isArray(t),a=Array.isArray(n);if(r!==a)return!1;var s=Object.prototype.toString.call(t)===co,d=Object.prototype.toString.call(n)===co;if(s!==d)return!1;if(!s&&!r)return t===n;var y=Object.keys(t),f=Object.keys(n);if(y.length!==f.length)return!1;for(var p={},k=0;k<y.length;k+=1)p[y[k]]=!0;for(var h=0;h<f.length;h+=1)p[f[h]]=!0;var b=Object.keys(p);if(b.length!==y.length)return!1;var v=t,R=n,C=function(V){return e(v[V],R[V])};return b.every(C)},mo=function(t,n,r){return Qe(t)?Object.keys(t).reduce(function(a,s){var d=!Qe(n)||!Ii(t[s],n[s]);return r.includes(s)?(d&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),a):d?so(so({},a||{}),{},uo({},s,t[s])):a},null):null},fo="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",lo=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fo;if(t===null||Li(t))return t;throw new Error(n)},Ti=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fo;if(Ai(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return lo(a,n)})};var r=lo(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},qi=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),t.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},Mt=I.createContext(null);Mt.displayName="ElementsContext";var yo=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t},kn=function(t){var n=t.stripe,r=t.options,a=t.children,s=I.useMemo(function(){return Ti(n)},[n]),d=I.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(r):null}}),y=po(d,2),f=y[0],p=y[1];I.useEffect(function(){var b=!0,v=function(C){p(function(O){return O.stripe?O:{stripe:C,elements:C.elements(r)}})};return s.tag==="async"&&!f.stripe?s.stripePromise.then(function(R){R&&b&&v(R)}):s.tag==="sync"&&!f.stripe&&v(s.stripe),function(){b=!1}},[s,f,r]);var k=bn(n);I.useEffect(function(){k!==null&&k!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[k,n]);var h=bn(r);return I.useEffect(function(){if(f.elements){var b=mo(r,h,["clientSecret","fonts"]);b&&f.elements.update(b)}},[r,h,f.elements]),I.useEffect(function(){qi(f.stripe)},[f.stripe]),I.createElement(Mt.Provider,{value:f},a)};kn.propTypes={stripe:M.default.any,options:M.default.object};var go=function(t){var n=I.useContext(Mt);return yo(n,t)},ho=function(){var t=go("calls useElements()"),n=t.elements;return n},Fi=function(t){var n=t.children,r=go("mounts <ElementsConsumer>");return n(r)};Fi.propTypes={children:M.default.func.isRequired};var _i=I.createContext(null);_i.displayName="CheckoutContext";var bo=I.createContext(null);bo.displayName="CheckoutSdkContext";var vn=function(t){var n=I.useContext(bo),r=I.useContext(Mt);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both a checkout provider and <Elements> provider."));return n}else return yo(r,t)},Mi=["mode"],Ki=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},K=function(t,n,r){var a="".concat(Ki(t),"Element"),s=function(p){var k=p.id,h=p.className,b=p.options,v=b===void 0?{}:b,R=p.onBlur,C=p.onFocus,O=p.onReady,V=p.onChange,E=p.onEscape,P=p.onClick,Y=p.onLoadError,Z=p.onLoaderStart,pe=p.onNetworksChange,j=p.onConfirm,se=p.onCancel,Se=p.onShippingAddressChange,qe=p.onShippingRateChange,ee=p.onSavedPaymentMethodRemove,he=p.onSavedPaymentMethodUpdate,re=p.onAvailablePaymentMethodsChange,te=vn("mounts <".concat(a,">")),z="elements"in te?te.elements:null,g="checkoutSdk"in te?te.checkoutSdk:null,we=I.useState(null),Fe=po(we,2),U=Fe[0],nt=Fe[1],Q=I.useRef(null),be=I.useRef(null);X(U,"blur",R),X(U,"focus",C),X(U,"escape",E),X(U,"click",P),X(U,"loaderror",Y),X(U,"loaderstart",Z),X(U,"networkschange",pe),X(U,"confirm",j),X(U,"cancel",se),X(U,"shippingaddresschange",Se),X(U,"shippingratechange",qe),X(U,"savedpaymentmethodremove",ee),X(U,"savedpaymentmethodupdate",he),X(U,"availablepaymentmethodschange",re),X(U,"change",V);var Ee;O&&(t==="expressCheckout"?Ee=O:Ee=function(){O(U)}),X(U,"ready",Ee),I.useLayoutEffect(function(){if(Q.current===null&&be.current!==null&&(z||g)){var L=null;if(g){var oe=g,me=g;switch(t){case"paymentForm":L=me.createForm(v);break;case"payment":L=oe.createPaymentElement(v);break;case"address":if("mode"in v){var Oe=v.mode,ve=Si(v,Mi);if(Oe==="shipping")L=oe.createShippingAddressElement(ve);else if(Oe==="billing")L=oe.createBillingAddressElement(ve);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":L=oe.createExpressCheckoutElement(v);break;case"currencySelector":L=g.createCurrencySelectorElement();break;case"taxId":L=oe.createTaxIdElement(v);break;case"contactDetails":L=oe.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in g)L=g.createLinkSignupElement(v);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":L=oe.createTermsElement(v);break;default:throw new Error("<".concat(a,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else z&&(L=z.create(t,v));Q.current=L,nt(L),L&&L.mount(be.current)}},[z,g,v]);var Re=bn(v);return I.useEffect(function(){if(Q.current){var L=mo(v,Re,["paymentRequest"]);L&&"update"in Q.current&&Q.current.update(L)}},[v,Re]),I.useLayoutEffect(function(){return function(){if(Q.current&&typeof Q.current.destroy=="function")try{Q.current.destroy(),Q.current=null}catch{}}},[]),I.createElement("div",{id:k,className:h,ref:be})},d=function(p){vn("mounts <".concat(a,">"));var k=p.id,h=p.className;return I.createElement("div",{id:k,className:h})},y=n?d:s;return y.propTypes={id:M.default.string,className:M.default.string,onChange:M.default.func,onBlur:M.default.func,onFocus:M.default.func,onReady:M.default.func,onEscape:M.default.func,onClick:M.default.func,onLoadError:M.default.func,onLoaderStart:M.default.func,onNetworksChange:M.default.func,onConfirm:M.default.func,onCancel:M.default.func,onShippingAddressChange:M.default.func,onShippingRateChange:M.default.func,onSavedPaymentMethodRemove:M.default.func,onSavedPaymentMethodUpdate:M.default.func,onAvailablePaymentMethodsChange:M.default.func,options:M.default.object},y.displayName=a,y.__elementType=t,y},D=typeof window>"u",Di=I.createContext(null);Di.displayName="EmbeddedCheckoutProviderContext";var vo=function(){var t=vn("calls useStripe()"),n=t.stripe;return n},ec=K("auBankAccount",D),tc=K("card",D),nc=K("cardNumber",D),rc=K("cardExpiry",D),oc=K("cardCvc",D),ac=K("currencySelector",D),ic=K("iban",D),ko=K("payment",D),sc=K("expressCheckout",D),cc=K("paymentRequestButton",D),lc=K("linkAuthentication",D),uc=K("linkSignup",D),dc=K("contactDetails",D),pc=K("address",D),mc=K("shippingAddress",D),fc=K("paymentMethodMessaging",D),yc=K("taxId",D),gc=K("issuingCardNumberDisplay",D),hc=K("issuingCardCvcDisplay",D),bc=K("issuingCardExpiryDisplay",D),vc=K("issuingCardPinDisplay",D),kc=K("issuingCardCopyButton",D),xc=K("terms",D);function jt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jt=function(t){return typeof t}:jt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(e)}var Po="dahlia",ji=function(t){return t===3?"v3":t},No="https://js.stripe.com",Ui="".concat(No,"/").concat(Po,"/stripe.js"),Wi=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,$i=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,xo="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Yi=function(t){return Wi.test(t)||$i.test(t)},Bi=function(){for(var t=document.querySelectorAll('script[src^="'.concat(No,'"]')),n=0;n<t.length;n++){var r=t[n];if(Yi(r.src))return r}return null},Co=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Ui).concat(n);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(r),r},Hi=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},yt=null,Kt=null,Dt=null,zi=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},Gi=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},Vi=function(t){return yt!==null?yt:(yt=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(xo),window.Stripe){n(window.Stripe);return}try{var a=Bi();if(a&&t)console.warn(xo);else if(!a)a=Co(t);else if(a&&Dt!==null&&Kt!==null){var s;a.removeEventListener("load",Dt),a.removeEventListener("error",Kt),(s=a.parentNode)===null||s===void 0||s.removeChild(a),a=Co(t)}Dt=Gi(n,r),Kt=zi(r),a.addEventListener("load",Dt),a.addEventListener("error",Kt)}catch(d){r(d);return}}),yt.catch(function(n){return yt=null,Promise.reject(n)}))},Ji=function(t,n,r){if(t===null)return null;var a=n[0];if(typeof a!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(jt(a)," instead."));var s=a.match(/^pk_test/),d=ji(t.version),y=Po;s&&d!==y&&console.warn("Stripe.js@".concat(d," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(y,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var f=t.apply(void 0,n);return Hi(f,r),f},gt,So=!1,wo=function(){return gt||(gt=Vi(null).catch(function(t){return gt=null,Promise.reject(t)}),gt)};Promise.resolve().then(function(){return wo()}).catch(function(e){So||console.warn(e)});var Ut=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];So=!0;var a=Date.now();return wo().then(function(s){return Ji(s,n,a)})};var Wt=2;function Eo(e){return e==="card"}var Xi="checkout_unavailable",Zi="checkout_waiting",Ro="committed",Te="We could not check your payment. Please try again.",$t="Your last change was not saved. This is your order as placed.",Oo="Your bank is still waiting for you to approve this payment, so your order stays as it was. Finish the approval, or try again in a few minutes.",Ao=1e4;async function Lo(e,t=Ao){let n,r=new Promise(s=>{n=setTimeout(()=>s(void 0),t)}),a=(async()=>{try{return(await(await Ut(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([a,r])}finally{clearTimeout(n)}}var Io=new Set(["none","requires_payment_method","canceled"]);async function xn(e,t=Ao){let n,r=new Promise(a=>{n=setTimeout(()=>a(void 0),t)});try{return await Promise.race([$.releaseCheckout({idempotencyKey:e}).then(a=>a.status,()=>{}),r])}finally{clearTimeout(n)}}function To(e,t){return e instanceof ue&&typeof e.data=="object"&&e.data!==null&&e.data.code===t}function Yt(e){return To(e,Xi)}function Cn(e){return To(e,Zi)}function Pn(e){return e instanceof ue&&e.status>=400&&e.status<500&&e.status!==408}function qo(e){return JSON.stringify([e.email,e.firstName,e.lastName,e.phone,e.address,e.city,e.subdivision,e.postcode,e.country,e.lines,e.shippingMethodId,e.couponCode,e.currency,e.shopperId,e.company])}function Bt(e){return e.orderNumber||e.checkoutNumber}function Qi(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function Fo({checkoutNumber:e,resend:t,page:n}){n.setConfirming(!0);let r;try{r=Qi(await t())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(n.markPaid(),n.track(r.order),n.land(r.order)):n.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),n.setConfirming(!1)}import{createContext as gs,useContext as hs,useEffect as H,useMemo as sa,useRef as B,useState as S}from"react";var es="sf:gclid",ts="sf:fbclid",ns=2160*60*60*1e3;function Ko(){return typeof window<"u"}function _o(e){let t=pt.getItem(e);if(!t)return"";try{let{v:n,t:r}=JSON.parse(t);return!n||typeof r!="number"||Date.now()-r>ns?"":n}catch{return""}}function Mo(e){if(!Ko())return"";let t=e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${t}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Do(){if(!Ko())return{};let e=_o(es),t=_o(ts),n=Mo("_fbp"),r=Mo("_fbc");!r&&t&&(r=`fb.1.${Date.now()}.${t}`);let a={};return e&&(a.gclid=e),t&&(a.fbclid=t),n&&(a.fbp=n),r&&(a.fbc=r),a}var jo="sf:meta-purchases",rs=20;function Wo(){return typeof window>"u"||window.parent!==window}function os(...e){try{if(Wo()||typeof window.fbq!="function")return;window.fbq(...e)}catch{}}var Uo=new Set;function as(e){if(Uo.has(e))return!1;Uo.add(e);try{let t=JSON.parse(pt.getItem(jo)??"[]");if(t.includes(e))return!1;pt.setItem(jo,JSON.stringify([...t,e].slice(-rs)))}catch{}return!0}function is(e){return[...new Set(e.filter(mt).flatMap(t=>t.components.map(n=>n.partNumber)))]}function $o(e){let t=e.confirmation;Wo()||!as(t.orderNumber)||os("track","Purchase",{value:Number(t.grandTotal),currency:t.currency,content_type:"product",content_ids:is(e.lines)},{eventID:t.orderNumber})}var Nn="checkout-afterpay-context",Sn="checkout-gocardless-context",wn="checkout-zip-context",En="checkout-klarna-context";function ss(e){return e?.lostChange===!0}function cs({evidence:e,parked:t}){return e?{action:"capture",evidence:e,parked:t}:t?{action:"settle",parked:t}:{action:"ignore"}}function ls(e,t){let n=e.getItem(t);if(e.removeItem(t),!n)return null;try{return JSON.parse(n)}catch{return null}}function us(e){let t=e.words?.declined??`${e.name} declined the payment \u2014 our team will follow up on payment.`;return{settled:e.words?.settled??`The ${e.name} payment was not completed \u2014 our team will follow up on payment.`,declined:t,collecting:e.words?.collecting??t,unconfirmed:e.words?.unconfirmed??`We could not confirm the ${e.name} payment \u2014 our team will follow up on payment.`}}var Yo={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:Nn,evidenceFrom(e,t){return t==="cancel"||(e.get("status")??"").toUpperCase()==="CANCELLED"?null:e.get("orderToken")},requestFrom:e=>({token:e})},Bo={name:"Zip",legParam:"zip",legValues:["return"],storageKey:wn,evidenceFrom(e){let t=(e.get("result")??"").toLowerCase();return t==="cancelled"||t==="declined"?null:e.get("checkoutId")},requestFrom:e=>({checkoutId:e})},Ho={name:"GoCardless",legParam:"gocardless",legValues:["confirm","cancel"],storageKey:Sn,evidenceFrom:(e,t)=>t==="confirm"?t:null,requestFrom:(e,t)=>({idempotencyKey:t?.idempotencyKey??""}),keyedByParked:!0,words:{settled:"The direct debit was not set up \u2014 our team will follow up on payment.",declined:"The direct debit was declined \u2014 our team will follow up on payment.",collecting:"Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.",unconfirmed:"We could not confirm the direct debit \u2014 our team will follow up on payment."}},zo={name:"Klarna",legParam:"klarna",legValues:["confirm","cancel"],storageKey:En,evidenceFrom:(e,t)=>t==="confirm"?e.get("authorization_token"):null,requestFrom:(e,t)=>({idempotencyKey:t?.idempotencyKey??"",authorizationToken:e}),keyedByParked:!0,words:{collecting:"Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly."}};async function ht(e,t){let n=new URLSearchParams(t.search),r=n.get(e.legParam);if(!r||!e.legValues.includes(r))return;let a=ls(t.storage,e.storageKey),s=e.evidenceFrom(n,r);t.scrubQuery();let d=cs({evidence:s,parked:a});if(d.action==="ignore"||e.keyedByParked&&!d.parked)return;let y=us(e);if(t.page.clearCart(),ss(d.parked)&&t.page.lostChange(),d.action==="settle"){t.page.note(y.settled,!0),t.page.land(d.parked.confirmation);return}t.page.setConfirming(!0);try{let f=await t.capture(e.requestFrom(d.evidence,d.parked));f.status==="paid"?t.page.markPaid():f.status==="collecting"?t.page.note(y.collecting,!e.words?.collecting):t.page.note(y.declined,!0),t.page.land(d.parked?.confirmation??f)}catch{d.parked?(t.page.note(y.unconfirmed,!0),t.page.land(d.parked.confirmation)):t.page.fail(`We could not confirm your ${e.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{t.page.setConfirming(!1)}}function Go(e,t,n){let r=(t??"").trim();if(!r)return"";if(n.length===0)return r;let a=r.toUpperCase(),s=`${e.toUpperCase()}-${a}`,d=n.find(y=>y.code&&y.code.toUpperCase()===a)??n.find(y=>y.code&&y.code.toUpperCase()===s)??n.find(y=>y.name.toUpperCase()===a);return d?d.code||d.name:""}var On="checkout-memory-context",Xo="Prices have changed since this checkout started. The total shows today's prices.",Zo="We couldn't check today's prices for your basket. Try again in a moment \u2014 you can place the order once the total is confirmed.",Qo=3,ds=3600*1e3;function ps(e){return{id:e.id,slug:e.slug,name:{lead:e.name?.lead,accent:e.name?.accent},process:e.process,positionNo:e.positionNo,config:(e.config??[]).map(t=>({label:t.label,gold:t.gold})),finishName:e.finishName,size:e.size,qty:e.qty,href:e.href,kind:e.kind,sku:e.sku,components:e.components.map(t=>({partNumber:t.partNumber,wheels:t.wheels,prices:{...t.prices},hand:t.hand}))}}var Ht=e=>e.map(ps);function ea(e,t){let n=r=>JSON.stringify(r.map(a=>[a.id,a.qty]).sort(([a],[s])=>a<s?-1:a>s?1:0));return n(e)===n(t)}function ta(e){let t=e.customer;return{customer:{email:t.email,name:t.name,phone:t.phone,companyName:t.companyName,address:t.address,city:t.city,state:t.state,zipCode:t.zipCode,country:t.country},items:e.items.flatMap(n=>Tt([{partNumber:n.partNumber,wheels:n.quantity,prices:{}}],1)),currency:e.currency,idempotencyKey:e.idempotencyKey,shippingMethodId:e.shippingMethodId,couponCode:e.couponCode}}function An(e){return{...ta(e),payFirst:!!e.checkoutFlow}}function na(e){return ta(e)}var ms={lastPress:null,keptCardKey:null,placedShape:null,placedRequest:null,unpaidOrder:null};function Ln(e){let t=n=>typeof n=="string"?n:"";return{email:t(e.email),firstName:t(e.firstName),lastName:t(e.lastName),company:t(e.company),address1:t(e.address1),address2:t(e.address2),city:t(e.city),postcode:t(e.postcode),phone:t(e.phone),country:t(e.country),subdivision:t(e.subdivision),selectedAddressId:t(e.selectedAddressId),shippingMethodId:typeof e.shippingMethodId=="string"?e.shippingMethodId:null,couponCode:typeof e.couponCode=="string"?e.couponCode:null}}function In(e){return{orderNumber:e.orderNumber,checkoutNumber:e.checkoutNumber,expiresAt:e.expiresAt,status:e.status,total:e.total,currency:e.currency,freightCharge:e.freightCharge,discountAmount:e.discountAmount,grandTotal:e.grandTotal,shippingMethod:e.shippingMethod,couponCode:e.couponCode}}function Tn(e){return e.lastPress!==null||e.unpaidOrder!==null||e.keptCardKey!==null}function fs(e){let t=e.parkedAt+ds,n=e.press.unpaidOrder,r=n&&!n.orderNumber?n.expiresAt:null,a=r?Date.parse(r):NaN;return Number.isNaN(a)?t:Math.min(t,a)}function ra(e){try{let t={...e,lines:Ht(e.lines),press:aa(e.press)};Ie.setItem(On,JSON.stringify({v:Qo,...t}))}catch{}}var We=e=>!!e&&typeof e=="object"&&!Array.isArray(e),oa=e=>We(e)&&typeof e.idempotencyKey=="string"&&Array.isArray(e.items)&&e.items.every(t=>We(t)&&typeof t.partNumber=="string"&&typeof t.quantity=="number")&&We(e.customer)&&typeof e.payFirst=="boolean",Rn=e=>We(e)&&typeof e.id=="string"&&typeof e.qty=="number"&&Array.isArray(e.components);function ys(e){return We(e)&&typeof e.key=="string"&&oa(e.request)&&Array.isArray(e.lines)&&e.lines.every(Rn)&&Array.isArray(e.plainLines)&&e.plainLines.every(Rn)?{key:e.key,request:e.request,lines:Ht(e.lines),goods:typeof e.goods=="string"?e.goods:"",plainPressed:e.plainPressed===!0,plainLines:Ht(e.plainLines),plainGoods:typeof e.plainGoods=="string"?e.plainGoods:""}:null}var Vo=e=>typeof e=="string"?e:null,Jo={lastPress:ys,keptCardKey:Vo,placedShape:Vo,placedRequest:e=>oa(e)?e:null,unpaidOrder:e=>We(e)?In(e):null};function aa(e){let t=We(e)?e:{},n={...ms};for(let r of Object.keys(Jo))n[r]=Jo[r](t[r]);return n}function ia(){let e;try{e=Ie.getItem(On)}catch{return null}if(!e)return null;try{let t=JSON.parse(e);if(t.v!==Qo||typeof t.key!="string"||!t.key||!Array.isArray(t.lines)||!t.lines.every(Rn)||typeof t.parkedAt!="number")return null;let n={key:t.key,authed:t.authed===!0,parkedAt:t.parkedAt,press:aa(t.press),lines:Ht(t.lines),form:t.form&&typeof t.form=="object"?Ln(t.form):null};return Date.now()>=fs(n)?(qn(),null):Tn(n.press)?n:null}catch{return null}}function qn(){try{Ie.removeItem(On)}catch{}}import{jsx as Ce}from"react/jsx-runtime";function ca(e){let t=e.indexOf(`
3
3
  `);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function la(e,{canParkContext:t}={canParkContext:!0}){let n=e.paymentMethods,r=[];return n.includes("card")&&r.push({key:"card",title:"Card",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&e.paypalClientId&&r.push({key:"paypal",title:"PayPal",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&r.push({key:"afterpay",title:"Afterpay",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&e.squareApplicationId&&e.squareLocationId&&r.push({key:"square",title:"Card (Square)",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&t&&r.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&r.push({key:"zip",title:"Zip",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&t&&r.push({key:"klarna",title:"Klarna",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),n.includes("bank")&&r.push({key:"bank",title:"Bank transfer",body:null,price:Ce("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),r}var fa="This shop does not take payment online yet. Please contact the shop to order.",et=class extends Error{};function ua(e,t){if(!e.orderNumber&&Yt(t))return t.message;let n=t instanceof ue?` (${t.message})`:"";return e.orderNumber?`Your order ${e.orderNumber} is saved, but the payment did not start${n}. Try the payment again \u2014 your order will not be placed twice.`:`Your items are held under ${e.checkoutNumber}, but the payment did not start${n}. Try the payment again \u2014 you will not be charged twice.`}var bs=3e3,vs=.005,da=new Set(["paypal","square","afterpay","gocardless","zip","klarna"]);function pa(){let e=Gr();return{...e==="denied"?{}:Do(),...e?{adConsent:e}:{}}}var ge=e=>JSON.parse(e),ks={lastPress:null,keptCardKey:null,placedShape:null,placedRequest:null,unpaidOrder:null},xs={lastPress:e=>e&&{key:e.key,request:An(e.request),lines:e.lines,goods:ge(e.shape)[0],plainPressed:!!e.plainMethod,plainLines:e.plainLines,plainGoods:ge(e.plainShape)[0]},keptCardKey:e=>e,placedShape:e=>e===null?null:ge(e)[0],placedRequest:e=>e&&An(e.body),unpaidOrder:e=>e&&In(e)};function ma(e,t){let n={};for(let r of Object.keys(e))n[r]=e[r](t[r]);return n}var ya="Shipping cannot be calculated right now. Please try again.";function ga(e){return`Your order is saved, so its contact, address, delivery and discount can't change here. To change any of them, contact the shop and quote ${e}.`}function Cs({site:e,logo:t,preview:n=!1}){let{items:r,totals:a,coupon:s,refuseCoupon:d,deliveryOptions:y,shippingMethodId:f,setShippingMethodId:p,setQuoteDestination:k,courier:h,requote:b,identify:v,clearCapturedCart:R,replaceItems:C,removeCoupon:O,applyCoupon:V}=_t(),E=y.find(o=>o.id===f)?.pickupLocation??null,{country:P,countries:Y,activeCountry:Z,formatMoney:pe}=ye(),[j,se]=S(()=>la(e)[0]?.key??null),[Se,qe]=S(!0);H(()=>{qe(Ar(Ie))},[]);let[ee,he]=S(!1),[re,te]=S(""),[z,g]=S(""),[we,Fe]=S(""),[U,nt]=S(""),[Q,be]=S(""),[Ee,Re]=S(""),[L,oe]=S(""),[me,Oe]=S(""),[ve,rt]=S(""),[W,ot]=S(()=>P||Y[0]?.code||""),[ke,vt]=S(""),[at,Dn]=S([]),[Xt,Zt]=S(null),[kt,Be]=S(null),jn=sa(()=>Y.find(o=>o.code===W)??Z,[Y,W,Z]),La=jn?.postalLabel||"Postal Code",Ia=at[0]?.divisionType||"State / Province";H(()=>{if(!W){Dn([]),Zt(W);return}Zt(null);let o=!1;return $.listCountrySubdivisions(W).then(c=>{o||(Dn(c),Zt(W),vt(""))}),()=>{o=!0}},[W]);let Un=Q.trim()!==""&&L.trim()!==""&&me.trim()!==""&&Xt===W&&(at.length===0||ke!=="")?me.trim():"";H(()=>{k(W?{country:W,subdivision:ke,postcode:Un}:null)},[W,ke,Un,k]),H(()=>()=>k(null),[k]);let Ta=h?.status==="unavailable",qa=b,[it,Wn]=S(null),[Fa,$n]=S([]),[Qt,xt]=S("new"),[Yn,Bn]=S(!1),[en,_a]=S("Home"),[Ma,Hn]=S(null),[Ka,tn]=S(null),[_e,Ct]=S(()=>ft()),zn=B(null),[nn,He]=S(null),[Da,ce]=S(null),[Gn,Pt]=S(null),[Vn,ja]=S(!1),[Jn,Ua]=S(!1),[Ae,ze]=S(null),[Wa,Nt]=S(!1),[J,le]=S(null),Xn=!!J?.orderNumber,$a=Xn||ee,[Ya,Ba]=S(null),[Ha,za]=S(!1),[Ga,Va]=S(!1),[Ja,Xa]=S(!1),[Za,Qa]=S(!1),[Zn,ei]=S(!1),[ti,rn]=S(!1),[st,Qn]=S(null),A=B({...ks});A.current.unpaidOrder=J;let on=B(!1),Me=B(r),er=!!(nn||st&&st.kind!=="processing"||Zn||Vn||Jn||Gn&&Ae?.orderNumber);H(()=>{er&&(C([]),O())},[er,C,O]);let tr=B(!1);H(()=>{n||tr.current||!r.some(mt)||(tr.current=!0,Fr({lines:r,currency:a.currency,value:a.subtotal-a.discount,coupon:s?.valid?s.code:void 0}))},[r,a,s,n]),H(()=>{v(re,z.trim()||void 0)},[re,z,v]);let nr=B(null),[St,ni]=S(null);H(()=>{let o=nr.current;if(!St||!o)return;let c=()=>o.style.setProperty("--sf-checkout-header-h",`${St.offsetHeight}px`);c();let m=new ResizeObserver(c);return m.observe(St),()=>m.disconnect()},[St]),H(()=>{let o=m=>({setConfirming:m,land:He,markPaid:()=>Nt(!0),note:(w,u)=>Ba({text:w,warning:u}),fail:ce,clearCart:R,lostChange:()=>tn($t)}),c={search:window.location.search,storage:Ie,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};ht(Yo,{...c,capture:$.captureAfterpayPayment,page:o(za)}),ht(Bo,{...c,capture:$.captureZipPayment,page:o(Xa)}),ht(Ho,{...c,capture:$.completeGocardlessPayment,page:o(Va)}),ht(zo,{...c,capture:$.captureKlarnaPayment,page:o(Qa)})},[]);function rr(o){let[c,m]=ca(o.address);be(c),Re(m),oe(o.city),Oe(o.zip_code),o.country&&ot(o.country),o.phone&&rt(o.phone),Be({country:o.country||null,state:o.state??""})}H(()=>{if(kt){if((kt.country||W)!==W){Be(null);return}Xt===W&&(vt(Go(W,kt.state,at)),Be(null))}},[kt,W,Xt,at]),H(()=>{let o=!1;return(async()=>{try{let[c,m,w]=await Promise.all([Ze.me(),Ze.myProfile().catch(()=>null),Ze.myAddresses().catch(()=>[])]);if(o)return;Wn(c);let u=w.filter(_=>_.is_active);$n(u),te(c.email);let T=(m?.contact_name??"").split(/\s+/);g(c.first_name||T[0]||""),Fe(c.last_name||T.slice(1).join(" "));let F=c.phone||m?.phone;F&&rt(F);let q=u.find(_=>_.id===c.default_delivery_location)??u[0];if(q)xt(q.id),rr(q);else if(m){let[_,Xe]=ca(m.address??"");be(_),Re(Xe),oe(m.city??""),Oe(m.zip_code??""),m.country&&ot(m.country),Be({country:m.country||null,state:m.state??""})}It.current&&ur(It.current,!1)}catch{}})(),()=>{o=!0}},[]);function ri(){Ze.logout(),ct.current=!0,It.current=null,Lt.current=null,lt(),Wn(null),$n([]),xt("new"),Bn(!1),te(""),g(""),Fe(""),nt(""),be(""),Re(""),oe(""),Oe(""),rt(""),ot(P||Y[0]?.code||""),vt(""),Be(null)}let Ge=sa(()=>la(e,{canParkContext:Se}),[e,Se]);H(()=>{Ge.some(o=>o.key===j)||se(Ge[0]?.key??null)},[Ge,j]);let oi=Ge.length===0,wt=Ee.trim()?`${Q}
4
4
  ${Ee.trim()}`:Q,ai=qo({email:re,firstName:z,lastName:we,company:U.trim(),phone:ve,address:wt,city:L,subdivision:ke,postcode:me,country:W,lines:r.map(o=>[o.id,o.qty]),shippingMethodId:f,couponCode:fn(s),currency:a.currency,shopperId:it?.id??null}),ae=JSON.stringify([ai,j]),an=B(null),Et=B(!1),Le=B(!1),Ve=B(null),Rt=B(!1),fe=B(ae);fe.current=ae;let or=B(ee);or.current=ee;let Ot=B(null);H(()=>{let o=()=>{let c=Ot.current;c&&(Ot.current=null,le(c),he(!1))};return window.addEventListener("pageshow",o),()=>window.removeEventListener("pageshow",o)},[]);function At(o,c,m,w){let u={idempotencyKey:c,confirmation:m};gr()&&(u.lostChange=!0),Ie.setItem(o,JSON.stringify(u)),window.location.assign(w),Ot.current=m}async function ar(o){he(!0);try{await o()}finally{Ot.current||he(!1)}}let ir=B(!1),sr=!!(nn||st&&st.kind!=="processing");H(()=>{sr&&(ir.current=!0,lt())},[sr]);let Lt=B(null),ct=B(!1),sn=B(null);function lt(){sn.current=null,qn()}let It=B(null),[Je,ii]=S(!1);function cn(o){if(ir.current||n||ct.current)return;let c={key:o,authed:on.current,parkedAt:sn.current??=Date.now(),press:ma(xs,A.current),lines:r.length>0?r:Me.current,form:Ln({email:re,firstName:z,lastName:we,company:U,address1:Q,address2:Ee,city:L,postcode:me,phone:ve,country:W,subdivision:ke,selectedAddressId:Qt,shippingMethodId:f,couponCode:s?.valid?s.code:null})};Tn(c.press)?ra(c):lt()}let cr=B(j);cr.current=j;function ln(o){return{...na(o),...pa(),...o.payFirst?{checkoutFlow:Wt}:{}}}function si(o,c){let m=o.request.payFirst?"":null,w=o.plainPressed?null:"",u=()=>cr.current??"";return{key:o.key,send:()=>c(ln(o.request)),request:ln(o.request),lines:o.lines,shape:JSON.stringify([o.goods,null]),get method(){return m??u()},set method(T){m=T},get plainMethod(){return w??u()},set plainMethod(T){w=T},plainLines:o.plainLines,plainShape:JSON.stringify([o.plainGoods,null])}}let[ci,li]=S(!1),lr=ci?!a.quoted||a.serverSubtotal===null?"waiting":Math.abs(a.serverSubtotal-a.subtotal)<vs?"same":"changed":null,un=!J&&lr==="waiting",ui=un?{...a,repricing:!0}:a,dn=un&&a.quoteFailed;H(()=>{if(!dn)return;let o=setInterval(b,bs);return()=>clearInterval(o)},[dn,b]);let di=b;function ur(o,c=!0){te(o.email),g(o.firstName),Fe(o.lastName),nt(o.company),be(o.address1),Re(o.address2),oe(o.city),Oe(o.postcode),rt(o.phone),o.country&&ot(o.country),Be({country:o.country||null,state:o.subdivision}),xt(o.selectedAddressId),o.shippingMethodId&&p(o.shippingMethodId),c&&(Lt.current=o.couponCode)}H(()=>{let o=n?null:ia(),c=!!(o&&r.length>0);if(o&&c&&!ea(o.lines,r)&&(lt(),o=null),o){let m=o.authed?$.createOrderAuthed:$.createOrder;Ct(o.key),sn.current=o.parkedAt,on.current=o.authed;let w={lastPress:u=>u&&si(u,m),keptCardKey:u=>u,placedShape:u=>u===null?null:JSON.stringify([u,null]),placedRequest:u=>{if(!u)return null;let T=ln(u);return{body:T,send:()=>m(T)}},unpaidOrder:u=>u};A.current=ma(w,o.press),o.press.unpaidOrder&&le(o.press.unpaidOrder),o.lines.length>0&&!c&&(C(o.lines),Me.current=o.lines,li(!0)),o.form&&(It.current=o.form,ur(o.form))}ii(!0)},[]),H(()=>{!Je||r.length>0||A.current.unpaidOrder||ee||(ct.current=!0,lt())},[Je,r.length]),H(()=>{let o=Lt.current;!Je||!o||r.length===0||(Lt.current=null,V(o,re||void 0))},[Je,r.length]),H(()=>{!Je||ee||cn(_e)},[Je,ee,_e,J]);let Ke=B(null);H(()=>{or.current||(ae!==Ke.current&&(Ke.current=null),!(!Le.current||!J||J.orderNumber)&&(ae===A.current.placedShape||ae===Ke.current||ar(()=>dr(J))))},[ae,J]);async function dr(o){if(Rt.current)return null;Rt.current=!0;try{let c=Ve.current?await Lo(Ve.current):"none";if(c==="succeeded"||c==="processing")return Le.current=!1,le(null),xe("card"),c==="succeeded"?await De(void 0,o):xr(o),null;if(c===void 0||!Io.has(c))return Ke.current=fe.current,le(o),ce(c==="requires_action"?Oo:Te),null;let m=await xn(_e);if(m==="committed")return Le.current=!1,le(null),xe("card"),await De(void 0,o),null;if(m!=="released")return Ke.current=fe.current,le(o),ce(Te),null;Le.current=!1,Ve.current=null,Ke.current=null,ce(null),le(null);let w=ft();return Ct(w),w}finally{Rt.current=!1}}async function pi(){n||ee||Rt.current||await ar(mi)}async function mi(){if(J){if((Le.current?ae!==A.current.placedShape:ut())&&!J.orderNumber){let w=await dr(J);w&&fe.current===ae&&await pr(w);return}ce(null),Et.current=!1,await pn();let c=ge(fe.current)[1],m=J.orderNumber?c:"card";if(m&&da.has(m)&&ut()&&ge(fe.current)[0]!==an.current){mr(J);return}xe(m),m!==j&&se(m),await Cr(J,m,!J.orderNumber);return}await pr(_e)}async function pr(o){if(r.length===0||a.repricing||un||!j||!Ge.some(F=>F.key===j))return;let c=r.filter(mt).flatMap(F=>Tt(F.components,F.qty));if(c.length===0){ce("Pick a size on each wheel's product page before checking out.");return}ce(null);let m,w=o,u=j,T=!1;try{let F=it?$.createOrderAuthed:$.createOrder,q={customer:{email:re,name:`${z} ${we}`.trim(),phone:ve.trim()||void 0,companyName:U.trim()||void 0,address:wt,city:L,state:ke||void 0,zipCode:me,country:W},items:c,currency:a.currency,idempotencyKey:o,shippingMethodId:f??void 0,couponCode:fn(s),...pa(),...Eo(j)?{checkoutFlow:Wt}:{}};A.current.placedRequest={body:q,send:()=>F(q)},on.current=!!it,ct.current=!1,tn(null),an.current=null,Et.current=!1,Ve.current=null,Le.current=!1,Ke.current=null,A.current.placedShape=ae,Me.current=r;let _=A.current.lastPress,Xe=_?.key===q.idempotencyKey&&(_.shape!==ae&&(!!q.checkoutFlow||!!_.method||!!_.plainMethod)||!!q.checkoutFlow&&!!_.plainMethod);Xe&&(A.current.keptCardKey=q.idempotencyKey);let Sr=br(q,F),wr=Xe||!q.checkoutFlow&&A.current.keptCardKey===q.idempotencyKey,Er=!Sr&&!wr&&!q.checkoutFlow&&!!_&&!_.method;Er&&(_.plainMethod=j,_.plainLines=r,_.plainShape=ae,cn(q.idempotencyKey));let je=await(wr?yr(q,F):F(q).then(dt=>({answer:dt,request:q})).catch(dt=>(Sr?fr(dt,q.idempotencyKey):Er&&Pn(dt)&&(_.plainMethod=""),fi(dt,q,F))));if(!je)return;m=je.answer,w=je.request.idempotencyKey,u=je.method??u,xe(u),T=ut()||u!==ge(fe.current)[1],je.method&&je.method!==j&&se(je.method),m.orderNumber&&(vr(m),R()),await pn()}catch(F){let q=qr(F);q?(d(q),ce(`${q} Your order has not been placed. Place it again to continue without the code.`)):F instanceof et?ce(Te):ce(F instanceof ue?F.message:"Could not place the order. Please try again.");return}if(u&&da.has(u)&&(T||ut())){mr(m);return}await Cr(m,u,!1,w)}function mr(o){an.current=ge(fe.current)[0],ce(`${ua(o,null)} ${$t}`),le(o)}function fr(o,c){Pn(o)&&!Cn(o)&&A.current.lastPress?.key===c&&(A.current.lastPress=null)}async function fi(o,c,m){if(Yt(o))return hr(c,m);if(!Cn(o))throw o;return A.current.keptCardKey=c.idempotencyKey,yr(c,m,!0)}async function yr(o,c,m=!1){let w=await xn(o.idempotencyKey);if(w==="released")return hr(o,c);if(w!=="committed")throw new et;let u=A.current.lastPress?.key===o.idempotencyKey?A.current.lastPress:null;if(Me.current=u?.lines??r,u?.method&&!m){A.current.keptCardKey=null,A.current.placedRequest={body:u.request,send:u.send};let Xe=await u.send().catch(()=>{throw new et});return A.current.placedShape=u.shape,{answer:Xe,request:o,method:u.method}}let T={...o,checkoutFlow:Wt},F=u&&!u.method?{body:u.request,send:u.send}:{body:T,send:()=>c(T)};A.current.placedRequest=F;let q=F.send,_=await q().catch(()=>null);if(!_&&u?.plainMethod)throw new et;return _?.orderNumber&&_.status!==Ro?(A.current.keptCardKey=null,u?.plainMethod&&(Me.current=u.plainLines),u&&(A.current.placedShape=u.plainMethod?u.plainShape:u.shape),{answer:_,request:o,method:u?.plainMethod||void 0}):(u&&(A.current.placedShape=u.shape),xe("card"),await kr("",_?async()=>_:()=>Promise.reject(new Error("The order request did not answer."))),await pn(),null)}function ut(){let o=A.current.placedShape;return o!==null&&ge(o)[0]!==ge(fe.current)[0]}function xe(o){o!==ge(fe.current)[1]&&(Et.current=!0),tn(gr()?$t:null)}function gr(){return Et.current||ut()}async function hr(o,c){let m={...o,idempotencyKey:ft()};A.current.keptCardKey=null,Ct(m.idempotencyKey),A.current.placedRequest={body:m,send:()=>c(m)},br(m,c);try{return{answer:await c(m),request:m}}catch(w){throw fr(w,m.idempotencyKey),w}}function br(o,c){return A.current.lastPress?.key===o.idempotencyKey?!1:(A.current.lastPress={key:o.idempotencyKey,send:()=>c(o),request:o,lines:r,shape:ae,method:o.checkoutFlow?"":j??"",plainMethod:"",plainLines:r,plainShape:ae},ct.current=!1,cn(o.idempotencyKey),!0)}function vr(o){_r({confirmation:o,lines:Me.current,adsSendTo:e.googleAdsId&&e.googleAdsConversionLabel?`${e.googleAdsId}/${e.googleAdsConversionLabel}`:null}),$o({confirmation:o,lines:Me.current})}async function De(o,c=Ae){if(!c)return;let m=o?async()=>o:A.current.placedRequest?.send;if(c.orderNumber||!m){Nt(!0),He(c);return}await kr(c.checkoutNumber,m)}async function kr(o,c){R(),await Fo({checkoutNumber:o,resend:c,page:{setConfirming:ei,land:He,markPaid:()=>Nt(!0),track:vr,unplaced:Qn}})}function xr(o=Ae){if(o){if(o.orderNumber){He(o);return}R(),Qn({kind:"processing",checkoutNumber:o.checkoutNumber})}}async function pn(){let o=JSON.stringify([en.trim(),z,we,ve.trim(),wt,L,ke,me,W]);if(!(!it||!Yn||Qt!=="new"||zn.current===o))try{await Ze.createAddress({label:en.trim()||"Home",contact_name:`${z} ${we}`.trim(),phone:ve.trim(),address:wt,city:L,zip_code:me,state:ke,country:W}),zn.current=o,Hn("Address saved to your account.")}catch{Hn("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}}async function Cr(o,c=j,m=!1,w=_e){le(null);try{if(c==="card"&&e.paymentMethods.includes("card")){let u=await $.createPaymentIntent({idempotencyKey:w});Ve.current=u;let T=o;if(m){let F=await A.current.placedRequest?.send().catch(()=>null);if(F?.orderNumber){xe("card"),await De(F,o);return}T=Pr(o,F)??{...o,expiresAt:null}}xe("card"),ze(T),rn(!1),Pt(u)}else if(c==="paypal"&&e.paymentMethods.includes("paypal"))ze(o),ja(!0);else if(c==="afterpay"&&e.paymentMethods.includes("afterpay")){let u=window.location.origin,T=await $.createAfterpayCheckout({idempotencyKey:w,confirmUrl:`${u}/checkout?afterpay=confirm`,cancelUrl:`${u}/checkout?afterpay=cancel`});At(Nn,w,o,T.redirectCheckoutUrl);return}else if(c==="square"&&e.paymentMethods.includes("square"))ze(o),Ua(!0);else if(c==="gocardless"&&e.paymentMethods.includes("gocardless")){let u=window.location.origin,T=await $.createGocardlessBillingRequest({idempotencyKey:w,confirmUrl:`${u}/checkout?gocardless=confirm`,cancelUrl:`${u}/checkout?gocardless=cancel`});At(Sn,w,o,T.authorisationUrl);return}else if(c==="zip"&&e.paymentMethods.includes("zip")){let u=window.location.origin,T=await $.createZipCheckout({idempotencyKey:w,redirectUrl:`${u}/checkout?zip=return`});At(wn,w,o,T.redirectUrl);return}else if(c==="klarna"&&e.paymentMethods.includes("klarna")){let u=window.location.origin,T=await $.createKlarnaCheckout({idempotencyKey:w,confirmUrl:`${u}/checkout?klarna=confirm`,cancelUrl:`${u}/checkout?klarna=cancel`});At(En,w,o,T.redirectUrl);return}else xe(c),He(o)}catch(u){if((m||c==="card")&&u instanceof ue&&u.status===409){xe(c),await De(void 0,o);return}Nr(o,u)}}function Pr(o,c){return c&&!c.orderNumber&&c.status==="open"&&c.checkoutNumber===o.checkoutNumber?c:null}function Nr(o,c){ce(ua(o,c)),!o.orderNumber&&Yt(c)?(Le.current=!1,Ct(ft())):le(o)}async function yi(o){if(!Ae)return;let c=Ae;try{let m=await $.createPaymentIntent({idempotencyKey:_e}),w=await A.current.placedRequest?.send().catch(()=>null);if(w?.orderNumber){await De(w);return}let u=Pr(c,w);ze(u??{...c,expiresAt:null}),rn(o&&u!==null),Ve.current=m,Pt(m)}catch(m){if(m instanceof ue&&m.status===409){await De();return}Pt(null),ze(null),Nr(c,m)}}function gi(){Ae&&(Le.current=!0,le(Ae),Pt(null),ze(null),rn(!1))}return{site:e,logo:t,items:r,totals:ui,coupon:s,deliveryOptions:y,courierUnavailable:Ta,retryCourier:qa,shippingMethodId:f,setShippingMethodId:p,pickupLocation:E,servedCountries:Y,formatMoney:pe,payChoice:j,setPayChoice:se,placing:ee,email:re,setEmail:te,firstName:z,setFirstName:g,lastName:we,setLastName:Fe,company:U,setCompany:nt,address1:Q,setAddress1:be,address2:Ee,setAddress2:Re,city:L,setCity:oe,postcode:me,setPostcode:Oe,phone:ve,setPhone:rt,country:W,setCountry:ot,subdivision:ke,setSubdivision:vt,subdivisions:at,destination:jn,postcodeLabel:La,subdivisionLabel:Ia,me:it,savedAddresses:Fa,selectedAddressId:Qt,setSelectedAddressId:xt,saveAddress:Yn,setSaveAddress:Bn,saveLabel:en,setSaveLabel:_a,addressSaveNote:Ma,lostChangeNote:Ka,idemKey:_e,confirmation:nn,setConfirmation:He,orderError:Da,payment:Gn,paypalStep:Vn,squareStep:Jn,pendingConf:Ae,paid:Wa,setPaid:Nt,unpaidOrder:J,orderLocked:Xn,formLocked:$a,restoredPrices:lr,quoteFailed:dn,retryQuote:di,payNote:Ya,afterpayConfirming:Ha,gocardlessConfirming:Ga,zipConfirming:Ja,klarnaConfirming:Za,cardConfirming:Zn,checkoutResult:st,confirmCardPayment:De,cardStillProcessing:xr,renewCardPayment:yi,holdRenewed:ti,leaveCardPayment:gi,checkoutRootRef:nr,setCheckoutHeaderEl:ni,fillFromAddress:rr,checkoutSignOut:ri,payOptions:Ge,noPaymentMethod:oi,placeOrder:pi}}var ha=gs(null);function ba({children:e,...t}){let n=Cs(t);return Ce(ha.Provider,{value:n,children:e})}function Pe(){let e=hs(ha);if(!e)throw new Error("useCheckout must be used inside CheckoutStateProvider");return e}import{useId as Fn}from"react";import{Fragment as Ne,jsx as i,jsxs as N}from"react/jsx-runtime";function xa(){let{email:e,setEmail:t,firstName:n,setFirstName:r,lastName:a,setLastName:s,company:d,setCompany:y,me:f,checkoutSignOut:p,orderLocked:k,unpaidOrder:h}=Pe(),b=Fn();return N(Vt,{num:"N\xB0 01",title:"Contact",children:[k&&h&&i(Ns,{orderNumber:h.orderNumber}),i(ie,{label:"Email",htmlFor:b,hint:f?N(Ne,{children:["Signed in \xB7"," ",i("button",{type:"button",onClick:p,className:"underline transition-colors enabled:hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:i("input",{id:b,type:"email",value:e,onChange:v=>t(v.target.value),placeholder:"you@example.com",readOnly:f!==null,className:ne})}),N(wa,{children:[i(ie,{label:"First name",children:i("input",{type:"text",value:n,onChange:v=>r(v.target.value),className:ne})}),i(ie,{label:"Last name",children:i("input",{type:"text",value:a,onChange:v=>s(v.target.value),className:ne})})]}),i(ie,{label:"Company (optional)",children:i("input",{type:"text",value:d,onChange:v=>y(v.target.value),autoComplete:"organization",className:ne})})]})}function Ca(){let{pickupLocation:e,servedCountries:t,address1:n,setAddress1:r,address2:a,setAddress2:s,city:d,setCity:y,postcode:f,setPostcode:p,phone:k,setPhone:h,country:b,setCountry:v,subdivision:R,setSubdivision:C,subdivisions:O,destination:V,postcodeLabel:E,subdivisionLabel:P,me:Y,savedAddresses:Z,selectedAddressId:pe,setSelectedAddressId:j,saveAddress:se,setSaveAddress:Se,saveLabel:qe,setSaveLabel:ee,fillFromAddress:he,orderLocked:re}=Pe(),te=Fn(),z=Fn();return N(Vt,{num:"N\xB0 02",title:e?"Collection":"Shipping address",children:[e?N("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[i("span",{className:"font-medium",children:e.name}),[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).length>0&&i("span",{className:"opacity-80",children:[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).join(", ")}),e.openingHours&&i("span",{className:"opacity-80",children:e.openingHours}),e.readyIn&&i("span",{className:"opacity-80",children:e.readyIn}),e.instructions&&i("span",{className:"opacity-80",children:e.instructions}),i("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):N(Ne,{children:[Y!==null&&Z.length>0&&N("div",{className:"grid gap-3",children:[Z.map(g=>i(zt,{active:pe===g.id,onClick:()=>{j(g.id),he(g)},title:g.label,body:g.formatted_address,price:null},g.id)),i(zt,{active:pe==="new",onClick:()=>j("new"),title:"New address",body:null,price:null})]}),i(ie,{label:"Address line 1",children:i("input",{type:"text",value:n,onChange:g=>r(g.target.value),className:ne})}),i(ie,{label:"Address line 2",children:i("input",{type:"text",value:a,onChange:g=>s(g.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:ne})}),N(wa,{cols:"three",children:[i(ie,{label:"City",children:i("input",{type:"text",value:d,onChange:g=>y(g.target.value),className:ne})}),i(ie,{label:E,children:i("input",{type:"text",value:f,onChange:g=>p(g.target.value),className:ne})}),i(ie,{label:"Country",separate:!0,htmlFor:te,children:i(gn,{id:te,value:b,onChange:g=>v(g.target.value),className:ne+" pr-10",style:va,children:t.map(g=>i("option",{value:g.code,children:g.name},g.code))})})]}),i(ie,{label:P,separate:!0,htmlFor:z,children:O.length>0?N(gn,{id:z,value:R,onChange:g=>C(g.target.value),className:ne+" pr-10",style:va,children:[i("option",{value:"",children:"Select\u2026"}),O.map(g=>i("option",{value:g.code||g.name,children:g.name},g.code||g.name))]}):i("input",{id:z,type:"text",value:R,onChange:g=>C(g.target.value),className:ne})})]}),i(ie,{label:"Phone",children:i("input",{type:"tel",value:k,onChange:g=>h(g.target.value),className:ne})}),!e&&Y!==null&&pe==="new"&&!re&&N(Ne,{children:[i(Ss,{checked:se,onChange:Se,label:"Save this address to my account"}),se&&i(ie,{label:"Address label",children:i("input",{type:"text",value:qe,onChange:g=>ee(g.target.value),placeholder:"Home",className:ne})})]})]})}function Pa(){let{totals:e,coupon:t,deliveryOptions:n,shippingMethodId:r,setShippingMethodId:a,pickupLocation:s,formatMoney:d,city:y,destination:f,courierUnavailable:p,retryCourier:k}=Pe();return i(Vt,{num:"N\xB0 03",title:"Shipping",children:N("div",{className:"grid gap-3",children:[n.map(h=>{let b=h.pickupLocation,v=b?[b.address,b.city,b.state,b.zipCode].filter(Boolean).join(", "):null;return i(zt,{active:r===h.id,onClick:()=>a(h.id),title:b?`${h.name} \u2014 ${b.name}`:h.name,body:b?[v,b.openingHours,b.readyIn,b.instructions,h.description].filter(Boolean).join(" \xB7 "):h.description||null,price:e.freeShipping||h.amount===0?qt:d(h.amount,e.currency),tag:h.tag||void 0},h.id)}),p?N("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ya," ",i("button",{type:"button",onClick:k,className:"underline transition-colors enabled:hover:text-accent",children:"Try again"})]}):n.length===0&&i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Na(){let{payChoice:e,setPayChoice:t,payment:n,payOptions:r,noPaymentMethod:a}=Pe();return N(Vt,{num:"N\xB0 04",title:"Payment",children:[a&&i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:fa}),i("div",{className:"grid gap-3",children:r.map(s=>i(zt,{active:e===s.key,onClick:()=>t(s.key),title:s.title,body:s.body,price:s.price,tag:s.tag},s.key))}),e==="card"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="paypal"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):e==="afterpay"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):e==="square"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="gocardless"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):e==="zip"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):e==="klarna"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):e==="bank"?i("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."}):null]})}function Sa(){let{site:e,items:t,totals:n,coupon:r,formatMoney:a,payChoice:s,placing:d,email:y,orderError:f,payment:p,noPaymentMethod:k,unpaidOrder:h,formLocked:b,restoredPrices:v,quoteFailed:R,retryQuote:C,placeOrder:O}=Pe(),V=v==="waiting",E=v==="changed";return N("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-view-desktop:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[N("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[i("span",{children:"Your order"}),i(bt,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),i("div",{className:"flex flex-col px-6 py-2",children:t.length===0?N("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",i(bt,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):t.map(P=>i(ws,{slug:P.slug,name:P.name,qty:P.qty,config:P.config,configSummary:Es(P.config),price:E||V?null:jr(P,n.currency)??0,currency:n.currency},P.id))}),i(Gt,{locked:b,className:"border-t border-line px-6 pt-5",children:i(Br,{customerEmail:y,disabled:b})}),N("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[i($e,{label:"Subtotal",value:V?Ft:a(E?n.serverSubtotal??0:n.subtotal,n.currency)}),n.discount>0&&r?.valid&&i($e,{label:`Coupon \xB7 ${r.code}`,value:N("span",{className:"font-semibold text-green",children:["\u2212 ",a(n.discount,n.currency)]})}),r?.deferred&&i($e,{label:`Coupon \xB7 ${r.code}`,value:Tr}),r?.valid&&r.effects?.gift&&i($e,{label:`Free gift \xB7 ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` \xD7${r.effects.gift.quantity}`:""}`,value:i("span",{className:"font-semibold text-green",children:qt})}),i($e,{label:"Shipping",value:n.shippingStatus==="free"?i("span",{className:"font-semibold text-green",children:qt}):Kr(n.shippingStatus)??a(n.shipping,n.currency)}),n.tax&&(n.tax.charged?i($e,{label:n.tax.inclusive?`${n.tax.name} included \xB7 ${n.tax.rate}%`:n.tax.name,value:a(n.tax.amount,n.currency)}):n.tax.name?i($e,{label:n.tax.name,value:Mr}):null)]}),N("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[i("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),i("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?Ft:a(n.grand,n.currency)})]}),N("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[E&&i(de,{tone:"quiet",children:Xo}),R&&N(de,{role:"alert",children:[Zo," ",i("button",{type:"button",onClick:C,className:"underline transition-colors enabled:hover:text-accent",children:"Try again"})]}),f&&i(de,{role:"alert",children:f}),n.hasUnpricedLine&&N(de,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),i("button",{type:"button",onClick:O,disabled:d||!h&&(k||t.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all max-[640px]:whitespace-nowrap max-[640px]:tracking-[0.04em]",d||!h&&(t.length===0||k||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:d?N(Ne,{children:["Building order\u2026 ",i("span",{children:"\xB7"})]}):k?N(Ne,{children:["No online payment ",i("span",{children:"\xB7"})]}):h?N(Ne,{children:[N("span",{children:["Try payment again",N(ka,{children:[" \xB7 ",Bt(h)]})]}),i("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]}):R?N(Ne,{children:["Total not confirmed ",i("span",{children:"\xB7"})]}):n.repricing?N(Ne,{children:[Ft," ",i("span",{children:"\xB7"})]}):N(Ne,{children:[N("span",{children:[s==="bank"?"Place order":"Continue to payment",N(ka,{children:[" \xB7 ",a(n.grand,n.currency)]})]}),i("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})}var Ps=" [&:disabled_:disabled]:cursor-not-allowed! [&:disabled_:disabled]:opacity-70! [&_input[readonly]]:cursor-not-allowed [&_input[readonly]]:opacity-70";function Gt({locked:e,className:t="",children:n}){return i("fieldset",{disabled:e,className:"m-0 min-w-0 border-0 p-0 "+t+Ps,children:n})}function bt({href:e,className:t="",children:n,...r}){let{placing:a}=Pe();return a?i("span",{"aria-disabled":"true","aria-label":r["aria-label"],className:t+" pointer-events-none",children:n}):i(Ue,{href:e,"aria-label":r["aria-label"],className:t,children:n})}function Ns({orderNumber:e}){return i(de,{tone:"quiet",role:"status",children:N("span",{className:"flex items-start gap-2",children:[N("svg",{"aria-hidden":!0,viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mt-[3px] shrink-0",children:[i("rect",{x:"3",y:"7",width:"10",height:"7",rx:"1"}),i("path",{d:"M5 7V5a3 3 0 0 1 6 0v2"})]}),i("span",{children:ga(e)})]})})}var va={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function Vt({num:e,title:t,children:n}){return N("section",{className:"mb-6 border border-line bg-bg",children:[N("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[i("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e}),i("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:t})]}),i("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function wa({cols:e="two",children:t}){return i("div",{className:["grid gap-3 max-[640px]:grid-cols-1",e==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:t})}function zt({active:e,onClick:t,title:n,body:r,price:a,tag:s}){return N("button",{type:"button",onClick:t,"aria-pressed":e,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",e?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line enabled:hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[e&&i("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),i("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",e?"border-accent":"border-fg-dim"].join(" "),children:e&&i("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),N("span",{className:"flex min-w-0 flex-col gap-1",children:[N("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&i("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:s})]}),r&&i("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),i("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function Ss({checked:e,onChange:t,label:n,sub:r}){return N("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[i("button",{type:"button",onClick:()=>t(!e),"aria-pressed":e,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",e?"border-accent":"border-line"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:e&&i("span",{className:"text-[13px] text-accent",children:"\u2713"})}),N("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,r&&i("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:r})]})]})}function ws({slug:e,name:t,qty:n,config:r,configSummary:a,price:s,currency:d}){let{catalog:y}=_t(),{formatMoney:f}=ye(),p=y.find(C=>C.slug===e),k=p?.spokes??5,h=p?.mesh??!1,b=r.find(C=>C.gold)?.label,v=p?.finishes.find(C=>C.name===b&&C.src)??p?.finishes.find(C=>C.src),R=p?.finishes[0]?.color??Yr;return N("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[N("div",{className:"relative aspect-square",children:[i("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:v?.src?i(Rr,{src:v.src,alt:`${t.lead}${t.accent} \u2014 ${v.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):i("div",{className:"block w-[78%]",style:{color:R},children:i($r,{spokes:k,mesh:h,className:"block w-full"})})}),i("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n})]}),N("div",{className:"flex min-w-0 flex-col gap-0.5",children:[N("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[t.lead,i("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:t.accent})]}),i("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),i("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:s===null?null:f(s,d)})]})}function ka({children:e}){return i("span",{className:"max-[640px]:sr-only",children:e})}function $e({label:e,value:t}){return N("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[i("span",{children:e}),i("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:t})]})}function Es(e){return e.map(t=>t.label).join(" \xB7 ")}import{Fragment as G,jsx as l,jsxs as x}from"react/jsx-runtime";function Kn(e){return l(ba,{...e,children:l(Is,{})})}function As({order:e,paid:t}){let{formatMoney:n}=ye();if(!e.grandTotal||!e.currency)return null;let r=d=>n(Number(d),e.currency),a=Number(e.freightCharge??0),s=Number(e.discountAmount??0);return x("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(e.shippingMethod||a>0)&&x(G,{children:[x("dt",{className:"text-fg-dim",children:["Delivery",e.shippingMethod?` \xB7 ${e.shippingMethod}`:""]}),l("dd",{className:"text-right font-mono",children:r(e.freightCharge??"0")})]}),s>0&&x(G,{children:[x("dt",{className:"text-fg-dim",children:["Discount",e.couponCode?` \xB7 ${e.couponCode}`:""]}),x("dd",{className:"text-right font-mono",children:["\u2212",r(e.discountAmount??"0")]})]}),l("dt",{className:"text-fg",children:t?"Total paid":"Order total"}),l("dd",{className:"text-right font-mono text-fg",children:r(e.grandTotal)})]})}function Ls({result:e,lostChangeNote:t=null}){let n=l("span",{className:"font-mono text-fg",children:e.checkoutNumber});return x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:e.kind==="refunded"||e.kind==="expired"?"Order not placed":e.kind==="processing"?"Payment processing":"Payment received"}),l("p",{className:"text-fg-dim",children:e.kind==="refunded"?x(G,{children:["An item sold out or an offer ended while you paid for checkout ",n,". Your payment goes back to your card."]}):e.kind==="expired"?x(G,{children:["The hold on checkout ",n," ran out before your payment arrived. Your payment goes back to your card."]}):e.kind==="processing"?x(G,{children:["Your payment for checkout ",n," is being processed. When it goes through, we will email your order confirmation."]}):x(G,{children:["Thank you \u2014 your payment",e.checkoutNumber?x(G,{children:[" for checkout ",n]}):null," has gone through. We will email you the order number shortly."]})}),t&&e.kind!=="refunded"&&e.kind!=="expired"&&l("p",{className:"text-sm text-fg-dim",children:t}),l(Ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]})}function Is(){let{site:e,logo:t,items:n,placing:r,formLocked:a,email:s,me:d,addressSaveNote:y,lostChangeNote:f,idemKey:p,confirmation:k,setConfirmation:h,payment:b,paypalStep:v,squareStep:R,pendingConf:C,paid:O,setPaid:V,payNote:E,afterpayConfirming:P,gocardlessConfirming:Y,zipConfirming:Z,klarnaConfirming:pe,cardConfirming:j,checkoutResult:se,confirmCardPayment:Se,cardStillProcessing:qe,renewCardPayment:ee,holdRenewed:he,leaveCardPayment:re,checkoutRootRef:te,setCheckoutHeaderEl:z}=Pe();return k?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:O?"Payment received":"Order received"}),x("p",{className:"text-fg-dim",children:[O?x(G,{children:["Thank you \u2014 your payment for order"," ",l("span",{className:"font-mono text-fg",children:k.orderNumber})," has gone through."," "]}):x(G,{children:["Thank you \u2014 your order ",l("span",{className:"font-mono text-fg",children:k.orderNumber})," is being reviewed by our team."," "]}),d?x(G,{children:["Track it under"," ",l(Ue,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):l(G,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),l(As,{order:k,paid:O}),f&&l("p",{className:"text-sm text-fg-dim",children:f}),E&&(E.warning?l("div",{className:"w-full max-w-sm text-left",children:l(de,{tone:"bad",role:"alert",children:E.text})}):l("p",{className:"text-sm text-fg-dim",children:E.text})),y&&l("p",{className:"text-sm text-fg-dim",children:y}),!d&&x("p",{className:"text-sm text-fg-dim",children:["You can also"," ",l(Ue,{href:`/track?order=${encodeURIComponent(k.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),l(Ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):se?l(Ls,{result:se,lostChangeNote:f}):j?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order \u2014 one moment."})]}):P?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Y?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Z?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):pe?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[l("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):b&&C?l(Ts,{payment:b,checkout:C,holdRenewed:he,onPaid:Se,onProcessing:qe,onRenew:ee,onBack:re}):v&&C?l(Ms,{confirmation:C,clientId:e.paypalClientId??"",idemKey:p,onPaid:()=>{V(!0),h(C)},onSkip:()=>h(C)}):R&&C?l(js,{confirmation:C,applicationId:e.squareApplicationId??"",locationId:e.squareLocationId??"",environment:e.squareEnvironment??"production",idemKey:p,onPaid:()=>{V(!0),h(C)},onSkip:()=>h(C)}):x("div",{ref:te,className:"bg-bg text-fg",children:[x("header",{ref:z,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 max-[640px]:grid-cols-[auto_minmax(0,1fr)_auto] max-[640px]:gap-3 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[x(bt,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[14px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",l("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),l("div",{className:"flex min-w-0 justify-center max-[640px]:[container-type:inline-size]",children:l(bt,{href:"/","aria-label":`${e.name} home`,className:"inline-flex max-w-full items-center justify-center max-[640px]:overflow-x-clip",children:[!0,!1].map(g=>l(zr,{hideClass:g?"min-[641px]:hidden":"max-[640px]:hidden",variant:"header",scrolled:!0,src:t?.url??null,reverse:t?.reverse??!1,reversedSrc:t?.reversed??null,inkIsDark:t?.inkIsDark??null,size:t?.size??"medium",sizePx:t?.sizePx??null,sizeUnit:t?.sizeUnit??null,siteName:e.name,fitWordmarkToContainer:g,fitFloorPx:g?Hr:void 0},g?"phone":"wide"))})}),e.cardPayments?x("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[l("span",{className:"text-green",children:"\u25CF"}),l("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):l("span",{})]}),x("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]",children:[l("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),l("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(g=>x("span",{className:["relative flex items-center gap-2 transition-colors",g.state==="pending"?"text-fg-dim":"text-fg",g.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[l("span",{className:g.state==="done"?"text-accent font-bold":"",children:g.n}),l("span",{children:g.label})]},g.n))})]}),x("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-view-desktop:grid-cols-1 max-view-desktop:gap-10 max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))] max-view-desktop:pt-8 max-view-desktop:pb-20",children:[x("div",{children:[x(Gt,{locked:a,children:[l(xa,{}),l(Ca,{}),l(Pa,{})]}),l(Gt,{locked:r,children:l(Na,{})})]}),l(Sa,{})]}),l("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:l("span",{children:Wr({legalName:e.legalName,foundedYear:e.foundedYear,siteName:e.name})})})]})}function Ts({payment:e,checkout:t,holdRenewed:n,onPaid:r,onProcessing:a,onRenew:s,onBack:d}){let{formatMoney:y}=ye(),f=l("span",{className:"text-fg",children:y(Number(e.amount),e.currency)}),p=Ea(()=>Ut(e.publishableKey),[e.publishableKey]),k=Ea(()=>Jr(),[]),h=Vr(t.expiresAt??"",Rs()??"");return l("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[l("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:Bt(t)}),l("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[l("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:t.orderNumber?x(G,{children:["Your order is placed. Pay ",f," by card to confirm it now."]}):n?x(G,{children:["Your hold ran out, so your items are held again",h?` until ${h}`:"",". Enter your card again, then pay ",f,"."]}):x(G,{children:["Your items are held",h?` until ${h}`:"",". Pay ",f," by card to place your order."]})}),l(kn,{stripe:p,options:{clientSecret:e.clientSecret,appearance:k},children:l(Fs,{payment:e,checkout:t,onPaid:r,onProcessing:a,onRenew:s,onBack:d})},e.clientSecret)]})]})})}var qs=5;function Fs({payment:e,checkout:t,onPaid:n,onProcessing:r,onRenew:a,onBack:s}){let{formatMoney:d}=ye(),y=vo(),f=ho(),[p,k]=Ye(!1),[h,b]=Ye(null),v=tt(!1);async function R(){try{return(await y.retrievePaymentIntent(e.clientSecret)).paymentIntent?.status}catch{return}}async function C(E){let P=E;for(let Y=0;P==="processing"&&Y<qs;Y+=1)await new Promise(Z=>setTimeout(Z,1e3)),P=await R()??P;if(P==="succeeded"){n();return}if(P==="processing"){r();return}b("Payment did not complete. Please try again."),k(!1)}async function O(){if(!y||!f||p)return;k(!0),b(null),v.current=!0;let E=await y.confirmPayment({elements:f,redirect:"if_required"}).catch(()=>null);if(!E){let P=await R();if(P==="succeeded"||P==="processing"){await C(P);return}b(P===void 0?Te:"Payment failed. Please try again."),k(!1);return}if(E.error){if(!t.orderNumber&&E.error.code==="payment_intent_unexpected_state"){let P=await R();if(P==="succeeded"||P==="processing"){await C(P);return}if(P===void 0){b(Te),k(!1);return}await a(P==="canceled"),k(!1);return}b(E.error.message??"Payment failed. Please try again."),k(!1);return}await C(E.paymentIntent?.status)}async function V(){if(p)return;if(!v.current){s();return}k(!0),b(null);let E=await R();if(E==="succeeded"||E==="processing"){await C(E);return}if(k(!1),E===void 0){b(Te);return}s()}return x("div",{className:"flex flex-col gap-4",children:[l(ko,{}),h&&l(de,{role:"alert",children:h}),l("button",{type:"button",onClick:O,disabled:!y||!f||p,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!y||!f||p?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:p?x(G,{children:["Processing\u2026 ",l("span",{children:"\xB7"})]}):x(G,{children:["Pay ",d(Number(e.amount),e.currency),l("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),!t.orderNumber&&!p&&x("button",{type:"button",onClick:V,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",l("span",{children:"Back to checkout"})]})]})}var Ra="paypal-sdk-js",_n=null;function _s(e,t){let n=`${e}|${t}`;if(_n?.key===n)return _n.promise;let r=new Promise((a,s)=>{document.getElementById(Ra)?.remove();let d=document.createElement("script");d.id=Ra;let y=new URLSearchParams({"client-id":e,currency:t,intent:"capture"});d.src=`https://www.paypal.com/sdk/js?${y}`,d.onload=()=>{let f=window.paypal;f?a(f):s(new Error("PayPal SDK loaded without its namespace"))},d.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(d)});return _n={key:n,promise:r},r}function Ms({confirmation:e,clientId:t,idemKey:n,onPaid:r,onSkip:a}){let{formatMoney:s}=ye(),d=tt(null),[y,f]=Ye(!1),[p,k]=Ye(null),h=tt(r);return h.current=r,Aa(()=>{let b=!1,v=null;return _s(t,e.currency).then(R=>{if(!(b||!d.current))return v=R.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await $.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async C=>{try{if((await $.capturePaypalOrder({idempotencyKey:n,paypalOrderId:C.orderID})).status==="paid"){h.current();return}k("PayPal did not complete the payment. Please try again.")}catch(O){k(O instanceof ue?O.message:"PayPal payment failed. Please try again.")}},onError:()=>{k("PayPal could not process the payment. Please try again.")}}),v.render(d.current).then(()=>{b||f(!0)})}).catch(()=>{b||k("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{b=!0,v?.close?.()}},[t,e.currency,n]),l("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[l("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),l("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[x("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",l("span",{className:"text-fg",children:s(Number(e.grandTotal),e.currency)})," ","with PayPal to confirm it now."]}),!y&&!p&&l("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),l("div",{ref:d}),p&&l(de,{role:"alert",children:p}),l("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}var Oa="square-web-sdk",Mn=null,Ks=["sandbox","production"];function Ds(e){let t=Os(Ks,"production",e);if(Mn?.key===t)return Mn.promise;let n=new Promise((r,a)=>{document.getElementById(Oa)?.remove();let s=document.createElement("script");s.id=Oa,s.src=t==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let d=window.Square;d?r(d):a(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(s)});return Mn={key:t,promise:n},n}function js({confirmation:e,applicationId:t,locationId:n,environment:r,idemKey:a,onPaid:s,onSkip:d}){let{formatMoney:y}=ye(),f=tt(null),p=tt(null),k=tt(null),[h,b]=Ye(!1),[v,R]=Ye(!1),[C,O]=Ye(null);Aa(()=>{let E=!1,P=null;return Ds(r).then(async Y=>{if(E||!f.current)return;let Z=Y.payments(t,n);k.current=Z,P=await Z.card(),await P.attach(f.current),p.current=P,E||b(!0)}).catch(()=>{E||O("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{E=!0,P?.destroy?.()}},[t,n,r]);async function V(){let E=p.current;if(!(!E||v)){R(!0),O(null);try{let P=await E.tokenize();if(P.status!=="OK"||!P.token){O(P.errors?.[0]?.message??"Please check the card details and try again."),R(!1);return}let Y;try{Y=(await k.current?.verifyBuyer?.(P.token,{amount:String(e.grandTotal),currencyCode:e.currency,intent:"CHARGE"}))?.token}catch{}if((await $.chargeSquare({idempotencyKey:a,sourceId:P.token,...Y?{verificationToken:Y}:{}})).status==="paid"){s();return}O("Square did not complete the payment. Please try again.")}catch(P){O(P instanceof ue?P.message:"Square payment failed. Please try again.")}R(!1)}}return l("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[l("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),l("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[x("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",l("span",{className:"text-fg",children:y(Number(e.grandTotal),e.currency)})," ","by card to confirm it now."]}),!h&&!C&&l("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),l("div",{ref:f}),C&&l(de,{role:"alert",children:C}),l("button",{type:"button",onClick:V,disabled:!h||v,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!h||v?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:v?x(G,{children:["Processing\u2026 ",l("span",{children:"\xB7"})]}):x(G,{children:["Pay ",y(Number(e.grandTotal),e.currency),l("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),l("button",{type:"button",onClick:d,disabled:v,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}import{jsx as Jt}from"react/jsx-runtime";function Us(){let{settings:e,websiteName:t}=Or(),n=t?{...yn,name:t}:yn,r=e?{url:e.logoUrl,reversed:e.logoReversed??null,inkIsDark:e.logoInkIsDark??null,reverse:e.reverseLogo,size:e.logoSize,sizePx:e.logoSizePx,sizeUnit:e.logoSizeUnit??null}:null;return Jt("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:Jt(Dr,{children:Jt(Ur,{preview:!0,children:Jt(Kn,{site:n,logo:r,preview:!0})})})})}export{Us as default};
@@ -0,0 +1 @@
1
+ "use client";import{Sh as r}from"./chunk-SPLS5ZLA.js";import"./chunk-ICWPUDN3.js";import"./chunk-SRHU2S3G.js";import"./chunk-RCOLM57Z.js";import"./chunk-Y7DFVCVM.js";import"./chunk-R3WKYZOZ.js";import"./chunk-RJM55KDO.js";import"./chunk-3DDOV7FZ.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
@@ -1,4 +1,4 @@
1
- import{f as fs,g as hs}from"./chunk-COR5IL6E.js";import{a as T,b as Sr}from"./chunk-Y6SLVHK3.js";var Sn=T((ud,Ds)=>{"use strict";function Iu(i,e){this.v=i,this.k=e}function ps(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function Lu(i){if(Array.isArray(i))return i}function Du(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,s,o,l=[],a=!0,h=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(r=s.call(t)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(f){h=!0,n=f}finally{try{if(!a&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(h)throw n}}return l}}function Ru(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{f as fs,g as hs}from"./chunk-Y7DFVCVM.js";import{a as T,b as Sr}from"./chunk-Y6SLVHK3.js";var Sn=T((ud,Ds)=>{"use strict";function Iu(i,e){this.v=i,this.k=e}function ps(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=Array(e);t<e;t++)r[t]=i[t];return r}function Lu(i){if(Array.isArray(i))return i}function Du(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,s,o,l=[],a=!0,h=!1;try{if(s=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(r=s.call(t)).done)&&(l.push(r.value),l.length!==e);a=!0);}catch(f){h=!0,n=f}finally{try{if(!a&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(h)throw n}}return l}}function Ru(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nu(i,e){return Lu(i)||Du(i,e)||ku(i,e)||Ru()}function ku(i,e){if(i){if(typeof i=="string")return ps(i,e);var t={}.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ps(i,e):void 0}}function br(i){var e,t;function r(s,o){try{var l=i[s](o),a=l.value,h=a instanceof Iu;Promise.resolve(h?a.v:a).then(function(f){if(h){var _=s==="return"&&a.k?s:"next";if(!a.k||f.done)return r(_,f);f=i[_](f).value}n(!!l.done,f)},function(f){r("throw",f)})}catch(f){n(2,f)}}function n(s,o){s===2?e.reject(o):e.resolve({value:o,done:s}),(e=e.next)?r(e.key,e.arg):t=null}this._invoke=function(s,o){return new Promise(function(l,a){var h={key:s,arg:o,resolve:l,reject:a,next:null};t?t=t.next=h:(e=t=h,r(s,o))})},typeof i.return!="function"&&(this.return=void 0)}br.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},br.prototype.next=function(i){return this._invoke("next",i)},br.prototype.throw=function(i){return this._invoke("throw",i)},br.prototype.return=function(i){return this._invoke("return",i)};var xs=Object.entries,ds=Object.setPrototypeOf,Mu=Object.isFrozen,Fu=Object.getPrototypeOf,qu=Object.getOwnPropertyDescriptor,J=Object.freeze,re=Object.seal,vt=Object.create,Cs=typeof Reflect<"u"&&Reflect,vn=Cs.apply,wn=Cs.construct;J||(J=function(e){return e});re||(re=function(e){return e});vn||(vn=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];return e.apply(t,n)});wn||(wn=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return new e(...r)});var Ge=X(Array.prototype.forEach);Array.prototype.indexOf;var ju=X(Array.prototype.lastIndexOf),ms=X(Array.prototype.pop),kt=X(Array.prototype.push);Array.prototype.slice;var Uu=X(Array.prototype.splice),wt=Array.isArray,qt=X(String.prototype.toLowerCase),pn=X(String.prototype.toString),gs=X(String.prototype.match),Mt=X(String.prototype.replace),ys=X(String.prototype.indexOf),Bu=X(String.prototype.trim),zu=X(Number.prototype.toString),Wu=X(Boolean.prototype.toString),_s=typeof BigInt>"u"?null:X(BigInt.prototype.toString),vs=typeof Symbol>"u"?null:X(Symbol.prototype.toString),ue=X(Object.prototype.hasOwnProperty),Ft=X(Object.prototype.toString),oe=X(RegExp.prototype.test),ke=Hu(TypeError);function X(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vn(i,e,r)}}function Hu(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return wn(i,t)}}function D(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qt;if(ds&&ds(i,null),!wt(e))return i;let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(Mu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Gu(i){for(let e=0;e<i.length;e++)ue(i,e)||(i[e]=null);return i}function he(i){let e=vt(null);for(let r of xs(i)){var t=Nu(r,2);let n=t[0],s=t[1];ue(i,n)&&(wt(s)?e[n]=Gu(s):s&&typeof s=="object"&&s.constructor===Object?e[n]=he(s):e[n]=s)}return e}function Yu(i){switch(typeof i){case"string":return i;case"number":return zu(i);case"boolean":return Wu(i);case"bigint":return _s?_s(i):"0";case"symbol":return vs?vs(i):"Symbol()";case"undefined":return Ft(i);case"function":case"object":{if(i===null)return Ft(i);let e=i,t=me(e,"toString");if(typeof t=="function"){let r=t(e);return typeof r=="string"?r:Ft(r)}return Ft(i)}default:return Ft(i)}}function me(i,e){for(;i!==null;){let r=qu(i,e);if(r){if(r.get)return X(r.get);if(typeof r.value=="function")return X(r.value)}i=Fu(i)}function t(){return null}return t}function $u(i){try{return oe(i,""),!0}catch{return!1}}var ws=J(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),dn=J(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mn=J(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Vu=J(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gn=J(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Qu=J(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ss=J(["#text"]),bs=J(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),yn=J(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ts=J(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Tr=J(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Xu=re(/{{[\w\W]*|^[\w\W]*}}/g),Ku=re(/<%[\w\W]*|^[\w\W]*%>/g),Ju=re(/\${[\w\W]*/g),Zu=re(/^data-[\-\w.\u00B7-\uFFFF]+$/),el=re(/^aria-[\-\w]+$/),Es=re(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tl=re(/^(?:\w+script|data):/i),rl=re(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nl=re(/^html$/i),il=re(/^[a-z][.\w]*(-[.\w]+)+$/i),Os=re(/<[/\w!]/g),As=re(/<[/\w]/g),sl=re(/<\/no(script|embed|frames)/i),ol=re(/\/>/i),fe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Is=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],al=J(D({},Is)),ul=(function(){let i={};return Ge(Is,e=>{i[e]=re(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),J(i)})(),ll=function(){return typeof window>"u"?null:window},cl=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Ps=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Me=function(e,t,r,n){return ue(e,t)&&wt(e[t])?D(n.base?he(n.base):{},e[t],n.transform):r},_n=function(e,t,r){let n=ue(e,t)?e[t]:void 0;return n&&typeof n=="object"?he(n):r()};function Ls(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ll(),e=y=>Ls(y);if(e.version="3.4.16",e.removed=[],!i||!i.document||i.document.nodeType!==fe.document||!i.Element)return e.isSupported=!1,e;let t=i.document,r=t,n=r.currentScript;i.DocumentFragment;let s=i.HTMLTemplateElement,o=i.Node,l=i.Element,a=i.NodeFilter;i.NamedNodeMap===void 0&&(i.NamedNodeMap||i.MozNamedAttrMap),i.HTMLFormElement;let h=i.DOMParser,f=i.trustedTypes,_=l.prototype,p=me(_,"cloneNode"),d=me(_,"remove"),v=me(_,"removeAttributeNode"),x=me(_,"nextSibling"),E=me(_,"childNodes"),U=me(_,"parentNode"),Y=me(_,"shadowRoot"),K=me(_,"attributes"),k=o&&o.prototype?me(o.prototype,"nodeType"):null,V=o&&o.prototype?me(o.prototype,"nodeName"):null,Q=o&&o.prototype?me(o.prototype,"ownerDocument"):null,ee=function(u){return k?k(u):u.nodeType},Se=function(u){return V?V(u):u.nodeName};if(typeof s=="function"){let y=t.createElement("template");y.content&&y.content.ownerDocument&&(t=y.content.ownerDocument)}let te,pe="",Lt,ar=!1,Be=0,Ni=function(){if(Be>0)throw ke('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ct=function(u){Ni(),Be++;try{return te.createHTML(u)}finally{Be--}},ru=function(u){Ni(),Be++;try{return te.createScriptURL(u)}finally{Be--}},nu=function(){return ar||(Lt=cl(f,n),ar=!0),Lt},ur=t,Xr=ur.implementation,ki=ur.createNodeIterator,iu=ur.createDocumentFragment,su=ur.getElementsByTagName,ou=r.importNode,B=Ps();e.isSupported=typeof xs=="function"&&typeof U=="function"&&Xr&&Xr.createHTMLDocument!==void 0;let au=Xu,uu=Ku,lu=Ju,cu=Zu,fu=el,hu=tl,Mi=rl,pu=il,Fi=Es,z=null,Kr=D({},[...ws,...dn,...mn,...gn,...Ss]),W=null,Jr=D({},[...bs,...yn,...Ts,...Tr]),be=Object.seal(vt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Dt=null,qi=null,De=Object.seal(vt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ji=!0,Zr=!0,Ui=!1,Bi=!0,Re=!1,ze=!0,We=!1,en=!1,lr=null,cr=null,tn=!1,ft=!1,fr=!1,hr=!1,zi=!0,Wi=!1,Hi="user-content-",rn=!0,nn=!1,ht={},pt=null,Gi=D({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Yi=null,$i=D({},["audio","video","img","source","image","track"]),Vi=null,Qi=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pr="http://www.w3.org/1998/Math/MathML",dr="http://www.w3.org/2000/svg",Te="http://www.w3.org/1999/xhtml",dt=Te,sn=!1,on=null,du=D({},[pr,dr,Te],pn),Xi=J(["mi","mo","mn","ms","mtext"]),an=D({},Xi),Ki=J(["annotation-xml"]),un=D({},Ki),mu=D({},["title","style","font","a","script"]),Rt=null,gu=["application/xhtml+xml","text/html"],yu="text/html",$=null,mt=null,_u=t.createElement("form"),Ji=function(u){return u instanceof RegExp||u instanceof Function},ln=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mt&&mt===u)return;(!u||typeof u!="object")&&(u={}),u=he(u),Rt=gu.indexOf(u.PARSER_MEDIA_TYPE)===-1?yu:u.PARSER_MEDIA_TYPE,$=Rt==="application/xhtml+xml"?pn:qt,z=Me(u,"ALLOWED_TAGS",Kr,{transform:$}),W=Me(u,"ALLOWED_ATTR",Jr,{transform:$}),on=Me(u,"ALLOWED_NAMESPACES",du,{transform:pn}),Vi=Me(u,"ADD_URI_SAFE_ATTR",Qi,{transform:$,base:Qi}),Yi=Me(u,"ADD_DATA_URI_TAGS",$i,{transform:$,base:$i}),pt=Me(u,"FORBID_CONTENTS",Gi,{transform:$}),Dt=Me(u,"FORBID_TAGS",he({}),{transform:$}),qi=Me(u,"FORBID_ATTR",he({}),{transform:$}),ht=ue(u,"USE_PROFILES")?u.USE_PROFILES&&typeof u.USE_PROFILES=="object"?he(u.USE_PROFILES):u.USE_PROFILES:!1,ji=u.ALLOW_ARIA_ATTR!==!1,Zr=u.ALLOW_DATA_ATTR!==!1,Ui=u.ALLOW_UNKNOWN_PROTOCOLS||!1,Bi=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=u.SAFE_FOR_TEMPLATES||!1,ze=u.SAFE_FOR_XML!==!1,We=u.WHOLE_DOCUMENT||!1,ft=u.RETURN_DOM||!1,fr=u.RETURN_DOM_FRAGMENT||!1,hr=u.RETURN_TRUSTED_TYPE||!1,tn=u.FORCE_BODY||!1,zi=u.SANITIZE_DOM!==!1,Wi=u.SANITIZE_NAMED_PROPS||!1,rn=u.KEEP_CONTENT!==!1,nn=u.IN_PLACE||!1,Fi=$u(u.ALLOWED_URI_REGEXP)?u.ALLOWED_URI_REGEXP:Es,dt=typeof u.NAMESPACE=="string"?u.NAMESPACE:Te,an=_n(u,"MATHML_TEXT_INTEGRATION_POINTS",()=>D({},Xi)),un=_n(u,"HTML_INTEGRATION_POINTS",()=>D({},Ki));let c=_n(u,"CUSTOM_ELEMENT_HANDLING",()=>vt(null));if(be=vt(null),ue(c,"tagNameCheck")&&Ji(c.tagNameCheck)&&(be.tagNameCheck=c.tagNameCheck),ue(c,"attributeNameCheck")&&Ji(c.attributeNameCheck)&&(be.attributeNameCheck=c.attributeNameCheck),ue(c,"allowCustomizedBuiltInElements")&&typeof c.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=c.allowCustomizedBuiltInElements),re(be),Re&&(Zr=!1),fr&&(ft=!0),ht&&(z=D({},Ss),W=vt(null),ht.html===!0&&(D(z,ws),D(W,bs)),ht.svg===!0&&(D(z,dn),D(W,yn),D(W,Tr)),ht.svgFilters===!0&&(D(z,mn),D(W,yn),D(W,Tr)),ht.mathMl===!0&&(D(z,gn),D(W,Ts),D(W,Tr))),De.tagCheck=null,De.attributeCheck=null,ue(u,"ADD_TAGS")&&(typeof u.ADD_TAGS=="function"?De.tagCheck=u.ADD_TAGS:wt(u.ADD_TAGS)&&(z===Kr&&(z=he(z)),D(z,u.ADD_TAGS,$))),ue(u,"ADD_ATTR")&&(typeof u.ADD_ATTR=="function"?De.attributeCheck=u.ADD_ATTR:wt(u.ADD_ATTR)&&(W===Jr&&(W=he(W)),D(W,u.ADD_ATTR,$))),ue(u,"ADD_FORBID_CONTENTS")&&wt(u.ADD_FORBID_CONTENTS)&&(pt===Gi&&(pt=he(pt)),D(pt,u.ADD_FORBID_CONTENTS,$)),rn&&(z["#text"]=!0),We&&D(z,["html","head","body"]),z.table&&(D(z,["tbody"]),delete Dt.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let g=te;te=u.TRUSTED_TYPES_POLICY;try{pe=ct("")}catch(w){throw te=g,w}}else u.TRUSTED_TYPES_POLICY===null?(te=void 0,pe=""):(te===void 0&&(te=nu()),te&&typeof pe=="string"&&(pe=ct("")));J&&J(u),mt=u},Zi=D({},[...dn,...mn,...Vu]),es=D({},[...gn,...Qu]),vu=function(u,c,g){return c.namespaceURI===Te?u==="svg":c.namespaceURI===pr?u==="svg"&&(g==="annotation-xml"||an[g]):!!Zi[u]},wu=function(u,c,g){return c.namespaceURI===Te?u==="math":c.namespaceURI===dr?u==="math"&&un[g]:!!es[u]},Su=function(u,c,g){return c.namespaceURI===dr&&!un[g]||c.namespaceURI===pr&&!an[g]?!1:!es[u]&&(mu[u]||!Zi[u])},bu=function(u){let c=U(u);(!c||!c.tagName)&&(c={namespaceURI:dt,tagName:"template"});let g=qt(u.tagName),w=qt(c.tagName);return on[u.namespaceURI]?u.namespaceURI===dr?vu(g,c,w):u.namespaceURI===pr?wu(g,c,w):u.namespaceURI===Te?Su(g,c,w):!!(Rt==="application/xhtml+xml"&&on[u.namespaceURI]):!1},Ne=function(u){kt(e.removed,{element:u});try{U(u).removeChild(u)}catch{if(d(u),!U(u))throw ke("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ts=function(u,c,g){try{v(u,c)}catch{try{u.removeAttribute(g)}catch{}}},mr=function(u){gr(u);let c=E(u);if(c){let w=[];Ge(c,A=>{kt(w,A)}),Ge(w,A=>{try{d(A)}catch{}})}let g=K(u);if(g)for(let w=g.length-1;w>=0;--w){let A=g[w],C=A&&A.name;typeof C=="string"&&ts(u,A,C)}},He=function(u,c,g){if(!g)try{g=c.getAttributeNode(u)}catch{g=null}kt(e.removed,{attribute:g||null,from:c});try{g?v(c,g):c.removeAttribute(u)}catch{try{c.removeAttribute(u)}catch{}}if(u==="is")if(ft||fr)try{Ne(c)}catch{}else try{c.setAttribute(u,"")}catch{}},Tu=function(u){let c=K(u);if(c)for(let g=c.length-1;g>=0;--g){let w=c[g],A=w&&w.name;typeof A!="string"||W[$(A)]||ts(u,w,A)}},gr=function(u){let c=[u];for(;c.length>0;){let g=c.pop();ee(g)===fe.element&&Tu(g);let w=E(g);if(w)for(let A=w.length-1;A>=0;--A)c.push(w[A])}},rs=function(u,c){return ze?u==="patchsrc"?!0:u==="for"&&c!=="label"&&c!=="output":!1},Eu=function(u){if(!ze)return;let c=[u];for(;c.length>0;){let g=c.pop(),w=ee(g);if(w===fe.processingInstruction||w===fe.comment&&oe(As,g.data)){try{d(g)}catch{}continue}if(w===fe.element){let C=g,L=$(Se(g));try{C.hasAttribute&&C.hasAttribute("patchsrc")&&C.removeAttribute("patchsrc"),C.hasAttribute&&C.hasAttribute("for")&&rs("for",L)&&C.removeAttribute("for")}catch{}}let A=E(g);if(A)for(let C=A.length-1;C>=0;--C)c.push(A[C])}},ns=function(u){let c=null,g=null;if(tn)u="<remove></remove>"+u;else{let C=gs(u,/^[\r\n\t ]+/);g=C&&C[0]}Rt==="application/xhtml+xml"&&dt===Te&&(u='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+u+"</body></html>");let w=te?ct(u):u;if(dt===Te)try{c=new h().parseFromString(w,Rt)}catch{}if(!c||!c.documentElement){c=Xr.createDocument(dt,"template",null);try{c.documentElement.innerHTML=sn?pe:w}catch{}}let A=c.body||c.documentElement;return u&&g&&A.insertBefore(t.createTextNode(g),A.childNodes[0]||null),dt===Te?su.call(c,We?"html":"body")[0]:We?c.documentElement:A},is=function(u){let c=Q?Q(u):u.ownerDocument;return ki.call(c||u,u,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT|a.SHOW_PROCESSING_INSTRUCTION|a.SHOW_CDATA_SECTION,null)},yr=function(u){return u=Mt(u,au," "),u=Mt(u,uu," "),u=Mt(u,lu," "),u},cn=function(u){var c;u.normalize();let g=Q?Q(u):u.ownerDocument,w=ki.call(g||u,u,a.SHOW_TEXT|a.SHOW_COMMENT|a.SHOW_CDATA_SECTION|a.SHOW_PROCESSING_INSTRUCTION,null),A=w.nextNode();for(;A;)A.data=yr(A.data),A=w.nextNode();let C=(c=u.querySelectorAll)===null||c===void 0?void 0:c.call(u,"template");C&&Ge(C,L=>{gt(L.content)&&cn(L.content)})},_r=function(u){let c=V?V(u):null;return typeof c!="string"||$(c)!=="form"?!1:typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||u.attributes!==K(u)||typeof u.removeAttribute!="function"||typeof u.removeAttributeNode!="function"||typeof u.getAttributeNode!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function"||u.nodeType!==k(u)||u.childNodes!==E(u)},gt=function(u){if(!k||typeof u!="object"||u===null)return!1;try{return k(u)===fe.documentFragment}catch{return!1}},Nt=function(u){if(!k||typeof u!="object"||u===null)return!1;try{return typeof k(u)=="number"}catch{return!1}};function Ee(y,u,c){y.length!==0&&Ge(y,g=>{g.call(e,u,c,mt)})}let Ou=function(u,c){return!!(ze&&u.hasChildNodes()&&!Nt(u.firstElementChild)&&oe(Os,u.textContent)&&oe(Os,u.innerHTML)||ze&&u.namespaceURI===Te&&al[c]&&(Nt(u.firstElementChild)||typeof u.textContent=="string"&&oe(ul[c],u.textContent))||u.nodeType===fe.processingInstruction||ze&&u.nodeType===fe.comment&&oe(As,u.data))},vr=function(u,c){if(u instanceof RegExp)return oe(u,c);if(u instanceof Function){for(var g=arguments.length,w=new Array(g>2?g-2:0),A=2;A<g;A++)w[A-2]=arguments[A];return!!u(c,...w)}return!1},Au=function(u,c,g){if(!Dt[c]&&us(c)&&vr(be.tagNameCheck,c))return!1;if(rn&&!pt[c]){let w=U(u),A=E(u);if(A&&w){let C=A.length;for(let L=C-1;L>=0;--L){let G=u===g?p(A[L],!0):A[L];w.insertBefore(G,x(u))}}}return Ne(u),!0},ss=function(u,c,g,w){return u.length===0?c:c===g||c===w?he(c):c},yt=function(u,c){return u===c||U(u)!==null?!1:(nn&&gr(u),!0)},os=function(u,c){if(Ee(B.beforeSanitizeElements,u,null),yt(u,c))return!0;if(_r(u))return Ne(u),!0;let g=$(Se(u));if(z=ss(B.uponSanitizeElement,z,Kr,lr),Ee(B.uponSanitizeElement,u,{tagName:g,allowedTags:z}),yt(u,c))return!0;if(Ou(u,g))return Ne(u),!0;if(Dt[g]||!(De.tagCheck instanceof Function&&De.tagCheck(g))&&!z[g]){let w=Au(u,g,c);return w===!1&&(Ee(B.afterSanitizeElements,u,null),yt(u,c))?!0:w}if(ee(u)===fe.element&&!bu(u)||(g==="noscript"||g==="noembed"||g==="noframes")&&oe(sl,u.innerHTML))return Ne(u),!0;if(Re&&u.nodeType===fe.text){let w=yr(u.textContent);u.textContent!==w&&(kt(e.removed,{element:u.cloneNode()}),u.textContent=w)}return Ee(B.afterSanitizeElements,u,null),yt(u,c)},as=function(u,c,g){if(qi[c]||rs(c,u)||zi&&(c==="id"||c==="name")&&(g in t||g in _u))return!1;let w=W[c]||De.attributeCheck instanceof Function&&De.attributeCheck(c,u);return Zr&&oe(cu,c)||ji&&oe(fu,c)?!0:w?Vi[c]||oe(Fi,Mt(g,Mi,""))||(c==="src"||c==="xlink:href"||c==="href")&&u!=="script"&&ys(g,"data:")===0&&Yi[u]||Ui&&!oe(hu,Mt(g,Mi,""))?!0:!g:us(u)&&vr(be.tagNameCheck,u)&&vr(be.attributeNameCheck,c,u)||c==="is"&&be.allowCustomizedBuiltInElements&&vr(be.tagNameCheck,g)},Pu=D({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),us=function(u){return!Pu[qt(u)]&&oe(pu,u)},xu=function(u,c,g,w){if(te&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!g)switch(f.getAttributeType(u,c)){case"TrustedHTML":return ct(w);case"TrustedScriptURL":return ru(w)}return w},Cu=function(u,c,g,w){try{return g?u.setAttributeNS(g,c,w):u.setAttribute(c,w),_r(u)?(Ne(u),!1):!0}catch{return He(c,u),!1}},ls=function(u,c){if(Ee(B.beforeSanitizeAttributes,u,null),yt(u,c))return;let g=u.attributes;if(!g||_r(u))return;W=ss(B.uponSanitizeAttribute,W,Jr,cr);let w={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0},A=g.length,C=$(u.nodeName);for(;A--;){let L=g[A],G=L.name,de=L.namespaceURI,ce=L.value,_t=$(G),hn=ce,ae=G==="value"?hn:Bu(hn),cs=!1;if(w.attrName=_t,w.attrValue=ae,w.keepAttr=!0,w.forceKeepAttr=void 0,Ee(B.uponSanitizeAttribute,u,w),ae=w.attrValue,Wi&&(_t==="id"||_t==="name")&&ys(ae,Hi)!==0&&(He(G,u,L),ae=Hi+ae,cs=!0),ze&&oe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ae)){He(G,u,L);continue}if(_t==="attributename"&&gs(ae,"href")){He(G,u,L);continue}if(!w.forceKeepAttr){if(!w.keepAttr){He(G,u,L);continue}if(!Bi&&oe(ol,ae)){He(G,u,L);continue}if(Re&&(ae=yr(ae)),!as(C,_t,ae)){He(G,u,L);continue}ae=xu(C,_t,de,ae),ae!==hn&&Cu(u,G,de,ae)&&cs&&ms(e.removed)}}Ee(B.afterSanitizeAttributes,u,null),yt(u,c)},wr=function(u){let c=null,g=is(u);for(Ee(B.beforeSanitizeShadowDOM,u,null);c=g.nextNode();)if(Ee(B.uponSanitizeShadowNode,c,null),os(c,u),ls(c,u),gt(c.content)&&wr(c.content),ee(c)===fe.element){let w=Y(c);gt(w)&&(fn(w),wr(w))}Ee(B.afterSanitizeShadowDOM,u,null)},fn=function(u){let c=[{node:u,shadow:null}];for(;c.length>0;){let g=c.pop();if(g.shadow){wr(g.shadow);continue}let w=g.node,A=ee(w)===fe.element,C=E(w);if(C)for(let L=C.length-1;L>=0;--L)c.push({node:C[L],shadow:null});if(A){let L=V?V(w):null;if(typeof L=="string"&&$(L)==="template"){let G=w.content;gt(G)&&c.push({node:G,shadow:null})}}if(A){let L=Y(w);gt(L)&&c.push({node:null,shadow:L},{node:L,shadow:null})}}};return e.sanitize=function(y){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,g=null,w=null,A=null;if(sn=!y,sn&&(y="<!-->"),typeof y!="string"&&!Nt(y)&&(y=Yu(y),typeof y!="string"))throw ke("dirty is not a string, aborting");if(!e.isSupported)return y;en?(z=lr,W=cr):ln(u),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(z=he(z)),B.uponSanitizeAttribute.length>0&&(W=he(W)),e.removed=[];let C=nn&&typeof y!="string"&&Nt(y);if(C){Eu(y);let de=Se(y);if(typeof de=="string"){let ce=$(de);if(!z[ce]||Dt[ce])throw mr(y),ke("root node is forbidden and cannot be sanitized in-place")}if(_r(y))throw mr(y),ke("root node is clobbered and cannot be sanitized in-place");try{fn(y)}catch(ce){throw mr(y),ce}}else if(Nt(y))c=ns("<!---->"),g=c.ownerDocument.importNode(y,!0),g.nodeType===fe.element&&g.nodeName==="BODY"||g.nodeName==="HTML"?c=g:c.appendChild(g),fn(c);else{if(!ft&&!Re&&!We&&y.indexOf("<")===-1)return te&&hr?ct(y):y;if(c=ns(y),!c)return ft?null:hr?pe:""}c&&tn&&Ne(c.firstChild);let L=C?y:c;try{let de=is(L);for(;w=de.nextNode();)os(w,L),ls(w,L),gt(w.content)&&wr(w.content)}catch(de){throw C&&(mr(y),Ge(e.removed,ce=>{ce.element&&gr(ce.element)})),de}if(C){let de=!1;if(Ge(e.removed,ce=>{ce.element&&(ce.element===y&&(de=!0),gr(ce.element))}),de)throw ke("a node selected for removal could not be safely returned; refusing to sanitize in place");return Re&&cn(y),y}if(ft){if(Re&&cn(c),fr)for(A=iu.call(c.ownerDocument);c.firstChild;)A.appendChild(c.firstChild);else A=c;return(W.shadowroot||W.shadowrootmode)&&(A=ou.call(r,A,!0)),A}let G=We?c.outerHTML:c.innerHTML;return We&&z["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&oe(nl,c.ownerDocument.doctype.name)&&(G="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
3
3
  `+G),Re&&(G=yr(G)),te&&hr?ct(G):G},e.setConfig=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ln(y),en=!0,lr=z,cr=W},e.clearConfig=function(){mt=null,en=!1,lr=null,cr=null,te=Lt,pe=""},e.isValidAttribute=function(y,u,c){mt||ln({});let g=$(y),w=$(u);return as(g,w,c)},e.addHook=function(y,u){typeof u=="function"&&ue(B,y)&&kt(B[y],u)},e.removeHook=function(y,u){if(ue(B,y)){if(u!==void 0){let c=ju(B[y],u);return c===-1?void 0:Uu(B[y],c,1)[0]}return ms(B[y])}},e.removeHooks=function(y){ue(B,y)&&(B[y]=[])},e.removeAllHooks=function(){B=Ps()},e}var fl=Ls();Ds.exports=fl});var Ns=T((ld,bn)=>{"use strict";var P=String,Rs=function(){return{isColorSupported:!1,reset:P,bold:P,dim:P,italic:P,underline:P,inverse:P,hidden:P,strikethrough:P,black:P,red:P,green:P,yellow:P,blue:P,magenta:P,cyan:P,white:P,gray:P,bgBlack:P,bgRed:P,bgGreen:P,bgYellow:P,bgBlue:P,bgMagenta:P,bgCyan:P,bgWhite:P,blackBright:P,redBright:P,greenBright:P,yellowBright:P,blueBright:P,magentaBright:P,cyanBright:P,whiteBright:P,bgBlackBright:P,bgRedBright:P,bgGreenBright:P,bgYellowBright:P,bgBlueBright:P,bgMagentaBright:P,bgCyanBright:P,bgWhiteBright:P}};bn.exports=Rs();bn.exports.createColors=Rs});var Tn=T(()=>{"use strict"});var Er=T((hd,Fs)=>{"use strict";var ks=Ns(),Ms=Tn(),jt=class i extends Error{constructor(e,t,r,n,s,o){super(e),this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=ks.isColorSupported);let r=f=>f,n=f=>f,s=f=>f;if(e){let{bold:f,gray:_,red:p}=ks.createColors(!0);n=d=>f(p(d)),r=d=>_(d),Ms&&(s=d=>Ms(d))}let o=t.split(/\r?\n/),l=Math.max(this.line-3,0),a=Math.min(this.line+2,o.length),h=String(a).length;return o.slice(l,a).map((f,_)=>{let p=l+1+_,d=" "+(" "+p).slice(-h)+" | ";if(p===this.line){if(f.length>160){let x=20,E=typeof this.endColumn=="number"?this.endColumn:this.column,U=Math.max(0,this.column-x),Y=Math.max(this.column+x,E+x),K=f.slice(U,Y),k=r(d.replace(/\d/g," "))+f.slice(0,Math.min(this.column-1,x-1)).replace(/[^\t]/g," ");return n(">")+r(d)+s(K)+`
4
4
  `+k+n("^")}let v=r(d.replace(/\d/g," "))+f.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(d)+s(f)+`