import{F as w}from"./section-Dbg05qO2.js";import{aA as $,b as t,a9 as _,a7 as h,M as f,P as A,$ as p,r as K,d as D,bf as M,x as T}from"./app-QjDgb7aF.js";import{b as I,ab as S,j as g,p as y,k as r,i as e,J as s,D as n,u as o,I as L,q as d,F as N,G as U,g as q,a as x}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const E={class:"_formRoot"},z=I({__name:"migration",async setup(P){let b,k,u=x(""),i=x([""]);[b,k]=S(()=>v()),await b,k();async function v(){if(p?.alsoKnownAs&&p.alsoKnownAs.length>0){const l=await D("users/show",{userIds:M(p.alsoKnownAs)});i.value=l&&l.length>0?l.map(a=>`@${T.toString(a)}`):[""]}else i.value=[""]}async function V(){const l=await A("i/known-as",{alsoKnownAs:i.value.map(a=>a.trim()).filter(a=>a!=="")});p.alsoKnownAs=l.alsoKnownAs,await v()}function B(){i.value.push("")}async function C(l){(await K({type:"warning",text:t.t("migrationConfirm",{account:l.toString()})})).canceled||A("i/move",{moveToAccount:l})}return $({title:t.ts.security,icon:"ph-lock ph-bold ph-lg"}),(l,a)=>(g(),y("div",E,[r(w,null,{label:e(()=>[s(n(o(t).ts.moveTo),1)]),default:e(()=>[r(_,{warn:"",class:"_formBlock"},{default:e(()=>[s(n(o(t).ts.moveAccountDescription),1)]),_:1}),r(h,{modelValue:o(u),"onUpdate:modelValue":a[0]||(a[0]=m=>L(u)?u.value=m:u=m),class:"_formBlock"},{prefix:e(()=>[...a[2]||(a[2]=[d("i",{class:"ph-airplane-takeoff ph-bold ph-lg"},null,-1)])]),label:e(()=>[s(n(o(t).ts.moveToLabel),1)]),_:1},8,["modelValue"]),r(f,{primary:"",danger:"",onClick:a[1]||(a[1]=m=>C(o(u)))},{default:e(()=>[s(n(o(t).ts.moveAccount),1)]),_:1})]),_:1}),r(w,null,{label:e(()=>[s(n(o(t).ts.moveFrom),1)]),default:e(()=>[r(_,{warn:"",class:"_formBlock"},{default:e(()=>[s(n(o(t).ts.moveFromDescription),1)]),_:1}),(g(!0),y(N,null,U(o(i),(m,c)=>(g(),q(h,{modelValue:o(i)[c],"onUpdate:modelValue":F=>o(i)[c]=F,class:"_formBlock"},{prefix:e(()=>[...a[3]||(a[3]=[d("i",{class:"ph-airplane-landing ph-bold ph-lg"},null,-1)])]),label:e(()=>[s(n(`#${c+1} ${o(t).ts.moveFromLabel}`),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),256)),r(f,{class:"button",disabled:o(i).length>=10,inline:"",style:{"margin-right":"8px"},onClick:B},{default:e(()=>[a[4]||(a[4]=d("i",{class:"ph-plus ph-bold ph-lg"},null,-1)),s(" "+n(o(t).ts.add),1)]),_:1},8,["disabled"]),r(f,{class:"button",inline:"",primary:"",onClick:V},{default:e(()=>[a[5]||(a[5]=d("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1)),s(" "+n(o(t).ts.save),1)]),_:1})]),_:1})]))}});export{z as default};
//# sourceMappingURL=migration-CmIun9Sw.js.map
