PageSourceSearch

https://primaria-cehusilvaniei.ro/_nuxt/F9GmVzTM.js

js primaria-cehusilvaniei.ro collected 2026-10-02 23:38:37 UTC 3,464 bytes, 1 lines download raw bytes

1import{a as I,m as k}from"./-W1VOijv.js";import{bg as n,b3 as p,J as h,b_ as a,a0 as r,Z as f,bs as d,I as C,Q as $,F as L,be as B,bG as _}from"./PW_UF68a.js";import"./Bz2dEcw7.js";import"./CIhhRri8.js";import"./Bs5_TFWz.js";import"./B_aewNsK.js";import"./fgnZjpTr.js";import"./CH7vd0UB.js";import"./206wqFYJ.js";const w={class:"confirmation-code-wrapper"},D={name:"ConfirmAccount",auth:"guest",props:{email:{type:String,required:!0}},data(){return{isLoading:!1,confirmationCode:["","","","","",""],resendLoading:!1}},computed:{isCodeComplete(){return this.confirmationCode.every(t=>t!=="")}},methods:{...k("resources",["confirmAccount"]),onUpdateCode(t,e){this.confirmationCode[t]=e},onInput(t){const e=this.confirmationCode[t];if(e&&e.length===1&&t<this.confirmationCode.length-1){const o=document.getElementById(`input-${t+1}`);o&&o.focus()}},onBackspace(t,e){if(t.key==="Backspace"&&!this.confirmationCode[e]&&e>0){const o=document.getElementById(`input-${e-1}`);o&&o.focus()}},onlyNumber(t){/\d/.test(t.key)||t.preventDefault()},onPaste(t){t.preventDefault();const o=t.clipboardData.getData("text").replace(/\D/g,"");o.split("").forEach((u,l)=>{l<this.confirmationCode.length&&(this.confirmationCode[l]=u)});const m=Math.min(o.length,this.confirmationCode.length)-1,c=document.getElementById(`input-${m}`);c&&c.focus()},async submit(){this.isLoading=!0;try{const t=localStorage.getItem("email"),{$axios:e}=_();await e.post("/api/citizens/confirm-account",{email:t,code:this.confirmationCode.join("")}),await this.$router.replace("/auth/citizens/login")}catch(t){await this.$errorAlert(t.response?.data?.message||"Confirmarea contului a eșuat. Încearcă din nou.")}finally{this.isLoading=!1}},async resendCode(){if(!this.resendLoading){this.resendLoading=!0;try{const t=localStorage.getItem("email"),{$axios:e}=_();await e.post("/api/citizens/resend-code",{email:t})}catch(t){this.$errorAlert(t.response?.data?.message||"Retrimiterea codului a eșuat. Încearcă din nou.")}finally{this.resendLoading=!1}}}}},A=Object.assign(D,{setup(t){return(e,o)=>{const m=n("v-card-title"),c=n("v-card-subtitle"),u=n("v-text-field"),l=n("v-btn"),v=n("v-form"),y=n("v-card-text"),b=n("v-card");return p(),h(b,{class:"text-center pa-2",elevation:"10",light:""},{default:a(()=>[r(m,{class:"justify-center display-1 mb-2"},{default:a(()=>[f(d(e.$t("confirm.message")),1)]),_:1}),r(c,null,{default:a(()=>[f(d(e.$t("confirm.instructions")),1)]),_:1}),r(y,null,{default:a(()=>[r(v,{ref:"form","lazy-validation":""},{default:a(()=>[C("div",w,[(p(!0),$(L,null,B(e.confirmationCode,(g,i)=>(p(),h(u,{id:"input-"+i,key:i,"model-value":e.confirmationCode[i],"onUpdate:modelValue":s=>e.onUpdateCode(i,s),class:"confirmation-input",maxlength:"1",variant:"outlined",type:"text",onInput:s=>e.onInput(i),onPaste:e.onPaste,onKeydown:s=>e.onBackspace(s,i),onKeypress:o[0]||(o[0]=s=>e.onlyNumber(s))},null,8,["id","model-value","onUpdate:modelValue","onInput","onPaste","onKeydown"]))),128))]),r(c,null,{default:a(()=>[C("a",{onClick:o[1]||(o[1]=(...g)=>e.resendCode&&e.resendCode(...g))},d(e.resendLoading?"Se retrimite...":"Retrimite codul"),1)]),_:1}),r(l,{disabled:e.isLoading||!e.isCodeComplete,loading:e.isLoading,block:"",height:"56",color:"primary",size:"large",onClick:e.submit,class:"text-white"},{default:a(()=>[f(d(e.$t("confirm.button")),1)]),_:1},8,["disabled","loading","onClick"])]),_:1},512)]),_:1})]),_:1})}}}),K=I(A,[["__scopeId","data-v-a16730b5"]]);export{K 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.