1import{_ as Fe}from"./DfcrrRdP.js";import{_ as Ve}from"./D0C21uGq.js";import{fL as U,hh as t,fr as m,iF as e,aS as We,jE as N,fs as p,fq as r,ft as y,ig as v,is as Ye,h5 as Z,hF as w,j4 as W,j6 as Y,iX as ce,hf as ee,jm as te,jo as we,iL as ne,j7 as qe,jl as He,fG as Xe,jz as Ce,jB as J,hg as Ie,fz as z,cE as Je,fn as d,gu as Qe,ff as le,iQ as ze,hb as Ae,aX as ie,hJ as $e,jG as Ze,jK as et,cs as tt,g6 as nt,aT as Q,j9 as st,iI as at,iT as ot,j1 as rt,jg as it,h0 as xe,cu as lt,fx as ct,ct as dt,gz as ut,cF as mt,cN as pt,gK as he,i4 as yt}from"./DkruC5uJ.js";import{u as ht,_ as _t,a as vt}from"./DNshdvSf.js";import{L as ft}from"./B6Y7oAVt.js";import{_ as gt}from"./gzfJfkFE.js";import{_ as bt}from"./DXj14ext.js";import"./gncWJRY1.js";import"./vGu3cBkb.js";const kt={class:"flex justify-between rounded bg-primary-700 p-4 text-white shadow-md"},Pt={class:"flex items-center"},Ct={key:0},$t={key:1},xt=U({__name:"MyKikTeaserBanner",props:{externalId:{default:""},cardNumber:{default:""}},setup(P){const s=w(0),l=w([]);return(g,f)=>(t(),m(e(We),{key:`accordion-mykik-${e(s)}`,modelValue:e(l)[e(s)],"onUpdate:modelValue":f[0]||(f[0]=h=>e(l)[e(s)]=h)},{summary:N(()=>[r("div",kt,[r("div",Pt,[P.externalId?(t(),y("span",$t,v(g.$t("Your benefit card number:"))+" "+v(P.cardNumber),1)):(t(),y("span",Ct,v(g.$t("With the myKiK advantage card you save 20% on shipping costs and up to 20% on selected monthly items!")),1))]),P.externalId?p("",!0):(t(),m(e(Ye),{key:0,size:"2xl",class:Z(["text-white",{"-rotate-90":e(l)[e(s)],"rotate-180":!e(l)[e(s)]}]),"data-testid":"myKiK-Dropdown"},null,8,["class"]))])]),default:N(()=>[P.externalId?p("",!0):(t(),m(ft,{key:0,"show-magnolia-content":!1,class:"border bg-white p-3 text-neutral-900"}))]),_:1},8,["modelValue"]))}}),wt=Object.assign(xt,{__name:"CheckoutMyKikTeaserBanner"}),It={class:"unzer-form mx-5 mt-8"},zt=["publicKey","locale"],At=U({__name:"UnzerCardProvider",setup(P){const{$domain:s}=W(),{setPaymentCreditCard:l}=Y(),{send:g}=te();return ce({script:[{src:"https://static-v2.unzer.com/v2/ui-components/index.js",type:"module",defer:!0,tagPosition:"bodyClose"}]}),ee(async()=>{Promise.all([customElements.whenDefined("unzer-payment"),customElements.whenDefined("unzer-card")]).then(()=>{const f=document.getElementById("unzer-checkout");f.onPaymentSubmit=h=>{if(h.submitResponse&&h.submitResponse.status==="SUCCESS"){const u=h.submitResponse.data.id;l(u)}else g({type:"danger",message:"somethingWentWrong"})}})}),(f,h)=>(t(),y("div",It,[r("unzer-payment",{publicKey:e(s).unzerClientId,locale:e(s).locales[0]},[...h[0]||(h[0]=[r("unzer-card",{checkoutButtonId:"paymentButton"},null,-1)])],8,zt)]))}}),Et=Object.assign(At,{__name:"CheckoutUnzerCardProvider"}),Bt={class:"mx-5 mt-8"},Nt=["innerHTML"],Mt=U({__name:"UnzerInvoiceProvider",props:{paymentOption:{default:void 0},onPaymentError:{type:Function,default:()=>{}}},setup(P){const s=P,{$i18n:l,$config:g}=W(),{isAuthenticated:f,user:h,updateBirthDate:u}=we(),{cart:i}=ne(),{setIsValidDate:b}=qe(),{paymentInCart:S,generateThreatMetrixSessionId:M,debounceAddPaymentOption:T,errors:L}=Y(),{trackError:c}=He(),E=d(()=>Qe()),O=i.value?.billingAddress?.custom?.customFieldsRaw?.find(({name:o})=>o==="dateOfBirth")?.value??"",$=w(!!h.value?.dateOfBirth),D=w(h.value?.dateOfBirth??O),I=w(!1),_=w(),q=w(S.value?.custom?.fields?.threatMetrixId??M()),K=w({dateOfBirth:h.value?.dateOfBirth??O}),j=w(),G=Xe(o=>{Ce(o.dateOfBirth,"required|validBirthDate|atAgeLimit:18").then(async({valid:k})=>{if(b(k),!$.value)if(k){I.value=!0;try{f.value&&!$.value&&await u({dateOfBirth:o.dateOfBirth}),await T(s?.paymentOption,`"${o.dateOfBirth}"`),L.value?.addPayment&&s.onPaymentError()}finally{I.value=!1}}else{const C=j.value.errors();Object.entries(C).forEach(([A,H])=>{c(`Form input - unzer invoice - ${A}`,H)})}})},500),R=o=>{K.value=o};J(K,G),ee(async()=>{if(f.value&&$.value){const{valid:o}=await Ce(D.value,"required|validBirthDate|atAgeLimit:18");if(!o){_.value=!0;return}I.value=!0;try{D.value&&(await T(s?.paymentOption,`"${D.value}"`),L.value?.addPaymentOption&&s.onPaymentError())}catch(k){k instanceof Error&&(_.value=!0),c("unzer",`Failed to add payment -> ${s.paymentOption?.name}`)}finally{I.value=!1}}}),Ie(()=>{b(!0)});const F=l.t("unzerInvoiceTermsAndConditions");return ce({script:[{src:`${g.public.threatMetrixUrl}&session_id=${q.value}`,async:!0,defer:!0,type:"application/javascript"}]}),(o,k)=>{const C=Je;return t(),y("div",Bt,[z(C,{id:"invoice-birth-date",ref_key:"invoiceFormRef",ref:j,fields:e(E),values:e(K),"by-key-order":["dateOfBirth"],disabled:e($)||e(I),onOnFormUpdate:R},null,8,["fields","values","disabled"]),r("p",{class:"cursor-auto text-sm font-light [&_a]:underline",innerHTML:e(F)},null,8,Nt)])}}}),St=Object.assign(Mt,{__name:"CheckoutUnzerInvoiceProvider"}),Lt={class:"mx-5 mt-8"},Ot=["publicKey","locale"],Dt=U({__name:"UnzerApplePayProvider",setup(P){const{$domain:s}=W(),{setPaymentApplePay:l}=Y(),{cart:g}=ne(),{send:f}=te();ce({script:[{src:"https://static-v2.unzer.com/v2/ui-components/index.js",type:"module",defer:!0,tagPosition:"bodyClose"}]});const h=d(()=>le.getTotals(g.value));return ee(async()=>{Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{const i=document.getElementById("unzer-payment"),b={countryCode:s.countryCode?.toUpperCase(),currencyCode:s.currency?.toUpperCase(),supportedNetworks:["visa","mastercard"],merchantCapabilities:["supports3DS"],total:{label:"Unzer GmbH",amount:h.value.total.toString()}};i.setApplePayData(b)});const u=document.getElementById("unzer-checkout");u.onPaymentSubmit=i=>{if(i?.submitResponse?.success){const b=i.submitResponse.data.id;l(b)}else f({type:"danger",message:"somethingWentWrong"})}}),(u,i)=>(t(),y("div",Lt,[r("unzer-payment",{id:"unzer-payment",publicKey:e(s).unzerClientId,locale:e(s).locales[0]}
1,[...i[0]||(i[0]=[r("unzer-apple-pay",null,null,-1)])],8,Ot),i[1]||(i[1]=r("unzer-checkout",{id:"unzer-checkout"},null,-1))]))}}),Kt=Object.assign(Dt,{__name:"CheckoutUnzerApplePayProvider"}),Rt={class:"mx-5 mt-8"},Ut=["publicKey","locale"],Tt=U({__name:"UnzerGooglePayProvider",setup(P){const{$domain:s}=W(),{setPaymentGooglePay:l}=Y(),{cart:g}=ne(),{send:f}=te();ce({script:[{src:"https://static-v2.unzer.com/v2/ui-components/index.js",type:"module",defer:!0,tagPosition:"bodyClose"}]});const h=d(()=>le.getTotals(g.value));return ee(async()=>{Promise.all([customElements.whenDefined("unzer-payment")]).then(()=>{document.getElementById("unzer-payment").setGooglePayData({gatewayMerchantId:s.googleChannelId,merchantInfo:{merchantId:s.googleMerchantId,merchantName:s.googleMerchantName},transactionInfo:{countryCode:s.countryCode?.toUpperCase(),currencyCode:s.currency?.toUpperCase(),totalPrice:h.value.total.toString()},buttonOptions:{buttonColor:"black"}})});const u=document.getElementById("unzer-checkout");u.onPaymentSubmit=i=>{if(i?.submitResponse?.success){const b=i.submitResponse.data.id;l(b)}else f({type:"danger",message:"somethingWentWrong"})}}),(u,i)=>(t(),y("div",Rt,[r("unzer-payment",{id:"unzer-payment",publicKey:e(s).unzerClientId,locale:e(s).locales[0]},[...i[0]||(i[0]=[r("unzer-google-pay",null,null,-1)])],8,Ut),i[1]||(i[1]=r("unzer-checkout",{id:"unzer-checkout"},null,-1))]))}}),jt=Object.assign(Tt,{__name:"CheckoutUnzerGooglePayProvider"}),Gt={key:0},Ft=["for"],Vt=["onKeydown"],Wt={class:"text-lg leading-5"},Yt={class:"flex gap-2"},qt={key:0,class:"ml-9 mt-2 text-sm font-light"},Ht={key:0,class:"mx-5 mt-5 text-sm font-light"},Xt=U({__name:"PaymentMethods",props:{selected:{default:()=>({})}},emits:{"payment-selection":P=>P},setup(P,{emit:s}){const l=P,{send:g}=te(),f=s,{cart:h}=ne(),{availablePaymentOptions:u,debounceAddPaymentOption:i,errors:b,loadPayments:S}=Y(),{$config:M,$flags:T}=W(),{payment:{nextState:L}}=ze(),c=M.public?.payment?.methods,E=async o=>{const{method:k,provider:C,enabled:A}=o;if(!(l.selected?.method===k&&l.selected?.provider===C||!A))switch(o.method){case c.INVOICE:case c.SOFORT:case c.FILIALE:case c.PAYPAL:case c.VORKASSE:case c.BANK_TRANSFER:case c.EPS:case c.P24:case c.IDEAL:case c.PAYU:case c.CARD:case c.APPLEPAY:case c.GOOGLEPAY:if(o.method===c.INVOICE){f("payment-selection",o);return}await i(o),f("payment-selection",b.value?.addPaymentOption?{}:o),b.value?.addPaymentOption&&(F(),await S());break}},O=d(()=>l.selected?.name),$=d(()=>h.value?.shippingInfo?.shippingMethod?.name==="DHL_Packstation"),D=d(()=>l.selected?.method===c.INVOICE),I=d(()=>l.selected?.method===c.CARD),_=d(()=>l.selected?.method===c?.APPLEPAY),q=d(()=>l.selected?.method===c?.GOOGLEPAY),K=o=>{const k=o.split("/").pop()?.replace(/\.[^.]+$/,"").toLowerCase()??"";let C=k.replace(/-[a-z]{2}$/,"").replaceAll("-"," ");return k.includes("apple-pay")&&(C="Apple Pay"),k.includes("paypal")&&(C="PayPal"),`${C.replace(/\b\w/g,A=>A.toUpperCase())} icon`},j=o=>$.value&&["Invoice"].includes(o.label),G=d(()=>L.value===Q.LOADING),R=o=>!o.enabled||G.value||j(o),F=()=>{g({message:"somethingWentWrong",type:"danger"}),f("payment-selection",{})};return Ae(async()=>{await S(),u.value?.length===1&&E(u.value?.[0])}),(o,k)=>{const C=tt,A=Et,H=St,de=Kt,B=jt;return e(u)?(t(),y("ul",Gt,[(t(!0),y(ie,null,$e(e(u),(a,X)=>(t(),m(e(nt),{key:X,class:Z([{"!cursor-not-allowed opacity-50":!a.enabled,"bg-neutral-100":e(O)===a.name},"border-b border-neutral-100 pb-7 hover:!bg-neutral-50"]),disabled:R(a),onClick:V=>E(a)},{default:N(()=>[r("label",{class:Z(["mt-5 flex cursor-pointer items-center justify-between gap-2 rounded",{"!cursor-not-allowed":!a.enabled}]),for:a.name},[r("div",{class:"flex gap-4",tabindex:"0",onKeydown:Ze(V=>E(a),["enter"])},[z(e(et),{id:a.name,"data-testid":`payment-method__${a.name}`,value:a.name,disabled:R(a),class:Z({"opacity-50":R(a)}),"model-value":e(O),name:"paymentType",tabindex:"-1"},null,8,["id","data-testid","value","disabled","class","model-value"]),r("span",Wt,v(o.$t(a.label)),1)],40,Vt),r("div",Yt,[(t(!0),y(ie,null,$e(a?.logo,V=>(t(),m(C,{key:V,src:V,alt:e(T).has("sr-5583")?K(a.label):a.label,width:"50",class:"float-right rounded border"},null,8,["src","alt"]))),128))])],10,Ft),a.enabled?p("",!0):(t(),y("span",qt,v(a?.failedConditionsMessages?.minThreshold)+" "+v(a?.failedConditionsMessages?.shippingIsBilling),1)),a.method===P.selected.method?(t(),y(ie,{key:1}
1,[a.text?(t(),y("p",Ht,v(o.$t(a.text)),1)):p("",!0),e(I)?(t(),m(A,{key:1})):p("",!0),k[0]||(k[0]=r("div",{id:"payment-form"},null,-1)),e(D)?(t(),m(H,{key:2,"payment-option":a,"on-payment-error":F},null,8,["payment-option"])):p("",!0),e(_)?(t(),m(de,{key:3})):p("",!0),e(q)?(t(),m(B,{key:4})):p("",!0)],64)):p("",!0)]),_:2},1032,["class","disabled","onClick"]))),128))])):p("",!0)}}}),Jt=Object.assign(Xt,{__name:"CheckoutPaymentMethods"}),Qt={key:1},Zt={class:"grid grid-cols-[2fr_1fr] items-start gap-10 mobile:grid-cols-1"},en={class:"mb-10"},tn={class:"mb-4 text-2xl"},nn={class:"grid grid-cols-2 gap-4 mobile:grid-cols-1 tablet:grid-cols-1"},sn={class:"mb-2 text-lg text-neutral-950"},an={class:"mb-2 text-lg text-neutral-950"},on={key:2,class:"relative w-full rounded border border-neutral-100 p-4"},rn={class:"mb-2 text-lg text-neutral-950"},ln={class:"mb-4 text-2xl"},cn={key:0,class:"mt-7 desktop:hidden"},dn={class:"mt-10"},un={class:"mb-4 text-2xl"},mn={key:1,class:"mr-6 mt-5 flex cursor-pointer items-center gap-2 rounded"},pn={class:"text-base"},yn={key:1},hn={key:1,id:"unzer-checkout"},_n={key:1},vn={key:1},fn={key:0,class:"sticky top-10 mt-[61px]"},zn=U({__name:"Payment",emits:["click:edit"],setup(P){const s=st(),{$config:l,$flags:g}=W(),{locale:f}=at(),{isMobile:h}=ot(),{payment:{paymentOption:u,setPaymentMethod:i,nextState:b}}=ze(),{isAuthenticated:S,user:M}=we(),{result:T}=rt(M.value?.id),L=d(()=>({...M.value,...T.value})),c=d(()=>L.value?.custom?.fields?.cardIds[0]?L.value?.custom?.fields?.cardIds[0]:M.value?.custom?.customFieldsRaw?.find(({name:n})=>n==="cardIds")?.value[0]),{result:E,load:O}=ht(),$=w(!1),{loadShippingMethodByCart:D,shippingMethodsByCart:I}=it(),{cart:_,setNewsletterState:q,refresh:K,recalculateCart:j}=ne(),{send:G}=te(),{createPaymentOrder:R,loadPayments:F,errors:o,redirectUrl:k,availablePaymentOptions:C,paymentCreditCard:A,paymentApplePay:H,paymentGooglePay:de}=Y(),B=w(!1),a=w(!1),X=()=>{F(),i({}),V()},V=()=>{const n=I.value?.find(({id:ae,type:ye})=>ae===_.value?.shippingInfo?.shippingMethod?.id&&ye==="shop");if(!n)return;const{special:x}=Be.value,{thresholdToActivate:pe=0}=n;x<pe&&G({message:"shippingMethodCartError",type:"danger"})},Ee=async n=>{if(n){window.location.href=n;return}B.value=!1,a.value=!1,xe({name:"thank-you",query:{orderNumber:_.value?.key}})},_e=async()=>{Ke.value||await se()},se=async()=>{if(B.value=!0,await K(),await q($.value),await R(u.value),o.value?.createPaymentOrder){i({}),A.value=null,B.value=!1,a.value=!1;return}await Ee(k.value)};J(A,n=>{n&&u.value.method===l.public?.payment?.methods?.CARD&&!B.value&&se()}),J(H,n=>{n&&u.value.method===l.public?.payment?.methods?.APPLEPAY&&se()}),J(de,n=>{n&&u.value.method===l.public?.payment?.methods?.GOOGLEPAY&&se()});const ue=n=>{G({message:n,type:"danger"}),i({})},Be=d(()=>le.getTotals(_.value)),ve=d(()=>_.value?.shippingAddress),fe=d(()=>_.value?.billingAddress),Ne=d(()=>I.value?.find(n=>n.id===_.value?.shippingInfo?.shippingMethod?.id)),me=d(()=>_.value?.customer?.externalId);ee(async()=>{const{errorCode:n}=s.query||{};if(n)switch(n){case"paymentCanceled":ue("paymentAborted");break;case"addressValidationError":ue("addressValidationError");break;default:ue("paymentError");break}await j()});const ge=d(()=>!me.value),Me=d(()=>E.value!==void 0);J(_,async n=>{(!n?.id||le.getTotalItems(n)===0)&&xe("/")}),Ae(async()=>{E.value===void 0&&(await O(M.value?.email??_.value?.billingAddress?.email),$.value=E.value),I.value||await D()}),Ie(()=>{i({})});const Se=d(()=>b.value!==Q.MISSING_INFO),Le=d(()=>b.value===Q.TO_ORDER),Oe=d(()=>b.value===Q.TO_PAYMENT&&!B.value&&!a.value),De=d(()=>yt.getShippingDisplayName(_.value?.shippingInfo?.shippingMethod,f)),Ke=d(()=>b.value===Q.LOADING);return(n,x)=>{const pe=Fe,ae=Ve,ye=lt,oe=dt,Re=_t,be=wt,ke=gt,Pe=bt,Ue=Jt,Te=mt,je=vt,Ge=pt;return!e(_)&&!e(C)?(t(),m(pe,{key:0})):(t(),y("div",Qt,[r("div",Zt,[r("div",null,[r("div",en,[r("h1",tn,v(n.$t("Payment Overview")),1),r("div",nn,[e(fe)?(t(),m(ae,{key:0,address:e(fe),editable:!e(g).has("address.company-data"),onEditAddress:x[0]||(x[0]=re=>n.$emit("click:edit","billing"))},{title:N(()=>[r("h2",sn,v(n.$t("Billing address")),1)]),_:1},8,["address","editable"])):p("",!0),e(ve)?(t(),m(ae,{key:1,address:e(ve),editable:!0,onEditAddress:x[1]||(x[1]=re=>n.$emit("click:edit","shipping"))},{title:N(()=>[r("h2",an,v(n.$t("Shipping address")),1)]),_:1},8,["address"])):p("",!0),e(Ne)?(t(),y("div",on,[r("h2",rn,v(n.$t("Shipping method")),1),r("p",null,v(e(De)),1),e(g).hasnt("enabledKiosk")?(t(),m(oe,{key:0,class:"absolute right-0 top-0 mr-2 mt-4",variant:"tertiary",size:"sm",onClick:x[2]||(x[2]=re=>n.$emit("click:edit","shippingMethod"))},{default:N(()=>[z(ye,{size:"sm",icon:"edit",class:"!h-[13px] !w-[13px] fill-primary"}),ct(" "+v(n.$t("Change")),1)]),_:1})):p("",!0)])):p("",!0)])]),r("h1",ln,v(n.$t("Overview")),1),z(Re,{onOnCartUpdate:X}),e(h)?(t(),y("div",cn,[e(ge)&&e(S)&&e(g).has("loyalty.program")?(t(),m(be,{key:0,class:"mb-6","external-id":e(me),"card-number":e(c)},null,8,["external-id","card-number"])):p("",!0),e(_)?(t(),m(ke,{key:1,cart:e(_)},null,8,["cart"])):p("",!0),z(Pe,{onCouponsChanged:X})])):p("",!0),r("div",dn,[r("h1",un,v(n.$t("Your payment methods")),1),z(Ue,{selected:e(u),onPaymentSelection:e(i)},null,8,["selected","onPaymentSelection"])]),e(Me)?(t(),y("label",mn,[z(Te,{modelValue:e($),"onUpdate:modelValue":x[3]||(x[3]=re=>ut($)?$.value=re:null),"data-testid":"payment-newsletter_checkbox",name:"newsletterChecked"},null,8,["modelValue"]),r("span",pn,v(n.$t("newsletterCheckboxLabel")),1)])):p("",!0),z(je,{class:"mt-2"}),z(Ge),e(u).method!==e(l).public?.payment?.methods?.APPLEPAY&&e(u).method!==e(l).public?.payment?.methods?.GOOGLEPAY?(t(),y(ie,{key:2},[e(Le)?(t(),m(oe,{key:0,class:"mt-5 min-w-72 mobile:w-full","data-testid":"payment-checkout__place-order-button",variant:"primary",uppercase:!0,disabled:!e(Se),onClick:_e},{default:N(()=>[e(B)?(t(),m(e(he),{key:0})):(t(),y("span",yn,v(n.$t("Place order")),1))]),_:1},8,["disabled"])):e(u).method===e(l).public?.payment?.methods?.CARD?(t(),y("unzer-checkout",hn,[z(oe,{id:"paymentButtonUnzer",class:Z(["mt-5 min-w-72 mobile:w-full",{"!cursor-not-allowed !bg-disabled-300 !text-disabled-500":e(a)}]),"data-testid":"payment-checkout__continue-to-payment-button",variant:"primary",uppercase:!0,type:"submit",onClick:x[4]||(x[4]=()=>a.value=!0)},{default:N(()=>[e(a)?(t(),m(e(he),{key:0})):(t(),y("span",_n,v(n.$t("Continue to payment")),1))]),_:1},8,["class"])])):(t(),m(oe,{key:2,id:"paymentButton",class:"mt-5 min-w-72 mobile:w-full","data-testid":"payment-checkout__continue-to-payment-button",variant:"primary",uppercase:!0,type:"submit",disabled:!e(Oe),onClick:_e},{default:N(()=>[e(B)?(t(),m(e(he),{key:0})):(t(),y("span",vn,v(n.$t("Continue to payment")),1))]),_:1},8,["disabled"]))],64)):p("",!0)]),e(h)?p("",!0):(t(),y("div",fn,[e(ge)&&e(S)&&e(g).has("loyalty.program")?(t(),m(be,{key:0,class:"mb-6","external-id":e(me)||"","card-number":e(c)},null,8,["external-id","card-number"])):p("",!0),e(_)?(t(),m(ke,{key:1,cart:e(_)},null,8,["cart"])):p("",!0),z(Pe,{onCouponsChanged:X})]))])]))}}});
1export{zn 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.