(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67363,e=>{"use strict";let t=(0,e.i(56420).default)("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);e.s(["Truck",0,t],67363)},55925,e=>{"use strict";var t=e.i(43476),i=e.i(71645),r=e.i(19455),s=e.i(67363),a=e.i(5766),l=e.i(18566);e.s(["FulfillOrderForm",0,function({orderId:e,token:c}){let[o,n]=(0,i.useState)(!1),[u,d]=(0,i.useState)("STEADFAST"),h=(0,l.useRouter)(),p=async t=>{t.preventDefault(),n(!0);try{let t=await fetch("/api/shipping",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`},body:JSON.stringify({orderId:e,provider:u,shippingFee:100})});if(!t.ok){let e=await t.json();throw Error(e.message||"Failed to dispatch shipment")}a.default.success("Order dispatched successfully!"),h.refresh()}catch(e){a.default.error(e.message)}finally{n(!1)}};return(0,t.jsxs)("form",{onSubmit:p,className:"flex items-center gap-3",children:[(0,t.jsxs)("select",{value:u,onChange:e=>d(e.target.value),className:"px-3 py-2 border border-slate-200 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-600 bg-white",children:[(0,t.jsx)("option",{value:"STEADFAST",children:"Steadfast Courier"}),(0,t.jsx)("option",{value:"PATHAO",children:"Pathao Delivery"})]}),(0,t.jsxs)(r.Button,{type:"submit",disabled:o,className:"gap-2 bg-indigo-600 hover:bg-indigo-700 h-9",children:[(0,t.jsx)(s.Truck,{className:"w-4 h-4"}),o?"Dispatching...":"Fulfill Order"]})]})}])}]);