1import{_ as Re}from"./4IOEZ-zZ.js";import{U as Ae,d as q,l as Y,aM as Te,p as K,o as v,h as j,w as P,c as w,F as z,x as he,f as r,t as x,n as Q,q as se,v as U,a as p,b as I,a$ as Ue,j as ie,C as Z,b0 as Oe,as as Ne,ai as _e,B as le,a2 as ce,Z as Be,T as ue,J as B,K as H,aH as de,aF as pe,a4 as ee,i as L,M as Me,G as Le,E as De,W as Ce,ag as W,b1 as X,aU as V,N as Fe,au as be,O as Se,aG as Pe,a3 as $e,b2 as He,aV as Ee,r as te,X as Ve,b3 as je,b4 as qe,b5 as fe,aP as ne,Y as xe,aa as We,b6 as Ye,b7 as ze,ac as ke,aJ as Ge,aW as Ke,a5 as Je,b8 as ve,aY as Xe,aq as Ze,aZ as Qe,b9 as et,a_ as tt,e as nt,ba as ot}from"./beVNFf66.js";import{I as at}from"./D5U5_BPP.js";import{P as oe,a as ae}from"./CO4eJk4_.js";const rt=a=>!!a.find(s=>Ae(s)),st=["value"],it=q({__name:"CountrySelect",props:{label:{},updateValue:{type:Function},value:{},wrapperClass:{}},setup(a){const{locale:s}=Y(),g=Te(),$=K();return(_,d)=>{const l=Re;return v(),j(l,{"model-value":a.value,"test-id":"shipping-country-select","select-wrapper-class":a.wrapperClass,label:a.label,name:"country",autocomplete:"country","onUpdate:modelValue":a.updateValue},{default:P(()=>[(v(!0),w(z,null,he(r(g).getCountries(r(s)),t=>(v(),w("option",{key:t.id,value:t.iso_code},x(r($).getTranslation(t,r(s))),9,st))),128))]),_:1},8,["model-value","select-wrapper-class","label","onUpdate:modelValue"])}}}),Nt=Object.assign(it,{__name:"CountrySelect"}),lt={class:"bg-chinese-black text-cultured"},ct={class:"flex flex-col items-start px-6 pt-6"},ut={class:"flex flex-col px-6"},dt=q({__name:"ShippingWarning",props:{checkout:{type:Boolean},warningContent:{}},setup(a){const{locale:s}=Y(),g=Q(),$=K(),_=a,d=B(""),l=B(),t=()=>{d.value="remove",g.updateCart({actions:_.warningContent.concerned_products.map(o=>({id:o.id,quantity:o.quantity??0,type:H.REMOVE_ITEM})),country:$.currentShippingCountryCode,locale:s.value}).then(o=>{o&&!rt(o.line_items)&&g.updateCart({actions:[{key:"",name:"",type:H.SET_SHIPPING_METHOD}],country:$.currentShippingCountryCode,locale:s.value})}).finally(()=>d.value="")};return se(()=>{l.value=_.warningContent.concerned_products.map(o=>o.name).join(", ")}),(o,O)=>{const u=ie,M=le,n=ce;return v(),w("div",lt,[U("div",ct,[p(u,{styled:""},{default:P(()=>[I(x(o.$t(`shipping.${r(Ue)(a.warningContent.type)}`)),1)]),_:1}),p(M,{"test-id":"more-info-button",to:r(Oe)(("fullPaths"in o?o.fullPaths:r(Ne)).faq,r(s))+("externalPaths"in o?o.externalPaths:r(_e)).customFee,"is-external":"",variant:r(Z).TERTIARY,class:"!px-0 !font-body !text-xs !text-cultured"},{default:P(()=>[I(x(o.$t("shipping.moreInfo")),1)]),_:1},8,["to","variant"])]),p(n),U("div",ut,[p(u,{class:"!text-xs"},{default:P(()=>[I(x(o.$t("shipping.productsConcerned")),1)]),_:1}),p(u,{class:"!text-xs",weight:"bold"},{default:P(()=>[I(x(r(l)),1)]),_:1})]),p(n),U("div",{class:ue(["flex px-6 pb-6 pt-2",{"flex-col":!a.checkout}])},[p(M,{"test-id":"find-local-dealer-button",to:("getExternalUrl"in o?o.getExternalUrl:r(Be))(("externalPaths"in o?o.externalPaths:r(_e)).dealerLocator,r(s)),"is-external":"",variant:r(Z).SECONDARY,class:"!border-cultured !text-cultured"},{default:P(()=>[I(x(o.$t("shipping.findALocalDealer")),1)]),_:1},8,["to","variant"]),p(M,{"test-id":"remove-products-button",variant:r(Z).TERTIARY,class:"!font-body !text-xs !text-cultured",onClick:t},{default:P(()=>[I(x(o.$t("shipping.removeProducts")),1)]),_:1},8,["variant"])],2)])}}}),Bt=Object.assign(dt,{__name:"ShippingWarning"});var G=(a=>(a.BILLING="billing",a.SHIPPING="shipping",a))(G||{});const pt={key:0},mt=["data-testid"],gt={class:"flex justify-between"},yt=q({__name:"CouponCode",setup(a){const{locale:s,t:g}=Y(),$=de(),{isFromInApp:_}=pe(),d=Q(),l=K(),t=B(),o=B(!1),O=n=>{const c=n.discount_tag??[],y=c.find(h=>h.type===X.DESCRIPTION);if(y)return String(y.value);const i=c.find(h=>h.type===X.PERCENTAGE);if(i)return g("product.pack.discountTag.save",{symbol:i.symbol,value:i.value});const E=c.find(h=>h.type===X.AMOUNT&&h.symbol===l.getCurrency);if(E)return g("product.pack.discountTag.save",{symbol:"",value:ee(s.value,E.value,l.getCurrency)});const e=c.find(h=>h.type===X.GIFT_LINE_ITEM);return e?g("product.pack.discountTag.get",{value:e.value}):n.name??""},u=()=>{if(o.value=!0,t.value){if(d.cart?.discounts){for(const n of d.cart.discounts.portions)if(n.code_name==t.value){$.addError({text:"couponCode.couponAlreadyUsed",title:"general.error"}),o.value=!1;return}}if(d.cart?.line_items?.find(n=>n.discounted_price_per_quantity.find(c=>c.discounted_price?.portions.find(y=>y.code_name===t.value)))){$.addError({text:"couponCode.couponAlreadyUsed",title:"general.error"}),o.value=!1;return}d.updateCart({actions:[{code:t.value,type:H.ADD_COUPON}],country:l.currentShippingCountryCode,locale:s.value,store:_.value?W.INAPP:W.WEB}).then(n=>
1{n&&(n.discounts?.portions.some(c=>c.code_name===t.value)||n.line_items?.find(c=>c.discounted_price_per_quantity.find(y=>y.discounted_price?.portions.find(i=>i.code_name===t.value))))?$.addSuccess({text:"couponCode.addPromoCodeSuccessMessage",title:"general.success"}):$.addError({text:"couponCode.addPromoCodeErrorMessage",title:"general.error"})}).finally(()=>{t.value="",o.value=!1})}},M=n=>{o.value=!0,d.updateCart({actions:[{id:n,type:H.REMOVE_COUPON}],country:l.currentShippingCountryCode,locale:s.value,store:_.value?W.INAPP:W.WEB}).then(c=>{c&&$.addSuccess({text:"couponCode.removePromoCodeSuccessMessage",title:"general.success"})}).finally(()=>o.value=!1)};return(n,c)=>{const y=ie,i=le,E=ce,e=at,h=Ce,C=Me;return v(),w(z,null,[r(d).cart?.discounts?(v(),w("div",pt,[(v(!0),w(z,null,he(r(d).cart.discounts.portions,m=>(v(),w("div",{key:m.code_id,"data-testid":`coupon-code-${m.code_id}-container`,class:"flex flex-col items-start"},[p(y,null,{default:P(()=>[I(x(O(m)),1)]),_:2},1024),m.use_discount_code?(v(),j(i,{key:0,"test-id":`remove-${m.id}-button`,variant:r(Z).TERTIARY,class:"!px-0 !text-xs","no-underline":"",disabled:r(o),onClick:b=>M(m.code_id)},{default:P(()=>[I(x(n.$t("couponCode.remove")),1)]),_:1},8,["test-id","variant","disabled","onClick"])):L("",!0)],8,mt))),128)),U("div",gt,[p(y,{styled:""},{default:P(()=>[I(x(n.$t("couponCode.total")),1)]),_:1}),p(y,{styled:""},{default:P(()=>[I(x(n.$t("general.symbols.dash"))+" "+x(r(ee)(r(s),r(d).cart.discounts?.total.cent_amount,r(d).cart.discounts.total.currency_code)),1)]),_:1})]),p(E)])):L("",!0),U("div",null,[p(C,{modelValue:r(t),"onUpdate:modelValue":c[0]||(c[0]=m=>De(t)?t.value=m:null),"test-id":"coupon-code-input",label:n.$t("couponCode.placeholder"),disabled:r(o),onKeyup:Le(u,["enter"])},{suffix:P(()=>[p(h,{"test-id":"confirm-coupon-code-button",class:"mr-4 focus-visible:outline-turquoise-blue",disabled:!r(t)||r(o),onClick:u},{default:P(()=>[p(e,{class:"size-6 hover:fill-turquoise-blue"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","label","disabled"])])],64)}}}),Mt=Object.assign(yt,{__name:"CouponCode"}),_t={class:"bg-cultured p-6 md:p-8 dark:bg-gunmetal"},ft={class:"flex flex-row items-center justify-between"},vt={key:1},ht={class:"flex flex-col"},Ct={key:1,class:"flex flex-col","data-testid":"total-price-container"},bt=q({__name:"CartOrderSummary",props:{hasItems:{type:Boolean},isUpdating:{type:Boolean},loading:{type:Boolean},showTotalPrice:{type:Boolean},title:{},totalPrice:{},totalWrapperClass:{}},setup(a){const{locale:s}=Y();return(g,$)=>{const _=ie,d=ce,l=Fe;return v(),w("div",_t,[U("div",ft,[p(_,{styled:"",class:"!text-2xl"},{default:P(()=>[I(x(a.title),1)]),_:1}),V(g.$slots,"header")]),p(d),a.loading?(v(),j(l,{key:0,centered:""})):(v(),w("div",vt,[a.hasItems?V(g.$slots,"items",{key:0}):L("",!0),V(g.$slots,"shipping"),V(g.$slots,"discounts"),a.totalPrice?(v(),w(z,{key:1},[p(d),U("div",{class:ue(["flex flex-row justify-between",a.totalWrapperClass])},[U("div",ht,[p(_,{styled:"",class:"!text-2xl"},{default:P(()=>[I(x(g.$t("checkout.total")),1)]),_:1}),V(g.$slots,"vat-label")]),a.isUpdating?(v(),j(l,{key:0,centered:"",class:"!p-2",size:"sm"})):(v(),w("div",Ct,[a.showTotalPrice?(v(),j(_,{key:0,styled:"",class:"!text-2xl"},{default:P(()=>[I(x(("formatPrice"in g?g.formatPrice:r(ee))(r(s),a.totalPrice.cent_amount,a.totalPrice.currency_code)),1)]),_:1})):L("",!0)]))],2)],64)):L("",!0)])),V(g.$slots,"footer")])}}}),Lt=Object.assign(bt,{__name:"CartOrderSummary"}),St={key:0,class:"flex flex-col"},Pt=q({__name:"BraintreePaypalButton",props:{pageContext:{default:"cart"}},setup(a){const s=de(),{locale:g}=Y(),$=be(),{isDarkMode:_,isFromInApp:d}=pe(),l=Q(),t=Se(),o=K(),O=Pe(),u=$e(),M=a,n=B(!0),c=B(!1),y=B(null),i=B(null),E=B(!1),e=`paypal-button-${M.pageContext}-${Math.random().toString(36).substring(7)}`,h=Ve(()=>{const S=!ne.includes(o.currentShippingAddress.country)||(o.currentShippingAddress.state?.trim().length??0)>1;return t.isLoggedIn&&!u.isAdaptivePricing&&l.cart?.total_price&&l.cart.total_price.cent_amount>0&&l.hasNoHardwareInCart&&S}),C=async()=>{if(!E.value||!h.value||!y.value){console.debug(`[${e}] Component prerequisites not met.`),n.value=!1,h.value&&!y.value&&(c.value=!0);return}n.value=!0,c.value=!1,console.debug(`[${e}] Setting up component...`),await b();try{if(console.debug(`[${e}] Ensuring PayPal Checkout Instance...`),await u.ensurePaypalCheckoutInstance(),console.debug(`[${e}] Loading PayPal SDK Script if needed...`),await u.loadPaypalSdkScript(g.value),!E.value||!u.isPaypalReady||!y.value){console.warn(`[${e}] Component unmounted or PayPal not ready after setup. Instance: ${!!u.paypalCheckoutInstance}, SDK Loaded: ${u.isPaypalSdkLoaded}`),E.value&&!u.isPaypalReady&&(c.value=!0),n.value=!1;return}console.debug(`[${e}] Rendering component using window.paypal...`),await m()}catch(S){console.error(`[${e}] Failed to setup or render component:`,S),c.value=!0,s.addError({text:"payment.paypalInitErrorMessage",title:"general.error"}),await b()}finally{E.value&&(n.value=!1),console.debug(`[${e}] Component setup process finished.`)}},m=async()=>{const S=window.paypal,R=document.getElementById(e);if(!S||typeof S.Buttons!="function"||!u.isPaypalReady||!R||!E.value){console.warn(`[${e}] Cannot render component - prerequisites failed.`),!R&&h.value&&(c.value=!0),(!S||typeof S.Buttons!="function")&&(c.value=!0);return}R.innerHTML="";try{console.debug(`[${e}] Rendering...`),i.value=S.Buttons({createOrder:()=>{console.debug(`[${e}] createOrder called`);const f=u.paypalCheckoutInstance;if(!f)throw console.error(`[${e}] Braintree PayPal checkout instance missing in createOrder.`),s.addError({text:"payment.paypalCreatePaymentErrorMessage",title:"general.error"}),new Error("Braintree PayPal checkout instance is not available.");const k=We(l.cart?.total_price.cent_amount??null),T=l.cart?.total_price.currency_code;if(!k||!T)throw console.error(`[${e}] Invalid amount or currency for PayPal order:`,k,T),s.addError({text:"payment.paypalCartInvalidErrorMessage",title:"general.error"}),new Error("Invalid cart total for PayPal.");return f.createPayment({amount:k,currency:T,enableShippingAddress:!0,flow:ze.Checkout,intent:Ye.Capture})},fundingSource:"paypal",onApprove:async(f,k)=>{if(console.debug(`[${e}
1] onApprove`,f),!E.value){console.warn(`[${e}] Component unmounted during onApprove`);return}const T=u.paypalCheckoutInstance;if(!T)throw console.error(`[${e}] Braintree PayPal checkout instance missing in onApprove.`),s.addError({text:"payment.paypalCreateOrderErrorMessage",title:"general.error"}),new Error("Braintree PayPal checkout instance is not available for tokenization.");n.value=!0;try{return T.tokenizePayment(f).then(async A=>{console.debug(`[${e}] Payment tokenized by Braintree:`,A);try{const N=A.details.shippingAddress??A.details.billingAddress,F=A.details.billingAddress??A.details.shippingAddress;if(N?.countryCode&&N.countryCode!==o.currentShippingCountryCode){s.addError({text:"payment.addressCountryMismatchErrorMessage",title:"general.error"}),n.value=!1;return}const ge=N?.countryCode??o.currentShippingCountryCode,Ie=F?.countryCode??o.currentBillingCountryCode,ye=N?.state||o.currentShippingAddress.state,we=F?.state||o.currentBillingAddress?.state;if(ne.includes(ge)&&!ye){s.addError({text:"payment.paypalMissingStateErrorMessage",title:"general.error"}),window.scrollTo({behavior:"smooth",top:0});return}const J=[];N?.line1&&J.push({address:{additional_street_info:N.line2,city:N.city,country:ge,first_name:N.recipientName??"",id:"",last_name:"",postal_code:N.postalCode,state:ye,street_name:N.line1},address_type:G.SHIPPING,type:H.UPDATE_ADDRESS}),F?.line1&&J.push({address:{additional_street_info:F.line2,city:F.city,country:Ie,first_name:F.recipientName??"",id:"",last_name:"",postal_code:F.postalCode,state:we,street_name:F.line1},address_type:G.BILLING,type:H.UPDATE_ADDRESS}),J.length&&await l.updateCart({actions:J,country:o.currentShippingCountryCode,locale:g.value,skip_checkout_session_creation:!0})}catch(N){console.warn(`[${e}] Failed to update cart addresses from PayPal details:`,N)}const me=await O.createOrder({device_data:d.value?"app":"web",interface:ae.BRAINTREE,method:oe.EXPRESS_CHECKOUT,name:"Paypal",nonce:A.nonce},d.value);me?.id&&xe($(`/${d.value?"buy/inapp":"order"}/success?id=${me.id}${d.value?"&from_inapp=true":""}`))})}catch(A){console.error(`[${e}] Error during onApprove processing:`,A),s.addError({text:"payment.paymentError",title:"general.error"}),n.value=!1}},onCancel:f=>{console.warn(`[${e}] onCancel`,f),E.value&&(s.add({text:"payment.paymentCanceledErrorMessage",title:"general.warning"}),n.value=!1)},onClick:(f,k)=>(console.debug(`[${e}] onClick`,f),l.cart?.total_price?.cent_amount?k.resolve():(console.warn(`[${e}] Preventing PayPal flow due to invalid cart total.`),s.addError({text:"payment.paypalCartInvalidErrorMessage",title:"general.error"}),k.reject())),onError:f=>{console.error(`[${e}] onError:`,f),E.value&&(c.value=!0,n.value=!1)},onInit:(f,k)=>{console.debug(`[${e}] onInit`,f),k.enable()},style:{borderRadius:1,color:_.value?fe.Silver:fe.Black,height:45,label:qe.Pay,shape:je.Rect,tagline:!1}}),await i.value.render(`#${e}`),console.debug(`[${e}] Component rendered.`)}catch(f){console.error(`[${e}] Error while rendering component:`,f),c.value=!0,n.value=!1,await b()}},b=async()=>{if(!(u.currentOrderAction||u.isExpressCheckoutInProgress)){if(i.value){console.debug(`[${e}] Cleaning up component instance...`);try{await i.value.close(),console.debug(`[${e}] PayPal component instance closed.`)}catch(S){console.warn(`[${e}] Error closing component instance (ignoring):`,S)}finally{i.value=null}}y.value&&(console.debug(`[${e}] Clearing component.`),y.value.innerHTML="")}};se(()=>{console.debug(`[${e}] Component mounted.`),E.value=!0,h.value?He(()=>{y.value?C():(console.error(`[${e}] elementRef not available on mount.`),c.value=!0)}):(console.debug(`[${e}] Not attempting render on mount (conditions not met).`),n.value=!1)}),Ee(async()=>{console.debug(`[${e}] Component unmounted.`),E.value=!1,await b()});const D=Ge(C,500);return te([()=>l.cart?.total_price?.cent_amount,()=>l.cart?.total_price?.currency_code,_,()=>t.isLoggedIn,()=>l.hasNoHardwareInCart],async(S,R)=>{const[,f,,,]=S,[,k,,,]=R;if(!E.value)return;console.debug(`[${e}] Watcher triggered. Currency or cart content changed`);const T=f&&k&&f!==k;T&&(console.warn(`[${e}] Currency changed from ${k} to ${f}. Cleaning up PayPal SDK state forcefully.`),n.value=!0,c.value=!1,await u.cleanupPayPal(),await b()),h.value?T||JSON.stringify(S)!==JSON.stringify(R)?(console.debug(`[${e}] Conditions met and relevant data changed, triggering component re-setup.`),D()):(console.debug(`[${e}] Watched values changed but resulted in no effective difference requiring setup.`),n.value&&!T&&(n.value=!1)):(console.debug(`[${e}] Conditions no longer met, cleaning up component`),await b(),n.value=!1,c.value=!1)}),te(()=>u.isPaypalReady,(S,R)=>
1{E.value&&h.value&&S&&!R&&!i.value&&!c.value&&!n.value&&(console.debug(`[${e}] PayPal became ready post-mount. Triggering setup.`),D())}),(S,R)=>{const f=ke;return r(h)?(v(),w("div",St,[r(n)?(v(),j(f,{key:0,class:"h-[45px] w-full"})):L("",!0),U("div",{id:e,ref_key:"elementRef",ref:y,class:ue([{"opacity-0":r(n)},"z-10 transition-opacity duration-300"])},null,2)])):L("",!0)}}}),Dt=Object.assign(Pt,{__name:"BraintreePaypalButton"}),$t={key:0,class:"flex flex-col"},Et=q({__name:"StripeExpressCheckout",setup(a){const{locale:s}=Y(),g=Ze(),{isDarkMode:$,isFromInApp:_}=pe(),d=be(),l=de(),t=$e(),o=Pe(),O=Q(),u=Se(),M=K(),n=B(null),c=B(null),y=B(!1),i=`stripe-express-checkout-${Math.random().toString(36).substring(7)}`;se(()=>{console.debug(`[${i}] Component mounted.`),h()}),Ee(()=>{console.debug(`[${i}] Component leaving route.`),e()}),Ke(()=>{console.debug(`[${i}] Component unmounted.`),e()}),te([()=>u.isLoggedIn,()=>O.cartFetchState,()=>o.orderFetchState,()=>t.stripeCheckout],()=>{if(t.isExpressCheckoutInProgress||t.isStripeActionInProgress){console.debug(`[${i}] State changed during express checkout, skipping re-setup.`);return}console.debug(`[${i}] State changed, re-setting up element.`),e(),h()},{flush:"post"});const E=(C,m)=>{const b="/payment/process";let D=`?id=${C}&checkout_session_id=${m}${_.value?"&from_inapp=true":""}`;return _.value?D+="&from_inapp=true&redirect_url=/buy/inapp/success":D+="&redirect_url=/order/success",`${Xe(g.public.baseUrl,"/store",d(b))}${D}`},e=()=>{if(t.currentOrderAction||t.isExpressCheckoutInProgress||t.isStripeActionInProgress){console.log(`[${i}] Unable to cleanup existing element.`);return}n.value&&(console.debug(`[${i}] Destroying existing element.`),n.value.unmount(),n.value.destroy(),n.value=null)},h=async()=>{if(t.currentOrderAction||t.isExpressCheckoutInProgress||t.isStripeActionInProgress){console.debug(`[${i}] Unable to create and mount element.`);return}if(!(t.getCheckoutSessionClientSecret&&u.isLoggedIn&&O.hasNoHardwareInCart)){console.debug(`[${i}] Setup prerequisites not met.`);return}if(!t.stripeCheckout){console.warn(`[${i}] Stripe checkout not available in store.`);return}y.value=!0,t.stripeCheckout&&O.cart&&O.cartFetchState===Je.SUCCEEDED&&c.value&&(n.value||(console.debug(`[${i}] Creating and mounting element.`),n.value=t.stripeCheckout.createExpressCheckoutElement({buttonHeight:45,buttonTheme:{applePay:$.value?"white":"black",googlePay:$.value?"white":"black",paypal:$.value?"white":"black"},buttonType:{applePay:"buy",googlePay:"buy",paypal:"pay"},layout:{maxColumns:t.isAdaptivePricing?2:1,maxRows:1},paymentMethodOrder:void 0,paymentMethods:{amazonPay:"never",applePay:"always",googlePay:"always",link:"auto",paypal:t.isAdaptivePricing?"auto":"never"}})),n.value&&(console.debug(`[${i}] Mounting element.`),n.value.mount(c.value),n.value.on("ready",()=>{console.debug(`[${i}] Element ready.`),y.value=!1}),n.value.on("loaderror",C=>{console.error(`[${i}] Load error:`,C),y.value=!1}),n.value.on("confirm",async C=>{if(!t.isExpressCheckoutInProgress){t.isExpressCheckoutInProgress=!0;try{console.debug(`[${i}] Confirmation started.`);const m=C.shippingAddress??C.billingDetails,b=C.billingDetails??C.shippingAddress;if(m?.address.country!==M.currentShippingCountryCode){l.addError({text:"payment.addressCountryMismatchErrorMessage",title:"general.error"}),C.paymentFailed({reason:"invalid_shipping_address"});return}if(ne.includes(m.address.country)&&!m.address.state){l.addError({text:"payment.paypalMissingStateErrorMessage",title:"general.error"}),window.scrollTo({behavior:"smooth",top:0}),C.paymentFailed({reason:"invalid_shipping_address"});return}const D=ve(m?.name),S=ve(b?.name),R=[];if(m&&R.push({address:{additional_street_info:m.address.line2??void 0,city:m.address.city,country:m.address.country,first_name:D.firstName,id:"",last_name:D.lastName,postal_code:m.address.postal_code,state:m.address.state,street_name:m.address.line1},address_type:G.SHIPPING,type:H.UPDATE_ADDRESS}),b&&R.push({address:{additional_street_info:b.address.line2??void 0,city:b.address.city,country:b.address.country,first_name:S.firstName,id:"",last_name:S.lastName,postal_code:b.address.postal_code,state:b.address.state,street_name:b.address.line1},address_type:G.BILLING,type:H.UPDATE_ADDRESS}),R.length&&await O.updateCart({actions:R,country:M.currentShippingCountryCode,locale:s.value,skip_checkout_session_creation:!0,store:_.value?W.INAPP:W.WEB}),!t.checkoutSession){l.addError({text:"payment.communicationWithPaymentServiceError",title:"general.error"}),C.paymentFailed();return}if(await t.createPayment(ae.STRIPE,oe.EXPRESS_CHECKOUT,C.expressPaymentType.toString(),t.checkoutSession.id,_.value)){console.debug(`[${i}] Creating order.`);const k=await o.createOrder({interface:ae.STRIPE,method:oe.EXPRESS_CHECKOUT,name:C.expressPaymentType.toString()},_.value);if(k){if(!t.stripeClient||!t.checkoutActions){l.addError({text:"payment.communicationWithPaymentServiceError",title:"general.error"}),C.paymentFailed();return}console.debug(`[${i}] Confirming Stripe payment...`),t.isStripeActionInProgress=!0;const T=await t.checkoutActions.confirm({email:u.user?.email??u.newUser?.email,expressCheckoutConfirmEvent:C,returnUrl:E(k.id,t.checkoutSession.id)}).then(A=>(console.debug(`[${i}] Stripe confirmation response:`,A),A)).catch(A=>{console.error(`[${i}] Stripe confirmation error:`,A),l.addError({text:"payment.paymentError",title:"general.error"})}).finally(()=>t.isStripeActionInProgress=!1);if(T?.type==="error"&&T?.error){l.addError({text:"payment.stripeConfirmPaymentErrorMessage",title:"general.error"}),xe(d(`/checkout${_.value?"?from_inapp=true":""}`));return}}}}finally{t.isExpressCheckoutInProgress=!1}}})))};return(C,m)=>{const b=ke;return r(u).isLoggedIn&&r(O).cart?.total_price&&r(O).hasNoHardwareInCart||r(t).isExpressCheckoutInProgress?(v(),w("div",$t,[r(y)?(v(),j(b,{key:0,class:"h-[45px] w-full"})):L("",!0),U("div",{ref_key:"elementRef",ref:c},null,512)])):L("",!0)}}}),Ft=Object.assign(Et,{__name:"StripeExpressCheckout"});var re=(a=>(a.PRIVACY_POLICY="PRIVACY_POLICY",a.RETURN_POLICY="RETURN_POLICY",a.TERMS_OF_SERVICE="TERMS_OF_SERVICE",a))(re||{});const xt={key:0,class:"fixed inset-0 z-30 flex flex-col justify-between !rounded-none bg-white !p-0 !shadow-none md:inset-y-6 md:!w-fit xl:inset-x-48 3xl:inset-x-96 dark:bg-chinese-black"},kt={class:"flex flex-col items-center p-10"},It={class:"h-full overflow-y-auto bg-bright-gray p-8 dark:bg-gunmetal"},wt={class:"flex flex-col bg-bright-gray text-center dark:bg-gunmetal"},Rt=q({__name:"PopIn",props:{close:{type:Function},type:{}},setup(a){return(s,g)=>{const $=Qe,_=et,d=Ce,l=nt,t=le;return v(),w(z,null,[p($,{"is-open":a.type!=null,close:a.close},null,8,["is-open","close"]),p(ot,{direction:"bottom"},{default:P(()=>[a.type!=null?(v(),w("section",xt,[U("header",kt,[p(d,{"test-id":"modal-close-button",class:"absolute right-4 top-4",onClick:a.close},{default:P(()=>[p(_,{class:"size-6"})]),_:1},8,["onClick"]),p(r(tt),{class:"size-14 fill-chinese-black dark:fill-white"}),p(l,{type:"h3",class:"mt-2"},{default:P(()=>[I(x(a.type===r(re).TERMS_OF_SERVICE?s.$t("checkout.termsOfServiceTitle"):a.type===r(re).RETURN_POLICY?s.$t("checkout.returnPolicyTitle"):s.$t("checkout.privacyPolicyTitle")),1)]),_:1})]),U("div",It,[V(s.$slots,"default")]),U("footer",wt,[p(t,{"test-id":"
1close-button",class:"m-4 mt-6 dark:!bg-chinese-black",onClick:a.close},{default:P(()=>[I(x(s.$t("general.close")),1)]),_:1},8,["onClick"])])])):L("",!0)]),_:3})],64)}}}),Ht=Object.assign(Rt,{__name:"UiPopIn"});export{G as A,re as P,Nt as _,Bt as a,Ht as b,Lt as c,Mt as d,Dt as e,Ft as f,rt as i};
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.