import{_ as c,b as k,n as j,g as s,r as U,c as z,o as B,w as o,a as t,f as g,B as $,l as v,t as _,j as I,m as L}from"./index-CTxlYqj4.js";import{_ as P}from"./MenuItems-CaGz5Av4.js";import{V as q}from"./VDataTable-CYPG0MtF.js";import{V as w}from"./VMenu-DTm7W1Hp.js";import{V as p}from"./VAvatar-x_79C0tA.js";import{V as T,a as E}from"./VToolbar-Cd2iSn8H.js";import{V as F}from"./forwardRefs-BSESyuUp.js";import{V as C}from"./VSpacer-BcQnH0oL.js";import{V as G}from"./VTextField-CWm47OUI.js";import{b as O}from"./VCard-DRptUN8Y.js";import"./tag-Dx3OexMp.js";import"./VProgressCircular-ubzZW5PC.js";import"./VSelect-tV4GZAtn.js";import"./VCheckboxBtn-xrhfoOlo.js";import"./VSelectionControl-Bdgm37Tl.js";import"./VChip-Def9BYoN.js";import"./VTable-B-HE2nmK.js";import"./filter-DaBUD6Rp.js";import"./ssrBoot-DGgZQEVC.js";/* empty css              */const f="migrations",y={getMigrations(r){return c.get(`/${f}/`,{params:r})},getMigration(r,i){return c.get(`/${f}/${r}/`,i)},deleteMigration(r){return c.delete(`/${f}/${r}/`)}},H={__name:"MigrationsList",setup(r){const{$gettext:i}=k(),V=j(),n=s([]),S=[{title:i("Provider"),value:"provider.name"},{title:i("Old account"),value:"username"},{title:i("New account"),value:"mailbox"},{title:i("Actions"),value:"actions",sortable:!1,align:"right"}],x=s([]),u=s(!1),m=s(""),b=s({}),M=s(0);function A(l){y.deleteMigration(l.id).then(()=>{V.displayNotification({msg:i("Migration deleted")}),n.value=n.value.filter(a=>a.id!==l.id)})}function h(l){u.value=!0;let a={};y.getMigrations(a).then(d=>{n.value=d.data,M.value=n.value.length}).finally(()=>u.value=!1)}function D(){const l=[];return l.push({label:i("Delete"),icon:"mdi-delete-outline",onClick:A(),color:"red"}),l}return h(),(l,a)=>{const d=U("router-link");return B(),z(O,{class:"mt-6"},{default:o(()=>[t(q,{modelValue:x.value,"onUpdate:modelValue":a[2]||(a[2]=e=>x.value=e),options:b.value,"onUpdate:options":a[3]||(a[3]=e=>b.value=e),headers:S,items:n.value,search:m.value,"server-items-length":M.value,loading:u.value,"show-select":""},{top:o(()=>[t(T,{color:"white",flat:""},{default:o(()=>[t(w,{location:"bottom"},{activator:o(({props:e})=>[t(p,$(e,{variant:"flat","append-icon":"mdi-chevron-down",size:"small"}),{default:o(()=>[v(_(g(i)("Actions")),1)]),_:2},1040)]),default:o(()=>[t(F,{density:"compact"})]),_:1}),t(p,{variant:"text",icon:"mdi-reload",onClick:a[0]||(a[0]=e=>h())}),t(C),t(G,{modelValue:m.value,"onUpdate:modelValue":a[1]||(a[1]=e=>m.value=e),"prepend-inner-icon":"mdi-magnify",placeholder:"Search",filled:"",variant:"outlined",density:"compact","hide-details":""},null,8,["modelValue"])]),_:1})]),"item.mailbox":o(({item:e})=>[t(d,{to:{name:"AccountDetail",params:{id:e.mailbox.user}}},{default:o(()=>[v(_(e.mailbox.full_address),1)]),_:2},1032,["to"])]),"item.actions":o(({item:e})=>[t(w,{"offset-y":""},{activator:o(({props:N})=>[t(p,$({icon:"mdi-dots-horizontal"},N),null,16)]),default:o(()=>[t(g(P),{items:D(),object:e},null,8,["items","object"])]),_:2},1024)]),_:2},1032,["modelValue","options","items","search","server-items-length","loading"])]),_:1})}}},J={__name:"MigrationsView",setup(r){const{$gettext:i}=k();return(V,n)=>(B(),L("div",null,[t(T,{flat:""},{default:o(()=>[t(E,null,{default:o(()=>[v(_(g(i)("Migrations")),1)]),_:1}),t(C)]),_:1}),t(H)]))}},pt=I(J,[["__scopeId","data-v-5f22702f"]]);export{pt as default};
