PageSourceSearch

https://twobrothersindiashop.com/cdn/shopifycloud/checkout-web/assets/c1/f8706cb6.DMygWC1h.js

js twobrothersindiashop.com collected 2026-10-01 10:42:23 UTC 174,305 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["26e63865.Dx6ep3GI.js","2c1ab0fe.D_oO1jU7.js","164ad2e3.DgUUtBtV.js","4c290a1e.D9lE9kmU.js","app.bDJ3v-8C.js","assets/app.BuSMBobh.css","assets/previous.BpuyvRSB.css","65f3d4da.8ZfwXSRH.js","60a453ce.BIyixFcg.js","0a7dffce.BMM606kb.js","bb728e1c.BObJOhlA.js","assets/stopwatch.Kyhz8KoT.css","f3fe2775.91jcUSQ2.js","ac5a19ff.CrIDx928.js","598fef4e.DSM2KxPW.js","assets/PaymentIcon.gzvCNwz_.css","e77f7fe0.B5ukwIHt.js","assets/PaymentLine.BGhbZYQP.css","a422df8c.CGT3eUwi.js","efa0389a.-R9eik6_.js","assets/Choice.B7lVAtpz.css","31cc568e.CsDC1k63.js","8599b02a.yKiXuwTF.js","assets/index.CIy8uDiZ.css","assets/EmptyState.BEvzDDvy.css","cc6ff67d.SUHuL0DO.js","08a3b809.CkE7TqUZ.js","e477f96c.dvrL9dgG.js","87bfafec.DaEgHDYY.js","e39bc11c.BNw-kv3c.js","bff2ff9b.DxpvVf7S.js","cf29e63b.CnWxVFH5.js","assets/hasViolationsIgnoringCodes.BcTJoNaV.css","dfc03c53.CSYqcfoO.js","86720dbb.lSLFpGJE.js","dfca5da5.H1thSL3M.js","assets/Section.CU18S7Ap.css","55098bf1.CrP8QF43.js","0e67bd3b.DkCvQkdq.js","74835653.9kmD7491.js","3ca8ef7e.DT3qvctx.js","assets/FormLayout.CrYq3At_.css","47b970b2.Bspt4mBz.js","29034f35.BY8rOPhQ.js","assets/PhoneField.uZEuHncj.css","064f6ac1.CT1iFQsV.js","assets/Popover.Bi1nHaU-.css","53bbdad9.Bipg1_Lt.js","assets/BillingAddressForm.BdwN7V1K.css","7a8217fd.BlWFPiiA.js","assets/useShopPayProgressIntercepts.xO_7ctnq.css","7114e006.B60DstSA.js","f692f62f.D8N74P4K.js","assets/RedirectionNotice.B8v_QGNW.css","b684bff6.Dv62TgX4.js","assets/MissingFields.BbxB_6wt.css","6720fa5f.gZhcGybT.js","assets/Rollup.DKll7CHa.css","ccdf3592.Jq-5VsnW.js","58314944.QVtJf4c2.js","assets/PaymentMethodProgressionHost.BIxPaYCu.css","50130ded.D7fAevzP.js","assets/KnownBuyerPaymentMethodSelector.BXqN6ZOx.css","c10167e6.MzmlADrK.js","b9c0319a.Bj2lNtZE.js","dffdfb34.BmCoupl3.js","0c0ad074.C7YXa-mF.js","5587f402.B4N8qnlk.js","945a08d6.DUn1GrN-.js","assets/useShopPayButtonClassName.CpHF4L7Q.css","cb8fcd45.gqoNFKgG.js","2fdb3dd3.Dk6unqUy.js","f1968089.4OkuMKtQ.js","cb5cf153.Cf9Ss23E.js","e3e348f2.sbssU431.js","ca5e9c49.BL-l7mUG.js","ed9f2238.C-XxbQrN.js","0b8657b8.CBFRF2sQ.js","79974aab.B4rWj4Zf.js","7b0c98ea.0CGJF8wQ.js","assets/TransitionHeight.CuRoM9zv.css","d22d2b80.22VthIi0.js","f49d4216.DMwWemXC.js","assets/VatNumberValidationField.CyiectWG.css","3a819064.CWC3Yoc0.js","assets/PaymentOptionSelector.s-Kd_X2E.css","91811554.rEls6X-G.js","64de7b49.Dffug7P1.js","347b440c.oWH9qB5Z.js","d5d34b3b.HJgnljYP.js","assets/EstimatedDeliveryContent.B_THySFF.css","0e9ee714.DqBmP7tY.js","39921a74.bStpjMMs.js","assets/Switch.BS8yVgoP.css","ec391382.Cpl2aZVN.js","assets/StickyPayButton.CPXhWoNv.css","01973ac7.BVhNP6nv.js","2b89a178.DO17bNRV.js","910cd6e2.IzGgJ-IA.js","181d38d3.Bsy-Yqp4.js","assets/Middot.D7Ujmshx.css","d6447d9e.wAHKQJgC.js","f51e663e.C08Dmcez.js","8e79be58.CObm0ydZ.js","assets/ShippingMethodSelector.B0hio2RO.css","90e26f5f.DVFq2b8a.js","assets/SubscriptionPriceBreakdown.vTcdVGq4.css","assets/ShippingLines.LcqrKXE1.css","f3e117aa.CTtG4OvO.js","a25deb9a.XIOr6b3K.js","assets/useShopPayNewSignupLoginExperiment.BYM12A8B.css","7a21cd4e.CUt3EoT6.js","assets/VaultedContactAvatar.BF3cX_zA.css","17a5f1e4.C-TpI4xq.js","0e4087ec.BrZIBLQj.js","7aefefff.DBWne1lR.js","a535174a.D9-hmEEh.js","5fd968f2.DTvmd-mL.js","assets/Captcha.CJQgLR0i.css","73a9b0a0.D8Gs2o-g.js","e0989459.44TRzqx7.js","assets/RememberMeSection.JBO5WNhc.css","fc21c11a.Oq7eYqe8.js","4ea44c06.D08Q9XyC.js","f78726c8.K7FaLIh2.js","assets/useHasOrdersFromMultipleShops.B_iZlQze.css","assets/PaymentButtons.CKE1iCma.css","1ed8f5e3.Oin1LrS4.js","assets/floating-layer.DfWUBaTh.css","7ee73f43.CQB45vvk.js","aea3fb03.BGfdKdPP.js","assets/PayButtonSection.Bi0nhBOp.css","d2e6a587.DdUzoAUU.js","assets/MobileOrderSummary.DjDhVpQB.css","assets/BelowTheFoldContent.CmuzzmSI.css"])))=>i.map(i=>d[i]);
2import{_ as e}from"./app.bDJ3v-8C.js";import{u as n,f as t,i as a,S as i,X as r,d as l,x as o,h as s,T as d,y as u,E as c,r as p,q as h,A as m,o as v,G as y,l as g,e as f,k as b,n as _,g as C,c as P,_ as S,a as A,Q as E}from"./2c1ab0fe.D_oO1jU7.js";import{H as k,bD as w,fE as O,fD as I,as as R,L as T,il as N,bL as L,d5 as D,ad as M,Y as B,B as x,n as V,c as F,A as H,l as z,dZ as j,im as U,p as G,bA as Y,bI as W,eF as q,bJ as $,a as K,d0 as X,I as J,i0 as Z,g$ as Q,P as ee,y as ne,S as te,b8 as ae,io as ie,bH as re,fQ as le,bF as oe,bE as se,cY as de,c6 as ue,b7 as ce,cR as pe,eU as he,b as me,$ as ve,br as ye,Z as ge,dj as fe,h as be,av as _e,ip as Ce,aC as Pe,cp as Se,W as Ae,eL as Ee,aD as ke,i as we,iq as Oe,eR as Ie,ac as Re,h_ as Te,bB as Ne,cy as Le,ir as De,is as Me,it as Be,iu as xe,fa as Ve,eb as Fe,cv as He,hC as ze,eK as je,iv as Ue,ft as Ge,iw as Ye,bp as We,ix as qe,bl as $e,ci as Ke,eS as Xe,e9 as Je,c7 as Ze,iy as Qe,iz as en,cS as nn,d8 as tn,db as an,eN as rn,iA as ln,d3 as on,d6 as sn,bw as dn,iB as un,iC as cn,d9 as pn,da as hn,ck as mn,hI as vn,hJ as yn,U as gn,eW as fn,eO as bn,bm as _n,f6 as Cn,aX as Pn,al as Sn,az as An,iD as En,bh as kn,iE as wn,fF as On,iF as In,c3 as Rn,eo as Tn,eT as Nn,f5 as Ln,eX as Dn,iG as Mn,R as Bn,aa as xn,bv as Vn,c9 as Fn,iH as Hn,bS as z
2n,iI as jn,cl as Un,iJ as Gn,cj as Yn,e$ as Wn,f$ as qn,bO as $n,b$ as Kn,bT as Xn,c$ as Jn,eY as Zn,dd as Qn,_ as et,a6 as nt,f as tt,fc as at,a1 as it,iK as rt,a0 as lt,eM as ot,fl as st,iL as dt,N as ut,O as ct}from"./164ad2e3.DgUUtBtV.js";import{O as pt,cF as ht,a6 as mt,_ as vt,je as yt,ds as gt,Q as ft,jM as bt,bX as _t,bN as Ct,bT as Pt,a7 as St,jN as At,P as Et,h as kt,i0 as wt,aX as Ot,h_ as It,hY as Rt,bp as Tt,h$ as Nt,jB as Lt,bJ as Dt,ar as Mt,bM as Bt,jO as xt,jP as Vt,gH as Ft,bY as Ht,ba as zt,bt as jt,aT as Ut,hG as Gt,V as Yt,dn as Wt,jQ as qt,b0 as $t,ae as Kt,w as Xt,h0 as Jt,aJ as Zt,bx as Qt,fD as ea,ac as na,bu as ta,jR as aa,iU as ia,fU as ra,jS as la,jT as oa,gc as sa,jU as da,ga as ua,gb as ca,dC as pa,bb as ha,f0 as ma,jV as va,fx as ya,X as ga,cp as fa,eM as ba,M as _a,f9 as Ca,jW as Pa,fd as Sa,ex as Aa,a9 as Ea,ek as ka,co as wa,iZ as Oa,ab as Ia,d as Ra,bj as Ta,cg as Na,eg as La,jX as Da,N as Ma,fy as Ba,jY as xa,j1 as Va,jZ as Fa,j_ as Ha,j3 as za,h1 as ja,aM as Ua,hd as Ga,I as Ya,f1 as Wa,fG as qa,fE as $a,db as Ka,cG as Xa,cI as Ja,cJ as Za,cH as Qa,j$ as ei,cW as ni,fb as ti,cU as ai,fZ as ii,bz as ri,aE as li,j2 as oi,k0 as si,dj as di,aq as ui,n as ci,dh as pi,cT as hi,j7 as mi,k1 as vi,k2 as yi,k3 as gi,k4 as fi,k5 as bi,k6 as _i,j9 as Ci,da as Pi,k7 as Si,j5 as Ai,a8 as Ei,k8 as ki,k9 as wi,ka as Oi,aB as Ii,kb as Ri,kc as Ti,kd as Ni,ke as Li,fX as Di,cS as Mi,iS as Bi,iT as xi,kf as Vi,kg as Fi,aA as Hi,iX as zi}from"./4c290a1e.D9lE9kmU.js";import{w as ji,x as Ui,C as Gi,y as Yi,f as Wi,U as qi,u as $i,I as Ki,i as Xi,z as Ji,B as Zi,F as Qi,G as er,H as nr,J as tr,K as ar,k as ir,M as rr,S as lr,N as or,O as sr,Q as dr,R as ur,h as cr,T as pr,W as hr,X as mr,Y as vr,Z as yr,_ as gr,$ as fr,g as br,j as _r,a0 as Cr,D as Pr,c as Sr,a1 as Ar,d as Er,a2 as kr,l as wr,m as Or,n as Ir,e as Rr,V as Tr,p as Nr,E as Lr,o as Dr}from"./dffdfb34.BmCoupl3.js";import{k as Mr,D as Br,a as xr,u as Vr,s as Fr,c as Hr,d as zr,l as jr,b as Ur,H as Gr}from"./0e9ee714.DqBmP7tY.js";import{X as Yr,U as Wr,N as qr,W as $r,b as Kr,Y as Xr,Z as Jr,c as Zr,d as Qr,G as el,S as nl,e as tl,_ as al,$ as il,a0 as rl,a1 as ll,a2 as ol,f as sl,n as dl,v as ul,x as cl,p as pl,q as hl,r as ml,z as vl,s as yl,A as gl,V as fl,a3 as bl,a4 as _l,h as Cl,u as Pl,t as Sl,T as Al,i as El}from"./f3fe2775.91jcUSQ2.js";import{a as kl,c as wl,r as Ol,S as Il,M as Rl}from"./dfca5da5.H1thSL3M.js";import{S as Tl,M as Nl}from"./79974aab.B4rWj4Zf.js";import{R as Ll}from"./6720fa5f.gZhcGybT.js";import{A as Dl,C as Ml,u as Bl,S as xl}from"./0e67bd3b.DkCvQkdq.js";import{u as Vl,g as Fl,e as Hl,f as zl,h as jl}from"./bb728e1c.BObJOhlA.js";import{E as Ul,u as Gl,a as Yl,P as Wl,b as ql}from"./01973ac7.BVhNP6nv.js";import{E as $l,S as Kl}from"./5587f402.B4N8qnlk.js";import{u as Xl,a as Jl}from"./945a08d6.DUn1GrN-.js";import{c as Zl,a as Ql}from"./58314944.QVtJf4c2.js";import{P as eo}from"./598fef4e.DSM2KxPW.js";import{O as no,U as to,I as ao,u as io}from"./7a8217fd.BlWFPiiA.js";import{a as ro,b as lo,C as oo}from"./efa0389a.-R9eik6_.js";import{a as so,S as uo,u as co,b as po}from"./87bfafec.DaEgHDYY.js";import{P as ho,C as mo}from"./e77f7fe0.B5ukwIHt.js";import{B as vo,A as yo}from"./74835653.9kmD7491.js";import{b as go,a as fo,t as bo,d as _o,u as Co,c as Po}from"./2b89a178.DO17bNRV.js";import{i as So,g as Ao,h as Eo}from"./65f3d4da.8ZfwXSRH.js";import{S as ko}from"./39921a74.bStpjMMs.js";import{r as wo,b as Oo,d as Io,e as Ro}from"./bff2ff9b.DxpvVf7S.js";import{u as To,a as No,M as Lo,b as Do}from"./b684bff6.Dv62TgX4.js";import{C as Mo,b as Bo,E as xo}from"./a422df8c.CGT3eUwi.js";import{u as Vo,g as Fo}from"./f1968089.4OkuMKtQ.js";import{C as Ho}from"./cf29e63b.CnWxVFH5.js";import{W as zo,b as jo,C as Uo,S as Go}from"./31cc568e.CsDC1k63.js";import{v as Yo,a as Wo,c as qo,S as $o}from"./0c0ad074.C7YXa-mF.js";import{S as Ko}from"./cb5cf153.Cf9Ss23E.js";import{u as Xo,A as Jo}from"./53bbdad9.Bipg1_Lt.js";import{v as Zo}from"./8599b02a.yKiXuwTF.js";import{P as Qo}from"./47b970b2.Bspt4mBz.js";import{u as es}from"./29034f35.BY8rOPhQ.js";import{I as ns}from"./55098bf1.CrP8QF43.js";import{a as ts}from"./ed9f2238.C-XxbQrN.js";import{V as as,M as is,u as rs,a as ls,S as os,R as ss,b as ds}from"./910cd6e2.IzGgJ-IA.js";import{b as us,a as cs,g as ps}from"./0a7dffce.BMM606kb.js";import{D as hs,u as ms,S as vs}from"./d6447d9e.wAHKQJgC.js";import{M as ys,c as gs,u as fs,b as bs}from"./64de7b49.Dffug7P1.js";import{u as _s,S as Cs,E as Ps}from"./347b440c.oWH9qB5Z.js";import{b as Ss}from"./2fdb3dd3.Dk6unqUy.js";import{u as As}
2from"./d5d34b3b.HJgnljYP.js";import{c as Es}from"./ca5e9c49.BL-l7mUG.js";import{f as ks,i as ws}from"./e3e348f2.sbssU431.js";import{S as Os}from"./f3e117aa.CTtG4OvO.js";import{u as Is}from"./a25deb9a.XIOr6b3K.js";import{T as Rs}from"./7b0c98ea.0CGJF8wQ.js";import{F as Ts}from"./3ca8ef7e.DT3qvctx.js";import{D as Ns}from"./f49d4216.DMwWemXC.js";import{S as Ls}from"./f51e663e.C08Dmcez.js";import{m as Ds}from"./ac5a19ff.CrIDx928.js";function Ms(){const{i18n:e}=pt();return n(k,{level:1,children:e.translate("embed.header.review_order")})}function Bs(){const{hasError:e}=w(ht),i=O(),{i18n:r,observability:l}=pt(),o=r.translate("review.blocks.change_link_label"),s=I(i.value?.method?.walletParams)?.checkout_session_id,{inMemoryAmazonPayParts:{hasPaymentSheetError:d,sdkStatus:u}}=mt(),c=t((()=>{const e=u.value;return e.status===R.Available?e.sdk:void 0}));return i.value?n(a,{when:c,children:t=>n(T,{onClick:()=>{try{t.buywithprime.changePaymentMethod({amazonPayOptions:{amazonCheckoutSessionId:s,isDeclined:e}})}catch(n){d.value=!0,l.error(new N(`Error on changing buyer payment method. Details: ${n}`,{cause:n}))}},children:o})}):null}function xs(){const e=pt(),{i18n:t}=e,a=function({checkout:e}){return"buyWithPrime"===e.identity.current.value?{rollupId:"buyWithPrimePayDetails",sdkButton:n(ji,{wallet:vt.BuyWithPrime,isSdkOnly:!0}),changeLink:n(Bs,{})}:{rollupId:"amazonPayDetails",sdkButton:n(Dl,{isSdkOnly:!0}),changeLink:n(Yr,{})}}(e);return n(i,{children:[a.sdkButton,n(Ll,{id:a.rollupId,label:t.translate("payment.title"),primaryContent:n(Vs,{}),primaryAction:a.changeLink})]})}function Vs(){const{brand:e,descriptor:t}=Wr().value,a=L(),i=yt(),r=D();return a.value?i.value?n(qr,{vaulted:!0,reason:"giftCard"}):t&&r.value?n($r,{brand:e,descriptor:t}):n(M,{}):n(qr,{vaulted:!0,reason:"freeOrder"})}function Fs({label:e}){const{i18n:t}=pt();return B(),n(i,{children:[n(x,{accessibilityRole:"status",children:n(V,{accessibilityVisibility:"exclusive",children:t.translate("vaulted.loading_section",{section:e(t)})})}),n(F,{gap:"small-300",children:[n(M,{inlineSize:"large"}),n(M,{inlineSize:"large"}),n(M,{inlineSize:"small"})]})]})}class Hs{#e=u(0);#n=c((()=>this.#e.value>0));get hasFailures(){return this.#n}register(){return this.#e.value+=1,()=>{this.#e.value-=1}}}const zs=r(null);function js({children:e}){const t=d((()=>new Hs),[]);return n(zs.Provider,{value:t,children:e})}function Us(){const{i18n:e}=pt(),t=o(zs);return t?n(a,{when:()=>t.hasFailures.value,children:n(x,{paddingBlockEnd:"base",children:n(Ul,{bannerId:"VaultedRollupContentsLoadError",errorType:H.CheckoutError,heading:e.translate("error_page.terminal.title"),tone:"critical",autoFocus:!0,iconHidden:!0,children:n(F,{gap:"small-400",alignItems:"start",children:[n(V,{children:e.translate("error_page.terminal.message")}),n(z,{variant:"plain",onClick:()=>globalThis.location.reload(),children:e.translate("error_page.terminal.action.cta")})]})})})}):null}function Gs({children:e}){const t=o(zs),a=t?.hasFailures.value??!1;return n(x,{inert:a,opacity:a?50:void 0,children:e})}const Ys=()=>e((()=>import("./26e63865.Dx6ep3GI.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]));function Ws(){return p(Ys)}function qs(e,t,a){return function({displayName:e,load:t,loadingLabel:a}){return l({displayName:e,load:t,suspense:!1,renderLoading:()=>n(Fs,{label:a}),useError:function(n){const{observability:t}=pt(),a=o(zs);B({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 Ws()).vaultedRollupContents)})}const $s=qs("DefaultVaultedPaymentRollupContent",(e=>e.translate("payment.title")),(e=>e.DefaultVaultedPaymentRollupContent)),Ks=qs("VaultedShippingMethodsRollupContent",(e=>e.translate("shipping.title")),(e=>e.VaultedShippingMethodsRollupContent)),Xs=qs("VaultedBillingAddressRollupContent",(e=>e.translate("billing.billing_address_title")),(e=>e.VaultedBillingAddressRollupContent)),Js=qs("DefaultVaultedDeliveryAddressRollupContent",(e=>e.translate("shipping.shipping_address_title")),(e=>e.DefaultVaultedDeliveryAddressRollupContent)),Zs=qs("VaultedLocalPickupOptionsRollupContent",(e=>e.translate("local_pickup.title")),(e=>e.VaultedLocalPickupOptionsRollupContent)),Qs=qs("VaultedPaymentOptionsRollupContent",(e=>e.translate("payment.payment_option.title")),(e=>e.VaultedPaymentOptionsRollupContent)),ed={id:"c2d32a41854d2b88c435b1a8710244c3357bc9533fc69142a72d00b75acac5a8",type:"mutation",name:"ExperimentExposed",source:"mutation ExperimentExposed($experiments:[String!]!){experimentExposed(experiments:$experiments){userErrors{field message __typename}__typename}}"};
2function nd(){const{shop:e,checkout:n,shopPay:t}=pt(),a=e.hasFlagEnabled(gt),{recordExposure:i}=(()=>{const{graphql:{shopPayGraphql:e}}=pt();return{recordExposure:h((async n=>{await e.mutate(ed,{variables:{experiments:[n]}})}),[e])}})(),r=m(!1),l=t.installments.isServiceAvailable.value,o=t.user.installments.isRetryable.value,u=n.installments.isSupported.value,c=n.installments.isUnavailable.value,p=n.installments.config.value?.supportedCountries,v=d((()=>!u||!l||c&&!o),[u,l,c,o]);s((()=>{a||!p?.includes("GB")||!n.installments.isSupported.value||v||r.current||(i($l.handle),r.current=!0)}),[a,p,v,n.installments.isSupported.value,i])}function td(e,n){const t=new Set(n.map((e=>e.id)));return e.some((e=>t.has(e.id)))}function ad(e,n){const t=j();return v((()=>{n&&td(t.blockingExtensions.value,e)&&y((()=>n()))})),td(t.blockingExtensions.value,e)}function id(){const{generalPaymentError:e,generalPaymentErrorCode:n}=ft(),{violations:a}=U(bt);return t((()=>!!e.value&&(!_t(n.value)||a.value.size>0)))}function rd({showTips:e,billingFormPosition:n}){const t=G("Checkout::Dynamic::Render","PAYMENT1"),a=G("Checkout::Dynamic::Render","PAYMENT2"),i=G("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 ld(e,n){return e.currentUrl.value.hash===`#${n}`}function od(e,n=!1){const{router:a}=pt(),i=g(e),r=t((()=>ld(a,i.value))),l=f(n);return s((()=>{r.peek()&&(l.value=!0)}),[r,l]),l}function sd({autoOpen:e=!0,isMissing:n,open:t}){s((()=>{e&&n&&(t.value=!0)}),[e,n,t]);const{shopPay:{progressInterceptor:a}}=pt();s((()=>{if(n)return a.listenResult((e=>{e||(t.value=!0)}))}),[a,n,t])}function dd(){const{loading:e}=q(),{checkout:n}=pt(),t=n.isShippingRequired.value,a=ft().shippingAddress.value,{shippingAddress:i,deliveryNext:r}=Et(),l=i.value,o=kt(r.value),s=!t||!e&&(o||a?.countryCode===l?.countryCode),d=f(s);return s&&!d.value&&(d.value=!0),d}function ud(){const{shop:e}=pt(),n=e.hasFlagEnabled(It),a=Kr(),i=Rt(),r=Tt(),l=Nt(),{loading:o}=q(),s=g(o),d=Xr(a),u=dd(),c=t((()=>{const e=a.value;if(l.value&&e&&!(e.balance.amount<=0))return d.value?Jr({firstOrderTotal:i.value,storeCreditAccount:e}):0===r.value?.amount&&i.value?.currencyCode===e.balance.currencyCode?e.balance:void 0})),p=Zr(a),h=t((()=>{const e=u.value,t=!s.value,a=p.value,i=null!=c.value;return n&&e&&t&&a&&i}));return{storeCreditBalanceForSubscriptionRenewals:c,showStoreCreditForSubscriptionRenewals:h}}function cd(){const{i18n:e}=pt(),{paymentLines:t}=ft(),{violations:a}=$(bt),{message:i,tone:r}=Gl(),l=[...a][0],o=l&&(l.localizedMessage||l.nonLocalizedMessage),d=t.value.find((e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type))?.method,u="customOnsite"===d?.type?d:void 0,c=u?e.translate("payment_errors.local_payment_method_unavailable",{payment_method:u.name}):void 0,p=Boolean(i)&&("critical"===r||"warning"===r),h=o&&c&&p?`${c}. ${o}`:void 0;return s((()=>{if(h)return K({content:h})}),[h]),o&&u?n(Ul,{errorType:H.PaymentError,bannerId:"LocalPaymentMethodUnavailableBanner",tone:"warning",heading:c,autoFocus:!p,children:o}):null}function pd({openRedeemablesModal:e,includeStoreCredit:t=!0}){const{i18n:a}=pt(),i=Qr(),{paymentLines:r}=X(),l=t&&i.value.length>0,o=r.length>0,s=[...t?i.value:[],...r];if(!s.length)return null;let d="";return d=o&&l?a.translate("payment.gift_card_store_credit.manage_label"):o?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(hd,{paymentLine:e},Lt(e.method))))}),n(x,{inlineAlignment:"start",padding:"small-200",borderWidth:"none base base base",borderRadius:"none none base base",children:n(T,{onClick:e,textDecoration:"none",children:n(F,{direction:"inline",alignItems:"center",gap:"small-200",children:[n(J,{type:"edit"}),n(V,{children:d})]})})})]})}function hd({paymentLine:e}){const{i18n:t}=pt();switch(e.method.redemptionSource){case"STORE_CREDIT":return n(ne,{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(eo,{type:"store-credit"}),n(V,{children:t.translate("payment.store_credit.label")})]}),n(ee,{textAlign:"end",children:n(V,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]});case"CUSTOM":{const a=e.method.redemptionContent,i=Z(a);return n(ne,{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(eo,{type:"gift-card"}),n(V,{children:t.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Q(i)})})]}),n(ee,{textAlign:"end",children:n(V,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})})]})}default:return null}}function md({open:e,onClose:t,includeStoreCredit:a=!0}){const{i18n:r,checkout:l}=pt(),o=Kr(),d=Zr(o),{canApplyGiftCards:u,paymentLines:c}=X(),p=Dt(),h=a&&l.configuration.visibility.showStoreCreditRedemption.value&&d.value,v=u||c.length>0,y=m(v);s((()=>{const n=y.current&&!v;y.current=v,e&&n&&!h&&t()}),[h,v,t,e]);let g="";h&&v?g=r.translate("payment.gift_card_store_credit.manage_label"):v?g=r.translate("payment.gift_card_wrapper.manage_label"):h&&(g=r.translate("payment.store_credit.manage_label"));const f=()=>{(p.value||!u&&h)&&t()},b=a?n(i,{children:[n(nl,{}),n(tl,{afterAppliedRedeemablesChange:f})]}):null;return n(no,{heading:g,open:e,onHide:t,children:n(F,{gap:"base",children:[l.configuration.visibility.showStoreCreditRedemption.value?b:null,n(el,{afterAppliedRedeemablesChange:f,autoSelect:!0,showHeading:!1})]})})}function vd(){const e=Kr(),n=Zr(e),a=Xr(e),i=dd(),r=Tt();return t((()=>{const e=0===r.value?.amount&&!a.value;return n.value&&i.value&&!e}))}function yd(){const{paymentLines:e}=X(),n=vd(),{showStoreCreditForSubscriptionRenewals:t}=ud();return Boolean(e.length)||n.value||t.value}function gd({afterAppliedRedeemablesChange:e,placement:i}){const{i18n:r,userEvents:l,shop:o,source:d,checkout:u}=pt(),{paymentLines:c,remove:p}=X(),{useStoreCreditForSubscriptionRenewals:m}=ft(),y=Tt(),g=wt(),b=Ot(),_=Kr(),C=Xr(_),P=f(al.Init),S=t((()=>P.value===al.Loading)),A=yd(),E=vd(),{storeCreditBalanceForSubscriptionRenewals:k,showStoreCreditForSubscriptionRenewals:w}=ud(),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=il(_.value,P),T=rl(_.value,P),N=f(L());function L({storeCreditSelected:e=C.value,subscriptionRenewalsSelected:n=m.value}={}){const t=c.map((({method:e})=>Lt(e)));return e&&t.unshift(ll),n&&t.splice(e?1:0,0,ol),t}s((()=>{N.value=L()}),[c]),v((()=>
2{const e=C.value,n=m.value;N.value=L({storeCreditSelected:e,subscriptionRenewalsSelected:n})}));const D=h(((e,n)=>{const t=n?"add":"remove",a=i?`${i}_`:"";l.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Mt(d,u,o),action:`${a}manage_redeemables_${t}_${e}`}})}),[u,l,i,o,d]),M=h((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 l=r.find((e=>!i.includes(e))),o=l===ol;let s=!1;if(l===ll)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(o){const e=!a;D("store_credit_subscription_renewals",e),m.value=e}else{D("gift_card",!a);const e=c.find((e=>Lt(e.method)===l));if(e?.method){const n=await p(e.method);s="success"===n?.status}}s&&e?.()}),[e,R,N,c,D,p,T,m]),B=t((()=>S.value||O.value)),x=t((()=>B.value||0===y.value?.amount&&!C.value)),H=B;if(!A)return null;const z=_.value?.balance,j=k.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(ro,{name:"redeemables_list",values:N.value,onChange:M,variant:"block",multiple:!0,children:[E.value&&z&&n(lo,{value:ll,disabled:x.value,secondaryContent:n(V,{type:"strong",children:r.formatCurrency(z.amount,{currency:z.currencyCode})}),details:U&&n(V,{children:U}),children:n(F,{direction:"inline",gap:"base",alignItems:"center",children:[n(V,{children:r.translate("payment.store_credit.apply_label")}),n(a,{when:S,children:n(te,{})})]})}),w.value&&j&&n(lo,{value:ol,disabled:H.value,details:n(F,{gap:"small-500",children:[n(V,{children:r.translate("payment.store_credit.remaining_for_subscription_charges_description",{amount:r.formatCurrency(j.amount,{currency:j.currencyCode})})}),U&&n(V,{children:U})]}),children:n(V,{children:r.translate("payment.store_credit.use_remaining_for_subscription_charges_label")})}),c.map((e=>n(fd,{paymentLine:e},Lt(e.method))))]})})}function fd({paymentLine:e}){const{i18n:t}=pt(),a=e.method.redemptionContent,i=Z(a);return n(lo,{value:Lt(e.method),secondaryContent:n(ee,{textAlign:"end",children:n(V,{type:"strong",children:e.cost&&t.formatCurrency(e.cost.amount,{form:"short",currency:e.cost.currencyCode})})}),children:n(F,{children:[n(ee,{children:t.translate("payment.gift_card_checkbox_label")}),n(F,{direction:"inline",gap:"small-400",children:[n(J,{type:"gift-card"}),n(V,{color:"subdued",children:[" ",Q(i)]})]})]})})}function bd(){const{checkout:e}=pt(),t=f(!1),a=_d();switch(e.identity.current.value){case"shopPay":return n(gd,{placement:"summary"});case"customerAccount":case"businessCustomer":return n(F,{gap:"base",children:[a?n(i,{children:[n(nl,{}),n(tl,{})]}):null,n(pd,{includeStoreCredit:!1,openRedeemablesModal:()=>t.value=!0}),n(md,{includeStoreCredit:!1,open:t.value,onClose:()=>t.value=!1})]});default:return null}}function _d(){const{checkout:e}=pt(),n=Kr(),t=Zr(n),a=Xr(n),i=Tt(),r=a.value,l=0===i.value?.amount&&!r;return t.value&&(e.configuration.visibility.showStoreCreditRedemption.value||r)&&!l}const Cd={ONE_PERCENT_CASHBACK:"1",THREE_PERCENT_CASHBACK:"3"};function Pd({children:e}){return n(F,{direction:"inline",gap:"small-200",alignItems:"center",children:e})}function Sd({handleNoValidCards:e}){const[t,a]=b(!1),r=Et().paymentMethods.value,{i18n:l,observability:o,shopPay:d}=pt(),u=d.session.paymentMethodOption.value,c=sl(),p=c.selectedCreditCard.value,h=c.selectedPaymentMethod.value,m=c.selectedPaymentMethodItem.value,v=c.paymentMethods.value,y=d.user.hasFlow.value,g=dl(p),f=v.find((e=>!e.isDisabled));if(s((()=>{if(t){const e=setTimeout((()=>{a(!1)}),750);return()=>clearTimeout(e)}}),[t]),s((()=>{f?"SHOPIFY_INSTALLMENTS"===u?.name&&!0===m?.isDisabled&&(c.selectPaymentMethod(f.method),a(!0)):y&&e()}),[m?.isDisabled,u?.name,e,f,c,y]),!h)return null;if(t)return n(Pd,{children:n(M,{})});if("CUSTOM_ONSITE"===h.paymentMethod){const e=r?.find((e=>h.paymentBrands&&Bt(e,h.paymentBrands)));if(!e)return o.log("shop_pay_payment_line_custom_onsite_payment_selected","customOnsitePaymentMethod was selected but not in negotiatedPaymentMethods",{selectedPaymentMethod:JSON.stringify(h),negotiatedPaymentMethods:JSON.stringify(r)}),null;const t=ae(e)&&Boolean(e.incentiveType),a=1===e.paymentBrands?.length?e.paymentBrands[0]:"generic";if(t){const t=Cd[e.incentiveType],i={title:l.translate("payment.usdc_cashback_t
2itle",{incentive_percentage:t}),additionalInfo:l.translate("payment.usdc_cashback_additional_info",{terms_url:to,incentive_percentage:t}),terms:l.translate("payment.usdc_cashback_terms"),termsUrl:to};return n(Pd,{children:[n(V,{children:e.name}),n(ao,{notice:i,selected:!1}),n(eo,{type:a})]})}return n(ho,{paymentLine:{method:e},showAmount:!1})}if(ul(h))return n(Pd,{children:[n(V,{children:n(V,{children:l.translate("payment.ideal_label")})}),n(eo,{type:"ideal"})]});if(cl(h))return n(Pd,{children:[n(V,{children:l.translate("brand.apple_pay")}),n(eo,{type:"apple_pay"})]});if(pl(h))return n(Pd,{children:[n(V,{children:l.translate("brand.paypal")}),n(eo,{type:"paypal"})]});if(hl(h)||ml(h)){const e=l.translate("payment_gateway.shop_pay.name"),t=ml(h)?l.translate("payment_gateway.shop_pay.installments_label"):void 0;return n(Pd,{children:[n(V,{children:e}),n(eo,{type:"shop_pay"}),t?n(V,{color:"subdued",children:t}):null]})}if(vl(h))return n(Pd,{children:n(V,{children:h.name})});if(yl(h))return null;if(gl(h))return null;const _=h.paymentAttributes;return n(fl,{name:g,digits:n(i,{children:[n(mo,{}),n(V,{size:"base",tone:"neutral",children:_.lastDigits})]}),icon:n(eo,{type:_.brand})})}function Ad(){const e=ft().paymentLines.value,t=d((()=>e.find((e=>"giftCard"!==e.method.type&&"redeemable"!==e.method.type))),[e]);return n(F,{gap:"small-400",children:[t&&n(ho,{paymentLine:t,showCardBrandLabel:!0}),n(bl,{})]})}function Ed({openSignal:e}){const{checkout:{identity:t}}=pt();return"shopPay"===t.current.value?n(Sd,{handleNoValidCards:()=>e.value=!0}):n(Ad,{})}function kd(){const{i18n:e}=pt(),t=xt("STORE_CREDIT"),{paymentLines:a}=X(),i=[...t.value,...a];return i.length?n(F,{gap:"small-200",children:i.map((t=>{const a=t.cost?n(V,{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(eo,{type:"store-credit"}),n(ee,{children:[e.translate("payment.store_credit.label"),a]})]},Lt(t.method));case"CUSTOM":{const i=t.method.redemptionContent,r=Z(i);return n(F,{direction:"inline",alignItems:"center",gap:"base",children:[n(eo,{type:"gift-card"}),n(ee,{children:[e.translate("payment.gift_card_wrapper.gift_card_label",{identifier:Q(r)}),a]})]},Lt(t.method))}default:return null}}))}):null}function wd({paymentExemptionReason:e}){const{checkout:{identity:t}}=pt();return"shopPay"!==t.current.value||"storeCredit"!==e&&"redeemables"!==e?n(kd,{}):n(qr,{vaulted:!0,reason:e})}function Od({hasPersistentRedeemablesManagement:e,openSignal:t}){const{checkout:a}=pt(),i=so(),r=Dt();return"freeOrder"===i.value?n(qr,{vaulted:!0,reason:"freeOrder"}):"giftCard"===i.value?n(qr,{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(wd,{paymentExemptionReason:i.value}):n(F,{gap:"small-200",children:[!e&&n(kd,{}),n(Ed,{openSignal:t})]})}function Id(){const{checkout:e}=pt(),n=e.latestReceipt.value,{value:t}=Et().paymentMethods,{inMemoryGooglePayParts:{sdkStatus:a,paymentSheetError:i},persistedGooglePaySignal:r,receiptErrorSignal:l}=mt(),o=ie({shouldResetCustomerInfo:!1}),d=re("failed"===n?.status&&"payment"===n.failure.type?n.failure:void 0),u=m(o);return u.current=o,v((()=>{"error"===a.value.status&&y((()=>{u.current(),i.value={type:Vt}}))})),s((()=>{Ft(t,"GOOGLE_PAY")||i.value?.type===Vt||(i.value={type:Vt},u.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},l.value=d)}),[n,l,t,r,i,d]),s((()=>()=>{l.value=void 0}),[l]),null}function Rd(){const{checkout:e}=pt(),n=e.latestReceipt.value,{value:t}=Et().paymentMethods,{inMemoryPayPalParts:{paymentSheetError:a},persistedPayPalSignal:i}=mt(),r=le(),l=m(r);l.current=r;const o=d((()=>Ft(t,"PAYPAL_EXPRESS")),[t]);return s((()=>{o||(l.current(),a.value={type:Vt})}),[o,a]),s((()=>
2{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},l.current())}),[n,o,a,i]),null}function Td(){const{checkout:{identity:e}}=pt();switch(e.current.value){case"payPal":return n(Rd,{});case"googlePay":return n(Id,{});default:return null}}function Nd(){const e=pt(),{checkout:a,i18n:r,shop:l,shopPay:o,webMcp:d}=e,u="shopPay"===a.identity.current.value,c=Zl(),p="payment",{hasAnyPaymentError:m,clearReceiptError:f}=function({clearReceiptErrorOnPaymentLineChange:e=!0}={}){const{hasViolations:n}=Y(new Set([...Ct,"PAYMENTS_PHONE_NUMBER_DOES_NOT_MATCH_EXPECTED_PATTERN"])),{hasError:t,clearError:a}=w(Pt),{lastJourneyProgression:i}=St(),r="failed"===i.value.type&&"completion"===i.value.negotiationStage,l=id(),o=W();At((()=>{e&&a()}));const s=t&&!o,d=l.value;return{hasAnyPaymentError:n||s||r||d,errors:{hasExpiryViolation:n,hasReceiptPaymentFailure:t,hasReceiptPaymentError:s,hasSubmitCompletionFailure:r,hasGeneralPaymentError:d},clearReceiptError:a}}({clearReceiptErrorOnPaymentLineChange:!1}),{hasViolations:b}=Y(Ht),{hasError:_}=oe(),{hasError:C}=se(),{paymentErrors:P}=de().value,S=P.length>0,{notSupportedError:A}=Yl(),E=Boolean(A),k=Et(),O=k.buyerIdentity,{value:I}=k.paymentFlexibilityPaymentTermsTemplate,R=ue(),T=null!=I&&!R.value,N=zt().value,D=o.session.selectedPaymentMethod.value,M=jt(D),{value:B}=k.paymentMethods,x=sl({enableAutoSelect:!1}),V=Vl(x),{buyerHasActedSignal:H}=Ut();s((()=>{if(d&&u)return d.unstable_provideSavedCardSelector((async e=>{const n=V.current;if(!(n instanceof _l))return!1;const t=n.cardPaymentMethods.value.find((({method:n})=>n.id===e))?.method;return!!t&&(H.value=!0,"handled"===(await n.selectPaymentMethod(t,"programmatic",{rebuild:!0})).status)}))}),[V,u,d,H]);const z=x.paymentMethods.value.length>0;nd();const j=null!=D&&Gt(D)?D.paymentBrands??[]:[],U=j.length>0?B?.find((e=>Bt(e,j))):void 0,$=ce("Checkout::PaymentMethod::Render",U?.uiExtension?[U.uiExtension]:[]),K=function({checkout:e,shop:n,source:t},{customerProfile:a}){return"shopPay"===e.identity.current.value||qt({identitySource:e.identity.current.value,isOrderSession:$t(t),storeVaultEnabled:n.storeVaultEnabled,customerProfile:a})}(e,{customerProfile:O.value?.customerProfile}),Z=K&&(u||z),Q=K&&0===x.cardPaymentMethods.value.length,{expandedSlot:ee,collapsedSlot:ne}=Cl(x),te=m||E||S||_||C,{directPaymentErrors:ae,paymentLines:ie}=ft(),re=ie.value.some((e=>e.method.type===Yt.CreditCard&&e.method.requiresCvvConfirmation)),le=l.storeVaultGuestCvvVerificationEnabled&&re,he=Boolean(M)&&!M?.expired&&!M?.verified,me=Boolean(M?.expired)||te||T||N||le||he,ve=G("purchase.checkout.payment-method-list.render-before"),ye=G("purchase.checkout.payment-method-list.render-after"),ge=Xl([...ve,...ye]),fe=Xl($),be=Mr([...ve,...ye]),_e=L(),Ce=yt(),Pe=t((()=>!(!_e.value||Ce.value)||Boolean(O.value?.purchasingCompany))),Se=od(p,me||b);ad($.map(Wt),h((()=>{Se.value=!0}),[Se])),s((()=>{(me||b)&&(Se.value=!0)}),[me,b,Se]),Pl();const Ae=h((()=>{Se.value&&Ql(ae)||(Se.value=!Se.value,Se.value&&c(),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:{...Mt(n,t,a),action:i?"credit_card_expand":"credit_card_collapse"}})}(e,Se.value))}),[c,ae,Se,e]),Ee=function(){const{checkout:e}=pt(),n=yd(),t=_d(),{paymentLines:a}=X();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}}}(),ke=n(Od,{openSignal:Se,hasPersistentRedeemablesManagement:Ee.hasPersistentRedeemablesManagement}),we=te?n(Ld,{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||le,Le=!Re&&(be||Q||T),De=Te||Le||Boolean(Ne);!function(e){const{useStoreCreditForSubscriptionRenewals:n}=ft(),{loading:t}=q(),a=g(e),i=g(t),r=wt(),l=Ot(),{showStoreCreditForSubscriptionRenewals:o}=ud();v((()=>{const e=a.value,t=i.value,s=o.value,d=r.value,u=l.value;e&&!t&&(!s||d||u)&&y((()=>{n.value&&(n.value=!1)}))}))}(u),v((()=>{Ql(ae)&&(Se.value=!0)})),sd({autoOpen:!1,isMissing:le||he,open:Se});const Me=Ie?n($s,{usesSharedVaultedSelector:Z,hasPersistentRedeemablesManagement:Ee.hasPersistentRedeemablesManagement,msiExpandedSlot:ee,onSelectedPaymentMethodChange:f}):null;v((()=>{(ge.value||fe.value)&&(Se.value=!0)}));const Be=Ee.show?n(bd,{}):null,xe=De?void 0:ne,Ve=Be?n(F,{gap:"base",children:[Be,xe]}):xe;return n(i,{children:n(pe,{target:"cart.paymentLines[0]",children:[n(Ll,{open:Te,disabled:Le,id:p,label:r.translate("payment.title"),icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),primaryContent:ke,onToggle:Ie?Ae:void 0,error:Ne,renderChildrenWhenCollapsed:Ie,secondaryPersistentContent:Ve,children:Me}),n(Td,{})]})})}function Ld({paymentErrors:e}){return n(x,{children:[e.length>0?n(he,{errors:e,errorType:H.PaymentError}):n(i,{children:[n(Wl,{}),n(cd,{})]}),n(me,{blockSize:"base"})]})}function Dd({onPaymentDelegation:e}){const{embed:t,i18n:a}=pt(),{rollup:{action:{tone:i}={}}={}}=ve();return"amazon"===t?.embedder?n(T,{textDecoration:"none",onClick:e,children:n(V,{tone:"accent",children:a.translate("embed.payment.payment_options")})}
2):n(z,{tone:"custom"===i?"custom":void 0,onClick:e,variant:"plain",textDecoration:"none",children:a.translate("payment.choose_new_payment_method")})}const Md={visa:"Visa",mastercard:"Mastercard",americanexpress:"American Express",amex:"American Express",discover:"Discover",dinersclub:"Diners Club",maestro:"Maestro",jcb:"JCB"};function Bd(e){return e.toLowerCase().replace(/[-_]/g,"")}function xd(e,n){return e&&"unknown"!==Bd(e)?Md[Bd(e)]??n.translate("payment_gateway.credit_card_label"):n.translate("payment_gateway.credit_card_label")}function Vd(){const{i18n:e,observability:t,embed:a,shop:i,shopPay:r,checkout:l}=pt(),o=L(),d=Kt(),{delegatedPaymentInstrument:u}=Ut(),{message:c,tone:p,inventoryRecoveryReceiptId:v}=Gl(),{rollup:{blockPadding:y}={}}=ve(),{hasViolations:g,clearViolations:f}=$(Ht);s((()=>{let e=Fl(u.peek());return u.subscribe((n=>{const t=Fl(n);t!==e&&(e=t,f())}))}),[u,f]);const b=Boolean(a)&&l.configuration.isPaymentInstrumentsDelegationEnabled&&Boolean(u.value),_=b&&g,C=Fl(u.value),P=m(void 0);_&&(P.current=C);const S=Hl(u.value),{billingAddress:A}=ft(),E=Boolean(S&&!Xt(A.value,zl(S))),w=b&&(_||P.current===C&&E),O=a?.embedder,I=Jt({embedder:O,shop:i}),R=Zt(r.app.config),T=!a?.isFlagshipPartner||Qt(a.embedder)||R||I?e.translate("payment.title"):e.translate("payment.payment_method"),N=a?.client?.paymentErrors.value.includes(ea.PaymentEmpty)??!1,D=m(!1),M=m(null),B=h((e=>{M.current=e,e&&D.current&&(e.focus(),D.current=!1)}),[]),x=h((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:Fl(u.value)});else if(n.cart)try{await e.applyCart(n.cart),t.log("delegated_payment_selected","Payment instrument selected",{externalReferenceId:Fl(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(ea.PaymentDelegationError),z=H?e.translate("payment_errors.payment_credential_delegation_error"):void 0,j=z||c,U=z?"critical":p,G=na(y),Y=o.value&&j?n(F,{direction:"block",gap:G,paddingBlockEnd:G,children:[n(ql,{message:j,tone:U,inventoryRecoveryReceiptId:z?void 0:v}),!w&&a?.isFlagshipPartner&&n(Dd,{onPaymentDelegation:x})]}):void 0;if(!o.value){const e=n(qr,{vaulted:!0,reason:"freeOrder"}),t="amazon"===O?{compact:e}:{primary:e};return n(Ll,{id:"payment",label:T,primaryContent:t.primary,compactContent:t.compact,icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"})})}const W=u.value,q=jl(W),K=q?.brand,X=q?.lastDigits,Z=!(d.value&&W&&K&&X),Q=Z?e.translate("payment.add_payment_method"):void 0,ee=n(V,{tone:"critical",children:e.translate("payment.add_payment_method")}),ne=X?n(V,{accessibilityVisibility:"exclusive",children:`${xd(K,e)} ${e.translate("payment.ends_with_label",{last_digits:X})}`}):null,te=n(V,{accessibilityVisibility:"hidden",children:n("bdi",{children:[xd(K,e),n(mo,{}),X]})}),ae=(()=>{if(!Z)return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[ne,te,n(eo,{type:K,size:"small",accessibilityVisibility:"hidden"})]})})(),ie=Z?n(V,{tone:N?"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(eo,{type:K})}),ne,te]}),re=Z?n(V,{tone:"accent",decoration:"underline",children:e.translate("payment.add_new_payment_method")}):n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(V,{children:e.translate("payment.pay_with")})," ",ne,n(V,{type:"strong",accessibilityVisibility:"hidden",children:[xd(K,e),n(mo,{}),X]}),n(eo,{type:K,accessibilityVisibility:"hidden"})]}),le="amazon"===O?{compact:re}:"google"!==O||I?{primary:ae,secondary:void 0===ae?ee:void 0}:{primary:ie};return n(Ll,{buttonRef:B,id:"payment",label:T,open:w,disabled:w,onToggle:Y?void 0:x,primaryContent:le.primary,secondaryContent:le.secondary,compactContent:le.compact,buttonAccessibilityLabel:Q,icon:n(J,{id:"payment-creditCardIcon",type:"credit-card",size:"fill"}),error:Y,children:w?n(F,{direction:"block",gap:"base",children:[n(k,{level:3,children:e.translate("billing.billing_address_title")}),n(vo,{}),a?.isFlagshipPartner?n(Dd,{onPaymentDelegation:x}):null]}):null})}const Fd=new Set(["amazonPay","buyWithPrime"]);function Hd(){const{checkout:{identity:e}}=pt();return Fd.has(e.current.value)?n(xs,{}):"sdkCartHints"===e.current.value?n(Vd,{}):n(Nd,{})}function zd(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),remainingAmou
2nt: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 jd(){const{checkout:e}=pt(),n=m(null);return t((()=>{const t=e.proposal.negotiated.fields.shopDiscountOffer.value;return"unavailable"===t?.status?(n.current=null,null):("filled"!==t?.status||(n.current=zd(t)),n.current)}))}const Ud=({requiresAvailableBalance:e=!0}={})=>{const n=function({requiresAvailableBalance:e=!0}={}){const n=go({requiresAvailableBalance:e}),a=Et(),i=a.paymentMethods,r=a.shopCashBalance;return t((()=>{const{nonEligibleReason:t}=n.value,a=Boolean(i.value?.some((e=>"redeemable"===e.type&&"SHOP_CASH"===e.redemptionSource))),l=r.value,o=null==l||"unavailable"===l.status;let s;return s=e&&o?ta.ShopCashNotAvailable:a?t:ta.ShopCashMerchantNotSupported,{nonEligibleReason:s}}))}({requiresAvailableBalance:e});return t((()=>{const{nonEligibleReason:e}=n.value;return e?{eligible:!1,reason:e}:{eligible:!0}}))};function Gd(){const{shop:e}=pt(),n=e.hasFlagEnabled(aa);return Ud({requiresAvailableBalance:!n})}const Yd=()=>{const e=pt().shopPay.app.config,n=Jl();return ia(e,n)};function Wd(e,n,t){s((()=>{if(e&&t)return e.recordPresentation({component:n,displayLabel:t})}),[n,t,e])}const qd=()=>{const{embed:e,i18n:t,shop:a,shopPay:i}=pt(),r=Qt(e?.embedder),l=i.app.config.surface,o=a.hasFlagEnabled(ra),s=ye();return(r?"shop_app"===l:o||"shop_app"===l)?n(T,{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(V,{size:"small",children:t.translate("shop_cash.minimum_order_value_banner_keep_shopping")})}):null},$d=({adType:e,offerAmount:a,minimumOrderValueAmount:i,remainingAmount:r,incentivePresentation:l})=>{const{i18n:o}=pt(),s=Yd(),{hasMerchandiseDiscounts:d}=(()=>{const e=Et().discountLines;return t((()=>{const n=e.value;return{hasMerchandiseDiscounts:!!n&&n.lines.some((e=>!!So(e)&&e.allocations.some((e=>"MERCHANDISELINE"===e.target.type)))),orderDiscountAmount:n?n.lines.filter((e=>So(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,u=o.formatCurrency(a.amount,{currency:a.currencyCode,form:"short"}),c=o.formatCurrency(i.amount,{currency:i.currencyCode,form:"short"}),p=r?o.formatCurrency(r.amount,{currency:r.currencyCode,form:"short"}):void 0,h=Kd({adType:e,formatMinimumOrderAmount:c,formatRemainingAmount:p,formatOfferAmount:u,hasMerchandiseDiscounts:d});return Wd(l,"minimumOrderValueBanner","FLAT_AMOUNT_CASHBACK_OFFER"===e?h:void 0),n(x,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:s?"dHa7y":"O9AXs",children:[n(ee,{type:"small",children:h}),n(qd,{})]})},Kd=({adType:e,formatMinimumOrderAmount:n,formatRemainingAmount:t,formatOfferAmount:a,hasMerchandiseDiscounts:i})=>{const{i18n:r}=pt(),l=i||!t;return"SHOP_CASH_OFFER"===e?l?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?l?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 Xd({eligibility:e,offerEligibility:t,discountOffer:a}){const i=o(uo),r=i?.cashback?.incentive;if(!e.eligible&&!t.eligible)return[];const l=[];var s;return t.eligible&&a?.minimumOrderValue&&!a.minimumOrderValue.satisfied&&l.push(n($d,{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))&&l.push(n($d,{adType:"FLAT_AMOUNT_CASHBACK_OFFER",offerAmount:r.cashbackAmount,minimumOrderValueAmount:r.minimumOrderValue,remainingAmou
2nt:r.minimumOrderValueRemainder,incentivePresentation:i?.incentivePresentation},"mov-cashback")),l}function Jd(){const{checkout:e,embed:t}=pt(),{main:{section:a}}=ge(),i=Ud().value,r=Gd().value,l=jd(),o=fe().value.payment,s=Xd({eligibility:i,offerEligibility:r,discountOffer:l.value});return Qt(t?.embedder)&&!e.configuration.visibility.showCashRedemption.value&&s.length>0?o?n(F,{padding:Zd(a?.padding),gap:"small-200",children:s}):n(kl,{hideDivider:o,condition:!o,padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:s})}):null}function Zd(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 ${na(n)??"none"} small-200 ${na(t)??"none"}`}function Qd({checked:e,onChange:t,disabled:a}){return n(ko,{checked:e,onChange:t,icon:"none",className:"mu1NS",accessibilityLabel:"Shop Cash",disabled:a})}function eu(e,n){return null==e&&null==n||null!=e&&null!=n&&e.amount===n.amount&&e.currencyCode===n.currencyCode}const nu=e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource,tu=e=>{if(!e)return la;if(!e.method.redemptionContent?.details)return la;const n={...la};for(const t of e.method.redemptionContent.details){const e=oa.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:bo(t.destinationAmount),sourceAmount:fo(t.sourceAmount)};"SHOP_PROMOTION"===e?n.SHOP_PROMOTION=[...n.SHOP_PROMOTION,a]:n[e]=a}return n},au=(e,n)=>{const t=e[n];return Array.isArray(t)?t.length>0:null!=t},iu=()=>{const{paymentLines:e}=Et();return t((()=>tu(e.value?.lines.find(nu))))},ru=()=>{const{paymentLines:e}=ft();return t((()=>tu(e.value?.find(nu))))},lu=e=>({type:e.type,amount:e.destinationAmount,promotionId:e.promotionId}),ou=({enabled:e=!0}={})=>{const{shopPay:n}=pt(),t=ru(),a=o(uo),i=a?.redemption.applying,{negotiate:r}=be(),l=ft().paymentLines,s=_o(),d=co(),u=Et().buyerIdentity.value?.shopUser?.publicId,c=n.session.isInternalProgressing.value,p=!1===i?.value,h=e&&Boolean(u)&&!c&&p,{SHOP_CASH_BALANCE:m,SHOP_DISCOUNT_OFFER:v,SHOP_PROMOTION:y}=t.value,g=m?lu(m):null,f=v?lu(v):null,b=y.map(lu);return{isShopCashNegotiationReady:h,negotiateShopCash:async(t,{onNegotiateAccepted:a}={})=>{const{SHOP_CASH_BALANCE:o=g,SHOP_DISCOUNT_OFFER:c=f,SHOP_PROMOTION:p=b}=t,h=n.session.isInternalProgressing.value;if(!e)return;if(!i)return;if(h)return;if(!u)return;if(i.peek())return;_((()=>{i.value=!0}));const m=l.peek().filter((e=>"redeemable"!==e.method.type||"SHOP_CASH"!==e.method.redemptionSource)),v=Object.values(t).flatMap((e=>Array.isArray(e)?e:[e])).find((e=>null!=e))?.amount.currencyCode,y=[o,c,...p??[]].filter((e=>null!==e&&(!v||e.amount.currencyCode===v))),{selectedBillingAddress:C,selectedShippingAddress:P,isUsingApplePayShippingFallback:S}=s.value,A=!C.address1||"APPLE_PAY"===d.value,E=((e,n)=>{if(!u)return null;if(0===e.length)return null;const t=e.reduce(((e,n)=>e+n.amount.amount),0),a=e[0].amount.currencyCode;return{cost:{amount:t,currencyCode:a},method:{type:"redeemable",redemptionSource:"SHOP_CASH",redemptionContent:{redemptionId:u,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:t.toString(),currencyCode:a},sourceAmount:{amount:t.toString(),currencyCode:a},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})))}}}})(y,!S&&P&&A?P:C);E&&m.push(E),l.value=m;try{a?.(),await r({include:["paymentLines","billingAddress"],silenceViolations:["non-shop-cash"]})}finally{_((()=>{i.value=!1}))}}}},su=sa,du=e=>{const{i18n:n,shopPay:t,webMcp:a,checkout:i}=pt(),{isShopCashNegotiationReady:r,negotiateShopCash:l}=ou(),o=ru(),d=iu(),{applying:u}=po().redemption,{buyerIdentity:c,shopCashBalance:p}=Et(),m=c.value,v=p.value,y=Boolean(o.value[su]),g=d.value[su]?.destinationAmount||null,f=h((async n=>{if(u.value)return;const t=n?e:null;eu(g,t)&&eu(o.value[su]?.destinationAmount,t)||await l({[su]:t?{type:"SHOP_CASH_BALANCE",amount:t,promotionId:null}:null})}),[g,e,l,u,o]);s((()=>
2{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(o.value[su])}},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||u.value||t.session.isInternalProgressing.value||c.value!==m||p.value!==v)&&(await f(a),eu(d.value[su]?.destinationAmount??null,a?e:null))}}})}),[a,i,t.session,e,o,d,r,u,c,m,p,v,f]),s((()=>{g&&(eu(g,e)||f(!0))}),[e]);const b=n.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"});return{title:n.translate("order_summary.shop_cash_title"),amount:y?n.translate("shop_cash.redemption.balance.applied",{formattedAmount:b}):n.translate("shop_cash.redemption.balance.available",{formattedAmount:b}),checked:y,handleChange:f,disabled:u.value}},uu=({redeemableBalance:e})=>{const{title:t,amount:a,checked:i,handleChange:r,disabled:l}=du(e);return n("div",{className:"yY3sV",children:n(_e,{theme:{rollup:{blockAlignment:"center"}},children:n(Ll,{label:t,primaryContent:a,primaryAction:n(Qd,{checked:i,onChange:r,disabled:l})})})})},cu=()=>{const{i18n:e}=pt(),t=Yd(),a=e.translate("payment_errors.vaulted_card_required_error");return n(x,{padding:"small-200 small-100",borderRadius:"base",accessibilityRole:"status",className:C("Q9An4",t&&"K92xU"),children:n(ee,{type:"small",children:a})})},pu=()=>{const e=Et().subtotalAfterMerchandiseDiscounts,n=Rt(),a=hu(),i=mu();return t((()=>{const t=n.value,r=t?{amount:wo(t.amount-a.value-i.value,P(t.currencyCode)),currencyCode:t.currencyCode}:void 0;return{orderTotal:t,orderSubtotal:e.value,redeemableTotal:r}}))},hu=()=>{const{paymentLines:e}=Et();return t((()=>(e.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)))},mu=()=>{const e=iu();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)))},vu={availableBalance:null,redeemableBalance:null};function yu(){const e=m([]),n=pu(),{checkout:a}=pt(),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=[]),Ro(e.current,t)}))}const gu=()=>{const{recordRedemptionActionEvent:e}=Co(),{shop:n,shopPay:t}=pt(),a=n.hasFlagEnabled(ra),i=t.app.config.surface,r=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),l=d((()=>({shopPayCheckoutSurface:i,isReactNativeWebview:r,isShopCashBalanceBetaEnabled:a,isOnePageCheckout:!0,nEnabledCreditCards:0})),[i,r,a]),o=h((n=>
2{e({...l,...n})}),[l,e]),s=h(((e,n)=>{o({action:"auto-apply",redemptionType:e,source:n})}),[o]),u=h(((e,n)=>{o({action:"manually-apply",redemptionType:e,source:n})}),[o]);return{recordRedemptionAutomaticallyApplied:s,recordRedemptionAutomaticallyRemoved:h(((e,n)=>{o({action:"auto-remove",redemptionType:e,source:n})}),[o]),recordRedemptionManuallyApplied:u,recordRedemptionManuallyRemoved:h(((e,n)=>{o({action:"manually-remove",redemptionType:e,source:n})}),[o])}},fu=({enabled:e=!0,redemptionTypes:n=oa}={})=>{const t=iu(),a=o(uo),i=a?.cashbackState.stale,{recordRedemptionAutomaticallyRemoved:r}=gu(),{negotiateShopCash:l}=ou({enabled:e}),{hasViolations:d}=$(da);s((()=>{if(!e||!i||!d)return;let a=!1;for(const e of n)au(t.value,e)&&(a=!0,r(e,"useRemoveRedemptionsOnViolation"));a&&(i.value=!0,l(Object.fromEntries(n.map((e=>[e,null])))))}),[e,d])},bu=(e,{enabled:n=!0,retryOnReady:t=!1}={})=>{const{isShopCashNegotiationReady:a,negotiateShopCash:i}=ou({enabled:n}),{recordRedemptionAutomaticallyRemoved:r}=gu(),l=iu(),o=ru(),d=e.filter((e=>!e.eligibility.eligible)).flatMap((e=>e.redemptionTypes??oa)),u=d.join(","),c=!!t&&a,p=t?d.filter((e=>au(o.value,e))).join(","):"";s((()=>{if(!n||0===d.length)return;if(!t){const e=d.filter((e=>au(l.value,e)));if(0===e.length)return;return void i(Object.fromEntries(d.map((e=>[e,null]))),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})}if(!a)return;const e=d.filter((e=>au(o.value,e)));0!==e.length&&i(Object.fromEntries(d.map((e=>[e,null]))),{onNegotiateAccepted:()=>{for(const n of e)r(n,"useRemoveRedemptionsWhenIneligible")}})}),[n,c,u,p])};class _u extends Error{constructor(){super("Multiple Shop Cash payment lines present in negotiation response"),this.name="MultipleShopCashPaymentLinesAnomaly"}}const Cu=({message:e})=>n(ne,{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(J,{type:"alert-circle",size:"small"}),n(ee,{color:"subdued",size:"small",children:e})]});function Pu(){const{eligibility:e,offerEligibility:n,redeemableBalance:t,availableBalance:a,discountOffer:i,messages:r,showVaultedCardBanner:l,vaulted:o,isDigitalGoodsRedemptionAllowed:u}=Su();!function(e){const n=m(!1),t=m(performance.now()),{observability:a}=pt();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:c}=pt(),p=c.hasFlagEnabled(aa);return bu([{eligibility:e,redemptionTypes:[sa]},...p?[]:[{eligibility:n,redemptionTypes:[ua,ca]}]],{retryOnReady:p}),fu(),(e=>{const{client:n,shop:t,shopPay:a}=pt(),{recordRedemptionVisibilityEvent:i}=Co(),r=n.unstable_getSerialization("apiClientId"),l=t.hasFlagEnabled(ra),o=a.app.config.surface,u=Boolean("undefined"!=typeof window&&window.ReactNativeWebView),c=fe().value.payment,p=d((()=>({visibility:"visible",reason:e.reason??"none",position:c?"vaulted":"unvaulted",shopPayCheckoutSurface:o,isReactNativeWebview:u,isShopCashBalanceBetaEnabled:l,apiClientId:r,isOnePageCheckout:!0,nEnabledCreditCards:0})),[o,u,l,r,e.reason,c]);s((()=>{i(p)}),[i,e.reason])})(e),(({eligibility:e,availableBalance:n,redeemableBalance:t,discountOffer:a})=>{const{recordRedemptionEligibilityEvent:i}=Co(),{orderTotal:r,orderSubtotal:l}=pu().value,o=d((()=>a?a.minimumOrderValue&&!a.minimumOrderValue.satisfied?"BELOW_MOV":void 0:"NO_CAMPAIGN"),[a]),u=d((()=>{if(r)return{balance:n?.amount??0,balanceCurrency:n?.currencyCode??"USD",totalPrice:r.amount,totalPriceCurrency:r.currencyCode,subtotalPrice:l?.amount??0,subtotalPriceCurrency:l?.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:o,redemptionIneligibilityReason:e.reason}}),[n,r,l,a,t,o,e.reason]);s((()=>{u&&i(u)}),[i,e.reason,n,t,a])})({eligibility:e,availableBalance:a,redeemableBalance:t,discountOffer:i.value}),(()=>{const{observability:e,source:n}=pt(),t=Et().paymentLines.value,a=d((()=>t?.lines.filter((e=>"redeemable"===e.method.type&&"SHOP_CASH"===e.method.redemptionSource))??[]),[t]),i=m(!1);s((()=>
2{if(!a)return;if(a.length<=1)return;if(i.current)return;const t=JSON.stringify(a.map((e=>e.method.redemptionContent?.details?.map((n=>({redemptionPaymentGroupId:e.method.redemptionContent?.redemptionId,redemptionId:n.redemptionId,type:n.redemptionType,amount:n.destinationAmount}))))));i.current=!0,e.error(new _u,{severity:"error",metadata:{shopCash:{redemptions:t},source:{type:n.type},checkout:{token:n.checkoutSessionIdentifier||n.sourceId}}})}),[a,e,n])})(),{eligibility:e,redeemableBalance:t,messages:r,showVaultedCardBanner:l,vaulted:o,isDigitalGoodsRedemptionAllowed:u}}function Su(){const e=fe().value.payment,t=Ud().value,a=Gd().value,{redeemableBalance:i,availableBalance:r}=(()=>{const e=Et().shopCashBalance.value,{redeemableTotal:n}=pu().value,t=(()=>{const e=Et().shopCashBalance.value,n=m(null);return"filled"===e?.status?n.current=e.availableBalance:"unavailable"===e?.status&&(n.current=null),n.current})();if("filled"===e?.status&&e.eligible&&null!=e.redeemableBalance&&e.redeemableBalance.amount>0)return{availableBalance:e.availableBalance,redeemableBalance:e.redeemableBalance};if(!t)return vu;if(t.amount<=0)return vu;if(!n)return vu;const a=Oo(n.currencyCode);if(n.amount<=a)return vu;if(n.amount<t.amount)return{availableBalance:t,redeemableBalance:n};const i=wo(n.amount-t.amount,P(n.currencyCode));return i>=a?{availableBalance:t,redeemableBalance:t}:{availableBalance:t,redeemableBalance:Io({amount:t.amount-(a-i),currencyCode:t.currencyCode})}})(),l=jd(),o=yu().value,s=Xd({eligibility:t,offerEligibility:a,discountOffer:l.value}),{eligibilityMessage:d,showVaultedCardBanner:u}=(e=>{const t=(()=>{const{i18n:e}=pt();return t=>{if(t)switch(t){case"SHOP_CASH_INVALID_BILLING_ADDRESS":return e.translate("shop_cash.redemption_invalid_billing_address");case"SHOP_CASH_INVALID_SHIPPING_ADDRESS":return e.translate("shop_cash.redemption_invalid_shipping_address");case"SHOP_CASH_MERCHANT_NOT_SUPPORTED":case"PAYMENTS_SHOP_CASH_UNSUPPORTED_CURRENCY":return e.translate("shop_cash.redemption_unsupported_merchant");case"SHOP_CASH_UNSUPPORTED_DELIVERY_METHOD_TYPE":return e.translate("shop_cash.redemption_unsupported_delivery_method");case"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING":return e.translate("shop_cash.redemption_unsupported_shipping");case"PAYMENTS_SHOP_CASH_GIFT_CARD_NOT_ALLOWED":return e.translate("shop_cash.redemption_unsupported_gift_cards");case"INSUFFICIENT_FUNDING_LEDGER_BALANCE":return e.translate("shop_cash.redemption_error_exclusive_campaign_out_of_funds");case"BUYER_BALANCE_HOLD_ERROR":return e.translate("shop_cash.redemption_balance_hold",{shopRewardsTermsLink:n(T,{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")}}})(),{paymentLines:a}=Et(),i=Dt().value&&Boolean(a.value?.lines.find(nu));return{eligibilityMessage:t(e.reason),showVaultedCardBanner:i}})(t),c=!t.eligible&&"PAYMENTS_SHOP_CASH_UNSUPPORTED_SHIPPING"===t.reason,p=[];return d&&!c&&p.push(n(Cu,{message:d},"eligibility-banner")),p.push(...s),{eligibility:t,offerEligibility:a,redeemableBalance:i,availableBalance:r,discountOffer:l,shopPromotionDiscounts:o,messages:p,showVaultedCardBanner:u,vaulted:e,isDigitalGoodsRedemptionAllowed:c}}const Au=()=>{const{eligibility:e,redeemableBalance:t,messages:a,showVaultedCardBanner:r,vaulted:l,isDigitalGoodsRedemptionAllowed:o}=Pu();return r&&!l&&a.push(n(cu,{})),n(i,{children:[(e.eligible||o)&&t&&n(kl,{hideDivider:l,condition:!l,children:n(uu,{redeemableBalance:t})}),a.length>0&&n(kl,{hideDivider:l,condition:!l,padding:"none large-200",children:n(F,{padding:"small-200 none",gap:"small-200",children:a})})]})};function Eu({formattedAddress:e}){const{i18n:t,checkout:a}=pt(),i=Et().buyerIdentity.value?.purchasingCompany,r=a.addressManager.shipping.value,l=r.selectedAddress.value?.id===Ho&&pa(i)||!e;return n(F,{children:[l&&n(ee,{children:i?.location.name}),n(ee,e?{children:e}:{color:"subdued",children:t.translate("review.blocks.no_address")})]})}const ku=new Set(["DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE_FOR_MERCHANDISE_LINE"]);function wu({id:e="deliveryAddress",label:t,formattedAddress:r}){const{i18n:l}=pt(),o=od(e),s=Et().buyerIdentity.value?.purchasingCompany,u=Vo(),c=Ce(),{hasViolations:p}=$(ku),{deliveryAddressErrors:h}=de().value,m=r??c,v=d((()=>[`single_choice_${e}`]),[e]),y=t??l.translate("shipping.shipping_address_title"),g=n(Eu,{formattedAddress:m}),f=n(i,{children:[n(Mo,{name:`single_choice_list_${e}`,values:v,hideRadioControl:!0,children:n(lo,{value:`single_choice_${e}`,children:n(F,{children:[n(ee,{children:s?.location.name}),n(ee,{color:"subdued",children:m??l.translate("review.blocks.no_address")})]})})}),n(a,{when:u,children:n(x,{padding:"small-200 small-100 none small-100",children:n(Ml,{showIcon:!0})})})]}),b="deliveryAddress"!==e?null:p?n(Ui,{message:l.translate("shipping_errors.shipping_method_not_available_generic.one")}):h.length>0?n(he,{errors:h,errorType:H.DeliveryError}):null;return n(Ll,{id:e,label:y,open:o.value,onToggle:()=>{o.value=!o.value},primaryContent:g,error:b,children:f})}function Ou({isAbovePaymentSummary:e=!1}={}){const{checkout:{identity:t}}=pt(),a=Et().buyerIdentity.value?.purchasingCompany,i=function(e){const n=e.current.value;return"customerAccount"===n||"businessCustomer"===n}(t)&&!e;return i?n(Ru,{renderInlineSelector:!0}):a?n(Iu,{purchasingCompany:a}):n(Ru,{})}function Iu({purchasingCompany:e}){const{i18n:t}=pt(),{shippingAddress:a,name:i}=e.location,{secondary:r}=Ee({address:a??{},nameLinePosition:"inline",addressDisplayName:i}),l=a?r:t.translate("review.blocks.no_address");return n(wu,{id:"billingAddress",label:t.translate("company_location.location_title"),formattedAddress:l})}function Ru({renderInlineSelector:e=!1}={}){const t=ft(),a=t.billingAddress.value,i=Tu().value,r=null!=i&&t.billingAddressOption.value===i.option,l="form"!==Pe().value,o=r&&i.sameAsShipping&&!l,d=o?i.address:a,u=Se(d,{displayName:!1}),{i18n:c,checkout:{identity:p}}=pt(),{isMissingPhone:v}=To({addressType:"billing"}),{isMissingFirstName:y}=No({addressType:"billing"}),g=v||y,f="billingAddress",b=od(f),_=ha("deliveryNext").value,C=m(!0),{hasViolations:P,violations:S,clearViolations:A}=Y(Ht),E=new Set([...v?["PAYMENTS_PHONE_NUMBER_REQUIRED"]:[],...y?ma:[]]),k=Sl(P,S,E),{hasViolations:w}=Y(va);s((()=>{k&&(b.value=!0)}),[k,b]),s((()=>{C.current?C.current=!1:A()}),[A,a]),sd({isMissing:g,open:b});const O=function(){const{userEvents:e,source:n,checkout:t,shop:a}=pt(),{billingAddress:i,billingAddressOption:r,shippingAddress:l}=ft(),o=Tu(),s=h((e=>{e?r.value="custom":Xt(i.value,l.value)?r.value="shipping":r.value="custom"}),[i,r,l]),d=h((e=>{const n=o.value;e?(n&&r.value===n.option&&(i.value=n.address),r.value="custom"):n&&Xt(i.value,
2n.address)?r.value=n.option:r.value="custom"}),[i,r,o]),u=h((i=>e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Mt(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:d,recordShopPayInteraction:u})}(),I=h((()=>{const e=!b.value;return O?.(e),b.value=e,e}),[O,b]);let R=k;!function(e,n){return"applePay"===e.current.value&&n}(p,w)?k&&!_&&(R=n(Ae,{errorType:H.PaymentError,tone:"critical",children:c.translate("address_management.invalid_billing_address_selected")})):R=n(Ae,{errorType:H.PaymentError,tone:"critical",children:c.translate("payment.billing_must_match_shipping_notice")});const T=c.formatName(d?.firstName,d?.lastName,!0);let N,L;return!r||o?(N=T,L=u):N=i.sameAsShipping?c.translate("billing.same_as_shipping"):u,n(Ll,{id:f,label:c.translate("billing.billing_address_title"),open:b.value,onToggle:I,error:R,primaryContent:N,secondaryContent:L,renderChildrenWhenCollapsed:g,children:n(Xs,{renderInlineSelector:e})})}function Tu(){const{checkout:e}=pt(),{buyerIdentity:n}=Et(),a=ke();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 Nu(e,n){return e?n?`${n} · ${e}`:e:""}class Lu{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 Du="large-400";function Mu(){return n(F,{"aria-busy":!0,alignItems:"center",display:"inline",justifyContent:"center",children:n(F,{borderRadius:"fullyRounded",overflow:"hidden",children:n(Re,{contentDisplay:"block",children:n(Bu,{})})})})}function Bu(){return n(me,{blockSize:Du,inlineSize:Du})}const xu=l({displayName:"VaultedContactAvatar",suspense:!1,load:()=>p((()=>e((()=>import("./7a21cd4e.CUt3EoT6.js").then((e=>e.V))),__vite__mapDeps([111,1,2,3,4,5,6,7,8,9,10,11,112])))),renderLoading:()=>n(Mu,{}),renderError:()=>n(Bu,{}),useError:Ie("VaultedContactAvatar")});function Vu(e,t=""){const a=e?.customerProfile?.firstName?.charAt(0),i=e?.customerProfile?.lastName?.charAt(0),r=t.charAt(0),l=(a??i??r).toUpperCase();return l?n(xu,{initials:l}):null}function Fu({email:e,phone:t}){const{i18n:a,checkout:{configuration:i},observability:r,shop:{name:l}}=pt(),{hasExternalOrderNotifications:o}=i,u=function({email:e,phone:n}){return e?"email":n?"phone":void 0}({email:e,phone:t}),c=o?u:void 0;s((()=>{c&&(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:c}),r.counter({name:"shop_pay_external_order_notification_banner_suppressed",value:1,attributes:{contact_type:c}}))}),[r,c]);const p=d((()=>o?null:e?a.translate("account_management.email_changed",{shopName:l,email:Hu(e)}):t?a.translate("account_management.phone_changed",{shopName:l,phone:Hu(t)}):null),[e,t,l,a,o]);return p?n(x,{padding:"small-200 none none none",children:n(Ne,{tone:"info",children:p})}):null}const Hu=e=>n(V,{type:"strong",children:e});function zu({url:e,displayName:t}){return n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[n(x,{inl
2ineSize:"16px",blockSize:"16px",children:n(Le,{src:e,alt:"",accessibilityRole:"presentation",inlineSize:"fill",aspectRatio:"auto"})}),n(V,{size:"medium",type:"strong",children:t})]})}const ju={amazonPay:class extends Lu{get displayContent(){return{contact:Nu(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(zo,{wallet:vt.AmazonPay,size:e})}},applePay:class extends Lu{get logo(){return n(zo,{wallet:"APPLE_PAY_BORDERLESS",size:"xsmall"})}},buyWithPrime:class extends Lu{get displayContent(){return{contact:Nu(this.appContext.checkout.proposal.proposed.email.value,this.appContext.checkout.proposal.proposed.shippingAddress.fields.firstName.value)}}get logo(){return n(zo,{wallet:vt.BuyWithPrime,size:"large"})}},businessCustomer:class extends Lu{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.fields?.buyerIdentity.value}get isOrderOrDraftSession(){return Te(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 Vu(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 Lu{get buyerIdentity(){return this.appContext.checkout.proposal.negotiated.value.buyerIdentity}get logo(){return Vu(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 Lu{get logo(){const e=this.isEmbeddedPartner?"xxxsmall":"xxsmall";return n(zo,{wallet:"GOOGLE_PAY",size:e})}},payPal:class extends Lu{get displayContent(){return{contact:this.payPalEmail||this.email}}get logo(){const e=this.isEmbeddedPartner?"xxsmall":"small";return n(zo,{size:e,wallet:"PAYPAL_EXPRESS"})}get payPalEmail(){const e=ga(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(Fu,{email:this.email}):null}get displayOptions(){return{vaultedContactType:"base",contentLayout:void 0,children:this.children}}},sdkCartHints:class extends Lu{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 De({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)&&Me({isFlagshipPartner:Boolean(this.appContext.embed?.isFlagshipPartner),hasError:this.hasError,hasOnlyDigitalItems:Be(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:{hasViolations:e}}=this.providerData;return e}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=Jt({embedder:e?.embedder,shop:this.appContext.shop}),a=e?.interstitialPartnerDisplayName,i=e?.interstitialPartnerProfileIconUrl;return t&&a&&!0===e?.isFlagshipPartner&&this.appContext.checkout.identity.customerContactMethodPrefilled?i?n(zu,{url:i,displayName:a}):Vu(void 0,this.email):n(J,{type:"email",size:"fill"})}get displayOptions(){return{vaultedContactType:"rollup",expandable:!0,children:n(Gi,{showEmailMarketingOptIn:!1})}}get displayableContactViolations(){const{violations:e,negotiationStage:n}=this.providerData.violationsSubscriptionResult,t=fa(this.email)||this.appContext.shop.contactInfoOptions.includes("PHONE")&&fa(this.phone),a="negotiation"===n&&!this.appContext.embed?.isFlagshipPartner&&t;return Array.from(e).filter((({code:e})=>!a||"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=Yo(e,a.emailBlank),t=Wo(e,a.emailInvalid),i=n??t;if(i)return{field:"email",error:i}}else if(n&&t){const e=Yo(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 Lu{#t;#a;constructor(e,n){super(e,n),this.#t=(this.appContext.mobileCheckoutSdk.enabled||Boolean(this.appContext.embed?.isCheckoutKit()))&&Zt(this.appContext.shopPay.app.config),this.#a=ba(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(Fu,{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 Uu extends Error{constructor(){super("Guest identity should never be instantiated. Guest identity has vaultedSections.contact=false, so VaultedContact never renders."),this.name="GuestIdentityError"}}const Gu=new _a(0,0,100);function Yu(){const e=pt(),a=e.checkout.identity.current.value,i=d((()=>({appContext:e,identitySource:a})),[e,a]),r=ze().value,l=e.client.unstable_getSerialization("logoutUrl")||"",o=function(){const e=pt(),n=je(),a=Ue(),i=Ge(),r=Ye(),l=function(){const{checkout:{wallets:e}}=pt(),{persistedPayPalSignal:n,inMemoryPayPalParts:{accountStatus:t}}=mt(),{clearForcedCheckoutLayout:a}=we(ya),i=h((()=>{n.value={isVenmo:!1},t.value={status:"not_connected"},a({wallet:e.escalatedWallet.value})}),[e.escalatedWallet,n,t,a]);return Oe({onClick:i,shouldResetCustomerInfo:!0,skipRedirect:!0})}(),o=g({amazonPayCheckoutAsGuest:n,applePayCheckoutAsGuest:a,buyWithPrimeCheckoutAsGuest:i,googlePayCheckoutAsGuest:r,payPalCheckoutAsGuest:l});return t((()=>{const n=o.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=Bl(),u=function(){const{shopPay:e,mobileCheckoutSdk:t,embed:a,router:i}=pt(),r=i.currentUrl.value,l=Boolean(a?.isFlagshipPartner)?"small":"medium",o=(t.enabled||a?.isCheckoutKit())&&Zt(e.app.config),s=ba(r.search),d=qo({foregroundColor:Kl}),u=qo({foregroundColor:Gu});if(o||s||!e.visibility.showVaultedContactInlineLogo)return null;let c;return c=d?"branded":u?"white":"black","shop"!==e.logoBrand?n(Ko,{color:c,size:l}):n($o,{color:c,size:l})}(),c=function(){const e=St(),{i18n:n,observability:t,userEvents:a,source:i,checkout:r,shop:l,persistence:o,shopPay:s,router:d}=pt(),{visibility:u,app:{config:c}}=s,p=Zt(c),{replaceShopPayInHistory:m}=Ca(),v=h(((e,n)=>
2{if("success"!==n.status)return r.unstable_setRedirectingExternally(!1),void t.log("shop_pay_switch_account_session_clear_failed","Shop Pay account switch session clear did not succeed",{status:n.status});o?.clearAll();const a=new URL(window.location.href);a.pathname=d.resolve(Pa).pathname,a.searchParams.set(Sa,"1"),m(a.toString())}),[r,t,o,m,d]),y=xe(v),{label:g}=Ve(),f=Fe({clearPii:!0}),b=He(),_=Boolean(s.config.isReferral),C=h((()=>{r.unstable_setRedirectingExternally(!0),a.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Mt(i,r,l),action:"switch_account"}},{exportImmediately:!0});const n=e.block();e.waitForPendingNegotiations().then((()=>y())).catch((()=>{r.unstable_setRedirectingExternally(!1)})).finally(n)}),[y,a,i,r,l,e]),P={onClick:b?()=>{}:C,label:n.translate("account_management.switch_account")},S={onClick:f,label:g},A=[];return u.showSwitchAccountAction&&A.push(P),u.showCheckoutAsGuestKebabLink&&!_&&A.push(S),!p&&u.showSwitchVaultedContactMenu?A:void 0}(),p=Y(Aa),m=xe(h((()=>{e.persistence?.clearAll(),window.location.assign(l)}),[e,l])),v=h((()=>{e.checkout.unstable_setRedirectingExternally(!0),m().catch((()=>{e.checkout.unstable_setRedirectingExternally(!1)}))}),[e.checkout,m]);return d((()=>function(e,n){const t=e.checkout.identity.current.value;if("guest"===t)throw new Uu;return function(e,n,t){return new(0,ju[e])(n,t)}(t,e,n)}(i.appContext,{accountInfo:{logoutAndClearProposal:v,showLogoutLink:r},loadShopPayVerification:s.value,shopPayLogo:u,shopPayMoreOptions:c,checkoutAsGuest:o,violationsSubscriptionResult:p})),[i,v,r,s.value,u,c,o,p])}function Wu(e){const n=m(void 0),t=e.email,a=e.phone,i=Boolean(t||a);s((()=>{const r=n.current,l=Boolean(r),o=Boolean(r?.email||r?.phone),s=!l||r?.email!==t||r?.phone!==a;e.shouldTriggerValidation&&s?e.triggerClientSideValidation():l&&!o||i||!e.shouldClearClientSideValidation||e.clearClientSideValidation(),n.current={email:t,phone:a}}),[t,i,a,e]),s((()=>{e.shouldMapServerViolationsToClient&&e.mapServerViolationsToClient()}),[e])}function qu({emailAddress:e,phone:t,logo:a,moreOptions:r,emailAlignment:l="end",children:o}){const{i18n:s,shop:d}=pt(),u=ft(),c=d.hasFlagEnabled(Ea)?t:void 0,p=e??(c?void 0:u.email.value),h=p||c||n(M,{});return n(i,{children:[n(ne,{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:l,justifyItems:l,children:[a,n(x,{maxInlineSize:"100%",children:"string"==typeof h?n(ee,{children:[!p&&c&&n(i,{children:[n(V,{accessibilityVisibility:"exclusive",children:s.translate("contact.phone_label")})," "]}),n(We,{children:h})]}):h}),r&&n(Lo,{accessibilityLabel:s.translate("review.account_more_actions"),positionArea:"block-end",options:r})]}),o]})}function $u({layout:e,emailAlignment:t,...a}){const{i18n:i}=pt(),r=n(qu,{...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(x,{padding:"base none",children:n(F,{gap:"base",children:r})});default:return n(x,{role:"region",accessibilityLabel:i.translate("customer_account.rollup_label"),padding:"small-200 none base none",children:r})}}function Ku(){const e="contact",t=od(e),r=h((()=>t.value=!t.value),[t]),l=Yu();Wu(l);const o=f(!1),d=Kt(),u=m(!1),{embed:c,i18n:p}=pt(),v=l.displayOptions,{vaultedContactType:y}=v,{label:g,contact:b,useSummaryInContent:_}=l.displayContent,C=l.email,P=l.displayPhone,S=l.hasError;if(s((()=>{l.hasError&&(t.value=!0)}),[l.hasError,t]),"hidden"===y||l.shouldHide&&!u.current)return null;u.current=!0;const A=_?b:void 0,E="amazon"===c?.embedder?{compact:A}:{primary:A};return"rollup"===y?n(Ll,{id:e,label:g??p.translate("contact.contact_method_title"),primaryContent:E.primary,compactContent:E.compact,open:t.value||S,onToggle:S||!v.expandable?void 0:r,icon:l.logo,children:v.children??null}):n(i,{children:[n($u,{emailAddress:b,phone:P,logo:l.logo,moreOptions:l.moreOptions,layout:v.contentLayout,children:v.children??null}),l.showShopPayVerification?n(a,{when:d,children:n(Yi,{email:C??"",open:o.value,showPopover:e=>{o.value=e}})}):null]})}function Xu(){return qe(new Set([...ka].filter((e=>e.startsWith("DELIVERY_COMPANY")))))}function Ju({loading:e,countryCode:n,phone:t}){const a=wa(),{i18n:i,checkout:r}=pt(),l=r.configuration.addressSettings.nonBillingAddressSettings.value,o=d((()=>l.isRequired("phone",{countryCode:n})),[n,l]),{validatePhoneNumber:u,isPhoneNumberUtilLoaded:c}=Xo(),p=h((e=>{const t=fa(e);return o&&!t?i.translate("field_errors.phone_blank"):t&&!u(e??"",n)?i.translate("field_errors.shipping_line_phone_invalid"):void 0}),[o,u,n,i]),v=m(!1);return s((()=>
2{if(v.current||!c||e)return;const n=p(t);a.value=n,v.current=!0}),[o,c,e,t,a,p]),d((()=>({errorSignal:a,validatePhoneField:p,isPhoneRequired:o})),[a,o,p])}const Zu=new Set(Oa);function Qu(){const{shopPay:e,checkout:n,source:t,observability:a}=pt(),{deliveryMethodsAddressErrors:i}=Ut(),r=jo(),{shippingAddress:l}=ft(),o=l.value,d=n.configuration.addressSettings.nonBillingAddressSettings.value,u="simulated"===t.type,c=$e(o.countryCode,void 0,d),p=n.addressManager.shipping.value.selectedAddress.value,h=p?.address.countryCode,v=$e(h??o.countryCode,void 0,d,null),{details:y}=Ia(h),g=!h||void 0!==y&&!y.isFallback,{clearViolations:f}=$(Zu),b=m(!0);return s((()=>{b.current?b.current=!1:f()}),[f,o]),io("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(!u){const r=n.addressManager.shipping.value.selectedAddress.value,l=n.proposal.negotiated.fields.buyerIdentity.value?.customerProfile;if(r&&"CustomerProfile"===l?.__typename&&l.shippingAddresses.some((e=>e.id===r.id))){const l=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(!g||r.address.countryCode!==h)return s();const d=v(r.address,"shipping");if(0===d.size)return s();const u=c(o,"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(d.keys()).sort().join(","),proposalInvalidFields:Array.from(u.keys()).sort().join(","),proposalDiverges:!Ra(o,r.address),outcome:e})}catch{}};if(0===u.size){const a=e.user.addresses.value.find((e=>Ra(e.address,o)));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:o,selectAddress:!0,addressErrorsOverride:i});return p(r.success?"vaulted_proposal":"vault_proposal_rejected"),r}return p("blocked_client_side"),Zo({addressType:"shipping",validate:()=>u,setErrors:l})}}if(e.session.selectedShippingAddress.value||e.user.addresses.value.length)return{success:!0};const l=Zo({addressType:"shipping",validate:()=>c(o,"shipping"),setErrors:e=>{_((()=>{for(const[n,t]of e)i[n].value=t}))}});return l.success?"authenticated_user"===e.user.flow.peek()?t("intercept_shipping_address_add_new",{address:o,addressErrorsOverride:i}):{success:!0}:l})),null}const ec=()=>{const{shopPay:e}=pt(),{geolocation:n}=Ke(),{shippingAddress:a}=ft();return t((()=>{const t=a.value;return e.signup.phoneCountryCode.value??t.countryCode??n.country.code}))};function nc({padding:e}){const{i18n:t,shopPay:a}=pt(),{shopPayMobilePhoneInputShownSignal:i}=Ut(),r=ec(),l=Boolean(a.user.phoneNumber.value),o=(()=>{const{i18n:e,shopPay:n}=pt(),{isPhoneNumberUtilLoaded:t,validatePhoneNumber:a}=Xo(),i=ec(),r=h((n=>fa(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 Ta(n.signup.phoneNumberRawSignal,n.signup.phoneErrorRawSignal,r)})();S((()=>(i.value=!0,()=>{i.value=!1})),[i]);const d=m(r.peek());(()=>{const{shopPay:e,checkout:n}=pt(),t=n.configuration.addressSettings.nonBillingAddressSettings.value,{shippingAddress:a}=ft(),i=e.signup.phoneNumber.value,r=e.signup.phoneError.value,l=a.fields.countryCode.value,o=a.fields.phone.value,{deliveryMethodsAddressErrors:d}=Ut(),u=d.phone.value,{setAddressError:c}=Xe(d),p=ec(),{isPhoneNumberUtilLoaded:h}=Xo(),v=m(!1),y=es(p.value,i,!0);s((function(){o&&!i&&e.signup.unstable_setPhoneNumber(o);const n=e.signup.phoneCountryCode.value;l&&!n&&e.signup.unstable_setPhoneCountryCode(l)}),[]),s((()=>{if(!v.current&&h&&i){const{prefix:n}=y;i.startsWith(n)||e.signup.unstable_setPhoneNumber(`${n}${i}`),v.current=!0}}),[h]),Na((async({parts:n,reason:a})=>{if("negotiation"!==a)return{behavior:"allow"};const{shippingAddress:i}=n;let r=e.signup.phoneNumber.peek();r&&r!==y.prefix||(r=void 0);const l=i.peek().phone;return{behavior:"allow",perform(){r!==l&&t.isVisible("phone",{countryCode:p.value,useMerchantSettings:!0})&&(i.fields.phone.value=r)}}})),s((function(){r!==u&&c("phone",r)}),[r,u,c])})();const u=h((e=>{a.signup.unstable_setPhoneCountryCode(e)}),[a.signup]);return n(F,{gap:"base",padding:e,children:[n(Qo,{name:"phone",countryCode:d.current,label:t.translate("mobile_phone_number.label"),autocomplete:"shipping tel",requireCountryCode:!0,disabled:l,onSelectedCountryChange:u,...o}),n(ee,{type:"small",color:"subdued",children:t.translate("mobile_phone_number.disclaimer")})]})}const tc="shipping";function ac({filteredFields:e,additionalFieldGroups:t,children:i,settings:r}){const{deliveryMethodsAddressErrors:l}=Ut(),{shippingAddress:o}=ft(),d=La(),{shouldGateCrossBorder:u,crossBorderGate:c}=ts(),p=pt(),{checkout:h,i18n:v,userEvents:y,source:f,shop:b}=p,{configuration:C}=h,P=C.isAddressDelegationEnabled,{violations:S}=$(ka),A=o.fields?.countryCode.value,E=Je(A),k=m(!1);s((()=>
2{if(!P)return;if(k.current)return;if(0===S.size)return;if(k.current=!0,Object.values(l).some((e=>{const n=e.value;return n&&"object"==typeof n&&"client"===n.origin&&"inline-validation"===n.type})))return;const e=E(tc,Array.from(S));_((()=>{for(const[n,t]of e)void 0===l[n]?.value&&(l[n].value=t)}))}),[P,S,E,l]);const w=C.addressSettings.nonBillingAddressSettings.value,O=o.value,I=Da(),{hasViolations:R}=$(Zu),T=C.defaultPhoneNumber.value;w.isRequired("phone",{countryCode:O.countryCode,useMerchantSettings:!0})&&!O.phone&&T&&(o.value={...O,phone:T});const N=g(Boolean(e&&e.length>0)),L=C.trackAddressAutoComplete?()=>{y.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Mt(f,h,b),action:"address_autocomplete"}})}:void 0,D=n(yo,{id:"shippingAddressForm",addressType:tc,address:o,countries:d,settings:r,addressErrors:l,additionalFieldGroups:t,showSavedAddressSelector:!1,onAddressAutoComplete:L,onBeforeCountryChange:(e,n,t)=>{u(e)?c(n,{onCancel:t}):n()},filteredFields:e,children:i}),M=n(a,{when:N,fallback:D,children:n(x,{background:"base",borderRadius:"base",className:Ma({colorLayer:"controlSelected"}),paddingInline:"base",paddingBlockStart:"large-100",paddingBlockEnd:"base",children:n(F,{direction:"block",gap:"base",children:[n(x,{padding:"none",children:[n(ee,{children:[O.firstName," ",O.lastName]}),n(Jo,{address:O,hiddenFields:["firstName","lastName","phone"],textColor:"subdued"})]}),D]})})});return n(ns,{impressionType:"delivery_address",impressionFeatures:[],children:[ic(p)&&n(Qu,{}),R&&C.visibility.showInvalidDeliveryAddressBanner.value&&n(x,{children:[n(Wi,{}),n(me,{blockSize:"base"})]}),n(a,{when:I,children:n(x,{children:[n(Ne,{tone:"info",children:v.translate("address_management.draft_order_delivery_address_reminder")}),n(me,{blockSize:"base"})]})}),M,n(a,{when:C.visibility.showStandalonePhoneField,children:n(nc,{padding:"base none none none"})})]})}function ic({checkout:e}){return"shopPay"===e.identity.current.value}const rc=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 lc(){const e=Ze(),{paymentLines:n}=ft(),{walletUsedForSubmissionSignal:a}=mt();return t((()=>e.value||us({paymentLines:n.value,walletUsedForSubmission:a.value})))}function oc(e,n){return e.isAddressDelegationEnabled&&"shopPay"!==n&&!Ha(n)}const sc=new Set([...ka,...Va,...Oa,...za]),dc=["phone","zoneCode","countryCode","firstName","lastName","name"],uc=["phone","zoneCode","countryCode","firstName","lastName","name","coordinates","oneTimeUse"];function cc(e){return"pending"===e||"pendingCollapsed"===e}function pc(e){return"collapsed"===e||"pendingCollapsed"===e}function hc({summary:e,forceOpen:r,initiallyOpen:l=!1,renderRollup:o}={}){const{shippingAddress:d}=ft(),{allViolations:u}=Et(),c=function(){const e=Et().buyerIdentity.value?.purchasingCompany,t=Ce();return e?n(Eu,{formattedAddress:t}):void 0}(),p=c??e,C=g(function(){const{i18n:e}=pt(),{hasViolations:t}=$(Va),{hasViolations:a}=$(Fa),{hasError:i,error:r}=w(xa),l=re(r?{type:"payment",code:r}:void 0);return i&&l?n(Ae,{tone:"critical",errorType:H.DeliveryError,children:l}):t?n(Ui,{message:e.translate("shipping_errors.shipping_method_not_available_generic.one")}):a?n(Ui,{message:e.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions")}):null}()),P=Da(),{embed:A,i18n:E,shopPay:k,observability:O,userEvents:I,checkout:R,source:T,shop:N}=pt(),L=A?.client?.addressErrors.value.includes(ja.AddressEmpty)??!1,D=La(),{installments:M}=k,B="shopPay"===R.identity.current.value,{isMissingPhone:z}=To(),{isMissingFirstName:j}=No(),U=z||j,Y="google"===A?.embedder,W=R.configuration.addressSettings.nonBillingAddressSettings.value,q=t((()=>Y&&W.isVisible("phone",{countryCode:d.value?.countryCode}))),{formattedNumber:K}=es(d.value?.countryCode??"",q.value?d.value?.phone:void 0),X=t((()=>oc(R.configuration,R.identity.current.value))),{deliveryMethodsAddressErrors:Z}=Ut(),Q=t((()=>Object.values(Z).some((e=>void 0!==e.value)))),ee=t((()=>Boolean(d.value?.countryCode&&!D?.some((e=>e.value===d.value.countryCode))))),ne=function({checkout:e,i18n:t},a){return e.configuration.visibility.showInvalidDeliveryAddressBanner.value?n(Wi,{}):a?n(Ui,{message:t.translate("shipping_errors.unavailable_address_country")}):null}({checkout:R,i18n:E},ee.value),te=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}(d.value,X.value?uc:dc))),[ae,ie]=b([]),{availableDeliveryAddresses:le,mustSelectProvidedAddress:oe}=R.proposal.negotiated.fields,se=t((()=>le.value??[])),ue=t((()=>oe.value??!1)),ce=G("Checkout::DeliveryAddress::RenderBefore"),pe=G("purchase.checkout.delivery-address.render-after"),me=Xl([...ce,...pe],{lazyReveal:!0}),ve=nn(),ye=t((()=>se.value?.length&&Boolean(se.value.find((e=>
2Ra(d.value,e.address)))))),ge=t((()=>Boolean(ye.value&&ue.value))),fe=tn(),be=Kt(),_e=Ua(an),Pe=t((()=>be.value&&"loading"===_e.uiStateSignal.value?.status)),ke=t((()=>"filled"===_e.uiStateSignal.value?.status)),we=t((()=>!X.value||!te.value&&ke.value)),Oe="deliveryAddress",Ie=od(Oe,y((()=>l||(me.value||ge.value)&&we.value))),Re=function(e,n){const[t,a]=b(rc(e)),i=m(null),r=f(!1);"vaulted"===t&&rc(e)!==t&&a("write"),"unknown"===t&&rc(e)!==t&&a(rc(e));const l=h((e=>{i.current=e,n.value&&e&&r.value&&(r.value=!1,e.focus())}),[r,n]);return v((()=>{n.value&&i.current&&r.value&&(r.value=!1,i.current.focus())})),{status:t,inputRef:l,focus:h((()=>{r.value=!0,a("write"),n.value&&i.current&&(r.value=!1,i.current.focus())}),[r,n])}}(fe,Ie),Te=m(null),Le=m(null),De=m(!1),Me=f("idle"),Be=cc(Me.value),xe=pc(Me.value),Ve=f(!1),Fe=ad(Ga([...ce,...pe],"uiExtension").map(Wt),h((()=>{we.value&&(Ie.value=!0)}),[we,Ie]));s((()=>{Fe&&we.value&&(Ve.value=!0)}),[Fe,Ve,we.value]);const He=t((()=>X.value&&Ve.value));s((()=>{we.value&&(me.value||Fe)&&(Ie.value=!0)}),[me.value,we.value,Fe,Ie]),S((()=>{ve.current&&(X.value&&te.value||X.value&&xe||!1===ye.value&&(Ie.value=!0))}),[ye.value,Ie,ve,X.value,te.value,xe]),sd({isMissing:U,open:Ie});const ze=de(),je=ze.value.deliveryAddressErrors,Ue=t((()=>ze.value.deliveryAddressErrors.length>0)),Ge=lc().value||"payPal"===R.identity.current.value,{hasViolations:Ye,violations:We,clearViolations:qe}=$(sc),{missingAddressFieldSignal:$e,hasResolvedMissingAddressFieldSignal:Ke}=function({countryCode:e,addressType:n,addressViolations:t}){const{shop:a,checkout:{identity:i}}=pt(),r=a.hasFlagEnabled(Ba),l=f(void 0),{violations:o}=Qe(t),s=Je(e),d=f(!1),u="applePay"===i.current.value||"googlePay"===i.current.value||"payPal"===i.current.value;if(r&&u&&void 0===l.value&&o.size>0&&!d.value){d.value=!0;const e=s(n,Array.from(o)),t=en({addressErrors:e});t&&(l.value=t)}return{missingAddressFieldSignal:l,hasResolvedMissingAddressFieldSignal:d}}({countryCode:d.value?.countryCode,addressType:"shipping",addressViolations:ka}),Xe=t((()=>Boolean($e.value)&&!Ie.value)),Ze=new Set([...z?Ya:[],...j?Wa:[],...Xe.value?ka:[]]),on=Sl(Ye,We,Ze),{hasError:sn,clearError:dn}=w(xa),un=M.agreementError.value===rn.InvalidShippingAddress,cn=ha("deliveryNext"),pn=t((()=>!be.value||cn.value));v((()=>{Pe.value&&y((()=>{dn(),M.unstable_setAgreementError(null)}))}));const hn=h((()=>{qe(),dn(),M.unstable_setAgreementError(null)}),[qe,dn,M]),mn=Se(d.value,{hiddenFields:["phone"],displayName:!1}),vn=E.formatName(d.value?.firstName,d.value?.lastName,!0),yn=d.value?.firstName&&d.value?.lastName?vn:void 0,gn=Ee({address:d.value??{}}),fn=n(a,{when:te,fallback:n(F,{children:[mn,q.value&&K&&n(V,{children:K})]}),children:n(V,{tone:"critical",children:E.translate("shipping.add_shipping_address")})}),bn=te.value?n(V,{tone:L?"critical":void 0,children:E.translate("shipping.add_shipping_address")}):yn,_n=te.value?void 0:n(F,{children:[gn.primary&&n(V,{children:gn.primary}),gn.secondary&&n(V,{children:gn.secondary}),q.value&&K&&n(V,{children:K})]}),Cn=n(a,{when:()=>te.value||!d.value?.postalCode,fallback:n(i,{children:[n(V,{children:E.translate("shipping.delivery_to")}),n(V,{type:"strong",children:yn})]}),children:n(V,{tone:"accent",decoration:"underline",children:E.translate("shipping.add_new_delivery_address")})}),Pn=t((()=>d.value?.postalCode)),Sn=n(a,{when:()=>te.value||!Pn.value,fallback:n(F,{children:[n(V,{type:"strong",children:Pn}),q.value&&K&&n(V,{children:K})]}),children:()=>""}),An=(()=>{if(p)return{primary:p};switch(A?.embedder){case"amazon":return{compact:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[Cn,Sn]})};case"google":return{primary:bn,secondary:_n};default:return{primary:yn,secondary:fn}}})(),En=t((()=>ln(u.value??[])&&!Pe.value)),kn=g(on&&!En.value||sn||un),wn=t((()=>pn.value?null:kn.value&&ne&&!Pe.value?{type:"invalid-address-banner",element:ne}:!C.value||En.value||Pe.value?!Ue.value||Ge||En.value?En.value?{type:"unavailable-in-buyer-location-banner",element:null}:null:{type:"validation-errors-banner",element:n(he,{errors:je,errorType:H.DeliveryError})}:{type:"default-vaulted-delivery-address-error-banner",element:C.value})),On=n(vc,{errorSignal:wn}),In=t((()=>Boolean(wn.value)||Ge&&Ue.value)),Rn=g(on),Tn=g(sn),Nn=g(r),Ln=g(Fe),Dn=t((()=>Q.value||Rn.value||Ue.value)),Mn=t((()=>Boolean(Nn.value)||me.value||Ln.value&&we.value||He.value)),Bn=t((()=>X.value&&cc(Me.value)&&pc(Me.value)&&!Mn.value&&!Tn.value&&!En.value)),xn=t((()=>Ke.value&&void 0===$e.value)),Vn=t((()=>Dn.value&&!Bn.value)),Fn=t((()=>X.value&&ke.value&&!Vn.value)),Hn=t((()=>Fn.value&&pc(Me.value))),zn=t((()=>Mn.value||Tn.value||xn.value||!Bn.value&&In.value)),jn=t((()=>Dn.value&&!(X.value&&cc(Me.value))||En.value||Mn.value||Tn.value));De.current=jn.value;const Un=t((()=>
2{if(X.value){if(te.value)return!1;if(Hn.value)return zn.value;if(Q.value&&!Bn.value&&(!Ke.value||!$e.value))return!0}return Ie.value||zn.value})),Gn=h((()=>{Le.current&&(clearTimeout(Le.current),Le.current=null)}),[]),Yn=h((()=>{Gn(),Me.value="idle"}),[Gn,Me]),Wn=h((()=>{if(Gn(),De.current)return Me.value="collapsed",void(Ie.value=!0);Me.value="collapsed",Ie.value=!1}),[Gn,Me,Ie]),qn=h((()=>{Gn(),Le.current=setTimeout((()=>{Le.current=null,De.current||(Me.value="pendingCollapsed",Ie.value=!1)}),300)}),[Gn,Me,Ie]),$n=h((()=>{Yn(),Ie.value=!0}),[Yn,Ie]);s((()=>Gn),[Gn]),s((()=>{X.value&&Dn.value&&!Be&&Yn()}),[Be,Dn.value,X.value,Yn]);const Kn=h((async()=>{if(!X.value||!A?.client)return;if(cc(Me.value))return;ie([]),Me.value="pending";const e=Un.value;He.value||qn();const n=performance.now();try{const a=await A.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 qa)return O.log("third_party_delivery_address_timeout","Address change timed out, falling back to manual entry.",{duration:i}),ie([{code:"GENERAL_ERROR",message:String(E.translate("shipping.third_party_address_timeout"))}]),void $n();const t=n instanceof Error?n.message:String(n);return n instanceof $a&&n.isUserCancelledError?(O.log("third_party_delivery_address_cancelled","User cancelled address selection",{duration:i}),Yn(),Ie.value=e,void Te.current?.focus()):(n instanceof Ka?(O.log("third_party_delivery_address_protocol_error","Address change failed due to protocol/schema violation",{duration:i,technicalError:t}),A.client.error({code:"INVALID_PAYLOAD",message:"Invalid response format from address selection",timestamp:Date.now()})):O.log("third_party_delivery_address_error","Address change failed with error",{duration:i,error:t}),ie([{code:"GENERAL_ERROR"}]),void $n())}const{response:r}=a;if(!r||"object"!=typeof r)return O.log("embedder_invalid_response","Invalid or missing response from embedder",{event:"checkout.addressChangeStart",duration:i,receivedResponse:r}),A.client.error({code:"INVALID_PAYLOAD",message:"Invalid or missing response from address selection",timestamp:Date.now()}),ie([{code:"GENERAL_ERROR"}]),void $n();if(r?.errors&&r.errors.length>0)return ie(r.errors),O.log("embedder_error_cancelled_operation","Address change cancelled due to embedder errors",{event:"checkout.addressChangeStart",errorCodes:r.errors.map((e=>e.code)),duration:i}),void $n();if(r?.cart){_((()=>{for(const e of Object.values(Z))e.value=void 0;qe()}));try{await A.client.applyCart(r.cart),_e.dispatch("addressReplaced"),He.value?Yn():Wn(),O.log("address_change_start_success","Successfully applied address change from embedder",{duration:i}),Te.current?.focus()}catch(t){O.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}),A.client.error({code:"INVALID_CART",message:"Failed to apply cart update after address change",timestamp:Date.now()}),ie([{code:"GENERAL_ERROR"}]),$n()}}else He.value?Yn():Wn()}catch(t){const e=performance.now()-n;O.log("third_party_delivery_address_error","Error delegating address change to embedder.",{error:t instanceof Error?t.message:String(t),duration:e}),ie([{code:"GENERAL_ERROR"}]),$n()}}),[He,X,A,O,ie,E,Z,Me,_e,qe,Un,qn,$n,Yn,Ie,Wn]),Xn=h((async()=>{if(He.value)return;if(X.value){if(Ie.value)return;return void(await Kn())}const e=!Ie.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:{...Mt(a,e,t),action:i?"shipping_addresses_expand":"shipping_addresses_collapse"}})}({userEvents:I,source:T,checkout:R,shop:N},e),Ie.value=e}),[He,I,T,R,N,Ie,Kn,X]);s((()=>{!X.value||!xe||Vn.value||zn.value?Un.value?Ie.value=!0:Hn.value&&!zn.value&&(Ie.value=!1):Ie.value=!1}),[Ie,X.value,xe,Vn.value,Un.value,Hn.value,zn.value]);const Jn=0===ce.length&&0===pe.length,Zn=1===se.value.length&&ue.value&&Jn,Qn=P.value,et=!pn.value&&!Pe.value&&!Bn.value&&on&&!(X.value&&te.value),nt=X.value&&!Bn.value&&Q.value&&!te.value,tt=et||nt,at=(()=>
2{if(X.value){const{firstName:e,lastName:t}=d.value,i=!0,r=E.formatName(e,t,i);return n(F,{children:[e&&t&&n(V,{children:r}),n(a,{when:te,fallback:n(V,{color:"subdued",children:mn}),children:n(V,{tone:"critical",children:E.translate("address_management.address_form.add_address")})})]})}return p??mn})(),it=te.value?E.translate("shipping.add_shipping_address"):void 0,rt=fe&&!Un.value?n(as,{vatNumber:fe.taxId.value,onAdd:()=>{Ie.value=!0,Re.focus()}}):void 0,lt=Xe.value?n(x,{padding:"none base base base",children:n(ac,{filteredFields:$e.value?[$e.value]:void 0})}):void 0,ot=lt&&rt?n(F,{direction:"block",gap:"base",children:[lt,rt]}):lt??rt,st=n(Ne,{tone:"info",children:E.translate("address_management.draft_order_delivery_address_reminder")}),dt=Hn.value&&!zn.value||Bn.value?null:P.value?n(i,{children:[On,st]}):wn.value?On:null,ut=Xe.value?{}:{primaryContent:An.primary,secondaryContent:An.secondary,compactContent:An.compact,inlinePrimaryContent:bn,inlineSecondaryContent:_n,compactPrimaryContent:Cn,compactSecondaryContent:Sn,summary:at},ct={buttonRef:Te,open:Ie.value,id:Oe,label:E.translate("shipping.shipping_address_title"),error:dt,buttonAccessibilityLabel:it,...ut,secondaryPersistentContent:ot,onToggle:Qn?void 0:Xn,disabled:He.value||Zn||!Fn.value&&tt,renderChildrenWhenCollapsed:!0,icon:n(J,{id:"deliveryAddress-truckIcon",type:"truck",size:"fill"})},ht=n(Js,{embedderErrors:ae,onDismissEmbedderErrors:()=>ie([]),showMissingAddressField:Xe.value,onAddressDelegation:Kn,onFirstNamePersisted:hn,vatIdFieldMode:Re});return n(i,{children:[B&&n(Qu,{}),o?o(ct,ht):n(Ll,{...ct,children:ht})]})}const mc=({errorBanner:e})=>n(x,{paddingBlock:"small-500",children:e}),vc=({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(mc,{errorBanner:t.element});case"unavailable-in-buyer-location-banner":return n(mc,{errorBanner:n(qi,{})});default:A(a)}};function yc(){const{formattedAddress:e,address:{phone:t,countryCode:a}}=on(["company"]),r=!D().value,{errorSignal:l}=Ju({loading:r,phone:t,countryCode:a}),o=Boolean(Xu()?.length),s=Boolean(sn()?.length),d=Boolean(l.value),u=Boolean(s||o||d);return n(hc,{summary:r?n(M,{}):n(F,{direction:"inline",children:[u&&n(i,{children:[n(J,{tone:"critical",type:"alert-circle"}),n(me,{display:"inline",inlineSize:"small-400"})]}),e]}),forceOpen:u})}function gc(e){const{checkout:{identity:a}}=pt(),i=function(){const e=Et().buyerIdentity,n=dn(),a=un();return t((()=>Boolean(e.value?.purchasingCompany)&&(!n.value||a.value)))}();return"amazonPay"===a.current.value||"buyWithPrime"===a.current.value?n(yc,{}):i.value?n(wu,{}):n(hc,{...e})}function fc(){const{i18n:e,router:i}=pt(),r=Et().buyerIdentity.value?.purchasingCompany,l=Vo(),o=un(),s="deliveryAddress",d=t((()=>ld(i,s)));return!r||r.contact.locationCount<=1||o.value?n(k,{id:s,level:1,autoFocus:d.value,children:e.translate("shipping.delivery_title")}):n(ne,{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(k,{id:s,level:1,autoFocus:d.value,children:e.translate("contact.ship_to_company",{companyName:r.location.name})}),n(a,{when:l,children:n(Ml,{})})]})}function bc(){const{i18n:e}=pt(),{eligibility:t,redeemableBalance:a,messages:i,isDigitalGoodsRedemptionAllowed:r}=Pu(),l=(t.eligible||r)&&a,o=i.length>0?n(F,{gap:"small-200",children:i}):void 0;return l||o?l?n(_c,{redeemableBalance:a,messages:o}):n(Ll,{id:"cashRedemption",open:!1,label:e.translate("order_summary.shop_cash_title"),error:o}):null}function _c({redeemableBalance:e,messages:t}){const{i18n:a}=pt(),{amount:i,checked:r,handleChange:l,disabled:o}=du(e),s=e?a.formatCurrency(e.amount,{currency:e.currencyCode,form:"short"}):void 0;return n(Ll,{id:"cashRedemption",open:!0,label:a.translate("order_summary.shop_cash_title"),primaryContent:s,error:t,primaryAction:n(Qd,{checked:r,onChange:l,disabled:o}),children:n(V,{fonts:"primary",tone:"accent",children:i})})}function Cc({onShowPickupLocations:e}={}){const{i18n:i}=pt(),r=fe(),[l]=cn(),o=l.includes("PICK_UP"),{value:s}=pn().value,{value:d}=hn().value,u=Boolean(s||d),c=$i({mode:"localPickup"}),p=t((()=>c.value.merchandiseLines)),h=t((()=>c.value.allowAlternativeAction)),m=t((()=>c.value.merchandiseLines.length>0)),v=mn(),y=u&&!m.value;if(!o||!r.value.delivery)return null;const g=m.value&&u;return n(Xi,{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(x,{paddingBlockStart:"small-400",paddingBlockEnd:y?"small-400":void 0,children:n(k,{level:2,children:i.translate("delivery_options.pickup")})})}),n(a,{when:m,children:n(Ki,{bannerType:"pickup",merchandiseLines:p,allowAlternativeAction:h})}),n(Pc,{hasNoDeliveryMethods:u,onShowPickupLocations:e})]})})}function Pc({hasNoDeliveryMethods:e,onShowPickupLocations:r}){const{i18n:l}=pt(),o=mn(),s=Xa(),{progressing:d}=be(),u=ha("deliveryNext").value,c=Kt(),{isOnlyCountryAvailable:p}=Ji(),h=f(!1),m=t((()=>s.value?.methods??[])),v=t((()=>{const e=s.value;return e&&Ja(e)})),y=t((()=>m.value.length>
20&&Zi(m.value))),b=g(Y(Za).hasViolations),_=Qi({allLocationsFarAway:y,selectedPickupOptionNoLongerAvailable:b}),C=vn({methods:m.value,selectedDeliveryMethodHandle:v.value?.handle}),P=t((()=>yn(s.value?.targetMerchandiseLines))),S=t((()=>er(m.value,p,P.value,l,{selectedDeliveryMethodHandle:v.value?.handle,allLocationsFarAway:y.value}))),A=()=>{C(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:_,children:n(nr,{itemCount:P.value,methods:m.value,onChangeLocationClick:A})}),n(F,{direction:"inline",gap:"small-400",alignItems:"center",justifyContent:"space-between",paddingBlockStart:o.value?void 0:"small-200",paddingBlockEnd:o.value?"small":"small-200",children:[c.value&&!d.value&&u?n(M,{inlineSize:"base"}):n(V,{color:"subdued",children:S}),n(tr,{onClick:A})]}),r?null:n(ar,{methods:s.value?.methods,type:s.value?.type,open:h.value,onClose:()=>{h.value=!1}})]})}const Sc={isLocationFormVisible:!1};function Ac({initiallyOpen:e=!1,renderRollup:a}){const{i18n:r,shop:l}=pt(),{deliveryNext:o}=Et(),{progressing:s}=be(),d=ha("deliveryNext"),u=Kt(),{value:c}=pn().value,{value:p}=hn().value,h=Boolean(c||p),v=Xa(),y=t((()=>Qa(o.value)??[])),g=t((()=>l.shipPickupInOneOrderEnabled?v.value&&Ja(v.value):y.value[0])),_=t((()=>g.value?.handle??"")),C=t((()=>({handle:_.value}))),P=ir(),{isOnlyCountryAvailable:S}=Ji(),A=Se(g.value?.pickupLocation?.address,{hiddenFields:["postalCode","countryCode","phone"]}),E=G("Checkout::PickupLocations::RenderBefore"),k=G("Checkout::PickupLocations::RenderAfter"),w=G("purchase.checkout.pickup-location-option-item.render-after"),O=E.length>0?n(gn,{customizations:E,options:Sc}):void 0,I=k.length>0?n(gn,{customizations:k,options:Sc}):void 0,R=rr(),T=vn({methods:y.value||[],selectedDeliveryMethodHandle:g.value?.handle}),[N,L]=b(!1),D=f(e),B=f(!1),x=e=>{L(!0),B.value=e??!1},{currentAdditionalLocations:V,additionalLocationsCount:H}=function(e){const n=m(),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),z=t((()=>Boolean(V.value)||u.value&&d.value&&0!==H.value));let j,U,Y,W,q;const $=R.value?n(F,{gap:"small-200",children:n(lr,{variant:"banner"})}):void 0;if(u.value&&!s.value&&d.value)j=n(M,{}),U=n(M,{inlineSize:"base"}),Y=n(M,{inlineSize:"small"}),q=$;else if(g.value?.pickupLocation){const{cost:{amount:e,currencyCode:t},pickupLocation:{name:a}}=g.value,l="PickupInStoreLocation"===g.value.pickupLocation?.type?g.value.pickupLocation.distanceFromBuyer:void 0,o=l&&!S?or(r,l):void 0,s=0===e?r.translate("shipping.free_rate_label"):r.formatCurrency(e,{currency:t}),d="PickupInStoreLocation"===g.value.pickupLocation.type&&g.value.pickupLocation.instructions.trim();j=n(i,{children:[a,n(is,{}),s]}),U=A||void 0;const u=o||d?n(dr,{distanceLabel:o,instructions:d||void 0}):null,c=w.length>0?n(gn,{customizations:w,options:C.value}):null;Y=u&&c?n(F,{gap:"small-400",children:[u,c]}):u??c??void 0,W=O?n(F,{gap:"small-200",children:O}):void 0,q=$||I?n(F,{gap:"small-200",children:[$,I]}):void 0}const K=!d.value&&!0===h,X=h?n(tr,{onClick:()=>{x(),T(S?"checkout_pickup_geoselector_clicked_country_grain":"checkout_pickup_geoselector_clicked_other_grain")},commandFor:sr}):void 0,J=z.value?n(Ec,{locationCount:H.value,onShowModal:x,onTrackAnalytics:()=>T("checkout_pickup_buyer_reveal_more")}):void 0,Z=a?{id:"pickupLocations",label:r.translate("delivery_options.pickup"),open:D.value,disabled:K||w.length>0,onToggle:()=>{D.value=!D.value},primaryContent:j,secondaryContent:U,primaryPersistentContent:W,secondaryPersistentContent:I}:{id:"pickupLocations",label:r.translate("local_pickup.title"),open:K,primaryContent:j,secondaryContent:U,tertiaryContent:Y,primaryPersistentContent:W,secondaryPersistentContent:q,primaryAction:X,secondaryActions:J},Q=n(Zs,{onShowModal:x}),ee=a?n(F,{gap:"base",children:[n(Uo.Provider,{value:!1,children:n(Cc,{onShowPickupLocations:()=>x()})}),X,Q,J]}):P&&Q;return n(i,{children:[a?a(Z,ee):n(Ll,{...Z,children:ee}),n(ar,{methods:v.value?.methods,type:v.value?.type,open:N,onClose:()=>{L(!1),B.value=!1},addressFocus:B})]})}function Ec({locationCount:e,onShowModal:i,onTrackAnalytics:r}){const{progressing:l}=be(),o=ha("deliveryNext"),s=pn(),d=t((()=>l.value||!o.value&&!s.value.loading));return n(a,{when:d,fallback:n(M,{}),children:n(kc,{locationCount:e,onShowModal:i,onTrackAnalytics:r})})}function kc({locationCount:e,onShowModal:t,onTrackAnalytics:a}){const{i18n:i}=pt();return e?n(z,{variant:"plain",textDecoration:"none",inlineAlignment:"start",onClick:()=>{t(),a()},children:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:n(V,{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 wc({destination:e}){const t=f(!1),a=f();return n(i,{children:[n("deliveryAddress"===e?gc:Ac,{initiallyOpen:t.value,renderRollup:(e,n)=>(a.value={props:e,content:n},null)}),n(Oc,{rollup:a,switched:t})]})}function Oc({rollup:e,switched:t}){const a=e.value;return a?n(Ll,{...a.props,children:n(F,{gap:"base",children:[n(Ic,{switched:t}),a.content]}
2)}):null}function Ic({switched:e}){const t=fn();return t?n(ur,{options:t.options,selected:t.selected,select:n=>{e.value=!0,t.select(n)},showChangedBanner:!1}):null}const Rc=new Set(["SHIPPING","PICK_UP"]);function Tc(){const{checkout:e,shop:n}=pt(),a=g(fn()),i=n.hasFlagEnabled(ei);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})=>Rc.has(e)))&&1===t.length&&Rc.has(t[0])}(e.configuration.deliveryMethodSelectorPlacement,a.value?.options.value,a.value?.selected.value)))}const Nc=()=>{const{i18n:e}=pt(),t=f(!0),{value:a}=Et().optionalDuties,i=a?.buyerRefusesDuties?e.translate("shipping.duties_and_taxes_options.ddu_title"):e.translate("shipping.duties_and_taxes_options.ddp_title");return n(Ll,{open:t.value,id:"optionalDuties",label:e.translate("shipping.duties_and_taxes_title"),primaryContent:i,onToggle:()=>t.value=!t.value,children:n(hs,{})})};function Lc(){const{i18n:e,checkout:t}=pt(),a=ft().shippingAddress.value,{deliveryNext:{value:i},buyerIdentity:{value:r}}=Et(),l=(t.proposal.facts.delivery??[])[0],o=r?.purchasingCompany,s=o?.location.name,d=Boolean(o)&&Boolean(s),u="unavailable"===i?.status?a:l?.deliveryAddress,c=Se(u??void 0,{countryFormat:"explicit",displayName:d}),p=e.formatName(u?.firstName,u?.lastName,!0);if(l?.pickupAddress)return n(Dc,{address:l.pickupAddress??void 0});const h=u?p:e.translate("review.blocks.no_address"),m=d?s:h,v=d?e.translate("review.blocks.no_address"):void 0,y=u?c:v;return n(Ll,{id:"orderEditDeliveryAddress",label:e.translate("review.blocks.shipping_address_title"),primaryContent:m,secondaryContent:y})}function Dc({address:e}){const{i18n:t}=pt(),a=Se(e,{hiddenFields:["postalCode","countryCode","phone"]}),i=a?n(V,{children:a}):void 0;return n(Ll,{id:"orderEditDeliveryAddress",label:t.translate("local_pickup.title"),primaryContent:i})}function Mc(){const{i18n:e,checkout:t}=pt(),a=(t.proposal.facts.delivery??[])[0],i=a?.lines.filter((({deliveryChange:e,isFulfilled:n})=>"REMOVED"!==e&&!n)).map((e=>n(Br,{line:e},e.title)));return n(Ll,{id:"orderEditShippingMethod",label:e.translate("shipping.title"),primaryContent:i})}function Bc(){const{i18n:e,shopPay:n,checkout:a}=pt(),i=Tt(),{paymentMethods:r}=Et();return t((()=>function({i18n:e,shopPay:n,chargeAmount:t,numberOfPaymentTerms:a,installmentsUnavailable:i,paymentDue:r,installmentsConfig:l}){const o=Ao(n),s=r?.currencyCode,d=l?.availableLoanTypes,u=t?e.formatCurrency(t,{currency:s,form:"short"}):void 0,{payNowLabel:c,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&&u&&d&&0!==d.length?d.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments.only_interest"):d.includes("INTEREST")&&d.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments.all"):d.includes("INTEREST")?e.translate("installments.pay_in_installments.only_interest"):(g=u,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&&d&&u&&0!==d.length?2===a?h():d.includes("INTEREST")&&d.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:u}):d.includes("ZERO_PERCENT")&&d.includes("SPLIT_PAY")&&(6===a||12===a)?e.translate("installments.pay_in_installments_subt
2itle.split_pay_3_6z_12z_gb",{amount:u}):d.includes("ZERO_PERCENT")&&12===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_12z_gb",{amount:u}):d?.includes("ZERO_PERCENT")&&6===a?e.translate("installments.pay_in_installments_subtitle.zero_percent_6z_gb",{amount:u}):d.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.informational_gb"):e.translate("installments.pay_in_installments_subtitle.split_pay_3_gb",{amount:u}):e.translate("installments.pay_in_installments_subtitle.informational_gb"):d&&u&&0!==d.length?d.includes("ZERO_PERCENT")?e.translate("installments.pay_in_installments_subtitle.interest"):d.includes("INTEREST")&&d.includes("SPLIT_PAY")?e.translate("installments.pay_in_installments_subtitle.all",{amount:u}):d.includes("INTEREST")?e.translate("installments.pay_in_installments_subtitle.interest"):h():h(),y="SHOP_PAY"===o;var g;return{payNowLabel:c,payNowSubtitle:p,installmentsLabel:m,installmentsSubtitle:v,summary:"SHOP_PAY"===o?`${c} - ${p}`:`${m} - ${v}`,primaryLabel:y?c: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:ni(r.value)})))}function xc(){const{userEvents:e}=pt(),n=bn(ti.SHOP_PAY_PAY_NOW),t=bn(ti.SHOP_PAY_INSTALLMENTS),a=bn(ti.SHOP_PAY_INSTALLMENTS_DEFAULTED),i=bn(ti.SHOP_PAY_PAY_NOW_DEFAULTED);return{recordRetailEvent:h((r=>{const l=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:l})}),[e,n,t,a,i])}}function Vc({onAutoExpand:e,ineligibilityReasonLabel:n}){const{source:a,checkout:i,shop:r,observability:l,userEvents:o,shopPay:d,embed:u}=pt(),{visibility:c}=d,p=i.installments.isSupported.value,h=i.installments.isUnavailable.value,v=_n(),y=Ao(d),{paymentMethods:g}=Et(),f=t((()=>ni(g.value))),b=p?f.value?.availableLoanTypes:void 0,_=m(),C=Po(),P=d.user.installments.isRetryable.value,{recordRetailEvent:S}=xc(),A=xr();s((()=>{n&&!P&&"SHOPIFY_INSTALLMENTS"===y&&d.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOP_PAY"})}),[P,n,y,d.session]),s((()=>{d.session.isInternalProgressing.value||p&&!h&&(!v.value&&c.showAutoExpandedPaymentMethods&&e?.(),C.value.spiPreselected&&!A&&(d.session.unstable_updatePaymentMethodOption({type:"wallet",name:"SHOPIFY_INSTALLMENTS"}),l.leaveErrorBreadcrumb("SPI preselected",{})))}),[p,h,v.value,C.value.spiPreselected,d.session,l,c.showAutoExpandedPaymentMethods,A,e]),s((()=>{v.value&&p&&S(h?"default_payment_method_pay_now":"default_payment_method_installments")}),[p,h,v.value,S]),s((()=>{!h&&b&&JSON.stringify(_.current)!==JSON.stringify(b)&&(o.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...Fo(a,i,r,{embedPlatform:u?.platform,shopAppSurface:d.app.config.surface}),eventType:ai.InterestEligibility,success:ii(b),errorMessage:ii(b)?void 0:JSON.stringify(["amount"])}}),o.monorailEvent({schemaId:"shopify_pay_payment_page_installments/1.4",payload:{...Fo(a,i,r,{embedPlatform:u?.platform,shopAppSurface:d.app.config.surface}),eventType:ai.SplitPayEligibility,success:Boolean(b.includes("SPLIT_PAY")),errorMessage:b.includes("SPLIT_PAY")?void 0:JSON.stringify(["amount"])}}),_.current=b)}),[b,h,o,a,i,r,u?.platform,d.app.config.surface])}function Fc(){const{i18n:e}=pt(),t=f(!1),a=Bc(),i=Cn(),r=h((()=>{t.value=!t.value}),[t]);return Vc({onAutoExpand:h((()=>{t.value=!0}),[t]),ineligibilityReasonLabel:i}),n(Ll,{open:t.value,id:"paymentOptions",label:e.translate("payment.payment_option.title"),primaryContent:a.value.primaryLabel,secondaryContent:a.value.secondaryLabel,onToggle:r,children:n(Qs,{ineligibilityReason:i})})}function Hc(){const{i18n:e}=pt();return n(Ll,{label:e.translate("pickup_point.title"),open:!0,children:n(Pn,{rowsInset:!0,children:n(cr,{heading:"none"})})})}function zc(){const{userEvents:e,shop:n,source:t,checkout:a}=pt();return{trackOnDeliveryToggle:h((i=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.2",payload:{...Mt(t,a,n),action:i?"
2shipping_rates_expand":"shipping_rates_collapse"}})}),[e,t,a,n]),trackSelectShippingMethod:h(((i,r)=>{e.monorailEvent({schemaId:"shopify_pay_payment_page_select_shipping_rate/3.1",payload:{...Mt(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 jc=l({displayName:"ShippingGroupsSummary",load:()=>p((()=>e((()=>import("./17a5f1e4.C-TpI4xq.js")),__vite__mapDeps([113,1,2,3,4,5,6,7,8,9,10,11,21,22,23,88,89,90,114,82,18,19,20,24,65,40,13,41,66,67,47,68,69,70,71,38,39,42,43,44,45,46,48,72,37,73,74,75,76,77,78,79,80,81,83,91,92,93,58,27,94,95,12,14,15,16,17,25,26,28,29,30,31,32,35,36,56,57,96,59,49,50,97,54,98,99,100,101,102,87,103,104,105,106,107,108,109,110])))),renderLoading:()=>n(M,{})});function Uc({lines:e,hideThumbnail:t,shippingTime:a}){const{i18n:r,checkout:l}=pt(),{deliveryExpectationLines:o}=_s(),s=l.configuration.layout.isOnePage.value,d=e=>{const t=e.methods.find((({handle:n})=>n===e.selectedDeliveryMethodHandle));if(!t)return null;const{handle:i,cost:l,costAfterDiscounts:d,brandedPromise:u,estimatedTimeInTransit:c}=t,p="LOCAL"===t.methodType,h=Boolean(t?.deliveryPredictionEligible),{deliveryExpectation:m}=En(t,o||[],Boolean(h||u));return n(F,{gap:"small-400",children:n(x,{children:[n(Go,{methodTitle:kn({deliveryMethod:t,localDelivery:p?r.translate("shipping.local_delivery"):void 0}),showInterpunct:!0,price:n(Cs,{cost:l,costAfterDiscounts:d,inlineDiscount:!0})}),a?n(ee,{color:"subdued",size:s?void 0:"small",children:a}):n(Ps,{deliveryMethod:t,deliveryExpectationLine:m,estimatedTimeInTransit:c,paragraphColor:"subdued"})]})},i)};return n(i,{children:e.map((e=>{const a=Sn(e.targetMerchandiseLines??[]);return a.slice(0,1).map((i=>n(ne,{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(An,{variant:"fan-legacy",merchandise:a,size:"small",useResponsiveImageSources:!0,useTitleAsAltTextFallback:!0}):n(ys,{merchandiseItem:i,hideBadge:!0})),d(e)]},i.id)))}))})}function Gc({deliveryNextValue:e}){const t=li(e).filter(wn);return t.length?n(ne,{gridAutoRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-200",children:n(Uc,{lines:t,hideThumbnail:1===t.length})}):null}function Yc({cost:e,costAfterDiscounts:t,hideDiscountedTotalOnShippingSelector:a,styleOverrides:i={}}){return e&&t?n(Cs,{cost:e,costAfterDiscounts:t,inlineDiscount:!0,preDiscountCost:a,styleOverrides:i}):null}function Wc(){const{i18n:e,checkout:{identity:{current:t}}}=pt(),a=t.value,i="amazonPay"===a||"buyWithPrime"===a;return!D().value&&i?n(Ll,{id:"amazonPayShippingMethods",label:e.translate("shipping.title"),primaryContent:n(M,{})}):n(qc,{})}function qc(){const{embed:e,i18n:a,checkout:r}=pt(),l=gs(),{hasMultipleDeliveryGroups:o}=l.value,s=r.configuration.isAddressDelegationEnabled,{customizationsForRollupReveal:d}=fs({hasMultipleDeliveryGroups:o,targeted:!1,shouldHandleRollup:!0}).value,u=G("Checkout::ShippingMethodDetails::RenderAfter"),c=G("Checkout::ShippingMethodDetails::RenderExpanded"),{uiStateSignal:p}=Ua(an),{hasViolations:m}=Y(si),y=g(m),f=lc(),{hasViolations:b}=In(di),_=g(b),C=t((()=>f.value&&_.value)),P=mn(),S=Xl([...d,...u,...c],{lazyReveal:!0}),A="shippingMethod",E=od(A,S.peek()),k=g(ad(Ga([...d,...u,...c],"uiExtension").map(Wt),h((()=>{E.value=!0}),[E])));v((()=>{S.value&&(E.value=!0)})),v((()=>{(y.value||C.value||!P.value&&function(e){if("filled"!==e.status)return!1;const n=["SHIPPING","LOCAL"];return e.deliveryLines.some((e=>{const t=ci(e);return!!n.includes(t?.methodType||"")&&"available"===e.status&&e.hasDeliveryLineChange}))}(p.value))&&(E.value=!0)}));const w=function({identity:{current:e}}){const{trackOnDeliveryToggle:n}=zc(),t=h((e=>{n(e)}),[n]);return"shopPay"===e.value?t:void 0}({identity:r.identity}),O=h((()=>{const e=!E.value;w?.(e),E.value=e}),[w,E]),{deliveryNext:I,shippingAddress:R}=Et(),{parts:{deliveryLines:T}}=ui(),N=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}),L=function({state:e,addressInvalidMessage:t,addressIncompleteMessage:a}){const{i18n:r}=pt(),l=Et().deliveryNext,o=ha("deliveryNext"),{deliveryExpectationLines:s}=_s(),{rollup:{secondaryContent:{typography:{color:d}={}}={}}={}}=ve(),u=mn(),c=d??"base",p="filled"===e.status?e.deliveryLines:void 0,h=rs({deliveryLines:p}),{hasViolations:m}=$(oi),{hasViolations:v}=$(Va),y=n(F,{children:[n(M,{inlineSize:"base",size:"small"}),n(M,{inlineSize:"small",size:"extraSmall"})]});if("initial"===e.status||"loading"===e.status)return{compactPrimaryContent:n(M,{inlineSize:"base",size:"small"}),compactSecondaryContent:void 0,inlinePrimaryContent:y,inlineSecondaryContent:void 0,primaryContent:y,secondaryContent:void 0};if("empty"===e.status||"error"===e.status){const i=a??r.translate("shipping.method_summary.incomplete_address_entered"),l=t??r.translate("shipping.invalid_shipping_method_summary"),o=r.translate("shipping.different_shipping_method_summary");let s="empty"===e.status?i:l;m?s=i:v&&(s=o);const d=n(V,{children:s});return{compactPrimaryContent:d,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:d,primaryContent:d,secondaryContent:void 0}}if(ri(l.value,u.value)){if(o.value)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:y,secondaryContent:void 0};let e=n(jc,{});return h?e=n(os,{summary:h}):u.value&&(e=n(Gc,{deliveryNextValue:l.value})),{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:e,secondaryContent:h?n(ls,{summary:h,secondaryContentColor:c}):void 0}}const g=u.value?e.deliveryLines.filter(wn):e.deliveryLines,f=On(g);if(!f)return{compactPrimaryContent:void 0,compactSecondaryContent:void 0,inlinePrimaryContent:void 0,inlineSecondaryContent:void 0,primaryContent:void 0,secondaryContent:void 0};const{costAfterDiscounts:b,cost:_,hideDiscountedTotalOnShippingSelector:C}=f,P=kn({deliveryMethod:f,localDelivery:"LOCAL"===f.methodType?r.translate("shipping.local_delivery"):void 0}),S=s?.find((e=>e.deliveryStrategyHandle===f.handle)),A=n(Go,{methodTitle:P,showInterpunct:!0,price:_&&b?n(Yc,{cost:_,costAfterDiscounts:b,hideDiscountedTotalOnShippingSelector:C}):void 0}),E=n(Ps,{deliveryMethod:f,deliveryExpectationLine:S,paragraphColor:d??"base"});return{compactPrimaryContent:n(V,{type:"strong",children:n(Go,{methodTitle:P})}),compactSecondaryContent:n(i,{children:[n(Ps,{deliveryMethod:f,deliveryExpectationLine:S,paragraphColor:d,formatContent:e=>e?n(F,{display:"inline",direction:"inline",columnGap:"none",alignItems:"center",children:["(",e,")"]}):null}),n(V,{color:d,children:n(Yc,{cost:_,costAfterDiscounts:b,hideDiscountedTotalOnShippingSelector:C,styleOverrides:{shouldBold:!1}})})]}),inlinePrimaryContent:A,inlineSecondaryContent:E,primaryContent:A,secondaryContent:E}}({state:p.value,addressIncompleteMessage:N?.addressIncompleteMessage,addressInvalidMessage:N?.addressInvalidMessage}),D=(()=>{switch(e?.embedder){case"amazon":{const{compactPrimaryContent:e,compactSecondaryContent:t}=L;return void 0===e&&void 0===t?{primary:L.primaryContent,secondary:L.secondaryContent}:{compact:n(F,{direction:"inline",gap:"small-400",alignItems:"center",children:[e,t]})}}case"google":return{primary:L.inlinePrimaryContent,secondary:L.inlineSecondaryContent};default:return{primary:L.primaryContent,secondary:L.secondaryContent}}})();v((()=>{const e=function(e,n,t){return pi(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}))}(I.value,T.value,R.value?.phone);e&&(E.value=!0)}));const B=t((()=>("error"===p.value.status||"empty"===p.value.status)&&!(S.value||k.value)));return v((()=>{B.value&&(E.value=!1)})),n(Ll,{open:E.value,id:A,label:a.translate("shipping.title"),primaryContent:D.primary,secondaryContent:D.secondary,compactContent:D.compact,onToggle:s&&"empty"===p.value.status||B.value?void 0:O,renderChildrenWhenCollapsed:!0,icon:n(J,{id:"shippingMethod-packageDeliveryIcon",type:"package-delivery",size:"fill"}),children:n(Ks,{singleDeliveryGroup:l})})}const $c={rollup:{label:{visibility:"visible"},blockAlignment:"center"}},Kc={rollup:{label:{visibility:"hidden"},blockAlignment:"center"}},Xc={SHIPPING:{id:"shippingMerchandiseList",getTargetMerchandiseLines:hr},PICK_UP:{id:"pickupMerchandiseList",getTargetMerchandiseLines:pr}};
2function Jc({selectedDeliveryMethodType:e}){const{i18n:i}=pt(),{deliveryLines:r}=ft(),l=mn(),{showOverlay:o}=Rn(),s=f(!1),d=Xc[e],u=t((()=>d.getTargetMerchandiseLines(r.value))),{visibleSummary:c,isNegotiating:p}=mr(u),h=Kt(),m=t((()=>vr(r.value))),v=t((()=>m.value>=yr)),y=t((()=>{const e=c.value;return e?e.isAllItems?i.translate("split_delivery.all_items"):i.translate("split_delivery.items_count",{count:e.totalItemCount}):""})),g="PICK_UP"===e?i.translate("delivery_options.pick_up"):i.translate("delivery_options.ship"),b=n(a,{when:()=>!(void 0===c.value||h.value&&p.value),fallback:n(M,{}),children:n(V,{children:y})}),_=n(An,{variant:"fan-legacy",sortByPrice:!0,merchandise:c.value?.merchandiseLines??[],size:"small"});if(v.value)return n(_e,{theme:$c,children:n(Ll,{id:d.id,label:g,thumbnail:_,onClick:()=>o(gr),primaryContent:b})});const C=s.value||l.value;return n(_e,{theme:C?Kc:$c,children:n(Ll,{id:d.id,label:g,thumbnail:_,open:C,onToggle:C?void 0:()=>{s.value=!s.value},primaryContent:b,children:n(fr,{title:"PICK_UP"===e?i.translate("split_delivery.items_for_pickup"):i.translate("split_delivery.items_for_shipping"),selectedDeliveryMethodType:e})})})}function Zc(){const{rollup:e}=ve(),{padding:t}=Ci({padding:[e?.blockPadding??"base",e?.inlinePadding??"base"]});return n(x,{padding:t,children:n(fc,{})})}const Qc="CU3YS",ep="_5HWz9",np="r8rqQ",tp="_2Ojsq";function ap({hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r}){const l=fe(),{negotiate:o}=be(),{checkout:d,embed:u,shop:c,source:p}=pt(),h=br(),m=t((()=>l.value.delivery&&d.isShippingRequired.value)),v=t((()=>m.value&&h.value)),y=hi({checkout:d}),g=t((()=>l.value.contact&&d.configuration.showContactInformation)),f=[...t((()=>Si({isContactVaulted:l.value.contact,configuration:d.configuration,identity:d.identity,embed:u,shop:c}))).value?[n(Ku,{},"contact")]:[],...m.value?[n(gc,{},"delivery")]:[],...function(e){if($t(p))return l.value.payment?[n(Hd,{},"payment")]:[];const t=[];return y&&t.push(n(Ou,{isAbovePaymentSummary:!0},"businessCustomerBilling")),l.value.payment&&(t.push(n(Hd,{},"payment")),e.configuration.visibility.showCashRedemption.value&&t.push(n(Au,{},"cashRedemption")),l.value.billing&&!y&&t.push(n(Ou,{},"billingAddress"))),t}(d)],b=f.length>0||g.value;var _;return s((()=>{_&&Ws().catch((()=>{}))}),[_=b]),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:b,identity:d.identity,wallets:d.wallets,negotiate:o}),0===f.length?null:n(x,{children:[n(Gs,{children:n(rp,{hideLastDivider:e,showTopDivider:i,stripBlockEndPadding:r})}),n(a,{when:()=>l.value.payment,children:n(Jd,{})}),n(a,{when:v,children:n(_r,{})})]})}function ip({sections:e,hideLastDivider:t,showTopDivider:a,stripBlockEndPadding:i}){const{checkout:{identity:r},shop:l}=pt(),o=function(e,n){return"guest"===e.current.value||"businessCustomer"===e.current.value&&n}(r,fe().value.payment),{vaulted:{spacing:s="none",cornerRadius:d,divider:{borderWidth:u="base",borderStyle:c="base",borderColor:p="base",visibility:h="visible"}={}}={}}=ve(),{main:{section:m}}=ge(),v=!o&&!Ol(t),y=Ln().rendered?.padding,{blockStart:g,blockEnd:f}=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:lp(n),blockEnd:lp(t)}}(l.hasFlagEnabled(Ea)?void 0:y);return 0===e.length?null:n("div",{className:C("K6vpG",{[Qc]:Ol(a),[ep]:v,[np]:g,[tp]:f||i}),style:op({spacing:s,borderWidth:u,borderStyle:c,borderColor:p,visibility:h,cornerRadius:m?.cornerRadius??d}),children:e})}function rp({hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a}){const r=function(){const e=fe(),{checkout:t,shop:a,embed:r,i18n:l,source:o}=pt(),{identity:s,identity:{current:u}}=t,c=u.value,p=a.hasFlagEnabled(ei),h=a.hasFlagEnabled(Ea),m=Tn(),v=Nn(),y=hi({checkout:t}),g=m.value&&!v.value,f=mn(),b=br(),_=void 0!==Xa().value,C=ha("deliveryNext"),P=Kt(),{deliveryLines:A}=ft(),E=mi(A.value??[]).filter((e=>e.requiresShipping)).length>0,w=function(){const{eligibility:e,messages:n,redeemableBalance:t,discountOffer:a,shopPromotionDiscounts:i,isDigitalGoodsRedemptionAllowed:r}=Su(),l=iu();if((e.eligible||r)&&t)return!0;
2const o=a?.value?.redeemableAmount,s=i.length>0;return!(!e.eligible||!o&&!s)||!!oa.some((e=>au(l.value,e)))||n.length>0}(),O=d((()=>({isSplitShipAndPickup:f.value,isBusinessCustomerSingleChoiceMode:g,businessCustomerCannotProvideShippingAddress:m.value,redemptionEligibilityVisible:w,shouldAllowInlineSplit:b.value,hasShippingMerchandiseLines:E,hasLocalPickupDeliveryLine:_,deliveryNextLoading:P.value&&C.value})),[f.value,g,m.value,w,b.value,E,_,P.value,C.value]),I=O.isSplitShipAndPickup?vi:yi,R=I[c]??I.default,T=Tc(),N=e=>{switch(e){case"contact":return n(Ku,{},e);case"businessCustomerSingleChoice":return n(wu,{},e);case"orderEditDeliveryAddress":return n(Lc,{},e);case"orderEditShippingMethod":return n(Mc,{},e);case"deliveryAddress":return T.value?n(wc,{destination:e}):n(gc,{},e);case"shippingMerchandiseList":return n(Jc,{selectedDeliveryMethodType:"SHIPPING"},e);case"shippingMethods":return n(Wc,{},e);case"pickupMerchandiseList":return n(Jc,{selectedDeliveryMethodType:"PICK_UP"},e);case"localPickupOptions":return T.value?n(wc,{destination:e}):n(Ac,{},e);case"pickupPoint":return n(Hc,{},e);case"dutyOptions":return n(Nc,{},e);case"paymentOptions":return n(Fc,{},e);case"payment":return n(Hd,{},e);case"billing":return n(Ou,{isAbovePaymentSummary:y},e);case"cashRedemption":return n(bc,{},e);default:return n(i,{})}};S((()=>{p&&t.sections.unstable_providePreactContext(O)}),[p,t.sections,O]);const L={configuration:t.configuration,installments:t.installments,isShippingRequired:t.isShippingRequired,vaultedSections:p?t.vaultedSections:{signal:e},source:o,proposal:t.proposal,identity:s,shop:a,embed:r},D=p?t.sections.availableToRenderGrouped.value:gi(fi(R.filter((e=>bi[e].shouldRender({preactContext:O,concepts:L}))),{preactContext:O,concepts:L}));let M=!1;return D.filter((e=>e.length>0)).map((e=>{const a=[];for(const{sectionId:l,groupId:s}of e){const e=N(l);null!=s&&_i.has(s)?(!M&&t.configuration.visibility.showDeliveryHeading.value&&(a.push(n(h?Zc:fc,{},"deliveryHeading")),M=!0),a.push(n(pe,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Xi,{name:l,children:e})},(i=l,!T.value||"deliveryAddress"!==i&&"localPickupOptions"!==i?i:"deliveryDestination")))):a.push(e)}var i;const r=e[0]?.groupId,o=function(e,t,a){if(t.isSplitShipAndPickup)return"shipping"===e?n(k,{level:2,children:a.translate("delivery_options.ship_to_address")}):void 0}(r,O,l);return{groupId:r,header:o,elements:a}}))}(),l=mn();if(0===r.length)return null;const o=r.length>1&&l.value;return n(i,{children:o?n(F,{gap:"large-200",children:r.map((({groupId:l,header:o,elements:s},d)=>{const u=0===d,c=d===r.length-1,p=n(wl,{hideDivider:"always",children:n(ip,{sections:s,hideLastDivider:!c||Ol(e),showTopDivider:u&&Ol(t),stripBlockEndPadding:c&&a})});return o?n(F,{gap:"base",children:[o,p]},l):n(i,{children:p},l)}))}):n(ip,{sections:r.flatMap((e=>e.elements)),hideLastDivider:e,showTopDivider:t,stripBlockEndPadding:a})})}function lp(e){return null!=e&&"none"!==e}function op({spacing:e,borderWidth:n,borderStyle:t,borderColor:a,visibility:i,cornerRadius:r}){const l=sp[e],o={none:"0px",...Pi.borderWidth},s={base:Pi.color.default.border,transparent:"transparent"},d="hidden"===i?"0px":o[n];return{"--vaulted-divider-width":d,"--vaulted-divider-style":dp[t],"--vaulted-divider-color":s[a],"--vaulted-spacing":l,"--divider-offset":`calc((${l} + calc(${d} * 2)) / 2)`,"--vaulted-corner-radius":r?Pi.borderRadius[r]:void 0}}const sp={none:"0px",...Pi.spacing},dp={base:"solid",dashed:"dashed",dotted:"dotted"};function up(){const{methods:e}=Dn(),{userEvents:n,shop:t,source:a,checkout:i}=pt(),r="shopPay"===i.identity.current.value;v((()=>{if(r)for(const r of e.value)y((()=>n.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Mt(a,i,t),action:`delivery_method_${r.toLowerCase()}_selected`}})))}))}function cp(){up();const{shop:e,i18n:t,checkout:a}=pt(),i=fn(),r=Tc(),l=!e.hasFlagEnabled(Ai),o=!a.configuration.visibility.showDeliveryHeading.value&&!l;if(!i)return null;if(r.value)return n(Cr,{});const s=t.translate("shipping.delivery_title");return n(Uo.Provider,{value:!0,children:n(oo,{presentation:"base",children:n(x,{padding:l?"none":"base none",accessibilityLabel:s,className:l?"_5hYUU":void 0,children:n(F,{gap:"base",children:[o&&n(V,{color:"subdued",children:s}),n(Pr,{})]})})})})}function pp(){const{source:e}=pt(),t=fe(),a=Mn(),r=fn(),l=Tc();return $t(e)||!t.value.delivery?null:n(i,{children:[n(cp,{}),a.value&&r&&!l.value?n(me,{blockSize:"base"}):null]})}function hp({placement:e}){const{checkout:a,embed:i,shop:r,shopPay:l}=pt(),{current:o}=a.identity,s=fe(),d=Ei(),u=Ss();return t((()=>ki({configuration:a.configuration,identity:a.identity,shop:r,shopPay:l,embed:i,vaultedSections:s.value,isShippingRequired:a.isShippingRequired.value,hasSellingPlan:d.value,phoneCountryCode:u.value}))).value!==e?null:n(mp,{vaultedContactTypeOverride:"sdkCartHints"===o.value?"base":void 0})}function mp({vaultedContactTypeOverride:e}){const t=Yu();Wu(t);const r=f(!1),l=Kt(),{embed:o}=pt(),s=t.displayOptions,d="base"===s.vaultedContactType,u="rollup"===s.vaultedContactType?e??"rollup":s.vaultedContactType,c=d?s.contentLayout:void 0,p="rollup"===s.vaultedContactType&&"base"
2===u;if("base"!==u)return null;const h=t.logo;let m=null;return(p&&t.hasError||d)&&(m=s.children??null),n(i,{children:[n($u,{emailAddress:t.displayContent.contact,phone:t.displayPhone,logo:h,moreOptions:t.moreOptions,emailAlignment:p&&t.isEmbeddedPartner&&!o?.interstitialPartnerProfileIconUrl?"start":void 0,layout:p?void 0:c,children:m}),t.showShopPayVerification&&n(a,{when:l,children:n(Yi,{email:t.email??"",open:r.value,showPopover:e=>{r.value=e}})})]})}function vp({showDelivery:e,insideVaultedCard:t}){const{embed:r,shop:l}=pt(),o=Tc(),{rollup:{inlinePadding:s}}=ve(),d=n(i,{children:[n(hp,{placement:"vaulted-adjacent"}),n(a,{when:e,children:n(pp,{})}),n(a,{when:()=>!o.value,children:n(Cc,{})})]}),u=Qt(r?.embedder);if(l.hasFlagEnabled(Ea)){if(!u&&!t?.value)return d;const{padding:e}=Ci({padding:["none",s??"base"]});return n(x,{padding:e,children:d})}const c=u?`none ${na(s)??"none"}`:void 0;return u?n(x,{padding:c,children:d}):d}const yp=(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&&eu(n.destinationAmount,e.availableBalance)));return-1!==n&&(t.splice(n,1),!0)}))};function gp(e,n,t,a){const i=e?.status;return"pending"===i||(t||a)&&("filled"===i||n)}const fp=({discountOffer:e,eligibility:n,shopPromotionDiscounts:a,enabled:i=!0})=>{const{isShopCashNegotiationReady:r,negotiateShopCash:l}=ou({enabled:i}),{recordRedemptionAutomaticallyApplied:o,recordRedemptionAutomaticallyRemoved:u}=gu(),c=m(),p=iu();!function(e,n=!0,a){const{setShopOfferReconciliationPending:i}=pt().shopPay,r=function(e,n){const a=g(e),i=g(n),{shopDiscountOffer:r,shopPromotion:l}=Et(),o=iu(),s=St().loading;return t((()=>{const e=o.value,n=a.value.eligible,t=s.value,d=t.has("discountLines"),u=t.has("shopCashBalance"),c=i.value;if(void 0!==c){const a=e.SHOP_PROMOTION,i=a.length>0;if(gp(l.value,i,d,t.has("shopPromotion")))return!0;if(c?.length){if(n?!yp(a,c):i||u)return!0}else if(i)return!0}const p=r.value,h=e.SHOP_DISCOUNT_OFFER?.destinationAmount;if(gp(p,null!=h,d,t.has("shopDiscountOffer")))return!0;const m=zd(p)?.redeemableAmount;return null==h?null!=m&&(n||u):!n||null==m||!eu(h,m)}))}(e,a);S((()=>
2{if(!n)return;const e=r.subscribe(i);return()=>{e(),i(!1)}}),[n,r,i])}(n,i,a);const h=d((()=>{const t=p.value.SHOP_DISCOUNT_OFFER?.destinationAmount;return e?eu(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]),v=d((()=>{if(void 0===a)return;const e=p.value.SHOP_PROMOTION;return a&&0!==a.length?!yp(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=d((()=>{if(h||v)return{...h,...v}}),[h,v]);s((()=>{i&&y?r&&c.current!==y&&l(y,{onNegotiateAccepted:()=>{c.current=y,Object.entries(y).forEach((([e,n])=>{(n?o:u)(e,"useApplyAutomaticRedemptions")}))}}):c.current=void 0}),[i,r,y])};function bp({active:e,ready:t}){const{i18n:a}=pt(),i=e.value&&!t.value?a.translate("general.loading"):null;return n(x,{accessibilityRole:"status",accessibilityVisibility:"exclusive",children:i})}const _p=l({displayName:"BelowTheFoldContent",renderLoading:function(){return n(x,{"aria-busy":!0,padding:"large-200 none",children:n(F,{gap:"base",children:[n(M,{inlineSize:"large"}),n(M,{inlineSize:"base"}),n(Re,{contentDisplay:"block",blockSize:"48px"})]})})},load:()=>p((()=>e((()=>import("./7aefefff.DBWne1lR.js")),__vite__mapDeps([115,1,2,3,4,5,6,7,8,9,10,11,116,117,96,59,118,119,38,39,40,13,41,42,43,44,45,46,47,19,20,48,34,27,35,36,37,12,14,15,16,17,18,21,22,23,24,25,26,28,29,30,31,32,49,50,51,52,53,54,55,56,57,58,60,120,121,77,122,91,92,93,74,75,67,66,68,69,94,95,123,124,125,76,126,127,128,129,73,130,131,63,64,65,70,71,72,78,79,80,81,82,83,84,85,132,89,133,97,98,88,90,99,100,101,102,87,103,104,105,106,107,108,109,110,134])))),renderError(e){throw e}});function Cp({children:e,fillAvailableBlockSize:t,ready:a}){const{checkout:i}=pt(),{progress:r}=be(),l=ks(),o=h((()=>{r("one-page-form-submit",void 0,{skipToCompletion:l.value})}),[r,l]),s=Vr(o);return n(Bn,{disabled:!a.value,onSubmit:s,contentsClassName:t?"ifz7X":void 0,children:e},i.identity.current.value)}function Pp({loading:e,lineItems:t,onClose:a}){const{i18n:i,url:r,checkout:{configuration:{allowRedirectToStorefront:l}}}=pt(),{checkoutProtocolModalEventSignal:o}=Ut(),d=n(z,{variant:"primary",onClick:a,children:i.translate("stock.continue_cta_label")}),u=l&&n(T,{href:r.cart(),children:i.translate("stock.return_to_store_label")});return s((()=>()=>{o.value="none"}),[o]),n(Vn,{heading:i.translate("stock.price_update.title"),open:!0,onShow:()=>{o.value="priceChange"},onHide:a,size:"large",children:n(F,{gap:"large-200",children:[n(ee,{children:i.translate("stock.price_update.description")}),n(x,{children:n(Os,{loading:e,lineItems:t,type:xn.PriceChange})}),n(F,{direction:"inline",gap:"large-300",alignItems:"center",justifyContent:"end",children:[u,d]})]})})}function Sp(e){return e.some((e=>"MERCHANDISE_EXPECTED_PRICE_MISMATCH"===e.code))}function Ap(){const{checkout:{wallets:e}}=pt(),i=Et(),r=function(){const e=Et(),n=ha("merchandiseLines"),a=ft().merchandiseLines,i=f(y((()=>a.value)));return t((()=>{const t=e.allViolations.value,a=Sp(t??[]),r=e.merchandiseLines.value,l=n.value,o=r?.lines??[],s=i.value,d=Fn(s,o,t,Hn).map((({proposed:e,negotiated:n})=>({line:e??n,problem:{type:xn.PriceChange,negotiatedPrice:n?.itemPrice,proposedPrice:e?.itemPrice}})));return{hasViolation:a,loading:l,lineItems:d,updateProposal:()=>{d.length>0&&(i.value=o)}}}))}(),l=zn(),o=m(!1),s=t((()=>i.allViolations.value?.some((e=>wi.has(e.code))))),d=t((()=>!s.value&&r.value.hasViolation&&r.value.lineItems.length>0)),u=t((()=>{const n=r.value;return d.value?o.current=!0:o.current&&!n.loading&&0===n.lineItems.length&&(o.current=!1),!e.activeSession.value&&o.current&&n.lineItems.length>0?n:void 0}));v((()=>{d.value&&l("inventoryPriceChange",{element:{tagName:"modal"},timestamp:new Date,visible:!0})}));const c=h((()=>{o.current=!1,r.value.updateProposal()}),[r]);return n(a,{when:u,children:e=>n(Pp,{loading:e.loading,lineItems:e.lineItems,onClose:c})})}function Ep(){const{i18n:e,shop:t}=pt(),a=jn(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 kp(){const{checkout:e,embed:a,shopPay:r}=pt(),l=ws(),o=ks(),s=fe(),d="webview-rendered"===r.config.isReferral,u=a?.isFlagshipPartner??!1,c=t((()=>s.value.contact&&e.configuration.showContactInformation||s.value.delivery||s.value.payment)).value,p=l.value,h=p||o.value||d;return c&&h?n(i,{children:[p?n(ss,{}):null,o.value?n(ds,{isVaultedReview:!0}):null,d?n(Ep,{}):null,h&&!u?n(me,{blockSize:"base"}):null]}):null}function wp(){const{embed:e,shop:t}=pt();return a=>
2!e?.isFlagshipPartner||Qt(e.embedder)||Jt({embedder:e.embedder,shop:t})?a:n(Pn,{children:a})}function Op({showEmailMarketingOptIn:e,showPhoneMarketingOptIn:i,aboveFoldSpacing:r,paddingBlockStart:l,children:o}){const s=Sr(),d=t((()=>i?.value??s.value.isRoot)),u=t((()=>e.value||d.value)),c=t((()=>e.value&&d.value)),p=t((()=>c.value?r?"small-200":"base":"none")),h=t((()=>r?"large-200 none large-200 none":`${l?.value??"none"} none base none`));return n(a,{when:u,fallback:o,children:()=>n(pe,{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:d,children:n(Er,{})})]}),o]})})})}function Ip({extensions:e,hideDivider:t="always"}){const a=wp();return n(gn,{gap:"base",customizations:Ol(e),render:(e,i)=>i?a(n(wl,{hideDivider:t,children:e})):e})}function Rp(e){const{i18n:n}=pt(),t=h((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 d((()=>{if(!Oi(e))return[];const a=li(e);return function(e,n){const t=(n||[]).filter(Ii).map(cs);return ps(t).filter((e=>e.length>0)).map((n=>function(e,n){return{...Ri(e)??e[0],title:Li(e,n),cost:Ni(e),costAfterDiscounts:Ti(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 Tp(){const{shopPay:e}=pt(),{value:n}=Et().deliveryNext,t=ha("deliveryNext").value,a=Di(n,"ONE_TIME_PURCHASE",!0),i=d((()=>a&&"available"===a.status?a.methods:[]),[a]),r=Rp(n),l=Oi(n)?r:i,o=d((()=>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]),[u,c]=b(!0),p=e.session.selectedShippingAddress.value;s((()=>{c(!0)}),[p]),s((()=>{t||c(!1)}),[t]);const[,h]=b(),m=ms(h);return{methodsByType:o,availableDeliveryMethods:l,availableDeliveryMethodsLoading:u,progressiveShippingRatesLoading:m}}function Np({onChange:e,prerequisitesLoading:n}){const{value:t}=Et().deliveryNext,a=ha("deliveryNext").value,i=Di(t,"ONE_TIME_PURCHASE",!0),r=Rp(t),[l]=Un({type:i?.type}),o=d((()=>{if(!n&&!a&&l&&null!=i&&"available"===i.status)return Oi(t)?r.find((e=>e.handle===l)):i.methods.find((e=>e.handle===l))}),[n,a,l,i,t,r]),u=m(o);return s((()=>{o&&u.current&&u.current.handle!==o.handle&&e(o,u.current),u.current=o}),[o,e]),{selectedDeliveryMethod:o}}function Lp(){const{i18n:e}=pt(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Tp(),a=n&&!t,{selectedDeliveryMethod:i}=Np({onChange:()=>{},prerequisitesLoading:n||a}),r=i?e.translate("order_summary.updated_shipping_method",{shipping_method:i.title}):void 0,l=m(r);return s((()=>{const e=l.current;if(l.current=r,r&&r!==e)return K({content:r})}),[r]),null}function Dp(){return Gn("ONE_TIME_PURCHASE")?n(Lp,{}):null}function Mp({includeContact:e=!0}={}){const n=fe(),a=g(G("Checkout::Dynamic::Render","INFORMATION1")),i=g(G("Checkout::Dynamic::Render","INFORMATION2")),r=g(G("Checkout::Dynamic::Render","DELIVERY1")),l=g(G("Checkout::Dynamic::Render","DELIVERY2")),o=g(G("Checkout::Dynamic::Render","PAYMENT1")),s=g(G("Checkout::Dynamic::Render","PAYMENT2")),d=g(G("Checkout::Dynamic::Render","PAYMENT3")),u=m();return t((()=>{const t=n.value,c=[];t.contact&&("boolean"==typeof e?e:e.value)&&c.push(...a.value,...i.value),t.delivery&&c.push(...r.value,...l.value),t.payment&&c.push(...o.value,...s.value,...d.value);const p=u.current;return p&&(m=c,(h=p).length===m.length&&h.every(((e,n)=>{const t=m[n];return void 0!==t&&Wt(e)===Wt(t)})))?p:(u.current=c,c);var h,m}))}const Bp=[Fr.Button,Hr.Button,zr.StickyFooter,jr.Wrapper];function xp(){const{shopPay:e,checkout:t}=pt(),[a]=Yn("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(nc,{}):null}const Vp="contact";function Fp({loginLink:e,title:a}){const{router:i}=pt(),r=t((()=>ld(i,Vp)));return n("div",{className:"nnGzs",children:[n(k,{id:Vp,level:1,autoFocus:r.value,children:a}),e]})}function Hp(){const{client:e,i18n:t,source:i}
2=pt(),r=Wn(),l="simulated"===i.type;return n(a,{when:r,children:n(T,{href:l?void 0:e.unstable_getSerialization("loginUrl")||"",children:t.translate("customer_account.sign_in_link_label")})})}Hp.displayName="LoginLink";const zp=()=>{const{i18n:e,userEvents:t,source:a,checkout:i,shop:r,shopPay:l}=pt();return n(T,{onClick:()=>{t.monorailEvent({schemaId:"shopify_pay_payment_page_ui_interaction/1.1",payload:{...Mt(a,i,r),action:"click_shop_pay_sign_in"}}),l.session.unstable_updateVerificationTrigger({source:qn.LoginLink})},children:e.translate("account_management.sign_in_shop")})};function jp({identityPresentation:e="form",showEmailMarketingOptIn:t}){const a="vaulted"===e,{i18n:r,checkout:{identity:l,validation:{contactErrors:{emailInputError:o}}},shopPay:d}=pt(),u="shopPay"===l.current.value,c=r.translate("field_errors.email_invalid"),p=d.userVerification.value;s((()=>{u&&"invalid"===p.status&&(o.value=c)}),[u,o,c,p.status]);const m=h((e=>{if(u)return p.email===e&&"invalid"===p.status?c:void 0}),[u,c,p.email,p.status]);return n(i,{children:[n(i,a?{children:[n(Fp,{title:r.translate("contact.contact_method_title")}),n(me,{blockSize:"base"}),n(hp,{placement:"standalone-vaulted"})]}:{children:[u&&n(i,{children:[n(Ko,{color:"branded"}),n(me,{blockSize:"base"})]}),n(Fp,{title:r.translate("contact.contact_method_title"),loginLink:n(Up,{})})]}),n(me,{blockSize:"base"}),n(Gi,{hideAllOptIns:u&&!a,hideCustomerCard:a,showEmailMarketingOptIn:t,onValidateEmailInput:m}),u&&!a&&n(xp,{})]})}function Up(){const{checkout:{identity:e}}=pt(),t=Is();return"shopPay"!==e.current.value?n(Hp,{}):t===Vi.UnauthenticatedCheckout?n(zp,{}):null}const Gp=E((function({showForm:e=!0,identityPresentation:t="form",showEmailMarketingOptIn:a}){const r=G("Checkout::Contact::RenderAfter"),l=G("Checkout::Dynamic::Render","INFORMATION1"),o=G("Checkout::Dynamic::Render","INFORMATION2");return n(i,{children:[l.length?n(i,{children:n(gn,{customizations:l,gap:"base",marginBlockEnd:"large300"})}):null,e?n(ns,{impressionType:"contact",impressionFeatures:[],children:[n(jp,{identityPresentation:t,showEmailMarketingOptIn:a}),r.length?n(i,{children:n(gn,{customizations:r,marginBlockStart:"base"})}):null,o.length?n(i,{children:n(gn,{customizations:o,gap:"large-200",marginBlockStart:"large300"})}):null]}):n(i,{children:[r.length?n(i,{children:n(gn,{customizations:r,marginBlockStart:"base"})}):null,o.length?n(i,{children:n(gn,{customizations:o,gap:"large-200",marginBlockStart:"large300"})}):null]})]})}));function Yp(){const{checkout:{identity:e},i18n:t}=pt(),{hasViolations:a}=Y(Oa),{hasViolations:i}=Y(Fa),{hasViolations:r}=$(Fi);if(a&&Wp({identity:e}))return n(kr,{});if(r)return n(pe,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ui,{message:t.translate("field_errors.shipping_method_invalid_phone_number")})});const l=i?t.translate("shipping_errors.shipping_method_not_available_due_to_unsatisfied_conditions"):t.translate("shipping_errors.shipping_method_not_available_generic.one");return n(pe,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(Ae,{tone:"critical",heading:t.translate("shipping_errors.title"),errorType:H.DeliveryError,children:l})})}const Wp=({identity:e})=>"shopPay"===e.current.value,qp=[{handle:"first"},{handle:"second"}];function $p(){const{i18n:e}=pt(),{shippableDeliveryLines:t}=$n().value,a=t?.[0]?.methods||qp;return n(Mo,{name:"shippingMethods",variant:"block",hideRadioControl:1===a.length,children:a.map((({handle:t,description:a,estimatedTimeInTransit:i,deliveryPredictionEligible:r})=>{const l=Boolean(r),o=a;return n(lo,{value:t,disabled:!0,accessibilityLabel:e.translate("general.loading"),secondaryContent:n(Re,{inlineSize:"5ch"}),children:n(F,{gap:"small-500",children:[n(M,{inlineSize:"small"}),l||null!=i?n(M,{inlineSize:"base",size:"small",id:"pending-shipping-estimated-time"}):null,o?n(Kn,{content:a,size:"small"}):null]})},t)}))})}function Kp(){const e=pt();return n(xo,{children:n(Bo,{children:Xp(e)})})}function Xp({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 Jp=E((function(){const{uiStateSignal:e,initialUiStateSignal:t}=Ua(an),a=Kt(),i=a.value?e.value:t.value,r=lc(),{hasViolations:l}=In(di),o=r.value&&l,{hasViolations:s}=Y(Qp),d=a.value&&s&&!o&&"error"!==i.status,u=d?n(eh,{}):null,c=(()=>{switch(i.status){case"initial":case"empty":return n(Kp,{});case"loading":return n($p,{});case"error":return n(Yp,{});case"filled":{const e=Hi(i.deliveryLines).filter(wn),t=e.flatMap((({methods:e})=>e.map((({title:e})=>e))));return n(ns,{impressionType:"shipping_methods",impressionFeatures:t,children:n(Zp,{lines:e,showErrorBanner:o,deliveryChangedBannerOwnedBySection:d})})}}})();return n(F,{gap:"base",children:[u,c]})}));function Zp({lines:e,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a}){const r=zn(),l=Xn(),[,o]=b(),d=ms(o),u=function({checkout:e}){return"shopPay"===e.identity.current.value?nh:i}(pt());return s((()=>{r("shippingMethodsFilled",{timestamp:new Date}),l({type:"shipping_methods_filled"})}),[l,r]),n(i,{children:[n(u,{}),n(F,{gap:"large-200",children:n(vs,{lines:e,loading:d,showErrorBanner:t,deliveryChangedBannerOwnedBySection:a})})]})}Jp.displayName="OnePageShippingMethods";const Qp=new Set(["DELIVERY_DELIVERY_LINE_DETAIL_CHANGED"]);function eh(){const{i18n:e}=pt();return n(Ae,{tone:"warning",errorType:H.DeliveryError,children:e.translate("shipping_errors.shipping_method")})}function nh(){const{trackSelectShippingMethod:e}=zc(),{availableDeliveryMethodsLoading:n,progressiveShippingRatesLoading:t}=Tp();
2return Np({onChange:e,prerequisitesLoading:n||n&&!t}),null}function th(){const{checkout:e,i18n:t}=pt(),a=e.addressManager.shipping.value,i=Do("shipping"),{shouldGateCrossBorder:r,crossBorderGate:l}=ts(),o=a.addresses.value.find((({id:e})=>e!==a.selectedAddress.value?.id)),s=h((()=>{if(!o)return;const e=()=>i.selectAddress(o.id,{source:"select-saved-address-link"}),n=o.address.countryCode;n&&r(n)?l(e):e()}),[i,o,r,l]);return o?n(ne,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, 1fr)",justifyContent:"start",justifyItems:"start",children:n(T,{id:"save_shipping_information",textDecoration:"none",onClick:s,children:t.translate("customer_account.saved_address_option_link")})}):null}function ah(){up();const e=fn(),t=e?.options.value.some((e=>"PICKUP_POINT"===e.id))??!1,i=br();return n(F,{gap:"large-300",children:[t&&n(cr.Prefetch,{}),n(Pr,{}),n(Xi,{name:"delivery-methods",children:n(ih,{})}),n(a,{when:i,children:n(_r,{})})]})}function ih(){const{methods:e}=Dn(),{i18n:i,router:r,checkout:{wallets:l,identity:o}}=pt(),s=Jn(),{deliveryNext:u,optionalDuties:c}=Et(),p=bs(),m=tn(),{shippingAddress:v}=ft();Zn(v,(()=>{m&&m.taxId.reset()}));const y=G("Checkout::DeliveryAddress::RenderBefore"),g=G("purchase.checkout.delivery-address.render-after"),f=gs(),{hasMultipleDeliveryGroups:b,onlyDeliveryGroupType:_}=f.value,{customizationsBefore:C,customizationsAfter:P}=fs({hasMultipleDeliveryGroups:b,targeted:!1}).value,S=t((()=>ri(u.value,!0)||p.value.showShipmentBreakdown)).value,A=S?"small-400":"base",E=zn(),w=Xn(),{negotiate:O}=be(),I=h((({shipping:e})=>{l.activeSession.value||O({include:[],fieldsToResolve:["deliveryNext"],silenceViolations:["non-delivery-address"],runListenersOnError:!0}),e.value=!0,E("sectionComplete",{section:"deliveryAddress",timestamp:new Date}),w({type:"section_complete",section:"deliveryAddress"})}),[l,O,E,w]),R=h((({shipping:e})=>{e.value=!1}),[]),T=e=>n(et,{padding:S?"small-400 none":void 0,children:e}),N=d((()=>({groupType:_&&Ds(_),includeDeliverySelectionGroups:!1})),[_]),L=Sr(),D=t((()=>L.value.isDelivery)),M=mn(),B=br(),V=t((()=>!!M.value&&(e.value.includes("PICK_UP")&&e.value.includes("SHIPPING")))),H="shippingMethod",z=t((()=>ld(r,H))),j=ir(),U=n(Qn,{sectionId:"localPickup",children:n(F,{gap:"small",children:[n(a,{when:V,children:n(k,{level:2,children:i.translate("delivery_options.pickup")})}),n(j?wr:Or,{})]})}),Y=n(Qn,{sectionId:"shipping",children:[n(et,{children:n(F,{gap:"base",children:[n(a,{when:V,children:n(k,{level:2,children:i.translate("delivery_options.ship_to_address")})}),n(a,{when:s,children:n(ee,{color:"subdued",children:i.translate("shipping.shipping_used_as_billing_notice")})}),n(a,{when:V,children:n(a,{when:B,children:n(x,{border:"base",padding:"base",borderRadius:"large",children:n(Ir,{selectedDeliveryMethodType:"SHIPPING"})})})}),n(gn,{customizations:y}),n(F,{gap:"large-300",children:[n(Ts,{children:n(xl,{onValid:I,onInvalid:R,children:n(ac,{children:[rh({identity:o})&&n(th,{}),n(Rr,{}),n(a,{when:D,children:n(Er,{})}),m&&n(Tr,{taxId:m.taxId,applied:m.applied})]})})}),n(gn,{customizations:g}),n(F,{gap:A,children:[n(k,{id:H,level:2,autoFocus:z.value,children:i.translate("shipping.shipping_method_title")}),n(nt,{children:[n(a,{when:()=>p.value.showShipmentBreakdown,children:n(Rs,{children:[n(Ls,{}),n(me,{blockSize:"small-200"})]})}),Eo("shipping.shipping_method_notice",i)?n(ee,{children:i.translate("shipping.shipping_method_notice")}):null,n(gn,{customizations:C,options:N,render:T}),n(Rs,{children:[n(Jp,{}),n(Ns.Preload,{})]}),n(gn,{customizations:P,options:N,render:T})]})]})]})]})}),n(a,{when:()=>c.value?.refuseDutiesPermitted,children:n(et,{accessibilityLabel:i.translate("shipping.duties_and_taxes_title"),children:n(F,{gap:"base",children:[n(k,{level:2,children:i.translate("shipping.duties_and_taxes_title")}),n(hs,{})]})})})]}),W=t((()=>e.value.includes("PICKUP_POINT"))),q=t((()=>e.value.includes("PICK_UP")));return n(a,{when:V,fallback:n(a,{when:()=>W.value||q.value,fallback:Y,children:n(a,{when:W,fallback:U,children:n(Qn,{sectionId:"pickupPoints",children:n(cr,{})})})}),children:n(F,{gap:"large-300",children:[U,Y]})})}function rh({identity:e}){return"customerAccount"===e.current.value}const lh=E((function(){const{shop:e,i18n:i}=pt(),r=G("Checkout::Dynamic::Render","DELIVERY1"),l=fn(),o=fe(),s=e.hasFlagEnabled(Ai),d=g(Boolean(!s&&l)),u=t((()=>o.value.contact&&d.value)),c=t((()=>u.value?void 0:"deliveryAddress")),p=t((()=>u.value?i.translate("shipping.delivery_title"):void 0));return n(wl,{accessibilityLabelledBy:c.value,accessibilityLabel:p.value,accessibilityRole:"group",children:n(F,{gap:"base",children:[n(a,{when:()=>!u.value,children:n(F,{gap:"small-400",children:n(fc,{})})}),n(qi,{}),n(ah,{}),n(gn,{customizations:r})]})})})),oh=l({displayName:"MobileOrderSummaryBeforeDetails",load:()=>p((()=>e((async()=>{const{MobileOrderSummary:e}=await import("./d2e6a587.DdUzoAUU.js");return{MobileOrderSummary:e}}),__vite__mapDeps([132,1,3,4,5,6,2,7,8,9,10,11,79,80,127,128,68,89,133])).then((({MobileOrderSummary:e})=>({default:e}))))),renderError(e){throw e}}),sh="undefined"==typeof window?void 0:performance.now();"undefined"!=typeof window&&_p.preload();const dh=Bp,uh=E((function(){return(()=>{const{embed:e,checkout:{identity:n},shop:t}=pt(),a="shopPay"===n.current.value&&Qt(e?.embedder),i=t.hasFlagEnabled(aa),r=jd(),l=Gd().value;fp({enabled:a,discountOffer:a?r.value:null,shopPromotionDiscounts:void 0,eligibility:l}),bu([{eligibility:l,redemptionTypes:["SHOP_DISCOUNT_OFFER"]}],{enabled:a,retryOnReady:i}),fu({enabled:a,redemptionTypes:["SHOP_DISCOUNT_OFFER"]})})(),(()=>{const{checkout:e,embed:n,shop:t,source:a}=pt(),i=fe(),r="shopPay"===e.identity.current.value&&!Qt(n?.embedder)&&e.configuration.visibility.showCashRedemption.value&&!(i.value.payment&&$t(a)),l=t.hasFlagEnabled(aa),o=jd(),s=yu(),d=Gd().value;fp({enabled:r,discountOffer:r?o.value:null,shopPromotionDiscounts:r?s.value:null,eligibility:d}),bu([{eligibility:d,redemptionTypes:["SHOP_DISCOUNT_OFFER","SHOP_PROMOTION"]}],{enabled:r&&l,retryOnReady:!0})})(),null}));function ch({isGuestPartialVaultedDelivery:e,isSectionStyleUnificationEnabled:a,children:i}){const r=t((()=>!e.value));return a?n(Tl,{target:e.value?"edgeToEdge":"vaulted",children:i}):n(Nl,{target:"vaulted",condition:r,children:i})}const ph=E((function({children:e}){const{checkout:i,embed:r,environment:l,i18n:o,observability:d,shop:u,shopPay:c,source:p}=pt(),m="VISIBLE"===i.configuration.headerText?.visibility,v=f(!1),y=h((()=>{v.value||(v.value=!0,void 0!==sh&&d.histogram({name:"one_page_below_fold_content_ready",value:Math.round(performance.now()-sh),unit:"ms",attributes:{buildId:l.commitSha}}))}),[l.commitSha,v,d]),b=Kt(),_=u.hasFlagEnabled(Ea),C=Jt({embedder:r?.embedder,shop:u}),P="google"===r?.embedder&&C,S=fe(),A=Ur(),E=t((()=>S.value.payment&&A.value)),k=g(fn()),w=tt(),O=t((()=>S.value.payment&&u.acceptTipPayments&&(w?.tippingPaymentAllowed??!0)&&i.configuration.visibility.showTips)),I=g(cn()[0]),{postPurchaseEnabled:R}=Es(),T=Et(),N=t((()=>T.buyerIdentity.value?.customerProfile)),L=at(),D=t((()=>P&&L.value)),M=mn(),B=t((()=>S.value.contact&&i.configuration.showContactInformation||S.value.delivery&&i.isShippingRequired.value||S.value.payment)),V=t((()=>S.value.delivery&&i.isShippingRequired.value||S.value.payment)),H=t((()=>M.value&&B.value)),z=Ei(),j=Ss(),U=t((()=>ki({configuration:i.configuration,identity:i.identity,shop:u,shopPay:c,embed:r,vaultedSections:S.value,isShippingRequired:i.isShippingRequired.value,hasSellingPlan:z.value,phoneCountryCode:j.value}))),Y=t((()=>"standalone-form"===U.value)),W=t((()=>"standalone-vaulted"===U.value)),q=t((()=>"vaulted-adjacent"===U.value)),$=t((()=>Y.value||W.value));!function(){const{negotiate:e}=be(),n=Et(),t=n.buyerIdentity,a=ft(),i=a.shippingAddress.value,r=a.billingAddress.value,{observability:l,checkout:o}=pt(),{value:d=[]}=n.allViolations,u=Mi(d),c=Sp(d),p=o.isShippingRequired.value?i.countryCode:r.countryCode,h=t?.value?.countryCode,m=JSON.stringify(t?.value,((e,n)=>void 0===n?null:n));s((()=>{u||c||h&&p!==h&&(l.log("country_code_alignment_mismatch_detected","[EnsureBackAndFrontEndCountryCodeAlignment] There was a mismatch between the preselected and the buyerIdentity countryCode on checkout load.",{selectedCountryCode:p,buyerIdentityCountryCode:h,buyerIdentity:m}),e({silenceViolations:["all"]}))}),[])}();const K=g(it({base:!0,medium:!1})),X=t((()=>!b.value||(K.value??!1))),J=Nr(),Z=t((()=>"hidden"!==J.value)),Q=g(G("Checkout::Contact::RenderAfter")),ee=function(){const{checkout:e,shop:n,source:a}=pt(),{email:i}=ft(),r=fe(),{buyerIdentity:l}=Et(),o=n.hasFlagEnabled(Bi);return t((()=>
2{if("businessCustomer"===e.identity.current.value)return!1;const t=l.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 d=o&&!xi(t?.countryCode);return Boolean(s&&"shopPayExternal"!==a.type&&!d&&!$t(a))}))}(),{main:{section:ne}}=ge(),{lineItems:{priority:te="base"}}=ve(),ae=g(zi(ne)),ie=Mn(),re=t((()=>"shopPay"===i.identity.current.value||S.value.payment||!ae.value?"belowPayment":"abovePayment")),le=t((()=>!$.value&&ee.value&&"belowPayment"===re.value)),oe=t((()=>!$.value&&ee.value&&"abovePayment"===re.value)),se=t((()=>ie.value&&S.value.payment&&le.value&&X.value)),de=t((()=>i.configuration.visibility.showEmailMarketing&&!$t(p)&&oe.value&&!N.value?.acceptsEmailMarketing)),ue=Sr(),ce=t((()=>ue.value.isRoot?"belowPayment"!==re.value||X.value&&ae.value?"abovePayment":"belowPayment":"none")),he=t((()=>"guest"===i.identity.current.value&&S.value.delivery||"businessCustomer"===i.identity.current.value&&!S.value.delivery&&S.value.payment)),me=t((()=>"guest"===i.identity.current.value?he.value&&!(S.value.contact&&S.value.payment):he.value)),ye=t((()=>!me.value&&i.isShippingRequired.value)),_e=t((()=>q.value||W.value)),Ce=Tc(),Pe=t((()=>Boolean(!$t(p)&&S.value.delivery&&null!=k.value&&!Ce.value))),Se=t((()=>S.value.delivery&&I.value.includes("PICK_UP")&&!Ce.value)),Ae=t((()=>Boolean(_e.value||Se.value||(ye.value||me.value)&&Pe.value))),Ee=t((()=>Boolean(ye.value&&Pe.value&&!_e.value))),ke=Qt(r?.embedder),we="beforeDetails"===i.configuration.orderSummary?.placement,Oe=t((()=>ke&&!we&&!Ee.value)),Ie=t((()=>ke&&Ae.value)),Re=t((()=>ke?we:ae.value)),Te=t((()=>"guest"===i.identity.current.value&&S.value.delivery&&!S.value.contact)),Ne=t((()=>!$.value&&ae.value&&(de.value||"abovePayment"===ce.value))),Le=t((()=>b.value&&S.value.contact&&!$.value&&Q.value.length>0)),De=t((()=>!$.value)),Me=Mp({includeContact:De}),Be=t((()=>b.value&&!L.value&&Me.value.length>0)),xe=As(),Ve=t((()=>b.value&&xe.value&&we)),Fe=t((()=>xe.value&&!we)),He=Boolean(r?.isFlagshipPartner)&&"high"===te;rt();const ze=t((()=>!$.value&&(de.value||se.value))),je=t((()=>"abovePayment"===ce.value)),Ue=t((()=>$.value?S.value.delivery&&i.isShippingRequired.value?o.translate("shipping.delivery_title"):o.translate("payment.title"):o.translate("contact.contact_method_title"))),Ge=t((()=>!ae.value&&!H.value&&(!W.value||V.value))),Ye=t((()=>!(H.value&&S.value.contact)&&(!W.value||V.value)&&(ie.value||ae.value&&!S.value.contact))),We=t((()=>S.value.payment&&!se.value&&!Fe.value)),qe=t((()=>B.value&&!Te.value)),$e=t((()=>_&&qe.value)),Ke=t((()=>!_&&qe.value)),Xe=t((()=>$e.value&&Ge.value)),Je=t((()=>!ke&&$e.value&&Ge.value&&!he.value&&S.value.payment&&(!i.isShippingRequired.value||S.value.delivery))),Ze=t((()=>ke?we:ie.value||Je.value)),Qe=t((()=>Je.value&&!X.value&&(le.value||"belowPayment"===ce.value)&&!E.value&&!Le.value&&!Be.value&&!D.value)),en=t((()=>Qe.value||E.value||Ne.value||se.value||ie.value&&!ae.value&&X.value||We.value&&(X.value||we))),nn=t((()=>E.value||We.value||!S.value.payment&&S.value.delivery&&!X.value&&!Le.value||S.value.payment&&se.value));return n(js,{children:[n(uh,{}),n(F,{blockSize:D.value?"100%":void 0,gap:"@media (inline-size >= extraSmall) large-200, none",children:[n(a,{when:Oe,children:n(lt,{accessibilityRole:"presentation"})}),$t(p)?n(F,{gap:"base",padding:"@media (inline-size >= extraSmall) none, large-200 large-200 none large-200",children:n(ot,{})}):null,n(st,{section:"toast"}),!He&&n(st,{section:"top"}),n(bp,{active:b,ready:v}),n(Cp,{fillAvailableBlockSize:D.value,ready:v,children:[m&&n(x,{padding:"none none large-100 none",children:n(Ms,{})}),"high"===te&&n(x,{display:"@media (inline-size >= medium) none, auto",children:n(Tl,{target:"lineItems",children:n(wl,{hideDivider:Z,children:n(dt,{})})})}),He&&n(st,{section:"top"}),n(a,{when:Z,children:n(Tl,{target:"expressCheckout",children:n(Lr,{})})}),n(a,{when:Ve,children:[n(ut,{section:"summary",children:n(ct,{section:"summary",children:n(x,{padding:"none large-200 large-100 large-200",children:n(Tl,{target:"plain",children:n(oh,{})})})})}),n(lt,{accessibilityRole:"presentation"})]}),n(kp,{}),n(Us,{}),n(a,{when:$,children:()=>n(wl,{accessibilityLabel:o.translate("contact.contact_method_title"),children:n(ut,{section:"contact",children:n(ct,{section:"contact",children:n(Gp,{showForm:i.configuration.showContactInformation,identityPresentation:W.value?"vaulted":"form",showEmailMarketingOptIn:W.value?ee.value:void 0})})})})}),n(Nl,{target:"vaulted",condition:$e,children:n(kl,{hideDivider:nn,condition:Ge,accessibilityLabel:Ue.value,children:n(Nl,{target:"vaulted",condition:Ke,children:[n(vp,{showDelivery:ye,insideVaultedCard:Xe}),n(kl,{condition:Ye,hideDivider:en,accessibilityLabel:Ue.value,children:n(F,{children:[n(a,{when:()=>!S.value.contact&&!Y.value,children:n(ut,{section:"contact",children:n(ct,{section:"contact",children:n(Gp,{showForm:i.configuration.showContactInformation})})})}),n(a,{when:()=>!he.value,children:n(ap,{hideLastDivider:Ze,showTopDivider:Ie,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})}),n(a,{when:H,children:n(Il,{})})]})})}),n(a,{when:E,children:n(x,{paddingBlockStart:"small-300",paddingBlockEnd:"base",children:n(Gr,{})})}),n(a,{when:()=>(!$.value||je.value)&&(ae.value||se.value),children:n(ct,{section:"contact",children:n(Op,{aboveFoldSpacing:!0,showEmailMarketingOptIn:ze,showPhoneMarketingOptIn:je})})}),n(a,{when:Le,children:n(ct,{section:"contact",children:n(Ip,{extensions:Q,hideDivider:"whenEmpty"})})}),n(a,{when:me,children:n(a,{when:i.isShippingRequired,children:n(ch,{isGuestPartialVaultedDelivery:Te,
2isSectionStyleUnificationEnabled:_,children:[n(pp,{}),n(Rl,{condition:he,accessibilityLabel:o.translate("shipping.delivery_title"),children:n(ap,{hideLastDivider:Re,showTopDivider:Ie,stripBlockEndPadding:i.configuration.isUniversalCheckoutFinalizer})})]})})}),n(a,{when:Be,children:n(Ip,{extensions:Me,hideDivider:"whenEmpty"})}),n(a,{when:()=>!S.value.delivery&&i.isShippingRequired.value,children:n(pe,{target:"cart.deliveryGroups[0].deliveryAddress",children:n(ut,{section:"delivery",children:n(ct,{section:"delivery",children:n(Qn,{sectionId:"delivery",children:n(lh,{})})})})})}),n(a,{when:O,children:n(Al.Prefetch,{})}),n(a,{when:D,children:n(x,{className:"xoG3V","data-testid":"onepage-vaulted-spacing"})}),n(a,{when:b,children:n(_p,{onReady:y,includeContactInVaultedExtensions:De,showMobileOrderSummary:Fe,showVaultedStateMarketingDisclosureBelowPayment:le,phoneMarketingPlacement:ce,isSectionCustomized:ae,showVaultedStateMarketingDisclosureOnMobile:se,expressCheckoutSlot:J,showVaultedCardConsentSpacing:Qe})})]}),R&&n(El,{})]}),n(Ap,{}),n(a,{when:i.isShippingRequired,children:n(Dp,{})}),n(Dr,{id:"OnePage"}),e]})})),hh=Object.freeze(Object.defineProperty({__proto__:null,MobileOrderSummaryBeforeDetails:oh,default:ph,onePageCriticalStyleClassNames:dh},Symbol.toStringTag,{value:"Module"}));export{cd as L,pd as M,ac as O,Op as P,md as R,Uc as S,Jd as U,Ip as V,Xu as a,Ju as b,Jp as c,xc as d,Bc as e,Vc as f,id as g,nd as h,oc as i,rd as j,ld as k,Wd as l,Yd as m,Mp as n,Au as o,hh as p,wp 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.