const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.692A8Xyg.js","2c1ab0fe.Dbn2KvkT.js","164ad2e3.FTBuhkTQ.js","4b4bc88f.z1yoAwwH.js","app.CooG55fE.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BZwmSkmD.css","69fae6d4.DwAzRqQZ.js","f67abd2c.nPTvXZJz.js","e12db40c.DF32J314.js","9dba8418.NidtnoQ4.js","60a453ce.B80X1bY8.js","3d539943.CHiZMBrZ.js","assets/hydrate.noyuxvQL.css","6bfea526.D62LLGBP.js","ac5a19ff.la4o1mqh.js","598fef4e.CSEeJ9se.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.ByPUY0fc.js","22345fd4.DfRWVvfi.js","4b1c22b7.Tf9Z0cR8.js","assets/PaymentLine.DT05kVlY.css","a422df8c.Cf87EYCO.js","efa0389a.BBF5Yj3v.js","assets/Choice.CrYuHUmO.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.CxMx1fOJ.js","08a3b809.Ce8w6gv6.js","d25d1b95.DYvnxyL-.js","bf513f9c.B3u9Jber.js","e39bc11c.CPXDRKy_.js","7a8217fd.qHfhLK3T.js","c6b02d73.Ba1sudbg.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","bfe75f31.CeEm_sIx.js","assets/Tipping.BcTJoNaV.css","dfc03c53.mwpCa0Y6.js","86720dbb.Ctpif1U0.js","dfca5da5.DtiE-B_a.js","dae24aab.CVNnVl1k.js","assets/Section.CU18S7Ap.css","55098bf1.C9NOZwx2.js","0e67bd3b.rVVcKKmW.js","74835653.BLveyRHP.js","3ca8ef7e.CoLpsNbY.js","2bac2c53.CBL7jHzd.js","a9fa9fda.CPgABguf.js","ca3e798e.BBho0lps.js","47b970b2.DCFIpVFI.js","assets/PhoneField.uZEuHncj.css","064f6ac1.DHFjHCTV.js","assets/Popover.Bi1nHaU-.css","assets/BillingAddressForm.BdwN7V1K.css","f692f62f.BHFpWwLS.js","9babe369.SH-YgBx8.js","b684bff6.bwJyjEIe.js","assets/RedirectionNotice.DgiInWJ-.css","79974aab.BEktvauy.js","58314944.C8o0ZBBk.js","434e3b0a.oup8Ur0H.js","assets/PaymentMethodProgressionHost.C0BOgdmL.css","50130ded.Dms84T1v.js","65f3d4da.Bb3QiqCm.js","31cc568e.95lmLO5k.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.a4UUxC0y.js","b9c0319a.CZrWIGzl.js","dffdfb34.BM70-hlD.js","1f5e7811.a2EjfHnG.js","assets/ShopPayLogo.87JMHPUK.css","1a6c2867.D8mTtJ_Z.js","assets/ShopPayVerificationTrigger.BnDF3H7t.css","2fdb3dd3.Dn592ndi.js","17425706.Du5FyTeZ.js","cb5cf153.DR2k6GTr.js","e3e348f2.DlRIwDFx.js","71ae3d5c.BgAyZsA9.js","cb38e5c2.BMWpCITo.js","78ab3dd0.UjAWxVn0.js","89e2d30a.BHZyUNbR.js","ed9f2238.3jB1CnRm.js","6fb6f9d8.D6yUmBOq.js","1444e6bd.CLS56A6L.js","0b8657b8.CiDJmOSt.js","f49d4216.CilLybTV.js","7b0c98ea.CmmnLN9P.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.B6GNsBAl.js","f58f39d8.CX1OVCRt.js","e03065ab.CTM9K0Hk.js","assets/VatNumberValidationField.CAYYnuvZ.css","ddf59287._uCuCuxL.js","17e57de1.C4OivbHV.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.DbyxZj2K.js","ff358f64.CxAdbpNt.js","ca0c3e72.CvmHYoux.js","21cc90a2.DHzOO82q.js","64de7b49.D8TZokHI.js","347b440c.Cr4Lo5jt.js","9ce08e25.CVFGyfHb.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.KXiBhcvk.js","39921a74.bahNnP3U.js","assets/Switch.BS8yVgoP.css","ec391382.Bx3C9xNN.js","24773686.CplnJ3xw.js","2210eadb.DF0gIp_2.js","71b60e0a.DfPLdYsH.js","assets/StickyPayButton.D-gNjNDa.css","01973ac7.D5XeeIWW.js","945a08d6.DsBMy-Sv.js","7bc8057b.jS2i-qiP.js","assets/constants.xO_7ctnq.css","a25deb9a.e6U0ww9n.js","2b89a178.BVP6w6_h.js","910cd6e2.BdYIBApg.js","181d38d3.CkWlyM7r.js","792bb671.B3OvVnSg.js","assets/Middot.D7Ujmshx.css","9ca7d819.NFD4561s.js","f51e663e.BOJ2cLC5.js","8e79be58.BLZlQ4SW.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.BtzmBOQP.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingMethods.DU0m5rdF.css","ca5e9c49.C4Dgo0WK.js","f3e117aa.DNLKh0Hn.js","68887467.B7U-77H5.js","ca8e826d.v8Ae0DkP.js","assets/Avatar.gBkEAe_p.css","22de7c07.CCunP4QZ.js","384a4e10.CgRnecux.js","17a5f1e4.DLFoxVmM.js","0e4087ec.BYUPwOz2.js","7aefefff.BQWXUkDp.js","b3389d5c.JToQX7EK.js","73a9b0a0.D8197R8-.js","25604ae0.56pfEpxV.js","dada7e07.d_Jgr9HV.js","e0989459.CIFtnx6c.js","cdfd59e6.CxVDNOs9.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.DX71sl9j.js","e129c76e.CdUlGY39.js","d4ea2faa.CFmOkqFN.js","fe885b80.D6XeXzR1.js","f78726c8.COms9s2w.js","assets/hooks.BDst-6PZ.css","e477f96c.DtwGO4P4.js","d7065744.DH5rilol.js","7ee73f43.ChJI3xSJ.js","0c0ad074.BVCUV6D7.js","assets/useShopPayButtonClassName.D-F4uQ9M.css","8fe56fc9._gTwhRQ_.js","87bfafec.CxwEzGHg.js","051149c8.lHD9iIAq.js","assets/PayButtonSection.CZuxzxFG.css","d2e6a587.BTa3jGZQ.js","assets/MobileOrderSummary.BlloiNDx.css","assets/BelowTheFoldContent.BKRoWsh4.css"])))=>i.map(i=>d[i]); import{_ as e}from"./app.CooG55fE.js";import{u as n,m as t,D as a,M as i,i as r,j as o,E as l,h as s,v as u,y as c,z as d,k as p,q as h,N as m,w as v,p as y,T as g,t as f,G as b,o as _,n as C,ai as P,F as S,O as A,g as k}from"./2c1ab0fe.Dbn2KvkT.js";import{H as E,bS as w,aY as O,fM as I,L as R,hU as T,ci as L,dx as N,N as D,ar as M,b as B,k as x,S as F,ag as V,B as H,em as z,cv as j,bL as U,bM as G,cu as Y,eR as W,G as q,ds as $,a7 as K,hA as J,gN as X,f as Z,Z as Q,hV as ee,hW as ne,c as te,d$ as ae,bC as ie,hX as re,ct as oe,fs as le,cr as se,cq as ue,eZ as ce,bB as de,p as pe,de as he,f2 as me,d as ve,Q as ye,b_ as ge,m as fe,dZ as be,w as _e,hY as Ce,b6 as Pe,cU as Se,af as Ae,eW as ke,b7 as Ee,a4 as we,hZ as Oe,e$ as Ie,aJ as Re,co as Te,d1 as Le,h_ as Ne,h$ as De,i0 as Me,i1 as Be,fj as xe,eE as Fe,c_ as Ve,hb as He,i2 as ze,i3 as je,c5 as Ue,i4 as Ge,c8 as Ye,cP as We,f0 as qe,eC as $e,bT as Ke,i5 as Je,i6 as Xe,df as Ze,dA as Qe,dD as en,i7 as nn,dv as tn,dy as an,c6 as rn,i8 as on,i9 as ln,dB as sn,dC as un,cR as cn,hj as dn,bO as pn,U as hn,f4 as mn,c9 as vn,fb as yn,fg as gn,br as fn,aQ as bn,X as _n,ia as Cn,c4 as Pn,ib as Sn,ic as An,cD as kn,eP as En,f1 as wn,fe as On,f5 as In,id as Rn,ie as Tn,an as Ln,aH as Nn,M as Dn,cF as Mn,ig as Bn,o as xn,ih as Fn,v as Vn,ii as Hn,cQ as zn,f9 as jn,cb as Un,cz as Gn,cf as Yn,dl as Wn,f6 as qn,dm as $n,j as Kn,aD as Jn,$ as Xn,fl as Zn,q as Qn,ij as et,ap as nt,eY as tt,ho as at,aC as it,ak as rt,al as ot}from"./164ad2e3.FTBuhkTQ.js";import{d as lt,cJ as st,a4 as ut,W as ct,jC as dt,jD as pt,c6 as ht,bY as mt,c2 as vt,jE as yt,gS as gt,hB as ft,aO as bt,hz as _t,hx as Ct,aL as Pt,hA as St,jr as At,jF as kt,bU as Et,aK as wt,bX as Ot,n as It,jG as Rt,gb as Tt,c7 as Lt,ba as Nt,bw as Dt,hf as Mt,I as Bt,k as xt,jH as Ft,F as Vt,ae as Ht,dv as zt,aB as jt,C as Ut,f7 as Gt,ac as Yt,jI as Wt,fv as qt,_ as $t,jJ as Kt,G as Jt,bb as Xt,jK as Zt,jL as Qt,ji as ea,N as na,ci as ta,ez as aa,H as ia,eX as ra,er as oa,a7 as la,e2 as sa,bn as ua,iP as ca,ag as da,gx as pa,b8 as ha,cf as ma,d_ as va,jM as ya,y as ga,ai as fa,iT as ba,jN as _a,jO as Ca,jP as Pa,iV as Sa,gB as Aa,u as ka,gQ as Ea,V as wa,jQ as Oa,fb as Ia,f8 as Ra,d8 as Ta,bh as La,cL as Na,be as Da,cK as Ma,it as Ba,K as xa,dU as Fa,eV as Va,fy as Ha,iU as za,bt as ja,ax as Ua,jR as Ga,dk as Ya,aw as Wa,di as qa,d4 as $a,bi as Ka,jS as Ja,jT as Xa,jU as Za,jV as Qa,jW as ei,jX as ni,i$ as ti,bp as ai,jY as ii,jZ as ri,iY as oi,a6 as li,j_ as si,B as ui,j$ as ci,au as di,k0 as pi,k1 as hi,k2 as mi,k3 as vi,q as yi,h as gi,iI as fi,iJ as bi,k4 as _i,k5 as Ci,at as Pi,br as Si,iM as Ai}from"./4b4bc88f.z1yoAwwH.js";import{G as ki,H as Ei,C as wi,J as Oi,m as Ii,U as Ri,g as Ti,I as Li,q as Ni,a as Di,K as Mi,c as Bi,M as xi,F as Fi,N as Vi,O as Hi,Q as zi,R as ji,i as Ui,T as Gi,W as Yi,X as Wi,o as qi,Y as $i,Z as Ki,_ as Ji,$ as Xi,a0 as Zi,n as Qi,r as er,a1 as nr,D as tr,j as ar,a2 as ir,k as rr,a3 as or,t as lr,v as sr,l as ur,V as cr,x as dr,E as pr,w as hr}from"./dffdfb34.BM70-hlD.js";import{k as mr,D as vr,u as yr,s as gr,b as fr,c as br,l as _r,a as Cr,H as Pr}from"./0e9ee714.KXiBhcvk.js";import{X as Sr,U as Ar,N as kr,W as Er,f as wr,Y as Or,Z as Ir,h as Rr,i as Tr,G as Lr,S as Nr,b as Dr,_ as Mr,$ as Br,a0 as xr,a1 as Fr,a2 as Vr,c as Hr,n as zr,v as jr,x as Ur,p as Gr,q as Yr,r as Wr,z as qr,s as $r,A as Kr,V as Jr,a3 as Xr,a4 as Zr,d as Qr,u as eo,t as no,T as to,e as ao}from"./6bfea526.D62LLGBP.js";import{c as io,a as ro,S as oo,M as lo}from"./dfca5da5.DtiE-B_a.js";import{T as so,S as uo,M as co}from"./79974aab.BEktvauy.js";import{R as po,P as ho,C as mo}from"./e77f7fe0.ByPUY0fc.js";import{A as vo,C as yo,u as go,S as fo}from"./0e67bd3b.rVVcKKmW.js";import{a as bo,u as _o,I as Co,P as Po,g as So,f as Ao}from"./ddf59287._uCuCuxL.js";import{E as ko,u as Eo,b as wo,a as Oo,c as Io}from"./01973ac7.D5XeeIWW.js";import{u as Ro}from"./945a08d6.DsBMy-Sv.js";import{c as To,a as Lo}from"./58314944.C8o0ZBBk.js";import{a as No,c as Do,S as Mo,u as Bo,b as xo}from"./bf513f9c.B3u9Jber.js";import{P as Fo}from"./598fef4e.CSEeJ9se.js";import{O as Vo,W as Ho,c as zo,b as jo}from"./7a8217fd.qHfhLK3T.js";import{a as Uo,b as Go,C as Yo}from"./efa0389a.BBF5Yj3v.js";import{U as Wo,I as qo}from"./7bc8057b.jS2i-qiP.js";import{B as $o,A as Ko}from"./74835653.BLveyRHP.js";import{g as Jo,d as Xo,c as Zo,e as Qo}from"./d25d1b95.DYvnxyL-.js";import{S as el,E as nl,e as tl,r as al,d as il,g as rl,f as ol,u as ll}from"./a25deb9a.e6U0ww9n.js";import{b as sl,a as ul,t as cl,d as dl,u as pl,c as hl}from"./2b89a178.BVP6w6_h.js";import{b as ml}from"./f67abd2c.nPTvXZJz.js";import{a as vl,v as yl,b as gl,u as fl}from"./1f5e7811.a2EjfHnG.js";import{S as bl}from"./39921a74.bahNnP3U.js";import{u as _l,a as Cl,M as Pl,b as Sl}from"./b684bff6.bwJyjEIe.js";import{C as Al,b as kl,E as El}from"./a422df8c.Cf87EYCO.js";import{u as wl,h as Ol}from"./17425706.Du5FyTeZ.js";import{C as Il}from"./bfe75f31.CeEm_sIx.js";import{u as Rl,c as Tl,b as Ll}from"./24773686.CplnJ3xw.js";import{S as Nl}from"./6fb6f9d8.D6yUmBOq.js";import{S as Dl}from"./cb5cf153.DR2k6GTr.js";import{S as Ml}from"./cb38e5c2.BMWpCITo.js";import{a as Bl,S as xl}from"./3d539943.CHiZMBrZ.js";import{u as Fl,a as Vl}from"./22345fd4.DfRWVvfi.js";import{v as Hl}from"./9dba8418.NidtnoQ4.js";import{P as zl}from"./47b970b2.DCFIpVFI.js";import{I as jl}from"./55098bf1.C9NOZwx2.js";import{a as Ul}from"./ed9f2238.3jB1CnRm.js";import{A as Gl,C as Yl}from"./4b1c22b7.Tf9Z0cR8.js";import{V as Wl,M as ql,u as $l,a as Kl,S as Jl,R as Xl,b as Zl}from"./910cd6e2.BdYIBApg.js";import{b as Ql,a as es,g as ns}from"./e12db40c.DF32J314.js";import{r as ts}from"./dae24aab.CVNnVl1k.js";import{D as as,u as is,S as rs}from"./9ca7d819.NFD4561s.js";import{g as os}from"./65f3d4da.Bb3QiqCm.js";import{b as ls,u as ss,a as us}from"./64de7b49.D8TZokHI.js";import{u as cs,S as ds,a as ps,E as hs}from"./347b440c.Cr4Lo5jt.js";import{M as ms}from"./ca0c3e72.CvmHYoux.js";import{b as vs}from"./2fdb3dd3.Dn592ndi.js";import{u as ys}from"./ca5e9c49.C4Dgo0WK.js";import{f as gs,i as fs}from"./e3e348f2.DlRIwDFx.js";import{S as bs}from"./f3e117aa.DNLKh0Hn.js";import{S as _s}from"./1a6c2867.D8mTtJ_Z.js";import{T as Cs}from"./7b0c98ea.CmmnLN9P.js";import{F as Ps}from"./3ca8ef7e.CoLpsNbY.js";import{D as Ss}from"./f49d4216.CilLybTV.js";import{S as As}from"./f51e663e.BOJ2cLC5.js";import{m as ks}from"./21cc90a2.DHzOO82q.js";function Es(){const{i18n:e}=lt();return n(E,{level:1,children:e.translate("embed.header.review_order")})}function ws(){const{hasError:e}=w(st),i=bo().value,{i18n:r,observability:o}=lt(),l=r.translate("review.blocks.change_link_label"),{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:u}}=ut(),c=t(()=>{const e=u.value;return e.status===O.Available?e.sdk:void 0});if(!i)return null;const d=I(i.method.walletParams)?.checkout_session_id;return n(a,{when:c,children:t=>n(R,{onClick:()=>{o.counter({name:"wallet_change_link_clicked",value:1,attributes:{wallet:ct.BuyWithPrime,link:"payment_method"}});try{t.buywithprime.changePaymentMethod({amazonPayOptions:{amazonCheckoutSessionId:d,isDeclined:e}})}catch(n){s.value=!0,o.error(new T(`Error on changing buyer payment method. Details: ${n}`,{cause:n}))}},children:l})})}function Os(){const e=lt(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(ki,{wallet:ct.BuyWithPrime,isSdkOnly:!0}),changeLink:n(ws,{})}:{rollupId:"amazonPayDetails",sdkButton:n(vo,{isSdkOnly:!0}),changeLink:n(Sr,{})}}(e);return n(i,{children:[a.sdkButton,n(po,{id:a.rollupId,label:t.translate("payment.title"),primaryContent:n(Is,{}),primaryAction:a.changeLink})]})}function Is(){const{brand:e,descriptor:t}=Ar().value,a=L(),i=dt(),r=N();return a.value?i.value?n(kr,{vaulted:!0,reason:"giftCard"}):t&&r.value?n(Er,{brand:e,descriptor:t}):n(D,{}):n(kr,{vaulted:!0,reason:"freeOrder"})}function Rs({label:e}){const{i18n:t}=lt();return M(),n(i,{children:[n(B,{accessibilityRole:"status",children:n(x,{accessibilityVisibility:"exclusive",children:t.translate("vaulted.loading_section",{section:e(t)})})}),n(F,{gap:"small-300",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"large"}),n(D,{inlineSize:"small"})]})]})}class Ts{#e=c(0);#n=d(()=>this.#e.value>0);get hasFailures(){return this.#n}register(){return this.#e.value+=1,()=>{this.#e.value-=1}}}const Ls=r(null);function Ns({children:e}){const t=u(()=>new Ts,[]);return n(Ls.Provider,{value:t,children:e})}function Ds(){const{i18n:e}=lt(),t=l(Ls);return t?n(a,{when:()=>t.hasFailures.value,children:n(B,{paddingBlockEnd:"base",children:n(ko,{bannerId:"VaultedRollupContentsLoadError",errorType:V.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:n(F,{gap:"small-400",alignItems:"start",children:[n(x,{children:e.translate("error_page.terminal.message")}),n(H,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function Ms({children:e}){const t=l(Ls),a=t?.hasFailures.value??!1;return n(B,{inert:a,opacity:a?50:void 0,children:e})}const Bs=()=>e(()=>import("./26e63865.692A8Xyg.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));function xs(){return p(Bs)}function Fs(e,t,a){return function({displayName:e,load:t,loadingLabel:a}){return o({displayName:e,load:t,suspense:!1,renderLoading:()=>n(Rs,{label:a}),useError:function(n){const{observability:t}=lt(),a=l(Ls);M({active:Boolean(n)}),s(()=>{if(n)return t.error(n,{metadata:{vaulted:{component:e,failure:"lazy_load",boundary:a?"present":"missing"}}}),a?.register()},[n,t,a])}})}({displayName:e,loadingLabel:t,load:async()=>a((await xs()).vaultedRollupContents)})}const Vs=Fs("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),Hs=Fs("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),zs=Fs("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),js=Fs("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),Us=Fs("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),Gs=Fs("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Ys(e,n){const t=new Set(n.map(e=>e.id));return e.some(e=>t.has(e.id))}function Ws(e,n){const t=z();return h(()=>{n&&Ys(t.blockingExtensions.value,e)&&m(()=>n())}),Ys(t.blockingExtensions.value,e)}function qs(){const{checkout:{negotiator:e}}=lt(),{generalPaymentError:n,generalPaymentErrorCode:a}=e.parts,{violations:i}=j(pt);return t(()=>!!n.value&&(!ht(a.value)||i.value.size>0))}function $s(e,n){return e.currentUrl.value.hash===`#${n}`}function Ks(e,n=!1){const{router:a}=lt(),i=v(e),r=t(()=>$s(a,i.value)),o=y(n);return s(()=>{r.peek()&&(o.value=!0)},[r,o]),o}function Js({autoOpen:e=!0,isMissing:n,open:t}){s(()=>{e&&n&&(t.value=!0)},[e,n,t]);const{shopPay:{progressInterceptor:a}}=lt();s(()=>{if(n)return a.listenResult(e=>{e||(t.value=!0)})},[a,n,t])}function Xs(){const{loading:e}=W(),{checkout:n}=lt(),t=n.isShippingRequired.value,a=n.negotiator.parts.shippingAddress.value,{shippingAddress:i,deliveryNext:r}=n.negotiator.current.fields,o=i.value,l=gt(r.value),s=!t||!e&&(l||a?.countryCode===o?.countryCode),u=y(s);return s&&!u.value&&(u.value=!0),u}function Zs(){const{shop:e}=lt(),n=e.hasFlagEnabled(_t),a=wr(),i=Ct(),r=Pt(),o=St(),{loading:l}=W(),s=v(l),u=Or(a),c=Xs(),d=t(()=>{const e=a.value;if(o.value&&e&&!(e.balance.amount<=0))return u.value?Ir({firstOrderTotal:i.value,storeCreditAccount:e}):0===r.value?.amount&&i.value?.currencyCode===e.balance.currencyCode?e.balance:void 0}),p=Rr(a),h=t(()=>{const e=c.value,t=!s.value,a=p.value,i=null!=d.value;return n&&e&&t&&a&&i});return{storeCreditBalanceForSubscriptionRenewals:d,showStoreCreditForSubscriptionRenewals:h}}function Qs(){const{i18n:e,checkout:{negotiator:t}}=lt(),{paymentLines:a}=t.parts,{violations:i}=j(pt),{message:r,tone:o}=Eo(),l=[...i.value][0],u=l&&(l.localizedMessage||l.nonLocalizedMessage),c=a.value.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type)?.method,d="customOnsite"===c?.type?c:void 0,p=d?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:d.name}):void 0,h=Boolean(r)&&("critical"===o||"warning"===o),m=u&&p&&h?`${p}. ${u}`:void 0;return s(()=>{if(m)return q({content:m})},[m]),u&&d?n(ko,{errorType:V.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:p,autoFocus:!h,children:u}):null}function eu({openRedeemablesModal:e,includeStoreCredit:t=!0}){const{i18n:a}=lt(),i=Tr(),{paymentLines:r}=$(),o=t&&i.value.length>0,l=r.length>0,s=[...t?i.value:[],...r];if(!s.length)return null;let u="";return u=l&&o?a.translate("payment.gift_card_store_credit.manage_label"):l?a.translate("payment.gift_card_wrapper.manage_label"):a.translate("payment.store_credit.manage_label"),n(F,{children:[n(F,{gap:"small-200",padding:"small-100",border:"base",borderRadius:"base base none none",children:s.map(e=>n(nu,{paymentLine:e},At(e.method)))}),n(B,{inlineAlignment:"start",padding:"small-200",borderWidth:"none base base base",borderRadius:"none none base base",children:n(R,{onClick:e,textDecoration:"none",children:n(F,{direction:"inline",alignItems:"center",gap:"small-200",children:[n(K,{type:"edit"}),n(x,{children:u})]})})})]})}function nu({paymentLine:e}){const{i18n:t}=lt();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(Q,{gridAutoFlow:"column",gridAutoColumns:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",children:[n(F,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(Fo,{type:"store-credit"}),n(x,{children:t.translate("payment.store_credit.label")})]}),n(Z,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,i=J(a);return n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 70%) minmax(0, 30%)",gridTemplateRows:"minmax(0, 1fr)",children:[n(F,{direction:"inline",alignItems:"center",gap:"small-100",children:[n(Fo,{type:"gift-card"}),n(x,{children:t.translate("payment.gift_card_wrapper.gift_card_label",{identifier:X(i)})})]}),n(Z,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function tu({open:e,onClose:r,includeStoreCredit:o=!0}){const{i18n:l,checkout:u}=lt(),{showStoreCreditRedemption:c}=u.configuration.visibility,d=wr(),p=Rr(d),h=ee(),m=kt("CUSTOM"),v=Et(),y=t(()=>c.value&&p.value),f=t(()=>Boolean(h.value)),b=t(()=>f.value||m.value.some(ne)),_=o&&y.value,C=b.value,P=g(C);s(()=>{const n=P.current&&!C;P.current=C,e&&n&&!_&&r()},[_,C,r,e]);let S="";_&&C?S=l.translate("payment.gift_card_store_credit.manage_label"):C?S=l.translate("payment.gift_card_wrapper.manage_label"):_&&(S=l.translate("payment.store_credit.manage_label"));const A=()=>{(v.value||!f.value&&_)&&r()};return n(Vo,{heading:S,open:e,onHide:r,children:n(F,{gap:"base",children:[n(a,{when:c,children:o?n(i,{children:[n(Nr,{}),n(Dr,{afterAppliedRedeemablesChange:A})]}):null}),n(Lr,{afterAppliedRedeemablesChange:A,autoSelect:!0,showHeading:!1})]})})}function au(){const e=wr(),n=Rr(e),a=Or(e),i=Xs(),r=Pt();return t(()=>{const e=0===r.value?.amount&&!a.value;return n.value&&i.value&&!e})}function iu(){const{paymentLines:e}=$(),n=au(),{showStoreCreditForSubscriptionRenewals:t}=Zs();return Boolean(e.length)||n.value||t.value}function ru({afterAppliedRedeemablesChange:e,placement:i}){const{i18n:r,userEvents:o,shop:l,source:u,checkout:c}=lt(),{paymentLines:d,remove:p}=$(),{useStoreCreditForSubscriptionRenewals:m}=c.negotiator.parts,v=Pt(),g=ft(),b=bt(),_=wr(),C=Or(_),P=y(Mr.Init),S=t(()=>P.value===Mr.Loading),A=iu(),k=au(),{storeCreditBalanceForSubscriptionRenewals:E,showStoreCreditForSubscriptionRenewals:w}=Zs(),O=t(()=>g.value||b.value),I=t(()=>g.value?r.translate("payment.store_credit.buying_gift_card"):b.value?r.translate("payment.store_credit.no_fixed_selling_plans"):void 0),R=Br(_.value,P),T=xr(_.value,P),L=y(N());function N({storeCreditSelected:e=C.value,subscriptionRenewalsSelected:n=m.value}={}){const t=d.map(({method:e})=>At(e));return e&&t.unshift(Fr),n&&t.splice(e?1:0,0,Vr),t}s(()=>{L.value=N()},[d]),h(()=>{const e=C.value,n=m.value;L.value=N({storeCreditSelected:e,subscriptionRenewalsSelected:n})});const D=f((e,n)=>{const t=n?"add":"remove",a=i?`${i}_`:"";o.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(u,c,l),action:`${a}manage_redeemables_${t}_${e}`}})},[c,o,i,l,u]),M=f(async n=>{const t=L.value,a=t.length>n.length,{shorter:i,longer:r}=a?{shorter:n,longer:t}:{shorter:t,longer:n};L.value=n;const o=r.find(e=>!i.includes(e)),l=o===Vr;let s=!1;if(o===Fr)if(D("store_credit",!a),a){const e=m.value;m.value=!1,({landed:s}=await T()),s||(m.value=e)}else({landed:s}=await R());else if(l){const e=!a;D("store_credit_subscription_renewals",e),m.value=e}else{D("gift_card",!a);const e=d.find(e=>At(e.method)===o);if(e?.method){const n=await p(e.method);s="success"===n?.status}}s&&e?.()},[e,R,L,d,D,p,T,m]),B=t(()=>S.value||O.value),V=t(()=>B.value||0===v.value?.amount&&!C.value),H=B;if(!A)return null;const z=_.value?.balance,j=E.value,U=I.value;return n(F,{gap:"base",borderRadius:"base base none none",padding:"expanded"===i?"small-100 none none none":void 0,children:n(Uo,{name:"redeemables_list",values:L.value,onChange:M,variant:"block",multiple:!0,children:[k.value&&z&&n(Go,{value:Fr,disabled:V.value,secondaryContent:n(x,{type:"strong",children:r.formatCurrency(z.amount,{currency:z.currencyCode})}),details:U&&n(x,{children:U}),children:n(F,{direction:"inline",gap:"base",alignItems:"center",children:[n(x,{children:r.translate("payment.store_credit.apply_label")}),n(a,{when:S,children:n(te,{})})]})}),w.value&&j&&n(Go,{value:Vr,disabled:H.value,details:n(F,{gap:"small-500",children:[n(x,{children:r.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:r.formatCurrency(j.amount,{currency:j.currencyCode})})}),U&&n(x,{children:U})]}),children:n(x,{children:r.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),d.map(e=>n(ou,{paymentLine:e},At(e.method)))]})})}function ou({paymentLine:e}){const{i18n:t}=lt(),a=e.method.redemptionContent,i=J(a);return n(Go,{value:At(e.method),secondaryContent:n(Z,{textAlign:"end",children:n(x,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:n(F,{children:[n(Z,{children:t.translate("payment.gift_card_checkbox_label")}),n(F,{direction:"inline",gap:"small-400",children:[n(K,{type:"gift-card"}),n(x,{color:"subdued",children:[" ",X(i)]})]})]})})}function lu(){const{checkout:e}=lt(),t=y(!1),a=su();switch(e.identity.current.value){case"shopPay":return n(ru,{placement:"summary"});case"customerAccount":case"businessCustomer":return n(F,{gap:"base",children:[a?n(i,{children:[n(Nr,{}),n(Dr,{})]}):null,n(eu,{includeStoreCredit:!1,openRedeemablesModal:()=>t.value=!0}),n(tu,{includeStoreCredit:!1,open:t.value,onClose:()=>t.value=!1})]});default:return null}}function su(){const{checkout:e}=lt(),n=wr(),t=Rr(n),a=Or(n),i=Pt(),r=a.value,o=0===i.value?.amount&&!r;return t.value&&(e.configuration.visibility.showStoreCreditRedemption.value||r)&&!o}const uu={ONE_PERCENT_CASHBACK:"1",THREE_PERCENT_CASHBACK:"3"};function cu({children:e}){return n(F,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function du({handleNoValidCards:e}){const[t,a]=b(!1),{i18n:r,observability:o,shopPay:l,checkout:{negotiator:u}}=lt(),c=ae(),d=u.current.fields.paymentMethods.value,p=l.session.paymentMethodOption.value,h=Hr(),m=h.selectedCreditCard.value,v=h.selectedPaymentMethod.value,y=h.selectedPaymentMethodItem.value,g=h.paymentMethods.value,f=l.user.hasFlow.value,_=zr(m),C=g.find(e=>!e.isDisabled);if(s(()=>{if(t){const e=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(e)}},[t]),s(()=>{C?"SHOPIFY_INSTALLMENTS"===p?.name&&!0===y?.isDisabled&&(h.selectPaymentMethod(C.method),a(!0)):f&&e()},[y?.isDisabled,p?.name,e,C,h,f]),!v)return null;if(t)return n(cu,{children:n(D,{})});if("CUSTOM_ONSITE"===v.paymentMethod){const e=d?.find(e=>v.paymentBrands&&Ot(e,v.paymentBrands));if(!e)return o.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(v),negotiatedPaymentMethods:JSON.stringify(d)}),null;const t=ie(e)&&Boolean(e.incentiveType),a=1===e.paymentBrands?.length?e.paymentBrands[0]:"generic";if(t){const t=uu[e.incentiveType],i={title:r.translate("payment.usdc_cashback_title",{incentive_percentage:t}),additionalInfo:r.translate("payment.usdc_cashback_additional_info",{terms_url:Wo,incentive_percentage:t}),terms:r.translate("payment.usdc_cashback_terms"),termsUrl:Wo};return n(cu,{children:[n(x,{children:e.name}),n(qo,{notice:i,selected:!1}),n(Fo,{type:a})]})}return n(ho,{paymentLine:{method:e},showAmount:!1})}if(jr(v))return n(cu,{children:[n(x,{children:n(x,{children:r.translate("payment.ideal_label")})}),n(Fo,{type:"ideal"})]});if(Ur(v))return n(cu,{children:[n(x,{children:r.translate("brand.apple_pay")}),n(Fo,{type:"apple_pay"})]});if(Gr(v))return n(cu,{children:[n(x,{children:r.translate("brand.paypal")}),n(Fo,{type:"paypal"})]});if(Yr(v)||Wr(v)){const e=r.translate("payment_gateway.shop_pay.name"),t=Wr(v)?c.translate("payment_gateway.shop_pay.installments_label"):void 0;return n(cu,{children:[n(x,{children:e}),n(Fo,{type:"shop_pay"}),t?n(x,{color:"subdued",children:t}):null]})}if(qr(v))return n(cu,{children:n(x,{children:v.name})});if($r(v))return null;if(Kr(v))return null;const P=v.paymentAttributes;return n(Jr,{name:_,digits:n(i,{children:[n(mo,{}),n(x,{size:"base",tone:"neutral",children:P.lastDigits})]}),icon:n(Fo,{type:P.brand})})}function pu(){const{checkout:{negotiator:e}}=lt(),t=e.parts.paymentLines.value,a=u(()=>t.find(e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type),[t]);return n(F,{gap:"small-400",children:[a&&n(ho,{paymentLine:a,showCardBrandLabel:!0}),n(Xr,{})]})}function hu({openSignal:e}){const{checkout:{identity:t}}=lt();return"shopPay"===t.current.value?n(du,{handleNoValidCards:()=>e.value=!0}):n(pu,{})}function mu(){const{i18n:e}=lt(),t=kt("STORE_CREDIT"),{paymentLines:a}=$(),i=[...t.value,...a];return i.length?n(F,{gap:"small-200",children:i.map(t=>{const a=t.cost?n(x,{children:[" - ",e.formatCurrency(t.cost.amount,{currency:t.cost.currencyCode,form:"short"})]}):null;switch(t.method.redemptionSource){case"STORE_CREDIT":return n(F,{direction:"inline",alignItems:"center",gap:"base",children:[n(Fo,{type:"store-credit"}),n(Z,{children:[e.translate("payment.store_credit.label"),a]})]},At(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=J(i);return n(F,{direction:"inline",alignItems:"center",gap:"base",children:[n(Fo,{type:"gift-card"}),n(Z,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:X(r)}),a]})]},At(t.method))}default:return null}})}):null}function vu({paymentExemptionReason:e}){const{checkout:{identity:t}}=lt();return"shopPay"!==t.current.value||"storeCredit"!==e&&"redeemables"!==e?n(mu,{}):n(kr,{vaulted:!0,reason:e})}function yu({hasPersistentRedeemablesManagement:e,openSignal:t}){const{checkout:a}=lt(),i=No(),r=Et();return"freeOrder"===i.value?n(kr,{vaulted:!0,reason:"freeOrder"}):"giftCard"===i.value?n(kr,{vaulted:!0,reason:"giftCard"}):function({identity:e,paymentExemptionReason:n,paymentFullyCoveredByRedeemablesAndGiftCards:t}){return!!t&&("shopPay"!==e.current.value||("storeCredit"===n||"redeemables"===n))}({identity:a.identity,paymentExemptionReason:i.value,paymentFullyCoveredByRedeemablesAndGiftCards:r.value})?n(vu,{paymentExemptionReason:i.value}):n(F,{gap:"small-200",children:[!e&&n(mu,{}),n(hu,{openSignal:t})]})}function gu(){const{checkout:e}=lt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:o}=ut(),l=re({shouldResetCustomerInfo:!1}),u=oe("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),c=It(l);return h(()=>{"error"===a.value.status&&m(()=>{c.current(),i.value={type:Rt}})}),s(()=>{Tt(t,"GOOGLE_PAY")||i.value?.type===Rt||(i.value={type:Rt},c.current(),r.value={...r.value,receiptIdForPaymentFailure:n?.id}),n?.id!==r.value?.receiptIdForPaymentFailure&&"failed"===n?.status&&"payment"===n?.failure.type&&(r.value={...r.value,receiptIdForPaymentFailure:n?.id},o.value=u)},[c,n,o,t,r,i,u]),s(()=>()=>{o.value=void 0},[o]),null}function fu(){const{checkout:e}=lt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=ut(),r=le(),o=It(r),l=u(()=>Tt(t,"PAYPAL_EXPRESS"),[t]);return s(()=>{l||(o.current(),a.value={type:Rt})},[l,a,o]),s(()=>{if(!n)return;const e=n.id===i.value?.receiptIdForClearedToken,t="failed"===n.status&&"payment"===n.failure.type;!e&&t&&(i.value={...i.value,receiptIdForClearedToken:n?.id},o.current())},[n,l,a,i,o]),null}function bu(){const{checkout:{identity:e}}=lt();switch(e.current.value){case"payPal":return n(fu,{});case"googlePay":return n(gu,{});default:return null}}function _u(){const e=lt(),{checkout:{identity:a,validation:r},i18n:o,shop:l,shopPay:u,webMcp:c}=e,d="shopPay"===a.current.value,p=To(),y="payment",{hasAnyPaymentError:g,clearReceiptError:b}=function({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const n=U(G(new Set([...mt,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"]))).value,{hasError:t,clearError:a}=w(vt),{checkout:{negotiator:i}}=lt(),{lastJourneyProgression:r}=i,o="failed"===r.value.type&&"completion"===r.value.negotiationStage,l=qs(),s=Y();yt(()=>{e&&a()});const u=t&&!s,c=l.value;return{hasAnyPaymentError:n||u||o||c,errors:{hasExpiryViolation:n,hasReceiptPaymentFailure:t,hasReceiptPaymentError:u,hasSubmitCompletionFailure:o,hasGeneralPaymentError:c},clearReceiptError:a}}({clearReceiptErrorOnPaymentLineChange:!1}),_=U(G(Lt)).value,{hasError:C}=se(),{hasError:P}=ue(),S=r.errors.value.paymentErrors,A=S.length>0,{notSupportedError:k}=wo(),E=Boolean(k),O=e.checkout.negotiator.current.fields.buyerIdentity,{value:I}=e.checkout.negotiator.current.fields.paymentFlexibilityPaymentTermsTemplate,R=ce(),T=null!=I&&!R.value,N=Nt().value,D=u.session.selectedPaymentMethod.value,M=Dt(D),{value:B}=e.checkout.negotiator.current.fields.paymentMethods,x=Hr({enableAutoSelect:!1}),V=It(x),{buyerHasActedSignal:H}=e.checkout.negotiator.context;s(()=>{if(c&&d)return c.unstable_provideSavedCardSelector(async e=>{const n=V.current;if(!(n instanceof Zr))return!1;const t=n.cardPaymentMethods.value.find(({method:n})=>n.id===e)?.method;return!!t&&(H.value=!0,"handled"===(await n.selectPaymentMethod(t,"programmatic",{rebuild:!0})).status)})},[V,d,c,H]);const z=x.paymentMethods.value.length>0,j=null!=D&&Mt(D)?D.paymentBrands??[]:[],q=j.length>0?B?.find(e=>Ot(e,j)):void 0,J=de("Checkout::PaymentMethod::Render",q?.uiExtension?[q.uiExtension]:[]),X=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||Ft({identitySource:e.identity.current.value,isOrderSession:Vt(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:O.value?.customerProfile}),Z=X&&(d||z),Q=X&&0===x.cardPaymentMethods.value.length,{expandedSlot:ee,collapsedSlot:ne}=Qr(x),te=g||E||A||C||P,{directPaymentErrors:ae,paymentLines:ie}=e.checkout.negotiator.parts,re=ie.value.some(e=>e.method.type===Bt.CreditCard&&e.method.requiresCvvConfirmation),oe=l.storeVaultGuestCvvVerificationEnabled&&re,le=Boolean(M)&&!M?.expired&&!M?.verified,me=Do(e)&&e.shopPay.session.isInstallmentsSelected.value&&x.isEveryCardDisabled.value||Boolean(M?.expired)||te||T||N||oe||le,ve=pe("purchase.checkout.payment-method-list.render-before"),ye=pe("purchase.checkout.payment-method-list.render-after"),ge=Ro([...ve,...ye]),fe=Ro(J),be=mr([...ve,...ye]),_e=L(),Ce=dt(),Pe=t(()=>!(!_e.value||Ce.value)||Boolean(O.value?.purchasingCompany)),Se=Ks(y,me||_);Ws(J.map(xt),f(()=>{Se.value=!0},[Se])),s(()=>{(me||_)&&(Se.value=!0)},[me,_,Se]),eo();const Ae=f(()=>{Se.value&&Lo(ae)||(Se.value=!Se.value,Se.value&&p(),function({userEvents:e,source:n,checkout:t,shop:a},i){"shopPay"===t.identity.current.value&&e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Se.value))},[p,ae,Se,e]),ke=function(){const{checkout:e}=lt(),n=iu(),t=su(),{paymentLines:a}=$();switch(e.identity.current.value){case"shopPay":return{hasPersistentRedeemablesManagement:!0,show:n};case"customerAccount":case"businessCustomer":{const e=t||a.length>0;return{hasPersistentRedeemablesManagement:e,show:e}}default:return{hasPersistentRedeemablesManagement:!1,show:!1}}}(),Ee=n(yu,{openSignal:Se,hasPersistentRedeemablesManagement:ke.hasPersistentRedeemablesManagement}),we=te?n(Cu,{paymentErrors:S}):null,Oe=function({checkout:e}){switch(e.identity.current.value){case"payPal":case"googlePay":case"applePay":return!1;default:return!0}}(e),Ie=Oe&&Pe.value,Re=!Oe,Te=!Re&&Se.value,Le=Re?null:we||oe,Ne=!Re&&(be||Q||T),De=Te||Ne||Boolean(Le);!function(e){const{checkout:{negotiator:n}}=lt(),{useStoreCreditForSubscriptionRenewals:t}=n.parts,{loading:a}=W(),i=v(e),r=v(a),o=ft(),l=bt(),{showStoreCreditForSubscriptionRenewals:s}=Zs();h(()=>{const e=i.value,n=r.value,a=s.value,u=o.value,c=l.value;e&&!n&&(!a||u||c)&&m(()=>{t.value&&(t.value=!1)})})}(d),h(()=>{Lo(ae)&&(Se.value=!0)}),Js({autoOpen:!1,isMissing:oe||le,open:Se});const Me=Ie?n(Vs,{usesSharedVaultedSelector:Z,hasPersistentRedeemablesManagement:ke.hasPersistentRedeemablesManagement,msiExpandedSlot:ee,onSelectedPaymentMethodChange:b}):null;h(()=>{(ge.value||fe.value)&&(Se.value=!0)});const Be=ke.show?n(lu,{}):null,xe=De?void 0:ne,Fe=Be?n(F,{gap:"base",children:[Be,xe]}):xe;return n(i,{children:n(he,{target:"cart.paymentLines[0]",children:[n(po,{open:Te,disabled:Ne,id:y,label:o.translate("payment.title"),icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:Ee,onToggle:Ie?Ae:void 0,error:Le,renderChildrenWhenCollapsed:Ie,secondaryPersistentContent:Fe,children:Me}),n(bu,{})]})})}function Cu({paymentErrors:e}){return n(B,{children:[e.length>0?n(me,{errors:e,errorType:V.PaymentError}):n(i,{children:[n(Oo,{}),n(Qs,{})]}),n(ve,{blockSize:"base"})]})}function Pu({onPaymentDelegation:e}){const{embed:t,i18n:a}=lt(),{rollup:{action:{tone:i}={}}={}}=ye();return"amazon"===t?.embedder?n(R,{textDecoration:"none",onClick:e,children:n(x,{tone:"accent",children:a.translate("embed.payment.payment_options")})}):n(H,{tone:"custom"===i?"custom":void 0,onClick:e,variant:"plain",textDecoration:"none",children:a.translate("payment.choose_new_payment_method")})}const Su={visa:"Visa",mastercard:"Mastercard",americanexpress:"American Express",amex:"American Express",discover:"Discover",dinersclub:"Diners Club",maestro:"Maestro",jcb:"JCB"};function Au(e){return e.toLowerCase().replace(/[-_]/g,"")}function ku(e,n){return e&&"unknown"!==Au(e)?Su[Au(e)]??n.translate("payment_gateway.credit_card_label"):n.translate("payment_gateway.credit_card_label")}function Eu(){const{i18n:e,observability:t,embed:a,shopPay:i,checkout:r}=lt(),o=L(),l=Ht(),{delegatedPaymentInstrument:u}=r.negotiator.context,{message:c,tone:d,inventoryRecoveryReceiptId:p}=Eo(),{rollup:{blockPadding:h}={}}=ye(),{violations:m,clearViolations:v}=j(Lt),y=U({violations:m}).value;s(()=>{let e=Jo(u.peek());return u.subscribe(n=>{const t=Jo(n);t!==e&&(e=t,v())})},[u,v]);const b=Boolean(a)&&r.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(u.value),_=b&&y,C=Jo(u.value),P=g(void 0);_&&(P.current=C);const S=Xo(u.value),{billingAddress:A}=r.negotiator.parts,k=Boolean(S&&!zt(A.value,Zo(S))),w=b&&(_||P.current===C&&k),O=a?.embedder,I=Wt({embedder:O}),R=jt(i.app.config),T=!a?.isFlagshipPartner||Ut(a.embedder)||R||I?e.translate("payment.title"):e.translate("payment.payment_method"),N=g(!1),D=g(null),M=f(e=>{D.current=e,e&&N.current&&(e.focus(),N.current=!1)},[]),B=f(async()=>{const e=a?.client;if(!e)return;N.current=!1;const n=null!==D.current;try{const n=await e.paymentMethodChangeStart();if(!n)return;if(n.ucpPaymentInstrument)t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Jo(u.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Jo(u.value)})}catch(i){t.log("delegated_payment_cart_update_error","Failed to apply cart update after payment selection",{error:String(i)})}}finally{!e.paymentErrors.value.length&&n&&(D.current?D.current.focus():N.current=!0)}},[a,t,u]),V=a?.client?.paymentErrors.value.includes(Gt.PaymentDelegationError),H=V?e.translate("payment_errors.payment_credential_delegation_error"):void 0,z=H||c,G=H?"critical":d,Y=Yt(h),W=o.value&&z?n(F,{direction:"block",gap:Y,paddingBlockEnd:Y,children:[n(Io,{message:z,tone:G,inventoryRecoveryReceiptId:H?void 0:p}),!w&&a?.isFlagshipPartner&&n(Pu,{onPaymentDelegation:B})]}):void 0;if(!o.value){const e=n(kr,{vaulted:!0,reason:"freeOrder"}),t="amazon"===O?{compact:e}:{primary:e};return n(po,{id:"payment",label:T,primaryContent:t.primary,compactContent:t.compact,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const q=u.value,$=Qo(q),J=$?.brand,X=$?.lastDigits,Z=!(l.value&&q&&J&&X),Q=Z?e.translate("payment.add_payment_method"):void 0,ee=n(x,{tone:"critical",children:e.translate("payment.add_payment_method")}),ne=X?n(x,{accessibilityVisibility:"exclusive",children:`${ku(J,e)} ${e.translate("payment.ends_with_label",{last_digits:X})}`}):null,te=n(x,{accessibilityVisibility:"hidden",children:n("bdi",{children:[ku(J,e),n(mo,{}),X]})}),ae=(()=>{if(!Z)return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[ne,te,n(Fo,{type:J,size:"small",accessibilityVisibility:"hidden"})]})})(),ie=Z?n(x,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(x,{children:e.translate("payment.pay_with")})," ",ne,n(x,{type:"strong",accessibilityVisibility:"hidden",children:[ku(J,e),n(mo,{}),X]}),n(Fo,{type:J,accessibilityVisibility:"hidden"})]}),re="amazon"===O?{compact:ie}:{primary:ae,secondary:void 0===ae?ee:void 0};return n(po,{buttonRef:M,id:"payment",label:T,open:w,disabled:w,onToggle:W?void 0:B,primaryContent:re.primary,secondaryContent:re.secondary,compactContent:re.compact,buttonAccessibilityLabel:Q,icon:n(K,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:W,children:w?n(F,{direction:"block",gap:"base",children:[n(E,{level:3,children:e.translate("billing.billing_address_title")}),n($o,{}),a?.isFlagshipPartner?n(Pu,{onPaymentDelegation:B}):null]}):null})}const wu=new Set(["amazonPay","buyWithPrime"]);function Ou(){const{checkout:{identity:e}}=lt();return wu.has(e.current.value)?n(Os,{}):"sdkCartHints"===e.current.value?n(Eu,{}):n(_u,{})}function Iu(e){if("filled"!==e?.status)return null;const{discountOffer:n}=e;if(!n.offerAmount||!n.campaignHandle)return null;const t=n.minimumOrderValue?{amount:n.minimumOrderValue,satisfied:Boolean(n.minimumOrderValueSatisfied),remainingAmount:n.minimumOrderValueRemainder??null}:null;return{adType:"SHOP_CASH_OFFER",campaignHandle:n.campaignHandle,offerAmount:n.offerAmount,redeemableAmount:!t||t.satisfied?n.offerAmount:null,minimumOrderValue:t}}function Ru(){const{checkout:e}=lt(),n=g(null);return t(()=>{const t=e.proposal.negotiated.fields.shopDiscountOffer.value;return"unavailable"===t?.status?(n.current=null,null):("filled"!==t?.status||(n.current=Iu(t)),n.current)})}const Tu={eligible:!0},Lu=({requiresAvailableBalance:e=!0}={})=>{const n=function({requiresAvailableBalance:e=!0}={}){const n=sl({requiresAvailableBalance:e}),a=g(null),{checkout:{negotiator:i}}=lt(),{paymentMethods:r,shopCashBalance:o}=i.current.fields;return t(()=>{const{nonEligibleReason:t}=n.value,i=Boolean(r.value?.some(e=>"redeemable"===e.type&&"SHOP_CASH"===e.redemptionSource)),l=o.value,s=null==l||"unavailable"===l.status;let u;u=e&&s?el.ShopCashNotAvailable:i?t:el.ShopCashMerchantNotSupported;const c=a.current?.nonEligibleReason===u?a.current:{nonEligibleReason:u};return a.current=c,c})}({requiresAvailableBalance:e}),a=g(null);return t(()=>{const{nonEligibleReason:e}=n.value;if(e){const n=e,t={eligible:!1,reason:n},i=!1===a.current?.eligible&&a.current.reason===n?a.current:t;return a.current=i,i}return a.current=null,Tu})};function Nu(){return Lu({requiresAvailableBalance:!1})}function Du(e,n,t){s(()=>{if(e&&t)return e.recordPresentation({component:n,displayLabel:t})},[n,t,e])}const Mu=()=>{const{embed:e,i18n:t,shop:a,shopPay:i}=lt(),r=Ut(e?.embedder),o=i.app.config.surface,l=a.hasFlagEnabled(qt),s=ge();return(r?"shop_app"===o:l||"shop_app"===o)?n(R,{tone:"monochrome",onClick:()=>{r?function(e){if("undefined"==typeof window)return;const n=function(e){if(e)try{return new URL(e).origin}catch{return}}(e);n&&window.parent.postMessage({jsonrpc:"2.0",method:"ec.keep_shopping"},n)}(e?.client?.embedderOrigin):s.notify({keep_shopping:!0})},children:n(x,{size:"small",children:t.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},Bu=({adType:e,offerAmount:a,minimumOrderValueAmount:i,remainingAmount:r,incentivePresentation:o})=>{const{i18n:l}=lt(),s=vl(),u=(()=>{const{checkout:{negotiator:e}}=lt(),n=e.current.fields.discountLines;return t(()=>{const e=n.value;return{hasMerchandiseDiscounts:!!e&&e.lines.some(e=>!!ml(e)&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)),orderDiscountAmount:e?e.lines.filter(e=>ml(e)&&"CART"===e.discount.presentationLevel&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)).reduce((e,n)=>{const t=n.amount?.amount;return t?e+t:e},0):0}})})(),c=t(()=>u.value.hasMerchandiseDiscounts),d=l.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),p=l.formatCurrency(i.amount,{currency:i.currencyCode,form:"short"}),h=r?l.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}):void 0,m=xu({adType:e,formatMinimumOrderAmount:p,formatRemainingAmount:h,formatOfferAmount:d,hasMerchandiseDiscounts:c.value});return Du(o,"minimumOrderValueBanner","FLAT_AMOUNT_CASHBACK_OFFER"===e?m:void 0),n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:_("dark"===s?"dHa7y":"O9AXs","automatic"===s&&"RbxJj"),children:[n(Z,{type:"small",children:m}),n(Mu,{})]})},xu=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=lt(),o=i||!t;return"SHOP_CASH_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_offer_amount",{formatBoostedAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner",{formatRemainingAmount:t,formatBoostedAmount:a}):"FLAT_AMOUNT_CASHBACK_OFFER"===e?o?r.translate("shop_cash.minimum_order_value_banner_discounts_flat_cashback",{formatOfferAmount:a,formatMinimumOrderAmount:n}):r.translate("shop_cash.minimum_order_value_banner_flat_cashback",{formatRemainingAmount:t,formatOfferAmount:a}):""};function Fu({eligibility:e,offerEligibility:t,discountOffer:a}){const i=l(Mo),r=i?.cashback?.incentive;if(!e.eligible&&!t.eligible)return[];const o=[];var s;return t.eligible&&a?.minimumOrderValue&&!a.minimumOrderValue.satisfied&&o.push(n(Bu,{adType:a.adType,offerAmount:a.offerAmount,minimumOrderValueAmount:a.minimumOrderValue.amount,remainingAmount:a.minimumOrderValue.remainingAmount},"mov-discount")),e.eligible&&(s=r,Boolean("ShopCashCheckoutFlatAmountCashbackIncentive"===s?.__typename&&s.minimumOrderValue&&!s.minimumOrderValueSatisfied))&&o.push(n(Bu,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:r.cashbackAmount,minimumOrderValueAmount:r.minimumOrderValue,remainingAmount:r.minimumOrderValueRemainder,incentivePresentation:i?.incentivePresentation},"mov-cashback")),o}function Vu(){const{checkout:e,embed:i}=lt(),r=Ut(i?.embedder),o=t(()=>r&&!e.configuration.visibility.showCashRedemption.value);return n(a,{when:o,children:n(Hu,{})})}function Hu(){const{main:{section:e}}=fe(),i=Lu().value,r=Nu().value,o=Ru(),l=be(),s=t(()=>l.value.payment),u=Fu({eligibility:i,offerEligibility:r,discountOffer:o.value});return 0===u.length?null:n(a,{when:s,fallback:n(io,{padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:u})}),children:n(F,{padding:zu(e?.padding),gap:"small-200",children:u})})}function zu(e){const[n,t]=(a=e,Array.isArray(a)?2===a.length?[a[1],a[1]]:[a[1],a[3]]:[a,a]);var a;return`small-200 ${Yt(n)??"none"} small-200 ${Yt(t)??"none"}`}function ju({checked:e,onChange:t,disabled:a}){return n(bl,{checked:e,onChange:t,icon:"none",className:"mu1NS",accessibilityLabel:"Shop Cash",disabled:a})}function Uu(e,n){return null==e&&null==n||null!=e&&null!=n&&e.amount===n.amount&&e.currencyCode===n.currencyCode}function Gu({enabled:e=!0}={}){const{shopPay:n,checkout:{negotiator:t}}=lt(),a=l(Mo),i=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return e&&Boolean(i)&&!n.session.isInternalProgressing.value&&!1===a?.redemption.applying?.value}const Yu=e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource,Wu=e=>{if(!e)return nl;if(!e.method.redemptionContent?.details)return nl;const n={...nl};for(const t of e.method.redemptionContent.details){const e=tl.find(e=>e===t.redemptionType);if(void 0===e)continue;const a={id:t.redemptionId??e,promotionId:"SHOP_PROMOTION"===e?t.redemptionId:void 0,type:e,destinationAmount:cl(t.destinationAmount),sourceAmount:ul(t.sourceAmount)};"SHOP_PROMOTION"===e?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,a]:n[e]=a}return n},qu=(e,n)=>{const t=e[n];return Array.isArray(t)?t.length>0:null!=t},$u=()=>{const{checkout:{negotiator:e}}=lt(),{paymentLines:n}=e.current.fields;return t(()=>Wu(n.value?.lines.find(Yu)))},Ku=()=>{const{checkout:{negotiator:e}}=lt(),{paymentLines:n}=e.parts;return t(()=>Wu(n.value?.find(Yu)))},Ju=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),Xu=({enabled:e=!0}={})=>{const{shopPay:n,checkout:{negotiator:t}}=lt(),a=Ku(),i=l(Mo),r=i?.redemption.applying,{negotiate:o}=_e(),s=t.parts.paymentLines,u=dl(),c=Bo(),d=t.current.fields.buyerIdentity.value?.shopUser?.publicId;return f(async(t,{onNegotiateAccepted:i}={})=>{const{SHOP_CASH_BALANCE:l,SHOP_DISCOUNT_OFFER:p,SHOP_PROMOTION:h}=a.peek(),{SHOP_CASH_BALANCE:m=(l?Ju(l):null),SHOP_DISCOUNT_OFFER:v=(p?Ju(p):null),SHOP_PROMOTION:y=h.map(Ju)}=t,g=n.session.isInternalProgressing.value;if(!e)return;if(!r)return;if(g)return;if(!d)return;if(r.peek())return;C(()=>{r.value=!0});const f=s.peek().filter(e=>"redeemable"!==e.method.type||"SHOP_CASH"!==e.method.redemptionSource),b=Object.values(t).flatMap(e=>Array.isArray(e)?e:[e]).find(e=>null!=e)?.amount.currencyCode,_=[m,v,...y??[]].filter(e=>null!==e&&(!b||e.amount.currencyCode===b)),{selectedBillingAddress:P,selectedShippingAddress:S,isUsingApplePayShippingFallback:A}=u.value,k=!P.address1||"APPLE_PAY"===c.value,E=function(e,n,t){if(!t)return null;const[a]=e;if(!a)return null;const i=e.reduce((e,n)=>e+n.amount.amount,0),r=a.amount.currencyCode;return{cost:{amount:i,currencyCode:r},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:t,billingAddress:{streetAddress:n?{address1:n.address1??"",address2:n.address2,city:n.city??"",company:n.company,firstName:n.firstName,lastName:n.lastName??"",phone:n.phone,postalCode:n.postalCode,zoneCode:n.zoneCode,countryCode:n.countryCode??""}:null},destinationAmount:{amount:i.toString(),currencyCode:r},sourceAmount:{amount:i.toString(),currencyCode:r},redemptionPaymentOptionKind:"decoupled",details:e.map(e=>({sourceAmount:e.amount?{amount:e.amount.amount.toString(),currencyCode:e.amount.currencyCode}:null,destinationAmount:{amount:e.amount.amount.toString(),currencyCode:e.amount.currencyCode},redemptionId:e.promotionId??e.type,redemptionType:e.type}))}}}}(_,!A&&S&&k?S:P,d);E&&f.push(E),s.value=f;try{i?.(),await o({silenceViolations:["non-shop-cash",...$t(["paymentLines","billingAddress"])]})}finally{C(()=>{r.value=!1})}},[r,e,o,c,s,a,d,u,n.session.isInternalProgressing])},Zu=()=>{const{checkout:{negotiator:e}}=lt(),n=e.current.fields.subtotalAfterMerchandiseDiscounts,a=Ct(),i=Qu(),r=ec();return t(()=>{const e=a.value,t=e?{amount:al(e.amount-i.value-r.value,P(e.currencyCode)),currencyCode:e.currencyCode}:void 0;return{orderTotal:e,orderSubtotal:n.value,redeemableTotal:t}})},Qu=()=>{const{checkout:{negotiator:e}}=lt(),{paymentLines:n}=e.current.fields;return t(()=>(n.value?.lines??[]).reduce((e,n)=>n.cost&&((e=>"giftCard"===e.method.type)(n)||(e=>"redeemable"===e.method.type)(n)&&!(e=>"SHOP_CASH"===e.method.redemptionSource)(n))?e+n.cost.amount:e,0))},ec=()=>{const e=$u();return t(()=>Object.values(e.value).flatMap(e=>Array.isArray(e)?e:[e]).reduce((e,n)=>n?"SHOP_CASH_BALANCE"===n.type?e:e+n.destinationAmount.amount:e,0))},nc=il,tc=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=lt(),r=Gu(),o=Xu(),l=Ku(),u=$u(),{applying:c}=xo().redemption,{buyerIdentity:d,shopCashBalance:p}=i.negotiator.current.fields,h=Zu(),m=ac(d.value),v=ac(p.value),y=(g=p.value,"filled"===g?.status&&g.eligible&&(g.redeemableBalance?.amount??0)>0?void 0:ac(h.value));var g;const b=Boolean(l.value[nc]),_=u.value[nc]?.destinationAmount||null,C=f(async n=>{if(c.value)return;const t=n?e:null;Uu(_,t)&&Uu(l.value[nc]?.destinationAmount,t)||await o({[nc]:t?{type:"SHOP_CASH_BALANCE",amount:t,promotionId:null}:null})},[_,e,o,c,l]);s(()=>{if(a&&e.amount>0)return a.unstable_registerDeclaredField({key:"shop_cash",read(){const e=i.latestReceipt.value?.status;if(!e||!["processed","processing","processing_remote_checkouts","polling_for_order","action_required"].includes(e))return{key:"shop_cash",purpose:"dev.shopify.shopping.declared_fields.generic",title:"Shop Cash",description:"Apply the available Shop Cash balance. Resend true to retain it in a checkout update; omission or null removes it.",value_schema:{type:"boolean"},required:!1,value:Boolean(l.value[nc])}},prepare(n){if(null!==n&&"boolean"!=typeof n)return{requirement:"must be a boolean or null"};const a=!0===n;return{phase:"negotiate",changed:!0,apply:async()=>!(!r||c.value||t.session.isInternalProgressing.value||ac(d.value)!==m||ac(p.value)!==v||void 0!==y&&ac(h.value)!==y)&&(await C(a),Uu(u.value[nc]?.destinationAmount??null,a?e:null))}}})},[a,i,t.session,e,l,u,r,c,d,m,p,v,h,y,C]),s(()=>{_&&(Uu(_,e)||C(!0))},[e]);const P=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"});return{title:n.translate("order_summary.shop_cash_title"),amount:b?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:P}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:P}),checked:b,handleChange:C,disabled:c.value}};function ac(e){return JSON.stringify(e)??""}const ic={rollup:{blockAlignment:"center"}},rc=({redeemableBalance:e})=>{const{title:t,amount:a,checked:i,handleChange:r,disabled:o}=tc(e);return n("div",{className:"yY3sV",children:n(so,{theme:ic,children:n(po,{label:t,primaryContent:a,primaryAction:n(ju,{checked:i,onChange:r,disabled:o})})})})},oc=()=>{const{i18n:e}=lt(),t=vl(),a=e.translate("payment_errors.vaulted_card_required_error");return n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:_("Q9An4","dark"===t&&"K92xU","automatic"===t&&"HTvo7"),children:n(Z,{type:"small",children:a})})},lc={availableBalance:null,redeemableBalance:null};function sc(){const e=g([]),{checkout:n}=lt(),a=n.proposal.negotiated.fields.shopPromotion;return t(()=>{const n=a.value;return"filled"===n?.status?e.current=n.promotions.flatMap(e=>e.redeemableBalance&&e.redeemableBalance.amount>0?[{...e,availableBalance:e.redeemableBalance}]:[]):"unavailable"===n?.status&&(e.current=[]),e.current})}const uc=()=>{const{recordRedemptionActionEvent:e}=pl(),{observability:n,shop:t,shopPay:a}=lt(),i=t.hasFlagEnabled(qt),r=a.app.config.surface,o=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),l=u(()=>({shopPayCheckoutSurface:r,isReactNativeWebview:o,isShopCashBalanceBetaEnabled:i,isOnePageCheckout:!0,nEnabledCreditCards:0}),[r,o,i]),s=f(t=>{e({...l,...t}),n.counter({name:"shop_cash_redemption_action",value:1,attributes:{action:t.action,redemption_type:t.redemptionType,hook:t.source}})},[l,e,n]),c=f((e,n)=>{s({action:"auto-apply",redemptionType:e,source:n})},[s]),d=f((e,n)=>{s({action:"manually-apply",redemptionType:e,source:n})},[s]);return{recordRedemptionAutomaticallyApplied:c,recordRedemptionAutomaticallyRemoved:f((e,n)=>{s({action:"auto-remove",redemptionType:e,source:n})},[s]),recordRedemptionManuallyApplied:d,recordRedemptionManuallyRemoved:f((e,n)=>{s({action:"manually-remove",redemptionType:e,source:n})},[s])}},cc=({enabled:e=!0,redemptionTypes:n=tl}={})=>{const t=$u(),a=l(Mo),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=uc(),o=Xu({enabled:e}),u=U(j(Kt)).value;s(()=>{if(!e||!i||!u)return;let a=!1;for(const e of n)qu(t.value,e)&&(a=!0,r(e,"useRemoveRedemptionsOnViolation"));a&&(i.value=!0,o(Object.fromEntries(n.map(e=>[e,null]))))},[e,u])},dc=(e,{enabled:n=!0}={})=>{const t=Gu({enabled:n}),a=Xu({enabled:n}),{recordRedemptionAutomaticallyRemoved:i}=uc(),r=Ku(),o=e.filter(e=>!e.eligibility.eligible).flatMap(e=>e.redemptionTypes??tl),l=o.join(","),u=o.filter(e=>qu(r.value,e)).join(",");s(()=>{if(!n||0===o.length)return;if(!t)return;const e=o.filter(e=>qu(r.value,e));0!==e.length&&a(Object.fromEntries(o.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)i(n,"useRemoveRedemptionsWhenIneligible")}})},[n,t,l,u])};class pc extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const hc=({message:e})=>n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",borderRadius:"base",borderWidth:"base",padding:"small-400 small-200",gap:"small-200",accessibilityRole:"alert",alignItems:"center",alignContent:"center",children:[n(K,{type:"alert-circle",size:"small"}),n(Z,{color:"subdued",size:"small",children:e})]});function mc(){const{eligibility:e,redeemableBalance:n,availableBalance:t,discountOffer:a,messages:i,showVaultedCardBanner:r,vaulted:o,isBalanceRedemptionEligible:l,balanceRedemptionEligibility:c}=vc();return function(e){const n=g(!1),t=g(performance.now()),{observability:a}=lt();s(()=>{if(!n.current&&e&&e.amount>0){const e=performance.now()-t.current;a.histogram({name:"new_performance_shop_cash_balance_display_time",value:Math.round(e)}),n.current=!0}},[e,a])}(t),dc([{eligibility:c,redemptionTypes:[il]}]),cc(),(e=>{const{client:n,shop:t,shopPay:a}=lt(),{recordRedemptionVisibilityEvent:i}=pl(),r=n.unstable_getSerialization("apiClientId"),o=t.hasFlagEnabled(qt),l=a.app.config.surface,c=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),d=be().value.payment,p=u(()=>({visibility:"visible",reason:e.reason??"none",position:d?"vaulted":"unvaulted",shopPayCheckoutSurface:l,isReactNativeWebview:c,isShopCashBalanceBetaEnabled:o,apiClientId:r,isOnePageCheckout:!0,nEnabledCreditCards:0}),[l,c,o,r,e.reason,d]);s(()=>{i(p)},[i,e.reason])})(e),(({eligibility:e,availableBalance:n,redeemableBalance:t,discountOffer:a})=>{const{recordRedemptionEligibilityEvent:i}=pl(),{orderTotal:r,orderSubtotal:o}=Zu().value,l=u(()=>a?a.minimumOrderValue&&!a.minimumOrderValue.satisfied?"BELOW_MOV":void 0:"NO_CAMPAIGN",[a]),c=u(()=>{if(r)return{balance:n?.amount??0,balanceCurrency:n?.currencyCode??"USD",totalPrice:r.amount,totalPriceCurrency:r.currencyCode,subtotalPrice:o?.amount??0,subtotalPriceCurrency:o?.currencyCode??"USD",maxTotalRedemptionAllowed:t?.amount??0,isBoostAvailable:Boolean(a),boostCampaignId:a?.campaignHandle,offerAmountBelowMov:a?.minimumOrderValue?.remainingAmount?.amount,offerMinimumOrderValueRequired:a?.minimumOrderValue?.amount.amount,maxPostOfferRemainingAmount:0,maxOfferRedemptionAmount:a?.offerAmount?.amount,boostIneligibilityReason:l,redemptionIneligibilityReason:e.reason}},[n,r,o,a,t,l,e.reason]);s(()=>{c&&i(c)},[i,e.reason,n,t,a])})({eligibility:e,availableBalance:t,redeemableBalance:n,discountOffer:a.value}),(()=>{const{observability:e,source:n,checkout:{negotiator:t}}=lt(),a=t.current.fields.paymentLines.value,i=u(()=>a?.lines.filter(e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource)??[],[a]),r=g(!1);s(()=>{if(!i)return;if(i.length<=1)return;if(r.current)return;const t=JSON.stringify(i.map(e=>e.method.redemptionContent?.details?.map(n=>({redemptionPaymentGroupId:e.method.redemptionContent?.redemptionId,redemptionId:n.redemptionId,type:n.redemptionType,amount:n.destinationAmount}))));r.current=!0,e.error(new pc,{severity:"error",metadata:{shopCash:{redemptions:t},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})},[i,e,n])})(),{eligibility:e,redeemableBalance:n,messages:i,showVaultedCardBanner:r,vaulted:o,isBalanceRedemptionEligible:l}}function vc(){const e=be().value.payment,t=Lu().value,a=Nu().value,{redeemableBalance:i,availableBalance:r}=(()=>{const{checkout:{negotiator:e}}=lt(),n=e.current.fields.shopCashBalance.value,{redeemableTotal:t}=Zu().value,a=(()=>{const{checkout:{negotiator:e}}=lt(),n=e.current.fields.shopCashBalance.value,t=g(null);return"filled"===n?.status?t.current=n.availableBalance:"unavailable"===n?.status&&(t.current=null),t.current})();if("filled"===n?.status&&n.eligible&&null!=n.redeemableBalance&&n.redeemableBalance.amount>0)return{availableBalance:n.availableBalance,redeemableBalance:n.redeemableBalance};if(!a)return lc;if(a.amount<=0)return lc;if(!t)return lc;const i=rl(t.currencyCode);if(t.amount<=i)return lc;if(t.amount=i?{availableBalance:a,redeemableBalance:a}:{availableBalance:a,redeemableBalance:ol({amount:a.amount-(i-r),currencyCode:a.currencyCode})}})(),o=Ru(),l=sc().value,s=Fu({eligibility:t,offerEligibility:a,discountOffer:o.value}),{eligibilityMessage:u,showVaultedCardBanner:c}=(e=>{const t=(()=>{const{i18n:e}=lt();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invalid_billing_address");case"SHOP_CASH_INVALID_SHIPPING_ADDRESS":return e.translate("shop_cash.redemption_invalid_shipping_address");case"SHOP_CASH_MERCHANT_NOT_SUPPORTED":case"PAYMENTS_SHOP_CASH_UNSUPPORTED_CURRENCY":return e.translate("shop_cash.redemption_unsupported_merchant");case"SHOP_CASH_UNSUPPORTED_DELIVERY_METHOD_TYPE":return e.translate("shop_cash.redemption_unsupported_delivery_method");case"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING":return e.translate("shop_cash.redemption_unsupported_shipping");case"PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED":return e.translate("shop_cash.redemption_unsupported_gift_cards");case"INSUFFICIENT_FUNDING_LEDGER_BALANCE":return e.translate("shop_cash.redemption_error_exclusive_campaign_out_of_funds");case"BUYER_BALANCE_HOLD_ERROR":return e.translate("shop_cash.redemption_balance_hold",{shopRewardsTermsLink:n(R,{target:"_blank",href:"https://shop.app/shop-cash-terms",children:e.translate("shop_cash.shop_rewards_terms")})});case"DISCOUNT_OFFER_ERROR":return e.translate("shop_cash.exclusive_offer_error");case"SHOP_CASH_NOT_AVAILABLE":case"PAYMENTS_SHOP_CASH_ORDER_TOTAL_TOO_LOW":return;default:return e.translate("shop_cash.redemption_error")}}})(),{checkout:{negotiator:a}}=lt(),{paymentLines:i}=a.current.fields,r=Et().value&&Boolean(i.value?.lines.find(Yu));return{eligibilityMessage:t(e.reason),showVaultedCardBanner:r}})(t),d="PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING"===t.reason,p=t.eligible||d&&null!=i,h=p&&!t.eligible?{eligible:!0}:t,m=[];return u&&!d&&m.push(n(hc,{message:u},"eligibility-banner")),m.push(...s),{eligibility:t,redeemableBalance:i,availableBalance:r,discountOffer:o,shopPromotionDiscounts:l,messages:m,showVaultedCardBanner:c,vaulted:e,isBalanceRedemptionEligible:p,balanceRedemptionEligibility:h}}const yc=()=>{const{redeemableBalance:e,messages:t,showVaultedCardBanner:a,vaulted:r,isBalanceRedemptionEligible:o}=mc();return a&&!r&&t.push(n(oc,{})),n(i,{children:[o&&e&&n(ro,{hideDivider:r,condition:!r,children:n(rc,{redeemableBalance:e})}),t.length>0&&n(ro,{hideDivider:r,condition:!r,padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:t})})]})};function gc({formattedAddress:e}){const{i18n:t,checkout:a}=lt(),i=a.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,o=r.selectedAddress.value?.id===Il&&Jt(i)||!e;return n(F,{children:[o&&n(Z,{children:i?.location.name}),n(Z,e?{children:e}:{color:"subdued",children:t.translate("review.blocks.no_address")})]})}const fc=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function bc({id:e="deliveryAddress",label:t,formattedAddress:r}){const{i18n:o,checkout:{negotiator:l,validation:s}}=lt(),c=Ks(e),d=l.current.fields.buyerIdentity.value?.purchasingCompany,p=wl(),h=Ce(),m=U(j(fc)).value,v=s.errors.value.deliveryAddressErrors,y=r??h,g=u(()=>[`single_choice_${e}`],[e]),f=t??o.translate("shipping.shipping_address_title"),b=n(gc,{formattedAddress:y}),_=n(i,{children:[n(Al,{name:`single_choice_list_${e}`,values:g,hideRadioControl:!0,children:n(Go,{value:`single_choice_${e}`,children:n(F,{children:[n(Z,{children:d?.location.name}),n(Z,{color:"subdued",children:y??o.translate("review.blocks.no_address")})]})})}),n(a,{when:p,children:n(B,{padding:"small-200 small-100 none small-100",children:n(yo,{showIcon:!0})})})]}),C="deliveryAddress"!==e?null:m?n(Ei,{message:o.translate("shipping_errors.shipping_method_not_available_generic.one")}):v.length>0?n(me,{errors:v,errorType:V.DeliveryError}):null;return n(po,{id:e,label:f,open:c.value,onToggle:()=>{c.value=!c.value},primaryContent:b,error:C,children:_})}function _c({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:t,negotiator:a}}=lt(),i=a.current.fields.buyerIdentity.value?.purchasingCompany,r=function(e){const n=e.current.value;return"customerAccount"===n||"businessCustomer"===n}(t)&&!e;return r?n(Pc,{renderInlineSelector:!0}):i?n(Cc,{purchasingCompany:i}):n(Pc,{})}function Cc({purchasingCompany:e}){const{i18n:t}=lt(),{shippingAddress:a,name:i}=e.location,{secondary:r}=ke({address:a??{},nameLinePosition:"inline",addressDisplayName:i}),o=a?r:t.translate("review.blocks.no_address");return n(bc,{id:"billingAddress",label:t.translate("company_location.location_title"),formattedAddress:o})}function Pc({renderInlineSelector:e=!1}={}){const{i18n:t,checkout:{identity:a,negotiator:i}}=lt(),r=i.parts.billingAddress.value,o=Sc().value,l=null!=o&&i.parts.billingAddressOption.value===o.option,u="form"!==Pe().value,c=l&&o.sameAsShipping&&!u,d=c?o.address:r,p=Se(d,{displayName:!1}),{isMissingPhone:h}=_l({addressType:"billing"}),{isMissingFirstName:m}=Cl({addressType:"billing"}),v=h||m,y="billingAddress",b=Ks(y),_=Xt("deliveryNext").value,C=g(!0),{violations:P,clearViolations:S}=G(Lt),A=P.value,k=U({violations:P}).value,E=new Set([...h?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?Zt:[]]),w=no(k,A,E),O=U(G(Qt)).value;s(()=>{w&&(b.value=!0)},[w,b]),s(()=>{C.current?C.current=!1:S()},[S,r]),Js({isMissing:v,open:b});const I=function(){const{userEvents:e,source:n,checkout:t,shop:a}=lt(),{billingAddress:i,billingAddressOption:r,shippingAddress:o}=t.negotiator.parts,l=Sc(),s=f(e=>{e?r.value="custom":zt(i.value,o.value)?r.value="shipping":r.value="custom"},[i,r,o]),u=f(e=>{const n=l.value;e?(n&&r.value===n.option&&(i.value=n.address),r.value="custom"):n&&zt(i.value,n.address)?r.value=n.option:r.value="custom"},[i,r,l]),c=f(i=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(n,t,a),action:i?"billing_addresses_expand":"billing_addresses_collapse"}}),[t,e,a,n]);return function({identity:e,switchBillingAddressOption:n,switchAndPrefillBillingAddressOption:t,recordShopPayInteraction:a}){switch(e.current.value){case"payPal":return n;case"customerAccount":case"businessCustomer":return t;case"shopPay":return a;default:return}}({identity:t.identity,switchBillingAddressOption:s,switchAndPrefillBillingAddressOption:u,recordShopPayInteraction:c})}(),R=f(()=>{const e=!b.value;return I?.(e),b.value=e,e},[I,b]);let T=w;!function(e,n){return"applePay"===e.current.value&&n}(a,O)?w&&!_&&(T=n(Ae,{errorType:V.PaymentError,tone:"critical",children:t.translate("address_management.invalid_billing_address_selected")})):T=n(Ae,{errorType:V.PaymentError,tone:"critical",children:t.translate("payment.billing_must_match_shipping_notice")});const L=t.formatName(d?.firstName,d?.lastName,!0);let N,D;return!l||c?(N=L,D=p):N=o.sameAsShipping?t.translate("billing.same_as_shipping"):p,n(po,{id:y,label:t.translate("billing.billing_address_title"),open:b.value,onToggle:R,error:T,primaryContent:N,secondaryContent:D,renderChildrenWhenCollapsed:v,children:n(zs,{renderInlineSelector:e})})}function Sc(){const{checkout:e}=lt(),{buyerIdentity:n}=e.negotiator.current.fields,a=Ee();return t(()=>{if(n.value?.purchasingCompany){const{address:n,type:t}=e.addressManager.billing.value.suggestedAddress.value;return!n||"billing"!==t&&"billing-fact"!==t&&"shipping"!==t?null:{option:t,address:n,sameAsShipping:!1}}return{option:"shipping",address:a.value,sameAsShipping:!0}})}function Ac(e,n){return e?n?`${n} · ${e}`:e:""}class kc{constructor(e,n){this.appContext=e,this.providerData=n,this.triggerClientSideValidation=this.triggerClientSideValidation.bind(this),this.mapServerViolationsToClient=this.mapServerViolationsToClient.bind(this)}get email(){return this.appContext.checkout.proposal.proposed.email.value||void 0}get phone(){return this.appContext.checkout.proposal.proposed.phone.value||void 0}get displayPhone(){}get displayContent(){return{contact:this.email}}get moreOptions(){if(this.hasCheckoutAsGuest(this.providerData))return this.providerData.checkoutAsGuest?[this.providerData.checkoutAsGuest]:void 0}get showShopPayVerification(){return!1}get hasError(){return!1}get shouldHide(){return!1}get shouldTriggerValidation(){return!1}get shouldClearClientSideValidation(){return!1}get shouldMapServerViolationsToClient(){return!1}triggerClientSideValidation(){return!1}clearClientSideValidation(){}mapServerViolationsToClient(){}get isEmbeddedPartner(){return Boolean(this.appContext.embed?.isFlagshipPartner)}get logo(){return null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0}}hasCheckoutAsGuest(e){return"object"==typeof e&&null!==e&&"checkoutAsGuest"in e}}const Ec="large-400";function wc(){return n(F,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:n(F,{borderRadius:"fullyRounded",overflow:"hidden",children:n(Re,{contentDisplay:"block",children:n(Oc,{})})})})}function Oc(){return n(ve,{blockSize:Ec,inlineSize:Ec})}const Ic=o({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p(()=>e(()=>import("./68887467.B7U-77H5.js"),__vite__mapDeps([129,1,130,2,3,4,5,6,7,8,9,10,11,12,13,131]))),renderLoading:()=>n(wc,{}),renderError:()=>n(Oc,{}),useError:Ie("VaultedContactAvatar")});function Rc(e,t=""){const a=e?.customerProfile?.firstName?.charAt(0),i=e?.customerProfile?.lastName?.charAt(0),r=t.charAt(0),o=(a??i??r).toUpperCase();return o?n(Ic,{initials:o}):null}function Tc({email:e,phone:t}){const{i18n:a,checkout:{configuration:i},observability:r,shop:{name:o}}=lt(),{hasExternalOrderNotifications:l}=i,c=function({email:e,phone:n}){return e?"email":n?"phone":void 0}({email:e,phone:t}),d=l?c:void 0;s(()=>{d&&(r.log("shop_pay_external_order_notification_banner_suppressed","Withheld the order notification banner: this checkout's order notifications are the merchant's to send",{contact_type:d}),r.counter({name:"shop_pay_external_order_notification_banner_suppressed",value:1,attributes:{contact_type:d}}))},[r,d]);const p=u(()=>l?null:e?a.translate("account_management.email_changed",{shopName:o,email:Lc(e)}):t?a.translate("account_management.phone_changed",{shopName:o,phone:Lc(t)}):null,[e,t,o,a,l]);return p?n(B,{padding:"small-200 none none none",children:n(Te,{tone:"info",children:p})}):null}const Lc=e=>n(x,{type:"strong",children:e});function Nc({url:e,displayName:t}){return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(B,{inlineSize:"16px",blockSize:"16px",children:n(Le,{src:e,alt:"",accessibilityRole:"presentation",inlineSize:"fill",aspectRatio:"auto"})}),n(x,{size:"medium",type:"strong",children:t})]})}const Dc={amazonPay:class extends kc{get displayContent(){return{contact:Ac(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){const e=this.isEmbeddedPartner?"xsmall":"medium";return n(Ho,{wallet:ct.AmazonPay,size:e})}},applePay:class extends kc{get logo(){return n(Ho,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}},buyWithPrime:class extends kc{get displayContent(){return{contact:Ac(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){return n(Ho,{wallet:ct.BuyWithPrime,size:"large"})}},businessCustomer:class extends kc{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return ea(this.appContext.source)}get displayContent(){const e=this.buyerIdentity?.purchasingCompany?.company.name??"",n=this.email;return{contact:this.appContext.i18n.translate("contact.company_contact_info",{companyName:e,contact:n??""})}}get logo(){return Rc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink&&!this.isOrderOrDraftSession?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},customerAccount:class extends kc{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return Rc(this.buyerIdentity,this.email)}get displayOptions(){return{vaultedContactType:"base",contentLayout:"box"}}get showShopPayVerification(){return Boolean(this.email)&&this.providerData.loadShopPayVerification}get moreOptions(){const{accountInfo:e}=this.providerData,{i18n:n}=this.appContext;return e.showLogoutLink?[{label:n.translate("customer_account.sign_out_link_label"),onClick:e.logoutAndClearProposal}]:void 0}},googlePay:class extends kc{get logo(){const e=this.isEmbeddedPartner?"xxxsmall":"xxsmall";return n(Ho,{wallet:"GOOGLE_PAY",size:e})}},payPal:class extends kc{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const e=this.isEmbeddedPartner?"xxsmall":"small";return n(Ho,{size:e,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){const e=na(this.appContext.checkout.proposal.proposed.paymentLines.value,"PAYPAL_EXPRESS");return e?.method.walletContent?.email||void 0}get children(){const e=this.displayContent.contact;return Boolean(e)&&Boolean(this.email)&&e!==this.email?n(Tc,{email:this.email}):null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0,children:this.children}}},sdkCartHints:class extends kc{get displayPhone(){return this.appContext.shop.contactInfoOptions.includes("PHONE")?this.phone:void 0}get displayContent(){const{i18n:e}=this.appContext,n=this.email||this.displayPhone||"";return{label:e.translate("contact.contact_method_title"),contact:n,useSummaryInContent:!0}}get hasError(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return Ne({email:this.email,phone:this.phone,emailInputError:e.value,phoneInputError:n.value,hasViolations:this.displayableContactViolations.length>0})}get shouldHide(){const e=this.appContext.checkout.proposal.negotiated.fields.merchandiseLines.value?.lines;return!(Boolean(this.appContext.embed?.interstitialPartnerDisplayName)&&!this.appContext.checkout.identity.customerContactMethodPrefilled)&&De({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:Me(e)})}get shouldTriggerValidation(){return Boolean(this.email||this.phone)}get shouldClearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;return!this.email&&!this.phone&&(this.isClearableContactError(e.value)||this.isClearableContactError(n.value))}get shouldMapServerViolationsToClient(){const{violationsSubscriptionResult:{violations:e}}=this.providerData;return e.value.size>0}triggerClientSideValidation(){const{i18n:e}=this.appContext,{validation:{contactErrors:{emailInputError:n,phoneInputError:t}}}=this.appContext.checkout;n.value=void 0,t.value=void 0;const a=this.appContext.shop.contactInfoOptions.includes("PHONE"),i=this.validateContactInformation({email:this.email,phone:this.phone,phoneAllowed:a,translations:{emailBlank:e.translate("field_errors.email_blank"),emailInvalid:e.translate("field_errors.email_invalid"),blank:e.translate("field_errors.email_or_phone_blank")}});if(!i)return!1;switch(i.field){case"email":return n.value=i.error,!0;case"phone":return t.value=i.error,!0}}clearClientSideValidation(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout;this.isClearableContactError(e.value)&&(e.value=void 0),this.isClearableContactError(n.value)&&(n.value=void 0)}mapServerViolationsToClient(){const{validation:{contactErrors:{emailInputError:e,phoneInputError:n}}}=this.appContext.checkout,{violationsSubscriptionResult:{clearViolations:t}}=this.providerData,a=Boolean(this.email||this.phone),i=Boolean(e.value)||Boolean(n.value);for(const r of this.displayableContactViolations)!i&&a&&"UnprocessableTermViolation"===r.__typename&&(e.value=r.localizedMessage??r.nonLocalizedMessage,n.value=void 0);t()}get logo(){const e=this.appContext.embed,t=Wt({embedder:e?.embedder}),a=e?.interstitialPartnerDisplayName,i=e?.interstitialPartnerProfileIconUrl;return t&&a&&!0===e?.isFlagshipPartner&&this.appContext.checkout.identity.customerContactMethodPrefilled?i?n(Nc,{url:i,displayName:a}):Rc(void 0,this.email):n(K,{type:"email",size:"fill"})}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:n(wi,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:e,negotiationStage:n}=this.providerData.violationsSubscriptionResult,t=e.value,a=n?.value,i=ta(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&ta(this.phone),r="negotiation"===a&&!this.appContext.embed?.isFlagshipPartner&&i;return Array.from(t).filter(({code:e})=>!r||"BUYER_IDENTITY_MISSING_CONTACT_METHOD"!==e)}validateContactInformation({email:e,phone:n,phoneAllowed:t,translations:a}){if(!(e||n&&t))return{field:"email",error:t?a.blank:a.emailBlank};if(e){const n=yl(e,a.emailBlank),t=gl(e,a.emailInvalid),i=n??t;if(i)return{field:"email",error:i}}else if(n&&t){const e=yl(n,a.blank);if(e)return{field:"phone",error:e}}}isClearableContactError(e){return!!e&&!("object"==typeof e&&"origin"in e&&"client"===e.origin)}},shopPay:class extends kc{#t;#a;constructor(e,n){super(e,n),this.#t=(this.appContext.mobileCheckoutSdk.enabled||Boolean(this.appContext.embed?.isCheckoutKit()))&&jt(this.appContext.shopPay.app.config),this.#a=aa(this.appContext.router.currentUrl.value.search)}get displayContent(){return{contact:this.appContext.shopPay.user.email.value}}get displayPhone(){return this.appContext.shopPay.user.phoneNumber.value||void 0}get logo(){return this.providerData.shopPayLogo}get moreOptions(){return this.providerData.shopPayMoreOptions}get children(){const e=this.displayContent.contact,t=Boolean(e)&&Boolean(this.email)&&e!==this.email,a=Boolean(this.phone&&!this.email);return t||a?n(Tc,{email:this.email,phone:this.phone}):null}get displayOptions(){let e;return(this.#t||this.#a||!this.appContext.shopPay.visibility.showVaultedContactInlineLogo)&&(e="stack"),this.appContext.shopPay.visibility.showVaultedContactHeader||(e="box"),this.appContext.shopPay.visibility.showVaultedContact?{vaultedContactType:"base",contentLayout:e,children:this.children}:{vaultedContactType:"hidden"}}}};class Mc extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const Bc=new ia(0,0,100);class xc extends Error{constructor(){super(...arguments),this.name="MissingLogoutUrlError"}}function Fc(){const e=lt(),a=e.checkout.identity.current.value,i=u(()=>({appContext:e,identitySource:a}),[e,a]),r=He().value,o=e.client.unstable_getSerialization("logoutUrl")||"",l=function(){const e=lt(),n=Tl(),a=ze(),i=_o(),r=je(),o=function(){const{checkout:{wallets:e}}=lt(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=ut(),{clearForcedCheckoutLayout:a}=we(),i=f(()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,t,a]);return Oe({onClick:i,shouldResetCustomerInfo:!0,skipRedirect:!0})}(),l=v({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:i,googlePayCheckoutAsGuest:r,payPalCheckoutAsGuest:o});return t(()=>{const n=l.value;switch(e.checkout.identity.current.value){case"amazonPay":return n.amazonPayCheckoutAsGuest;case"applePay":return n.applePayCheckoutAsGuest;case"buyWithPrime":return n.buyWithPrimeCheckoutAsGuest;case"googlePay":return n.googlePayCheckoutAsGuest;case"payPal":return n.payPalCheckoutAsGuest;default:return}})}().value,s=go(),c=function(){const{shopPay:e,mobileCheckoutSdk:t,embed:a,router:i}=lt(),r=i.currentUrl.value,o=Boolean(a?.isFlagshipPartner)?"small":"medium",l=(t.enabled||a?.isCheckoutKit())&&jt(e.app.config),s=aa(r.search),u=fl({foregroundColor:Ml}),c=fl({foregroundColor:Bc});if(l||s||!e.visibility.showVaultedContactInlineLogo)return null;let d;return d=u?"branded":c?"white":"black","shop"!==e.logoBrand?n(Dl,{color:d,size:o}):n(Nl,{color:d,size:o})}(),d=function(){const{i18n:e,observability:n,userEvents:t,source:a,checkout:i,shop:r,persistence:o,shopPay:l,router:s}=lt(),c=i.negotiator,{visibility:d,app:{config:p}}=l,h=jt(p),{replaceShopPayInHistory:m}=Rl(),v=f((e,t)=>{if("success"!==t.status)return i.unstable_setRedirectingExternally(!1),void n.log("shop_pay_switch_account_session_clear_failed","Shop Pay account switch session clear did not succeed",{status:t.status});o?.clearAll();const a=new URL(window.location.href);a.pathname=s.resolve(Bl).pathname,a.searchParams.set(ra,"1"),m(a.toString())},[i,n,o,m,s]),y=Be(v),{label:g}=xe(),b=Fe({clearPii:!0}),_=Ve(),C=Boolean(l.config.isReferral),P=f(()=>{i.unstable_setRedirectingExternally(!0),t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...wt(a,i,r),action:"switch_account"}},{exportImmediately:!0});const e=c.block();c.waitForPendingNegotiations().then(()=>y()).catch(()=>{i.unstable_setRedirectingExternally(!1)}).finally(e)},[y,t,a,i,r,c]);return u(()=>{const n=[];return d.showSwitchAccountAction&&n.push({onClick:_?()=>{}:P,label:e.translate("account_management.switch_account")}),d.showCheckoutAsGuestKebabLink&&!C&&n.push({onClick:b,label:g}),!h&&d.showSwitchVaultedContactMenu?n:void 0},[g,b,P,e,_,C,h,d.showSwitchAccountAction,d.showCheckoutAsGuestKebabLink,d.showSwitchVaultedContactMenu])}(),p=G(oa),{checkout:h,persistence:m,observability:y}=e,g=Be(f(()=>{m?.clearAll(),window.location.assign(o)},[m,o])),b=f(()=>{C(()=>{h.checkoutExit.setClearingSession(!1),h.unstable_setRedirectingExternally(!1)})},[h]),_=f(()=>{h.isRedirectingExternally.peek()||(o||y.error(new xc("logoutAndClearProposal called without a logout URL")),C(()=>{h.checkoutExit.setClearingSession(!0),h.unstable_setRedirectingExternally(!0)}),g().then(e=>{e||b()}).catch(b))},[h,o,y,g,b]);return u(()=>function(e,n){const t=e.checkout.identity.current.value;if("guest"===t)throw new Mc;return function(e,n,t){return new(0,Dc[e])(n,t)}(t,e,n)}(i.appContext,{accountInfo:{logoutAndClearProposal:_,showLogoutLink:r},loadShopPayVerification:s.value,shopPayLogo:c,shopPayMoreOptions:d,checkoutAsGuest:l,violationsSubscriptionResult:p}),[i,_,r,s.value,c,d,l,p])}function Vc(e){const n=g(void 0),t=e.email,a=e.phone,i=Boolean(t||a);s(()=>{const r=n.current,o=Boolean(r),l=Boolean(r?.email||r?.phone),s=!o||r?.email!==t||r?.phone!==a;e.shouldTriggerValidation&&s?e.triggerClientSideValidation():o&&!l||i||!e.shouldClearClientSideValidation||e.clearClientSideValidation(),n.current={email:t,phone:a}},[t,i,a,e]),s(()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()},[e])}function Hc({emailAddress:e,phone:t,logo:a,moreOptions:r,emailAlignment:o="end",children:l}){const{i18n:s,shop:u,checkout:{negotiator:c}}=lt(),d=u.hasFlagEnabled(la)?t:void 0,p=e??(d?void 0:c.parts.email.value),h=p||d||n(D,{});return n(i,{children:[n(Q,{gridAutoFlow:"column",gridTemplateColumns:a?"minmax(auto, max-content) minmax(0, 1fr) minmax(auto, max-content)":"minmax(0, 1fr) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-300",alignItems:"center",alignContent:"center",justifyContent:o,justifyItems:o,children:[a,n(B,{maxInlineSize:"100%",children:"string"==typeof h?n(Z,{children:[!p&&d&&n(i,{children:[n(x,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(Ue,{children:h})]}):h}),r&&n(Pl,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),l]})}function zc({layout:e,emailAlignment:t,...a}){const{i18n:i}=lt(),r=n(Hc,{...a,emailAlignment:t??("stack"===e||"box"===e?"start":"end")});switch(e){case"stack":return n(F,{gap:"base",padding:"none none base none",children:r});case"box":return n(B,{padding:"base none",children:n(F,{gap:"base",children:r})});default:return n(B,{role:"region",accessibilityLabel:i.translate("customer_account.rollup_label"),padding:"small-200 none base none",children:r})}}function jc(){const e="contact",t=Ks(e),r=f(()=>t.value=!t.value,[t]),o=Fc();Vc(o);const l=y(!1),u=Ht(),c=g(!1),{embed:d,i18n:p}=lt(),h=o.displayOptions,{vaultedContactType:m}=h,{label:v,contact:b,useSummaryInContent:_}=o.displayContent,C=o.email,P=o.displayPhone,S=o.hasError;if(s(()=>{o.hasError&&(t.value=!0)},[o.hasError,t]),"hidden"===m||o.shouldHide&&!c.current)return null;c.current=!0;const A=_?b:void 0,k="amazon"===d?.embedder?{compact:A}:{primary:A};return"rollup"===m?n(po,{id:e,label:v??p.translate("contact.contact_method_title"),primaryContent:k.primary,compactContent:k.compact,open:t.value||S,onToggle:S||!h.expandable?void 0:r,icon:o.logo,children:h.children??null}):n(i,{children:[n(zc,{emailAddress:b,phone:P,logo:o.logo,moreOptions:o.moreOptions,layout:h.contentLayout,children:h.children??null}),o.showShopPayVerification?n(a,{when:u,children:n(Oi,{email:C??"",open:l.value,showPopover:e=>{l.value=e}})}):null]})}function Uc(){return Ge(new Set([...sa].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Gc({loading:e,countryCode:n,phone:t}){const a=ua(),{i18n:i,checkout:r}=lt(),o=r.configuration.addressSettings.nonBillingAddressSettings.value,l=u(()=>o.isRequired("phone",{countryCode:n}),[n,o]),{validatePhoneNumber:c,isPhoneNumberUtilLoaded:d}=Fl(),p=f(e=>{const t=ta(e);return l&&!t?i.translate("field_errors.phone_blank"):t&&!c(e??"",n)?i.translate("field_errors.shipping_line_phone_invalid"):void 0},[l,c,n,i]),h=g(!1);return s(()=>{if(h.current||!d||e)return;const n=p(t);a.value=n,h.current=!0},[l,d,e,t,a,p]),u(()=>({errorSignal:a,validatePhoneField:p,isPhoneRequired:l}),[a,l,p])}const Yc=new Set(ca);function Wc(){const{shopPay:e,checkout:n,source:t,observability:a}=lt(),{deliveryMethodsAddressErrors:i}=n.negotiator.context,r=zo(),{shippingAddress:o}=n.negotiator.parts,l=o.value,u=n.configuration.addressSettings.nonBillingAddressSettings.value,c="simulated"===t.type,d=Ye(l.countryCode,void 0,u),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,m=Ye(h??l.countryCode,void 0,u,null),{details:v}=da(h),y=!h||void 0!==v&&!v.isFallback,{clearViolations:f}=j(Yc),b=g(!0);return s(()=>{b.current?b.current=!1:f()},[f,l]),jo("shippingAddress",async()=>{const t=async(e,t)=>await n.addressManager.shipping.value.createAddress(t)?{success:!0}:{success:!1,location:e,errors:Object.values(i).some(e=>void 0!==e.value)?[]:[r({offerGuestCheckout:!0})]};if(!c){const r=n.addressManager.shipping.value.selectedAddress.value,o=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(r&&"CustomerProfile"===o?.__typename&&o.shippingAddresses.some(e=>e.id===r.id)){const o=e=>{C(()=>{for(const[n,t]of e)i[n].value=t})},s=()=>t("intercept_shipping_address_vault_ca",{address:r.address,selectAddress:!0,addressErrorsOverride:i});if(!y||r.address.countryCode!==h)return s();const u=m(r.address,"shipping");if(0===u.size)return s();const c=d(l,"shipping"),p=e=>{try{a.log("shop_pay_ca_vault_address_invalid","Selected customer-account address fails validation before Shop Pay vault-save",{invalidFields:Array.from(u.keys()).sort().join(","),proposalInvalidFields:Array.from(c.keys()).sort().join(","),proposalDiverges:!pa(l,r.address),outcome:e})}catch{}};if(0===c.size){const a=e.user.addresses.value.find(e=>pa(e.address,l));if(a&&await n.addressManager.shipping.value.selectAddress(a.id))return p("selected_matching_vaulted"),{success:!0};const r=await t("intercept_shipping_address_vault_ca_proposal",{address:l,selectAddress:!0,addressErrorsOverride:i});return p(r.success?"vaulted_proposal":"vault_proposal_rejected"),r}return p("blocked_client_side"),Hl({addressType:"shipping",validate:()=>c,setErrors:o})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const o=Hl({addressType:"shipping",validate:()=>d(l,"shipping"),setErrors:e=>{C(()=>{for(const[n,t]of e)i[n].value=t})}});return o.success?"authenticated_user"===e.user.flow.peek()?t("intercept_shipping_address_add_new",{address:l,addressErrorsOverride:i}):{success:!0}:o}),null}const qc=()=>{const{shopPay:e,checkout:{negotiator:n}}=lt(),{geolocation:a}=We(),{shippingAddress:i}=n.parts;return t(()=>{const n=i.value;return e.signup.phoneCountryCode.value??n.countryCode??a.country.code})};function $c({padding:e}){const{i18n:t,shopPay:a,checkout:{negotiator:i}}=lt(),{shopPayMobilePhoneInputShownSignal:r}=i.context,o=qc(),l=Boolean(a.user.phoneNumber.value),u=(()=>{const{i18n:e,shopPay:n}=lt(),{isPhoneNumberUtilLoaded:t,validatePhoneNumber:a}=Fl(),i=qc(),r=f(n=>ta(n)?t&&!a(n??"",i.value,!0)?e.translate("mobile_phone_number.mobile_phone_invalid"):void 0:e.translate("field_errors.phone_blank"),[e,t,a,i]);return ha(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,r)})();S(()=>(r.value=!0,()=>{r.value=!1}),[r]);const c=g(o.peek());(()=>{const{shopPay:e,checkout:n}=lt(),t=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:a}=n.negotiator.parts,i=e.signup.phoneNumber.value,r=e.signup.phoneError.value,o=a.fields.countryCode.value,l=a.fields.phone.value,{deliveryMethodsAddressErrors:u}=n.negotiator.context,c=u.phone.value,{setAddressError:d}=qe(u),p=qc(),{isPhoneNumberUtilLoaded:h}=Fl(),m=g(!1),v=Vl(p.value,i,!0);s(function(){l&&!i&&e.signup.unstable_setPhoneNumber(l);const n=e.signup.phoneCountryCode.value;o&&!n&&e.signup.unstable_setPhoneCountryCode(o)},[]),s(()=>{if(!m.current&&h&&i){const{prefix:n}=v;i.startsWith(n)||e.signup.unstable_setPhoneNumber(`${n}${i}`),m.current=!0}},[h]),ma(async({parts:n,reason:a})=>{if("negotiation"!==a)return{behavior:"allow"};const{shippingAddress:i}=n;let r=e.signup.phoneNumber.peek();r&&r!==v.prefix||(r=void 0);const o=i.peek().phone;return{behavior:"allow",perform(){r!==o&&t.isVisible("phone",{countryCode:p.value,useMerchantSettings:!0})&&(i.fields.phone.value=r)}}}),s(function(){r!==c&&d("phone",r)},[r,c,d])})();const d=f(e=>{a.signup.unstable_setPhoneCountryCode(e)},[a.signup]);return n(F,{gap:"base",padding:e,children:[n(zl,{name:"phone",countryCode:c.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:d,...u}),n(Z,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const Kc="shipping";function Jc({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const o=va(),{shouldGateCrossBorder:l,crossBorderGate:u}=Ul(),c=lt(),{deliveryMethodsAddressErrors:d}=c.checkout.negotiator.context,{shippingAddress:p}=c.checkout.negotiator.parts,{checkout:h,i18n:m,userEvents:y,source:f,shop:b}=c,{configuration:_}=h,P=_.isAddressDelegationEnabled,{violations:S}=j(sa),A=S.value,k=p.fields?.countryCode.value,E=$e(k),w=g(!1);s(()=>{if(!P)return;if(w.current)return;if(0===A.size)return;if(w.current=!0,Object.values(d).some(e=>{const n=e.value;return n&&"object"==typeof n&&"client"===n.origin&&"inline-validation"===n.type}))return;const e=E(Kc,Array.from(A));C(()=>{for(const[n,t]of e)void 0===d[n]?.value&&(d[n].value=t)})},[P,A,E,d]);const O=_.addressSettings.nonBillingAddressSettings.value,I=p.value,R=ya(),T=U(j(Yc)).value,L=_.defaultPhoneNumber.value;O.isRequired("phone",{countryCode:I.countryCode,useMerchantSettings:!0})&&!I.phone&&L&&(p.value={...I,phone:L});const N=v(Boolean(e&&e.length>0)),D=_.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...wt(f,h,b),action:"address_autocomplete"}})}:void 0,M=n(Ko,{id:"shippingAddressForm",addressType:Kc,address:p,countries:o,settings:r,addressErrors:d,additionalFieldGroups:t,showSavedAddressSelector:!1,onAddressAutoComplete:D,onBeforeCountryChange:(e,n,t)=>{l(e)?u(n,{onCancel:t}):n()},filteredFields:e,children:i}),x=n(a,{when:N,fallback:M,children:n(B,{background:"base",borderRadius:"base",className:ga({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:n(F,{direction:"block",gap:"base",children:[n(B,{padding:"none",children:[n(Z,{children:[I.firstName," ",I.lastName]}),n(Gl,{address:I,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),M]})})});return n(jl,{impressionType:"delivery_address",impressionFeatures:[],children:[Xc(c)&&n(Wc,{}),T&&_.visibility.showInvalidDeliveryAddressBanner.value&&n(B,{children:[n(Ii,{}),n(ve,{blockSize:"base"})]}),n(a,{when:R,children:n(B,{children:[n(Te,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),n(ve,{blockSize:"base"})]})}),x,n(a,{when:_.visibility.showStandalonePhoneField,children:n($c,{padding:"base none none none"})})]})}function Xc({checkout:e}){return"shopPay"===e.identity.current.value}const Zc=o({displayName:"WalletAddressFormatOnExpand",suspense:!1,load:()=>p(()=>e(()=>import("./22de7c07.CCunP4QZ.js"),__vite__mapDeps([132,1,3,4,5,6,46,47,12,2,7,8,9,10,11,13,133])))}),Qc=Ie("WalletAddressFormatOnExpand");function ed({open:e}){const{checkout:{wallets:i},shop:r}=lt(),o=y(null);Qc(o.value);const l=t(()=>Boolean(i.pendingShippingAddressFormat.value&&r.hasFlagEnabled(fa)));return h(()=>{const e=i.pendingShippingAddressFormat.value;l.value&&e&&m(()=>Zc.load().then(n=>{n instanceof Error&&i.pendingShippingAddressFormat.value===e&&(o.value=n,i.setPendingShippingAddressFormat(void 0))}))}),n(a,{when:l,children:n(Zc,{open:e})})}const nd=e=>{if(!e)return"unknown";const{taxId:n}=e;if(n.warnings.includes("DOMESTIC_NOT_APPLICABLE"))return"write";const{status:t}=e.taxId;return"pending"===t.type&&"VALID"===n.validated.status||"resolved"===t.type&&"VALID"===t.validationStatus?"vaulted":"write"};function td(){const e=Ke(),{checkout:{negotiator:n}}=lt(),{paymentLines:a}=n.parts,{walletUsedForSubmissionSignal:i}=ut();return t(()=>e.value||Ql({paymentLines:a.value,walletUsedForSubmission:i.value}))}function ad(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Pa(n)}const id=new Set([...sa,...ba,...ca,...Sa]),rd=["phone","zoneCode","countryCode","firstName","lastName","name"],od=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"];function ld(e){return"pending"===e||"pendingCollapsed"===e}function sd(e){return"collapsed"===e||"pendingCollapsed"===e}function ud({summary:e,forceOpen:r,initiallyOpen:o=!1,renderRollup:l}={}){const u=function(){const{checkout:{negotiator:e}}=lt(),t=e.current.fields.buyerIdentity.value?.purchasingCompany,a=Ce();return t?n(gc,{formattedAddress:a}):void 0}(),c=u??e,d=v(function(){const{i18n:e}=lt(),t=U(j(ba)).value,a=U(j(_a)).value,{hasError:i,error:r}=w(Ca),o=oe(r?{type:"payment",code:r}:void 0);return i&&o?n(Ae,{tone:"critical",errorType:V.DeliveryError,children:o}):t?n(Ei,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?n(Ei,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}()),p=ya(),{embed:_,i18n:P,shopPay:A,observability:k,userEvents:E,checkout:O,source:I,shop:R}=lt(),{validation:T}=O,{shippingAddress:L}=O.negotiator.parts,{allViolations:N}=O.negotiator.current.fields,D=_?.client?.addressErrors.value.includes(Aa.AddressEmpty)??!1,M=va(),{installments:H}=A,z="shopPay"===O.identity.current.value,{isMissingPhone:G}=_l(),{isMissingFirstName:Y}=Cl(),W=G||Y,q="google"===_?.embedder,$=O.configuration.addressSettings.nonBillingAddressSettings.value,J=t(()=>q&&$.isVisible("phone",{countryCode:L.value?.countryCode})),{formattedNumber:X}=Vl(L.value?.countryCode??"",J.value?L.value?.phone:void 0),Z=t(()=>ad(O.configuration,O.identity.current.value)),{deliveryMethodsAddressErrors:Q}=O.negotiator.context,ee=t(()=>Object.values(Q).some(e=>void 0!==e.value)),ne=t(()=>Boolean(L.value?.countryCode&&!M?.some(e=>e.value===L.value.countryCode))),te=function({checkout:e,i18n:t},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?n(Ii,{}):a?n(Ei,{message:t.translate("shipping_errors.unavailable_address_country")}):null}({checkout:O,i18n:P},ne.value),ae=t(()=>function(e,n=[]){const t=Object.entries(e).reduce((e,[t,a])=>("boolean"!=typeof a&&!a||n.includes(t)||(e[t]=a),e),{});return 0===Object.keys(t).length}(L.value,Z.value?od:rd)),[ie,re]=b([]),{availableDeliveryAddresses:le,mustSelectProvidedAddress:se}=O.proposal.negotiated.fields,ue=t(()=>le.value??[]),ce=t(()=>se.value??!1),de=pe("Checkout::DeliveryAddress::RenderBefore"),he=pe("purchase.checkout.delivery-address.render-after"),ve=Ro([...de,...he],{lazyReveal:!0}),ye=Ze(),ge=t(()=>ue.value?.length&&Boolean(ue.value.find(e=>pa(L.value,e.address)))),fe=t(()=>Boolean(ge.value&&ce.value)),be=Qe(),_e=Ht(),Pe=ka(en),Ee=t(()=>_e.value&&"loading"===Pe.uiStateSignal.value?.status),we=t(()=>"filled"===Pe.uiStateSignal.value?.status),Oe=t(()=>!Z.value||!ae.value&&we.value),Ie="deliveryAddress",Re=Ks(Ie,m(()=>o||(ve.value||fe.value)&&Oe.value)),Le=function(e,n){const[t,a]=b(nd(e)),i=g(null),r=y(!1);"vaulted"===t&&nd(e)!==t&&a("write"),"unknown"===t&&nd(e)!==t&&a(nd(e));const o=f(e=>{i.current=e,n.value&&e&&r.value&&(r.value=!1,e.focus())},[r,n]);return h(()=>{n.value&&i.current&&r.value&&(r.value=!1,i.current.focus())}),{status:t,inputRef:o,focus:f(()=>{r.value=!0,a("write"),n.value&&i.current&&(r.value=!1,i.current.focus())},[r,n])}}(be,Re),Ne=g(null),De=g(null),Me=g(!1),Be=y("idle"),xe=ld(Be.value),Fe=sd(Be.value),Ve=y(!1),He=Ws(Ea([...de,...he],"uiExtension").map(xt),f(()=>{Oe.value&&(Re.value=!0)},[Oe,Re]));s(()=>{He&&Oe.value&&(Ve.value=!0)},[He,Ve,Oe.value]);const ze=t(()=>Z.value&&Ve.value);s(()=>{Oe.value&&(ve.value||He)&&(Re.value=!0)},[ve.value,Oe.value,He,Re]),S(()=>{ye.current&&(Z.value&&ae.value||Z.value&&Fe||!1===ge.value&&(Re.value=!0))},[ge.value,Re,ye,Z.value,ae.value,Fe]),Js({isMissing:W,open:Re});const je=T.errors.value.deliveryAddressErrors,Ue=t(()=>T.errors.value.deliveryAddressErrors.length>0),Ge=td().value||"payPal"===O.identity.current.value,{violations:Ye,clearViolations:We}=j(id),qe=Ye.value,Ke=qe.size>0,{missingAddressFieldSignal:tn,hasResolvedMissingAddressFieldSignal:an}=function({countryCode:e,addressType:n,addressViolations:t}){const{checkout:{identity:a}}=lt(),i=y(void 0),{violations:r}=Je(t),o=r.value,l=$e(e),s=y(!1);if(("applePay"===a.current.value||"googlePay"===a.current.value||"payPal"===a.current.value)&&void 0===i.value&&o.size>0&&!s.value){s.value=!0;const e=l(n,Array.from(o)),t=Xe({addressErrors:e});t&&(i.value=t)}return{missingAddressFieldSignal:i,hasResolvedMissingAddressFieldSignal:s}}({countryCode:L.value?.countryCode,addressType:"shipping",addressViolations:sa}),rn=t(()=>Boolean(tn.value)&&!Re.value),on=new Set([...G?wa:[],...Y?Oa:[],...rn.value?sa:[]]),ln=no(Ke,qe,on),{hasError:sn,clearError:un}=w(Ca),cn=H.agreementError.value===Co.InvalidShippingAddress,dn=Xt("deliveryNext"),pn=t(()=>!_e.value||dn.value);h(()=>{Ee.value&&m(()=>{un(),H.unstable_setAgreementError(null)})});const hn=f(()=>{We(),un(),H.unstable_setAgreementError(null)},[We,un,H]),mn=Se(L.value,{hiddenFields:["phone"],displayName:!1}),vn=P.formatName(L.value?.firstName,L.value?.lastName,!0),yn=L.value?.firstName&&L.value?.lastName?vn:void 0,gn=ke({address:L.value??{}}),fn=n(a,{when:ae,fallback:n(F,{children:[mn,J.value&&X&&n(x,{children:X})]}),children:n(x,{tone:"critical",children:P.translate("shipping.add_shipping_address")})}),bn=ae.value?n(x,{tone:D?"critical":void 0,children:P.translate("shipping.add_shipping_address")}):yn,_n=ae.value?void 0:n(F,{children:[gn.primary&&n(x,{children:gn.primary}),gn.secondary&&n(x,{children:gn.secondary}),J.value&&X&&n(x,{children:X})]}),Cn=n(a,{when:()=>ae.value||!L.value?.postalCode,fallback:n(i,{children:[n(x,{children:P.translate("shipping.delivery_to")}),n(x,{type:"strong",children:yn})]}),children:n(x,{tone:"accent",decoration:"underline",children:P.translate("shipping.add_new_delivery_address")})}),Pn=t(()=>L.value?.postalCode),Sn=n(a,{when:()=>ae.value||!Pn.value,fallback:n(F,{children:[n(x,{type:"strong",children:Pn}),J.value&&X&&n(x,{children:X})]}),children:()=>""}),An=(()=>{if(c)return{primary:c};switch(_?.embedder){case"amazon":return{compact:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[Cn,Sn]})};case"google":return{primary:bn,secondary:_n};default:return{primary:yn,secondary:fn}}})(),kn=t(()=>nn(N.value??[])&&!Ee.value),En=v(ln&&!kn.value||sn||cn),wn=t(()=>pn.value?null:En.value&&te&&!Ee.value?{type:"invalid-address-banner",element:te}:!d.value||kn.value||Ee.value?!Ue.value||Ge||kn.value?kn.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(me,{errors:je,errorType:V.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:d.value}),On=n(dd,{errorSignal:wn}),In=t(()=>Boolean(wn.value)||Ge&&Ue.value),Rn=v(ln),Tn=v(sn),Ln=v(r),Nn=v(He),Dn=t(()=>ee.value||Rn.value||Ue.value),Mn=t(()=>Boolean(Ln.value)||ve.value||Nn.value&&Oe.value||ze.value),Bn=t(()=>Z.value&&ld(Be.value)&&sd(Be.value)&&!Mn.value&&!Tn.value&&!kn.value),xn=t(()=>an.value&&void 0===tn.value),Fn=t(()=>Dn.value&&!Bn.value),Vn=t(()=>Z.value&&we.value&&!Fn.value),Hn=t(()=>Vn.value&&sd(Be.value)),zn=t(()=>Mn.value||Tn.value||xn.value||!Bn.value&&In.value),jn=t(()=>Dn.value&&!(Z.value&&ld(Be.value))||kn.value||Mn.value||Tn.value);Me.current=jn.value;const Un=t(()=>{if(Z.value){if(ae.value)return!1;if(Hn.value)return zn.value;if(ee.value&&!Bn.value&&(!an.value||!tn.value))return!0}return Re.value||zn.value}),Gn=f(()=>{De.current&&(clearTimeout(De.current),De.current=null)},[]),Yn=f(()=>{Gn(),Be.value="idle"},[Gn,Be]),Wn=f(()=>{if(Gn(),Me.current)return Be.value="collapsed",void(Re.value=!0);Be.value="collapsed",Re.value=!1},[Gn,Be,Re]),qn=f(()=>{Gn(),De.current=setTimeout(()=>{De.current=null,Me.current||(Be.value="pendingCollapsed",Re.value=!1)},300)},[Gn,Be,Re]),$n=f(()=>{Yn(),Re.value=!0},[Yn,Re]);s(()=>Gn,[Gn]),s(()=>{Z.value&&Dn.value&&!xe&&Yn()},[xe,Dn.value,Z.value,Yn]);const Kn=f(async()=>{if(!Z.value||!_?.client)return;if(ld(Be.value))return;re([]),Be.value="pending";const e=Un.value;ze.value||qn();const n=performance.now();try{const a=await _.client.addressChangeStart("shipping").then(e=>({response:e,error:void 0})).catch(e=>({response:void 0,error:e})),i=performance.now()-n;if(a.error){const{error:n}=a;if(n instanceof Ia)return k.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:i}),re([{code:"GENERAL_ERROR",message:String(P.translate("shipping.third_party_address_timeout"))}]),void $n();const t=n instanceof Error?n.message:String(n);return n instanceof Ra&&n.isUserCancelledError?(k.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:i}),Yn(),Re.value=e,void Ne.current?.focus()):(n instanceof Ta?(k.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:i,technicalError:t}),_.client.error({code:"INVALID_PAYLOAD",message:"Invalid response format from address selection",timestamp:Date.now()})):k.log("third_party_delivery_address_error","Address change failed with error",{duration:i,error:t}),re([{code:"GENERAL_ERROR"}]),void $n())}const{response:r}=a;if(!r||"object"!=typeof r)return k.log("embedder_invalid_response","Invalid or missing response from embedder",{event:"checkout.addressChangeStart",duration:i,receivedResponse:r}),_.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),re([{code:"GENERAL_ERROR"}]),void $n();if(r?.errors&&r.errors.length>0)return re(r.errors),k.log("embedder_error_cancelled_operation","Address change cancelled due to embedder errors",{event:"checkout.addressChangeStart",errorCodes:r.errors.map(e=>e.code),duration:i}),void $n();if(r?.cart){C(()=>{for(const e of Object.values(Q))e.value=void 0;We()});try{await _.client.applyCart(r.cart),Pe.dispatch("addressReplaced"),ze.value?Yn():Wn(),k.log("address_change_start_success","Successfully applied address change from embedder",{duration:i}),Ne.current?.focus()}catch(t){k.log("cart_update_failed_after_address_change","Failed to apply cart update after address change",{event:"checkout.addressChangeStart",error:t instanceof Error?t.message:String(t),duration:i}),_.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}),re([{code:"GENERAL_ERROR"}]),$n()}}else ze.value?Yn():Wn()}catch(t){const e=performance.now()-n;k.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:t instanceof Error?t.message:String(t),duration:e}),re([{code:"GENERAL_ERROR"}]),$n()}},[ze,Z,_,k,re,P,Q,Be,Pe,We,Un,qn,$n,Yn,Re,Wn]),Jn=f(async()=>{if(ze.value)return;if(Z.value){if(Re.value)return;return void(await Kn())}const e=!Re.value;!function({checkout:e,userEvents:n,shop:t,source:a},i){"shopPay"===e.identity.current.value&&n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:E,source:I,checkout:O,shop:R},e),Re.value=e},[ze,E,I,O,R,Re,Kn,Z]);s(()=>{!Z.value||!Fe||Fn.value||zn.value?Un.value?Re.value=!0:Hn.value&&!zn.value&&(Re.value=!1):Re.value=!1},[Re,Z.value,Fe,Fn.value,Un.value,Hn.value,zn.value]);const Xn=0===de.length&&0===he.length,Zn=1===ue.value.length&&ce.value&&Xn,Qn=p.value,et=!pn.value&&!Ee.value&&!Bn.value&&ln&&!(Z.value&&ae.value),nt=Z.value&&!Bn.value&&ee.value&&!ae.value,tt=et||nt,at=(()=>{if(Z.value){const{firstName:e,lastName:t}=L.value,i=!0,r=P.formatName(e,t,i);return n(F,{children:[e&&t&&n(x,{children:r}),n(a,{when:ae,fallback:n(x,{color:"subdued",children:mn}),children:n(x,{tone:"critical",children:P.translate("address_management.address_form.add_address")})})]})}return c??mn})(),it=ae.value?P.translate("shipping.add_shipping_address"):void 0,rt=be&&!Un.value?n(Wl,{vatNumber:be.taxId.value,onAdd:()=>{Re.value=!0,Le.focus()}}):void 0,ot=rn.value?n(B,{padding:"none base base base",children:n(Jc,{filteredFields:tn.value?[tn.value]:void 0})}):void 0,st=ot&&rt?n(F,{direction:"block",gap:"base",children:[ot,rt]}):ot??rt,ut=n(Te,{tone:"info",children:P.translate("address_management.draft_order_delivery_address_reminder")}),ct=Hn.value&&!zn.value||Bn.value?null:p.value?n(i,{children:[On,ut]}):wn.value?On:null,dt=rn.value?{}:{primaryContent:An.primary,secondaryContent:An.secondary,compactContent:An.compact,inlinePrimaryContent:bn,inlineSecondaryContent:_n,compactPrimaryContent:Cn,compactSecondaryContent:Sn,summary:at},pt={buttonRef:Ne,open:Re.value,id:Ie,label:P.translate("shipping.shipping_address_title"),error:ct,buttonAccessibilityLabel:it,...dt,secondaryPersistentContent:st,onToggle:Qn?void 0:Jn,disabled:ze.value||Zn||!Vn.value&&tt,renderChildrenWhenCollapsed:!0,icon:n(K,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},ht=v(Boolean(pt.open||pt.error||pt.disabled)),mt=n(js,{embedderErrors:ie,onDismissEmbedderErrors:()=>re([]),showMissingAddressField:rn.value,onAddressDelegation:Kn,onFirstNamePersisted:hn,vatIdFieldMode:Le});return n(i,{children:[n(ed,{open:ht}),z&&n(Wc,{}),l?l(pt,mt):n(po,{...pt,children:mt})]})}const cd=({errorBanner:e})=>n(B,{paddingBlock:"small-500",children:e}),dd=({errorSignal:e})=>{const t=e.value;if(!t)return null;const a=t.type;switch(a){case"invalid-address-banner":case"default-vaulted-delivery-address-error-banner":case"validation-errors-banner":return n(cd,{errorBanner:t.element});case"unavailable-in-buyer-location-banner":return n(cd,{errorBanner:n(Ri,{})});default:A(a)}};function pd(){const{formattedAddress:e,address:{phone:t,countryCode:a}}=tn(["company"]),r=!N().value,{errorSignal:o}=Gc({loading:r,phone:t,countryCode:a}),l=Boolean(Uc()?.length),s=Boolean(an()?.length),u=Boolean(o.value),c=Boolean(s||l||u);return n(ud,{summary:r?n(D,{}):n(F,{direction:"inline",children:[c&&n(i,{children:[n(K,{tone:"critical",type:"alert-circle"}),n(ve,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function hd(e){const{checkout:{identity:a}}=lt(),i=function(){const{checkout:{negotiator:e}}=lt(),n=e.current.fields.buyerIdentity,a=rn(),i=on();return t(()=>Boolean(n.value?.purchasingCompany)&&(!a.value||i.value))}();return"amazonPay"===a.current.value||"buyWithPrime"===a.current.value?n(pd,{}):i.value?n(bc,{}):n(ud,{...e})}function md(){const{i18n:e,router:i,checkout:{negotiator:r}}=lt(),o=r.current.fields.buyerIdentity.value?.purchasingCompany,l=wl(),s=on(),u="deliveryAddress",c=t(()=>$s(i,u));return!o||o.contact.locationCount<=1||s.value?n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("shipping.delivery_title")}):n(Q,{gridTemplateColumns:"@media (inline-size >= small) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gap:"@media (inline-size >= small) base, none",alignItems:"@media (inline-size >= small) center, ''",alignContent:"@media (inline-size >= small) center, ''",justifyContent:"@media (inline-size >= small) start, ''",justifyItems:"@media (inline-size >= small) start, ''",children:[n(E,{id:u,level:1,autoFocus:c.value,children:e.translate("contact.ship_to_company",{companyName:o.location.name})}),n(a,{when:l,children:n(yo,{})})]})}function vd(){const{i18n:e}=lt(),{redeemableBalance:t,messages:a,isBalanceRedemptionEligible:i}=mc(),r=i&&t,o=a.length>0?n(F,{gap:"small-200",children:a}):void 0;return r||o?r?n(yd,{redeemableBalance:t,messages:o}):n(po,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:o}):null}function yd({redeemableBalance:e,messages:t}){const{i18n:a}=lt(),{amount:i,checked:r,handleChange:o,disabled:l}=tc(e),s=e?a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}):void 0;return n(po,{id:"cashRedemption",open:!0,label:a.translate("order_summary.shop_cash_title"),primaryContent:s,error:t,primaryAction:n(ju,{checked:r,onChange:o,disabled:l}),children:n(x,{fonts:"primary",tone:"accent",children:i})})}function gd({onShowPickupLocations:e}={}){const{i18n:i}=lt(),r=be(),[o]=ln(),l=o.includes("PICK_UP"),{value:s}=sn().value,{value:u}=un().value,c=Boolean(s||u),d=Ti({mode:"localPickup"}),p=t(()=>d.value.merchandiseLines),h=t(()=>d.value.allowAlternativeAction),m=t(()=>d.value.merchandiseLines.length>0),v=cn(),y=c&&!m.value;if(!l||!r.value.delivery)return null;const g=m.value&&c;return n(Ni,{name:"local-pickup-adjacent",variant:"adjacent",children:n(F,{gap:m.value?"base":"small-400",paddingBlockEnd:g?"base":void 0,children:[n(a,{when:v,children:n(B,{paddingBlockStart:"small-400",paddingBlockEnd:y?"small-400":void 0,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})})}),n(a,{when:m,children:n(Li,{bannerType:"pickup",merchandiseLines:p,allowAlternativeAction:h})}),n(fd,{hasNoDeliveryMethods:c,onShowPickupLocations:e})]})})}function fd({hasNoDeliveryMethods:e,onShowPickupLocations:r}){const{i18n:o}=lt(),l=cn(),s=La(),{progressing:u}=_e(),c=Xt("deliveryNext").value,d=Ht(),{isOnlyCountryAvailable:p}=Di(),h=y(!1),m=t(()=>s.value?.methods??[]),v=t(()=>{const e=s.value;return e&&Na(e)}),g=t(()=>m.value.length>0&&Mi(m.value)),f=U(G(Da)),b=Bi({allLocationsFarAway:g,selectedPickupOptionNoLongerAvailable:f}),_=dn({methods:m.value,selectedDeliveryMethodHandle:v.value?.handle}),C=t(()=>pn(s.value?.targetMerchandiseLines)),P=t(()=>xi(m.value,p,C.value,o,{selectedDeliveryMethodHandle:v.value?.handle,allLocationsFarAway:g.value})),S=()=>{_(p?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain"),r?r():h.value=!0};return e?null:n(i,{children:[n(a,{when:b,children:n(Fi,{itemCount:C.value,methods:m.value,onChangeLocationClick:S})}),n(F,{direction:"inline",gap:"small-400",alignItems:"center",justifyContent:"space-between",paddingBlockStart:l.value?void 0:"small-200",paddingBlockEnd:l.value?"small":"small-200",children:[d.value&&!u.value&&c?n(D,{inlineSize:"base"}):n(x,{color:"subdued",children:P}),n(Vi,{onClick:S})]}),r?null:n(Hi,{methods:s.value?.methods,type:s.value?.type,open:h.value,onClose:()=>{h.value=!1}})]})}const bd={isLocationFormVisible:!1};function _d({initiallyOpen:e=!1,renderRollup:a}){const{i18n:r,shop:o,checkout:{negotiator:l}}=lt(),{deliveryNext:s}=l.current.fields,{progressing:u}=_e(),c=Xt("deliveryNext"),d=Ht(),{value:p}=sn().value,{value:h}=un().value,m=Boolean(p||h),v=La(),f=t(()=>Ma(s.value)??[]),_=t(()=>o.shipPickupInOneOrderEnabled?v.value&&Na(v.value):f.value[0]),C=t(()=>_.value?.handle??""),P=t(()=>({handle:C.value})),S=zi(),{isOnlyCountryAvailable:A}=Di(),k=Se(_.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),E=pe("Checkout::PickupLocations::RenderBefore"),w=pe("Checkout::PickupLocations::RenderAfter"),O=pe("purchase.checkout.pickup-location-option-item.render-after"),I=E.length>0?n(hn,{customizations:E,options:bd}):void 0,R=w.length>0?n(hn,{customizations:w,options:bd}):void 0,T=ji(),L=dn({methods:f.value||[],selectedDeliveryMethodHandle:_.value?.handle}),[N,M]=b(!1),B=y(e),x=y(!1),V=e=>{M(!0),x.value=e??!1},{currentAdditionalLocations:H,additionalLocationsCount:z}=function(e){const n=g(),a=t(()=>{const t=e.value?e.value.methods.length-1:void 0;return void 0!==t&&(n.current=t),t}),i=t(()=>a.value??n.current);return{currentAdditionalLocations:a,additionalLocationsCount:i}}(v),j=t(()=>Boolean(H.value)||d.value&&c.value&&0!==z.value);let U,G,Y,W,q;const $=T.value?n(F,{gap:"small-200",children:n(Ui,{variant:"banner"})}):void 0;if(d.value&&!u.value&&c.value)U=n(D,{}),G=n(D,{inlineSize:"base"}),Y=n(D,{inlineSize:"small"}),q=$;else if(_.value?.pickupLocation){const{cost:{amount:e,currencyCode:t},pickupLocation:{name:a}}=_.value,o="PickupInStoreLocation"===_.value.pickupLocation?.type?_.value.pickupLocation.distanceFromBuyer:void 0,l=o&&!A?Gi(r,o):void 0,s=0===e?r.translate("shipping.free_rate_label"):r.formatCurrency(e,{currency:t}),u="PickupInStoreLocation"===_.value.pickupLocation.type&&_.value.pickupLocation.instructions.trim();U=n(i,{children:[a,n(ql,{}),s]}),G=k||void 0;const c=l||u?n(Yi,{distanceLabel:l,instructions:u||void 0}):null,d=O.length>0?n(hn,{customizations:O,options:P.value}):null;Y=c&&d?n(F,{gap:"small-400",children:[c,d]}):c??d??void 0,W=I?n(F,{gap:"small-200",children:I}):void 0,q=$||R?n(F,{gap:"small-200",children:[$,R]}):void 0}const K=!c.value&&!0===m,J=m?n(Vi,{onClick:()=>{V(),L(A?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},commandFor:Po}):void 0,X=j.value?n(Cd,{locationCount:z.value,onShowModal:V,onTrackAnalytics:()=>L("checkout_pickup_buyer_reveal_more")}):void 0,Z=a?{id:"pickupLocations",label:r.translate("delivery_options.pickup"),open:B.value,disabled:K||O.length>0,onToggle:()=>{B.value=!B.value},primaryContent:U,secondaryContent:G,primaryPersistentContent:W,secondaryPersistentContent:R}:{id:"pickupLocations",label:r.translate("local_pickup.title"),open:K,primaryContent:U,secondaryContent:G,tertiaryContent:Y,primaryPersistentContent:W,secondaryPersistentContent:q,primaryAction:J,secondaryActions:X},Q=n(Us,{onShowModal:V}),ee=a?n(F,{gap:"base",children:[n(Yl.Provider,{value:!1,children:n(gd,{onShowPickupLocations:()=>V()})}),J,Q,X]}):S&&Q;return n(i,{children:[a?a(Z,ee):n(po,{...Z,children:ee}),n(Hi,{methods:v.value?.methods,type:v.value?.type,open:N,onClose:()=>{M(!1),x.value=!1},addressFocus:x})]})}function Cd({locationCount:e,onShowModal:i,onTrackAnalytics:r}){const{progressing:o}=_e(),l=Xt("deliveryNext"),s=sn(),u=t(()=>o.value||!l.value&&!s.value.loading);return n(a,{when:u,fallback:n(D,{}),children:n(Pd,{locationCount:e,onShowModal:i,onTrackAnalytics:r})})}function Pd({locationCount:e,onShowModal:t,onTrackAnalytics:a}){const{i18n:i}=lt();return e?n(H,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{t(),a()},children:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:n(x,{type:"strong",children:e>20?i.translate("local_pickup.toggle_multiple_locations",{count:String(20)}):i.translate("local_pickup.toggle_more_locations",{count:e})})})}):null}function Sd({destination:e}){const t=y(!1),a=y();return n(i,{children:[n("deliveryAddress"===e?hd:_d,{initiallyOpen:t.value,renderRollup:(e,n)=>(a.value={props:e,content:n},null)}),n(Ad,{rollup:a,switched:t})]})}function Ad({rollup:e,switched:t}){const a=e.value;return a?n(po,{...a.props,children:n(F,{gap:"base",children:[n(kd,{switched:t}),a.content]})}):null}function kd({switched:e}){const t=mn();return t?n(Wi,{options:t.options,selected:t.selected,select:n=>{e.value=!0,t.select(n)},showChangedBanner:!1}):null}const Ed=new Set(["SHIPPING","PICK_UP"]);function wd(){const{checkout:e,shop:n}=lt(),a=v(mn()),i=n.hasFlagEnabled(Ba);return t(()=>"next"===a.value?.variant&&(!i||1===e.sections.availableToRender.value.filter(e=>"deliveryAddress"===e||"localPickupOptions"===e).length)&&function(e,n=[],t=[]){return"vaulted"===e&&n.every(({id:e})=>Ed.has(e))&&1===t.length&&Ed.has(t[0])}(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}const Od=()=>{const{i18n:e,checkout:{negotiator:t}}=lt(),a=y(!0),{value:i}=t.current.fields.optionalDuties,r=i?.buyerRefusesDuties?e.translate("shipping.duties_and_taxes_options.ddu_title"):e.translate("shipping.duties_and_taxes_options.ddp_title");return n(po,{open:a.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:r,onToggle:()=>a.value=!a.value,children:n(as,{})})};function Id(){const{i18n:e,checkout:t}=lt(),a=t.negotiator.parts.shippingAddress.value,{deliveryNext:{value:i},buyerIdentity:{value:r}}=t.negotiator.current.fields,o=(t.proposal.facts.delivery??[])[0],l=r?.purchasingCompany,s=l?.location.name,u=Boolean(l)&&Boolean(s),c="unavailable"===i?.status?a:o?.deliveryAddress,d=Se(c??void 0,{countryFormat:"explicit",displayName:u}),p=e.formatName(c?.firstName,c?.lastName,!0);if(o?.pickupAddress)return n(Rd,{address:o.pickupAddress??void 0});const h=c?p:e.translate("review.blocks.no_address"),m=u?s:h,v=u?e.translate("review.blocks.no_address"):void 0,y=c?d:v;return n(po,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:m,secondaryContent:y})}function Rd({address:e}){const{i18n:t}=lt(),a=Se(e,{hiddenFields:["postalCode","countryCode","phone"]}),i=a?n(x,{children:a}):void 0;return n(po,{id:"orderEditDeliveryAddress",label:t.translate("local_pickup.title"),primaryContent:i})}function Td(){const{i18n:e,checkout:t}=lt(),a=(t.proposal.facts.delivery??[])[0],i=a?.lines.filter(({deliveryChange:e,isFulfilled:n})=>"REMOVED"!==e&&!n).map(e=>n(vr,{line:e},e.title));return n(po,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:i})}function Ld(){const{i18n:e,shopPay:n,checkout:a,shop:i}=lt(),r=Pt(),o=vn(),{paymentMethods:l}=a.negotiator.current.fields,s=ae();return t(()=>function({i18n:e,installmentsI18n:n,shopPay:t,shopCountryCode:a,isPointOfSale:i,chargeAmount:r,numberOfPaymentTerms:o,installmentsUnavailable:l,paymentDue:s,installmentsConfig:u}){const c=os(t),d=s?.currencyCode,p=u?.availableLoanTypes,h=u?.merchantCountry??a,m=("US"===h||"CA"===h)&&"AUD"!==d&&!i&&!Fa(t)&&!l&&t.installments.isServiceAvailable.value&&p?.includes("SPLIT_PAY")&&p.includes("ZERO_PERCENT"),v=r?e.formatCurrency(r,{currency:d,form:"short"}):void 0,{payNowLabel:y,payNowSubtitle:g}={payNowLabel:n.translate("installments.installments_pay_now"),payNowSubtitle:n.translate("installments.installments_pay_now_subtitle")},f=()=>2===o?n.translate("installments.pay_in_installments_subtitle.split_pay_2"):1===o?n.translate("installments.pay_in_installments_subtitle.split_pay_30"):n.translate("installments.pay_in_installments_subtitle.split_pay"),b="GBP"===d?n.translate("installments.pay_in_installments.gb"):"AUD"===d?n.translate("installments.pay_in_installments.au"):!l&&v&&p&&0!==p.length?m?n.translate("installments.pay_in_installments.all"):p.includes("ZERO_PERCENT")?n.translate("installments.pay_in_installments.only_interest"):p.includes("INTEREST")&&p.includes("SPLIT_PAY")?n.translate("installments.pay_in_installments.all"):p.includes("INTEREST")?n.translate("installments.pay_in_installments.only_interest"):(P=v,2===o?n.translate("installments.pay_in_installments.only_split_pay_2",{amount:P}):1===o?n.translate("installments.pay_in_installments.only_split_pay_30",{amount:P}):n.translate("installments.pay_in_installments.only_split_pay",{amount:P})):2===o?n.translate("installments.pay_in_installments_no_amount_2"):1===o?n.translate("installments.pay_in_installments_no_amount_30"):n.translate("installments.pay_in_installments_no_amount"),_="GBP"===d?!l&&p&&v&&0!==p.length?2===o?f():p.includes("INTEREST")&&p.includes("SPLIT_PAY")?n.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:v}):p.includes("ZERO_PERCENT")&&p.includes("SPLIT_PAY")&&(6===o||12===o)?n.translate("installments.pay_in_installments_subtitle.split_pay_3_6z_12z_gb",{amount:v}):p.includes("ZERO_PERCENT")&&12===o?n.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:v}):p?.includes("ZERO_PERCENT")&&6===o?n.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:v}):p.includes("INTEREST")?n.translate("installments.pay_in_installments_subtitle.informational_gb"):n.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:v}):n.translate("installments.pay_in_installments_subtitle.informational_gb"):p&&v&&0!==p.length?m?n.translate("installments.pay_in_installments_subtitle.split_pay_and_zero_percent",{amount:v}):p.includes("ZERO_PERCENT")?n.translate("installments.pay_in_installments_subtitle.interest"):p.includes("INTEREST")&&p.includes("SPLIT_PAY")?n.translate("installments.pay_in_installments_subtitle.all",{amount:v}):p.includes("INTEREST")?n.translate("installments.pay_in_installments_subtitle.interest"):f():f(),C="SHOP_PAY"===c;var P;return{payNowLabel:y,payNowSubtitle:g,installmentsLabel:b,installmentsSubtitle:_,summary:"SHOP_PAY"===c?`${y} - ${g}`:`${b} - ${_}`,primaryLabel:C?y:b,secondaryLabel:C?g:_}}({i18n:e,installmentsI18n:s,shopPay:n,shopCountryCode:i.countryCode,isPointOfSale:o.value,chargeAmount:a.installments.chargeAmount.value,numberOfPaymentTerms:a.installments.numberOfPaymentTerms.value,installmentsUnavailable:a.installments.isUnavailable.value,paymentDue:r.value,installmentsConfig:xa(l.value)}))}function Nd(){const{userEvents:e}=lt(),n=yn(Va.SHOP_PAY_PAY_NOW),t=yn(Va.SHOP_PAY_INSTALLMENTS),a=yn(Va.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=yn(Va.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:f(r=>{const o=function(){switch(r){case"payment_method_pay_now":return n.value;case"payment_method_installments":default:return t.value;case"default_payment_method_installments":return a.value;case"default_payment_method_pay_now":return i.value}}();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:o})},[e,n,t,a,i])}}function Dd({onAutoExpand:e}={}){const{source:n,checkout:a,shop:i,observability:r,userEvents:o,shopPay:l,embed:u}=lt(),{visibility:c}=l,d=a.installments.isSupported.value,p=a.installments.isUnavailable.value,h=p||l.user.installments.wasRejected.value,m=vn(),v=os(l),{paymentMethods:y}=a.negotiator.current.fields,f=t(()=>xa(y.value)),b=d?f.value?.availableLoanTypes:void 0,_=g(),C=hl(),{recordRetailEvent:P}=Nd();s(()=>{"SHOPIFY_INSTALLMENTS"===v&&d&&p&&l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[v,d,p,l.session]),s(()=>{l.session.isInternalProgressing.value||d&&!p&&(!m.value&&c.showAutoExpandedPaymentMethods&&e?.(),C.value.spiPreselected&&(l.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),r.leaveErrorBreadcrumb("SPI preselected",{})))},[d,p,m.value,C.value.spiPreselected,l.session,r,c.showAutoExpandedPaymentMethods,e]),s(()=>{m.value&&d&&P(p?"default_payment_method_pay_now":"default_payment_method_installments")},[d,p,m.value,P]),s(()=>{!h&&b&&JSON.stringify(_.current)!==JSON.stringify(b)&&(o.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...So(n,a,i,{embedPlatform:u?.platform,shopAppSurface:l.app.config.surface}),eventType:xl.InterestEligibility,success:Ha(b),errorMessage:Ha(b)?void 0:JSON.stringify(["amount"])}}),o.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...So(n,a,i,{embedPlatform:u?.platform,shopAppSurface:l.app.config.surface}),eventType:xl.SplitPayEligibility,success:Boolean(b.includes("SPLIT_PAY")),errorMessage:b.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),_.current=b)},[b,h,o,n,a,i,u?.platform,l.app.config.surface])}function Md(){const{i18n:e}=lt(),t=y(!1),a=Ld(),i=gn(),r=f(()=>{t.value=!t.value},[t]);return Dd({onAutoExpand:f(()=>{t.value=!0},[t])}),n(po,{open:t.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:r,children:n(Gs,{ineligibilityReason:i})})}function Bd(){const{i18n:e}=lt();return n(po,{label:e.translate("pickup_point.title"),open:!0,children:n(fn,{rowsInset:!0,children:n(qi,{heading:"none"})})})}function xd(){const{userEvents:e,shop:n,source:t,checkout:a}=lt();return{trackOnDeliveryToggle:f(i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...wt(t,a,n),action:i?"shipping_rates_expand":"shipping_rates_collapse"}})},[e,t,a,n]),trackSelectShippingMethod:f((i,r)=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_rate/3.1",payload:{...wt(t,a,n),currentRate:i.handle??"",currentRatePrice:`${i?.cost?.amount??0}`,isLocalDelivery:!i.pickupLocation&&"LOCAL"===i.methodType,isLocalPickup:Boolean(i.pickupLocation),previousRate:r?.handle,previousRatePrice:"number"==typeof r?.cost?.amount?`${r?.cost?.amount}`:void 0}})},[e,t,a,n])}}const Fd=o({displayName:"ShippingGroupsSummary",load:()=>p(()=>e(()=>import("./17a5f1e4.DLFoxVmM.js"),__vite__mapDeps([134,1,2,3,4,5,6,7,8,9,10,11,12,13,99,100,101,135,84,22,23,19,24,20,25,67,44,68,69,70,71,72,42,43,45,46,47,48,49,50,51,52,73,74,75,76,77,78,79,80,81,82,83,41,57,85,86,87,88,89,90,102,103,104,31,32,33,105,106,107,108,109,14,15,16,17,18,21,26,27,28,29,30,34,35,38,39,40,91,110,58,111,112,113,114,115,55,116,117,118,119,120,121,97,98,96,122,123,124,125,63,126,62,127,128]))),renderLoading:()=>n(D,{})});function Vd({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:o}=lt(),{deliveryExpectationLines:l}=cs(),s=o.configuration.layout.isOnePage.value,u=e=>{const t=e.methods.find(({handle:n})=>n===e.selectedDeliveryMethodHandle);if(!t)return null;const{handle:i,cost:o,costAfterDiscounts:u,brandedPromise:c,estimatedTimeInTransit:d}=t,p="LOCAL"===t.methodType,h=Boolean(t?.deliveryPredictionEligible),{deliveryExpectation:m}=Cn(t,l||[],Boolean(h||c));return n(F,{gap:"small-400",children:n(B,{children:[n(ds,{methodTitle:Pn({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(ps,{cost:o,costAfterDiscounts:u,inlineDiscount:!0})}),a?n(Z,{color:"subdued",size:s?void 0:"small",children:a}):n(hs,{deliveryMethod:t,deliveryExpectationLine:m,estimatedTimeInTransit:d,paragraphColor:"subdued"})]})},i)};return n(i,{children:e.map(e=>{const a=bn(e.targetMerchandiseLines??[]);return a.slice(0,1).map(i=>n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(auto, max-content) minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"large-100",alignItems:"center",alignContent:"center",children:[!t&&(a.length>1?n(_n,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(ms,{merchandiseItem:i,hideBadge:!0})),u(e)]},i.id))})})}function Hd({deliveryNextValue:e}){const t=Ua(e).filter(Sn);return t.length?n(Q,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(Vd,{lines:t,hideThumbnail:1===t.length})}):null}function zd({cost:e,costAfterDiscounts:t,hideDiscountedTotalOnShippingSelector:a,styleOverrides:i={}}){return e&&t?n(ps,{cost:e,costAfterDiscounts:t,inlineDiscount:!0,preDiscountCost:a,styleOverrides:i}):null}function jd(){const{i18n:e,checkout:{identity:{current:t}}}=lt(),a=t.value,i="amazonPay"===a||"buyWithPrime"===a;return!N().value&&i?n(po,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:n(D,{})}):n(Ud,{})}function Ud(){const{embed:e,i18n:a,checkout:r}=lt(),o=ls(),{hasMultipleDeliveryGroups:l}=o.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:u}=ss({hasMultipleDeliveryGroups:l,targeted:!1,shouldHandleRollup:!0}).value,c=pe("Checkout::ShippingMethodDetails::RenderAfter"),d=pe("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=ka(en),m=U(G(Ga)),y=td(),g=U(An(Ya)),b=t(()=>y.value&&g.value),_=cn(),C=Ro([...u,...c,...d],{lazyReveal:!0}),P="shippingMethod",S=Ks(P,C.peek()),A=v(Ws(Ea([...u,...c,...d],"uiExtension").map(xt),f(()=>{S.value=!0},[S])));h(()=>{C.value&&(S.value=!0)}),h(()=>{(m.value||b.value||!_.value&&function(e){if("filled"!==e.status)return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some(e=>{const t=Wa(e);return!!n.includes(t?.methodType||"")&&"available"===e.status&&e.hasDeliveryLineChange})}(p.value))&&(S.value=!0)});const k=function({identity:{current:e}}){const{trackOnDeliveryToggle:n}=xd(),t=f(e=>{n(e)},[n]);return"shopPay"===e.value?t:void 0}({identity:r.identity}),E=f(()=>{const e=!S.value;k?.(e),S.value=e},[k,S]),{deliveryNext:w,shippingAddress:O}=r.negotiator.current.fields,{deliveryLines:I}=r.negotiator.parts,R=function({i18n:e,identity:{current:n}}){switch(n.value){case"amazonPay":case"buyWithPrime":case"businessCustomer":case"customerAccount":case"shopPay":return{addressIncompleteMessage:e.translate("shipping.method_summary.incomplete_address_selected"),addressInvalidMessage:e.translate("shipping_errors.invalid_shipping_method_summary")};default:return}}({i18n:a,identity:r.identity}),T=function({state:e,addressInvalidMessage:t,addressIncompleteMessage:a}){const{i18n:r,checkout:{negotiator:o}}=lt(),l=o.current.fields.deliveryNext,s=Xt("deliveryNext"),{deliveryExpectationLines:u}=cs(),{rollup:{secondaryContent:{typography:{color:c}={}}={}}={}}=ye(),d=cn(),p=c??"base",h="filled"===e.status?e.deliveryLines:void 0,m=$l({deliveryLines:h}),v=U(j(za)).value,y=U(j(ba)).value,g=n(D,{inlineSize:"base"}),f=n(D,{inlineSize:"small"});if("initial"===e.status||"loading"===e.status)return{compactPrimaryContent:g,compactSecondaryContent:void 0,inlinePrimaryContent:g,inlineSecondaryContent:f,primaryContent:g,secondaryContent:f};if("empty"===e.status||"error"===e.status){const i=a??r.translate("shipping.method_summary.incomplete_address_entered"),o=t??r.translate("shipping.invalid_shipping_method_summary"),l=r.translate("shipping.different_shipping_method_summary");let s="empty"===e.status?i:o;v?s=i:y&&(s=l);const u=n(x,{children:s});return{compactPrimaryContent:u,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:u,primaryContent:u,secondaryContent:void 0}}if(ja(l.value,d.value)){if(s.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:f};let e=n(Fd,{});return m?e=n(Jl,{summary:m}):d.value&&(e=n(Hd,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:m?n(Kl,{summary:m,secondaryContentColor:p}):void 0}}const b=d.value?e.deliveryLines.filter(Sn):e.deliveryLines,_=Ao(b);if(!_)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:C,cost:P,hideDiscountedTotalOnShippingSelector:S}=_,A=Pn({deliveryMethod:_,localDelivery:"LOCAL"===_.methodType?r.translate("shipping.local_delivery"):void 0}),k=u?.find(e=>e.deliveryStrategyHandle===_.handle),E=n(ds,{methodTitle:A,showInterpunct:!0,price:P&&C?n(zd,{cost:P,costAfterDiscounts:C,hideDiscountedTotalOnShippingSelector:S}):void 0}),w=n(hs,{deliveryMethod:_,deliveryExpectationLine:k,paragraphColor:c??"base"});return{compactPrimaryContent:n(x,{type:"strong",children:n(ds,{methodTitle:A})}),compactSecondaryContent:n(i,{children:[n(hs,{deliveryMethod:_,deliveryExpectationLine:k,paragraphColor:c,formatContent:e=>e?n(F,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",e,")"]}):null}),n(x,{color:c,children:n(zd,{cost:P,costAfterDiscounts:C,hideDiscountedTotalOnShippingSelector:S,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:E,inlineSecondaryContent:w,primaryContent:E,secondaryContent:w}}({state:p.value,addressIncompleteMessage:R?.addressIncompleteMessage,addressInvalidMessage:R?.addressInvalidMessage}),L=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:e,compactSecondaryContent:t}=T;return void 0===e&&void 0===t?{primary:T.primaryContent,secondary:T.secondaryContent}:{compact:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[e,t]})}}case"google":return{primary:T.inlinePrimaryContent,secondary:T.inlineSecondaryContent};default:return{primary:T.primaryContent,secondary:T.secondaryContent}}})();h(()=>{const e=function(e,n,t){return qa(e).some(({line:e,method:a})=>{if("SHIPPING"!==a?.methodType&&"LOCAL"!==a?.methodType)return!1;if(!a?.phoneRequired)return!1;const i=n.find(n=>{const t=n.peek();return t.type===e.type&&t.id===e.id}),r=i?.fields.deliveryMethodOptions.value.phone?.value;return!r&&!t})}(w.value,I.value,O.value?.phone);e&&(S.value=!0)});const N=t(()=>("error"===p.value.status||"empty"===p.value.status)&&!(C.value||A.value));return h(()=>{N.value&&(S.value=!1)}),n(po,{open:S.value,id:P,label:a.translate("shipping.title"),primaryContent:L.primary,secondaryContent:L.secondary,compactContent:L.compact,onToggle:s&&"empty"===p.value.status||N.value?void 0:E,renderChildrenWhenCollapsed:!0,icon:n(K,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(Hs,{singleDeliveryGroup:o})})}const Gd={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},Yd={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Wd={SHIPPING:{id:"shippingMerchandiseList"},PICK_UP:{id:"pickupMerchandiseList"}};function qd({selectedDeliveryMethodType:e}){const{i18n:i}=lt(),r=cn(),{showOverlay:o}=kn(),l=y(!1),s=Wd[e],u=$i(e),{visibleSummary:c,isNegotiating:d}=Ki(u),p=Ht(),{shouldOpenModal:h}=Ji(),m=t(()=>{const e=c.value;return e?e.isAllItems?i.translate("split_delivery.all_items"):i.translate("split_delivery.items_count",{count:e.totalItemCount}):""}),v="PICK_UP"===e?i.translate("delivery_options.pick_up"):i.translate("delivery_options.ship"),g=n(a,{when:()=>!(void 0===c.value||p.value&&d.value),fallback:n(D,{}),children:n(x,{children:m})}),f=n(_n,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(h.value)return n(so,{theme:Gd,children:n(po,{id:s.id,label:v,thumbnail:f,onClick:()=>o(Xi),primaryContent:g})});const b=l.value||r.value;return n(so,{theme:b?Yd:Gd,children:n(po,{id:s.id,label:v,thumbnail:f,open:b,onToggle:b?void 0:()=>{l.value=!l.value},primaryContent:g,children:n(Zi,{title:"PICK_UP"===e?i.translate("split_delivery.items_for_pickup"):i.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function $d(){const{rollup:e}=ye(),{padding:t}=ti({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(B,{padding:t,children:n(md,{})})}function Kd({hideLastDivider:e,splitGroupsOnCards:i,showTopDivider:r,stripBlockEndPadding:o}){const l=be(),{negotiate:u}=_e(),{checkout:c,embed:d,source:p}=lt(),v=Qi(),y=t(()=>l.value.delivery&&c.isShippingRequired.value),g=t(()=>y.value&&v.value),f=$a({checkout:c}),b=t(()=>l.value.contact&&c.configuration.showContactInformation),_=[...t(()=>ii({isContactVaulted:l.value.contact,configuration:c.configuration,identity:c.identity,embed:d})).value?[n(jc,{},"contact")]:[],...y.value?[n(hd,{},"delivery")]:[],...function(e){if(Vt(p))return l.value.payment?[n(Ou,{},"payment")]:[];const t=[];return f&&t.push(n(_c,{isAbovePaymentSummary:!0},"businessCustomerBilling")),l.value.payment&&(t.push(n(Ou,{},"payment")),e.configuration.visibility.showCashRedemption.value&&t.push(n(yc,{},"cashRedemption")),l.value.billing&&!f&&t.push(n(_c,{},"billingAddress"))),t}(c)],C=_.length>0||b.value;var P;return s(()=>{P&&xs().catch(()=>{})},[P=C]),function(){const{checkout:{wallets:e},shop:n}=lt();h(()=>{(e.activeSession.value||e.escalatedWallet.value)&&n.hasFlagEnabled(fa)&&m(()=>{Zc.preload()})})}(),function({hasSections:e,identity:n,wallets:t,lastJourneyProgression:a,negotiate:i}){s(()=>{e&&function({identity:e,wallets:n}){return"amazonPay"!==e.current.value&&"buyWithPrime"!==e.current.value&&!n.activeSession.value}({identity:n,wallets:t})&&!ri(a.peek())&&i({silenceViolations:["all"]})},[])}({hasSections:C,identity:c.identity,wallets:c.wallets,lastJourneyProgression:c.negotiator.lastJourneyProgression,negotiate:u}),0===_.length?null:n(B,{children:[n(Ms,{children:n(Xd,{hideLastDivider:e,splitGroupsOnCards:i,showTopDivider:r,stripBlockEndPadding:o})}),n(a,{when:()=>l.value.payment,children:n(Vu,{})}),n(a,{when:g,children:n(er,{})})]})}function Jd({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:o}=lt(),l=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,be().value.payment),{vaulted:{spacing:s="none",cornerRadius:u,divider:{borderWidth:c="base",borderStyle:d="base",borderColor:p,visibility:h="visible"}={}}={}}=ye(),{main:{section:m}}=fe(),{rendered:v}=On(),y=o.hasFlagEnabled(la),g=!l&&!ts(t),f=v?.padding,{blockStart:b,blockEnd:C}=function(e){if(null==e)return{blockStart:!1,blockEnd:!1};const n=Array.isArray(e)?e[0]:e;let t=Array.isArray(e)?e[0]:e;return Array.isArray(e)&&4===e.length&&(t=e[2]),{blockStart:Zd(n),blockEnd:Zd(t)}}(y?void 0:f);return 0===e.length?null:n("div",{className:_("K6vpG",ts(a)&&"CU3YS",g&&"_5HWz9",b&&"r8rqQ",(C||i)&&"_2Ojsq"),style:Qd({spacing:s,borderWidth:c,borderStyle:d,borderColor:p??"base",visibility:h,cornerRadius:m?.cornerRadius??u}),children:e})}function Xd({hideLastDivider:e,splitGroupsOnCards:t,showTopDivider:a,stripBlockEndPadding:r}){const o=function(){const e=be(),{checkout:t,shop:a,embed:r,i18n:o,source:l}=lt(),{identity:s,identity:{current:c}}=t,d=c.value,p=a.hasFlagEnabled(Ba),h=a.hasFlagEnabled(la),m=En(),v=wn(),y=$a({checkout:t}),g=m.value&&!v.value,f=cn(),b=Qi(),_=void 0!==La().value,C=Xt("deliveryNext"),P=Ht(),{deliveryLines:A}=t.negotiator.parts,k=Ka(A.value??[]).filter(e=>e.requiresShipping).length>0,w=$i("PICK_UP").value.length>0,O=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isBalanceRedemptionEligible:r}=vc(),o=$u();if(r&&t)return!0;const l=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!l&&!s)||!!tl.some(e=>qu(o.value,e))||n.length>0}(),I=u(()=>({isSplitShipAndPickup:f.value,isBusinessCustomerSingleChoiceMode:g,businessCustomerCannotProvideShippingAddress:m.value,redemptionEligibilityVisible:O,shouldAllowInlineSplit:b.value,hasShippingMerchandiseLines:k,hasLocalPickupDeliveryLine:_,hasPickupMerchandiseToDisplay:w,deliveryNextLoading:P.value&&C.value}),[f.value,g,m.value,O,b.value,k,_,w,P.value,C.value]),R=I.isSplitShipAndPickup?Ja:Xa,T=R[d]??R.default,L=wd(),N=e=>!L.value||"deliveryAddress"!==e&&"localPickupOptions"!==e?e:"deliveryDestination",D=e=>{switch(e){case"contact":return n(jc,{},e);case"businessCustomerSingleChoice":return n(bc,{},e);case"orderEditDeliveryAddress":return n(Id,{},e);case"orderEditShippingMethod":return n(Td,{},e);case"deliveryAddress":return L.value?n(Sd,{destination:e}):n(hd,{},e);case"shippingMerchandiseList":return n(qd,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(jd,{},e);case"pickupMerchandiseList":return n(qd,{selectedDeliveryMethodType:"PICK_UP"},e);case"localPickupOptions":return L.value?n(Sd,{destination:e}):n(_d,{},e);case"pickupPoint":return n(Bd,{},e);case"dutyOptions":return n(Od,{},e);case"paymentOptions":return n(Md,{},e);case"payment":return n(Ou,{},e);case"billing":return n(_c,{isAbovePaymentSummary:y},e);case"cashRedemption":return n(vd,{},e);default:return n(i,{})}};S(()=>{p&&t.sections.unstable_providePreactContext(I)},[p,t.sections,I]);const M={configuration:t.configuration,installments:t.installments,isShippingRequired:t.isShippingRequired,vaultedSections:p?t.vaultedSections:{signal:e},source:l,proposal:t.proposal,identity:s,shop:a,embed:r},B=p?t.sections.availableToRenderGrouped.value:Za(Qa(T.filter(e=>ei[e].shouldRender({preactContext:I,concepts:M})),{preactContext:I,concepts:M}));let x=!1;return B.filter(e=>e.length>0).map(e=>{const a=[];for(const{sectionId:o,groupId:l}of e){const e=D(o);null!=l&&ni.has(l)?(!x&&t.configuration.visibility.showDeliveryHeading.value&&(a.push(n(h?$d:md,{},"deliveryHeading")),x=!0),a.push(n(he,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ni,{name:o,children:e})},N(o)))):a.push(e)}const i=e[0]?.groupId,r=function(e,t,a){if(t.isSplitShipAndPickup)return"shipping"===e?n(E,{level:2,children:a.translate("delivery_options.ship_to_address")}):void 0}(i,I,o);return{groupId:i,header:r,elements:a}})}(),l=cn();if(0===o.length)return null;const s=o.length>1&&l.value;return n(i,{children:s?n(F,{gap:"large-200",children:o.map(({groupId:l,header:s,elements:u},c)=>{const d=0===c,p=c===o.length-1,h=n(io,{hideDivider:"always",children:n(Jd,{sections:u,hideLastDivider:!p||ts(t)||ts(e),showTopDivider:d&&ts(a),stripBlockEndPadding:p&&r})});return s?n(F,{gap:"base",children:[s,h]},l):n(i,{children:h},l)})}):n(Jd,{sections:o.flatMap(e=>e.elements),hideLastDivider:e,showTopDivider:a,stripBlockEndPadding:r})})}function Zd(e){return null!=e&&"none"!==e}function Qd({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const o=ep[e],l={none:"0px",...ai.borderWidth},s={base:ai.color.default.border,transparent:"transparent"},u="hidden"===i?"0px":l[n];return{"--vaulted-divider-width":u,"--vaulted-divider-style":np[t],"--vaulted-divider-color":s[a],"--vaulted-spacing":o,"--divider-offset":`calc((${o} + calc(${u} * 2)) / 2)`,"--vaulted-corner-radius":r?ai.borderRadius[r]:void 0}}const ep={none:"0px",...ai.spacing},np={base:"solid",dashed:"dashed",dotted:"dotted"};function tp(){const{methods:e}=In(),{userEvents:n,shop:t,source:a,checkout:i}=lt(),r="shopPay"===i.identity.current.value;h(()=>{if(r)for(const r of e.value)m(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function ap(){tp();const{shop:e,i18n:t,checkout:a}=lt(),i=mn(),r=wd(),o=!e.hasFlagEnabled(oi),l=!a.configuration.visibility.showDeliveryHeading.value&&!o;if(!i)return null;if(r.value)return n(nr,{});const s=t.translate("shipping.delivery_title");return n(Yl.Provider,{value:!0,children:n(Yo,{presentation:"base",children:n(B,{padding:o?"none":"base none",accessibilityLabel:s,className:o?"_5hYUU":void 0,children:n(F,{gap:"base",children:[l&&n(x,{color:"subdued",children:s}),n(tr,{})]})})})})}function ip(){const{source:e}=lt(),t=be(),a=Rn(),r=mn(),o=wd();return Vt(e)||!t.value.delivery?null:n(i,{children:[n(ap,{}),a.value&&r&&!o.value?n(ve,{blockSize:"base"}):null]})}function rp({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:o}=lt(),{current:l}=a.identity,s=be(),u=li(),c=vs();return t(()=>si({configuration:a.configuration,identity:a.identity,shop:r,shopPay:o,embed:i,vaultedSections:s.value,isShippingRequired:a.isShippingRequired.value,hasSellingPlan:u.value,phoneCountryCode:c.value})).value!==e?null:n(op,{vaultedContactTypeOverride:"sdkCartHints"===l.value?"base":void 0})}function op({vaultedContactTypeOverride:e}){const t=Fc();Vc(t);const r=y(!1),o=Ht(),{embed:l}=lt(),s=t.displayOptions,u="base"===s.vaultedContactType,c="rollup"===s.vaultedContactType?e??"rollup":s.vaultedContactType,d=u?s.contentLayout:void 0,p="rollup"===s.vaultedContactType&&"base"===c;if("base"!==c)return null;const h=t.logo;let m=null;return(p&&t.hasError||u)&&(m=s.children??null),n(i,{children:[n(zc,{emailAddress:t.displayContent.contact,phone:t.displayPhone,logo:h,moreOptions:t.moreOptions,emailAlignment:p&&t.isEmbeddedPartner&&!l?.interstitialPartnerProfileIconUrl?"start":void 0,layout:p?void 0:d,children:m}),t.showShopPayVerification&&n(a,{when:o,children:n(Oi,{email:t.email??"",open:r.value,showPopover:e=>{r.value=e}})})]})}function lp({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:o}=lt(),l=wd(),{rollup:{inlinePadding:s}}=ye(),u=n(i,{children:[n(rp,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(ip,{})}),n(a,{when:()=>!l.value,children:n(gd,{})})]}),c=Ut(r?.embedder);if(o.hasFlagEnabled(la)){if(!c&&!t?.value)return u;const{padding:e}=ti({padding:["none",s??"base"]});return n(B,{padding:e,children:u})}const d=c?`none ${Yt(s)??"none"}`:void 0;return c?n(B,{padding:d,children:u}):u}const sp=(e,n)=>{if(e.length!==n.length)return!1;const t=[...e];return n.every(e=>{const n=t.findIndex(n=>n.promotionId===e.promotionId&&Uu(n.destinationAmount,e.availableBalance));return-1!==n&&(t.splice(n,1),!0)})};function up(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const cp=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:i=!0})=>{const r=Gu({enabled:i}),o=Xu({enabled:i}),{recordRedemptionAutomaticallyApplied:l,recordRedemptionAutomaticallyRemoved:c}=uc(),d=g(),p=$u();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=lt().shopPay,r=function(e,n){const a=v(e),i=v(n),r=$u(),{checkout:{negotiator:o}}=lt(),{shopDiscountOffer:l,shopPromotion:s}=o.current.fields,u=o.loading;return t(()=>{const e=r.value,n=a.value.eligible,t=u.value,o=t.has("discountLines"),c=t.has("shopCashBalance"),d=i.value;if(void 0!==d){const a=e.SHOP_PROMOTION,i=a.length>0;if(up(s.value,i,o,t.has("shopPromotion")))return!0;if(d?.length){if(n?!sp(a,d):i||c)return!0}else if(i)return!0}const p=l.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(up(p,null!=h,o,t.has("shopDiscountOffer")))return!0;const m=Iu(p)?.redeemableAmount;return null==h?null!=m&&(n||c):!n||null==m||!Uu(h,m)})}(e,a);S(()=>{if(!n)return;const e=r.subscribe(i);return()=>{e(),i(!1)}},[n,r,i])}(n,i,a);const h=u(()=>{const t=p.value.SHOP_DISCOUNT_OFFER?.destinationAmount;return e?Uu(t,e.redeemableAmount)||!n.eligible&&e.redeemableAmount?void 0:{SHOP_DISCOUNT_OFFER:e.redeemableAmount?{type:"SHOP_DISCOUNT_OFFER",amount:e.redeemableAmount,promotionId:null}:null}:t?{SHOP_DISCOUNT_OFFER:null}:void 0},[e,p.value.SHOP_DISCOUNT_OFFER?.destinationAmount,n.eligible]),m=u(()=>{if(void 0===a)return;const e=p.value.SHOP_PROMOTION;return a&&0!==a.length?!sp(e,a)&&n.eligible?{SHOP_PROMOTION:a.map(e=>({type:"SHOP_PROMOTION",amount:e.availableBalance,promotionId:e.promotionId}))}:void 0:e.length>0?{SHOP_PROMOTION:null}:void 0},[a,p.value.SHOP_PROMOTION,n.eligible]),y=u(()=>{if(h||m)return{...h,...m}},[h,m]);s(()=>{i&&y?r&&d.current!==y&&o(y,{onNegotiateAccepted:()=>{d.current=y,Object.entries(y).forEach(([e,n])=>{(n?l:c)(e,"useApplyAutomaticRedemptions")})}}):d.current=void 0},[i,r,y])};function dp({active:e,ready:t}){const{i18n:a}=lt(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(B,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const pp=o({displayName:"BelowTheFoldContent",renderLoading:function(){return n(B,{"aria-busy":!0,padding:"large-200 none",children:n(F,{gap:"base",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"base"}),n(Re,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p(()=>e(()=>import("./7aefefff.BQWXUkDp.js"),__vite__mapDeps([136,1,2,3,4,5,6,7,8,9,10,11,12,13,137,138,139,140,32,42,43,44,45,46,47,48,19,49,50,51,23,24,20,52,37,28,38,39,40,41,14,15,16,17,18,21,22,25,26,27,29,30,31,33,34,35,53,54,55,56,57,58,59,60,141,142,143,83,144,102,103,104,105,106,107,108,68,69,75,76,109,145,78,146,147,148,149,150,151,152,74,77,153,154,155,156,157,158,159,85,86,111,160,110,65,66,67,70,71,72,73,79,80,81,82,84,87,88,89,90,62,91,92,93,112,113,114,115,116,99,100,101,117,118,119,120,121,97,98,96,122,123,124,125,63,126,127,128,161]))),renderError:Tn});function hp({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=lt(),{progress:r}=_e(),o=gs(),l=f(()=>{r("one-page-form-submit",void 0,{skipToCompletion:o.value})},[r,o]),s=yr(l);return n(Ln,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function mp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:o},negotiator:l}}=lt(),{checkoutProtocolModalEventSignal:u}=l.context,c=n(H,{variant:"primary",onClick:a,children:i.translate("stock.continue_cta_label")}),d=o&&n(R,{href:r.cart(),children:i.translate("stock.return_to_store_label")});return s(()=>()=>{u.value="none"},[u]),n(Dn,{heading:i.translate("stock.price_update.title"),open:!0,onShow:()=>{u.value="priceChange"},onHide:a,size:"large",children:n(F,{gap:"large-200",children:[n(Z,{children:i.translate("stock.price_update.description")}),n(B,{children:n(bs,{loading:e,lineItems:t,type:Nn.PriceChange})}),n(F,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,c]})]})})}function vp(e){return e.some(e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code)}function yp(){const{checkout:{wallets:e,negotiator:i}}=lt(),r=function(){const{checkout:{negotiator:e}}=lt(),n=Xt("merchandiseLines"),a=e.parts.merchandiseLines,i=y(m(()=>a.value));return t(()=>{const t=e.current.fields.allViolations.value,a=vp(t??[]),r=e.current.fields.merchandiseLines.value,o=n.value,l=r?.lines??[],s=i.value,u=Mn(s,l,t,Bn).map(({proposed:e,negotiated:n})=>({line:e??n,problem:{type:Nn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}}));return{hasViolation:a,loading:o,lineItems:u,updateProposal:()=>{u.length>0&&(i.value=l)}}})}(),o=xn(),l=g(!1),s=t(()=>i.current.fields.allViolations.value?.some(e=>ui.has(e.code))),u=t(()=>!s.value&&r.value.hasViolation&&r.value.lineItems.length>0),c=t(()=>{const n=r.value;return u.value?l.current=!0:l.current&&!n.loading&&0===n.lineItems.length&&(l.current=!1),!e.activeSession.value&&l.current&&n.lineItems.length>0?n:void 0});h(()=>{u.value&&o("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})});const d=f(()=>{l.current=!1,r.value.updateProposal()},[r]);return n(a,{when:c,children:e=>n(mp,{loading:e.loading,lineItems:e.lineItems,onClose:d})})}function gp(){const{i18n:e,shop:t}=lt(),a=Fn(t.storefrontUrl)?.replace(/-/g,"‑");return a?n("strong",{"data-testid":"referral-title",className:"LaXGo",children:e.translate("merchant_redirect.referral_title",{merchant_url:a})}):null}function fp(){const{checkout:e,embed:a,shopPay:r}=lt(),o=fs(),l=gs(),s=be(),u="webview-rendered"===r.config.isReferral,c=a?.isFlagshipPartner??!1,d=t(()=>s.value.contact&&e.configuration.showContactInformation||s.value.delivery||s.value.payment).value,p=o.value,h=p||l.value||u;return d&&h?n(i,{children:[p?n(Xl,{}):null,l.value?n(Zl,{isVaultedReview:!0}):null,u?n(gp,{}):null,h&&!c?n(ve,{blockSize:"base"}):null]}):null}function bp(){const{embed:e}=lt();return t=>!e?.isFlagshipPartner||Ut(e.embedder)||Wt({embedder:e.embedder})?t:n(fn,{children:t})}function _p({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:i,aboveFoldSpacing:r,paddingBlockStart:o,children:l}){const s=ar(),u=t(()=>i?.value??s.value.isRoot),c=t(()=>e.value||u.value),d=t(()=>e.value&&u.value),p=t(()=>d.value?r?"small-200":"base":"none"),h=t(()=>r?"large-200 none large-200 none":`${o?.value??"none"} none base none`);return n(a,{when:c,fallback:l,children:()=>n(he,{target:"cart.buyerIdentity",children:n(F,{gap:r?"small-200":"base",padding:h.value,children:[n(F,{gap:p.value,children:[n(a,{when:e,children:n(ir,{origin:"payment_page"})}),n(a,{when:u,children:n(rr,{})})]}),l]})})})}function Cp({extensions:e,hideDivider:t="always"}){const a=bp();return n(hn,{gap:"base",customizations:ts(e),render:(e,i)=>i?a(n(io,{hideDivider:t,children:e})):e})}function Pp(e){const{i18n:n}=lt(),t=f(e=>e.reduce((t,a,i)=>i===e.length-1?n.translate("shipping.shipping_method_combinations.combination",{rest:t,current:a}):n.translate("shipping.shipping_method_combinations.with_separator",{rest:t,current:a}),""),[n]);return u(()=>{if(!ci(e))return[];const a=Ua(e);return function(e,n){const t=(n||[]).filter(di).map(es);return ns(t).filter(e=>e.length>0).map(n=>function(e,n){return{...pi(e)??e[0],title:vi(e,n),cost:mi(e),costAfterDiscounts:hi(e)}}(n,e))}({businessDays:e=>n.translate("shipping.estimated_delivery_date",{count:e}),businessDaysRange:(e,t)=>n.translate("shipping.estimated_delivery_date_range",{minimum:e,maximum:t}),subscriptionsOnlyShippingTitle:n.translate("shipping.subscription_shipping"),combineTwoShippingTitles:(e,t)=>n.translate("shipping.shipping_method_combinations.combination",{rest:e,current:t}),combineMultipleShippingTitles:t,localDeliveryTitle:n.translate("shipping.local_delivery")},a)},[t,e,n])}function Sp(){const{shopPay:e,checkout:{negotiator:n}}=lt(),{value:t}=n.current.fields.deliveryNext,a=Xt("deliveryNext").value,i=yi(t,"ONE_TIME_PURCHASE",!0),r=u(()=>i&&"available"===i.status?i.methods:[],[i]),o=Pp(t),l=ci(t)?o:r,c=u(()=>l.reduce((e,n)=>{const t="LOCAL"===n.methodType?"SHIPPING":n.methodType;return"PICK_UP"===t||"SHIPPING"===t?{...e,[t]:[...e[t],n]}:e},{SHIPPING:[],PICK_UP:[]}),[l]),[d,p]=b(!0),h=e.session.selectedShippingAddress.value;s(()=>{p(!0)},[h]),s(()=>{a||p(!1)},[a]);const[,m]=b(),v=is(m);return{methodsByType:c,availableDeliveryMethods:l,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:v}}function Ap({onChange:e,prerequisitesLoading:n}){const{checkout:{negotiator:t}}=lt(),{value:a}=t.current.fields.deliveryNext,i=Xt("deliveryNext").value,r=yi(a,"ONE_TIME_PURCHASE",!0),o=Pp(a),[l]=Vn({type:r?.type}),c=u(()=>{if(!n&&!i&&l&&null!=r&&"available"===r.status)return ci(a)?o.find(e=>e.handle===l):r.methods.find(e=>e.handle===l)},[n,i,l,r,a,o]),d=g(c);return s(()=>{c&&d.current&&d.current.handle!==c.handle&&e(c,d.current),d.current=c},[c,e]),{selectedDeliveryMethod:c}}function kp(){const{i18n:e}=lt(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Sp(),a=n&&!t,{selectedDeliveryMethod:i}=Ap({onChange:()=>{},prerequisitesLoading:n||a}),r=i?e.translate("order_summary.updated_shipping_method",{shipping_method:i.title}):void 0,o=g(r);return s(()=>{const e=o.current;if(o.current=r,r&&r!==e)return q({content:r})},[r]),null}function Ep(){return Hn("ONE_TIME_PURCHASE")?n(kp,{}):null}function wp({includeContact:e=!0}={}){const n=be(),a=v(pe("Checkout::Dynamic::Render","INFORMATION1")),i=v(pe("Checkout::Dynamic::Render","INFORMATION2")),r=v(pe("Checkout::Dynamic::Render","DELIVERY1")),o=v(pe("Checkout::Dynamic::Render","DELIVERY2")),l=v(pe("Checkout::Dynamic::Render","PAYMENT1")),s=v(pe("Checkout::Dynamic::Render","PAYMENT2")),u=v(pe("Checkout::Dynamic::Render","PAYMENT3")),c=g();return t(()=>{const t=n.value,d=[];t.contact&&("boolean"==typeof e?e:e.value)&&d.push(...a.value,...i.value),t.delivery&&d.push(...r.value,...o.value),t.payment&&d.push(...l.value,...s.value,...u.value);const p=c.current;return p&&(m=d,(h=p).length===m.length&&h.every((e,n)=>{const t=m[n];return void 0!==t&&xt(e)===xt(t)}))?p:(c.current=d,d);var h,m})}const Op=[gr.Button,fr.Button,br.StickyFooter,_r.Wrapper];function Ip(){const{shopPay:e,checkout:t}=lt(),[a]=zn("ONE_TIME_PURCHASE");if("unauthenticated_user"!==e.user.flow.value)return null;const i=a[0],r="PICKUP_POINT"===i||"PICK_UP"===i;return!t.isShippingRequired.value||r?n($c,{}):null}const Rp="contact";function Tp({loginLink:e,title:a}){const{router:i}=lt(),r=t(()=>$s(i,Rp));return n("div",{className:"cHj7X",children:[n(E,{id:Rp,level:1,autoFocus:r.value,children:a}),e]})}function Lp(){const{client:e,i18n:t,source:i}=lt(),r=jn(),o="simulated"===i.type;return n(a,{when:r,children:n(R,{href:o?void 0:e.unstable_getSerialization("loginUrl")||"",children:t.translate("customer_account.sign_in_link_label")})})}Lp.displayName="LoginLink";const Np=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:o}=lt();return n(R,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...wt(a,i,r),action:"click_shop_pay_sign_in"}}),o.session.unstable_updateVerificationTrigger({source:_s.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Dp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:o,validation:{contactErrors:{emailInputError:l}}},shopPay:u}=lt(),c="shopPay"===o.current.value,d=r.translate("field_errors.email_invalid"),p=u.userVerification.value;s(()=>{c&&"invalid"===p.status&&(l.value=d)},[c,l,d,p.status]);const h=f(e=>{if(c)return p.email===e&&"invalid"===p.status?d:void 0},[c,d,p.email,p.status]);return n(i,{children:[n(i,a?{children:[n(Tp,{title:r.translate("contact.contact_method_title")}),n(ve,{blockSize:"base"}),n(rp,{placement:"standalone-vaulted"})]}:{children:[c&&n(i,{children:[n(Dl,{color:"branded"}),n(ve,{blockSize:"base"})]}),n(Tp,{title:r.translate("contact.contact_method_title"),loginLink:n(Mp,{})})]}),n(ve,{blockSize:"base"}),n(wi,{hideAllOptIns:c&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:h}),c&&!a&&n(Ip,{})]})}function Mp(){const{checkout:{identity:e}}=lt(),t=ll();return"shopPay"!==e.current.value?n(Lp,{}):t===_i.UnauthenticatedCheckout?n(Np,{}):null}const Bp=k(function({showForm:e=!0,identityPresentation:t="form",showEmailMarketingOptIn:a}){const r=pe("Checkout::Contact::RenderAfter"),o=pe("Checkout::Dynamic::Render","INFORMATION1"),l=pe("Checkout::Dynamic::Render","INFORMATION2");return n(i,{children:[o.length?n(i,{children:n(hn,{customizations:o,gap:"base",marginBlockEnd:"large300"})}):null,e?n(jl,{impressionType:"contact",impressionFeatures:[],children:[n(Dp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(hn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(hn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(hn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(hn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function xp(){const{checkout:{identity:e},i18n:t}=lt(),{violations:a}=G(ca),{violations:i}=G(_a),r=U(j(Ci)).value,o=U({violations:a}).value,l=U({violations:i}).value;if(o&&Fp({identity:e}))return n(or,{});if(r)return n(he,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ei,{message:t.translate("field_errors.shipping_method_invalid_phone_number")})});const s=l?t.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions"):t.translate("shipping_errors.shipping_method_not_available_generic.one");return n(he,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ae,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:V.DeliveryError,children:s})})}const Fp=({identity:e})=>"shopPay"===e.current.value,Vp=[{handle:"first"},{handle:"second"}];function Hp(){const{i18n:e}=lt(),{shippableDeliveryLines:t}=Un().value,a=t?.[0]?.methods||Vp;return n(Al,{name:"shippingMethods",variant:"block",hideRadioControl:1===a.length,children:a.map(({handle:t,description:a,estimatedTimeInTransit:i,deliveryPredictionEligible:r})=>{const o=Boolean(r),l=a;return n(Go,{value:t,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:n(Re,{inlineSize:"5ch"}),children:n(F,{gap:"small-500",children:[n(D,{inlineSize:"small"}),o||null!=i?n(D,{inlineSize:"base",size:"small",id:"pending-shipping-estimated-time"}):null,l?n(Gn,{content:a,size:"small"}):null]})},t)})})}function zp(){const e=lt();return n(El,{children:n(kl,{children:jp(e)})})}function jp({checkout:e,i18n:n}){return"shopPay"===e.identity.current.value?n.translate("shipping_errors.invalid_shipping_method_summary"):n.translate("shipping_errors.empty_state")}const Up=k(function(){const{uiStateSignal:e,initialUiStateSignal:t}=ka(en),a=Ht(),i=a.value?e.value:t.value,r=td(),o=U(An(Ya)),l=r.value&&o.value,s=U(G(Yp)).value,u=a.value&&s&&!l&&"error"!==i.status,c=u?n(Wp,{}):null,d=(()=>{switch(i.status){case"initial":case"empty":return n(zp,{});case"loading":return n(Hp,{});case"error":return n(xp,{});case"filled":{const e=Pi(i.deliveryLines).filter(Sn),t=e.flatMap(({methods:e})=>e.map(({title:e})=>e));return n(jl,{impressionType:"shipping_methods",impressionFeatures:t,children:n(Gp,{lines:e,showErrorBanner:l,deliveryChangedBannerOwnedBySection:u})})}}})();return n(F,{gap:"base",children:[c,d]})});function Gp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=xn(),o=Yn(),[,l]=b(),u=is(l),c=function({checkout:e}){return"shopPay"===e.identity.current.value?qp:i}(lt());return s(()=>{r("shippingMethodsFilled",{timestamp:new Date}),o({type:"shipping_methods_filled"})},[o,r]),n(i,{children:[n(c,{}),n(F,{gap:"large-200",children:n(rs,{lines:e,loading:u,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}Up.displayName="OnePageShippingMethods";const Yp=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function Wp(){const{i18n:e}=lt();return n(Ae,{tone:"warning",errorType:V.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function qp(){const{trackSelectShippingMethod:e}=xd(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Sp();return Ap({onChange:e,prerequisitesLoading:n||n&&!t}),null}function $p(){const{checkout:e,i18n:t}=lt(),a=e.addressManager.shipping.value,i=Sl("shipping"),{shouldGateCrossBorder:r,crossBorderGate:o}=Ul(),l=a.addresses.value.find(({id:e})=>e!==a.selectedAddress.value?.id),s=f(()=>{if(!l)return;const e=()=>i.selectAddress(l.id,{source:"select-saved-address-link"}),n=l.address.countryCode;n&&r(n)?o(e):e()},[i,l,r,o]);return l?n(Q,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:n(R,{id:"save_shipping_information",textDecoration:"none",onClick:s,children:t.translate("customer_account.saved_address_option_link")})}):null}function Kp(){tp();const e=mn(),t=e?.options.value.some(e=>"PICKUP_POINT"===e.id)??!1,i=Qi();return n(F,{gap:"large-300",children:[t&&n(qi.Prefetch,{}),n(tr,{}),n(Ni,{name:"delivery-methods",children:n(Jp,{})}),n(a,{when:i,children:n(er,{})})]})}function Jp(){const{methods:e}=In(),{i18n:i,router:r,checkout:{wallets:o,identity:l,negotiator:s}}=lt(),c=Wn(),{deliveryNext:d,optionalDuties:p}=s.current.fields,h=us(),m=Qe(),{shippingAddress:v}=s.parts;qn(v,()=>{m&&m.taxId.reset()});const y=pe("Checkout::DeliveryAddress::RenderBefore"),g=pe("purchase.checkout.delivery-address.render-after"),b=ls(),{hasMultipleDeliveryGroups:_,onlyDeliveryGroupType:C}=b.value,{customizationsBefore:P,customizationsAfter:S}=ss({hasMultipleDeliveryGroups:_,targeted:!1}).value,A=t(()=>ja(d.value,!0)||h.value.showShipmentBreakdown).value,k=A?"small-400":"base",w=xn(),O=Yn(),{negotiate:I}=_e(),R=f(({shipping:e})=>{o.activeSession.value||I({fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address",...Si],runListenersOnError:!0}),e.value=!0,w("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),O({type:"section_complete",section:"deliveryAddress"})},[o,I,w,O]),T=f(({shipping:e})=>{e.value=!1},[]),L=e=>n(Kn,{padding:A?"small-400 none":void 0,children:e}),N=u(()=>({groupType:C&&ks(C),includeDeliverySelectionGroups:!1}),[C]),D=ar(),M=t(()=>D.value.isDelivery),x=cn(),V=Qi(),H=t(()=>!!x.value&&(e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"))),z="shippingMethod",j=t(()=>$s(r,z)),U=n($n,{sectionId:"localPickup",children:n(F,{gap:"small",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})}),n(lr,{})]})}),G=n($n,{sectionId:"shipping",children:[n(Kn,{children:n(F,{gap:"base",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.ship_to_address")})}),n(a,{when:c,children:n(Z,{color:"subdued",children:i.translate("shipping.shipping_used_as_billing_notice")})}),n(a,{when:H,children:n(a,{when:V,children:n(B,{border:"base",padding:"base",borderRadius:"large",children:n(sr,{selectedDeliveryMethodType:"SHIPPING"})})})}),n(hn,{customizations:y}),n(F,{gap:"large-300",children:[n(Ps,{children:n(fo,{onValid:R,onInvalid:T,children:n(Jc,{children:[Xp({identity:l})&&n($p,{}),n(ur,{}),n(a,{when:M,children:n(rr,{})}),m&&n(cr,{taxId:m.taxId,applied:m.applied})]})})}),n(hn,{customizations:g}),n(F,{gap:k,children:[n(E,{id:z,level:2,autoFocus:j.value,children:i.translate("shipping.shipping_method_title")}),n(Jn,{children:[n(a,{when:()=>h.value.showShipmentBreakdown,children:n(Cs,{children:[n(As,{}),n(ve,{blockSize:"small-200"})]})}),Ol("shipping.shipping_method_notice",i)?n(Z,{children:i.translate("shipping.shipping_method_notice")}):null,n(hn,{customizations:P,options:N,render:L}),n(Cs,{children:[n(Up,{}),n(Ss.Preload,{})]}),n(hn,{customizations:S,options:N,render:L})]})]})]})]})}),n(a,{when:()=>p.value?.refuseDutiesPermitted,children:n(Kn,{accessibilityLabel:i.translate("shipping.duties_and_taxes_title"),children:n(F,{gap:"base",children:[n(E,{level:2,children:i.translate("shipping.duties_and_taxes_title")}),n(as,{})]})})})]}),Y=t(()=>e.value.includes("PICKUP_POINT")),W=t(()=>e.value.includes("PICK_UP"));return n(a,{when:H,fallback:n(a,{when:()=>Y.value||W.value,fallback:G,children:n(a,{when:Y,fallback:U,children:n($n,{sectionId:"pickupPoints",children:n(qi,{})})})}),children:n(F,{gap:"large-300",children:[U,G]})})}function Xp({identity:e}){return"customerAccount"===e.current.value}const Zp=k(function(){const{shop:e,i18n:i}=lt(),r=pe("Checkout::Dynamic::Render","DELIVERY1"),o=mn(),l=be(),s=e.hasFlagEnabled(oi),u=v(Boolean(!s&&o)),c=t(()=>l.value.contact&&u.value),d=t(()=>c.value?void 0:"deliveryAddress"),p=t(()=>c.value?i.translate("shipping.delivery_title"):void 0);return n(io,{accessibilityLabelledBy:d.value,accessibilityLabel:p.value,accessibilityRole:"group",children:n(F,{gap:"base",children:[n(a,{when:()=>!c.value,children:n(F,{gap:"small-400",children:n(md,{})})}),n(Ri,{}),n(Kp,{}),n(hn,{customizations:r})]})})}),Qp=o({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p(()=>e(async()=>{const{MobileOrderSummary:e}=await(import("./d2e6a587.BTa3jGZQ.js"));return{MobileOrderSummary:e}},__vite__mapDeps([159,1,3,4,5,6,2,7,8,9,10,11,12,13,85,86,151,111,106,160])).then(({MobileOrderSummary:e})=>({default:e}))),renderError:Tn}),eh="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&pp.preload();const nh=Op,th=k(function(){return(()=>{const{embed:e,checkout:{identity:n}}=lt(),t="shopPay"===n.current.value&&Ut(e?.embedder),a=Ru(),i=Nu().value;cp({enabled:t,discountOffer:t?a.value:null,shopPromotionDiscounts:void 0,eligibility:i}),dc([{eligibility:i,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:t}),cc({enabled:t,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})})(),(()=>{const{checkout:e,embed:n,source:a}=lt(),i=be(),r=t(()=>"shopPay"===e.identity.current.value&&!Ut(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&Vt(a))),o=Ru(),l=sc(),s=Nu().value;cp({enabled:r.value,discountOffer:r.value?o.value:null,shopPromotionDiscounts:r.value?l.value:null,eligibility:s}),dc([{eligibility:s,redemptionTypes:["SHOP_DISCOUNT_OFFER","SHOP_PROMOTION"]}],{enabled:r.value})})(),null});function ah({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:a,children:i}){const r=t(()=>!e.value);return a?n(uo,{target:e.value?"edgeToEdge":"vaulted",children:i}):n(co,{target:"vaulted",condition:r,children:i})}const ih=k(function({children:e}){const{checkout:i,embed:r,environment:o,i18n:l,observability:u,shop:c,shopPay:d,source:p}=lt(),h="VISIBLE"===i.configuration.headerText?.visibility,m=y(!1),g=f(()=>{m.value||(m.value=!0,void 0!==eh&&u.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-eh),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,m,u]),b=Ht(),_=c.hasFlagEnabled(la),C="google"===r?.embedder,P=be(),S=Cr(),A=t(()=>P.value.payment&&S.value),k=v(mn()),E=Xn(),w=t(()=>P.value.payment&&c.acceptTipPayments&&(E?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips),O=v(ln()[0]),{postPurchaseEnabled:I}=ys(),R=t(()=>i.negotiator.current.fields.buyerIdentity.value?.customerProfile),T=Zn(),L=t(()=>C&&T.value),N=cn(),D=t(()=>P.value.contact&&i.configuration.showContactInformation||P.value.delivery&&i.isShippingRequired.value||P.value.payment),M=t(()=>P.value.delivery&&i.isShippingRequired.value||P.value.payment),x=t(()=>N.value&&D.value),V=li(),H=vs(),z=t(()=>si({configuration:i.configuration,identity:i.identity,shop:c,shopPay:d,embed:r,vaultedSections:P.value,isShippingRequired:i.isShippingRequired.value,hasSellingPlan:V.value,phoneCountryCode:H.value})),j=t(()=>"standalone-form"===z.value),U=t(()=>"standalone-vaulted"===z.value),G=t(()=>"vaulted-adjacent"===z.value),Y=t(()=>j.value||U.value);!function(){const{negotiate:e}=_e(),{observability:n,checkout:t}=lt();s(()=>{const a=t.negotiator.current.fields.buyerIdentity.value,i=t.negotiator.parts.shippingAddress.value,r=t.negotiator.parts.billingAddress.value,o=t.negotiator.current.fields.allViolations.value??[];if(gi(o)||vp(o))return;const l=t.isShippingRequired.value?i.countryCode:r.countryCode,s=a?.countryCode;s&&l!==s&&(n.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:l,buyerIdentityCountryCode:s,buyerIdentity:JSON.stringify(a,(e,n)=>void 0===n?null:n)}),e({silenceViolations:["all"]}))},[])}();const W=v(Qn({base:!0,medium:!1})),q=t(()=>!b.value||(W.value??!1)),$=dr(),K=t(()=>"hidden"!==$.value),J=v(pe("Checkout::Contact::RenderAfter")),X=function(){const{checkout:e,shop:n,source:a}=lt(),{email:i}=e.negotiator.parts,r=be(),{buyerIdentity:o}=e.negotiator.current.fields,l=n.hasFlagEnabled(fi);return t(()=>{if("businessCustomer"===e.identity.current.value)return!1;const t=o.value;if(t?.customerProfile?.acceptsEmailMarketing)return!1;const s=e.configuration.visibility.showEmailMarketing&&"OFF"!==n.emailMarketing&&r.value.contact;if("sdkCartHints"===e.identity.current.value)return Boolean(s&&i.value);const u=l&&!bi(t?.countryCode);return Boolean(s&&"shopPayExternal"!==a.type&&!u&&!Vt(a))})}(),{main:{section:Z}}=fe(),{lineItems:{priority:Q="base"}}=ye(),ee=v(Ai(Z)),ne=Rn(),te=t(()=>"shopPay"===i.identity.current.value||P.value.payment||!ee.value?"belowPayment":"abovePayment"),ae=t(()=>!Y.value&&X.value&&"belowPayment"===te.value),ie=t(()=>!Y.value&&X.value&&"abovePayment"===te.value),re=t(()=>ne.value&&P.value.payment&&ae.value&&q.value),oe=t(()=>i.configuration.visibility.showEmailMarketing&&!Vt(p)&&ie.value&&!R.value?.acceptsEmailMarketing),le=ar(),se=t(()=>le.value.isRoot?"belowPayment"!==te.value||q.value&&ee.value?"abovePayment":"belowPayment":"none"),ue=t(()=>"guest"===i.identity.current.value&&P.value.delivery||"businessCustomer"===i.identity.current.value&&!P.value.delivery&&P.value.payment),ce=t(()=>"guest"===i.identity.current.value?ue.value&&!(P.value.contact&&P.value.payment):ue.value),de=t(()=>!ce.value&&i.isShippingRequired.value),me=t(()=>G.value||U.value),ve=wd(),ge=t(()=>Boolean(!Vt(p)&&P.value.delivery&&null!=k.value&&!ve.value)),Ce=t(()=>P.value.delivery&&O.value.includes("PICK_UP")&&!ve.value),Pe=t(()=>Boolean(me.value||Ce.value||(de.value||ce.value)&&ge.value)),Se=t(()=>Boolean(de.value&&ge.value&&!me.value)),Ae=Ut(r?.embedder),ke="beforeDetails"===i.configuration.orderSummary?.placement,Ee=t(()=>Ae&&!ke&&!Se.value),we=t(()=>Ae&&Pe.value),Oe=t(()=>Ae?ke:ee.value),Ie=t(()=>"guest"===i.identity.current.value&&P.value.delivery&&!P.value.contact),Re=t(()=>!Y.value&&ee.value&&(oe.value||"abovePayment"===se.value)),Te=t(()=>b.value&&P.value.contact&&!Y.value&&J.value.length>0),Le=t(()=>!Y.value),Ne=wp({includeContact:Le}),De=t(()=>b.value&&!T.value&&Ne.value.length>0),Me=Ll(),Be=t(()=>b.value&&Me.value&&ke),xe=t(()=>Me.value&&!ke),Fe=Boolean(r?.isFlagshipPartner)&&"high"===Q;et();const Ve=t(()=>!Y.value&&(oe.value||re.value)),He=t(()=>"abovePayment"===se.value),ze=t(()=>Y.value?P.value.delivery&&i.isShippingRequired.value?l.translate("shipping.delivery_title"):l.translate("payment.title"):l.translate("contact.contact_method_title")),je=t(()=>!ee.value&&!x.value&&(!U.value||M.value)),Ue=t(()=>!(x.value&&P.value.contact)&&(!U.value||M.value)&&(ne.value||ee.value&&!P.value.contact)),Ge=t(()=>P.value.payment&&!re.value&&!xe.value),Ye=t(()=>D.value&&!Ie.value),We=t(()=>_&&Ye.value),qe=t(()=>!_&&Ye.value),$e=t(()=>We.value&&je.value),Ke=t(()=>!Ae&&We.value&&je.value&&!ue.value&&P.value.payment&&(!i.isShippingRequired.value||P.value.delivery)),Je=t(()=>!Ae&&x.value&&We.value),Xe=t(()=>Ae?ke:ne.value||$e.value),Ze=t(()=>Ke.value&&!q.value&&(ae.value||"belowPayment"===se.value)&&!A.value&&!Te.value&&!De.value&&!L.value),Qe=t(()=>Ze.value||A.value||Re.value||re.value||ne.value&&!ee.value&&q.value||Ge.value&&(q.value||ke)),en=t(()=>A.value||Ge.value||!P.value.payment&&P.value.delivery&&!q.value&&!Te.value||P.value.payment&&re.value);return n(Ns,{children:[n(th,{}),n(F,{blockSize:L.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:Ee,children:n(nt,{accessibilityRole:"presentation"})}),Vt(p)?n(F,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(tt,{})}):null,n(at,{section:"toast"}),!Fe&&n(at,{section:"top"}),n(dp,{active:b,ready:m}),n(hp,{fillAvailableBlockSize:L.value,ready:m,children:[h&&n(B,{padding:"none none large-100 none",children:n(Es,{})}),"high"===Q&&n(B,{display:"@media (inline-size >= medium) none, auto",children:n(uo,{target:"lineItems",children:n(io,{hideDivider:K,children:n(it,{})})})}),Fe&&n(at,{section:"top"}),n(a,{when:K,children:n(uo,{target:"expressCheckout",children:n(pr,{})})}),n(a,{when:Be,children:[n(rt,{section:"summary",children:n(ot,{section:"summary",children:n(B,{padding:"none large-200 large-100 large-200",children:n(uo,{target:"plain",children:n(Qp,{})})})})}),n(nt,{accessibilityRole:"presentation"})]}),n(fp,{}),n(Ds,{}),n(a,{when:Y,children:()=>n(io,{accessibilityLabel:l.translate("contact.contact_method_title"),children:n(rt,{section:"contact",children:n(ot,{section:"contact",children:n(Bp,{showForm:i.configuration.showContactInformation,identityPresentation:U.value?"vaulted":"form",showEmailMarketingOptIn:U.value?X.value:void 0})})})})}),n(co,{target:"vaulted",condition:We,children:n(ro,{hideDivider:en,condition:je,accessibilityLabel:ze.value,children:n(co,{target:"vaulted",condition:qe,children:[n(lp,{showDelivery:de,insideVaultedCard:$e}),n(ro,{condition:Ue,hideDivider:Qe,accessibilityLabel:ze.value,children:n(F,{children:[n(a,{when:()=>!P.value.contact&&!j.value,children:n(rt,{section:"contact",children:n(ot,{section:"contact",children:n(Bp,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!ue.value,children:n(Kd,{hideLastDivider:Xe,splitGroupsOnCards:Je,showTopDivider:we,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})}),n(a,{when:x,children:n(oo,{})})]})})}),n(a,{when:A,children:n(B,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:n(Pr,{})})}),n(a,{when:()=>(!Y.value||He.value)&&(ee.value||re.value),children:n(ot,{section:"contact",children:n(_p,{aboveFoldSpacing:!0,showEmailMarketingOptIn:Ve,showPhoneMarketingOptIn:He})})}),n(a,{when:Te,children:n(ot,{section:"contact",children:n(Cp,{extensions:J,hideDivider:"whenEmpty"})})}),n(a,{when:ce,children:n(a,{when:i.isShippingRequired,children:n(ah,{isGuestPartialVaultedDelivery:Ie,isSectionStyleUnificationEnabled:_,children:[n(ip,{}),n(lo,{condition:ue,accessibilityLabel:l.translate("shipping.delivery_title"),children:n(Kd,{hideLastDivider:Oe,showTopDivider:we,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:De,children:n(Cp,{extensions:Ne,hideDivider:"whenEmpty"})}),n(a,{when:()=>!P.value.delivery&&i.isShippingRequired.value,children:n(he,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(rt,{section:"delivery",children:n(ot,{section:"delivery",children:n($n,{sectionId:"delivery",children:n(Zp,{})})})})})}),n(a,{when:w,children:n(to.Prefetch,{})}),n(a,{when:L,children:n(B,{className:"xoG3V","data-testid":"onepage-vaulted-spacing"})}),n(a,{when:b,children:n(pp,{onReady:g,includeContactInVaultedExtensions:Le,showMobileOrderSummary:xe,showVaultedStateMarketingDisclosureBelowPayment:ae,phoneMarketingPlacement:se,isSectionCustomized:ee,showVaultedStateMarketingDisclosureOnMobile:re,expressCheckoutSlot:$,showVaultedCardConsentSpacing:Ze})})]}),I&&n(ao,{})]}),n(yp,{}),n(a,{when:i.isShippingRequired,children:n(Ep,{})}),n(hr,{id:"OnePage"}),e]})}),rh=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Qp,default:ih,onePageCriticalStyleClassNames:nh},Symbol.toStringTag,{value:"Module"}));export{Qs as L,eu as M,Jc as O,_p as P,tu as R,Vd as S,Vu as U,Cp as V,Uc as a,Gc as b,Up as c,Nd as d,Ld as e,Du as f,Dd as g,qs as h,ad as i,$s as j,wp as k,yc as l,rh as m,bp as u};