1import{_ as K}from"./CyGsHqYs.js";import{_ as le}from"./BNEUGrcC.js";import{_ as se}from"./DGsfvH5k.js";import{_ as F}from"./CbQYhQsb.js";import{_ as Q}from"./BT9LViq0.js";import{_ as ie}from"./DrIyVPwf.js";import{_ as re}from"./DWPDyDdN.js";import{d as W,m as Z,c as N,z as s,o as b,t as n,y as t,M as de,b as a,j as B,x as J,k as U,N as X,l as g,i as Y,O as ee,P as ue,q as ce,Q as pe,E as me}from"./CvaQmXZC.js";import"./DlAUqK2U.js";import"./kv1C-L-O.js";import"./CS8A-eVM.js";import"./33ENwxUI.js";import"./3APapPYR.js";const fe={class:"text-neutral-800 mb-4"},_e={key:0,class:"mb-4 text-sm text-cta-700",role:"alert"},ge={class:"flex flex-wrap justify-end gap-3 px-6 md:px-8 py-4 border-t border-neutral-200"},ve="LOESCHEN",be=W({__name:"GuestDeleteAccountModal",props:{open:{type:Boolean}},emits:["hidden"],setup(O,{emit:d}){const V=O,w=d,{deleteAccount:C}=Z(),c=g(""),p=g(!1),m=g(""),v=Y(()=>c.value.trim()===ve),i={"Confirmation required":"Bitte schreibe LOESCHEN zur Bestätigung.","Invalid confirmation":"Bitte schreibe LOESCHEN zur Bestätigung.","Too many requests":"Zu viele Versuche. Bitte warte einen Moment und versuche es dann erneut.","Email login is currently unavailable":"Das Konto kann zurzeit nicht gelöscht werden. Bitte versuche es später erneut.","Account deletion failed":"Das Konto konnte nicht gelöscht werden. Bitte versuche es später erneut.","Not authenticated":"Deine Sitzung ist abgelaufen. Bitte melde dich erneut an."};function y(){c.value="",m.value="",w("hidden")}function E(){y()}async function S(){var h;if(!(!v.value||p.value)){p.value=!0,m.value="";try{await C({confirmation:c.value.trim()}),w("hidden"),await ee("/")}catch(r){const f=(h=r.data)==null?void 0:h.message;m.value=f&&i[f]||i["Account deletion failed"]}finally{p.value=!1}}}return(h,r)=>{const f=K,M=Q,k=F,D=re;return b(),N(D,{"modal-id":"guest-delete-account",open:V.open,variant:"default",width:"md:w-[30rem]","close-with-history-back":!1,onHidden:E},{head:s(()=>[t(f,{domain:"page.personaldetails",name:"delete_account_confirm_title"})]),foot:s(()=>[n("div",ge,[t(k,{type:"button",color:"light",buttonstyle:"rounded-xl",buttonpadding:"py-3 px-5",disabled:a(p),onClick:y},{default:s(()=>[t(f,{domain:"page.personaldetails",name:"return"})]),_:1},8,["disabled"]),t(k,{type:"button",color:"cta",buttonstyle:"rounded-xl",buttonpadding:"py-3 px-5",disabled:!a(v)||a(p),onClick:S},X({default:s(()=>[t(f,{domain:"page.personaldetails",name:"delete_account_confirm_button"})]),_:2},[a(p)?{name:"icon",fn:s(()=>[r[1]||(r[1]=n("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 animate-spin"},[n("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})],-1))]),key:"0"}:void 0]),1032,["disabled"])])]),default:s(()=>[n("p",fe,[t(f,{domain:"page.personaldetails",name:"delete_account_confirm_body"})]),t(M,{modelValue:a(c),"onUpdate:modelValue":r[0]||(r[0]=L=>de(c)?c.value=L:null),type:"text",name:"delete-account-confirmation",autocomplete:"off",placeholder:"LOESCHEN","accessibility-label":"LOESCHEN","label-position":"top",class:"mb-4"},null,8,["modelValue"]),a(m)?(b(),B("p",_e,J(a(m)),1)):U("",!0)]),_:1},8,["open"])}}}),he={class:"container 2xl:max-w-screen-xl mx-auto px-6 py-8 md:py-10"},ye={class:"md:col-span-3 flex flex-col items-center gap-y-3 md:px-4"},xe=["disabled"],we=["src"],ke={class:"md:col-span-9"},Be={class:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-5"},Ue={class:"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-5"},Ve={class:"relative"},Ce={class:"flex flex-wrap items-center justify-between gap-4 mt-10"},Ee={class:"flex flex-wrap items-center gap-x-3 gap-y-2"},Se={class:"flex flex-col items-end gap-2 ml-auto"},Me={key:0,class:"text-sm text-cta-700"},Te=W({__name:"profile",setup(O){var $,j,R,I,P,A,H,z,G,T;
1const{user:d,logout:V,updateProfile:w}=Z(),{log:C}=me();C("guest_page_view",{page:"profile"});const c=g(),p=g(!1),m=g(!1),v=g(null),i=ue({firstname:(($=d.value)==null?void 0:$.first_name)||((R=(j=d.value)==null?void 0:j.google_auth)==null?void 0:R.given_name)||"",lastname:((I=d.value)==null?void 0:I.last_name)||((A=(P=d.value)==null?void 0:P.google_auth)==null?void 0:A.family_name)||"",email:((H=d.value)==null?void 0:H.email)??"",birthdate:((z=d.value)==null?void 0:z.birth_date)??"",phone:((G=d.value)==null?void 0:G.phone)||((T=d.value)==null?void 0:T.mobile)||""}),y=o=>{o.data!==null&&/[&<>"']/.test(o.data)&&o.preventDefault()},E=o=>{o.data!==null&&(/^[\d-]*$/.test(o.data)||o.preventDefault())},S=o=>{o.data!==null&&(/^[+\d\s\-()/]*$/.test(o.data)||o.preventDefault())},h=g(null),r=g(null),f=Y(()=>{var o,e;return r.value||((e=(o=d.value)==null?void 0:o.google_auth)==null?void 0:e.picture)||""}),M=()=>{var o;(o=h.value)==null||o.click()},k=o=>{var _;const e=o.target,l=(_=e.files)==null?void 0:_[0];l&&(r.value&&URL.revokeObjectURL(r.value),r.value=URL.createObjectURL(l),e.value="")};ce(()=>{r.value&&URL.revokeObjectURL(r.value)});const D=async()=>{var e;m.value=!0,v.value=null;const o=Date.now();try{await w({first_name:i.firstname.trim(),last_name:i.lastname.trim(),birth_date:i.birthdate||null,phone:i.phone.trim()})}catch(l){const _=l;v.value=((e=_.data)==null?void 0:e.message)||"Save failed"}finally{const l=Date.now()-o;l<1e3&&await new Promise(_=>setTimeout(_,1e3-l)),m.value=!1}},L=async()=>{await V(),ee("/")},te=()=>{var o,e;(e=(o=c.value)==null?void 0:o.hide)==null||e.call(o),p.value=!0};return(o,e)=>{const l=K,_=le,oe=se,q=F,x=Q,ne=ie,ae=be;return b(),B("main",he,[t(_,{type:"h1",design:"h2",class:"mb-6 md:mb-8"},{default:s(()=>[t(l,{domain:"page.personaldetails",name:"title"})]),_:1}),n("form",{class:"grid grid-cols-1 md:grid-cols-12 gap-8 md:gap-12",onSubmit:pe(D,["prevent"])},[n("div",ye,[n("button",{type:"button",disabled:!0,class:"w-28 h-28 md:w-32 md:h-32 rounded-full bg-neutral-100 flex items-center justify-center overflow-hidden cursor-pointer disabled:cursor-default",onClick:M},[a(f)?(b(),B("img",{key:0,src:a(f),alt:"",referrerpolicy:"no-referrer",class:"w-full h-full object-cover"},null,8,we)):(b(),N(oe,{key:1,src:"/svg/icons/guest-profile-photo.svg",class:"w-full h-full"}))],8,xe),U("",!0),U("",!0),n("input",{ref_key:"fileInput",ref:h,type:"file",accept:"image/*",class:"hidden",onChange:k},null,544)]),n("div",ke,[t(_,{type:"h2",design:"h5",class:"text-neutral-500 mb-3"},{default:s(()=>[t(l,{domain:"page.personaldetails",name:"person"})]),_:1}),n("div",Be,[t(x,{modelValue:a(i).firstname,"onUpdate:modelValue":e[0]||(e[0]=u=>a(i).firstname=u),"label-position":"top",name:"firstname",onBeforeinput:y},{label:s(()=>[t(l,{domain:"page.personaldetails",name:"firstname"})]),_:1},8,["modelValue"]),t(x,{modelValue:a(i).lastname,"onUpdate:modelValue":e[1]||(e[1]=u=>a(i).lastname=u),"label-position":"top",name:"lastname",onBeforeinput:y},{label:s(()=>[t(l,{domain:"page.personaldetails",name:"lastname"})]),_:1},8,["modelValue"]),t(x,{modelValue:a(i).birthdate,"onUpdate:modelValue":e[2]||(e[2]=u=>a(i).birthdate=u),type:"date","label-position":"top",name:"birthdate",onBeforeinput:E},{label:s(()=>[t(l,{domain:"page.personaldetails",name:"birthdate"})]),_:1},8,["modelValue"])]),t(_,{type:"h2",design:"h5",class:"text-neutral-500 mb-3 mt-8"},{default:s(()=>[t(l,{domain:"page.personaldetails",name:"contact"})]),_:1}),n("div",Ue,[n("div",Ve,[t(x,{modelValue:a(i).email,"onUpdate:modelValue":e[3]||(e[3]=u=>a(i).email=u),type:"email","label-position":"top",name:"email",inputstyle:"rounded-xl w-full pr-11",disabled:""},{label:s(()=>[t(l,{domain:"page.personaldetails",name:"email"})]),_:1},8,["modelValue"]),e[8]||(e[8]=n("span",{class:"pointer-events-none absolute right-3 bottom-0 h-[55px] flex items-center text-neutral-400"},[n("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4"},[n("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"}),n("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})])],-1))]),t(x,{modelValue:a(i).phone,"onUpdate:modelValue":e[4]||(e[4]=u=>a(i).phone=u),type:"tel","label-position":"top",name:"phone",onBeforeinput
1:S},{label:s(()=>[t(l,{domain:"page.personaldetails",name:"phone"})]),_:1},8,["modelValue"])]),n("div",Ce,[n("div",Ee,[(b(),N(ne,{key:0,ref_key:"deleteMenu",ref:c,"custom-design":"w-auto py-1"},{trigger:s(()=>[n("button",{type:"button","aria-label":"Weitere Optionen",class:"w-11 h-11 rounded-xl bg-neutral-50 hover:bg-neutral-200 text-neutral-800 flex items-center justify-center transition-colors",onClick:e[5]||(e[5]=u=>a(c).toggle())},[...e[9]||(e[9]=[n("svg",{viewBox:"0 0 24 24",fill:"currentColor",class:"w-5 h-5"},[n("circle",{cx:"12",cy:"5",r:"1.7"}),n("circle",{cx:"12",cy:"12",r:"1.7"}),n("circle",{cx:"12",cy:"19",r:"1.7"})],-1)])])]),default:s(()=>[n("button",{type:"button",class:"w-full text-left px-4 py-2 text-cta-700 font-semibold whitespace-nowrap hover:bg-neutral-50",onClick:te},[t(l,{domain:"page.personaldetails",name:"delete_account"})])]),_:1},512)),t(q,{color:"light",buttonstyle:"rounded-xl whitespace-nowrap",buttonpadding:"py-3 px-5",type:"button",onClick:L},{default:s(()=>[t(l,{domain:"page.personaldetails",name:"logout"})]),_:1})]),n("div",Se,[a(v)?(b(),B("p",Me,J(a(v)),1)):U("",!0),t(q,{type:"submit",color:"cta",buttonstyle:"rounded-xl",buttonpadding:"py-3 px-5",disabled:a(m)},X({default:s(()=>[t(l,{domain:"page.personaldetails",name:"save_changes"})]),_:2},[a(m)?{name:"icon",fn:s(()=>[e[10]||(e[10]=n("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 animate-spin"},[n("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})],-1))]),key:"0"}:void 0]),1032,["disabled"])])])])],32),t(ae,{open:a(p),onHidden:e[6]||(e[6]=u=>p.value=!1)},null,8,["open"])])}}});export{Te 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.