import{_ as h}from"./SmartDataTable-2Nc3Ohem.js";import{d as m,H as l,f as c,h as r,i as s,D as p,y as o,v as d,C as y,x as u,O as v,c as g,V as k,P as T}from"./index-C5GbdPxY.js";import{V as _}from"./VChip-CsS_5IS6.js";import{V}from"./VTooltip-DPhSY2Qe.js";import"./VAvatar-RkAR0u0e.js";import"./VImg-BlqLjeEy.js";import"./VSelect-vtfYszIh.js";import"./VTextField-DxEUpn3-.js";import"./index-XcTykuv2.js";import"./forwardRefs-CB8NoG9r.js";import"./VList-C3dIUnee.js";import"./VMenu-CT0Fri-T.js";import"./VOverlay-DlJb3QlW.js";import"./getScrollParent-DE35ecf2.js";import"./VVirtualScroll-BUlcGoHW.js";import"./confirmDialog-CDDTmj30.js";import"./VCard-DptrO3GI.js";import"./VDialog-Dr29crN8.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./lodash-kem28dbC.js";import"./_commonjsHelpers-_d1bhYXs.js";import"./VForm-BZc3SavJ.js";import"./VCheckbox-rNAD_QU_.js";import"./VDatePicker-DHBX-k2T.js";import"./VSpacer-79sITyKz.js";import"./VBadge-DZHesqMo.js";import"./TableAgent.vue_vue_type_script_setup_true_lang-XA6R7TPe.js";import"./TableEnum.vue_vue_type_script_setup_true_lang-5ITYgflT.js";import"./TableStatus.vue_vue_type_script_setup_true_lang-BRbfAU0T.js";import"./RoleBadge.vue_vue_type_script_setup_true_lang-Ctl8Qye7.js";import"./VDataTable-BFiF8jPV.js";import"./VTable-M43pjJD_.js";import"./filter-DERJvhSS.js";const C=m({__name:"TableCompound",props:{item:{}},setup(n){const{t}=l();return(e,a)=>(r(),c(_,{class:"text-white",color:e.item.compound?"primary":"secondary",size:"small"},{default:s(()=>[p(o(d(t)(`tax::taxes.table.${e.item.compound?"compound":"uncompounded"}`)),1)]),_:1},8,["color"]))}}),B={key:1},N=m({__name:"TableName",props:{item:{}},setup(n){const{t}=l();return(e,a)=>e.item.is_global?(r(),c(V,{key:0,location:"top"},{activator:s(({props:i})=>[u("div",v({class:"d-flex align-center gap-1"},i),[g(k,{color:"primary",icon:"tabler-rosette-discount-check-filled"}),p(" "+o(e.item.name),1)],16)]),default:s(()=>[u("span",null,o(d(t)("tax::taxes.tooltips.global_tax")),1)]),_:1})):(r(),y("span",B,o(e.item.name),1))}}),$=m({__name:"TableType",props:{item:{}},setup(n){const t=n,e=()=>{switch(t.item.type.id){case"inclusive":return"primary";case"exclusive":return"info";default:return"default"}};return(a,i)=>(r(),c(_,{color:e(),size:"small"},{default:s(()=>[p(o(a.item.type.name),1)]),_:1},8,["color"]))}}),lt=m({__name:"Index",setup(n){const{t}=l(),{user:e}=T(),a=[{title:t("tax::taxes.table.name"),value:"name",sortable:!0},{title:t("branch::branches.table.branch"),value:"branch.name",sortable:!0,sortable_key:"branch_id",hidden:e==null?void 0:e.assigned_to_branch},{title:t("tax::taxes.table.code"),value:"code",sortable:!0},{title:t("tax::taxes.table.rate"),value:"rate",sortable:!0},{title:t("tax::taxes.table.compound"),value:"compound",sortable:!0},{title:t("tax::taxes.table.type"),value:"type",sortable:!0},{title:t("admin::admin.table.status"),value:"is_active",sortable:!0},{title:t("admin::admin.table.created_at"),value:"created_at",sortable:!0},{title:t("admin::admin.table.updated_at"),value:"updated_at",sortable:!0}],i=[{key:"edit"},{key:"destroy",confirm:{message:t("admin::admin.delete.confirmation_message"),confirmButtonText:t("admin::admin.delete.confirm_button_text")}}],b=[{key:"destroy",confirm:{message:t("admin::admin.delete.confirmation_message"),confirmButtonText:t("admin::admin.delete.confirm_button_text")}}],x={name:{component:N},compound:{component:C},type:{component:$}};return(w,D)=>{const f=h;return r(),c(f,{actions:i,"api-uri":"/v1/taxes","bulk-actions":b,"cell-components":x,"header-actions":[{key:"create"}],headers:a,module:"tax",name:"tax",resource:"taxes"})}}});export{lt as default};
