1import{_ as G}from"./Bo_kWYIi.js";import{aR as J,ea as L,e5 as O,cL as d,ax as X,T as Y,dP as e,aB as u,aw as o,f as C,aI as c,dD as n,aJ as N,eY as P,cb as R,ay as V,cv as U,eX as Z,eO as j,eZ as A,c$ as i,a1 as H}from"./BQpWByWK.js";import{G as D,E as Q,f as W}from"./BvCVExpy.js";const ee={class:"fv-modal",role:"dialog","aria-modal":"true"},le={class:"fv-modal__title"},oe=["title"],ae={class:"fvp-hint"},te={key:0,class:"fv-modal__error"},se={class:"fv-modal__actions"},ne=["disabled"],re=["disabled"],ie={class:"fv-modal__title"},de=["title"],ce={class:"fvp-hint"},ue={key:0,class:"fv-modal__error"},ve={class:"fv-modal__actions"},fe=["disabled"],pe={class:"fvp-hint"},_e=["placeholder"],me={class:"fvp-hint fvp-hint--warn"},be={key:0,class:"fv-modal__error"},ke={class:"fv-modal__actions"},ye=["disabled"],we=J({__name:"FileVaultUnlockDialog",emits:["unlocked"],setup(he,{expose:E,emit:T}){const{t:a}=L(),B=T,h=i(!1),g=i("unlock"),m=i("request"),b=i(""),k=i(""),f=i(""),p=i(""),y=i(""),x=i(""),r=i(!1),s=i("");function F(t,l,v=!1){b.value=t,k.value=l,f.value="",p.value="",y.value="",x.value="",s.value="",g.value=v?"recover":"unlock",m.value="request",h.value=!0}function w(){h.value=!1}O(h,()=>w());function K(t){return t?.data?.message||t?.response?._data?.message||""}function q(t){const l=K(t),v={bad_password:"drive.unlock_bad_password",rate_limited:"drive.pw_rate_limited",not_locked:"drive.unlock_not_locked",no_email:"drive.recover_no_email",recover_rate_limited:"drive.recover_rate_limited",recover_unavailable:"drive.recover_unavailable",bad_code:"drive.recover_bad_code",password_length:"drive.pw_length"};return v[l]?a(v[l]):a("drive.err_generic")}async function I(){if(!r.value){if(!f.value){s.value=a("drive.unlock_enter_password");return}r.value=!0,s.value="";try{await D(b.value,f.value),B("unlocked"),w()}catch(t){s.value=q(t)}finally{r.value=!1}}}function S(){g.value="recover",m.value="request",s.value=""}function $(){g.value="unlock",s.value=""}async function z(){if(!r.value){r.value=!0,s.value="";try{const t=await Q(b.value);x.value=t.emailMasked||"",m.value="verify"}catch(t){s.value=q(t)}finally{r.value=!1}}}async function M(){if(r.value)return;if(!p.value.trim()){s.value=a("drive.recover_enter_code");return}const t=y.value;if(t&&(t.length<4||t.length>64)){s.value=a("drive.pw_length");return}r.value=!0,s.value="";try{if(await W(b.value,p.value.trim(),t),t)try{await D(b.value,t)}catch{}B("unlocked"),w()}catch(l){s.value=q(l)}finally{r.value=!1}}return E({open:F}),(t,l)=>{const v=G;return d(),X(Y,{to:"body"},[e(h)?(d(),u("div",{key:0,class:"fv-overlay",onClick:A(w,["self"])},[o("div",ee,[e(g)==="unlock"?(d(),u(C,{key:0},[o("h3",le,[l[4]||(l[4]=o("i",{class:"fa-solid fa-lock"},null,-1)),c(" "+n(e(a)("drive.unlock_title")),1)]),o("p",{class:"fvp-folder",title:e(k)},[l[5]||(l[5]=o("i",{class:"fa-solid fa-folder fvp-folder__icon"},null,-1)),c(n(e(k)),1)],8,oe),o("p",ae,n(e(a)("drive.unlock_hint")),1),N(v,{modelValue:e(f),"onUpdate:modelValue":l[0]||(l[0]=_=>R(f)?f.value=_:null),class:"fvp-input",autocomplete:"off",label:e(a)("common.toggle_password_visibility"),placeholder:e(a)("drive.unlock_ph"),onKeydown:P(I,["enter"])},null,8,["modelValue","label","placeholder"]),o("button",{type:"button",class:"fvp-forgot",onClick:S},n(e(a)("drive.unlock_forgot")),1),e(s)?(d(),u("p",te,n(e(s)),1)):V("",!0),o("div",se,[l[6]||(l[6]=o("span",{class:"fvp-spacer"},null,-1)),o("button",{type:"button",class:"fv-btn fv-btn--ghost",disabled:e(r),onClick:w},n(e(a)("common.cancel")),9,ne),o("button",{type:"button",class:"fv-btn fv-btn--primary",disabled:e(r),onClick:I},[o("i",{class:U(e(r)?"fa-solid fa-spinner fa-spin":"fa-solid fa-unlock")},null,2),c(n(e(a)("drive.unlock_go")),1)],8,re)])],64)):(d(),u(C,{key:1},[o("h3",ie,[l[7]||(l[7]=o("i",{class:"fa-solid fa-envelope-circle-check"},null,-1)),c(" "+n(e(a)("drive.recover_title")),1)]),o("p",{class:"fvp-folder",title:e(k)},[l[8]||(l[8]=o("i",{class:"fa-solid fa-folder fvp-folder__icon"},null,-1)),c(n(e(k)),1)],8,de),e(m)==="request"?(d(),u(C,{key:0},[o("p",ce,n(e(a)("drive.recover_hint_request")),1),e(s)?(d(),u("p",ue,n(e(s)),1)):V("",!0),o("div",ve,[o("button",{type:"button",class:"fvp-back",onClick:$},[l[9]||(l[9]=o("i",{class:"fa-solid fa-arrow-left"}
1,null,-1)),c(n(e(a)("drive.recover_back")),1)]),l[10]||(l[10]=o("span",{class:"fvp-spacer"},null,-1)),o("button",{type:"button",class:"fv-btn fv-btn--primary",disabled:e(r),onClick:z},[o("i",{class:U(e(r)?"fa-solid fa-spinner fa-spin":"fa-solid fa-paper-plane")},null,2),c(n(e(a)("drive.recover_send")),1)],8,fe)])],64)):(d(),u(C,{key:1},[o("p",pe,n(e(a)("drive.recover_hint_verify",{email:e(x)})),1),Z(o("input",{"onUpdate:modelValue":l[1]||(l[1]=_=>R(p)?p.value=_:null),type:"text",inputmode:"numeric",maxlength:"6",class:"fvp-input fvp-input--code",autocomplete:"one-time-code",placeholder:e(a)("drive.recover_code_ph")},null,8,_e),[[j,e(p)]]),N(v,{modelValue:e(y),"onUpdate:modelValue":l[2]||(l[2]=_=>R(y)?y.value=_:null),class:"fvp-input fvp-input--gap",autocomplete:"new-password",label:e(a)("common.toggle_password_visibility"),placeholder:e(a)("drive.recover_newpw_ph"),onKeydown:P(M,["enter"])},null,8,["modelValue","label","placeholder"]),o("p",me,n(e(a)("drive.recover_newpw_note")),1),e(s)?(d(),u("p",be,n(e(s)),1)):V("",!0),o("div",ke,[o("button",{type:"button",class:"fvp-back",onClick:l[3]||(l[3]=_=>{m.value="request",s.value=""})},[l[11]||(l[11]=o("i",{class:"fa-solid fa-arrow-left"},null,-1)),c(n(e(a)("drive.recover_resend")),1)]),l[12]||(l[12]=o("span",{class:"fvp-spacer"},null,-1)),o("button",{type:"button",class:"fv-btn fv-btn--primary",disabled:e(r),onClick:M},[o("i",{class:U(e(r)?"fa-solid fa-spinner fa-spin":"fa-solid fa-check")},null,2),c(n(e(a)("drive.recover_confirm")),1)],8,ye)])],64))],64))])])):V("",!0)])}}}),xe=H(we,[["__scopeId","data-v-184a39dc"]]);export{xe as _};
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.