1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["CDViD8RT.js","Co3cvlEU.js","app-B3k0Lwm3.js","BTqQ_sdn.js","cPPnkASS.css","Dydz8LOQ.css","NMcuTmOx.js","D-y6wN8d.css","VB425e3y.js","Box48UwB.css"])))=>i.map(i=>d[i]); 2import{R as G,S as C,i as a,M as g,a2 as J,W as Q,c5 as b,E as y,f as U,g as W,Q as X,y as $,A as B,F as Y,k as K,am as z,ao as Z,C as ee,_ as te}from"./app-B3k0Lwm3.js";import{s as D,c as ae,b as se}from"./DR2vO6TF.js";import{F as x}from"./Cw4UJ9Tz.js";import{M as I}from"./NMcuTmOx.js";import{b as A,c as R,z as k,g as w,h as l,j as e,C as s,l as f,A as L,q as t,H as i,B as n,s as u,M as F,N,d as ne,f as re,k as oe}from"./Co3cvlEU.js";import{F as ie}from"./DgUQC0vr.js";import{M as le}from"./CxGp7-du.js";import{M as ce}from"./Cj1EZYcn.js";import"./BTqQ_sdn.js";const de={key:0,class:"_gaps_s"},ue={key:0,class:"ti ti-check",style:{color:"var(--MI_THEME-success)"}},fe={key:0,class:"_gaps_s"},pe=["textContent"],_e={key:1,class:"_gaps_s"},ke={class:"_gaps_s"},me={class:"_buttons"},ye=A({__name:"2fa",props:{first:{type:Boolean,default:!1}},setup(V){const d=G(),E=R(()=>d.usePasswordLessLogin??!1);async function S(){const r=await b();if(r.canceled)return;const o=await y("i/2fa/register",{password:r.result.password,token:r.result.token}),{dispose:c}=U(ne(()=>W(()=>import("./CDViD8RT.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),{twoFactorData:o},{closed:()=>c()})}async function m(){const r=await b();r.canceled||y("i/2fa/unregister",{password:r.result.password,token:r.result.token}).then(o=>{X({twoFactorEnabled:!1})}).catch(o=>{$({type:"error",text:o})})}function p(){B({type:"question",title:a.ts._2fa.renewTOTP,text:a.ts._2fa.renewTOTPConfirm,okText:a.ts._2fa.renewTOTPOk,cancelText:a.ts._2fa.renewTOTPCancel}).then(({canceled:r})=>{r||S()})}async function P(r){if((await B({type:"question",title:a.ts._2fa.removeKey,text:a.tsx._2fa.removeKeyConfirm({name:r.name})})).canceled)return;const c=await b();c.canceled||(await y("i/2fa/remove-key",{password:c.result.password,token:c.result.token,credentialId:r.id}),Y())}async function T(r){const o=await K({title:a.ts.rename,default:r.name,type:"text",minLength:1,maxLength:30});o.canceled||await y("i/2fa/update-key",{name:o.result,credentialId:r.id})}async function _(){const r=await b();if(r.canceled)return;const o=ae({publicKey:await y("i/2fa/register-key",{password:r.result.password,token:r.result.token})}),c=await K({title:a.ts._2fa.registerSecurityKey,text:a.ts._2fa.securityKeyName,type:"text",minLength:1,maxLength:30});if(c.canceled)return;const M=await z(se(o),null,()=>{},a.ts._2fa.tapSecurityKey);!M||(await b()).canceled||await y("i/2fa/key-done",{password:r.result.password,token:r.result.token,name:c.result,credential:M.toJSON()})}async function O(r){await y("i/2fa/password-less",{value:r})}return(r,o)=>{const c=k("SearchLabel"),M=k("SearchKeyword"),v=k("SearchMarker"),H=k("MkTime"),q=k("I18n");return l(),w(v,{markerId:"2fa",keywords:["2fa"],children:["qCXM0HtJ7","3g1RePuD9","pFRud5u8k"]},{default:e(()=>[s(x,{first:r.first},{label:e(()=>[s(c,null,{default:e(()=>[i(n(t(a).ts["2fa"]),1)]),_:1})]),default:e(()=>[t(d)?(l(),f("div",de,[t(d).twoFactorEnabled&&t(d).twoFactorBackupCodesStock==="partial"?(l(),w(C,{key:0,warn:""},{default:e(()=>[i(n(t(a).ts._2fa.backupCodeUsedWarning),1)]),_:1})):L("",!0),t(d).twoFactorEnabled&&t(d).twoFactorBackupCodesStock==="none"?(l(),w(C,{key:1,warn:""},{default:e(()=>[i(n(t(a).ts._2fa.backupCodesExhaustedWarning),1)]),_:1})):L("",!0),s(v,{keywords:["totp","app"],markerId:"qCXM0HtJ7","data-in-app-search-marker-id":"qCXM0HtJ7"},{default:e(()=>[s(I,{defaultOpen:!0},{icon:e(()=>o[1]||(o[1]=[u("i",{class:"ti ti-shield-lock"},null,-1)])),label:e(()=>[s(c,null,{default:e(()=>[i(n(t(a).ts.totp),1)]),_:1})]),caption:e(()=>[s(M,null,{default:e(()=>[i(n(t(a).ts.totpDescription),1)]),_:1})]),suffix:e(()=>[t(d).twoFactorEnabled?(l(),f("i",ue)):L("",!0)]),default:e(()=>[t(d).twoFactorEnabled?(l(),f("div",fe,[u("div",{textContent:n(t(a).ts._2fa.alreadyRegistered)},null,8,pe),t(d).securityKeysList.length>0?(l(),f(F,{key:0},[s(g,{onClick:p},{default:e(()=>[i(n(t(a).ts._2fa.renewTOTP),1)]),_:1}),s(C,null,{default:e(()=>[i(n(t(a).ts._2fa.whyTOTPOnlyRenew),1)]),_:1})],64)):(l(),w(g,{key:1,danger:"",onClick:m},{default:e(()=>[i(n(t(a).ts.unregister),1)]),_:1}))])):t(d).twoFactorEnabled?L("",!0):(l(),f("div",_e,[s(g,{primary:"",gradate:"",onClick:S},{default:e(()=>[i(n(t(a).ts._2fa.registerTOTP),1)]),_:1}),s(J,{url:"https://misskey-hub.net/docs/for-users/stepped-guides/how-to-enable-2fa/",target:"_blank"},{default:e(()=>[o[2]||(o[2]=u("i",{class:"ti ti-help-circle"},null,-1)),i(" "+n(t(a).ts.learnMore),1)]),_:1})]))]),_:1})]),_:1}),s(v,{keywords:["security","key","passkey"],markerId:"3g1RePuD9","data-in-app-search-marker-id":"3g1RePuD9"},{default:e(()=>[s(I,null,{icon:e(()=>o[3]||(o[3]=[u("i",{class:"ti ti-key"},null,-1)])),label:e(()=>[s(c,null,{default:e(()=>[i(n(t(a).ts.securityKeyAndPasskey),1)]),_:1})]),default:e(()=>[u("div",ke,[s(C,null,{default:e(()=>[i(n(t(a).ts._2fa.securityKeyInfo),1)]),_:1}),t(D)()?t(D)()&&!t(d).twoFactorEnabled?(l(),w(C,{key:1,warn:""},{default:e(()=>[i(n(t(a).ts._2fa.registerTOTPBeforeKey),1)]),_:1})):(l(),f(F,{key:2},[s(g,{primary:"",onClick:_},{default:e(()=>[i(n(t(a).ts._2fa.registerSecurityKey),1)]),_:1}),(l(!0),f(F,null,N(t(d).securityKeysList,h=>(l(),w(I,{key:h.id},{label:e(()=>[i(n(h.name),1)]),suffix:e(()=>[s(q,{src:t(a).ts.lastUsedAt},{t:e(()=>[s(H,{time:h.lastUsed},null,8,["time"])]),_:2}
2,1032,["src"])]),default:e(()=>[u("div",me,[s(g,{onClick:j=>T(h)},{default:e(()=>[o[4]||(o[4]=u("i",{class:"ti ti-forms"},null,-1)),i(" "+n(t(a).ts.rename),1)]),_:2},1032,["onClick"]),s(g,{danger:"",onClick:j=>P(h)},{default:e(()=>[o[5]||(o[5]=u("i",{class:"ti ti-trash"},null,-1)),i(" "+n(t(a).ts.unregister),1)]),_:2},1032,["onClick"])])]),_:2},1024))),128))],64)):(l(),w(C,{key:0,warn:""},{default:e(()=>[i(n(t(a).ts._2fa.securityKeyNotSupported),1)]),_:1}))])]),_:1})]),_:1}),s(v,{keywords:["password","less","key","passkey","login","signin"],markerId:"pFRud5u8k","data-in-app-search-marker-id":"pFRud5u8k"},{default:e(()=>[s(Q,{disabled:!t(d).twoFactorEnabled||t(d).securityKeysList.length===0,modelValue:E.value,"onUpdate:modelValue":o[0]||(o[0]=h=>O(h))},{label:e(()=>[s(c,null,{default:e(()=>[i(n(t(a).ts.passwordLessLogin),1)]),_:1})]),caption:e(()=>[s(M,null,{default:e(()=>[i(n(t(a).ts.passwordLessLoginDescription),1)]),_:1})]),_:1},8,["disabled","modelValue"])]),_:1})])):L("",!0)]),_:1},8,["first"])]),_:1})}}}),we={class:"_gaps_m"},ge={key:0,class:"ti ti-check icon succ"},he={key:1,class:"ti ti-circle-x icon fail"},be={class:"ip _monospace"},Te=A({__name:"security",setup(V){const d={endpoint:"i/signin-history",limit:5};async function E(){const{canceled:m,result:p}=await K({title:a.ts.newPassword,type:"password",autocomplete:"new-password"});if(m)return;const{canceled:P,result:T}=await K({title:a.ts.newPasswordRetype,type:"password",autocomplete:"new-password"});if(P)return;if(p!==T){$({type:"error",text:a.ts.retypedNotMatch});return}const _=await b();_.canceled||y("i/change-password",{currentPassword:_.result.password,token:_.result.token,newPassword:p})}async function S(){const m=await b();m.canceled||ee("i/regenerate-token",{password:m.result.password,token:m.result.token})}return R(()=>[]),R(()=>[]),Z(()=>({title:a.ts.security,icon:"ti ti-lock"})),(m,p)=>{const P=k("SearchKeyword"),T=k("SearchLabel"),_=k("SearchMarker"),O=k("MkTime"),r=re("panel");return l(),w(_,{path:"/settings/security",label:t(a).ts.security,keywords:["security"],icon:"ti ti-lock",inlining:["2fa"],markerId:"5BjnxMfYV","data-in-app-search-marker-id":"5BjnxMfYV",children:["75QPEg57v"]},{default:e(()=>[u("div",we,[s(ce,{icon:"/client-assets/locked_with_key_3d.png",color:"#ffbf00"},{default:e(()=>[s(P,null,{default:e(()=>[i(n(t(a).ts._settings.securityBanner),1)]),_:1})]),_:1}),s(_,{keywords:["password"],markerId:"75QPEg57v","data-in-app-search-marker-id":"75QPEg57v",children:["CiHijRkGG"]},{default:e(()=>[s(x,{first:""},{label:e(()=>[s(T,null,{default:e(()=>[i(n(t(a).ts.password),1)]),_:1})]),default:e(()=>[s(_,{markerId:"CiHijRkGG","data-in-app-search-marker-id":"CiHijRkGG"},{default:e(()=>
2[s(g,{primary:"",onClick:p[0]||(p[0]=o=>E())},{default:e(()=>[s(T,null,{default:e(()=>[i(n(t(a).ts.changePassword),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),s(ye),s(x,null,{label:e(()=>[i(n(t(a).ts.signinHistory),1)]),default:e(()=>[s(le,{pagination:d,disableAutoLoad:""},{default:e(({items:o})=>[u("div",null,[(l(!0),f(F,null,N(o,c=>oe((l(),f("div",{key:c.id,class:"timnmucd"},[u("header",null,[c.success?(l(),f("i",ge)):(l(),f("i",he)),u("code",be,n(c.ip),1),s(O,{time:c.createdAt,class:"time"},null,8,["time"])])])),[[r]])),128))])]),_:1})]),_:1}),s(x,null,{default:e(()=>[s(ie,null,{caption:e(()=>[i(n(t(a).ts.regenerateLoginTokenDescription),1)]),default:e(()=>[s(g,{danger:"",onClick:S},{default:e(()=>[p[1]||(p[1]=u("i",{class:"ti ti-refresh"},null,-1)),i(" "+n(t(a).ts.regenerateLoginToken),1)]),_:1})]),_:1})]),_:1})])]),_:1},8,["label"])}}}),Ee=te(Te,[["__scopeId","data-v-8ceb6155"]]);export{Ee 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.