import{u as p}from"./useCreateDrawer-JEzOVO6Z.js";import{c9 as s,b6 as o}from"./bootstrap-Bqxdt4iG.js";import{u as _}from"./data-refresh-BZ1_-6mk.js";import{u as d}from"./users-CtrZlEEf.js";import{_ as S}from"./wms-user-form.vue_vue_type_script_setup_true_lang-BaO4QUb_.js";import{a1 as b,L as w,ai as x,aj as R,ak as F,p as h,a9 as t}from"../jse/index-index-BUJ_4tQs.js";const g=b({__name:"wms-user-create-drawer",emits:["success"],setup(v,{emit:c}){const n=c,l=d(),m=_(),a=w(s.STAFF),{Drawer:u,formRef:f,handleSubmit:i}=p({createApi:e=>l.create(e),invalidateData:()=>{m.invalidateUsers()},title:o("page.wmsUsers.drawer.createTitle"),processOpenData:e=>{var r;a.value=(r=e==null?void 0:e.defaultRole)!=null?r:s.STAFF},onClosed:()=>{a.value=s.STAFF},onSuccess:e=>{n("success",e)}});return(e,r)=>(R(),x(t(u),{class:"w-[640px]","confirm-text":t(o)("page.table.button.create"),"cancel-text":t(o)("page.table.button.cancel")},{default:F(()=>[h(S,{ref_key:"formRef",ref:f,"default-role":a.value,mode:"create",onSubmit:t(i)},null,8,["default-role","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{g as _};
