PageSourceSearch

https://seven48.com/cdn/shopifycloud/checkout-web/assets/c1/f8706cb6.PbccX-7u.js

js seven48.com collected 2026-10-09 21:45:35 UTC 175,602 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.BuHP17nD.js","2c1ab0fe.qpvfywqb.js","164ad2e3.DcJn775M.js","4b4bc88f.DkycdxSK.js","app.DH8n-1bp.js","assets/app.CcGlIMpn.css","assets/wallet-prefilled-guest-return.BJvF0-q4.css","d0bb51ec.CWfbNPnY.js","f67abd2c.CNaB0QaR.js","e12db40c.DhbHW8sF.js","9dba8418.4R19B40l.js","60a453ce.DBFo6PRx.js","assets/hydrate.DDB053YN.css","6bfea526.WQUqRMom.js","ac5a19ff.C1i8fdUP.js","598fef4e.C71uub5O.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.Bl46DOUC.js","22345fd4.Bc95vVsB.js","4b1c22b7.zkM5jsqa.js","assets/PaymentLine.DT05kVlY.css","a422df8c.CDURsRjM.js","efa0389a.BiVLFqoF.js","assets/Choice.CrYuHUmO.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.RYXq9KZi.js","08a3b809.BKNVX2Vm.js","d25d1b95.CoPrVoCi.js","bf513f9c.DfVLzm1y.js","e39bc11c.CaER5qTM.js","7a8217fd.BSo0j5mC.js","8599b02a.D6crYzGJ.js","assets/useShopPayProgressIntercepts.CIy8uDiZ.css","cf29e63b.B0brOI65.js","assets/Tipping.BcTJoNaV.css","dfc03c53.J0k3tRlF.js","86720dbb.CVGIgA6H.js","dfca5da5.cHkNyCYM.js","dae24aab.LuzlJRmB.js","assets/Section.CU18S7Ap.css","55098bf1.CjSE9kMx.js","0e67bd3b.BulkkgyN.js","74835653.Cr7sKbVy.js","3ca8ef7e.DgXbCH_R.js","2495faa4.DgGNI16D.js","a9fa9fda.BO9gwssW.js","ca3e798e.XLlup-KR.js","47b970b2.Bc5Vmfq5.js","assets/PhoneField.uZEuHncj.css","064f6ac1.BoVb1opw.js","assets/Popover.Bi1nHaU-.css","assets/BillingAddressForm.BdwN7V1K.css","f692f62f.0aS5Pgyt.js","9babe369.DN4Uiit5.js","b684bff6.Do6MtAvQ.js","assets/RedirectionNotice.DgiInWJ-.css","79974aab.Cl0DLekt.js","58314944.CL_6FNuP.js","434e3b0a.oup8Ur0H.js","assets/PaymentMethodProgressionHost.C0BOgdmL.css","50130ded.CjqsTI7m.js","65f3d4da.Bb3QiqCm.js","31cc568e.95lmLO5k.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.BM-faetc.js","b9c0319a.8x5xdIiw.js","dffdfb34.DKxh4eql.js","1f5e7811.DBGnR3_R.js","assets/ShopPayLogo.87JMHPUK.css","1d34c07e.h4dJAaCz.js","assets/ExpressCheckoutButton.BnDF3H7t.css","2fdb3dd3.BI5ol3i8.js","17425706.DtdfKQJ3.js","cb5cf153.CNHN3NCG.js","e3e348f2.qdNJPs68.js","71ae3d5c.ChDO3fdz.js","cb38e5c2.k1ouuKLe.js","78ab3dd0.DsAxQUAi.js","89e2d30a.C7YQuTRu.js","ed9f2238.Brwxl8Yi.js","6fb6f9d8.BoDxvz0l.js","1444e6bd.DTqbRn9m.js","0b8657b8.CeR0nGry.js","f49d4216.Che8BnjU.js","d22d2b80.BRIhtVxA.js","f58f39d8.z0CUAjnp.js","e03065ab.V1fBuv4e.js","7b0c98ea.B8saOsP6.js","assets/TransitionHeight.CuRoM9zv.css","assets/VatNumberValidationField.d9bKhKtH.css","f1968089.BiyF2g2x.js","17e57de1.lSRGFmhc.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.DavrkhJI.js","21cc90a2.DHzOO82q.js","64de7b49.BnCPa5-S.js","347b440c.xpK15B3S.js","9ce08e25.dSvNrRyM.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.Cnsf3p8Q.js","39921a74.C0GzP1-7.js","assets/Switch.BS8yVgoP.css","ccdf3592.DmQuNZVR.js","71b60e0a.DfPLdYsH.js","24773686.NjNSWG1C.js","ec391382.CmRYZq9D.js","assets/StickyPayButton.Cv62Qqkq.css","a25deb9a.B5l1rGH9.js","01973ac7.CzRJWXtH.js","945a08d6.DPoKhjkl.js","7bc8057b.Cjs5rQ1q.js","assets/constants.xO_7ctnq.css","2b89a178.DlMzn79y.js","910cd6e2.D9laAOO_.js","181d38d3.C21ZO0gV.js","792bb671.B3OvVnSg.js","assets/Middot.D7Ujmshx.css","d6447d9e.yVMcZZjx.js","f51e663e.D3CveQI2.js","8e79be58.4pj59tZ-.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.Ac9ME8KB.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","ca5e9c49.BzUOvyL4.js","f3e117aa.CgyApM5y.js","68887467.BuHGd1PE.js","ca8e826d.HfkPR0Gb.js","assets/Avatar.gBkEAe_p.css","17a5f1e4.Bq-QRkFq.js","0e4087ec.XClKfnuM.js","7aefefff.CKGwXfaV.js","b3389d5c.AQoeX8aG.js","73a9b0a0.B8dxuTLG.js","25604ae0.56pfEpxV.js","dada7e07.DLvpJNXh.js","81e109b1.DOkM2TK2.js","e0989459.E2HGFiMB.js","cdfd59e6.C61oFvbb.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.CvREKW2p.js","e129c76e.83DznIAr.js","d4ea2faa.Bh5JwQU0.js","fe885b80.BxcRVx2R.js","f78726c8.CFtLd10H.js","assets/hooks.CKE1iCma.css","e477f96c.Bg2MTFPd.js","1ed8f5e3.DIMgWfc5.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.DRXbjRuN.js","0c0ad074.BuZ9_cdp.js","assets/useShopPayButtonClassName.BrcQzLuH.css","87bfafec.CxwEzGHg.js","051149c8.lHD9iIAq.js","assets/PayButtonSection.CZuxzxFG.css","d2e6a587.D5dE5VhU.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CyS-bj2t.css"])))=>i.map(i=>d[i]);
2import{_ as e}from"./app.DH8n-1bp.js";import{u as n,k as t,z as a,S as i,X as r,i as o,B as l,h as s,T as u,y as c,v as d,j as p,p as h,M as m,s as v,o as y,g,q as f,C as b,n as _,ah as C,m as P,_ as S,I as A,N as k}from"./2c1ab0fe.qpvfywqb.js";import{H as E,bE as w,aS as O,fy as I,L as R,hQ as T,cg as N,dj as L,G as D,al as M,b as B,j as x,S as F,aa as V,B as H,ed as z,ce as j,o as U,c5 as G,c6 as Y,cd as W,eN as q,A as $,de as K,a1 as X,hw as J,gM as Z,f as Q,ab as ee,c as ne,bt as te,hR as ae,cc as ie,fK as re,ca as oe,c9 as le,dK as se,eU as ue,bs as ce,d5 as de,e_ as pe,d as he,J as me,bM as ve,l as ye,dR as ge,v as fe,hS as be,a_ as _e,cJ as Ce,a9 as Pe,eS as Se,a$ as Ae,Z as ke,hT as Ee,eX as we,az as Oe,hu as Ie,c7 as Re,cS as Te,hU as Ne,hV as Le,hW as De,hX as Me,fd as Be,em as xe,cP as Fe,h4 as Ve,hY as He,hZ as ze,bT as je,h_ as Ue,bW as Ge,cD as Ye,eY as We,ek as qe,bF as $e,h$ as Ke,i0 as Xe,d6 as Je,dm as Ze,dq as Qe,i1 as en,dh as nn,dk as tn,bU as an,i2 as rn,i3 as on,dn as ln,dp as 
2sn,cF as un,hc as cn,hd as dn,U as pn,f0 as hn,eV as mn,bX as vn,fa as yn,bi as gn,aH as fn,aX as bn,i4 as _n,bS as Cn,i5 as Pn,i6 as Sn,cr as An,ex as kn,eZ as En,f9 as wn,f1 as On,i7 as In,ai as Rn,ax as Tn,M as Nn,cu as Ln,i8 as Dn,m as Mn,i9 as Bn,t as xn,ia as Fn,cE as Vn,f5 as Hn,bZ as zn,cn as jn,c1 as Un,ds as Gn,f2 as Yn,dt as Wn,i as qn,ao as $n,V as Kn,ff as Xn,p as Jn,ib as Zn,aj as Qn,eT as et,hk as nt,aw as tt,af as at,ag as it}from"./164ad2e3.DcJn775M.js";import{e as rt,cF as ot,aa as lt,W as st,jN as ut,jO as ct,bR as dt,bH as pt,bN as ht,jP as mt,gH as vt,hW as yt,aT as gt,hU as ft,hS as bt,aP as _t,hV as Ct,jB as Pt,bD as St,aO as At,bG as kt,jQ as Et,p as wt,jR as Ot,gj as It,bS as Rt,be as Tt,bp as Nt,hz as Lt,L as Dt,o as Mt,jS as Bt,J as xt,al as Ft,dn as Vt,A as Ht,I as zt,f4 as jt,aj as Ut,gq as Gt,jT as Yt,n as Wt,fD as qt,a2 as $t,jU as Kt,K as Xt,bf as Jt,jV as Zt,jW as Qt,X as ea,cf as na,eC as ta,H as aa,jX as ia,eV as ra,ep as oa,ac as la,ec as sa,bj as ua,iZ as ca,an as da,gD as pa,bc as ha,cb as ma,e8 as va,jY as ya,C as ga,j1 as fa,jZ as ba,j_ as _a,j$ as Ca,j3 as Pa,gr as Sa,u as Aa,gF as ka,V as Ea,k0 as wa,f8 as Oa,f5 as Ia,db as Ra,cG as Ta,cI as Na,cJ as La,cH as Da,hl as Ma,k as Ba,eT as xa,d6 as Fa,fH as Va,j2 as Ha,br as za,aA as ja,k1 as Ua,di as Ga,az as Ya,dg as Wa,d5 as qa,j5 as $a,k2 as Ka,k3 as Xa,k4 as Ja,k5 as Za,k6 as Qa,k7 as ei,jc as ni,d9 as ti,k8 as ai,j7 as ii,ab as ri,k9 as oi,T as li,ka as si,aw as ui,kb as ci,kc as di,kd as pi,ke as hi,v as mi,h as vi,iT as yi,iU as gi,kf as fi,kg as bi,av as _i,bl as Ci,iX as Pi}from"./4b4bc88f.DkycdxSK.js";import{t as Si,v as Ai,C as ki,w as Ei,f as wi,U as Oi,u as Ii,I as Ri,i as Ti,x as Ni,y as Li,z as Di,B as Mi,F as Bi,G as xi,H as Fi,J as Vi,K as Hi,S as zi,M as ji,N as Ui,O as Gi,Q as Yi,h as Wi,R as qi,T as $i,W as Ki,X as Xi,Y as Ji,g as Zi,j as Qi,Z as er,D as nr,c as tr,_ as ar,d as ir,$ as rr,k as or,l as lr,e as sr,V as ur,n as cr,E as dr,m as pr}from"./dffdfb34.DKxh4eql.js";import{k as hr,D as mr,u as vr,s as yr,b as gr,c as fr,l as br,a as _r,H as Cr}from"./0e9ee714.Cnsf3p8Q.js";import{X as Pr,U as Sr,N as Ar,W as kr,b as Er,Y as wr,Z as Or,c as Ir,d as Rr,G as Tr,S as Nr,e as Lr,_ as Dr,$ as Mr,a0 as Br,a1 as xr,a2 as Fr,f as Vr,n as Hr,v as zr,x as jr,p as Ur,q as Gr,r as Yr,z as Wr,s as qr,A as $r,V as Kr,a3 as Xr,a4 as Jr,h as Zr,u as Qr,t as eo,T as no,i as to}from"./6bfea526.WQUqRMom.js";import{a as ao,c as io,S as ro,M as oo}from"./dfca5da5.cHkNyCYM.js";import{T as lo,S as so,M as uo}from"./79974aab.Cl0DLekt.js";import{R as co,P as po,C as ho}from"./e77f7fe0.Bl46DOUC.js";import{A as mo,C as vo,u as yo,S as go}from"./0e67bd3b.BulkkgyN.js";import{b as fo,a as bo,f as _o,u as Co}from"./a25deb9a.B5l1rGH9.js";import{E as Po,u as So,b as Ao,a as ko,c as Eo}from"./01973ac7.CzRJWXtH.js";import{u as wo}from"./945a08d6.DPoKhjkl.js";import{c as Oo,a as Io}from"./58314944.CL_6FNuP.js";import{a as Ro,c as To,S as No,u as Lo,b as Do}from"./bf513f9c.DfVLzm1y.js";import{P as Mo}from"./598fef4e.C71uub5O.js";import{O as Bo,W as xo,c as Fo,b as Vo}from"./7a8217fd.BSo0j5mC.js";import{a as Ho,b as zo,C as jo}from"./efa0389a.BiVLFqoF.js";import{U as Uo,I as Go}from"./7bc8057b.Cjs5rQ1q.js";import{B as Yo,A as Wo}from"./74835653.Cr7sKbVy.js";import{g as qo,d as $o,c as Ko,e as Xo}from"./d25d1b95.CoPrVoCi.js";import{S as Jo,E as Zo,f as Qo,r as el,e as nl,h as tl,i as al,j as il,b as rl,c as ol,I as ll,g as sl}from"./f1968089.BiyF2g2x.js";import{b as ul,a as cl,t as dl,d as pl,u as hl,c as ml}from"./2b89a178.DlMzn79y.js";import{a as vl,v as yl,b as gl,u as fl}from"./1f5e7811.DBGnR3_R.js";import{a as bl}from"./f67abd2c.CNaB0QaR.js";import{S as _l}from"./39921a74.C0GzP1-7.js";import{u as Cl,a as Pl,M as Sl,b as Al}from"./b684bff6.Do6MtAvQ.js";import{C as kl,b as El,E as wl}from"./a422df8c.CDURsRjM.js";import{u as Ol,h as Il}from"./17425706.DtdfKQJ3.js";import{C as Rl}from"./cf29e63b.B0brOI65.js";import{u as Tl,d as Nl,c as Ll}from"./24773686.NjNSWG1C.js";import{S as Dl}from"./6fb6f9d8.BoDxvz0l.js";import{S as Ml}from"./cb5cf153.CNHN3NCG.js";import{S as Bl}from"./cb38e5c2.k1ouuKLe.js";import{u as xl,a as Fl}from"./22345fd4.Bc95vVsB.js";import{v as Vl}from"./9dba8418.4R19B40l.js";import{P as Hl}from"./47b970b2.Bc5Vmfq5.js";import{I as zl}from"./55098bf1.CjSE9kMx.js";import{a as jl}from"./ed9f2238.Brwxl8Yi.js";import{A as Ul,C as Gl}from"./4b1c22b7.zkM5jsqa.js";import{V as Yl,M as Wl,u as ql,a as $l,S as Kl,R as Xl,b as Jl}from"./910cd6e2.D9laAOO_.js";import{b as Zl,a as Ql,g as es}from"./e12db40c.DhbHW8sF.js";import{r as ns}from"./dae24aab.LuzlJRmB.js";import{D as ts,u as as,S as is}from"./d6447d9e.yVMcZZjx.js";import{g as rs}from"./65f3d4da.Bb3QiqCm.js";import{M as os,c as ls,u as ss,b as us}from"./64de7b49.BnCPa5-S.js";import{u as cs,S as ds,a as ps,E as hs}from"./347b440c.xpK15B3S.js";import{b as ms}from"./2fdb3dd3.BI5ol3i8.js";import{u as vs}from"./ca5e9c49.BzUOvyL4.js";import{f as ys,i as gs}from"./e3e348f2.qdNJPs68.js";import{S as fs}
2from"./f3e117aa.CgyApM5y.js";import{S as bs}from"./1d34c07e.h4dJAaCz.js";import{T as _s}from"./7b0c98ea.B8saOsP6.js";import{F as Cs}from"./3ca8ef7e.DgXbCH_R.js";import{D as Ps}from"./f49d4216.Che8BnjU.js";import{S as Ss}from"./f51e663e.D3CveQI2.js";import{m as As}from"./21cc90a2.DHzOO82q.js";function ks(){const{i18n:e}=rt();return n(E,{level:1,children:e.translate("embed.header.review_order")})}function Es(){const{hasError:e}=w(ot),i=fo().value,{i18n:r,observability:o}=rt(),l=r.translate("review.blocks.change_link_label"),{inMemoryAmazonPayParts:{hasPaymentSheetError:s,sdkStatus:u}}=lt(),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:()=>{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 ws(){const e=rt(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(Si,{wallet:st.BuyWithPrime,isSdkOnly:!0}),changeLink:n(Es,{})}:{rollupId:"amazonPayDetails",sdkButton:n(mo,{isSdkOnly:!0}),changeLink:n(Pr,{})}}(e);return n(i,{children:[a.sdkButton,n(co,{id:a.rollupId,label:t.translate("payment.title"),primaryContent:n(Os,{}),primaryAction:a.changeLink})]})}function Os(){const{brand:e,descriptor:t}=Sr().value,a=N(),i=ut(),r=L();return a.value?i.value?n(Ar,{vaulted:!0,reason:"giftCard"}):t&&r.value?n(kr,{brand:e,descriptor:t}):n(D,{}):n(Ar,{vaulted:!0,reason:"freeOrder"})}function Is({label:e}){const{i18n:t}=rt();return M(),n(i,{children:[n(B,{accessibilityRole:"status",children:n(x,{accessibilityVisibility:"exclusive",children:t.translate("vaulted.loading_section",{section:e(t)})})}
2),n(F,{gap:"small-300",children:[n(D,{inlineSize:"large"}),n(D,{inlineSize:"large"}),n(D,{inlineSize:"small"})]})]})}class Rs{#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 Ts=r(null);function Ns({children:e}){const t=u(()=>new Rs,[]);return n(Ts.Provider,{value:t,children:e})}function Ls(){const{i18n:e}=rt(),t=l(Ts);return t?n(a,{when:()=>t.hasFailures.value,children:n(B,{paddingBlockEnd:"base",children:n(Po,{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 Ds({children:e}){const t=l(Ts),a=t?.hasFailures.value??!1;return n(B,{inert:a,opacity:a?50:void 0,children:e})}const Ms=()=>e(()=>import("./26e63865.BuHP17nD.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]));function Bs(){return p(Ms)}function xs(e,t,a){return function({displayName:e,load:t,loadingLabel:a}){return o({displayName:e,load:t,suspense:!1,renderLoading:()=>n(Is,{label:a}),useError:function(n){const{observability:t}=rt(),a=l(Ts);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 Bs()).vaultedRollupContents)})}const Fs=xs("DefaultVaultedPaymentRollupContent",e=>e.translate("payment.title"),e=>e.DefaultVaultedPaymentRollupContent),Vs=xs("VaultedShippingMethodsRollupContent",e=>e.translate("shipping.title"),e=>e.VaultedShippingMethodsRollupContent),Hs=xs("VaultedBillingAddressRollupContent",e=>e.translate("billing.billing_address_title"),e=>e.VaultedBillingAddressRollupContent),zs=xs("DefaultVaultedDeliveryAddressRollupContent",e=>e.translate("shipping.shipping_address_title"),e=>e.DefaultVaultedDeliveryAddressRollupContent),js=xs("VaultedLocalPickupOptionsRollupContent",e=>e.translate("local_pickup.title"),e=>e.VaultedLocalPickupOptionsRollupContent),Us=xs("VaultedPaymentOptionsRollupContent",e=>e.translate("payment.payment_option.title"),e=>e.VaultedPaymentOptionsRollupContent);function Gs(e,n){const t=new Set(n.map(e=>e.id));return e.some(e=>t.has(e.id))}function Ys(e,n){const t=z();return h(()=>{n&&Gs(t.blockingExtensions.value,e)&&m(()=>n())}),Gs(t.blockingExtensions.value,e)}function Ws(){const{checkout:{negotiator:e}}=rt(),{generalPaymentError:n,generalPaymentErrorCode:a}=e.parts,{violations:i}=j(ct);return t(()=>!!n.value&&(!dt(a.value)||i.value.size>0))}function qs({showTips:e,billingFormPosition:n}){const t=U("Checkout::Dynamic::Render","PAYMENT1"),a=U("Checkout::Dynamic::Render","PAYMENT2"),i=U("Checkout::Dynamic::Render","PAYMENT3"),r="inContext"===n||"hidden"===n||"afterPayment"===n&&e?[[],t,a]:[a,t];return(e||"afterPayment"===n)&&r.push(i),r}function $s(e,n){return e.currentUrl.value.hash===`#${n}`}function Ks(e,n=!1){const{router:a}=rt(),i=v(e),r=t(()=>$s(a,i.value)),o=y(n);return s(()=>{r.peek()&&(o.value=!0)},[r,o]),o}function Xs({autoOpen:e=!0,isMissing:n,open:t}){s(()=>{e&&n&&(t.value=!0)},[e,n,t]);const{shopPay:{progressInterceptor:a}}=rt();s(()=>{if(n)return a.listenResult(e=>{e||(t.value=!0)})},[a,n,t])}function Js(){const{loading:e}=q(),{checkout:n}=rt(),t=n.isShippingRequired.value,a=n.negotiator.parts.shippingAddress.value,{shippingAddress:i,deliveryNext:r}=n.negotiator.current.fields,o=i.value,l=vt(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}=rt(),n=e.hasFlagEnabled(ft),a=Er(),i=bt(),r=_t(),o=Ct(),{loading:l}=q(),s=v(l),u=wr(a),c=Js(),d=t(()=>{const e=a.value;if(o.value&&e&&!(e.balance.amount<=0))return u.value?Or({firstOrderTotal:i.value,storeCreditAccount:e}):0===r.value?.amount&&i.value?.currencyCode===e.balance.currencyCode?e.balance:void 0}),p=Ir(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}}=rt(),{paymentLines:a}=t.parts,{violations:i}=j(ct),{message:r,tone:o}=So(),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}
2`:void 0;return s(()=>{if(m)return $({content:m})},[m]),u&&d?n(Po,{errorType:V.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:p,autoFocus:!h,children:u}):null}function eu({openRedeemablesModal:e,includeStoreCredit:t=!0}){const{i18n:a}=rt(),i=Rr(),{paymentLines:r}=K(),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},Pt(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(X,{type:"edit"}),n(x,{children:u})]})})})]})}function nu({paymentLine:e}){const{i18n:t}=rt();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(ee,{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(Mo,{type:"store-credit"}),n(x,{children:t.translate("payment.store_credit.label")})]}),n(Q,{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(ee,{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(Mo,{type:"gift-card"}),n(x,{children:t.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(i)})})]}),n(Q,{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:t,includeStoreCredit:a=!0}){const{i18n:r,checkout:o}=rt(),l=Er(),u=Ir(l),{canApplyGiftCards:c,paymentLines:d}=K(),p=St(),h=a&&o.configuration.visibility.showStoreCreditRedemption.value&&u.value,m=c||d.length>0,v=g(m);s(()=>{const n=v.current&&!m;v.current=m,e&&n&&!h&&t()},[h,m,t,e]);let y="";h&&m?y=r.translate("payment.gift_card_store_credit.manage_label"):m?y=r.translate("payment.gift_card_wrapper.manage_label"):h&&(y=r.translate("payment.store_credit.manage_label"));const f=()=>{(p.value||!c&&h)&&t()},b=a?n(i,{children:[n(Nr,{}),n(Lr,{afterAppliedRedeemablesChange:f})]}):null;return n(Bo,{heading:y,open:e,onHide:t,children:n(F,{gap:"base",children:[o.configuration.visibility.showStoreCreditRedemption.value?b:null,n(Tr,{afterAppliedRedeemablesChange:f,autoSelect:!0,showHeading:!1})]})})}function au(){const e=Er(),n=Ir(e),a=wr(e),i=Js(),r=_t();return t(()=>{const e=0===r.value?.amount&&!a.value;return n.value&&i.value&&!e})}function iu(){const{paymentLines:e}=K(),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}=rt(),{paymentLines:d,remove:p}=K(),{useStoreCreditForSubscriptionRenewals:m}=c.negotiator.parts,v=_t(),g=yt(),b=gt(),_=Er(),C=wr(_),P=y(Dr.Init),S=t(()=>P.value===Dr.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=Mr(_.value,P),T=Br(_.value,P),N=y(L());function L({storeCreditSelected:e=C.value,subscriptionRenewalsSelected:n=m.value}={}){const t=d.map(({method:e})=>Pt(e));return e&&t.unshift(xr),n&&t.splice(e?1:0,0,Fr),t}s(()=>{N.value=L()},[d]),h(()=>{const e=C.value,n=m.value;N.value=L({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:{...At(u,c,l),action:`${a}manage_redeemables_${t}_${e}`}})},[c,o,i,l,u]),M=f(async n=>{const t=N.value,a=t.length>n.length,{shorter:i,longer:r}=a?{shorter:n,longer:t}:{shorter:t,longer:n};N.value=n;const o=r.find(e=>!i.includes(e)),l=o===Fr;let s=!1;if(o===xr)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=>Pt(e.method)===o);if(e?.method){const n=await p(e.method);s="success"===n?.status}}s&&e?.()},[e,R,N,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(Ho,{name:"redeemables_list",values:N.value,onChange:M,variant:"block",multiple:!0,children:[k.value&&z&&n(zo,{value:xr,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(ne,{})})]})}),w.value&&j&&n(zo,{value:Fr,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},Pt(e.method)))]})})}function ou({paymentLine:e}){const{i18n:t}=rt(),a=e.method.redemptionContent,i=J(a);return n(zo,{value:Pt(e.method),secondaryContent:n(Q,{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(Q,{children:t.translate("payment.gift_card_checkbox_label")}),n(F,{direction:"inline",gap:"small-400",children:[n(X,{type:"gift-card"}),n(x,{color:"subdued",children:[" ",Z(i)]})]})]})})}function lu(){const{checkout:e}=rt(),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(Lr,{})]}):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}=rt(),n=Er(),t=Ir(n),a=wr(n),i=_t(),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}}=rt(),c=u.current.fields.paymentMethods.value,d=l.session.paymentMethodOption.value,p=Vr(),h=p.selectedCreditCard.value,m=p.selectedPaymentMethod.value,v=p.selectedPaymentMethodItem.value,y=p.paymentMethods.value,g=l.user.hasFlow.value,f=Hr(h),_=y.find(e=>!e.isDisabled);if(s(()=>
2{if(t){const e=setTimeout(()=>{a(!1)},750);return()=>clearTimeout(e)}},[t]),s(()=>{_?"SHOPIFY_INSTALLMENTS"===d?.name&&!0===v?.isDisabled&&(p.selectPaymentMethod(_.method),a(!0)):g&&e()},[v?.isDisabled,d?.name,e,_,p,g]),!m)return null;if(t)return n(cu,{children:n(D,{})});if("CUSTOM_ONSITE"===m.paymentMethod){const e=c?.find(e=>m.paymentBrands&&kt(e,m.paymentBrands));if(!e)return o.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(m),negotiatedPaymentMethods:JSON.stringify(c)}),null;const t=te(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:Uo,incentive_percentage:t}),terms:r.translate("payment.usdc_cashback_terms"),termsUrl:Uo};return n(cu,{children:[n(x,{children:e.name}),n(Go,{notice:i,selected:!1}),n(Mo,{type:a})]})}return n(po,{paymentLine:{method:e},showAmount:!1})}if(zr(m))return n(cu,{children:[n(x,{children:n(x,{children:r.translate("payment.ideal_label")})}),n(Mo,{type:"ideal"})]});if(jr(m))return n(cu,{children:[n(x,{children:r.translate("brand.apple_pay")}),n(Mo,{type:"apple_pay"})]});if(Ur(m))return n(cu,{children:[n(x,{children:r.translate("brand.paypal")}),n(Mo,{type:"paypal"})]});if(Gr(m)||Yr(m)){const e=r.translate("payment_gateway.shop_pay.name"),t=Yr(m)?r.translate("payment_gateway.shop_pay.installments_label"):void 0;return n(cu,{children:[n(x,{children:e}),n(Mo,{type:"shop_pay"}),t?n(x,{color:"subdued",children:t}):null]})}if(Wr(m))return n(cu,{children:n(x,{children:m.name})});if(qr(m))return null;if($r(m))return null;const C=m.paymentAttributes;return n(Kr,{name:f,digits:n(i,{children:[n(ho,{}),n(x,{size:"base",tone:"neutral",children:C.lastDigits})]}),icon:n(Mo,{type:C.brand})})}function pu(){const{checkout:{negotiator:e}}=rt(),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(po,{paymentLine:a,showCardBrandLabel:!0}),n(Xr,{})]})}function hu({openSignal:e}){const{checkout:{identity:t}}=rt();return"shopPay"===t.current.value?n(du,{handleNoValidCards:()=>e.value=!0}):n(pu,{})}function mu(){const{i18n:e}=rt(),t=Et("STORE_CREDIT"),{paymentLines:a}=K(),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(Mo,{type:"store-credit"}),n(Q,{children:[e.translate("payment.store_credit.label"),a]})]},Pt(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=J(i);return n(F,{direction:"inline",alignItems:"center",gap:"base",children:[n(Mo,{type:"gift-card"}),n(Q,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Z(r)}),a]})]},Pt(t.method))}default:return null}})}):null}function vu({paymentExemptionReason:e}){const{checkout:{identity:t}}=rt();return"shopPay"!==t.current.value||"storeCredit"!==e&&"redeemables"!==e?n(mu,{}):n(Ar,{vaulted:!0,reason:e})}function yu({hasPersistentRedeemablesManagement:e,openSignal:t}){const{checkout:a}=rt(),i=Ro(),r=St();return"freeOrder"===i.value?n(Ar,{vaulted:!0,reason:"freeOrder"}):"giftCard"===i.value?n(Ar,{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}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:o}=lt(),l=ae({shouldResetCustomerInfo:!1}),u=ie("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),c=wt(l);return h(()=>{"error"===a.value.status&&m(()=>{c.current(),i.value={type:Ot}}
2)}),s(()=>{It(t,"GOOGLE_PAY")||i.value?.type===Ot||(i.value={type:Ot},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}=rt(),n=e.latestReceipt.value,{value:t}=e.negotiator.current.fields.paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=lt(),r=re(),o=wt(r),l=u(()=>It(t,"PAYPAL_EXPRESS"),[t]);return s(()=>{l||(o.current(),a.value={type:Ot})},[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}}=rt();switch(e.current.value){case"payPal":return n(fu,{});case"googlePay":return n(gu,{});default:return null}}function _u(){const e=rt(),{checkout:a,i18n:r,shop:o,shopPay:l,webMcp:u}=e,c="shopPay"===a.identity.current.value,d=Oo(),p="payment",{hasAnyPaymentError:y,clearReceiptError:g}=function({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const n=G(Y(new Set([...pt,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"]))).value,{hasError:t,clearError:a}=w(ht),{checkout:{negotiator:i}}=rt(),{lastJourneyProgression:r}=i,o="failed"===r.value.type&&"completion"===r.value.negotiationStage,l=Ws(),s=W();mt(()=>{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}),b=G(Y(Rt)).value,{hasError:_}=oe(),{hasError:C}=le(),{paymentErrors:P}=se().value,S=P.length>0,{notSupportedError:A}=Ao(),k=Boolean(A),E=e.checkout.negotiator.current.fields.buyerIdentity,{value:O}=e.checkout.negotiator.current.fields.paymentFlexibilityPaymentTermsTemplate,I=ue(),R=null!=O&&!I.value,T=Tt().value,L=l.session.selectedPaymentMethod.value,D=Nt(L),{value:M}=e.checkout.negotiator.current.fields.paymentMethods,B=Vr({enableAutoSelect:!1}),x=wt(B),{buyerHasActedSignal:V}=e.checkout.negotiator.context;s(()=>{if(u&&c)return u.unstable_provideSavedCardSelector(async e=>{const n=x.current;if(!(n instanceof Jr))return!1;const t=n.cardPaymentMethods.value.find(({method:n})=>n.id===e)?.method;return!!t&&(V.value=!0,"handled"===(await n.selectPaymentMethod(t,"programmatic",{rebuild:!0})).status)})},[x,c,u,V]);const H=B.paymentMethods.value.length>0,z=null!=L&&Lt(L)?L.paymentBrands??[]:[],j=z.length>0?M?.find(e=>kt(e,z)):void 0,$=ce("Checkout::PaymentMethod::Render",j?.uiExtension?[j.uiExtension]:[]),J=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||Bt({identitySource:e.identity.current.value,isOrderSession:xt(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:E.value?.customerProfile}),Z=J&&(c||H),Q=J&&0===B.cardPaymentMethods.value.length,{expandedSlot:ee,collapsedSlot:ne}=Zr(B),te=y||k||S||_||C,{directPaymentErrors:ae,paymentLines:ie}=e.checkout.negotiator.parts,re=ie.value.some(e=>e.method.type===Dt.CreditCard&&e.method.requiresCvvConfirmation),pe=o.storeVaultGuestCvvVerificationEnabled&&re,he=Boolean(D)&&!D?.expired&&!D?.verified,me=To(e)&&e.shopPay.session.isInstallmentsSelected.value&&B.isEveryCardDisabled.value||Boolean(D?.expired)||te||R||T||pe||he,ve=U("purchase.checkout.payment-method-list.render-before"),ye=U("purchase.checkout.payment-method-list.render-after"),ge=wo([...ve,...ye]),fe=wo($),be=hr([...ve,...ye]),_e=N(),Ce=ut(),Pe=t(()=>!(!_e.value||Ce.value)||Boolean(E.value?.purchasingCompany)),Se=Ks(p,me||b);Ys($.map(Mt),f(()=>{Se.value=!0},[Se])),s(()=>{(me||b)&&(Se.value=!0)},[me,b,Se]),Qr();const Ae=f(()=>{Se.value&&Io(ae)||(Se.value=!Se.value,Se.value&&d(),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:{...At(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Se.value))},[d,ae,Se,e]),ke=function(){const{checkout:e}=rt(),n=iu(),t=su(),{paymentLines:a}=K();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:P}):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,Ne=Re?null:we||pe,Le=!Re&&(be||Q||R),De=Te||Le||Boolean(Ne);!function(e){const{checkout:{negotiator:n}}=rt(),{useStoreCreditForSubscriptionRenewals:t}=n.parts,{loading:a}=q(),i=v(e),r=v(a),o=yt(),l=gt(),{showStoreCreditForSubscriptionRenewals:s}=Zs();h(()=>
2{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)})})}(c),h(()=>{Io(ae)&&(Se.value=!0)}),Xs({autoOpen:!1,isMissing:pe||he,open:Se});const Me=Ie?n(Fs,{usesSharedVaultedSelector:Z,hasPersistentRedeemablesManagement:ke.hasPersistentRedeemablesManagement,msiExpandedSlot:ee,onSelectedPaymentMethodChange:g}):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(de,{target:"cart.paymentLines[0]",children:[n(co,{open:Te,disabled:Le,id:p,label:r.translate("payment.title"),icon:n(X,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:Ee,onToggle:Ie?Ae:void 0,error:Ne,renderChildrenWhenCollapsed:Ie,secondaryPersistentContent:Fe,children:Me}),n(bu,{})]})})}function Cu({paymentErrors:e}){return n(B,{children:[e.length>0?n(pe,{errors:e,errorType:V.PaymentError}):n(i,{children:[n(ko,{}),n(Qs,{})]}),n(he,{blockSize:"base"})]})}function Pu({onPaymentDelegation:e}){const{embed:t,i18n:a}=rt(),{rollup:{action:{tone:i}={}}={}}=me();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}=rt(),o=N(),l=Ft(),{delegatedPaymentInstrument:u}=r.negotiator.context,{message:c,tone:d,inventoryRecoveryReceiptId:p}=So(),{rollup:{blockPadding:h}={}}=me(),{violations:m,clearViolations:v}=j(Rt),y=G({violations:m}).value;s(()=>{let e=qo(u.peek());return u.subscribe(n=>{const t=qo(n);t!==e&&(e=t,v())})},[u,v]);const b=Boolean(a)&&r.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(u.value),_=b&&y,C=qo(u.value),P=g(void 0);_&&(P.current=C);const S=$o(u.value),{billingAddress:A}=r.negotiator.parts,k=Boolean(S&&!Vt(A.value,Ko(S))),w=b&&(_||P.current===C&&k),O=a?.embedder,I=Gt({embedder:O}),R=Ht(i.app.config),T=!a?.isFlagshipPartner||zt(a.embedder)||R||I?e.translate("payment.title"):e.translate("payment.payment_method"),L=a?.client?.paymentErrors.value.includes(jt.PaymentEmpty)??!1,D=g(!1),M=g(null),B=f(e=>{M.current=e,e&&D.current&&(e.focus(),D.current=!1)},[]),V=f(async()=>{const e=a?.client;if(!e)return;D.current=!1;const n=null!==M.current;try{const n=await e.paymentMethodChangeStart();if(!n)return;if(n.ucpPaymentInstrument)t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:qo(u.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:qo(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&&(M.current?M.current.focus():D.current=!0)}},[a,t,u]),H=a?.client?.paymentErrors.value.includes(jt.PaymentDelegationError),z=H?e.translate("payment_errors.payment_credential_delegation_error"):void 0,U=z||c,Y=z?"critical":d,W=Ut(h),q=o.value&&U?n(F,{direction:"block",gap:W,paddingBlockEnd:W,children:[n(Eo,{message:U,tone:Y,inventoryRecoveryReceiptId:z?void 0:p}),!w&&a?.isFlagshipPartner&&n(Pu,{onPaymentDelegation:V})]}):void 0;if(!o.value){const e=n(Ar,{vaulted:!0,reason:"freeOrder"}),t="amazon"===O?{compact:e}:{primary:e};return n(co,{id:"payment",label:T,primaryContent:t.primary,compactContent:t.compact,icon:n(X,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const $=u.value,K=Xo($),J=K?.brand,Z=K?.lastDigits,Q=!(l.value&&$&&J&&Z),ee=Q?e.translate("payment.add_payment_method"):void 0,ne=n(x,{tone:"critical",children:e.translate("payment.add_payment_method")}),te=Z?n(x,{accessibilityVisibility:"exclusive",children:`${ku(J,e)} ${e.translate("payment.ends_with_label",{last_digits:Z})}`}):null,ae=n(x,{accessibilityVisibility:"hidden",children:n("bdi",{children:[ku(J,e),n(ho,{}),Z]})}),ie=(()=>
2{if(!Q)return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[te,ae,n(Mo,{type:J,size:"small",accessibilityVisibility:"hidden"})]})})(),re=Q?n(x,{tone:L?"critical":void 0,children:e.translate("payment.add_payment_method")}):n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n("span",{"aria-hidden":"true",className:"EnNLk",children:n(Mo,{type:J})}),te,ae]}),oe=Q?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")})," ",te,n(x,{type:"strong",accessibilityVisibility:"hidden",children:[ku(J,e),n(ho,{}),Z]}),n(Mo,{type:J,accessibilityVisibility:"hidden"})]}),le="amazon"===O?{compact:oe}:"google"!==O||I?{primary:ie,secondary:void 0===ie?ne:void 0}:{primary:re};return n(co,{buttonRef:B,id:"payment",label:T,open:w,disabled:w,onToggle:q?void 0:V,primaryContent:le.primary,secondaryContent:le.secondary,compactContent:le.compact,buttonAccessibilityLabel:ee,icon:n(X,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:q,children:w?n(F,{direction:"block",gap:"base",children:[n(E,{level:3,children:e.translate("billing.billing_address_title")}),n(Yo,{}),a?.isFlagshipPartner?n(Pu,{onPaymentDelegation:V}):null]}):null})}const wu=new Set(["amazonPay","buyWithPrime"]);function Ou(){const{checkout:{identity:e}}=rt();return wu.has(e.current.value)?n(ws,{}):"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}=rt(),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},Nu=({requiresAvailableBalance:e=!0}={})=>{const n=function({requiresAvailableBalance:e=!0}={}){const n=ul({requiresAvailableBalance:e}),a=g(null),{checkout:{negotiator:i}}=rt(),{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?Jo.ShopCashNotAvailable:i?t:Jo.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 Lu(){const{shop:e}=rt(),n=e.hasFlagEnabled(Yt);return Nu({requiresAvailableBalance:!n})}const Du=()=>{const e=rt().shopPay.app.config,n=vl();return Wt(e,n)};function Mu(e,n,t){s(()=>{if(e&&t)return e.recordPresentation({component:n,displayLabel:t})},[n,t,e])}const Bu=()=>{const{embed:e,i18n:t,shop:a,shopPay:i}=rt(),r=zt(e?.embedder),o=i.app.config.surface,l=a.hasFlagEnabled(qt),s=ve();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},xu=({adType:e,offerAmount:a,minimumOrderValueAmount:i,remainingAmount:r,incentivePresentation:o})=>{const{i18n:l}=rt(),s=Du(),{hasMerchandiseDiscounts:u}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.discountLines;return t(()=>{const e=n.value;return{hasMerchandiseDiscounts:!!e&&e.lines.some(e=>!!bl(e)&&e.allocations.some(e=>"MERCHANDISELINE"===e.target.type)),orderDiscountAmount:e?e.lines.filter(e=>bl(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}})})().value,c=l.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),d=l.formatCurrency(i.amount,{currency:i.currencyCode,form:"short"}),p=r?l.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}):void 0,h=Fu({adType:e,formatMinimumOrderAmount:d,formatRemainingAmou
2nt:p,formatOfferAmount:c,hasMerchandiseDiscounts:u});return Mu(o,"minimumOrderValueBanner","FLAT_AMOUNT_CASHBACK_OFFER"===e?h:void 0),n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:s?"dHa7y":"O9AXs",children:[n(Q,{type:"small",children:h}),n(Bu,{})]})},Fu=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=rt(),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 Vu({eligibility:e,offerEligibility:t,discountOffer:a}){const i=l(No),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(xu,{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(xu,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:r.cashbackAmount,minimumOrderValueAmount:r.minimumOrderValue,remainingAmount:r.minimumOrderValueRemainder,incentivePresentation:i?.incentivePresentation},"mov-cashback")),o}function Hu(){const{checkout:e,embed:t}=rt(),{main:{section:a}}=ye(),i=Nu().value,r=Lu().value,o=Ru(),l=ge().value.payment,s=Vu({eligibility:i,offerEligibility:r,discountOffer:o.value});return zt(t?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&s.length>0?l?n(F,{padding:zu(a?.padding),gap:"small-200",children:s}):n(ao,{hideDivider:l,condition:!l,padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:s})}):null}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 ${Ut(n)??"none"} small-200 ${Ut(t)??"none"}`}function ju({checked:e,onChange:t,disabled:a}){return n(_l,{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}}=rt(),a=l(No),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 Zo;if(!e.method.redemptionContent?.details)return Zo;const n={...Zo};for(const t of e.method.redemptionContent.details){const e=Qo.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:dl(t.destinationAmount),sourceAmount:cl(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}}=rt(),{paymentLines:n}=e.current.fields;return t(()=>Wu(n.value?.lines.find(Yu)))},Ku=()=>{const{checkout:{negotiator:e}}=rt(),{paymentLines:n}=e.parts;return t(()=>Wu(n.value?.find(Yu)))},Xu=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),Ju=({enabled:e=!0}={})=>{const{shopPay:n,checkout:{negotiator:t}}=rt(),a=Ku(),i=l(No),r=i?.redemption.applying,{negotiate:o}=fe(),s=t.parts.paymentLines,u=pl(),c=Lo(),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?Xu(l):null),SHOP_DISCOUNT_OFFER:v=(p?Xu(p):null),SHOP_PROMOTION:y=h.map(Xu)}=t,g=n.session.isInternalProgressing.value;if(!e)return;if(!r)return;if(g)return;if(!d)return;if(r.peek())return;_(()=>{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,C=[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;if(0===e.length)return null;const a=e.reduce((e,n)=>e+n.amount.amount,0),i=e[0].amount.currencyCode;return{cost:{amount:a,currencyCode:i},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:a.toString(),currencyCode:i},sourceAmount:{amount:a.toString(),currencyCode:i},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}))}}}}(C,!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{_(()=>{r.value=!1})}},[r,e,o,c,s,a,d,u,n.session.isInternalProgressing])},Zu=()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.subtotalAfterMerchandiseDiscounts,a=bt(),i=Qu(),r
2=ec();return t(()=>{const e=a.value,t=e?{amount:el(e.amount-i.value-r.value,C(e.currencyCode)),currencyCode:e.currencyCode}:void 0;return{orderTotal:e,orderSubtotal:n.value,redeemableTotal:t}})},Qu=()=>{const{checkout:{negotiator:e}}=rt(),{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=nl,tc=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=rt(),r=Gu(),o=Ju(),l=Ku(),u=$u(),{applying:c}=Do().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(lo,{theme:ic,children:n(co,{label:t,primaryContent:a,primaryAction:n(ju,{checked:i,onChange:r,disabled:o})})})})},oc=()=>{const{i18n:e}=rt(),t=Du(),a=e.translate("payment_errors.vaulted_card_required_error");return n(B,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:P("Q9An4",t&&"K92xU"),children:n(Q,{type:"small",children:a})})},lc={availableBalance:null,redeemableBalance:null};function sc(){const e=g([]),n=Zu(),{checkout:a}=rt(),i=a.proposal.negotiated.fields.shopPromotion;return t(()=>{const{orderTotal:t}=n.value,a=i.value;return"filled"===a?.status?e.current=a.promotions:"unavailable"===a?.status&&(e.current=[]),il(e.current,t)})}const uc=()=>{const{recordRedemptionActionEvent:e}=hl(),{shop:n,shopPay:t}=rt(),a=n.hasFlagEnabled(qt),i=t.app.config.surface,r=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),o=u(()=>({shopPayCheckoutSurface:i,isReactNativeWebview:r,isShopCashBalanceBetaEnabled:a,isOnePageCheckout:!0,nEnabledCreditCards:0}),[i,r,a]),l=f(n=>{e({...o,...n})},[o,e]),s=f((e,n)=>{l({action:"auto-apply",redemptionType:e,source:n})},[l]),c=f((e,n)=>{l({action:"manually-apply",redemptionType:e,source:n})},[l]);return{recordRedemptionAutomaticallyApplied:s,recordRedemptionAutomaticallyRemoved:f((e,n)=>{l({action:"auto-remove",redemptionType:e,source:n})},[l]),recordRedemptionManuallyApplied:c,recordRedemptionManuallyRemoved:f((e,n)=>{l({action:"manually-remove",redemptionType:e,source:n})},[l])}},cc=({enabled:e=!0,redemptionTypes:n=Qo}={})=>{const t=$u(),a=l(No),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=uc(),o=Ju({enabled:e}),u=G(j(Kt)).value;s(()=>
2{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,retryOnReady:t=!1}={})=>{const a=Gu({enabled:n}),i=Ju({enabled:n}),{recordRedemptionAutomaticallyRemoved:r}=uc(),o=$u(),l=Ku(),u=e.filter(e=>!e.eligibility.eligible).flatMap(e=>e.redemptionTypes??Qo),c=u.join(","),d=!!t&&a,p=t?u.filter(e=>qu(l.value,e)).join(","):"";s(()=>{if(!n||0===u.length)return;if(!t){const e=u.filter(e=>qu(o.value,e));if(0===e.length)return;return void i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})}if(!a)return;const e=u.filter(e=>qu(l.value,e));0!==e.length&&i(Object.fromEntries(u.map(e=>[e,null])),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})},[n,d,c,p])};class pc extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const hc=({message:e})=>n(ee,{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(X,{type:"alert-circle",size:"small"}),n(Q,{color:"subdued",size:"small",children:e})]});function mc(){const{eligibility:e,offerEligibility:n,redeemableBalance:t,availableBalance:a,discountOffer:i,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}=vc();!function(e){const n=g(!1),t=g(performance.now()),{observability:a}=rt();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])}(a);const{shop:d}=rt(),p=d.hasFlagEnabled(Yt);return dc([{eligibility:e,redemptionTypes:[nl]},...p?[]:[{eligibility:n,redemptionTypes:[rl,ol]}]],{retryOnReady:p}),cc(),(e=>{const{client:n,shop:t,shopPay:a}=rt(),{recordRedemptionVisibilityEvent:i}=hl(),r=n.unstable_getSerialization("apiClientId"),o=t.hasFlagEnabled(qt),l=a.app.config.surface,c=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),d=ge().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}=hl(),{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:a,redeemableBalance:t,discountOffer:i.value}),(()=>{const{observability:e,source:n,checkout:{negotiator:t}}=rt(),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:t,messages:r,showVaultedCardBanner:o,vaulted:l,isDigitalGoodsRedemptionAllowed:c}}function vc(){const e=ge().value.payment,t=Nu().value,a=Lu().value,{redeemableBalance:i,availableBalance:r}=(()=>{const{checkout:{negotiator:e}}=rt(),n=e.current.fields.shopCashBalance.value,{redeemableTotal:t}=Zu().value,a=(()=>{const{checkout:{negotiator:e}}=rt(),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=tl(t.currencyCode);if(t.amount<=i)return lc;if(t.amount<a.amount)return{availableBalance:a,redeemableBalance:t};const r=el(t.amount-a.amount,C(t.currencyCode));return r>=i?{availableBalance:a,redeemableBalance:a}:{availableBalance:a,redeemableBalance:al({amount:a.amount-(i-r),currencyCode:a.currencyCode})}})(),o=Ru(),l=sc().value,s=Vu({eligibility:t,offerEligibility:a,discountOffer:o.value}),{eligibilityMessage:u,showVaultedCardBanner:c}=(e=>{const t=(()=>{const{i18n:e}=rt();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invali
2d_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}}=rt(),{paymentLines:i}=a.current.fields,r=St().value&&Boolean(i.value?.lines.find(Yu));return{eligibilityMessage:t(e.reason),showVaultedCardBanner:r}})(t),d=!t.eligible&&"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING"===t.reason,p=[];return u&&!d&&p.push(n(hc,{message:u},"eligibility-banner")),p.push(...s),{eligibility:t,offerEligibility:a,redeemableBalance:i,availableBalance:r,discountOffer:o,shopPromotionDiscounts:l,messages:p,showVaultedCardBanner:c,vaulted:e,isDigitalGoodsRedemptionAllowed:d}}const yc=()=>{const{eligibility:e,redeemableBalance:t,messages:a,showVaultedCardBanner:r,vaulted:o,isDigitalGoodsRedemptionAllowed:l}=mc();return r&&!o&&a.push(n(oc,{})),n(i,{children:[(e.eligible||l)&&t&&n(ao,{hideDivider:o,condition:!o,children:n(rc,{redeemableBalance:t})}),a.length>0&&n(ao,{hideDivider:o,condition:!o,padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:a})})]})};function gc({formattedAddress:e}){const{i18n:t,checkout:a}=rt(),i=a.negotiator.current.fields.buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,o=r.selectedAddress.value?.id===Rl&&Xt(i)||!e;return n(F,{children:[o&&n(Q,{children:i?.location.name}),n(Q,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}}=rt(),s=Ks(e),c=l.current.fields.buyerIdentity.value?.purchasingCompany,d=Ol(),p=be(),h=G(j(fc)).value,{deliveryAddressErrors:m}=se().value,v=r??p,y=u(()=>[`single_choice_${e}`],[e]),g=t??o.translate("shipping.shipping_address_title"),f=n(gc,{formattedAddress:v}),b=n(i,{children:[n(kl,{name:`single_choice_list_${e}`,values:y,hideRadioControl:!0,children:n(zo,{value:`single_choice_${e}`,children:n(F,{children:[n(Q,{children:c?.location.name}),n(Q,{color:"subdued",children:v??o.translate("review.blocks.no_address")})]})})}),n(a,{when:d,children:n(B,{padding:"small-200 small-100 none small-100",children:n(vo,{showIcon:!0})})})]}),_="deliveryAddress"!==e?null:h?n(Ai,{message:o.translate("shipping_errors.shipping_method_not_available_generic.one")}):m.length>0?n(pe,{errors:m,errorType:V.DeliveryError}):null;return n(co,{id:e,label:g,open:s.value,onToggle:()=>{s.value=!s.value},primaryContent:f,error:_,children:b})}function _c({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:t,negotiator:a}}=rt(),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}=rt(),{shippingAddress:a,name:i}=e.location,{secondary:r}=Se({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}}=rt(),r=i.parts.billingAddress.value,o=Sc().value,l=null!=o&&i.parts.billingAddressOption.value===o.option,u="form"!==_e().value,c=l&&o.sameAsShipping&&!u,d=c?o.address:r,p=Ce(d,{displayName:!1}),{isMissingPhone:h}=Cl({addressType:"billing"}),{isMissingFirstName:m}=Pl({addressType:"billing"}),v=h||m,y="billingAddress",b=Ks(y),_=Jt("deliveryNext").value,C=g(!0),{violations:P,clearViolations:S}=Y(Rt),A=P.value,k=G({violations:P}).value,E=new Set([...h?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...m?Zt:[]]),w=eo(k,A,E),O=G(Y(Qt)).value;s(()=>{w&&(b.value=!0)},[w,b]),s(()=>{C.current?C.current=!1:S()},[S,r]),Xs({isMissing:v,open:b});const I=function(){const{userEvents:e,source:n,checkout:t,shop:a}=rt(),{billingAddress:i,billingAddressOption:r,shippingAddress:o}=t.negotiator.parts,l=Sc(),s=f(e=>{e?r.value="custom":Vt(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&&Vt(i.value,
2n.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:{...At(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(Pe,{errorType:V.PaymentError,tone:"critical",children:t.translate("address_management.invalid_billing_address_selected")})):T=n(Pe,{errorType:V.PaymentError,tone:"critical",children:t.translate("payment.billing_must_match_shipping_notice")});const N=t.formatName(d?.firstName,d?.lastName,!0);let L,D;return!l||c?(L=N,D=p):L=o.sameAsShipping?t.translate("billing.same_as_shipping"):p,n(co,{id:y,label:t.translate("billing.billing_address_title"),open:b.value,onToggle:R,error:T,primaryContent:L,secondaryContent:D,renderChildrenWhenCollapsed:v,children:n(Hs,{renderInlineSelector:e})})}function Sc(){const{checkout:e}=rt(),{buyerIdentity:n}=e.negotiator.current.fields,a=Ae();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(Oe,{contentDisplay:"block",children:n(Oc,{})})})})}function Oc(){return n(he,{blockSize:Ec,inlineSize:Ec})}const Ic=o({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p(()=>e(()=>import("./68887467.BuHGd1PE.js"),__vite__mapDeps([126,1,127,2,3,4,5,6,7,8,9,10,11,12,128]))),renderLoading:()=>n(wc,{}),renderError:()=>n(Oc,{}),useError:we("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}}=rt(),{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:Nc(e)}):t?a.translate("account_management.phone_changed",{shopName:o,phone:Nc(t)}):null,[e,t,o,a,l]);return p?n(B,{padding:"small-200 none none none",children:n(Re,{tone:"info",children:p})}):null}const Nc=e=>n(x,{type:"strong",children:e});function Lc({url:e,displayName:t}){return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(B,{inl
2ineSize:"16px",blockSize:"16px",children:n(Te,{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(xo,{wallet:st.AmazonPay,size:e})}},applePay:class extends kc{get logo(){return n(xo,{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(xo,{wallet:st.BuyWithPrime,size:"large"})}},businessCustomer:class extends kc{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Ie(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(xo,{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(xo,{size:e,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){const e=ea(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)&&Le({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:De(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.n
2onLocalizedMessage,n.value=void 0);t()}get logo(){const e=this.appContext.embed,t=Gt({embedder:e?.embedder}),a=e?.interstitialPartnerDisplayName,i=e?.interstitialPartnerProfileIconUrl;return t&&a&&!0===e?.isFlagshipPartner&&this.appContext.checkout.identity.customerContactMethodPrefilled?i?n(Lc,{url:i,displayName:a}):Rc(void 0,this.email):n(X,{type:"email",size:"fill"})}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:n(ki,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:e,negotiationStage:n}=this.providerData.violationsSubscriptionResult,t=e.value,a=n?.value,i=na(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&na(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()))&&Ht(this.appContext.shopPay.app.config),this.#a=ta(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 aa(0,0,100);function xc(){const e=rt(),a=e.checkout.identity.current.value,i=u(()=>({appContext:e,identitySource:a}),[e,a]),r=Ve().value,o=e.client.unstable_getSerialization("logoutUrl")||"",l=function(){const e=rt(),n=Nl(),a=He(),i=bo(),r=ze(),o=function(){const{checkout:{wallets:e}}=rt(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=lt(),{clearForcedCheckoutLayout:a}=ke(),i=f(()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})},[e.escalatedWallet,n,t,a]);return Ee({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=yo(),c=function(){const{shopPay:e,mobileCheckoutSdk:t,embed:a,router:i}=rt(),r=i.currentUrl.value,o=Boolean(a?.isFlagshipPartner)?"small":"medium",l=(t.enabled||a?.isCheckoutKit())&&Ht(e.app.config),s=ta(r.search),u=fl({foregroundColor:Bl}),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(Ml,{color:d,size:o}):n(Dl,{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}=rt(),c=i.negotiator,{visibility:d,app:{config:p}}=l,h=Ht(p),{replaceShopPayInHistory:m}=Tl(),v=f((e,t)=>
2{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(ia).pathname,a.searchParams.set(ra,"1"),m(a.toString())},[i,n,o,m,s]),y=Me(v),{label:g}=Be(),b=xe({clearPii:!0}),_=Fe(),C=Boolean(l.config.isReferral),P=f(()=>{i.unstable_setRedirectingExternally(!0),t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(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=Y(oa),h=Me(f(()=>{e.persistence?.clearAll(),window.location.assign(o)},[e,o])),m=f(()=>{e.checkout.unstable_setRedirectingExternally(!0),h().catch(()=>{e.checkout.unstable_setRedirectingExternally(!1)})},[e.checkout,h]);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:m,showLogoutLink:r},loadShopPayVerification:s.value,shopPayLogo:c,shopPayMoreOptions:d,checkoutAsGuest:l,violationsSubscriptionResult:p}),[i,m,r,s.value,c,d,l,p])}function Fc(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 Vc({emailAddress:e,phone:t,logo:a,moreOptions:r,emailAlignment:o="end",children:l}){const{i18n:s,shop:u,checkout:{negotiator:c}}=rt(),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(ee,{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(Q,{children:[!p&&d&&n(i,{children:[n(x,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(je,{children:h})]}):h}),r&&n(Sl,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),l]})}function Hc({layout:e,emailAlignment:t,...a}){const{i18n:i}=rt(),r=n(Vc,{...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 zc(){const e="contact",t=Ks(e),r=f(()=>t.value=!t.value,[t]),o=xc();Fc(o);const l=y(!1),u=Ft(),c=g(!1),{embed:d,i18n:p}=rt(),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(co,{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(Hc,{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(Ei,{email:C??"",open:l.value,showPopover:e=>{l.value=e}})}):null]})}function jc(){return Ue(new Set([...sa].filter(e=>e.startsWith("DELIVERY_COMPANY"))))}function Uc({loading:e,countryCode:n,phone:t}){const a=ua(),{i18n:i,checkout:r}=rt(),o=r.configuration.addressSettings.nonBillingAddressSettings.value,l=u(()=>o.isRequired("phone",{countryCode:n}),[n,o]),{validatePhoneNumber:c,isPhoneNumberUtilLoaded:d}=xl(),p=f(e=>{const t=na(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(()=>
2{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 Gc=new Set(ca);function Yc(){const{shopPay:e,checkout:n,source:t,observability:a}=rt(),{deliveryMethodsAddressErrors:i}=n.negotiator.context,r=Fo(),{shippingAddress:o}=n.negotiator.parts,l=o.value,u=n.configuration.addressSettings.nonBillingAddressSettings.value,c="simulated"===t.type,d=Ge(l.countryCode,void 0,u),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,m=Ge(h??l.countryCode,void 0,u,null),{details:v}=da(h),y=!h||void 0!==v&&!v.isFallback,{clearViolations:f}=j(Gc),b=g(!0);return s(()=>{b.current?b.current=!1:f()},[f,l]),Vo("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=>{_(()=>{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"),Vl({addressType:"shipping",validate:()=>c,setErrors:o})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const o=Vl({addressType:"shipping",validate:()=>d(l,"shipping"),setErrors:e=>{_(()=>{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 Wc=()=>{const{shopPay:e,checkout:{negotiator:n}}=rt(),{geolocation:a}=Ye(),{shippingAddress:i}=n.parts;return t(()=>{const n=i.value;return e.signup.phoneCountryCode.value??n.countryCode??a.country.code})};function qc({padding:e}){const{i18n:t,shopPay:a,checkout:{negotiator:i}}=rt(),{shopPayMobilePhoneInputShownSignal:r}=i.context,o=Wc(),l=Boolean(a.user.phoneNumber.value),u=(()=>{const{i18n:e,shopPay:n}=rt(),{isPhoneNumberUtilLoaded:t,validatePhoneNumber:a}=xl(),i=Wc(),r=f(n=>na(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}=rt(),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}=We(u),p=Wc(),{isPhoneNumberUtilLoaded:h}=xl(),m=g(!1),v=Fl(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(Hl,{name:"phone",countryCode:c.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:d,...u}),n(Q,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const $c="shipping";function Kc({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const o=va(),{shouldGateCrossBorder:l,crossBorderGate:u}=jl(),c=rt(),{deliveryMethodsAddressErrors:d}=c.checkout.negotiator.context,{shippingAddress:p}=c.checkout.negotiator.parts,{checkout:h,i18n:m,userEvents:y,source:f,shop:b}=c,{configuration:C}=h,P=C.isAddressDelegationEnabled,{violations:S}=j(sa),A=S.value,k=p.fields?.countryCode.value,E=qe(k),w=g(!1);s(()=>
2{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($c,Array.from(A));_(()=>{for(const[n,t]of e)void 0===d[n]?.value&&(d[n].value=t)})},[P,A,E,d]);const O=C.addressSettings.nonBillingAddressSettings.value,I=p.value,R=ya(),T=G(j(Gc)).value,N=C.defaultPhoneNumber.value;O.isRequired("phone",{countryCode:I.countryCode,useMerchantSettings:!0})&&!I.phone&&N&&(p.value={...I,phone:N});const L=v(Boolean(e&&e.length>0)),D=C.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(f,h,b),action:"address_autocomplete"}})}:void 0,M=n(Wo,{id:"shippingAddressForm",addressType:$c,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:L,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(Q,{children:[I.firstName," ",I.lastName]}),n(Ul,{address:I,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),M]})})});return n(zl,{impressionType:"delivery_address",impressionFeatures:[],children:[Xc(c)&&n(Yc,{}),T&&C.visibility.showInvalidDeliveryAddressBanner.value&&n(B,{children:[n(wi,{}),n(he,{blockSize:"base"})]}),n(a,{when:R,children:n(B,{children:[n(Re,{tone:"info",children:m.translate("address_management.draft_order_delivery_address_reminder")}),n(he,{blockSize:"base"})]})}),x,n(a,{when:C.visibility.showStandalonePhoneField,children:n(qc,{padding:"base none none none"})})]})}function Xc({checkout:e}){return"shopPay"===e.identity.current.value}const Jc=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 Zc(){const e=$e(),{checkout:{negotiator:n}}=rt(),{paymentLines:a}=n.parts,{walletUsedForSubmissionSignal:i}=lt();return t(()=>e.value||Zl({paymentLines:a.value,walletUsedForSubmission:i.value}))}function Qc(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Ca(n)}const ed=new Set([...sa,...fa,...ca,...Pa]),nd=["phone","zoneCode","countryCode","firstName","lastName","name"],td=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"];function ad(e){return"pending"===e||"pendingCollapsed"===e}function id(e){return"collapsed"===e||"pendingCollapsed"===e}function rd({summary:e,forceOpen:r,initiallyOpen:o=!1,renderRollup:l}={}){const u=function(){const{checkout:{negotiator:e}}=rt(),t=e.current.fields.buyerIdentity.value?.purchasingCompany,a=be();return t?n(gc,{formattedAddress:a}):void 0}(),c=u??e,d=v(function(){const{i18n:e}=rt(),t=G(j(fa)).value,a=G(j(ba)).value,{hasError:i,error:r}
2=w(_a),o=ie(r?{type:"payment",code:r}:void 0);return i&&o?n(Pe,{tone:"critical",errorType:V.DeliveryError,children:o}):t?n(Ai,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?n(Ai,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}()),p=ya(),{embed:C,i18n:P,shopPay:A,observability:k,userEvents:E,checkout:O,source:I,shop:R}=rt(),{shippingAddress:T}=O.negotiator.parts,{allViolations:N}=O.negotiator.current.fields,L=C?.client?.addressErrors.value.includes(Sa.AddressEmpty)??!1,D=va(),{installments:M}=A,H="shopPay"===O.identity.current.value,{isMissingPhone:z}=Cl(),{isMissingFirstName:Y}=Pl(),W=z||Y,q="google"===C?.embedder,$=O.configuration.addressSettings.nonBillingAddressSettings.value,K=t(()=>q&&$.isVisible("phone",{countryCode:T.value?.countryCode})),{formattedNumber:J}=Fl(T.value?.countryCode??"",K.value?T.value?.phone:void 0),Z=t(()=>Qc(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(T.value?.countryCode&&!D?.some(e=>e.value===T.value.countryCode))),te=function({checkout:e,i18n:t},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?n(wi,{}):a?n(Ai,{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}(T.value,Z.value?td:nd)),[re,oe]=b([]),{availableDeliveryAddresses:le,mustSelectProvidedAddress:ue}=O.proposal.negotiated.fields,ce=t(()=>le.value??[]),de=t(()=>ue.value??!1),he=U("Checkout::DeliveryAddress::RenderBefore"),me=U("purchase.checkout.delivery-address.render-after"),ve=wo([...he,...me],{lazyReveal:!0}),ye=Je(),ge=t(()=>ce.value?.length&&Boolean(ce.value.find(e=>pa(T.value,e.address)))),fe=t(()=>Boolean(ge.value&&de.value)),_e=Ze(),Ae=Ft(),ke=Aa(Qe),Ee=t(()=>Ae.value&&"loading"===ke.uiStateSignal.value?.status),we=t(()=>"filled"===ke.uiStateSignal.value?.status),Oe=t(()=>!Z.value||!ae.value&&we.value),Ie="deliveryAddress",Te=Ks(Ie,m(()=>o||(ve.value||fe.value)&&Oe.value)),Ne=function(e,n){const[t,a]=b(Jc(e)),i=g(null),r=y(!1);"vaulted"===t&&Jc(e)!==t&&a("write"),"unknown"===t&&Jc(e)!==t&&a(Jc(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])}}(_e,Te),Le=g(null),De=g(null),Me=g(!1),Be=y("idle"),xe=ad(Be.value),Fe=id(Be.value),Ve=y(!1),He=Ys(ka([...he,...me],"uiExtension").map(Mt),f(()=>{Oe.value&&(Te.value=!0)},[Oe,Te]));s(()=>{He&&Oe.value&&(Ve.value=!0)},[He,Ve,Oe.value]);const ze=t(()=>Z.value&&Ve.value);s(()=>{Oe.value&&(ve.value||He)&&(Te.value=!0)},[ve.value,Oe.value,He,Te]),S(()=>{ye.current&&(Z.value&&ae.value||Z.value&&Fe||!1===ge.value&&(Te.value=!0))},[ge.value,Te,ye,Z.value,ae.value,Fe]),Xs({isMissing:W,open:Te});const je=se(),Ue=je.value.deliveryAddressErrors,Ge=t(()=>je.value.deliveryAddressErrors.length>0),Ye=Zc().value||"payPal"===O.identity.current.value,{violations:We,clearViolations:$e}=j(ed),nn=We.value,tn=nn.size>0,{missingAddressFieldSignal:an,hasResolvedMissingAddressFieldSignal:rn}=function({countryCode:e,addressType:n,addressViolations:t}){const{checkout:{identity:a}}=rt(),i=y(void 0),{violations:r}=Ke(t),o=r.value,l=qe(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:T.value?.countryCode,addressType:"shipping",addressViolations:sa}),on=t(()=>Boolean(an.value)&&!Te.value),ln=new Set([...z?Ea:[],...Y?wa:[],...on.value?sa:[]]),sn=eo(tn,nn,ln),{hasError:un,clearError:cn}=w(_a),dn=M.agreementError.value===ll.InvalidShippingAddress,pn=Jt("deliveryNext"),hn=t(()=>!Ae.value||pn.value);h(()=>{Ee.value&&m(()=>{cn(),M.unstable_setAgreementError(null)})});const mn=f(()=>{$e(),cn(),M.unstable_setAgreementError(null)},[$e,cn,M]),vn=Ce(T.value,{hiddenFields:["phone"],displayName:!1}),yn=P.formatName(T.value?.firstName,T.value?.lastName,!0),gn=T.value?.firstName&&T.value?.lastName?yn:void 0,fn=Se({address:T.value??{}}),bn=n(a,{when:ae,fallback:n(F,{children:[vn,K.value&&J&&n(x,{children:J})]}),children:n(x,{tone:"critical",children:P.translate("shipping.add_shipping_address")})}),_n=ae.value?n(x,{tone:L?"critical":void 0,children:P.translate("shipping.add_shipping_address")}):gn,Cn=ae.value?void 0:n(F,{children:[fn.primary&&n(x,{children:fn.primary}),fn.secondary&&n(x,{children:fn.secondary}),K.value&&J&&n(x,{children:J})]}),Pn=n(a,{when:()=>ae.value||!T.value?.postalCode,fallback:n(i,{children:[n(x,{children:P.translate("shipping.delivery_to")}),n(x,{type:"strong",children:gn})]}),children:n(x,{tone:"accent",decoration:"underline",children:P.translate("shipping.add_new_delivery_address")})}),Sn=t(()=>T.value?.postalCode),An=n(a,{when:()=>ae.value||!Sn.value,fallback:n(F,{children:[n(x,{type:"strong",children:Sn}),K.value&&J&&n(x,{children:J})]}),children:()=>""}),kn=(()=>
2{if(c)return{primary:c};switch(C?.embedder){case"amazon":return{compact:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[Pn,An]})};case"google":return{primary:_n,secondary:Cn};default:return{primary:gn,secondary:bn}}})(),En=t(()=>en(N.value??[])&&!Ee.value),wn=v(sn&&!En.value||un||dn),On=t(()=>hn.value?null:wn.value&&te&&!Ee.value?{type:"invalid-address-banner",element:te}:!d.value||En.value||Ee.value?!Ge.value||Ye||En.value?En.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(pe,{errors:Ue,errorType:V.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:d.value}),In=n(ld,{errorSignal:On}),Rn=t(()=>Boolean(On.value)||Ye&&Ge.value),Tn=v(sn),Nn=v(un),Ln=v(r),Dn=v(He),Mn=t(()=>ee.value||Tn.value||Ge.value),Bn=t(()=>Boolean(Ln.value)||ve.value||Dn.value&&Oe.value||ze.value),xn=t(()=>Z.value&&ad(Be.value)&&id(Be.value)&&!Bn.value&&!Nn.value&&!En.value),Fn=t(()=>rn.value&&void 0===an.value),Vn=t(()=>Mn.value&&!xn.value),Hn=t(()=>Z.value&&we.value&&!Vn.value),zn=t(()=>Hn.value&&id(Be.value)),jn=t(()=>Bn.value||Nn.value||Fn.value||!xn.value&&Rn.value),Un=t(()=>Mn.value&&!(Z.value&&ad(Be.value))||En.value||Bn.value||Nn.value);Me.current=Un.value;const Gn=t(()=>{if(Z.value){if(ae.value)return!1;if(zn.value)return jn.value;if(ee.value&&!xn.value&&(!rn.value||!an.value))return!0}return Te.value||jn.value}),Yn=f(()=>{De.current&&(clearTimeout(De.current),De.current=null)},[]),Wn=f(()=>{Yn(),Be.value="idle"},[Yn,Be]),qn=f(()=>{if(Yn(),Me.current)return Be.value="collapsed",void(Te.value=!0);Be.value="collapsed",Te.value=!1},[Yn,Be,Te]),$n=f(()=>{Yn(),De.current=setTimeout(()=>{De.current=null,Me.current||(Be.value="pendingCollapsed",Te.value=!1)},300)},[Yn,Be,Te]),Kn=f(()=>{Wn(),Te.value=!0},[Wn,Te]);s(()=>Yn,[Yn]),s(()=>{Z.value&&Mn.value&&!xe&&Wn()},[xe,Mn.value,Z.value,Wn]);const Xn=f(async()=>{if(!Z.value||!C?.client)return;if(ad(Be.value))return;oe([]),Be.value="pending";const e=Gn.value;ze.value||$n();const n=performance.now();try{const a=await C.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 Oa)return k.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:i}),oe([{code:"GENERAL_ERROR",message:String(P.translate("shipping.third_party_address_timeout"))}]),void Kn();const t=n instanceof Error?n.message:String(n);return n instanceof Ia&&n.isUserCancelledError?(k.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:i}),Wn(),Te.value=e,void Le.current?.focus()):(n instanceof Ra?(k.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:i,technicalError:t}),C.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}),oe([{code:"GENERAL_ERROR"}]),void Kn())}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}),C.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),oe([{code:"GENERAL_ERROR"}]),void Kn();if(r?.errors&&r.errors.length>0)return oe(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 Kn();if(r?.cart){_(()=>{for(const e of Object.values(Q))e.value=void 0;$e()});try{await C.client.applyCart(r.cart),ke.dispatch("addressReplaced"),ze.value?Wn():qn(),k.log("address_change_start_success","Successfully applied address change from embedder",{duration:i}),Le.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}),C.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}
2),oe([{code:"GENERAL_ERROR"}]),Kn()}}else ze.value?Wn():qn()}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}),oe([{code:"GENERAL_ERROR"}]),Kn()}},[ze,Z,C,k,oe,P,Q,Be,ke,$e,Gn,$n,Kn,Wn,Te,qn]),Jn=f(async()=>{if(ze.value)return;if(Z.value){if(Te.value)return;return void(await Xn())}const e=!Te.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:{...At(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:E,source:I,checkout:O,shop:R},e),Te.value=e},[ze,E,I,O,R,Te,Xn,Z]);s(()=>{!Z.value||!Fe||Vn.value||jn.value?Gn.value?Te.value=!0:zn.value&&!jn.value&&(Te.value=!1):Te.value=!1},[Te,Z.value,Fe,Vn.value,Gn.value,zn.value,jn.value]);const Zn=0===he.length&&0===me.length,Qn=1===ce.value.length&&de.value&&Zn,et=p.value,nt=!hn.value&&!Ee.value&&!xn.value&&sn&&!(Z.value&&ae.value),tt=Z.value&&!xn.value&&ee.value&&!ae.value,at=nt||tt,it=(()=>{if(Z.value){const{firstName:e,lastName:t}=T.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:vn}),children:n(x,{tone:"critical",children:P.translate("address_management.address_form.add_address")})})]})}return c??vn})(),ot=ae.value?P.translate("shipping.add_shipping_address"):void 0,lt=_e&&!Gn.value?n(Yl,{vatNumber:_e.taxId.value,onAdd:()=>{Te.value=!0,Ne.focus()}}):void 0,st=on.value?n(B,{padding:"none base base base",children:n(Kc,{filteredFields:an.value?[an.value]:void 0})}):void 0,ut=st&&lt?n(F,{direction:"block",gap:"base",children:[st,lt]}):st??lt,ct=n(Re,{tone:"info",children:P.translate("address_management.draft_order_delivery_address_reminder")}),dt=zn.value&&!jn.value||xn.value?null:p.value?n(i,{children:[In,ct]}):On.value?In:null,pt=on.value?{}:{primaryContent:kn.primary,secondaryContent:kn.secondary,compactContent:kn.compact,inlinePrimaryContent:_n,inlineSecondaryContent:Cn,compactPrimaryContent:Pn,compactSecondaryContent:An,summary:it},ht={buttonRef:Le,open:Te.value,id:Ie,label:P.translate("shipping.shipping_address_title"),error:dt,buttonAccessibilityLabel:ot,...pt,secondaryPersistentContent:ut,onToggle:et?void 0:Jn,disabled:ze.value||Qn||!Hn.value&&at,renderChildrenWhenCollapsed:!0,icon:n(X,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},mt=n(zs,{embedderErrors:re,onDismissEmbedderErrors:()=>oe([]),showMissingAddressField:on.value,onAddressDelegation:Xn,onFirstNamePersisted:mn,vatIdFieldMode:Ne});return n(i,{children:[H&&n(Yc,{}),l?l(ht,mt):n(co,{...ht,children:mt})]})}const od=({errorBanner:e})=>n(B,{paddingBlock:"small-500",children:e}),ld=({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(od,{errorBanner:t.element});case"unavailable-in-buyer-location-banner":return n(od,{errorBanner:n(Oi,{})});default:A(a)}};function sd(){const{formattedAddress:e,address:{phone:t,countryCode:a}}=nn(["company"]),r=!L().value,{errorSignal:o}=Uc({loading:r,phone:t,countryCode:a}),l=Boolean(jc()?.length),s=Boolean(tn()?.length),u=Boolean(o.value),c=Boolean(s||l||u);return n(rd,{summary:r?n(D,{}):n(F,{direction:"inline",children:[c&&n(i,{children:[n(X,{tone:"critical",type:"alert-circle"}),n(he,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:c})}function ud(e){const{checkout:{identity:a}}=rt(),i=function(){const{checkout:{negotiator:e}}=rt(),n=e.current.fields.buyerIdentity,a=an(),i=rn();return t(()=>Boolean(n.value?.purchasingCompany)&&(!a.value||i.value))}();return"amazonPay"===a.current.value||"buyWithPrime"===a.current.value?n(sd,{}):i.value?n(bc,{}):n(rd,{...e})}function cd(){const{i18n:e,router:i,checkout:{negotiator:r}}=rt(),o=r.current.fields.buyerIdentity.value?.purchasingCompany,l=Ol(),s=rn(),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(ee,{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(vo,{})})]})}function dd(){const{i18n:e}=rt(),{eligibility:t,redeemableBalance:a,messages:i,isDigitalGoodsRedemptionAllowed:r}=mc(),o=(t.eligible||r)&&a,l=i.length>0?n(F,{gap:"small-200",children:i}):void 0;return o||l?o?n(pd,{redeemableBalance:a,messages:l}):n(co,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:l}):null}function pd({redeemableBalance:e,messages:t}){const{i18n:a}=rt(),{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(co,{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 hd({onShowPickupLocations:e}={}){const{i18n:i}=rt(),r=ge(),[o]=on(),l=o.includes("PICK_UP"),{value:s}=ln().value,{value:u}=sn().value,c=Boolean(s||u),d=Ii({mode:"localPickup"}),p=t(()=>d.value.merchandiseLines),h=t(()=>d.value.allowAlternativeAction),m=t(()=>d.value.merchandiseLines.length>0),v=un(),y=c&&!m.value;if(!l||!r.value.delivery)return null;const g=m.value&&c;return n(Ti,{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(Ri,{bannerType:"pickup",merchandiseLines:p,allowAlternativeAction:h})}),n(md,{hasNoDeliveryMethods:c,onShowPickupLocations:e})]})})}function md({hasNoDeliveryMethods:e,onShowPickupLocations:r}){const{i18n:o}=rt(),l=un(),s=Ta(),{progressing:u}=fe(),c=Jt("deliveryNext").value,d=Ft(),{isOnlyCountryAvailable:p}=Ni(),h=y(!1),m=t(()=>s.value?.methods??[]),v=t(()=>{const e=s.value;return e&&Na(e)}),g=t(()=>m.value.length>0&&Li(m.value)),f=G(Y(La)),b=Di({allLocationsFarAway:g,selectedPickupOptionNoLongerAvailable:f}),_=cn({methods:m.value,selectedDeliveryMethodHandle:v.value?.handle}),C=t(()=>dn(s.value?.targetMerchandiseLines)),P=t(()=>Mi(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(Bi,{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,{inl
2ineSize:"base"}):n(x,{color:"subdued",children:P}),n(xi,{onClick:S})]}),r?null:n(Fi,{methods:s.value?.methods,type:s.value?.type,open:h.value,onClose:()=>{h.value=!1}})]})}const vd={isLocationFormVisible:!1};function yd({initiallyOpen:e=!1,renderRollup:a}){const{i18n:r,shop:o,checkout:{negotiator:l}}=rt(),{deliveryNext:s}=l.current.fields,{progressing:u}=fe(),c=Jt("deliveryNext"),d=Ft(),{value:p}=ln().value,{value:h}=sn().value,m=Boolean(p||h),v=Ta(),f=t(()=>Da(s.value)??[]),_=t(()=>o.shipPickupInOneOrderEnabled?v.value&&Na(v.value):f.value[0]),C=t(()=>_.value?.handle??""),P=t(()=>({handle:C.value})),S=Vi(),{isOnlyCountryAvailable:A}=Ni(),k=Ce(_.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),E=U("Checkout::PickupLocations::RenderBefore"),w=U("Checkout::PickupLocations::RenderAfter"),O=U("purchase.checkout.pickup-location-option-item.render-after"),I=E.length>0?n(pn,{customizations:E,options:vd}):void 0,R=w.length>0?n(pn,{customizations:w,options:vd}):void 0,T=Hi(),N=cn({methods:f.value||[],selectedDeliveryMethodHandle:_.value?.handle}),[L,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 G,Y,W,q,$;const K=T.value?n(F,{gap:"small-200",children:n(zi,{variant:"banner"})}):void 0;if(d.value&&!u.value&&c.value)G=n(D,{}),Y=n(D,{inlineSize:"base"}),W=n(D,{inlineSize:"small"}),$=K;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?ji(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();G=n(i,{children:[a,n(Wl,{}),s]}),Y=k||void 0;const c=l||u?n(Gi,{distanceLabel:l,instructions:u||void 0}):null,d=O.length>0?n(pn,{customizations:O,options:P.value}):null;W=c&&d?n(F,{gap:"small-400",children:[c,d]}):c??d??void 0,q=I?n(F,{gap:"small-200",children:I}):void 0,$=K||R?n(F,{gap:"small-200",children:[K,R]}):void 0}const X=!c.value&&!0===m,J=m?n(xi,{onClick:()=>{V(),N(A?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},commandFor:Ui}):void 0,Z=j.value?n(gd,{locationCount:z.value,onShowModal:V,onTrackAnalytics:()=>N("checkout_pickup_buyer_reveal_more")}):void 0,Q=a?{id:"pickupLocations",label:r.translate("delivery_options.pickup"),open:B.value,disabled:X||O.length>0,onToggle:()=>{B.value=!B.value},primaryContent:G,secondaryContent:Y,primaryPersistentContent:q,secondaryPersistentContent:R}:{id:"pickupLocations",label:r.translate("local_pickup.title"),open:X,primaryContent:G,secondaryContent:Y,tertiaryContent:W,primaryPersistentContent:q,secondaryPersistentContent:$,primaryAction:J,secondaryActions:Z},ee=n(js,{onShowModal:V}),ne=a?n(F,{gap:"base",children:[n(Gl.Provider,{value:!1,children:n(hd,{onShowPickupLocations:()=>V()})}),J,ee,Z]}):S&&ee;return n(i,{children:[a?a(Q,ne):n(co,{...Q,children:ne}),n(Fi,{methods:v.value?.methods,type:v.value?.type,open:L,onClose:()=>{M(!1),x.value=!1},addressFocus:x})]})}function gd({locationCount:e,onShowModal:i,onTrackAnalytics:r}){const{progressing:o}=fe(),l=Jt("deliveryNext"),s=ln(),u=t(()=>o.value||!l.value&&!s.value.loading);return n(a,{when:u,fallback:n(D,{}),children:n(fd,{locationCount:e,onShowModal:i,onTrackAnalytics:r})})}function fd({locationCount:e,onShowModal:t,onTrackAnalytics:a}){const{i18n:i}=rt();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 bd({destination:e}){const t=y(!1),a=y();return n(i,{children:[n("deliveryAddress"===e?ud:yd,{initiallyOpen:t.value,renderRollup:(e,n)=>(a.value={props:e,content:n},null)}),n(_d,{rollup:a,switched:t})]})}function _d({rollup:e,switched:t}){const a=e.value;return a?n(co,{...a.props,children:n(F,{gap:"base",children:[n(Cd,{switched:t}),a.content]}
2)}):null}function Cd({switched:e}){const t=hn();return t?n(Yi,{options:t.options,selected:t.selected,select:n=>{e.value=!0,t.select(n)},showChangedBanner:!1}):null}const Pd=new Set(["SHIPPING","PICK_UP"]);function Sd(){const{checkout:e,shop:n}=rt(),a=v(hn()),i=n.hasFlagEnabled(Ma);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})=>Pd.has(e))&&1===t.length&&Pd.has(t[0])}(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value))}const Ad=()=>{const{i18n:e,checkout:{negotiator:t}}=rt(),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(co,{open:a.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:r,onToggle:()=>a.value=!a.value,children:n(ts,{})})};function kd(){const{i18n:e,checkout:t}=rt(),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=Ce(c??void 0,{countryFormat:"explicit",displayName:u}),p=e.formatName(c?.firstName,c?.lastName,!0);if(o?.pickupAddress)return n(Ed,{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(co,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:m,secondaryContent:y})}function Ed({address:e}){const{i18n:t}=rt(),a=Ce(e,{hiddenFields:["postalCode","countryCode","phone"]}),i=a?n(x,{children:a}):void 0;return n(co,{id:"orderEditDeliveryAddress",label:t.translate("local_pickup.title"),primaryContent:i})}function wd(){const{i18n:e,checkout:t}=rt(),a=(t.proposal.facts.delivery??[])[0],i=a?.lines.filter(({deliveryChange:e,isFulfilled:n})=>"REMOVED"!==e&&!n).map(e=>n(mr,{line:e},e.title));return n(co,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:i})}function Od(){const{i18n:e,shopPay:n,checkout:a}=rt(),i=_t(),{paymentMethods:r}=a.negotiator.current.fields;return t(()=>function({i18n:e,shopPay:n,chargeAmount:t,numberOfPaymentTerms:a,installmentsUnavailable:i,paymentDue:r,installmentsConfig:o}){const l=rs(n),s=r?.currencyCode,u=o?.availableLoanTypes,c=t?e.formatCurrency(t,{currency:s,form:"short"}):void 0,{payNowLabel:d,payNowSubtitle:p}={payNowLabel:e.translate("installments.installments_pay_now"),payNowSubtitle:e.translate("installments.installments_pay_now_subtitle")},h=()=>2===a?e.translate("installments.pay_in_installments_subtitle.split_pay_2"):1===a?e.translate("installments.pay_in_installments_subtitle.split_pay_30"):e.translate("installments.pay_in_installments_subtitle.split_pay"),m="GBP"===s?e.translate("installments.pay_in_installments.gb"):"AUD"===s?e.translate("installments.pay_in_installments.au"):!i&&c&&u&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments.only_interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments.all"):u.includes("INTEREST")?e.translate("installments.pay_in_installments.only_interest"):(g=c,2===a?e.translate("installments.pay_in_installments.only_split_pay_2",{amount:g}):1===a?e.translate("installments.pay_in_installments.only_split_pay_30",{amount:g}):e.translate("installments.pay_in_installments.only_split_pay",{amount:g})):2===a?e.translate("installments.pay_in_installments_no_amount_2"):1===a?e.translate("installments.pay_in_installments_no_amount_30"):e.translate("installments.pay_in_installments_no_amount"),v="GBP"===s?!i&&u&&c&&0!==u.length?2===a?h():u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):u.includes("ZERO_PERCENT")&&u.includes("SPLIT_PAY")&&(6===a||12===a)?e.translate("installments.pay_in_installments_subt
2itle.split_pay_3_6z_12z_gb",{amount:c}):u.includes("ZERO_PERCENT")&&12===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:c}):u?.includes("ZERO_PERCENT")&&6===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.informational_gb"):e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:c}):e.translate("installments.pay_in_installments_subtitle.informational_gb"):u&&c&&0!==u.length?u.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments_subtitle.interest"):u.includes("INTEREST")&&u.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.all",{amount:c}):u.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.interest"):h():h(),y="SHOP_PAY"===l;var g;return{payNowLabel:d,payNowSubtitle:p,installmentsLabel:m,installmentsSubtitle:v,summary:"SHOP_PAY"===l?`${d} - ${p}`:`${m} - ${v}`,primaryLabel:y?d:m,secondaryLabel:y?p:v}}({i18n:e,shopPay:n,chargeAmount:a.installments.chargeAmount.value,numberOfPaymentTerms:a.installments.numberOfPaymentTerms.value,installmentsUnavailable:a.installments.isUnavailable.value,paymentDue:i.value,installmentsConfig:Ba(r.value)}))}function Id(){const{userEvents:e}=rt(),n=mn(xa.SHOP_PAY_PAY_NOW),t=mn(xa.SHOP_PAY_INSTALLMENTS),a=mn(xa.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=mn(xa.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:f(r=>{const o=function(){switch(r){case"payment_method_pay_now":return n;case"payment_method_installments":default:return t;case"default_payment_method_installments":return a;case"default_payment_method_pay_now":return i}}();return e.monorailEvent({schemaId:"retail_shop_pay/2.0",payload:o})},[e,n,t,a,i])}}function Rd({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:i,shop:r,observability:o,userEvents:l,shopPay:u,embed:c}=rt(),{visibility:d}=u,p=i.installments.isSupported.value,h=i.installments.isUnavailable.value,m=vn(),v=rs(u),{paymentMethods:y}=i.negotiator.current.fields,f=t(()=>
2Ba(y.value)),b=p?f.value?.availableLoanTypes:void 0,_=g(),C=ml(),P=u.user.installments.isRetryable.value,{recordRetailEvent:S}=Id();s(()=>{n&&!P&&"SHOPIFY_INSTALLMENTS"===v&&u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})},[P,n,v,u.session]),s(()=>{u.session.isInternalProgressing.value||p&&!h&&(!m.value&&d.showAutoExpandedPaymentMethods&&e?.(),C.value.spiPreselected&&(u.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),o.leaveErrorBreadcrumb("SPI preselected",{})))},[p,h,m.value,C.value.spiPreselected,u.session,o,d.showAutoExpandedPaymentMethods,e]),s(()=>{m.value&&p&&S(h?"default_payment_method_pay_now":"default_payment_method_installments")},[p,h,m.value,S]),s(()=>{!h&&b&&JSON.stringify(_.current)!==JSON.stringify(b)&&(l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...sl(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Fa.InterestEligibility,success:Va(b),errorMessage:Va(b)?void 0:JSON.stringify(["amount"])}}),l.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...sl(a,i,r,{embedPlatform:c?.platform,shopAppSurface:u.app.config.surface}),eventType:Fa.SplitPayEligibility,success:Boolean(b.includes("SPLIT_PAY")),errorMessage:b.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),_.current=b)},[b,h,l,a,i,r,c?.platform,u.app.config.surface])}function Td(){const{i18n:e}=rt(),t=y(!1),a=Od(),i=yn(),r=f(()=>{t.value=!t.value},[t]);return Rd({onAutoExpand:f(()=>{t.value=!0},[t]),ineligibilityReasonLabel:i}),n(co,{open:t.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:r,children:n(Us,{ineligibilityReason:i})})}function Nd(){const{i18n:e}=rt();return n(co,{label:e.translate("pickup_point.title"),open:!0,children:n(gn,{rowsInset:!0,children:n(Wi,{heading:"none"})})})}function Ld(){const{userEvents:e,shop:n,source:t,checkout:a}=rt();return{trackOnDeliveryToggle:f(i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...At(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:{...At(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 Dd=o({displayName:"ShippingGroupsSummary",load:()=>p(()=>e(()=>import("./17a5f1e4.Bq-QRkFq.js"),__vite__mapDeps([129,1,2,3,4,5,6,7,8,9,10,11,12,96,97,98,130,83,21,22,18,23,19,24,66,43,67,68,69,70,71,41,42,44,45,46,47,48,49,50,51,72,40,73,74,75,76,77,78,79,80,81,82,84,85,86,56,87,88,89,99,100,101,30,31,32,102,103,104,105,106,13,14,15,16,17,20,25,26,27,28,29,33,34,37,38,39,107,108,57,109,110,111,90,112,54,113,114,115,116,117,118,94,95,119,120,121,122,62,123,61,124,125]))),renderLoading:()=>n(D,{})});function Md({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:o}=rt(),{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}=_n(t,l||[],Boolean(h||c));return n(F,{gap:"small-400",children:n(B,{children:[n(ds,{methodTitle:Cn({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(ps,{cost:o,costAfterDiscounts:u,inlineDiscount:!0})}),a?n(Q,{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=fn(e.targetMerchandiseLines??[]);return a.slice(0,1).map(i=>n(ee,{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(bn,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(os,{merchandiseItem:i,hideBadge:!0})),u(e)]},i.id))})})}function Bd({deliveryNextValue:e}){const t=ja(e).filter(Pn);return t.length?n(ee,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(Md,{lines:t,hideThumbnail:1===t.length})}):null}function xd({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 Fd(){const{i18n:e,checkout:{identity:{current:t}}}=rt(),a=t.value,i="amazonPay"===a||"buyWithPrime"===a;return!L().value&&i?n(co,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:n(D,{})}):n(Vd,{})}function Vd(){const{embed:e,i18n:a,checkout:r}=rt(),o=ls(),{hasMultipleDeliveryGroups:l}=o.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:u}=ss({hasMultipleDeliveryGroups:l,targeted:!1,shouldHandleRollup:!0}).value,c=U("Checkout::ShippingMethodDetails::RenderAfter"),d=U("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=Aa(Qe),m=G(Y(Ua)),y=Zc(),g=G(Sn(Ga)),b=t(()=>y.value&&g.value),_=un(),C=wo([...u,...c,...d],{lazyReveal:!0}),P="shippingMethod",S=Ks(P,C.peek()),A=v(Ys(ka([...u,...c,...d],"uiExtension").map(Mt),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=Ya(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}=Ld(),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")}
2;default:return}}({i18n:a,identity:r.identity}),T=function({state:e,addressInvalidMessage:t,addressIncompleteMessage:a}){const{i18n:r,checkout:{negotiator:o}}=rt(),l=o.current.fields.deliveryNext,s=Jt("deliveryNext"),{deliveryExpectationLines:u}=cs(),{rollup:{secondaryContent:{typography:{color:c}={}}={}}={}}=me(),d=un(),p=c??"base",h="filled"===e.status?e.deliveryLines:void 0,m=ql({deliveryLines:h}),v=G(j(Ha)).value,y=G(j(fa)).value,g=n(F,{children:[n(D,{inlineSize:"base",size:"small"}),n(D,{inlineSize:"small",size:"extraSmall"})]});if("initial"===e.status||"loading"===e.status)return{compactPrimaryContent:n(D,{inlineSize:"base",size:"small"}),compactSecondaryContent:void 0,inlinePrimaryContent:g,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};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(za(l.value,d.value)){if(s.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:g,secondaryContent:void 0};let e=n(Dd,{});return m?e=n(Kl,{summary:m}):d.value&&(e=n(Bd,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:m?n($l,{summary:m,secondaryContentColor:p}):void 0}}const f=d.value?e.deliveryLines.filter(Pn):e.deliveryLines,b=_o(f);if(!b)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:_,cost:C,hideDiscountedTotalOnShippingSelector:P}=b,S=Cn({deliveryMethod:b,localDelivery:"LOCAL"===b.methodType?r.translate("shipping.local_delivery"):void 0}),A=u?.find(e=>e.deliveryStrategyHandle===b.handle),k=n(ds,{methodTitle:S,showInterpunct:!0,price:C&&_?n(xd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P}):void 0}),E=n(hs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c??"base"});return{compactPrimaryContent:n(x,{type:"strong",children:n(ds,{methodTitle:S})}),compactSecondaryContent:n(i,{children:[n(hs,{deliveryMethod:b,deliveryExpectationLine:A,paragraphColor:c,formatContent:e=>e?n(F,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",e,")"]}):null}),n(x,{color:c,children:n(xd,{cost:C,costAfterDiscounts:_,hideDiscountedTotalOnShippingSelector:P,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:k,inlineSecondaryContent:E,primaryContent:k,secondaryContent:E}}({state:p.value,addressIncompleteMessage:R?.addressIncompleteMessage,addressInvalidMessage:R?.addressInvalidMessage}),N=(()=>{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 Wa(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 L=t(()=>("error"===p.value.status||"empty"===p.value.status)&&!(C.value||A.value));return h(()=>{L.value&&(S.value=!1)}),n(co,{open:S.value,id:P,label:a.translate("shipping.title"),primaryContent:N.primary,secondaryContent:N.secondary,compactContent:N.compact,onToggle:s&&"empty"===p.value.status||L.value?void 0:E,renderChildrenWhenCollapsed:!0,icon:n(X,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(Vs,{singleDeliveryGroup:o})})}const Hd={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},zd={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},jd={SHIPPING:{id:"shippingMerchandiseList"},PICK_UP:{id:"pickupMerchandiseList"}};function Ud({selectedDeliveryMethodType:e}){const{i18n:i}=rt(),r=un(),{showOverlay:o}=An(),l=y(!1),s=jd[e],u=qi(e),{visibleSummary:c,isNegotiating:d}=$i(u),p=Ft(),{shouldOpenModal:h}=Ki(),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(bn,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(h.value)return n(lo,{theme:Hd,children:n(co,{id:s.id,label:v,thumbnail:f,onClick:()=>o(Xi),primaryContent:g})});const b=l.value||r.value;return n(lo,{theme:b?zd:Hd,children:n(co,{id:s.id,label:v,thumbnail:f,open:b,onToggle:b?void 0:()=>{l.value=!l.value},primaryContent:g,children:n(Ji,{title:"PICK_UP"===e?i.translate("split_delivery.items_for_pickup"):i.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Gd(){const{rollup:e}=me(),{padding:t}=ni({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(B,{padding:t,children:n(cd,{})})}function Yd({hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r}){const o=ge(),{negotiate:l}=fe(),{checkout:u,embed:c,source:d}=rt(),p=Zi(),h=t(()=>o.value.delivery&&u.isShippingRequired.value),m=t(()=>h.value&&p.value),v=qa({checkout:u}),y=t(()=>o.value.contact&&u.configuration.showContactInformation),g=[...t(()=>ai({isContactVaulted:o.value.contact,configuration:u.configuration,identity:u.identity,embed:c})).value?[n(zc,{},"contact")]:[],...h.value?[n(ud,{},"delivery")]:[],...function(e){if(xt(d))return o.value.payment?[n(Ou,{},"payment")]:[];const t=[];return v&&t.push(n(_c,{isAbovePaymentSummary:!0},"businessCustomerBilling")),o.value.payment&&(t.push(n(Ou,{},"payment")),e.configuration.visibility.showCashRedemption.value&&t.push(n(yc,{},"cashRedemption")),o.value.billing&&!v&&t.push(n(_c,{},"billingAddress"))),t}(u)],f=g.length>0||y.value;var b;return s(()=>{b&&Bs().catch(()=>{})},[b=f]),function({hasSections:e,identity:n,wallets:t,negotiate:a}){s(()=>{e&&function({identity:e,wallets:n}){return"amazonPay"!==e.current.value&&"buyWithPrime"!==e.current.value&&!n.activeSession.value}({identity:n,wallets:t})&&a({silenceViolations:["all"]})},[])}({hasSections:f,identity:u.identity,wallets:u.wallets,negotiate:l}),0===g.length?null:n(B,{children:[n(Ds,{children:n(qd,{hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r})}),n(a,{when:()=>o.value.payment,children:n(Hu,{})}),n(a,{when:m,children:n(Qi,{})})]})}function Wd({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:o}=rt(),l=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,ge().value.payment),{vaulted:{spacing:s="none",cornerRadius:u,divider:{borderWidth:c="base",borderStyle:d="base",borderColor:p,visibility:h="visible"}={}}={}}
2=me(),{main:{section:m}}=ye(),{rendered:v}=wn(),y=o.hasFlagEnabled(la),g=!l&&!ns(t),f=v?.padding,{blockStart:b,blockEnd:_}=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:$d(n),blockEnd:$d(t)}}(y?void 0:f);return 0===e.length?null:n("div",{className:P("K6vpG",ns(a)&&"CU3YS",g&&"_5HWz9",b&&"r8rqQ",(_||i)&&"_2Ojsq"),style:Kd({spacing:s,borderWidth:c,borderStyle:d,borderColor:p??"base",visibility:h,cornerRadius:m?.cornerRadius??u}),children:e})}function qd({hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a}){const r=function(){const e=ge(),{checkout:t,shop:a,embed:r,i18n:o,source:l}=rt(),{identity:s,identity:{current:c}}=t,d=c.value,p=a.hasFlagEnabled(Ma),h=a.hasFlagEnabled(la),m=kn(),v=En(),y=qa({checkout:t}),g=m.value&&!v.value,f=un(),b=Zi(),_=void 0!==Ta().value,C=Jt("deliveryNext"),P=Ft(),{deliveryLines:A}=t.negotiator.parts,k=$a(A.value??[]).filter(e=>e.requiresShipping).length>0,w=qi("PICK_UP").value.length>0,O=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isDigitalGoodsRedemptionAllowed:r}=vc(),o=$u();if((e.eligible||r)&&t)return!0;const l=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!l&&!s)||!!Qo.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?Ka:Xa,T=R[d]??R.default,N=Sd(),L=e=>!N.value||"deliveryAddress"!==e&&"localPickupOptions"!==e?e:"deliveryDestination",D=e=>{switch(e){case"contact":return n(zc,{},e);case"businessCustomerSingleChoice":return n(bc,{},e);case"orderEditDeliveryAddress":return n(kd,{},e);case"orderEditShippingMethod":return n(wd,{},e);case"deliveryAddress":return N.value?n(bd,{destination:e}):n(ud,{},e);case"shippingMerchandiseList":return n(Ud,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(Fd,{},e);case"pickupMerchandiseList":return n(Ud,{selectedDeliveryMethodType:"PICK_UP"},e);case"localPickupOptions":return N.value?n(bd,{destination:e}):n(yd,{},e);case"pickupPoint":return n(Nd,{},e);case"dutyOptions":return n(Ad,{},e);case"paymentOptions":return n(Td,{},e);case"payment":return n(Ou,{},e);case"billing":return n(_c,{isAbovePaymentSummary:y},e);case"cashRedemption":return n(dd,{},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:Ja(Za(T.filter(e=>Qa[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&&ei.has(l)?(!x&&t.configuration.visibility.showDeliveryHeading.value&&(a.push(n(h?Gd:cd,{},"deliveryHeading")),x=!0),a.push(n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ti,{name:o,children:e})},L(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}})}(),o=un();if(0===r.length)return null;const l=r.length>1&&o.value;return n(i,{children:l?n(F,{gap:"large-200",children:r.map(({groupId:o,header:l,elements:s},u)=>{const c=0===u,d=u===r.length-1,p=n(io,{hideDivider:"always",children:n(Wd,{sections:s,hideLastDivider:!d||ns(e),showTopDivider:c&&ns(t),stripBlockEndPadding:d&&a})});return l?n(F,{gap:"base",children:[l,p]},o):n(i,{children:p},o)})}):n(Wd,{sections:r.flatMap(e=>e.elements),hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a})})}function $d(e){return null!=e&&"none"!==e}function Kd({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const o=Xd[e],l={none:"0px",...ti.borderWidth},s={base:ti.color.default.border,transparent:"transparent"},u="hidden"===i?"0px":l[n];return{"--vaulted-divider-width":u,"--vaulted-divider-style":Jd[t],"--vaulted-divider-color":s[a],"--vaulted-spacing":o,"--divider-offset":`calc((${o} + calc(${u} * 2)) / 2)`,"--vaulted-corner-radius":r?ti.borderRadius[r]:void 0}}const Xd={none:"0px",...ti.spacing},Jd={base:"solid",dashed:"dashed",dotted:"dotted"};function Zd(){const{methods:e}=On(),{userEvents:n,shop:t,source:a,checkout:i}=rt(),r="shopPay"===i.identity.current.value;h(()=>
2{if(r)for(const r of e.value)m(()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}}))})}function Qd(){Zd();const{shop:e,i18n:t,checkout:a}=rt(),i=hn(),r=Sd(),o=!e.hasFlagEnabled(ii),l=!a.configuration.visibility.showDeliveryHeading.value&&!o;if(!i)return null;if(r.value)return n(er,{});const s=t.translate("shipping.delivery_title");return n(Gl.Provider,{value:!0,children:n(jo,{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(nr,{})]})})})})}function ep(){const{source:e}=rt(),t=ge(),a=In(),r=hn(),o=Sd();return xt(e)||!t.value.delivery?null:n(i,{children:[n(Qd,{}),a.value&&r&&!o.value?n(he,{blockSize:"base"}):null]})}function np({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:o}=rt(),{current:l}=a.identity,s=ge(),u=ri(),c=ms();return t(()=>oi({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(tp,{vaultedContactTypeOverride:"sdkCartHints"===l.value?"base":void 0})}function tp({vaultedContactTypeOverride:e}){const t=xc();Fc(t);const r=y(!1),o=Ft(),{embed:l}=rt(),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(Hc,{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(Ei,{email:t.email??"",open:r.value,showPopover:e=>{r.value=e}})})]})}function ap({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:o}=rt(),l=Sd(),{rollup:{inlinePadding:s}}=me(),u=n(i,{children:[n(np,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(ep,{})}),n(a,{when:()=>!l.value,children:n(hd,{})})]}),c=zt(r?.embedder);if(o.hasFlagEnabled(la)){if(!c&&!t?.value)return u;const{padding:e}=ni({padding:["none",s??"base"]});return n(B,{padding:e,children:u})}const d=c?`none ${Ut(s)??"none"}`:void 0;return c?n(B,{padding:d,children:u}):u}const ip=(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 rp(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const op=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:i=!0})=>{const r=Gu({enabled:i}),o=Ju({enabled:i}),{recordRedemptionAutomaticallyApplied:l,recordRedemptionAutomaticallyRemoved:c}=uc(),d=g(),p=$u();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=rt().shopPay,r=function(e,n){const a=v(e),i=v(n),r=$u(),{checkout:{negotiator:o}}=rt(),{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(rp(s.value,i,o,t.has("shopPromotion")))return!0;if(d?.length){if(n?!ip(a,d):i||c)return!0}else if(i)return!0}const p=l.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(rp(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?!ip(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:()=>
2{d.current=y,Object.entries(y).forEach(([e,n])=>{(n?l:c)(e,"useApplyAutomaticRedemptions")})}}):d.current=void 0},[i,r,y])};function lp({active:e,ready:t}){const{i18n:a}=rt(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(B,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const sp=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(Oe,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p(()=>e(()=>import("./7aefefff.CKGwXfaV.js"),__vite__mapDeps([131,1,2,3,4,5,6,7,8,9,10,11,12,132,133,134,135,136,41,42,43,44,45,46,47,18,48,49,50,22,23,19,51,36,27,37,38,39,40,13,14,15,16,17,20,21,24,25,26,28,29,30,31,32,33,34,52,53,54,55,56,57,58,59,137,138,139,82,140,99,100,101,74,75,102,103,104,67,68,105,106,141,77,142,143,144,145,146,147,148,149,73,76,150,151,152,153,154,155,87,88,109,156,108,64,65,66,69,70,71,72,78,79,80,81,83,84,85,86,89,61,90,91,92,107,110,111,112,113,96,97,98,114,115,116,117,118,94,95,119,120,121,122,62,123,124,125,157]))),renderError(e){throw e}});function up({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=rt(),{progress:r}=fe(),o=ys(),l=f(()=>{r("one-page-form-submit",void 0,{skipToCompletion:o.value})},[r,o]),s=vr(l);return n(Rn,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function cp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:o},negotiator:l}}=rt(),{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(Nn,{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(Q,{children:i.translate("stock.price_update.description")}),n(B,{children:n(fs,{loading:e,lineItems:t,type:Tn.PriceChange})}),n(F,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[d,c]})]})})}function dp(e){return e.some(e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code)}function pp(){const{checkout:{wallets:e,negotiator:i}}=rt(),r=function(){const{checkout:{negotiator:e}}=rt(),n=Jt("merchandiseLines"),a=e.parts.merchandiseLines,i=y(m(()=>a.value));return t(()=>{const t=e.current.fields.allViolations.value,a=dp(t??[]),r=e.current.fields.merchandiseLines.value,o=n.value,l=r?.lines??[],s=i.value,u=Ln(s,l,t,Dn).map(({proposed:e,negotiated:n})=>({line:e??n,problem:{type:Tn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}}));return{hasViolation:a,loading:o,lineItems:u,updateProposal:()=>{u.length>0&&(i.value=l)}}})}(),o=Mn(),l=g(!1),s=t(()=>i.current.fields.allViolations.value?.some(e=>li.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(cp,{loading:e.loading,lineItems:e.lineItems,onClose:d})})}function hp(){const{i18n:e,shop:t}=rt(),a=Bn(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 mp(){const{checkout:e,embed:a,shopPay:r}=rt(),o=gs(),l=ys(),s=ge(),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(Jl,{isVaultedReview:!0}):null,u?n(hp,{}):null,h&&!c?n(he,{blockSize:"base"}):null]}):null}function vp(){const{embed:e}=rt();return t=>!e?.isFlagshipPartner||zt(e.embedder)||Gt({embedder:e.embedder})?t:n(gn,{children:t})}function yp({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:i,aboveFoldSpacing:r,paddingBlockStart:o,children:l}){const s=tr(),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(de,{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(ar,{origin:"payment_page"})}),n(a,{when:u,children:n(ir,{})})]}),l]})})})}function gp({extensions:e,hideDivider:t="always"}){const a=vp();return n(pn,{gap:"base",customizations:ns(e),render:(e,i)=>i?a(n(io,{hideDivider:t,children:e})):e})}function fp(e){const{i18n:n}=rt(),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(!si(e))return[];const a=ja(e);return function(e,n){const t=(n||[]).filter(ui).map(Ql);return es(t).filter(e=>e.length>0).map(n=>function(e,n){return{...ci(e)??e[0],title:hi(e,n),cost:pi(e),costAfterDiscounts:di(e)}}(n,e))}({businessDays:e=>n.translate("shipping.estimated_delivery_date",{count:e}),businessDaysRange:(e,t)=>
2n.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 bp(){const{shopPay:e,checkout:{negotiator:n}}=rt(),{value:t}=n.current.fields.deliveryNext,a=Jt("deliveryNext").value,i=mi(t,"ONE_TIME_PURCHASE",!0),r=u(()=>i&&"available"===i.status?i.methods:[],[i]),o=fp(t),l=si(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=as(m);return{methodsByType:c,availableDeliveryMethods:l,availableDeliveryMethodsLoading:d,progressiveShippingRatesLoading:v}}function _p({onChange:e,prerequisitesLoading:n}){const{checkout:{negotiator:t}}=rt(),{value:a}=t.current.fields.deliveryNext,i=Jt("deliveryNext").value,r=mi(a,"ONE_TIME_PURCHASE",!0),o=fp(a),[l]=xn({type:r?.type}),c=u(()=>{if(!n&&!i&&l&&null!=r&&"available"===r.status)return si(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 Cp(){const{i18n:e}=rt(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=bp(),a=n&&!t,{selectedDeliveryMethod:i}=_p({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 $({content:r})},[r]),null}function Pp(){return Fn("ONE_TIME_PURCHASE")?n(Cp,{}):null}function Sp({includeContact:e=!0}={}){const n=ge(),a=v(U("Checkout::Dynamic::Render","INFORMATION1")),i=v(U("Checkout::Dynamic::Render","INFORMATION2")),r=v(U("Checkout::Dynamic::Render","DELIVERY1")),o=v(U("Checkout::Dynamic::Render","DELIVERY2")),l=v(U("Checkout::Dynamic::Render","PAYMENT1")),s=v(U("Checkout::Dynamic::Render","PAYMENT2")),u=v(U("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&&Mt(e)===Mt(t)}))?p:(c.current=d,d);var h,m})}const Ap=[yr.Button,gr.Button,fr.StickyFooter,br.Wrapper];function kp(){const{shopPay:e,checkout:t}=rt(),[a]=Vn("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(qc,{}):null}const Ep="contact";function wp({loginLink:e,title:a}){const{router:i}=rt(),r=t(()=>$s(i,Ep));return n("div",{className:"cHj7X",children:[n(E,{id:Ep,level:1,autoFocus:r.value,children:a}),e]})}function Op(){const{client:e,i18n:t,source:i}
2=rt(),r=Hn(),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")})})}Op.displayName="LoginLink";const Ip=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:o}=rt();return n(R,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...At(a,i,r),action:"click_shop_pay_sign_in"}}),o.session.unstable_updateVerificationTrigger({source:bs.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function Rp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:o,validation:{contactErrors:{emailInputError:l}}},shopPay:u}=rt(),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(wp,{title:r.translate("contact.contact_method_title")}),n(he,{blockSize:"base"}),n(np,{placement:"standalone-vaulted"})]}:{children:[c&&n(i,{children:[n(Ml,{color:"branded"}),n(he,{blockSize:"base"})]}),n(wp,{title:r.translate("contact.contact_method_title"),loginLink:n(Tp,{})})]}),n(he,{blockSize:"base"}),n(ki,{hideAllOptIns:c&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:h}),c&&!a&&n(kp,{})]})}function Tp(){const{checkout:{identity:e}}=rt(),t=Co();return"shopPay"!==e.current.value?n(Op,{}):t===fi.UnauthenticatedCheckout?n(Ip,{}):null}const Np=k(function({showForm:e=!0,identityPresentation:t="form",showEmailMarketingOptIn:a}){const r=U("Checkout::Contact::RenderAfter"),o=U("Checkout::Dynamic::Render","INFORMATION1"),l=U("Checkout::Dynamic::Render","INFORMATION2");return n(i,{children:[o.length?n(i,{children:n(pn,{customizations:o,gap:"base",marginBlockEnd:"large300"})}):null,e?n(zl,{impressionType:"contact",impressionFeatures:[],children:[n(Rp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(pn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(pn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(pn,{customizations:r,marginBlockStart:"base"})}):null,l.length?n(i,{children:n(pn,{customizations:l,gap:"large-200",marginBlockStart:"large300"})}):null]})]})});function Lp(){const{checkout:{identity:e},i18n:t}=rt(),{violations:a}=Y(ca),{violations:i}=Y(ba),r=G(j(bi)).value,o=G({violations:a}).value,l=G({violations:i}).value;if(o&&Dp({identity:e}))return n(rr,{});if(r)return n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ai,{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(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Pe,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:V.DeliveryError,children:s})})}const Dp=({identity:e})=>"shopPay"===e.current.value,Mp=[{handle:"first"},{handle:"second"}];function Bp(){const{i18n:e}=rt(),{shippableDeliveryLines:t}=zn().value,a=t?.[0]?.methods||Mp;return n(kl,{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(zo,{value:t,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:n(Oe,{inlineSize:"5ch"}
2),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(jn,{content:a,size:"small"}):null]})},t)})})}function xp(){const e=rt();return n(wl,{children:n(El,{children:Fp(e)})})}function Fp({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 Vp=k(function(){const{uiStateSignal:e,initialUiStateSignal:t}=Aa(Qe),a=Ft(),i=a.value?e.value:t.value,r=Zc(),o=G(Sn(Ga)),l=r.value&&o.value,s=G(Y(zp)).value,u=a.value&&s&&!l&&"error"!==i.status,c=u?n(jp,{}):null,d=(()=>{switch(i.status){case"initial":case"empty":return n(xp,{});case"loading":return n(Bp,{});case"error":return n(Lp,{});case"filled":{const e=_i(i.deliveryLines).filter(Pn),t=e.flatMap(({methods:e})=>e.map(({title:e})=>e));return n(zl,{impressionType:"shipping_methods",impressionFeatures:t,children:n(Hp,{lines:e,showErrorBanner:l,deliveryChangedBannerOwnedBySection:u})})}}})();return n(F,{gap:"base",children:[c,d]})});function Hp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=Mn(),o=Un(),[,l]=b(),u=as(l),c=function({checkout:e}){return"shopPay"===e.identity.current.value?Up:i}(rt());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(is,{lines:e,loading:u,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}Vp.displayName="OnePageShippingMethods";const zp=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function jp(){const{i18n:e}=rt();return n(Pe,{tone:"warning",errorType:V.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function Up(){const{trackSelectShippingMethod:e}=Ld(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=bp();return _p({onChange:e,prerequisitesLoading:n||n&&!t}),null}function Gp(){const{checkout:e,i18n:t}=rt(),a=e.addressManager.shipping.value,i=Al("shipping"),{shouldGateCrossBorder:r,crossBorderGate:o}=jl(),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(ee,{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 Yp(){Zd();const e=hn(),t=e?.options.value.some(e=>"PICKUP_POINT"===e.id)??!1,i=Zi();return n(F,{gap:"large-300",children:[t&&n(Wi.Prefetch,{}),n(nr,{}),n(Ti,{name:"delivery-methods",children:n(Wp,{})}),n(a,{when:i,children:n(Qi,{})})]})}function Wp(){const{methods:e}=On(),{i18n:i,router:r,checkout:{wallets:o,identity:l,negotiator:s}}=rt(),c=Gn(),{deliveryNext:d,optionalDuties:p}=s.current.fields,h=us(),m=Ze(),{shippingAddress:v}=s.parts;Yn(v,()=>{m&&m.taxId.reset()});const y=U("Checkout::DeliveryAddress::RenderBefore"),g=U("purchase.checkout.delivery-address.render-after"),b=ls(),{hasMultipleDeliveryGroups:_,onlyDeliveryGroupType:C}=b.value,{customizationsBefore:P,customizationsAfter:S}=ss({hasMultipleDeliveryGroups:_,targeted:!1}).value,A=t(()=>za(d.value,!0)||h.value.showShipmentBreakdown).value,k=A?"small-400":"base",w=Mn(),O=Un(),{negotiate:I}=fe(),R=f(({shipping:e})=>{o.activeSession.value||I({fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address",...Ci],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},[]),N=e=>n(qn,{padding:A?"small-400 none":void 0,children:e}),L=u(()=>({groupType:C&&As(C),includeDeliverySelectionGroups:!1}),[C]),D=tr(),M=t(()=>D.value.isDelivery),x=un(),V=Zi(),H=t(()=>!!x.value&&(e.value.includes("PICK_UP")&&e.value.includes("SHIPPING"))),z="shippingMethod",j=t(()=>$s(r,z)),G=n(Wn,{sectionId:"localPickup",children:n(F,{gap:"small",children:[n(a,{when:H,children:n(E,{level:2,children:i.translate("delivery_options.pickup")})}),n(or,{})]})}
2),Y=n(Wn,{sectionId:"shipping",children:[n(qn,{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(Q,{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(lr,{selectedDeliveryMethodType:"SHIPPING"})})})}),n(pn,{customizations:y}),n(F,{gap:"large-300",children:[n(Cs,{children:n(go,{onValid:R,onInvalid:T,children:n(Kc,{children:[qp({identity:l})&&n(Gp,{}),n(sr,{}),n(a,{when:M,children:n(ir,{})}),m&&n(ur,{taxId:m.taxId,applied:m.applied})]})})}),n(pn,{customizations:g}),n(F,{gap:k,children:[n(E,{id:z,level:2,autoFocus:j.value,children:i.translate("shipping.shipping_method_title")}),n($n,{children:[n(a,{when:()=>h.value.showShipmentBreakdown,children:n(_s,{children:[n(Ss,{}),n(he,{blockSize:"small-200"})]})}),Il("shipping.shipping_method_notice",i)?n(Q,{children:i.translate("shipping.shipping_method_notice")}):null,n(pn,{customizations:P,options:L,render:N}),n(_s,{children:[n(Vp,{}),n(Ps.Preload,{})]}),n(pn,{customizations:S,options:L,render:N})]})]})]})]})}),n(a,{when:()=>p.value?.refuseDutiesPermitted,children:n(qn,{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(ts,{})]})})})]}),W=t(()=>e.value.includes("PICKUP_POINT")),q=t(()=>e.value.includes("PICK_UP"));return n(a,{when:H,fallback:n(a,{when:()=>W.value||q.value,fallback:Y,children:n(a,{when:W,fallback:G,children:n(Wn,{sectionId:"pickupPoints",children:n(Wi,{})})})}),children:n(F,{gap:"large-300",children:[G,Y]})})}function qp({identity:e}){return"customerAccount"===e.current.value}const $p=k(function(){const{shop:e,i18n:i}=rt(),r=U("Checkout::Dynamic::Render","DELIVERY1"),o=hn(),l=ge(),s=e.hasFlagEnabled(ii),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(cd,{})})}),n(Oi,{}),n(Yp,{}),n(pn,{customizations:r})]})})}),Kp=o({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p(()=>e(async()=>{const{MobileOrderSummary:e}=await(import("./d2e6a587.D5dE5VhU.js"));return{MobileOrderSummary:e}},__vite__mapDeps([155,1,3,4,5,6,2,7,8,9,10,11,12,87,88,147,148,109,104,156])).then(({MobileOrderSummary:e})=>({default:e}))),renderError(e){throw e}}),Xp="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&sp.preload();const Jp=Ap,Zp=k(function(){return(()=>{const{embed:e,checkout:{identity:n},shop:t}=rt(),a="shopPay"===n.current.value&&zt(e?.embedder),i=t.hasFlagEnabled(Yt),r=Ru(),o=Lu().value;op({enabled:a,discountOffer:a?r.value:null,shopPromotionDiscounts:void 0,eligibility:o}),dc([{eligibility:o,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:a,retryOnReady:i}),cc({enabled:a,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})})(),(()=>{const{checkout:e,embed:n,shop:t,source:a}=rt(),i=ge(),r="shopPay"===e.identity.current.value&&!zt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&xt(a)),o=t.hasFlagEnabled(Yt),l=Ru(),s=sc(),u=Lu().value;op({enabled:r,discountOffer:r?l.value:null,shopPromotionDiscounts:r?s.value:null,eligibility:u}),dc([{eligibility:u,redemptionTypes:["SHOP_DISCOUNT_OFFER","SHOP_PROMOTION"]}],{enabled:r&&o,retryOnReady:!0})})(),null});function Qp({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:a,children:i}){const r=t(()=>!e.value);return a?n(so,{target:e.value?"edgeToEdge":"vaulted",children:i}):n(uo,{target:"vaulted",condition:r,children:i})}const eh=k(function({children:e}){const{checkout:i,embed:r,environment:o,i18n:l,observability:u,shop:c,shopPay:d,source:p}=rt(),h="VISIBLE"===i.configuration.headerText?.visibility,m=y(!1),g=f(()=>{m.value||(m.value=!0,void 0!==Xp&&u.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-Xp),unit:"ms",attributes:{buildId:o.commitSha}}))},[o.commitSha,m,u]),b=Ft(),_=c.hasFlagEnabled(la),C=Gt({embedder:r?.embedder}),P="google"===r?.embedder&&C,S=ge(),A=_r(),k=t(()=>S.value.payment&&A.value),E=v(hn()),w=Kn(),O=t(()=>S.value.payment&&c.acceptTipPayments&&(w?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips),I=v(on()[0]),{postPurchaseEnabled:R}=vs(),T=t(()=>i.negotiator.current.fields.buyerIdentity.value?.customerProfile),N=Xn(),L=t(()=>P&&N.value),D=un(),M=t(()=>S.value.contact&&i.configuration.showContactInformation||S.value.delivery&&i.isShippingRequired.value||S.value.payment),x=t(()=>S.value.delivery&&i.isShippingRequired.value||S.value.payment),V=t(()=>D.value&&M.value),H=ri(),z=ms(),j=t(()=>oi({configuration:i.configuration,identity:i.identity,shop:c,shopPay:d,embed:r,vaultedSections:S.value,isShippingRequired:i.isShippingRequired.value,hasSellingPlan:H.value,phoneCountryCode:z.value})),G=t(()=>"standalone-form"===j.value),Y=t(()=>"standalone-vaulted"===j.value),W=t(()=>"vaulted-adjacent"===j.value),q=t(()=>G.value||Y.value);!function(){const{negotiate:e}=fe(),{observability:n,checkout:t}=rt(),a=t.negotiator.current.fields.buyerIdentity,i=t.negotiator.parts.shippingAddress.value,r=t.negotiator.parts.billingAddress.value,{value:o=[]}=t.negotiator.current.fields.allViolations,l=vi(o),u=dp(o),c=t.isShippingRequired.value?i.countryCode:r.countryCode,d=a?.value?.countryCode,p=JSON.stringify(a?.value,(e,n)=>void 0===n?null:n);s(()=>{l||u||d&&c!==d&&(n.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:c,buyerIdentityCountryCode:d,buyerIdentity:p}),e({silenceViolations:["all"]}))},[])}();const $=v(Jn({base:!0,medium:!1})),K=t(()=>!b.value||($.value??!1)),X=cr(),J=t(()=>"hidden"!==X.value),Z=v(U("Checkout::Contact::RenderAfter")),Q=function(){const{checkout:e,shop:n,source:a}=rt(),{email:i}=e.negotiator.parts,r=ge(),{buyerIdentity:o}=e.negotiator.current.fields,l=n.hasFlagEnabled(yi);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&&!gi(t?.countryCode);return Boolean(s&&"shopPayExternal"!==a.type&&!u&&!xt(a))})}(),{main:{section:ee}}=ye(),{lineItems:{priority:ne="base"}}=me(),te=v(Pi(ee)),ae=In(),ie=t(()=>"shopPay"===i.identity.current.value||S.value.payment||!te.value?"belowPayment":"abovePayment"),re=t(()=>!q.value&&Q.value&&"belowPayment"===ie.value),oe=t(()=>!q.value&&Q.value&&"abovePayment"===ie.value),le=t(()=>ae.value&&S.value.payment&&re.value&&K.value),se=t(()=>i.configuration.visibility.showEmailMarketing&&!xt(p)&&oe.value&&!T.value?.acceptsEmailMarketing),ue=tr(),ce=t(()=>ue.value.isRoot?"belowPayment"!==ie.value||K.value&&te.value?"abovePayment":"belowPayment":"none"),pe=t(()=>"guest"===i.identity.current.value&&S.value.delivery||"businessCustomer"===i.identity.current.value&&!S.value.delivery&&S.value.payment),he=t(()=>"guest"===i.identity.current.value?pe.value&&!(S.value.contact&&S.value.payment):pe.value),ve=t(()=>!he.value&&i.isShippingRequired.value),be=t(()=>W.value||Y.value),_e=Sd(),Ce=t(()=>Boolean(!xt(p)&&S.value.delivery&&null!=E.value&&!_e.value)),Pe=t(()=>S.value.delivery&&I.value.includes("PICK_UP")&&!_e.value),Se=t(()=>Boolean(be.value||Pe.value||(ve.value||he.value)&&Ce.value)),Ae=t
2(()=>Boolean(ve.value&&Ce.value&&!be.value)),ke=zt(r?.embedder),Ee="beforeDetails"===i.configuration.orderSummary?.placement,we=t(()=>ke&&!Ee&&!Ae.value),Oe=t(()=>ke&&Se.value),Ie=t(()=>ke?Ee:te.value),Re=t(()=>"guest"===i.identity.current.value&&S.value.delivery&&!S.value.contact),Te=t(()=>!q.value&&te.value&&(se.value||"abovePayment"===ce.value)),Ne=t(()=>b.value&&S.value.contact&&!q.value&&Z.value.length>0),Le=t(()=>!q.value),De=Sp({includeContact:Le}),Me=t(()=>b.value&&!N.value&&De.value.length>0),Be=Ll(),xe=t(()=>b.value&&Be.value&&Ee),Fe=t(()=>Be.value&&!Ee),Ve=Boolean(r?.isFlagshipPartner)&&"high"===ne;Zn();const He=t(()=>!q.value&&(se.value||le.value)),ze=t(()=>"abovePayment"===ce.value),je=t(()=>q.value?S.value.delivery&&i.isShippingRequired.value?l.translate("shipping.delivery_title"):l.translate("payment.title"):l.translate("contact.contact_method_title")),Ue=t(()=>!te.value&&!V.value&&(!Y.value||x.value)),Ge=t(()=>!(V.value&&S.value.contact)&&(!Y.value||x.value)&&(ae.value||te.value&&!S.value.contact)),Ye=t(()=>S.value.payment&&!le.value&&!Fe.value),We=t(()=>M.value&&!Re.value),qe=t(()=>_&&We.value),$e=t(()=>!_&&We.value),Ke=t(()=>qe.value&&Ue.value),Xe=t(()=>!ke&&qe.value&&Ue.value&&!pe.value&&S.value.payment&&(!i.isShippingRequired.value||S.value.delivery)),Je=t(()=>ke?Ee:ae.value||Xe.value),Ze=t(()=>Xe.value&&!K.value&&(re.value||"belowPayment"===ce.value)&&!k.value&&!Ne.value&&!Me.value&&!L.value),Qe=t(()=>Ze.value||k.value||Te.value||le.value||ae.value&&!te.value&&K.value||Ye.value&&(K.value||Ee)),en=t(()=>k.value||Ye.value||!S.value.payment&&S.value.delivery&&!K.value&&!Ne.value||S.value.payment&&le.value);return n(Ns,{children:[n(Zp,{}),n(F,{blockSize:L.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:we,children:n(Qn,{accessibilityRole:"presentation"})}),xt(p)?n(F,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(et,{})}):null,n(nt,{section:"toast"}),!Ve&&n(nt,{section:"top"}),n(lp,{active:b,ready:m}),n(up,{fillAvailableBlockSize:L.value,ready:m,children:[h&&n(B,{padding:"none none large-100 none",children:n(ks,{})}),"high"===ne&&n(B,{display:"@media (inline-size >= medium) none, auto",children:n(so,{target:"lineItems",children:n(io,{hideDivider:J,children:n(tt,{})})})}),Ve&&n(nt,{section:"top"}),n(a,{when:J,children:n(so,{target:"expressCheckout",children:n(dr,{})})}),n(a,{when:xe,children:[n(at,{section:"summary",children:n(it,{section:"summary",children:n(B,{padding:"none large-200 large-100 large-200",children:n(so,{target:"plain",children:n(Kp,{})})})})}),n(Qn,{accessibilityRole:"presentation"})]}),n(mp,{}),n(Ls,{}),n(a,{when:q,children:()=>n(io,{accessibilityLabel:l.translate("contact.contact_method_title"),children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Np,{showForm:i.configuration.showContactInformation,identityPresentation:Y.value?"vaulted":"form",showEmailMarketingOptIn:Y.value?Q.value:void 0})})})})}),n(uo,{target:"vaulted",condition:qe,children:n(ao,{hideDivider:en,condition:Ue,accessibilityLabel:je.value,children:n(uo,{target:"vaulted",condition:$e,children:[n(ap,{showDelivery:ve,insideVaultedCard:Ke}),n(ao,{condition:Ge,hideDivider:Qe,accessibilityLabel:je.value,children:n(F,{children:[n(a,{when:()=>!S.value.contact&&!G.value,children:n(at,{section:"contact",children:n(it,{section:"contact",children:n(Np,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!pe.value,children:n(Yd,{hideLastDivider:Je,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})}),n(a,{when:V,children:n(ro,{})})]})})}),n(a,{when:k,children:n(B,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:n(Cr,{})})}),n(a,{when:()=>(!q.value||ze.value)&&(te.value||le.value),children:n(it,{section:"contact",children:n(yp,{aboveFoldSpacing:!0,showEmailMarketingOptIn:He,showPhoneMarketingOptIn:ze})})}),n(a,{when:Ne,children:n(it,{section:"contact",children:n(gp,{extensions:Z,hideDivider:"whenEmpty"})})}),n(a,{when:he,children:n(a,{when:i.isShippingRequired,children:n(Qp,{isGuestPartialVaultedDelivery:Re,isSectionStyleUnificationEnabled:_,children:[n(ep,{}),n(oo,{condition:pe,accessibilityLabel:l.translate("shipping.delivery_title"),children:n(Yd,{hideLastDivider:Ie,showTopDivider:Oe,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:Me,children:n(gp,{extensions:De,hideDivider:"whenEmpty"})}),n(a,{when:()=>!S.value.delivery&&i.isShippingRequired.value,children:n(de,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(at,{section:"delivery",children:n(it,{section:"delivery",children:n(Wn,{sectionId:"delivery",children:n($p,{})})})})})}),n(a,{when:O,children:n(no.Prefetch,{})}),n(a,{when:L,children:n(B,{className:"xoG3V","data-testid":"onepage-vaulted-spacing"})}),n(a,{when:b,children:n(sp,{onReady:g,includeContactInVaultedExtensions:Le,showMobileOrderSummary:Fe,showVaultedStateMarketingDisclosureBelowPayment:re,phoneMarketingPlacement:ce,isSectionCustomized:te,showVaultedStateMarketingDisclosureOnMobile:le,expressCheckoutSlot:X,showVaultedCardConsentSpacing:Ze})})]}),R&&n(to,{})]}),n(pp,{}),n(a,{when:i.isShippingRequired,children:n(Pp,{})}),n(pr,{id:"OnePage"}),e]})}),nh=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:Kp,default:eh,onePageCritical
2StyleClassNames:Jp},Symbol.toStringTag,{value:"Module"}));export{Qs as L,eu as M,Kc as O,yp as P,tu as R,Md as S,Hu as U,gp as V,jc as a,Uc as b,Vp as c,Id as d,Od as e,Mu as f,Du as g,Rd as h,Qc as i,Ws as j,qs as k,$s as l,Sp as m,yc as n,nh as o,vp as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.