1import{_ as U}from"./DIheCY_a.js";import{_ as V}from"./CL93qZiK.js";import{E as q,d as x,c as I,Z as K,Q as F,x as P,y as w,z as t,_ as M,m as a,I as E,K as s,N as p,O as n,H as r,T as C,a4 as O,a1 as Q,r as S,P as Z}from"./BJhlU1rR.js";import{a as j,s as G}from"./BOVKW5Xp.js";import{u as f}from"./BXgMM1f5.js";import{s as J,a as W,b as X,c as Y}from"./Bi8Ndtln.js";import{u as ee}from"./8mnopAEE.js";import{u as ae}from"./BHREDrN6.js";import{f as te}from"./D7eu--uw.js";import"./C4-wI4XM.js";import"./v9y1S7hN.js";import"./BkGlnVwb.js";import"./CFxhoaL9.js";import"./B-IoMRrc.js";import"./DI6bt38v.js";import"./B2mMrSe6.js";import"./BwAlTTr4.js";async function se(h,i){const{appAuthorizationHeader:l}=ae();return await $fetch.raw("/customer/contract/sepa-mandate",{server:!1,method:"PUT",credentials:"include",headers:{...l&&l},baseURL:q().public.apiBaseURL,body:{contractId:h,sepaNotice:i},async onResponse(o){o.response.status===401&&(await te(),o.response=await $fetch.raw(o.request,o.options))}}).catch(o=>o.data)}const oe={class:"m-0"},ne={class:"text-cool-gray-500 text-sm"},re={class:"mb-[24px]"},ie={class:"flex flex-col gap-2"},Se=x({__name:"mandate",setup(h){const{t:i}=I(),l=ee(),{paymentData:o,contract:A}=K(l),N=F(),c=S(!1),m=S("");async function T(){c.value=!0;const e=await se(A.value.id,i("dbc-label-sepa-mandate"));c.value=!1,e.status===200?(await l.getContracts(),N.push({path:f("self-service-payment"),query:{update:"mandate"}})):m.value=i("dbc-error-something-went-wrong")}return(e,d)=>{const D=U,R=X,k=Y,B=W,H=J,u=Z("FormKit"),y=V,L=G,z=M;return P(),w(z,{name:"main-view",headline:e.$t("dbc-label-payment-method")},{default:t(()=>[a(m)?(P(),w(D,{key:0,severity:"warn","has-border":!0,message:a(m),class:"mb-xs",role:"alert","aria-live":"assertive"},null,8,["message"])):E("",!0),s(L,{pt:"specialCardPassThrough"in e?e.specialCardPassThrough:a(j),"pt:header:class":"bg-transparent pb-0 !mb-3","pt:content:class":"!mt-0"},{header:t(()=>[p(n(e.$t("dbc-label-sepa")),1)]),content:t(()=>[s(H,{"pt:root:class":"text-sm"},{default:t(()=>[s(B,{value:"0"},{default:t(()=>[s(R,{"pt:root:class":"border-0 bg-transparent p-0 cursor-pointer text-base","pt:toggleicon:class":"ml-2 rotate-180"},{default:t(()=>[p(n(e.$t("dbc-label-sepa-mandate-update")),1)]),_:1}),s(k,{"pt:root:class":"mt-[10px]"},{default:t(()=>[r("p",oe,n(e.$t("dbc-text-sepa-mandate-update")),1)]),_:1})]),_:1})]),_:1}),d[1]||(d[1]=r("hr",{class:"w-full m-0 border-solid border-0 border-t border-light"},null,-1)),s(u,{type:"form",id:"sepa-mandate-form",name:"sepa-mandate-form",actions:!1,onSubmit:T},{default:t(({state:{valid:b}})=>{var g,_,v,$;return[r("div",null,[r("div",ne,n(e.$t("dbc-payment-account-holder")),1),r("div",re,n((_=(g=a(o))==null?void 0:g.sepaDirectDebitPayment)==null?void 0:_.accountHolder),1),d[0]||(d[0]=r("div",{class:"text-cool-gray-500 text-sm"},"IBAN",-1)),r("div",null,n(($=(v=a(o))==null?void 0:v.sepaDirectDebitPayment)==null?void 0:$.iban),1)]),s(u,{type:"checkbox",label:e.$t("dbc-label-sepa-mandate"),name:"mandate",id:"mandate",value:[],validation:"accepted","validation-messages":{accepted:e.$t("dbc-error-sepa-consent-required")},"validation-visibility":"submit","label-class":"text-xs cursor-pointer text-attention-high pl-2"},null,8,["label","validation-messages"]),r("div",ie,[s(u,{type:"submit",id:"submit",label:b?e.$t("dbc-btn-update"):e.$t("dbc-btn-fill-in-mandatory-field"),disabled:!b||a(c),loading:a(c),"aria-label":b?a(c)?e.$t("dbc-text-loading"):e.$t("dbc-btn-update"):e.$t("dbc-btn-fill-in-mandatory-field")},null,8,["label","disabled","loading","aria-label"]),s(y,{to:("usePagePath"in e?e.usePagePath:a(f))("self-service-payment"),class:C("buttonSecondary"in e?e.buttonSecondary:a(O))},{default:t(()=>[p(n(a(i)("dbc-btn-abort")),1)]),_:1},8,["to","class"]),s(y,{to:("usePagePath"in e?e.usePagePath:a(f))("self-service-payment-update"),class:C("buttonSecondarySpecial"in e?e.buttonSecondarySpecial:a(Q))},{default:t(()=>[p(n(a(i)("dbc-btn-text-change-payment")),1)]),_:1},8,["to","class"])])]}),_:1})]),_:1},8,["pt"])]),_:1},8,["headline"])}}});export{Se 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.