1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a1cf4581-072c-4940-a87b-b18ebd8d8679",e._sentryDebugIdIdentifier="sentry-dbid-a1cf4581-072c-4940-a87b-b18ebd8d8679")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5730,9197],{1164:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(9028).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},1546:(e,t,n)=>{n.d(t,{CU:()=>o,O8:()=>i,gl:()=>d});var a=n(87432);let r={bg:"#F6F6F4",surface:"#FFFFFF",fg:"#17150F",muted:"#6B6B66",border:"rgba(20, 18, 12, 0.10)",primary:"#17150F",accent2:"#17150F",onPrimary:"#FFFFFF",fontDisplay:a.D6.Inter,fontBody:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',radius:"16px",shadow:"0 1px 2px rgba(20, 18, 12, 0.04), 0 14px 34px -18px rgba(20, 18, 12, 0.22)"},s=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function l(e){if(!e)return null;let t=e.trim();return s.test(t)?4===t.length?"#".concat(t[1]).concat(t[1]).concat(t[2]).concat(t[2]).concat(t[3]).concat(t[3]):t:null}function i(e){let t=l(e);if(!t)return"#FFFFFF";let n=Number.parseInt(t.slice(1,3),16)/255,a=Number.parseInt(t.slice(3,5),16)/255,r=Number.parseInt(t.slice(5,7),16)/255,s=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(a)+.0722*s(r)>.5?"#17150F":"#FFFFFF"}function o(e){return e?function(e){var t,n,s,o,d,c;let u=null!=(o=l(null==(t=e.colors)?void 0:t.primary))?o:r.primary,m=null!=(d=l(null==(n=e.colors)?void 0:n.secondary))?d:u;return{...r,primary:u,accent2:m,onPrimary:i(u),fontDisplay:(c=null==(s=e.typography)?void 0:s.headingFont)&&c in a.D6?a.D6[c]:r.fontDisplay}}(e):r}function d(e){return{"--acct-bg":e.bg,"--acct-surface":e.surface,"--acct-fg":e.fg,"--acct-muted":e.muted,"--acct-border":e.border,"--acct-primary":e.primary,"--acct-accent-2":e.accent2,"--acct-on-primary":e.onPrimary,"--acct-font-display":e.fontDisplay,"--acct-font-body":e.fontBody,"--acct-radius":e.radius,"--acct-shadow":e.shadow}}},17642:(e,t,n)=>{n.d(t,{lp:()=>s,tj:()=>l});let a=parseFloat(n(65364).env.NEXT_PUBLIC_SIMPLIFIED_FEE_PERCENTAGE||"5"),r=parseFloat("19");function s(e){return"simplified"===e?a:r}function l(e){let t=e=>Math.round(100*(Number(e)||0)),n=t(e.total_amount),a=t(e.seller_net_amount);if(n<=0)return{kind:"giveaway",shippingCharged:Math.max(0,-a)/100};let r=t(e.platform_fee),s=Math.max(0,n-r-a)/100;return{kind:"sale",platformFee:r/100,productionWithheld:s,productionEstimated:s>0&&"estimate"===e.production_cost_source}}},21027:(e,t,n)=>{n.d(t,{NI:()=>r,ox:()=>s});var a=n(51802);let r=["US"],s=a.Ik({enabled:a.zM(),minSubtotalCents:a.ai().int().nonnegative().nullable()});a.Ik({country:a.Yj().min(2).max(2).transform(e=>e.toUpperCase()).default("US"),quantity:a.au.number().int().positive().max(1e3).default(1),subtotalCents:a.au.number().int().nonnegative().optional()})},30692:(e,t,n)=>{async function a(e,t){let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await n.json();if(!n.ok)throw Error("string"==typeof(null==a?void 0:a.error)?a.error:"Request failed");return a}function r(e){return a("/api/customer/product-subscriptions/payment-intent",e)}function s(e){return a("/api/customer/product-subscriptions/finalize",e)}n.d(t,{B:()=>r,U:()=>s})},42260:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(37876),r=n(14232),s=n(66e3);function l(e){let{src:t,alt:n,className:l,width:i,height:o,fit:d="cover"}=e,[c,u]=(0,r.useState)(null),[m,p]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{p(!1)},[t]),(0,r.useEffect)(()=>{if(!t)return void u(null);if(t.startsWith("/api/page/")){let e=!0;return fetch(t).then(async e=>{if(!e.ok){if(404===e.status)return null;throw Error("Failed to load image metadata: ".concat(e.status))}return e.json()}).then(t=>{e&&(null==t?void 0:t.imageUrl)?u(t.imageUrl):e&&u(null)}).catch(t=>{console.error("SmartImage fetch error:",t),e&&u(null)}),()=>{e=!1}}u(t)},[t]),!c)return(0,a.jsx)("div",{className:l,style:{backgroundColor:"transparent"}});let h=void 0===i||m?void 0:{width:i,height:o,resize:d};return(0,a.jsx)("img",{src:h?(0,s.L)(c,h):c,srcSet:h?(0,s.W)(c,h):void 0,alt:n,className:l,onError:h?()=>p(!0):void 0})}},57619:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(9028).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},65810:(e,t,n)=>{n.d(t,{Sn:()=>s,vU:()=>o,jl:()=>d,M2:()=>i});var a=n(51802);a.k5(["lead","preorder","purchase","subscription","inventory_batch"]),a.k5(["pending","processing","succeeded","failed","refunded"]),a.k5(["pending","confirmed","processing","shipped","delivered","cancelled"]),a.k5(["pending","available","paid_out","refunded","escrow"]);let r=a.k5(["supplier_quote","estimate","override","none"]);n(17642);let s=a.Ik({pageId:a.Yj().optional(),selections:a.g1(a.Yj(),a.Yj()).optional(),displayLabel:a.Yj(),quantity:a.ai().int().positive(),imageUrl:a.Yj().optional()}),l=a.Ik({pageId:a.Yj().optional(),selections:a.g1(a.Yj(),a.Yj()).optional(),displayLabel:a.Yj(),productName:a.Yj().optional(),unitPrice:a.ai(),quantity:a.ai().int().positive(),imageUrl:a.Yj().optional(),unitProductionCost:a.ai().optional(),productionCostSource:r.optional(),productType:a.Yj().optional(),inventoryVariantId:a.Yj().optional(),catalogVariantId:a.Yj().optional()}).passthrough();function i(e){return Array.isArray(e)&&e.length>0&&e.every(e=>!!e&&"object"==typeof e&&"displayLabel"in e)}function o(e){return e.reduce((e,t)=>
1e+t.unitPrice*t.quantity,0)}function d(e,t){let n=[],a=new Set;for(let o of e){var r,s,l,i;let e=null!=(i=null!=(l=o.pageId)?l:o.productName)?i:o.displayLabel;a.has(e)||(a.add(e),n.push((null==(r=o.productName)?void 0:r.trim())||(null==(s=o.displayLabel)?void 0:s.trim())||t))}return 0===n.length?t:1===n.length?n[0]:"".concat(n[0]," + ").concat(n.length-1," more")}a.YO(l).min(1),Symbol("merged-parcel")},66e3:(e,t,n)=>{n.d(t,{L:()=>s,W:()=>l});let a="/storage/v1/object/public/";function r(e){let t;try{t=new URL(e)}catch(e){return null}return t.pathname.includes(a)?t:null}function s(e,t){let n=r(e);if(!n)return e;let{width:s,height:l,resize:i="cover",quality:o=80,dpr:d=1}=t,c=e=>Math.max(1,Math.min(2500,Math.round(e*d)));return n.pathname=n.pathname.replace(a,"/storage/v1/render/image/public/"),n.searchParams.set("width",String(c(s))),n.searchParams.set("resize",i),n.searchParams.set("quality",String(o)),void 0!==l?n.searchParams.set("height",String(c(l))):n.searchParams.delete("height"),n.toString()}function l(e,t){if(r(e))return"".concat(s(e,t)," 1x, ").concat(s(e,{...t,dpr:2})," 2x")}},66692:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(9028).A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])},73270:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(9028).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},79197:(e,t,n)=>{n.d(t,{$f:()=>c,At:()=>u,E8:()=>h,SK:()=>d,VE:()=>p,describeCheckoutStartFailure:()=>o,oq:()=>m,postCreatePendingLead:()=>i,t9:()=>a});class a extends Error{constructor(e,t,n){super(t),this.name="CheckoutApiError",this.status=e,this.details=n}}let r="Connection issue. Check your internet and try again.";function s(e){return e instanceof DOMException&&("TimeoutError"===e.name||"AbortError"===e.name)?new a(0,r):new a(0,e instanceof Error?e.message:"Network error")}async function l(e,t){let n;try{n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:AbortSignal.timeout(2e4)})}catch(e){throw s(e)}let r=await n.json().catch(()=>({}));if(!n.ok)throw new a(n.status,r.error||"Request failed (".concat(n.status,")"),r.details);return r}function i(e){return l("/api/stripe/create-pending-lead",e)}function o(e){return e instanceof a?0===e.status?r:e.status>=400&&e.status<500?e.message:"Something went wrong starting checkout. Please try again.".concat(""):"Something went wrong starting checkout. Please try again."}async function d(e){let t;try{t=await fetch("/api/stripe/pending-lead?id=".concat(encodeURIComponent(e)),{signal:AbortSignal.timeout(2e4)})}catch(e){throw s(e)}let n=await t.json().catch(()=>({}));if(!t.ok)throw new a(t.status,n.error||"Request failed (".concat(t.status,")"),n.details);return n}async function c(e){let t;try{t=await fetch("/api/stripe/pending-lead?group=".concat(encodeURIComponent(e)),{signal:AbortSignal.timeout(2e4)})}catch(e){throw s(e)}let n=await t.json().catch(()=>({}));if(!t.ok)throw new a(t.status,n.error||"Request failed (".concat(t.status,")"),n.details);return n}function u(e){return l("/api/stripe/order-group-quote",e)}function m(e){return l("/api/stripe/create-product-payment-intent",e)}function p(e){return l("/api/checkout/promo-code",e)}function h(e){return l("/api/checkout/free-order",e)}},86904:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(9028).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},86972:(e,t,n)=>{n.d(t,{NL:()=>s,Ry:()=>r});var a=n(51802);a.Ik({outOfStock:a.zM()});let r="Sold out";function s(e){return!!(null==e?void 0:e.out_of_stock_at)}},89203:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return r}});let a=n(14232);function r(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=n.current;e&&(n.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(n.current=s(e,a)),t&&(r.current=s(t,a))},[e,t])}function s(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
1dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},95087:(e,t,n)=>{n.d(t,{P:()=>r});class a extends Error{constructor(e,t){super(t),this.name="ShippingApiError",this.status=e}}async function r(e,t,n,r){var s,l,i,o,d;let c,u=new URLSearchParams({country:t,quantity:String(n)});(null==r?void 0:r.subtotalCents)!=null&&u.set("subtotalCents",String(r.subtotalCents));let m="/api/page/".concat(encodeURIComponent(e),"/shipping?").concat(u.toString()),p=new AbortController,h=!1,x=setTimeout(()=>{h=!0,p.abort()},null!=(l=null==r?void 0:r.timeoutMs)?l:15e3),f=()=>p.abort();null==r||null==(s=r.signal)||s.addEventListener("abort",f);try{c=await fetch(m,{signal:p.signal})}catch(e){if(null==r||null==(i=r.signal)?void 0:i.aborted)throw e;throw new a(0,h?"Shipping quote timed out after ".concat(null!=(o=null==r?void 0:r.timeoutMs)?o:15e3,"ms"):e instanceof Error?e.message:"Network error")}finally{clearTimeout(x),null==r||null==(d=r.signal)||d.removeEventListener("abort",f)}if(!c.ok)throw new a(c.status,"Shipping quote failed (".concat(c.status,")"));return await c.json()}}
1,99928:(e,t,n)=>{let a;n.r(t),n.d(t,{default:()=>H});var r=n(37876),s=n(91040);let l=(0,n(9028).A)("repeat-2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);var i=n(57619),o=n(1164),d=n(77328),c=n.n(d),u=n(54587),m=n.n(u),p=n(89099),h=n(14232),x=n(39742),f=n(4241),g=n(50859),b=n(73270),y=n(34379),v=n(45485),j=n(1546),w=n(30692),N=n(95087),k=n(21027),C=n(79197);class S extends Error{constructor(e,t,n=!1){super(t),this.name="TaxQuoteError",this.status=e,this.permanent=n}}async function F(e,t,n){var a,r,s,l,i;let o,d=new AbortController,c=!1,u=setTimeout(()=>{c=!0,d.abort()},null!=(r=null==n?void 0:n.timeoutMs)?r:15e3),m=()=>d.abort();null==n||null==(a=n.signal)||a.addEventListener("abort",m);try{o=await fetch("/api/page/".concat(encodeURIComponent(e),"/tax-quote"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:d.signal})}catch(e){if(null==n||null==(s=n.signal)?void 0:s.aborted)throw e;throw new S(0,c?"Tax quote timed out after ".concat(null!=(l=null==n?void 0:n.timeoutMs)?l:15e3,"ms"):e instanceof Error?e.message:"Network error")}finally{clearTimeout(u),null==n||null==(i=n.signal)||i.removeEventListener("abort",m)}if(!o.ok){let e="Tax quote failed (".concat(o.status,")");try{let t=await o.json();"string"==typeof(null==t?void 0:t.error)&&t.error&&(e=t.error)}catch(e){}throw new S(o.status,e,422===o.status)}return await o.json()}function P(e){return e&&0!==e.parcels.length?1===e.parcels.length?e.parcels[0].shippingLabel:"".concat(e.parcels.length," shipments"):null}function A(e){return{id:"standard",amount:e.free?0:e.amountCents,displayName:e.label,deliveryEstimate:{minimum:{unit:"business_day",value:e.deliveryEstimate.minBusinessDays},maximum:{unit:"business_day",value:e.deliveryEstimate.maxBusinessDays}}}}function E(e){let t=P(e);return e&&t?{id:"standard",amount:e.shippingAmountCents,displayName:t}:null}function _(e){let{title:t,children:n}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-2 text-[15px] font-semibold tracking-tight",children:t}),n]})}function I(e){let{brandColor:t,productAmount:n,orderType:s}=e,l=Math.max(50,Math.round(100*n)),i="subscription"===s,o=(0,h.useMemo)(()=>({mode:"payment",amount:l,currency:"usd",...i?{setupFutureUsage:"off_session",paymentMethodTypes:["card"]}:{paymentMethodCreation:"manual"},appearance:{theme:"stripe",variables:{colorPrimary:t||"#0f172a",borderRadius:"10px",spacingUnit:"4px",spacingGridRow:"10px",fontSizeBase:"16px",fontWeightNormal:"500"},rules:{".Label":{fontSize:"13px",fontWeight:"500",marginBottom:"6px"},".Input":{padding:"12px 14px",boxShadow:"0 1px 2px rgba(15, 23, 42, 0.04)"},".Input:focus":{boxShadow:"0 0 0 3px ".concat(t||"#0f172a","22")},".Tab":{padding:"10px 12px"},".Tab--selected":{boxShadow:"0 0 0 1.5px ".concat(t||"#0f172a")}}}}),[l,t,i]);return(0,r.jsx)(x.S8,{stripe:(a||(a=(0,f.c)("pk_live_51SSVy0BjQVr3mXKZvdNix79nGWtSdErCLrDLY9bUdnJlfFnHh0xcYWGMhfksFZgiukmxZpAgSu4OvDOOG1VJvtyZ00p7g8ipsK")),a),options:o,children:(0,r.jsx)(U,{...e})})}function U(e){var t,n,a,s,l,i,o,d,c,u,m,p,f,I,U,L,M,q;let{pageId:T,productName:$,unitPrice:R,productAmount:D,promo:Y,quantity:O,orderType:B,productVariant:V,affiliateId:z,brandColor:H,successUrl:G,leadId:K,orderGroupId:W,onShippingChange:J,onTaxChange:Q,onShippingUnavailable:Z,discountPercent:X}=e,ee="subscription"===B,et=(0,h.useMemo)(()=>H?{backgroundColor:H,color:(0,j.O8)(H)}:void 0,[H]),en=!!(X&&X>0&&X<100),ea=(en?R/(1-X/100):R)*O,er=en&&ea-R*O>.005,es=(0,x.t2)(),el=(0,x.HH)(),[ei,eo]=(0,h.useState)(""),[ed,ec]=(0,h.useState)(!1),[eu,em]=(0,h.useState)(!1),[ep,eh]=(0,h.useState)(null),[ex,ef]=(0,h.useState)("US"),[eg,eb]=(0,h.useState)(!1),[ey,ev]=(0,h.useState)(null),ej=(0,h.useRef)(null),ew=Math.round(100*D),eN=(null==ep?void 0:ep.address)?{line1:ep.address.line1||void 0,city:ep.address.city||void 0,state:ep.address.state||void 0,postal_code:ep.address.postal_code||void 0,country:ep.address.country||void 0}:void 0,ek="".concat(null!=(d=null==eN?void 0:eN.country)?d:"","|").concat(null!=(c=null==eN?void 0:eN.state)?c:"","|").concat(null!=(u=null==eN?void 0:eN.postal_code)?u:"","|").concat(null!=(m=null==eN?void 0:eN.city)?m:"","|").concat(ew),eC=(0,v.m)(e=>(0,N.P)(T,ex,O,{subtotalCents:ew,signal:e}),[T,ex,O,ew],{enabled:!!ex&&!W}),eS=(0,v.m)(()=>(0,C.At)({orderGroupId:W,address:eN}).then(e=>({...e,quoteKey:ek})),[W,ek],{enabled:!!W}),eF=(null==(t=eS.data)?void 0:t.quoteKey)===ek?eS.data:null,eP=W?null!=(p=null==eF?void 0:eF.shippingAmountCents)?p:null:null!=(f=null==(n=eC.data)?void 0:n.amountCents)?f:null,eA=W?P(eF):null!=(I=null==(a=eC.data)?void 0:a.label)?I:null,eE=W?!!(eF&&eF.parcels.length>0&&eF.parcels.every(e=>e.shippingFree)):(null==(s=eC.data)?void 0:s.free)===!0,e_=W?eS:eC,eI="error"===e_.status&&(W?null===eF:null===e_.data),eU=!!(null==Y?void 0:Y.coversShipping)&&ew<=0,eL=eE||eU?0:eP,eM=null==ep?void 0:ep.address,eq=null!=(U=null==eM?void 0:eM.country)?U:"",eT=null!=(L=null==eM?void 0:eM.state)?L:"",e$=null!=(M=null==eM?void 0:eM.postal_code)?M:"",eR=null!=(q=null==eM?void 0:eM.city)?q:"",eD=eu&&!!eq&&null!==eP,eY="".concat(ew,"|").concat(null!=eL?eL:"","|").concat(eq,"|").concat(eT,"|").concat(e$,"|").concat(eR,"|").concat(eD),eO
1=(0,v.m)(async e=>({...await F(T,{subtotalCents:Math.max(0,ew),shippingCents:null!=eL?eL:0,...eD?{address:{line1:null==eM?void 0:eM.line1,city:eR,state:eT,postal_code:e$,country:eq}}:{}},{signal:e}),key:eY}),[T,ew,eL,eq,eT,e$,eR,eD],{timeoutMs:15e3,enabled:!W}),eB=(null==(l=eO.data)?void 0:l.key)===eY?eO.data:null,eV=(null==eF?void 0:eF.parcels.some(e=>e.taxCalculated))?eF.taxAmountCents:null,ez=W?eV:(null==eB?void 0:eB.rated)?eB.taxCents:null,eH=(0,v.m)(async()=>F(T,{subtotalCents:Math.max(0,ew),shippingCents:0}),[T],{timeoutMs:15e3,enabled:!!W}),eG=W?(null==(i=eH.data)?void 0:i.enabled)===!0||null!==eV:(null==(o=eO.data)?void 0:o.enabled)===!0,eK=W?eD&&null===eF:eD&&null===eB,eW=eO.error instanceof S?eO.error:null,eJ="error"===eO.status&&(null==eW?void 0:eW.permanent)===!0,eQ=eJ?eW.message:"Couldn't work out tax. Check your internet and try again.",eZ=!!W&&null===eH.data,eX=eG||eK||eZ,e0=null!==eP?(ew+(null!=eL?eL:0)+(null!=ez?ez:0))/100:null,e1=!ee&&null!==eP&&ew<=0&&(null!=eL?eL:0)<=0;(0,h.useEffect)(()=>{ey&&ej.current&&ej.current.scrollIntoView({behavior:"smooth",block:"center"})},[ey]),(0,h.useEffect)(()=>{null!==eP&&null!==eA&&(null==J||J({amountCents:eP,country:ex,label:eA,free:eE,...W&&eF?{parcels:eF.parcels}:{}}))},[eP,eE,ex,eA,J,W,eF]),(0,h.useEffect)(()=>{null==Z||Z(eI)},[eI,Z]),(0,h.useEffect)(()=>{null==Q||Q(ez)},[ez,Q]);let e2=ew+(null!=eL?eL:0)+(null!=ez?ez:0);(0,h.useEffect)(()=>{el&&null!==eP&&(e1||el.update({amount:e2}))},[el,eP,e2,e1]);let e4=(0,h.useMemo)(()=>{let e=G.includes("?")?"&":"?";return"".concat(G).concat(e).concat(ee?"subscription":"order","=success")},[ee,G]),e5=(0,h.useCallback)(async function(){var e,t,n,a,r;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=null!=(e=s.customerEmail)?e:ei.trim(),i=null!=(t=s.customerName)?t:null==ep?void 0:ep.name,o=null!=(n=s.customerPhone)?n:null==ep?void 0:ep.phone,d=null!=(a=s.shippingAddress)?a:(null==ep?void 0:ep.address)?{name:ep.name,line1:ep.address.line1,line2:ep.address.line2||void 0,city:ep.address.city,state:ep.address.state,postal_code:ep.address.postal_code,country:ep.address.country}:void 0;if(ee){if(!K)throw Error("Subscription checkout session is missing.");if(!l)throw Error("Email is required.");if(!d)throw Error("Shipping address is required.");let e=await (0,w.B)({leadId:K,pageId:T,productName:$,customerEmail:l,customerName:i,customerPhone:o,shippingAddress:d});return{clientSecret:e.clientSecret,subscriptionId:e.subscriptionId}}let c={pageId:T,quantity:O,productName:$,orderType:"preorder"===B?"preorder":"purchase",leadId:K,...W?{orderGroupId:W}:{},productVariant:V,customerEmail:l,customerName:i,customerPhone:o,shippingAddress:d,affiliateId:z||void 0,extraAmountCents:null!=(r=s.extraAmountCents)?r:eE?0:null!=eP?eP:void 0};return{clientSecret:(await (0,C.oq)(c)).clientSecret}},[ee,T,$,K,W,O,B,V,ei,ep,z,eP,eE]),e6=async()=>{ev(null);let e=(()=>{let e=[];return ei||e.push("email"),eu&&ep||e.push("shipping address"),e})();if(e.length>0)return void ev("Please add your ".concat(e.join(" and ")," to continue."));if(!K)return void ev("Your checkout session has expired. Please try again.");eb(!0);try{let e=null==ep?void 0:ep.address;await (0,C.E8)({leadId:K,productName:$,customerEmail:ei,customerName:(null==ep?void 0:ep.name)||void 0,customerPhone:(null==ep?void 0:ep.phone)||void 0,shippingAddress:{name:(null==ep?void 0:ep.name)||void 0,line1:(null==e?void 0:e.line1)||"",line2:(null==e?void 0:e.line2)||void 0,city:(null==e?void 0:e.city)||"",state:(null==e?void 0:e.state)||void 0,postal_code:(null==e?void 0:e.postal_code)||void 0,country:(null==e?void 0:e.country)||"US"}}),window.location.href=e4}catch(e){ev(e instanceof Error?e.message:"Could not place your order. Please try again."),eb(!1)}},e3=async()=>{if(es&&el){if(ev(null),!/^\S+@\S+\.\S+$/.test(ei.trim()))return void ev("Please enter a valid email so we can send your order confirmation.");eb(!0);try{let{error:e}=await el.submit();if(e){ev(e.message||"Please check your details."),eb(!1);return}let{clientSecret:t,subscriptionId:n}=await e5(),{error:a}=await es.confirmPayment({elements:el,clientSecret:t,confirmParams:{return_url:n?"".concat(e4,"&sub_id=").concat(n):e4}});a&&(ev(a.message||"Payment failed."),eb(!1))}catch(e){ev(e instanceof Error?e.message:"Something went wrong."),eb(!1)}}},e7=W?E(eF):eC.data?A(eC.data):null,e8=async e=>{let t=(e.country||"US").toUpperCase();if(W){let n=await (0,C.At)({orderGroupId:W,address:{country:t,state:e.state||void 0,postal_code:e.postal_code||void 0,city:e.city||void 0}}),a=E(n);if(!a)throw Error("Group quote returned no parcels");return{rate:a,amountCents:ew+n.shippingAmountCents+n.taxAmountCents}}let n=A(await (0,N.P)(T,t,O,{subtotalCents:ew}));return{rate:n,amountCents:ew+n.amount+(null!=ez?ez:0)}},e9=async e=>{try{let{rate:t,amountCents:n}=await e8(e.address);null==el||el.update({amount:n}),e.resolve({shippingRates:[t]})}catch(t){ev("Couldn't work out shipping. Check your internet and try again."),e.reject()}},te=async e=>{if(es&&el){ev(null),eb(!0);try{var t,n,a,r,s,l,i,o;let{error:d}=await el.submit();if(d){e.paymentFailed({reason:"fail"}),ev(d.message||"Please check your details."),eb(!1);return}let c=null==(n=e.billingDetails)||null==(t=n.email)?void 0:t.trim(),u=null==(a=e.shippingAddress)?void 0:a.address;if(!c||!(null==u?void 0:u.line1)){e.paymentFailed({reason:c?"invali
1d_shipping_address":"fail"}),ev(c?"Your wallet did not share a shipping address. Please try again or pay with card below.":"Your wallet did not share an email address. Please try again or pay with card below."),eb(!1);return}let m=(null==(r=e.shippingAddress)?void 0:r.name)||(null==(s=e.billingDetails)?void 0:s.name)||void 0,p=(null==(l=e.billingDetails)?void 0:l.phone)||void 0,h=(u.country||"US").toUpperCase(),x=null!=(o=null==(i=e.shippingRate)?void 0:i.amount)?o:(await e8(u)).rate.amount,{clientSecret:f,subscriptionId:g}=await e5({customerEmail:c,customerName:m,customerPhone:p,shippingAddress:{name:m,line1:u.line1,line2:u.line2||void 0,city:u.city||"",state:u.state||"",postal_code:u.postal_code||"",country:h},extraAmountCents:x}),{error:b}=await es.confirmPayment({elements:el,clientSecret:f,confirmParams:{return_url:g?"".concat(e4,"&sub_id=").concat(g):e4}});b&&(ev(b.message||"Payment failed."),eb(!1))}catch(t){e.paymentFailed({reason:"fail"}),ev(t instanceof Error?t.message:"Something went wrong."),eb(!1)}}};return(0,r.jsxs)("form",{onSubmit:e=>e.preventDefault(),className:"space-y-5",children:[!e1&&(0,r.jsxs)("div",{children:[!eX&&(0,r.jsx)(x.F8,{onClick:e=>{e.resolve(e7?{shippingRates:[e7]}:{})},onShippingAddressChange:e9,onCancel:()=>{null==el||el.update({amount:e2})},onConfirm:te,onReady:e=>{let{availablePaymentMethods:t}=e;return ec(Object.values(null!=t?t:{}).some(Boolean))},options:{buttonHeight:48,paymentMethods:{applePay:"auto",googlePay:"auto",link:"auto",paypal:"auto"},emailRequired:!0,shippingAddressRequired:!0,allowedShippingCountries:[...k.NI],billingAddressRequired:!0}}),ed&&(0,r.jsxs)("div",{className:"my-5 flex items-center gap-3 text-[11px] font-medium uppercase tracking-[0.12em] text-muted-foreground",children:[(0,r.jsx)("div",{className:"h-px flex-1 bg-border"}),"or pay with card",(0,r.jsx)("div",{className:"h-px flex-1 bg-border"})]})]}),e1&&(0,r.jsxs)("div",{className:"rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-3",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-emerald-900",children:(null==Y?void 0:Y.code)?"".concat(Y.code," covers your whole order."):"Your order is fully covered."}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-emerald-700",children:"No payment needed. Just tell us where to ship it."})]}),(0,r.jsxs)("div",{className:"space-y-5",children:[!e1&&(0,r.jsx)(_,{title:"Payment",children:(0,r.jsx)(x.He,{options:{layout:"tabs"}})}),(0,r.jsx)(_,{title:"Contact",children:(0,r.jsxs)("label",{className:"block",children:[(0,r.jsx)("span",{className:"mb-1.5 block text-[13px] font-medium",children:"Email"}),(0,r.jsx)("input",{type:"email",name:"email",autoComplete:"email",inputMode:"email",required:!0,placeholder:"[email protected]",value:ei,onChange:e=>eo(e.target.value),className:"block h-[47px] w-full rounded-[10px] border border-[#e6e6e6] bg-white px-3.5 text-base font-medium text-foreground shadow-sm outline-none placeholder:text-muted-foreground/60 focus:border-transparent focus:ring-[3px]",style:{"--tw-ring-color":"".concat(H||"#0f172a","22")}})]})}),(0,r.jsx)(_,{title:"Shipping address",children:(0,r.jsx)(x.H1,{options:{mode:"shipping",allowedCountries:[...k.NI],fields:{phone:"auto"},autocomplete:{mode:"disabled"},defaultValues:{address:{country:"US"}}},onChange:e=>{var t;em(e.complete),eh(e.value);let n=null==(t=e.value.address)?void 0:t.country;n&&n!==ex&&ef(n.toUpperCase())}})})]}),ey&&(0,r.jsx)("div",{ref:ej,role:"alert","aria-live":"polite",className:"rounded-md border-l-4 border-red-500 bg-red-50 px-3 py-2.5 text-sm font-medium text-red-700",children:ey}),eI&&(0,r.jsxs)("div",{role:"alert","aria-live":"polite",className:"flex items-center justify-between gap-3 rounded-md border-l-4 border-amber-500 bg-amber-50 px-3 py-2.5 text-sm font-medium text-amber-800",children:[(0,r.jsx)("span",{children:"Couldn't work out shipping. Check your internet and try again."}),(0,r.jsx)("button",{type:"button",onClick:e_.reload,className:"shrink-0 underline underline-offset-2 hover:no-underline",children:"Retry"})]}),eK&&(0,r.jsxs)("div",{role:"alert","aria-live":"polite",className:"flex items-center justify-between gap-3 rounded-md border-l-4 border-amber-500 bg-amber-50 px-3 py-2.5 text-sm font-medium text-amber-800",children:[(0,r.jsx)("span",{children:eQ}),!eJ&&(0,r.jsx)("button",{type:"button",onClick:eO.reload,className:"shrink-0 underline underline-offset-2 hover:no-underline",children:"Retry"})]}),e1?(0,r.jsx)(y.$,{type:"button",onClick:e6,className:"h-14 w-full text-base font-semibold tracking-tight shadow-sm transition-transform active:scale-[0.99]",disabled:eg,style:et,children:eg?(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}),"Placing your orderâ¦"]}):"Place order \xb7 $0.00"}):(0,r.jsx)(y.$,{type:"button",onClick:e3,className:"h-14 w-full text-base font-semibold tracking-tight shadow-sm transition-transform active:scale-[0.99]",disabled:!es||eg||null===eP||eK,style:et,children:eg?(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,r.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white/40 border-t-white"}),"Processing your orderâ¦"]}):(0,r.jsx)("span",{className:"inline-flex items-center gap-2",children:eI?"Shipping unavailable":eK?"Tax unavailable":(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.A,{className:"h-4 w-4"}),"".concat(ee?"Start subscription":"Complete order"," \xb7 "),er&&null!==eP&&!ee&&(0,r.jsxs)("span",{className:"text-sm font-medium line-through opacity-60",children:["$",(ea+eP/100).toFixed(2)]}),null!==e0?"$".concat(e0.toFixed(2)):"Calculatingâ¦"]})})}),(0,r.jsxs)("div",{className:"flex items-center justify-center gap-4 text-[11px] text-muted-foreground",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(b.A,{className:"h-3.5 w-3.5"}),"256-bit SSL"]}
1),(0,r.jsx)("span",{"aria-hidden":!0,className:"h-3 w-px bg-border"}),(0,r.jsx)("span",{children:"Powered by Stripe"}),(0,r.jsx)("span",{"aria-hidden":!0,className:"h-3 w-px bg-border"}),(0,r.jsx)("span",{children:"No hidden fees"})]}),(0,r.jsxs)("p",{className:"text-center text-[11px] leading-relaxed text-muted-foreground",children:["By placing your order you agree to our"," ",(0,r.jsx)("a",{href:"https://dough.do/customer-terms",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Terms"})," ","and"," ",(0,r.jsx)("a",{href:"https://dough.do/customer-privacy",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Privacy Policy"}),"."]})]})}var L=n(66692),M=n(86904),q=n(67262),T=n(47716);function $(e){let{htmlFor:t}=e,n=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(L.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),"Promo code"]}),a="flex items-center gap-1.5 text-sm font-medium";return t?(0,r.jsx)("label",{htmlFor:t,className:a,children:n}):(0,r.jsx)("div",{className:a,children:n})}function R(e){let{leadId:t,orderGroupId:n,applied:a,onLeadRepriced:s,brandColor:l}=e,[i,o]=(0,h.useState)(!1),[d,c]=(0,h.useState)(""),[u,m]=(0,h.useState)(!1),[p,x]=(0,h.useState)(null),f=async e=>{x(null),m(!0);try{let{lead:a}=await (0,C.VE)(n?{orderGroupId:n,code:e}:{leadId:t,code:e});s(a),e&&(c(""),o(!1))}catch(e){x(e instanceof C.t9&&0!==e.status?e.message:"Connection issue. Check your internet and try again.")}finally{m(!1)}};return a?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)($,{}),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-emerald-200 bg-emerald-50 px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)(M.A,{className:"h-4 w-4 shrink-0 text-emerald-600"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"truncate text-sm font-semibold text-emerald-900",children:[a.code," applied"]}),(0,r.jsxs)("div",{className:"text-xs text-emerald-700",children:[null!==a.discountPercent?"".concat(a.discountPercent,"% off"):"$".concat(a.discountAmount.toFixed(2)," off"),a.coversShipping&&a.discountAmount>0?" \xb7 shipping included":""]})]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>f(null),disabled:u,className:"shrink-0 rounded-md p-1.5 text-emerald-700 transition-colors hover:bg-emerald-100 disabled:opacity-50","aria-label":"Remove promo code ".concat(a.code),children:u?(0,r.jsx)(q.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(T.A,{className:"h-4 w-4"})})]})]}):i?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)($,{htmlFor:"promo-code"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{id:"promo-code",type:"text",value:d,onChange:e=>c(e.target.value.toUpperCase()),onKeyDown:e=>{"Enter"===e.key&&d.trim()&&!u&&(e.preventDefault(),f(d.trim()))},placeholder:"SARAH10",className:"min-w-0 flex-1 rounded-lg border border-border bg-background px-3 py-2.5 text-[16px] font-medium uppercase tracking-wide outline-none transition-shadow focus:ring-2 focus:ring-ring/30"}),(0,r.jsx)("button",{type:"button",onClick:()=>f(d.trim()),disabled:u||!d.trim(),style:l?{borderColor:l,color:l}:void 0,className:"shrink-0 rounded-lg border border-foreground px-4 py-2.5 text-sm font-semibold transition-colors disabled:opacity-40",children:u?(0,r.jsx)(q.A,{className:"h-4 w-4 animate-spin"}):"Apply"})]}),p&&(0,r.jsx)("p",{role:"alert",className:"text-xs font-medium text-red-600",children:p})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>o(!0),className:"inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",children:[(0,r.jsx)(L.A,{className:"h-3.5 w-3.5"}),"Have a promo code?"]})}var D=n(42260),Y=n(21253),O=n(86972),B=n(65810),V=n(21257),z=n(54477);function H(){var e,t,n,a,d,u,x,f,g,b,y,v,j;let w=(0,p.useRouter)(),{page_id:N,l:k,g:S}=w.query,F=(()=>{let e=w.query.back;if("string"!=typeof e||!e)return null;try{let t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol?t:null}catch(e){return null}})(),[P,A]=(0,h.useState)(null),[E,_]=(0,h.useState)(null),[U,L]=(0,h.useState)(null),[M,q]=(0,h.useState)(null),[T,$]=(0,h.useState)({amountCents:null,country:"US",label:null}),[H,K]=(0,h.useState)(!1),[W,J]=(0,h.useState)([]),Q=(0,h.useCallback)(e=>{var t;$({amountCents:e.amountCents,country:e.country,label:e.label}),K(e.free),J(null!=(t=e.parcels)?t:[])},[]),Z=null!==T.amountCents,X=Z?T.amountCents/100:0,[ee,et]=(0,h.useState)(!1),[en,ea]=(0,h.useState)(null),er=ee?"Unavailable":"Calculatingâ¦",[es,el]=(0,h.useState)(!1);if((0,h.useEffect)(()=>
1{if(!es)return;let e=e=>{"Escape"===e.key&&el(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[es]),(0,h.useEffect)(()=>{if("string"!=typeof N)return;let e=!1;return s.A.get("/api/page/".concat(N,"?website=live")).then(t=>{e||A(t.data)}).catch(t=>{console.error("[Checkout] Failed to load page:",t),e||q("Could not load product. Please try again.")}),()=>{e=!0}},[N]),(0,h.useEffect)(()=>{let e="string"==typeof S&&S?S:null,t="string"==typeof k&&k?k:null;if(!e&&!t)return;let n=!1;return(e?(0,C.$f)(e):(0,C.SK)(t)).then(e=>{n||_(e)}).catch(e=>{console.error("[Checkout] Failed to load lead:",e),n||q(e instanceof C.t9&&0===e.status?"Connection issue. Check your internet and try again.":"Your checkout session has expired. Please try again.")}),()=>{n=!0}},[k,S]),(0,h.useEffect)(()=>{let e=null==P?void 0:P.page_id;if(!e)return;let t=!1;return fetch((0,V.wV)(e,"model1")).then(e=>e.json()).then(e=>{!t&&(null==e?void 0:e.imageUrl)&&L(e.imageUrl)}).catch(()=>{fetch((0,V.wV)(e,"reference")).then(e=>e.json()).then(e=>{!t&&(null==e?void 0:e.imageUrl)&&L(e.imageUrl)}).catch(()=>{})}),()=>{t=!0}},[null==P?void 0:P.page_id]),M)return(0,r.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 p-6 text-center",children:[(0,r.jsx)("p",{className:"text-red-600",children:M}),(0,r.jsx)("button",{type:"button",onClick:()=>window.location.reload(),className:"rounded-lg bg-neutral-900 px-4 py-2 text-sm font-medium text-white",children:"Try again"})]});if(!P||!E)return(0,r.jsx)(G,{});if(P.owner_subscription_blocked)return(0,r.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-muted/30 p-6",children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-2xl bg-white p-7 text-center shadow-lg",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-neutral-900",children:"This product is no longer available at the moment."}),(0,r.jsx)("p",{className:"mt-2 text-sm text-neutral-600",children:"Your card has not been charged. Please check back later."})]})});if((0,O.NL)(P)&&E.pageId===P.page_id&&!(0,B.M2)(E.productVariant))return(0,r.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-muted/30 p-6",children:(0,r.jsxs)("div",{className:"w-full max-w-sm rounded-2xl bg-white p-7 text-center shadow-lg",children:[(0,r.jsx)("h1",{className:"text-lg font-semibold text-neutral-900",children:"This product is sold out."}),(0,r.jsx)("p",{className:"mt-2 text-sm text-neutral-600",children:"Your card has not been charged. Please check back later."})]})});let ei=(0,z.Ou)(P),eo=ei.content.productName||"Product",ed=ei.content.brandName||"",ec=(null==(e=ei.theme.colors)?void 0:e.primary)||void 0,eu=(0,B.M2)(E.productVariant)?E.productVariant:null,em=eu?null:null!=(g=E.productVariant)?g:null,ep=eu?(0,B.jl)(eu,eo):eo,eh=eu?null!=(b=null==(t=eu.find(e=>e.imageUrl))?void 0:t.imageUrl)?b:null:U,ex="subscription"===E.orderType,ef=E.subscription?"month"===E.subscription.occurrence.interval?"Every ".concat(1===E.subscription.occurrence.intervalCount?"month":"".concat(E.subscription.occurrence.intervalCount," months")):"Every ".concat(E.subscription.occurrence.intervalCount," weeks"):null,eg=ex?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-1 text-[11px] font-semibold text-emerald-700",style:ec?{backgroundColor:"".concat(ec,"12"),color:ec}:void 0,children:[(0,r.jsx)(l,{className:"h-3 w-3"}),"Subscription"]}):null,eb=!eu||eu.every(e=>{var t;return(null!=(t=e.pageId)?t:E.pageId)===P.page_id}),ey=null!=(y=null==(n=E.subscription)?void 0:n.discountPercent)?y:eb&&ei.content.discountPercent||0,ev=ey>0&&ey<100,ej=eu?(0,B.vU)(eu):E.unitPrice*E.quantity,ew=ev?ej/(1-ey/100):ej,eN=null!=(v=null==(a=E.promo)?void 0:a.discountAmount)?v:0,ek=Math.max(0,ew-ej),eC=ev&&ek>.005,eS=!!(null==(d=E.promo)?void 0:d.coversShipping)&&E.totalAmount<=0,eF=H||eS,eP=eF?0:X,eA=E.totalAmount+eP+(null!=en?en:0)/100,eE=eF?"Free shipping":Z?"$".concat(X.toFixed(2)," shipping"):ee?"Shipping unavailable":"Calculating shipping",e_="".concat(window.location.origin).concat((window.location.pathname||"/").replace(/\/checkout$/,"")||"/"),eI=F?"".concat(e_,"?back=").concat(encodeURIComponent(F.toString())):e_;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c(),{children:[(0,r.jsxs)("title",{children:["Checkout \xb7 ",ed||ep]}),(0,r.jsx)("meta",{name:"robots",content:"noindex"})]}),(0,r.jsxs)("div",{className:"min-h-screen bg-muted/30",children:[(0,r.jsx)("header",{className:"relative z-30 bg-background lg:border-b",children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 pb-2 pt-3 sm:px-6 lg:py-4",children:[F?(0,r.jsxs)("a",{href:F.toString(),className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[(0,r.jsx)(i.A,{className:"h-4 w-4"}),(0,r.jsxs)("span",{className:"hidden sm:inline",children:["Back to ",F.hostname.replace(/^www\./,"")]}),(0,r.jsx)("span",{className:"sm:hidden",children:"Back"})]}):(0,r.jsxs)("a",{href:(0,Y.Vp)(window.location.pathname,P.page_id)||"/",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[(0,r.jsx)(i.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Back to store"}),(0,r.jsx)("span",{className:"sm:hidden",children:"Back"})]}),(0,r.jsx)("div",{className:"text-base font-semibold",style:ec?{color:ec}:void 0,children:ed||"Checkout"}),(0,r.jsx)("div",{className:"w-[60px] sm:w-[100px]"})]})}),es&&(0,r.jsx)("div",{className:"fixed inset-0 z-10 bg-black/40 transition-opacity lg:hidden","aria-hidden":!0,onClick:()=>el(!1)}),(0,r.jsxs)("div",{className:"sticky top-0 z-20 border-b bg-background shadow-sm lg:hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>el(e=>!e),"aria-expanded":es,"aria-controls":"mobile-order-summary",className:"flex w-full items-center gap-3 px-4 py-3 text-left",children:[(0,r.jsx)("div",{className:"relative h-10 w-10 flex-shrink-0 overflow-hidden rounded-md border bg-muted",style:ec?{backgroundColor:"".concat(ec,"10")}:void 0,children:eu?eh&&(0,r.jsx)(D.A,{src:eh,alt:ep,width:40,height:40,className:"h-full w-full object-cover"}):U&&(0,r.jsx)(m(),{src:U,alt:eo,fill:!0,className:"object-cover"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate text-sm font-medium",children:ep}),(0,r.jsxs)("div",{className:"truncate text-xs text-muted-foreground",children:[(0,r.jsx)("span",{className:eF?"text-emerald-700":void 0,children:eE})," \xb7 ".concat(es?"Hide details":"Show details")]})]}),(0,r.jsxs)("div",{className:"text-right",children:[(eC||eN>0||!!E.basketPromo)&&Z&&(0,r.jsxs)("div",{className:"text-[11px] text-muted-foreground line-through",children:["$",(ew+eP).toFixed(2)]}),(0,r.jsx)("div",{className:"text-sm font-semibold",children:Z?"$".concat(eA.toFixed(2)):er})]}),(0,r.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground transition-transform ".concat(es?"rotate-180":""),"aria-hidden":!0})]}),(0,r.jsx)("div",{id:"mobile-order-summary",className:"grid overflow-hidden transition-[grid-template-rows] duration-200 ease-out ".concat(es?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,r.jsx)("div",{className:"min-h-0",children:(0,r.jsxs)("div",{className:"space-y-2 border-t bg-muted/30 px-4 py-3 text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 pb-1",children:[(0,r.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Order Summary"}),eg]}),eu?eu.map((e,t)=>{var n;return(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[e.productName||e.displayLabel,e.productName&&e.displayLabel&&e.displayLabel!==e.productName?" \xb7 ".concat(e.displayLabel):"",e.quantity>1?" \xd7 ".concat(e.quantity):""]}),(0,r.jsxs)("span",{className:"tabular-nums",children:["$",(e.unitPrice*e.quantity).toFixed(2)]})]},"".concat(null!=(n=e.pageId)?n:"","#").concat(e.displayLabel,"#").concat(t))}):(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("span",{className:"text-muted-foreground",children:[ef?"Subscription":eo,ef?", ".concat(ef.toLowerCase()):"",(null==em?void 0:em.displayLabel)?" \xb7 ".concat(em.displayLabel):""]}),(0,r.jsxs)("span",{children:["Qty ",E.quantity]})]}),(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:"Subtotal"}),(0,r.jsxs)("span",{className:eC?"line-through":"",children:["$",(eC?ew:ej).toFixed(2)]})]}),eC&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsx)("span",{children:"Discount"}),(0,r.jsxs)("span",{children:["â$",ek.toFixed(2)]})]}),eN>0&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsxs)("span",{children:["Promo",(null==(u=E.promo)?void 0:u.code)?" \xb7 ".concat(E.promo.code):""]}),(0,r.jsxs)("span",{children:["â$",eN.toFixed(2)]})]}),E.basketPromo&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsx)("span",{children:E.basketPromo.label}),(0,r.jsxs)("span",{children:["â$",E.basketPromo.amount.toFixed(2)]})]}),(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:eF?"Free shipping":"Shipping".concat(T.label?" \xb7 ".concat(T.label):"")}),(0,r.jsx)("span",{children:Z?eF?(0,r.jsxs)("span",{className:"line-through text-muted-foreground",children:["$",X.toFixed(2)]}):"$".concat(X.toFixed(2)):er})]}),W.length>1&&W.map((e,t)=>{var n,a;return(0,r.jsxs)("div",{className:"flex justify-between pl-3 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:(null==(n=E.parcels)||null==(a=n.find(t=>t.pageId===e.pageId))?void 0:a.productName)||"Shipment ".concat(t+1)}),(0,r.jsx)("span",{children:e.shippingFree?"Free":"$".concat((e.shippingCents/100).toFixed(2))})]},e.pageId)}),null!==en&&en>0&&(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:"Sales tax"}),(0,r.jsxs)("span",{children:["$",(en/100).toFixed(2)]})]}),(0,r.jsxs)("div",{className:"flex justify-between border-t pt-2 text-base font-semibold",children:[(0,r.jsx)("span",{children:"Total"}),(0,r.jsx)("span",{children:Z?"$".concat(eA.toFixed(2)):er})]}),"preorder"===E.orderType&&(0,r.jsx)("div",{className:"mt-2 rounded-md bg-amber-50 px-3 py-2 text-xs text-amber-900",children:"This is a pre-order, the final product may be a little different. Funds are held until the launch goal is met."})]})})})]}),(0,r.jsxs)("main",{className:"mx-auto max-w-6xl px-4 py-8 sm:px-6",children:[(0,r.jsx)("h1",{className:"mb-6 hidden text-2xl font-semibold tracking-tight lg:block",children:"Checkout"}),(0,r.jsxs)("div",{className:"grid gap-8 lg:grid-cols-[minmax(0,1fr)_380px]",children:[(0,r.jsxs)("section",{className:"space-y-4",children:[(E.promoAvailable||E.promo)&&(0,r.jsx)("div",{className:"rounded-lg border bg-background p-4 shadow-sm sm:px-6",children:(0,r.jsx)(R,{leadId:E.leadId,orderGroupId:E.orderGroupId,applied:E.promo,onLeadRepriced:_,brandColor:ec})}),(0,r.jsx)("div",{className:"rounded-lg border bg-background p-5 shadow-sm sm:p-6",children:(0,r.jsx)(I,{leadId:E.leadId,orderGroupId:E.orderGroupId,pageId:E.pageId,productName:eo,unitPrice:E.unitPrice,productAmount:E.totalAmount,promo:E.promo,quantity:E.quantity,orderType:E.orderType,subscriptionOccurrence:null!=(j=null==(x=E.subscription)?void 0:x.occurrence)?j:null,productVariant:em,affiliateId:E.affiliateLinkId,brandColor:ec,successUrl:eI,onShippingChange:Q,onTaxChange:ea,onShippingUnavailable:et,discountAmount:ek,discountPercent:ev?ey:void 0})})]}),(0,r.jsx)("aside",{className:"hidden lg:block",children:(0,r.jsxs)("div",{className:"rounded-lg border bg-background p-5 shadow-sm lg:sticky lg:top-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-3",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:"Order Summary"}),eg]}),eu?(0,r.jsx)("div",{className:"space-y-3",children:eu.map((e,t)=>{var n;return(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border bg-muted",style:ec?{backgroundColor:"".concat(ec,"10")}:void 0,children:e.imageUrl&&(0,r.jsx)(D.A,{src:e.imageUrl,alt:e.displayLabel,width:64,height:64,className:"h-full w-full object-cover"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate font-medium",children:e.productName||e.displayLabel}),(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Qty ",e.quantity,e.productName&&e.displayLabel&&e.displayLabel!==e.productName?" \xb7 ".concat(e.displayLabel):""]})]}),(0,r.jsxs)("div",{className:"text-right text-sm font-medium tabular-nums",children:["$",(e.unitPrice*e.quantity).toFixed(2)]})]},"".concat(null!=(n=e.pageId)?n:"","#").concat(e.displayLabel,"#").concat(t))})}):(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"relative h-20 w-20 flex-shrink-0 overflow-hidden rounded-md border bg-muted",style:ec?{backgroundColor:"".concat(ec,"10")}:void 0,children:U&&(0,r.jsx)(m(),{src:U,alt:eo,fill:!0,className:"object-cover"})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate font-medium",children:eo}),ef&&(0,r.jsx)("div",{className:"mt-1 text-sm font-medium text-muted-foreground",children:ef}),(null==em?void 0:em.displayLabel)&&(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:em.displayLabel}),(0,r.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Qty ",E.quantity]})]}),(0,r.jsxs)("div",{className:"text-right text-sm",children:[(eC||eN>0||!!E.basketPromo)&&(0,r.jsxs)("div",{className:"text-xs text-muted-foreground line-through",children:["$",ew.toFixed(2)]}),(0,r.jsxs)("div",{className:"font-medium",children:["$",E.totalAmount.toFixed(2)]})]})]}),(0,r.jsxs)("div",{className:"mt-5 space-y-2 border-t pt-4 text-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:"Subtotal"}),(0,r.jsxs)("span",{children:["$",(eC?ew:ej).toFixed(2)]})]}),eC&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsx)("span",{children:"Discount"}),(0,r.jsxs)("span",{children:["â$",ek.toFixed(2)]})]}),eN>0&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsxs)("span",{children:["Promo",(null==(f=E.promo)?void 0:f.code)?" \xb7 ".concat(E.promo.code):""]}),(0,r.jsxs)("span",{children:["â$",eN.toFixed(2)]})]}),E.basketPromo&&(0,r.jsxs)("div",{className:"flex justify-between font-medium text-emerald-700",children:[(0,r.jsx)("span",{children:E.basketPromo.label}),(0,r.jsxs)("span",{children:["â$",E.basketPromo.amount.toFixed(2)]})]}),(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:eF?"Free shipping":"Shipping".concat(T.label?" \xb7 ".concat(T.label):"")}),(0,r.jsx)("span",{children:Z?eF?(0,r.jsxs)("span",{className:"line-through text-muted-foreground",children:["$",X.toFixed(2)]}):"$".concat(X.toFixed(2)):er})]}),null!==en&&en>0&&(0,r.jsxs)("div",{className:"flex justify-between text-muted-foreground",children:[(0,r.jsx)("span",{children:"Sales tax"}),(0,r.jsxs)("span",{children:["$",(en/100).toFixed(2)]})]}),(0,r.jsxs)("div",{className:"flex justify-between border-t pt-3 text-base font-semibold",children:[(0,r.jsx)("span",{children:"Total"}),(0,r.jsx)("span",{children:Z?"$".concat(eA.toFixed(2)):er})]})]}),"preorder"===E.orderType&&(0,r.jsx)("div",{className:"mt-4 rounded-md bg-amber-50 px-3 py-2 text-xs text-amber-900",children:"This is a pre-order, the final product may be a little different. Funds are held until the launch goal is met."})]})})]})]})]})]})}function G(){return(0,r.jsx)("div",{className:"min-h-screen bg-muted/30",children:(0,r.jsxs)("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[(0,r.jsx)("div",{className:"h-8 w-48 animate-pulse rounded bg-muted"}),(0,r.jsxs)("div",{className:"mt-8 grid gap-8 lg:grid-cols-[minmax(0
1,1fr)_380px]",children:[(0,r.jsxs)("div",{className:"space-y-4 rounded-lg border bg-background p-6",children:[(0,r.jsx)("div",{className:"h-12 animate-pulse rounded bg-muted"}),(0,r.jsx)("div",{className:"h-12 animate-pulse rounded bg-muted"}),(0,r.jsx)("div",{className:"h-32 animate-pulse rounded bg-muted"}),(0,r.jsx)("div",{className:"h-12 animate-pulse rounded bg-muted"})]}),(0,r.jsx)("div",{className:"rounded-lg border bg-background p-6",children:(0,r.jsx)("div",{className:"h-20 animate-pulse rounded bg-muted"})})]})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.