1import{d as a,a as i,r as N,b as n,w as s,f as l,n as x,t as S,E as B,q as D,G as Q,i as v,o,u as Y,H as G,c as g,h as m,e as b,F as I,g as U,p as z,D as R,y as O}from"./app-D3WDzOUw.js";import{b as W,a as j}from"./DialogModal-8FU5QbGv.js";import{_ as q,a as E}from"./TextInput-CCcGZO1v.js";import{_ as P}from"./PrimaryButton-DOG6QU8y.js";import{_ as T}from"./SecondaryButton-CaTL3zkk.js";import{_ as J}from"./DangerButton-BvjL2fQm.js";import{_ as X}from"./InputLabel-BptfTHUI.js";import"./SectionTitle-BZOXMYp-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const Z={class:"mt-4"},_={__name:"ConfirmsPassword",props:{title:{type:String,default:"Confirm Password"},content:{type:String,default:"For your security, please confirm your password to continue."},button:{type:String,default:"Confirm"}},emits:["confirmed"],setup(h,{emit:F}){const k=F,u=v(!1),e=Q({password:"",error:"",processing:!1}),d=v(null),w=()=>{axios.get(route("password.confirmation")).then(r=>{r.data.confirmed?k("confirmed"):(u.value=!0,setTimeout(()=>d.value.focus(),250))})},y=()=>{e.processing=!0,axios.post(route("password.confirm"),{password:e.password}).then(()=>{e.processing=!1,f(),D().then(()=>k("confirmed"))}).catch(r=>{e.processing=!1,e.error=r.response.data.errors.password[0],d.value.focus()})},f=()=>{u.value=!1,e.password="",e.error=""};return(r,c)=>(o(),a("span",null,[i("span",{onClick:w},[N(r.$slots,"default")]),n(W,{show:u.value,onClose:f},{title:s(()=>[l(S(h.title),1)]),content:s(()=>[l(S(h.content)+" ",1),i("div",Z,[n(q,{ref_key:"passwordInput",ref:d,modelValue:e.password,"onUpdate:modelValue":c[0]||(c[0]=$=>e.password=$),type:"password",class:"mt-1 block w-3/4",placeholder:"Password",autocomplete:"current-password",onKeyup:B(y,["enter"])},null,8,["modelValue"]),n(E,{message:e.error,class:"mt-2"},null,8,["message"])])]),footer:s(()=>[n(T,{onClick:f},{default:s(()=>[...c[1]||(c[1]=[l(" Cancel ",-1)])]),_:1}),n(P,{class:x(["ms-3",{"opacity-25":e.processing}]),disabled:e.processing,onClick:y},{default:s(()=>[l(S(h.button),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]))}},ee={key:0,class:"text-lg font-medium text-gray-900"},te={key:1,class:"text-lg font-medium text-gray-900"},oe={key:2,class:"text-lg font-medium text-gray-900"},se={key:3},ae={key:0},ne={class:"mt-4 max-w-xl text-sm text-gray-600"},re={key:0,class:"font-semibold"},le={key:1},ie=["innerHTML"],ue={key:0,class:"mt-4 max-w-xl text-sm text-gray-600"},ce={class:"font-semibold"},de=["innerHTML"],me={key:1,class:"mt-4"},fe={key:1},pe={class:"grid gap-1 max-w-xl mt-4 px-4 py-4 font-mono text-sm bg-gray-100 rounded-lg"},ve={class:"mt-5"},ye={key:0},we={key:1},Fe={__name:"TwoFactorAuthenticationForm",props:{requiresConfirmation:Boolean},setup(h){const F=h,k=O(),u=v(!1),e=v(!1),d=v(!1),w=v(null),y=v(null),f=v([]),r=Y({code:""}),c=z(()=>{var p;return!u.value&&((p=k.props.auth.user)==null?void 0:p.two_factor_enabled)});G(c,()=>{c.value||(r.reset(),r.clearErrors())});const $=()=>{u.value=!0,R.post(route("two-factor.enable"),{},{preserveScroll:!0,onSuccess:()=>Promise.all([H(),L(),V()]),onFinish:()=>{u.value=!1,e.value=F.requiresConfirmation}})},H=()=>axios.get(route("two-factor.qr-code")).then(p=>{w.value=p.data.svg}),L=()=>axios.get(route("two-factor.secret-key")).then(p=>{y.value=p.data.secretKey}),V=()=>axios.get(route("two-factor.recovery-codes")).then(p=>{f.value=p.data}),A=()=>{r.post(route("two-factor.confirm"),{errorBag:"confirmTwoFactorAuthentication",preserveScroll:!0,preserveState:!0,onSuccess:()=>{e.value=!1,w.value=null,y.value=null}})},M=()=>{axios.post(route("two-factor.recovery-codes")).then(()=>V())},K=()=>{d.value=!0,R.delete(route("two-factor.disable"),{preserveScroll:!0,onSuccess:()=>{d.value=!1,e.value=!1}})};return(p,t)=>(o(),g(j,null,{title:s(()=>[...t[1]||(t[1]=[l(" Two Factor Authentication ",-1)])]),description:s(()=>[...t[2]||(t[2]=[l(" Add additional security to your account using two factor authentication. ",-1)])]),content:s(()=>[c.value&&!e.value?(o(),a("h3",ee," You have enabled two factor authentication. ")):c.value&&e.value?(o(),a("h3",te," Finish enabling two factor authentication. ")):(o(),a("h3",oe," You have not enabled two factor authentication. ")),t[11]||(t[11]=i("div",{class:"mt-3 max-w-xl text-sm text-gray-600"},[i("p",null," When two factor authentication is enabled, you will be prompted for a secure, random token during authentication. You may retrieve this token from your phone's Google Authenticator application. ")],-1)),c.value?(o(),a("div",se,[w.value?(o(),a("div",ae,[i("div",ne,[e.value?(o(),a("p",re," To finish enabling two factor authentication, scan the following QR code using your phone's authenticator application or enter the setup key and provide the generated OTP code. ")):(o(),a("p",le," Two factor authentication is now enabled. Scan the following QR code using your phone's authenticator application or enter the setup key. "))]),i("div",{class:"mt-4 p-2 inline-block bg-white",innerHTML:w.value},null,8,ie),y.value?(o(),a("div",ue,[i("p",ce,[t[3]||(t[3]=l(" Setup Key: ",-1)),i("span",{innerHTML:y.value},null,8,de)])])):m("",!0),e.value?(o(),a("div",me,[n(X,{for:"code",value:"Code"}),n(q,{id:"code",modelValue:b(r).code,"onUpdate:modelValue":t[0]||(t[0]=C=>b(r).code=C),type:"text",name:"code",class:"block mt-1 w-1/2",inputmode:"numeric",autofocus:"",autocomplete:"one-time-code",onKeyup:B(A,["enter"])},null,8,["modelValue"]),n(E,{message:b(r).errors.code,class:"mt-2"},null,8,["message"])])):m("",!0)])):m("",!0),f.value.length>0&&!e.value?(o(),a("div",fe,[t[4]||(t[4]=i("div",{class:"mt-4 max-w-xl text-sm text-gray-600"},[i("p",{class:"font-semibold"}," Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost. ")],-1)),i("div",pe,[(o(!0),a(I,null,U(f.value,C=>(o(),a("div",{key:C},S(C),1))),128))])])):m("",!0)])):m("",!0),i("div",ve,[c.value?(o(),a("div",we,[n(_,{onConfirmed:A},{default:s(()=>
1[e.value?(o(),g(P,{key:0,type:"button",class:x(["me-3",{"opacity-25":u.value||b(r).processing}]),disabled:u.value||b(r).processing},{default:s(()=>[...t[6]||(t[6]=[l(" Confirm ",-1)])]),_:1},8,["class","disabled"])):m("",!0)]),_:1}),n(_,{onConfirmed:M},{default:s(()=>[f.value.length>0&&!e.value?(o(),g(T,{key:0,class:"me-3"},{default:s(()=>[...t[7]||(t[7]=[l(" Regenerate Recovery Codes ",-1)])]),_:1})):m("",!0)]),_:1}),n(_,{onConfirmed:V},{default:s(()=>[f.value.length===0&&!e.value?(o(),g(T,{key:0,class:"me-3"},{default:s(()=>[...t[8]||(t[8]=[l(" Show Recovery Codes ",-1)])]),_:1})):m("",!0)]),_:1}),n(_,{onConfirmed:K},{default:s(()=>[e.value?(o(),g(T,{key:0,class:x({"opacity-25":d.value}),disabled:d.value},{default:s(()=>[...t[9]||(t[9]=[l(" Cancel ",-1)])]),_:1},8,["class","disabled"])):m("",!0)]),_:1}),n(_,{onConfirmed:K},{default:s(()=>[e.value?m("",!0):(o(),g(J,{key:0,class:x({"opacity-25":d.value}),disabled:d.value},{default:s(()=>[...t[10]||(t[10]=[l(" Disable ",-1)])]),_:1},8,["class","disabled"]))]),_:1})])):(o(),a("div",ye,[n(_,{onConfirmed:$},{default:s(()=>[n(P,{type:"button",class:x({"opacity-25":u.value}),disabled:u.value},{default:s(()=>[...t[5]||(t[5]=[l(" Enable ",-1)])]),_:1},8,["class","disabled"])]),_:1})]))])]),_:1}))}};export{Fe 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.