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