var l=(d,i,r)=>new Promise((a,n)=>{var s=e=>{try{t(r.next(e))}catch(o){n(o)}},c=e=>{try{t(r.throw(e))}catch(o){n(o)}},t=e=>e.done?a(e.value):Promise.resolve(e.value).then(s,c);t((r=r.apply(d,i)).next())});import{b6 as m}from"./bootstrap-Bqxdt4iG.js";import{u as f}from"./data-refresh-BZ1_-6mk.js";import{u as g}from"./packing-orders-F5ifB4Cx.js";import{_ as k}from"./packing-form.vue_vue_type_script_setup_true_lang-ChphfFAG.js";import{a1 as _,L as v,ai as p,aj as u,ak as w,an as O,a9 as h}from"../jse/index-index-BUJ_4tQs.js";import{u as D}from"./use-drawer-CLDmRz16.js";const P=_({__name:"packing-order-edit-drawer",setup(d){const i=g(),r=f(),a=v(null),[n,s]=D({title:m("page.packingOrders.drawer.editTitle"),footer:!1,destroyOnClose:!0,onOpenChange:t=>l(null,null,function*(){if(!t){a.value=null;return}const e=s.getData();if(e!=null&&e.packingOrderId)try{a.value=yield i.getDetail(e.packingOrderId)}catch(o){console.error("Failed to load packing order:",o)}})}),c=()=>{r.invalidatePackingOrders(),r.invalidateInventories(),r.invalidateInventoryDetails(),s.close()};return(t,e)=>(u(),p(h(n),{class:"w-[100vw]"},{default:w(()=>[a.value?(u(),p(k,{key:0,"packing-order":a.value,mode:"edit",onSuccess:c},null,8,["packing-order"])):O("",!0)]),_:1}))}});export{P as _};
