import{_ as C,d as E,Q as v,m as b,p as u,r as _,c as k,h as T,o as d,f as c,a,w as s,S as n,O as $,z as h,B as w,D as g}from"./app-BOG5ezKh.js";import{A as S,f as B}from"./AddEdit-DAZjIBB4.js";const D=E({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:v,AddEdit:S},setup(e,{emit:p}){const{permsArray:m}=b(),{initData:l,addEditUrl:f}=B(),o=u(!1),i=u("add"),t=u({...l});return{permsArray:m,visible:o,addEditType:i,addEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},p("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),O={key:0};function P(e,p,m,l,f,o){const i=$,t=_("PlusOutlined"),r=w,y=g,A=_("AddEdit");return e.permsArray.includes("roles_create")||e.permsArray.includes("admin")?(d(),k("div",O,[e.customType=="menu"?(d(),c(i,{onClick:e.showAdd,key:"categories"},{icon:s(()=>[n(e.$slots,"icon")]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick"])):(d(),k(h,{key:1},[e.tooltip?(d(),c(y,{key:0,placement:"topLeft",title:e.$t("role.add"),"arrow-point-at-center":""},{default:s(()=>[a(r,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[a(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(d(),c(r,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[a(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),a(A,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("role.add"),successMessage:e.$t("role.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):T("v-if",!0)}const M=C(D,[["render",P],["__file","/Users/rajeshkumawat/sites/stockifly/resources/js/main/views/settings/roles/AddButton.vue"]]);export{M as R};
