var c=(p,r,a)=>new Promise((s,n)=>{var i=e=>{try{t(a.next(e))}catch(u){n(u)}},m=e=>{try{t(a.throw(e))}catch(u){n(u)}},t=e=>e.done?s(e.value):Promise.resolve(e.value).then(i,m);t((a=a.apply(p,r)).next())});import{u as d}from"./useEditDrawer-JG4PTzvo.js";import{b6 as f}from"./bootstrap-Bqxdt4iG.js";import{u as l}from"./data-refresh-BZ1_-6mk.js";import{u as _}from"./uoms-C8j_QMVZ.js";import{_ as w}from"./uom-form.vue_vue_type_script_setup_true_lang-y5OoXlq9.js";import{a1 as b,ai as x,aj as S,ak as h,p as D,a9 as o}from"../jse/index-index-BUJ_4tQs.js";const B=b({__name:"uom-edit-drawer",setup(p){const r=_(),a=l(),{Drawer:s,entity:n,formRef:i,handleSubmit:m}=d({getDetailApi:t=>c(null,null,function*(){const e=yield r.getDetail(t);if(!e)throw new Error("UOM not found");return e}),updateApi:(t,e)=>c(null,null,function*(){return r.update(t,e)}),invalidateData:()=>a.invalidateUoms(),title:f("page.uoms.drawer.editTitle"),idKey:"uomId"});return(t,e)=>(S(),x(o(s),{class:"w-[520px]","confirm-text":o(f)("page.table.button.save"),"cancel-text":o(f)("page.table.button.cancel")},{default:h(()=>[D(w,{ref_key:"formRef",ref:i,uom:o(n),mode:"edit",onSubmit:o(m)},null,8,["uom","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{B as _};
