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