import{J as b,G as E,aN as k,ah as C,r as c,o as a,l as n,w as o,u as t,f as r,i as p,t as I,j as v}from"./vendor.d12b5734.js";import{t as x,u as S,j as V,e as j,g as y}from"./main.465728e1.js";const G={props:{row:{type:Object,default:null},table:{type:Object,default:null},loadData:{type:Function,default:()=>{}}},setup(l){const _=l,g=x(),h=S(),N=V(),m=j(),{t:s}=b(),w=E();k(),C("utils");async function B(i=null){N.openDialog({title:s("general.are_you_sure"),message:s("invoices.confirm_delete"),yesLabel:s("general.ok"),noLabel:s("general.cancel"),variant:"danger",hideNoButton:!1,size:"lg"}).then(async u=>{u&&await g.deleteMultipleRecurringInvoices(i).then(e=>{e.data.success?(_.table&&_.table.refresh(),g.$patch(d=>{d.selectedRecurringInvoices=[],d.selectAllField=!1}),h.showNotification({type:"success",message:s("recurring_invoices.deleted_message",2)})):e.data.error&&h.showNotification({type:"error",message:e.data.message})})})}return(i,u)=>{const e=c("BaseIcon"),d=c("BaseButton"),f=c("BaseDropdownItem"),R=c("router-link"),D=c("BaseDropdown");return a(),n(D,{"content-loading":t(g).isFetchingViewData},{activator:o(()=>[t(w).name==="recurring-invoices.view"?(a(),n(d,{key:0,variant:"primary"},{default:o(()=>[r(e,{name:"DotsHorizontalIcon",class:"h-5 text-white"})]),_:1})):(a(),n(e,{key:1,name:"DotsHorizontalIcon",class:"h-5 text-gray-500"}))]),default:o(()=>[t(m).hasAbilities(t(y).EDIT_RECURRING_INVOICE)?(a(),n(R,{key:0,to:`/admin/recurring-invoices/${l.row.id}/edit`},{default:o(()=>[r(f,null,{default:o(()=>[r(e,{name:"PencilIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+I(i.$t("general.edit")),1)]),_:1})]),_:1},8,["to"])):v("",!0),t(w).name!=="recurring-invoices.view"&&t(m).hasAbilities(t(y).VIEW_RECURRING_INVOICE)?(a(),n(R,{key:1,to:`recurring-invoices/${l.row.id}/view`},{default:o(()=>[r(f,null,{default:o(()=>[r(e,{name:"EyeIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+I(i.$t("general.view")),1)]),_:1})]),_:1},8,["to"])):v("",!0),t(m).hasAbilities(t(y).DELETE_RECURRING_INVOICE)?(a(),n(f,{key:2,onClick:u[0]||(u[0]=$=>B(l.row.id))},{default:o(()=>[r(e,{name:"TrashIcon",class:"w-5 h-5 mr-3 text-gray-400 group-hover:text-gray-500"}),p(" "+I(i.$t("general.delete")),1)]),_:1})):v("",!0)]),_:1},8,["content-loading"])}}};export{G as _};
