1import{_ as V}from"./CI4S50Aq.js";import E from"./5P6srv5h.js";import{e as P,k as N,s as C,b as O,r as y,B}from"./EW60oKse.js";import{u as U}from"./CAESI_1u.js";import{z as $,b as r,H as I,u as a,O as k,P as v,L as x,R as b,S as w,a0 as L,a2 as R}from"./QVWpw_zs.js";const T={key:0},z={key:1},F={class:"container mx-auto text-center my-20"},J={class:"text-xl font-semibold mb-3"},G=$({__name:"verification",setup(M){const{t:o}=P(),{apiInstance:h}=N(),{selectedPaymentMethod:S}=C(),{query:f}=O(),t=f.state,m=f.code,n=r(o("checkout.ageVerification.generalError")),s=r(o("checkout.ageVerification.tryAgain")),i=r("/checkout?error=checkout.ageVerificationFailed"),g=r(!0);function u(){setTimeout(()=>{g.value=!1},1e3),U(i.value,200)}return I(async()=>{var l,c;if(t==null){u();return}let d=!1;if(await y(h,`/store-api/checkout/${t}/age-verification?authorizationCode=`+(m??""),{method:"POST",body:{authorizationCode:m}}).then(e=>{e&&(d=e.verified??!1)}).catch(e=>{console.error("Error occured during age-verification",JSON.stringify(e),t)}),!d){u();return}i.value="/checkout?error=checkout.paymentFailed",await y(h,B(),{method:"POST",body:{orderId:t,finishUrl:((l=window==null?void 0:window.location)==null?void 0:l.origin)+`/checkout/success/${t}/paid`,errorUrl:((c=window==null?void 0:window.location)==null?void 0:c.origin)+`/checkout/success/${t}/unpaid`}}).then(e=>{var p,_;((p=S.value)==null?void 0:p.synchronous)==!0?(n.value=o("checkout.ageVerification.success"),s.value=o("checkout.ageVerification.continueSuccess"),i.value=`${(_=window==null?void 0:window.location)==null?void 0:_.origin}/checkout/success/${t}/paid`):e&&e.redirectUrl?(n.value=o("checkout.ageVerification.success"),s.value=o("checkout.ageVerification.continuePayment"),i.value=e.redirectUrl):console.error("Error occured inside handlePaymentEndpoint",JSON.stringify(e),t)}).catch(e=>{console.error("Error occured during handlePaymentEndpoint",JSON.stringify(e),t)}),u()}),(d,l)=>{const c=V;return a(g)?(k(),v("div",T,[x(E)])):(k(),v("div",z,[b("section",F,[b("h1",J,w(a(n)),1),x(c,{class:"inline-block py-2 px-4 text-base font-medium text-center text-white bg-brand-primary rounded-lg hover:bg-gray-400",to:a(i)},{default:L(()=>[R(w(a(s)),1)]),_:1},8,["to"])])]))}}});
1export{G as default};
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.