1import{d as E,u as k,f as a,o as b,n as l,y as s,E as g,h as C,I as u,r as I,T as h,t as L}from"./Bek2-9gr.js";const _={class:"email-confirmation"},y=E({__name:"EmailConfirmation",props:{blok:{type:Object,required:!0}},setup(d){const e=d,n=k(),r=u(()=>n.query.formId),i=u(()=>n.query.id),c=u(()=>n.query.emailChangeId),f=u(()=>n.query.accountId),t=a().useLinkHelper(),o=I(),m=a().useVisualEditorHelper().useIsVisualEditor();b(async()=>{if(m){console.info("Visual Editor aktiv - Confirmation wird übersprungen.");return}if(await v(),!i.value&&!c.value&&!r.value){l(t.useGetUrlLink(e.blok.redirectLinkAfterError),{external:!0});return}if(!i.value&&!r.value&&!f.value){l(t.useGetUrlLink(e.blok.redirectLinkAfterError),{external:!0});return}o.value?.success?(s().info("Email Confirmation successful or email confirmation already confirmed. Redirect to success page..."),l(t.useGetUrlLink(e.blok.redirectLinkAfterConfirmation),{external:!0})):(s().info("Email Confirmation: Call to backend was not successful. Redirecting to error page..."),l(t.useGetUrlLink(e.blok.redirectLinkAfterError),{external:!0}))});const v=async()=>{if(!i.value&&!c.value&&!r.value){s().info("Email Confirmation: EmailChangeId for email change or databaseId for newsletter consent or formId for form confirmation is undefined. Redirecting to error page...");return}if(!i.value&&!r.value&&!f.value){s().info("Email Confirmation for email change: AccountId is undefined. Redirecting to error page...");return}i.value?o.value=await a().useClientFetch().put(`${e.blok.confirmEmailEndpoint}/${i.value}`,{server:!1}):r.value?o.value=await a().useClientFetch().put(`${e.blok.confirmEmailEndpoint}/${r.value}`,{server:!1}):o.value=await a().useClientFetch().post(`${e.blok.confirmEmailEndpoint}/${f.value}/${c.value}`,{server:!1})};return(w,$)=>{const p=h("editable");return g((L(),C("div",_,null,512)),[[p,d.blok]])}}}),q=Object.assign(y,{__name:"EmailConfirmation"});export{q 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.