1import{e as B,a as C,b as E,c as M,d as S,_ as K}from"./BsR9itgK.js";import{_ as P}from"./Y0109eIG.js";import{_ as $}from"./CowuyxjA.js";import{_ as j}from"./BjiLse1n.js";import{b as q,G as I,w as r}from"./PnHXRdXq.js";import{c as N,b as O,V as G}from"./CAs48BbK.js";import{X as H,ax as f,ay as L,A as X,I as Y,aj as z,al as t,ak as J,aa as e,aC as Q,ap as m,aq as g,Y as n}from"./Csg0bbzG.js";const R=H({__name:"TwoFactorAuth",props:f({loading:Boolean,twoFAType:String},{modelValue:{type:Boolean},modelModifiers:{}}),emits:f(["pin"],["update:modelValue"]),setup(i,{emit:w}){const x=w,{t:a}=q(),p=L(i,"modelValue"),y=N({pin:O().required(a("form.validation.required")).length(6,a("form.validation.pinLength"))}),l=X({pin:""}),u=Y("");async function d(){u.value="";try{await y.validate(l,{abortEarly:!0})}catch(_){_ instanceof G&&(u.value=_.message);return}b()}async function b(){x("pin",l.pin)}return(_,o)=>{const F=E,v=M,D=C,T=P,U=$,c=j,V=S,A=K,k=B;return J(),z(k,{open:p.value,"onUpdate:open":o[4]||(o[4]=s=>p.value=s)},{default:t(()=>[e(A,{class:"mb-4 bg-primary-300 dark:bg-primary-900 border-2 border-primary-700","show-close":!1,onPointerDownOutside:o[2]||(o[2]=r(()=>{},["prevent"])),onEscapeKeyDown:o[3]||(o[3]=r(()=>{},["prevent"]))},{default:t(()=>[e(D,null,{default:t(()=>[e(F,null,{default:t(()=>[m(g(i.twoFAType==="email"?n(a)("global.modal.twoFaEmailTitle"):i.twoFAType==="totp"?n(a)("global.modal.twoFaTotpTitle"):n(a)("global.modal.twoFaPinTitle")),1)]),_:1}),e(v,null,{default:t(()=>[m(g(i.twoFAType==="email"?n(a)("global.modal.twoFaEmailDescription"):i.twoFAType==="totp"?n(a)("global.modal.twoFaTotpDescription"):n(a)("global.modal.twoFaPinDescription")),1)]),_:1})]),_:1}),Q("form",{class:"mx-auto flex flex-col text-center",onSubmit:r(d,["prevent"])},[e(U,{name:"pin",error:n(u)},{default:t(()=>[e(T,{modelValue:n(l).pin,"onUpdate:modelValue":o[0]||(o[0]=s=>n(l).pin=s),type:"password",inputmode:"numeric",maxlength:"6",autocomplete:"one-time-code",class:"mx-auto w-48 text-center tracking-[0.4em] text-lg",onKeydown:I(r(d,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"])]),_:1},8,["error"])],32),e(V,{class:"sm:justify-between"},{default:t(()=>[e(c,{variant:"ghost",onClick:o[1]||(o[1]=s=>p.value=!1)},{default:t(()=>[...o[5]||(o[5]=[m(" Dismiss ",-1)])]),_:1}),e(c,{type:"submit",loading:i.loading,onClick:d},{default:t(()=>[...o[6]||(o[6]=[m(" Success ",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),ao=Object.assign(R,{__name:"OrganismsModalTwoFactorAuth"});export{ao 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.