1 line
48 KiB
JavaScript
1 line
48 KiB
JavaScript
(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[54],{855:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(7208),r=n(76475),s=n(44414);function o(e){var t,n;let o,l,{children:a,type:c="scale",direction:d="right",offset:h=10,scale:x={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":o=h,l=0;break;default:o=0,l=h}const[p,u]=(0,i.Y)(o,l),[m,f]=(0,i.Y)(o,l);switch(c){case"rotate":return(0,s.jsx)(r.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:a});case"slide":return"up"===d||"down"===d?(0,s.jsx)(r.P.div,{animate:{y:void 0!==m?m:""},onHoverEnd:()=>f(),onHoverStart:()=>f(),children:a}):(0,s.jsx)(r.P.div,{animate:{x:void 0!==p?p:""},onHoverEnd:()=>u(),onHoverStart:()=>u(),children:a});default:return"number"===typeof x&&(x={hover:x,tap:x}),(0,s.jsx)(r.P.div,{whileHover:{scale:null===(t=x)||void 0===t?void 0:t.hover},whileTap:{scale:null===(n=x)||void 0===n?void 0:n.tap},children:a})}}},23787:(e,t,n)=>{"use strict";n.d(t,{FG:()=>p,nV:()=>h,pY:()=>u,pg:()=>x});var i=n(89379),r=n(80045),s=n(93230),o=n(2235),l=n(16491),a=n(82053),c=n(44414);const d=["children","scroll","onScroll","sx"],h=e=>{let{children:t,scroll:n=!1,onScroll:o,sx:l}=e,a=(0,r.A)(e,d);return(0,c.jsx)(s.A,(0,i.A)((0,i.A)({spacing:1.25,onScroll:o,sx:(0,i.A)((0,i.A)({p:1.5},n&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},x=e=>{let{accent:t="#662582",header:n,footer:r,selected:s=!1,onClick:a,children:d,sx:h}=e;return(0,c.jsxs)(o.A,{elevation:0,onClick:a,sx:(0,i.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:s?t:"#e2e8f0",background:s?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},h),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[n,d,r]})]})},p=e=>{let{children:t,columns:n=2,sx:r}=e;return(0,c.jsx)(l.A,{sx:(0,i.A)({display:"grid",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))"),gap:1,mt:1.25},r),children:t})},u=e=>{let{label:t,value:n,children:i,full:r=!1,align:s="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:r?"1 / -1":"auto",minWidth:0,textAlign:s},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==i?i:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==n&&void 0!==n?n:"\u2014"})})]})}},39009:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>fe});var i=n(89379),r=n(9950),s=n(26910),o=n(50847),l=n.n(o),a=n(55271),c=n(4159),d=n.n(c),h=n(28429),x=n(14857),p=n(47223),u=n(8881),m=n(55158),f=n(16491),g=n(93230),A=n(82053),v=n(25277),j=n(60899),b=n(48089),y=n(77922),S=n(29925),w=n(2046),k=n(82223),Y=n(46639),C=n(83274),z=n(25333),W=n(1320),M=n(2235),N=n(15769),P=n(69780),D=n(9213),I=n(21671),R=n(34075),H=n(96583),T=n(40033),L=n(25979),F=n(2660),E=n(74745),O=n(28170),B=n(96557),J=n(16497),V=n(93038),q=n(79739),G=n(30633),K=n(81831),Z=n(95359),U=n(7762),Q=n(87942),X=n(81419),_=n(3911),$=n(47738),ee=n(27379),te=n(90421),ne=n(94118),ie=n(88349),re=n(60767),se=n(13838),oe=n(54826),le=n(43302),ae=n(31222),ce=n(52351),de=n(94826),he=(n(855),n(23787)),xe=(n(42041),n(44414)),pe=n(36220);d().extend(pe);const ue={fontSize:11.5,fontWeight:700,color:"#475569",py:.75,px:1},me={fontSize:12,py:.6,px:1},fe=()=>{const e=(0,h.Zp)(),t=(0,x.A)(),n=(0,p.A)(t.breakpoints.down("md")),o=(0,r.useRef)(null),c=(0,r.useRef)(null),pe=localStorage.getItem("userid"),[fe,ge]=(0,r.useState)([]),[Ae,ve]=(0,r.useState)([]),[je,be]=(0,r.useState)([]),[ye,Se]=(0,r.useState)(!1),[we,ke]=(0,r.useState)(!1),[Ye,Ce]=(0,r.useState)(0),[ze,We]=(0,r.useState)(0),[Me,Ne]=(0,r.useState)(0),[Pe,De]=(0,r.useState)(null),[Ie,Re]=(0,r.useState)(null),[He,Te]=(0,r.useState)(0),[Le,Fe]=(0,r.useState)(0),[Ee,Oe]=(0,r.useState)(0),[Be,Je]=(0,r.useState)(null),[Ve,qe]=(0,r.useState)([]),[Ge,Ke]=(0,r.useState)([]),[Ze,Ue]=(0,r.useState)(!1),[Qe,Xe]=(0,r.useState)(""),[_e,$e]=(0,r.useState)(d()().format("MM-DD-YYYY")),[et,tt]=(0,r.useState)(""),[nt,it]=(0,r.useState)(null),[rt,st]=(0,r.useState)(null),[ot,lt]=(0,r.useState)(""),[at,ct]=(0,r.useState)(),[dt,ht]=(0,r.useState)(0),[xt,pt]=(0,r.useState)(0),[ut,mt]=(0,r.useState)(0),[ft,gt]=(0,r.useState)(0),[At,vt]=(0,r.useState)(null),[jt,bt]=(0,r.useState)([]),[yt,St]=(0,r.useState)(""),wt=(0,r.useRef)({}),kt=(e,t,n)=>{(0,u.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:n||1500})},Yt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;const i="".concat(t,"-").concat(e);wt.current[i]||(kt(e,t,n),wt.current[i]=!0,setTimeout((()=>delete wt.current[i]),3e3))};(0,r.useEffect)((()=>{We(0),De(null),Ne(0),Re(null),be([]),Je(null),qe([]),bt([]),vt(null),St(""),it(null),st(null),tt("")}),[Ye]),(0,r.useEffect)((()=>{Ne(0),Re(null),qe([]),bt([]),vt(null),St("")}),[ze]);(0,r.useEffect)((()=>{(async()=>{Se(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(pe));ge(e.data.details||[])}catch(e){Yt(e.message,"error",5e3)}finally{Se(!1)}})()}),[]);(0,r.useEffect)((()=>{Ye&&(async()=>{Se(!0);try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(Ye,"&status=active"));if(e.data.status){const t=(e.data.details||[]).map((e=>(0,i.A)((0,i.A)({},e),{},{label:"".concat(e.tenantname)})));ve(t)}}catch(e){Yt("Failed to load clients","warning",3e3)}finally{Se(!1)}})()}),[Ye]);(0,r.useEffect)((()=>{if(!ze)return;const e=setTimeout((()=>{(""===Qe||Qe.length>2)&&(async()=>{try{const e=""===Qe?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(ze,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(ze,"&keyword=").concat(Qe),t=await s.A.get(e);t.data.status&&Ke(t.data.details||[])}catch(e){console.log(e),kt("server error","warning")}})()}),250);return()=>clearTimeout(e)}),[Qe,ze]),(0,r.useEffect)((()=>{let e=0,t=0,n=0,i=0;Ve.forEach((r=>{e+=Number(r.distance)||0,t+=Number(r.totalcharge)||0,n+=Number(r.quantity)||0,i+=Number(r.collectionamt)||0})),ht(e),pt(t),mt(n),gt(i)}),[Ve]);const Ct=async e=>{var t,n;if("undefined"===typeof window||null===(t=window.google)||void 0===t||null===(n=t.maps)||void 0===n||!n.DistanceMatrixService)throw new Error("Google Maps not loaded");const i=new window.google.maps.DistanceMatrixService;try{var r,s,o,l,a;if(!e||"object"!==typeof e)throw new Error("Invalid customer data.");if(!Be||"object"!==typeof Be)throw new Error("Origin (pickCust) data missing or invalid.");const t=await(c=Be,d=e,new Promise(((e,t)=>{try{if(!c||!d)return t(new Error("Origin or destination data missing."));i.getDistanceMatrix({origins:[new window.google.maps.LatLng(c.latitude,c.longitude)],destinations:[new window.google.maps.LatLng(d.latitude,d.longitude)],travelMode:"DRIVING",unitSystem:window.google.maps.UnitSystem.METRIC},((n,i)=>{"OK"===i?e(n):t(new Error("Google API error: ".concat(i)))}))}catch(n){t(new Error("Unexpected error inside DistanceMatrixService: ".concat(n.message)))}}))),n=null===t||void 0===t||null===(r=t.rows)||void 0===r||null===(s=r[0])||void 0===s||null===(o=s.elements)||void 0===o||null===(l=o[0])||void 0===l||null===(a=l.distance)||void 0===a?void 0:a.value;if(null==n)throw new Error("Malformed Distance Matrix response: missing distance value.");const h=n/1e3,x=Math.round(h);return{roundedDistance:x,totalcharge:x<Ee?He:(x-Ee)*Le+He}}catch(h){throw h.message.includes("Google API")?Yt("Invalid coordinates or Google API error.","error",3e3):h.message.includes("Malformed Distance Matrix")?Yt("Google Distance Matrix returned invalid data.","error",3e3):h.message.includes("Origin")||h.message.includes("customer")?Yt("Missing or invalid input data for distance calculation.","warning",3e3):Yt("Unexpected error during distance calculation.","error",3e3),h}var c,d},zt=async e=>{let t=!1;if(qe((n=>(t=n.some((t=>t.firstname===e.firstname)),t?n.filter((t=>t.firstname!==e.firstname)):n))),!t){Se(!0);try{const{roundedDistance:t,totalcharge:n}=await Ct(e);qe((r=>r.some((t=>t.firstname===e.firstname))?r:[...r,(0,i.A)((0,i.A)({},e),{},{distance:t,totalcharge:n})]))}catch(n){console.error("Failed to calculate distance:",n)}finally{Se(!1)}}};(0,r.useEffect)((()=>{Ye&&(async()=>{try{const e=await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(Ye));if(e.data.status){const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));ct(t)}}catch(e){console.log(e)}})()}),[Ye]);const Wt=e=>null===e||void 0===e?void 0:e.toString().trim().toLowerCase().replace(/\s+/g,""),Mt={"pickupdate(yyyy-mmm-dd)":"date","sendername*":"locationname","senderphone*":"locationcontact","senderaddress*":"locationaddress","receivername*":"firstname",receiverphone:"contactno","receiveralternatephone*":"altcontactno",receiverfulladdress:"address",receiverlatitude:"latitude",receiverlongitude:"longitude","itemdescription*":"description",Quantity:"quantity"," Collect Cash":"collectionamt",customerDeliveryTime:"customerdeliverytime",kitchenPickupTime:"kitchenpickuptime"},Nt=(e,t)=>{qe((n=>n.map((n=>n.customerid===e?(0,i.A)((0,i.A)({},n),{},{quantity:Number(t)||0}):n))))},Pt=(e,t)=>{qe((n=>n.map((n=>n.customerid===e?(0,i.A)((0,i.A)({},n),{},{collectionamt:Number(t)||0}):n))))},Dt={location:!!Ye,client:!!ze,business:!!Me,schedule:!!rt,drops:Ve.length>0},It=Dt.location&&Dt.client&&Dt.business&&Dt.schedule&&Dt.drops,Rt=Ve.length>0?"drops":jt.length>0?"preview":"empty";return(0,xe.jsxs)(xe.Fragment,{children:[ye&&(0,xe.jsx)(ce.A,{}),(0,xe.jsx)(m.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:we,children:(0,xe.jsx)(de.A,{color:"inherit"})}),(0,xe.jsxs)(f.A,{className:"orders-workspace-bg",sx:{height:{xs:"auto",md:"calc(100vh - 64px)"},minHeight:{xs:"calc(100vh - 64px)",md:0},display:"flex",flexDirection:"column",overflow:{xs:"visible",md:"hidden"},p:{xs:.75,sm:1.25},gap:1},children:[(0,xe.jsxs)(g.A,{direction:"row",alignItems:"center",gap:1,flexWrap:"wrap",sx:{flexShrink:0,px:.5},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:{xs:16,sm:17},color:"#1e293b",lineHeight:1.2},children:"Create Multiple Orders"}),(0,xe.jsx)(v.A,{size:"small",label:"".concat(Ve.length," drop").concat(1===Ve.length?"":"s"),sx:{height:20,fontSize:10.5,fontWeight:700,bgcolor:Ve.length?"rgba(24,144,255,0.10)":"#f1f5f9",color:Ve.length?"#1890ff":"#94a3b8",border:"1px solid ".concat(Ve.length?"rgba(24,144,255,0.25)":"#e2e8f0")}}),(0,xe.jsx)(f.A,{sx:{flex:1}}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#94a3b8",display:{xs:"none",md:"block"}},children:"Bulk-create deliveries from CSV/Excel or saved customers."})]}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.25,sx:{flex:1,minHeight:0,overflow:{xs:"visible",md:"hidden"}},children:[(0,xe.jsxs)(j.Ay,{item:!0,xs:12,md:6,sx:{height:{xs:"auto",md:"100%"},minHeight:0,display:"flex",flexDirection:"column",gap:{xs:1.25,md:2.25},overflowY:{xs:"visible",md:"auto"},pr:{xs:0,md:.75}},children:[(0,xe.jsxs)(b.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsx)(f.A,{className:"section-title-bar",sx:{mb:1.5},children:(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Setup"})}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.75,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",ref:o,className:"header-compact-input",options:fe||[],getOptionLabel:e=>"".concat(e.locationname),onChange:(e,t,n)=>{"clear"===n?Ce(0):t&&Ce(t.applocationid)},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(le.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:Ae||[],value:Pe,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||"",isOptionEqualToValue:(e,t)=>e.tenantid===t.tenantid,onOpen:e=>{Ye||(e.preventDefault(),Yt("Please select Location first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(We(0),De(null)):t&&(We(t.tenantid),De(t),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e))).data.details||{};Te(t.baseprice||0),Fe(t.priceperkm||0),Oe(t.minkm||0)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=(await s.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e))).data.details||[];1===t.length?(be(t),Je(t[0]),Ne(t[0].locationid),Re(t[0]),it(t[0].slots)):be(t)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid))},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:c,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(oe.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:4,children:1===je.length?(0,xe.jsx)(S.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:je[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:t.palette.primary.main},startAdornment:(0,xe.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,xe.jsx)(y.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:Ie,options:je||[],getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname," (").concat(e.suburb||"",")"):"",onOpen:e=>{Ye||ze?ze||(e.preventDefault(),Yt("Please select Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),Yt("Please select Location and Client first!","warning",3e3),setTimeout((()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"!==n&&t?(Ne(t.locationid||0),Re(t),Je(t),it(null===t||void 0===t?void 0:t.slots)):(Ne(0),Re(null),Je(null),it(null))},renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{size:"small",placeholder:"Business Location",label:"Business Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,xe.jsxs)(b.A,{className:"orders-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsx)(f.A,{className:"section-title-bar section-title-bar--accent",sx:{mb:1.5},children:(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"Schedule & Pickup"})}),(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.75,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:6,children:(0,xe.jsx)(K.$,{dateAdapter:Z.R,children:(0,xe.jsx)(G.l,{label:"Pickup Date",format:"DD-MM-YYYY",value:_e?d()(_e):null,onChange:e=>{if(!e||!d()(e).isValid())return void $e(d()().format("MM-DD-YYYY"));d()().diff(d()("".concat(d()(e).format("YYYY-MM-DD"))),"d")<=0?($e(d()(e).format("MM-DD-YYYY")),tt(""),st(null)):(kt("Choose an upcoming date","warning"),$e(d()().format("MM-DD-YYYY")))},disablePast:!0,slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:(0,xe.jsx)(X.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px",paddingLeft:"10px"}}}}})})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,sm:6,children:(0,xe.jsx)(y.A,{size:"small",fullWidth:!0,options:nt||[],sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},onChange:(e,t,n)=>{if("clear"===n||!t)return tt(null),void st(null);if(!t.time)return void Yt("This slot has no time configured.","warning",3e3);const i=d()(t.time,"HH:mm").format("hh:mm A");tt(i);const r=d()("".concat(_e," ").concat(i),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");st(r)},getOptionLabel:e=>e?"".concat(e.name," (").concat(d()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,xe.jsx)(S.A,(0,i.A)((0,i.A)({},e),{},{label:"Pickup Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",height:"36px"}},InputProps:(0,i.A)((0,i.A)({},e.InputProps),{},{startAdornment:(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(_.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,children:Be?(0,xe.jsxs)(g.A,{direction:"row",spacing:1.25,alignItems:"center",sx:{border:"1px solid #eef2f6",borderLeft:"3px solid #1890ff",borderRadius:"10px",px:1.25,py:.75,bgcolor:"#fbfcff"},children:[(0,xe.jsx)(f.A,{sx:{width:28,height:28,borderRadius:"8px",background:"linear-gradient(135deg,#1890ff,#096dd9)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:12,boxShadow:"0 4px 10px rgba(24,144,255,0.30)"},children:(0,xe.jsx)(le.sIY,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontSize:12.5,fontWeight:700,color:"#1e293b",lineHeight:1.2},noWrap:!0,children:Be.locationname||"\u2014"}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#64748b",lineHeight:1.3},noWrap:!0,children:Be.address||"\u2014"})]})]}):(0,xe.jsx)(A.A,{sx:{color:"#94a3b8",fontSize:12},children:"Pickup auto-fills once a Business Location is selected."})})]})]}),(0,xe.jsxs)(b.A,{className:"orders-card delivery-prefs-card",sx:{p:2,flexShrink:0},children:[(0,xe.jsxs)(f.A,{className:"delivery-prefs-header",sx:{mb:1},children:[(0,xe.jsx)(A.A,{className:"delivery-prefs-title",children:"Order Notes"}),(0,xe.jsx)(A.A,{className:"delivery-prefs-sub",children:"Applied to every order"})]}),(0,xe.jsx)(f.A,{className:"delivery-prefs-row",children:(0,xe.jsxs)(f.A,{className:"delivery-prefs-field",sx:{width:"100%"},children:[(0,xe.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"bulk-dispatch-notes-input",children:[(0,xe.jsx)($.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,xe.jsx)(S.A,{id:"bulk-dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:ot,onChange:e=>lt(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]})})]}),(0,xe.jsxs)(b.A,{className:"orders-card pricing-summary-card",sx:{flexShrink:0,p:"16px 18px !important"},children:[(0,xe.jsxs)(f.A,{className:"pricing-header",sx:{mb:1.5,pb:1},children:[(0,xe.jsx)(A.A,{className:"pricing-title",sx:{fontSize:"13px !important"},children:"Bulk Summary"}),(0,xe.jsx)(A.A,{className:"pricing-subtitle",sx:{fontSize:"10px !important"},children:"Live totals"})]}),(()=>{const e=e=>{let{icon:t,label:n,value:r,accent:s,active:o}=e;return(0,xe.jsxs)(f.A,{sx:(0,i.A)({bgcolor:"#fff",border:"1px solid #eef2f6",borderRadius:"10px",px:1,py:.75,display:"flex",alignItems:"center",gap:.85,minWidth:0,transition:"border-color 0.2s, box-shadow 0.2s"},o&&{borderColor:"".concat(s,"55"),boxShadow:"0 2px 6px -2px ".concat(s,"33")}),children:[(0,xe.jsx)(f.A,{sx:{width:26,height:26,borderRadius:"8px",bgcolor:"".concat(s,"18"),color:s,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,flexShrink:0},children:(0,xe.jsx)(t,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontSize:9.5,fontWeight:600,color:"#94a3b8",letterSpacing:.4,textTransform:"uppercase",lineHeight:1},children:n}),(0,xe.jsx)(A.A,{sx:{fontSize:13.5,fontWeight:800,color:o?"#1e293b":"#94a3b8",lineHeight:1.2,mt:.25},noWrap:!0,children:r})]})]})};return(0,xe.jsxs)(j.Ay,{container:!0,spacing:1.25,children:[(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.$Fg,label:"Distance",value:dt?"".concat(dt," km"):"\u2014",accent:"#1890ff",active:!!dt})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.H5e,label:"Quantity",value:ut||0,accent:"#16a34a",active:!!ut})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.MxO,label:"Cash Collect",value:"\u20b9".concat(Number(ft).toFixed(2)),accent:"#d97706",active:!!ft})}),(0,xe.jsx)(j.Ay,{item:!0,xs:6,children:e({icon:oe.dv1,label:"Deliveries",value:Ve.length,accent:"#65387a",active:Ve.length>0})})]})})(),Ve.length>0&&(0,xe.jsxs)("div",{className:"total-charge-badge",style:{marginTop:14,padding:"10px 14px"},children:[(0,xe.jsxs)("div",{className:"total-charge-left",children:[(0,xe.jsx)(oe.wTh,{className:"total-charge-icon"}),(0,xe.jsx)("div",{className:"total-charge-label",children:"Total Charge"})]}),(0,xe.jsxs)("div",{className:"total-charge-val",style:{fontSize:17},children:["\u20b9",Number(xt).toFixed(2)]})]}),(0,xe.jsx)(f.A,{sx:{mt:1.75},children:(0,xe.jsx)(k.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!It||we,startIcon:!we&&(0,xe.jsx)(oe.Cer,{style:{fontSize:11}}),onClick:async()=>{if(!ze)return void kt("Choose Client","warning");if(!Be)return void kt("Pickup location required","warning");if(!rt)return void kt("Select a pickup slot","warning");if(!Ve.length)return void kt("Add at least one drop customer","warning");const t=(()=>{if(rt){const e=d()(rt,["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}if(_e&&et){const e=d()("".concat(d()(_e).format("YYYY-MM-DD")," ").concat(et),["YYYY-MM-DD hh:mm A","YYYY-MM-DD HH:mm:ss"]);if(e.isValid())return e.format("YYYY-MM-DD HH:mm:ss")}return d()().format("YYYY-MM-DD HH:mm:ss")})(),n=Ve.map((e=>{var n,i,r,s;return{applocationid:Be.applocationid,configid:9,partnerid:Be.partnerid,partneruserid:+pe,paymentstatus:1,paymenttype:42,pickupaddress:Be.address||"",pickupcity:Be.city||"",pickupcontactno:Be.contactno||"",pickupcustomer:Be.locationname||"",pickuplandmark:Be.landmark||"",pickuplat:Be.latitude,pickuplocation:Be.suburb||"",pickuplocationid:Be.locationid||0,pickuplong:Be.longitude,tenantid:Be.tenantid,customerid:+(null===e||void 0===e?void 0:e.customerid),deliveryaddress:e.address||"",deliverycharge:+e.totalcharge||0,deliverycity:e.city||"",deliverycontactno:(null===(n=e.contactno)||void 0===n?void 0:n.toString())||"",deliverycustomer:e.firstname||"",deliveryid:+e.customerid,deliverylandmark:e.landmark||"",deliverylat:(null===(i=e.latitude)||void 0===i?void 0:i.toString())||"",deliverylocation:e.suburb||"",deliverylocationid:e.deliverylocationid||0,deliverylong:(null===(r=e.longitude)||void 0===r?void 0:r.toString())||"",deliverytime:t,deliverytype:"B",itemcount:1,quantity:e.quantity,collectionamt:e.collectionamt,kms:(null===(s=e.distance)||void 0===s?void 0:s.toString())||"0",locationid:+Be.locationid,moduleid:+Be.moduleid,orderamount:+e.totalcharge||0,ordercharges:0,orderdate:d()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:ot,orderstatus:"created",ordervalue:+e.totalcharge||0,pickupSlot:rt}}));Se(!0),ke(!0);try{const t=await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/orders/createorders"),n);var i;if(t.data.status)kt("Orders Created Successfully","success",2e3),at&&(async()=>{try{"Success"===(await s.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:at,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully, kindly process the same",sound:"ring"}})).data.message&&kt("Notification sent Successfully","success",1e3)}catch(e){kt(e.message,"error",1e3)}})(),e("/nearle/orders");else kt((null===t||void 0===t||null===(i=t.data)||void 0===i?void 0:i.message)||"Order creation failed. Please try again.","warning",3e3)}catch(o){let e="Something went wrong. Please try again.";var r;if(o.response)e=(null===(r=o.response.data)||void 0===r?void 0:r.message)||"Server error (".concat(o.response.status,")");else o.request&&(e="Network error. Check your internet connection.");kt(e,"error",3e3)}finally{Se(!1),ke(!1)}},sx:{minHeight:"36px !important"},children:we?(0,xe.jsx)(Y.A,{color:"inherit",size:16,thickness:5}):"Dispatch ".concat(Ve.length||""," ").concat(1===Ve.length?"Order":"Orders").trim()})})]})]}),(0,xe.jsx)(j.Ay,{item:!0,xs:12,md:6,sx:{height:{xs:"auto",md:"100%"},minHeight:0,display:"flex",flexDirection:"column"},children:(0,xe.jsxs)(b.A,{className:"orders-card",sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",p:1.25,maxHeight:{xs:"none",md:685}},children:[(0,xe.jsxs)(g.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{mb:.75,flexShrink:0},children:[(0,xe.jsxs)(f.A,{className:"section-title-bar",sx:{mb:0},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:13.5,letterSpacing:"-0.01em"},children:"drops"===Rt?"Drop List":"preview"===Rt?"File Preview":"Preview"}),(0,xe.jsx)(v.A,{size:"small",label:"drops"===Rt?Ve.length:"preview"===Rt?jt.length:0,sx:{height:20,fontSize:10.5,fontWeight:700,ml:1,bgcolor:"rgba(168,85,247,0.10)",color:"#65387a",border:"1px solid rgba(168,85,247,0.25)"}})]}),"drops"===Rt&&(0,xe.jsx)(v.A,{size:"small",label:"\u20b9".concat(Number(xt).toFixed(2)," total"),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(101,56,122,0.10)",color:"#65387a",border:"1px solid rgba(101,56,122,0.25)"}}),"preview"===Rt&&(0,xe.jsx)(v.A,{size:"small",label:"Awaiting Continue",icon:(0,xe.jsx)(ee.A,{style:{fontSize:11}}),sx:{height:22,fontWeight:700,fontSize:11,bgcolor:"rgba(245,158,11,0.12)",color:"#b45309",border:"1px solid rgba(245,158,11,0.30)","& .MuiChip-icon":{color:"#b45309"}}}),"empty"!==Rt&&(()=>{const e=Ye&&ze&&Me,t=t=>{var n;e?(vt(t),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ue(!0),Xe(""))):Yt("Please select Location, Client, and Business Location first.","warning",3e3)};return(0,xe.jsxs)(g.A,{direction:"row",gap:.75,alignItems:"center",children:[(0,xe.jsx)(k.A,{size:"small",variant:"outlined",onClick:()=>t(0),startIcon:(0,xe.jsx)(ae.CtR,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#1890ff",color:"#1890ff"}},children:"Excel / CSV"}),(0,xe.jsx)(k.A,{size:"small",variant:"outlined",onClick:()=>t(1),startIcon:(0,xe.jsx)(oe.YXz,{}),sx:{height:24,py:0,textTransform:"none",borderRadius:"6px",fontSize:10.5,fontWeight:600,borderColor:"#cbd5e1",color:"#475569","&:hover":{borderColor:"#65387a",color:"#65387a"}},children:"Selection"})]})})()]}),yt&&(0,xe.jsxs)(g.A,{direction:"row",gap:.75,alignItems:"center",sx:{mb:.75,color:"#64748b",flexShrink:0},children:[(0,xe.jsx)(te.A,{style:{fontSize:12}}),(0,xe.jsx)(A.A,{sx:{fontSize:11.5},noWrap:!0,children:yt})]}),"preview"===Rt&&jt.length>=1&&(0,xe.jsxs)(f.A,{sx:{mb:1,p:1.25,bgcolor:"rgba(245,158,11,0.06)",border:"1.5px solid rgba(245,158,11,0.25)",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexShrink:0,animation:"blink 1.5s infinite","@keyframes blink":{"0%":{borderColor:"rgba(245,158,11,0.25)"},"50%":{borderColor:"rgba(245,158,11,0.6)"},"100%":{borderColor:"rgba(245,158,11,0.25)"}}},children:[(0,xe.jsxs)(f.A,{sx:{textAlign:"left"},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:12,color:"#b45309",lineHeight:1.2},children:"Process & Calculate Distances"}),(0,xe.jsx)(A.A,{sx:{color:"#b45309",opacity:.8,fontSize:10.5,lineHeight:1.25},children:"Click continue to import spreadsheet rows and calculate drop charges."})]}),(0,xe.jsx)(k.A,{variant:"contained",size:"small",color:"warning",onClick:()=>jt.forEach((e=>zt(e))),sx:{textTransform:"none",borderRadius:"8px",fontWeight:700,fontSize:11,height:28,px:1.5,bgcolor:"#d97706",boxShadow:"none","&:hover":{bgcolor:"#b45309",boxShadow:"none"}},children:"Continue"})]}),(0,xe.jsxs)(f.A,{sx:{flex:1,minHeight:0,overflow:"auto"},children:["drops"===Rt&&n&&(0,xe.jsxs)(he.nV,{sx:{p:0},children:[Ve.map(((e,t)=>{var n;return(0,xe.jsx)(he.pg,{accent:"#65387a",header:(0,xe.jsxs)(g.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:700,color:"#1e293b",lineHeight:1.2},children:[t+1,". ",e.firstname]}),(0,xe.jsx)(A.A,{sx:{fontSize:12,color:"#64748b",mt:.25},children:e.address})]}),(0,xe.jsx)(C.A,{title:"Remove",children:(0,xe.jsx)(z.A,{size:"small",onClick:()=>zt(e),sx:{color:"#ef4444",p:.5,flexShrink:0},children:(0,xe.jsx)(ne.A,{style:{fontSize:14}})})})]}),children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Qty",children:0===At?(0,xe.jsx)(A.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},children:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.quantity||"",onChange:t=>Nt(e.customerid,t.target.value),inputProps:{min:0},fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"8px",height:34}}})}),(0,xe.jsx)(he.pY,{label:"Cash",children:0===At?(0,xe.jsx)(A.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},children:"\u20b9".concat(Number(e.collectionamt||0).toFixed(2))}):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.collectionamt?e.collectionamt:"",placeholder:"0",onChange:t=>{const n=Number(t.target.value);Pt(e.customerid,n>0?n:0)},inputProps:{min:0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:"\u20b9"})},fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"8px",height:34}}})}),(0,xe.jsx)(he.pY,{label:"Km",value:e.distance}),(0,xe.jsx)(he.pY,{label:"Charge",align:"right",children:(0,xe.jsxs)(A.A,{sx:{fontSize:13,fontWeight:700,color:"#1e293b"},children:["\u20b9",Number((null===e||void 0===e?void 0:e.totalcharge)||0).toFixed(2)]})})]})},e.customerid||e.firstname||t)})),(0,xe.jsx)(he.pg,{accent:"#65387a",sx:{bgcolor:"#fafbfc"},children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Total Qty",value:ut}),(0,xe.jsx)(he.pY,{label:"Total Cash",value:"\u20b9".concat(Number(ft).toFixed(2))}),(0,xe.jsx)(he.pY,{label:"Total Km",value:dt}),(0,xe.jsx)(he.pY,{label:"Total Charge",align:"right",children:(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:800,color:"#65387a"},children:["\u20b9",Number(xt).toFixed(2)]})})]})})]}),"drops"===Rt&&!n&&(0,xe.jsx)(W.A,{component:M.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,xe.jsxs)(N.A,{size:"small",stickyHeader:!0,children:[(0,xe.jsx)(P.A,{sx:{bgcolor:"#f8fafc"},children:(0,xe.jsxs)(D.A,{children:[(0,xe.jsx)(I.A,{sx:ue,children:"#"}),(0,xe.jsx)(I.A,{sx:ue,children:"Customer"}),(0,xe.jsx)(I.A,{sx:ue,children:"Address"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Qty"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Cash"}),(0,xe.jsx)(I.A,{sx:ue,children:"Km"}),(0,xe.jsx)(I.A,{sx:ue,align:"right",children:"Charge"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:" "})]})}),(0,xe.jsxs)(R.A,{children:[Ve.map(((e,t)=>(0,xe.jsxs)(D.A,{hover:!0,children:[(0,xe.jsx)(I.A,{sx:me,children:t+1}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{color:"#64748b",maxWidth:220}),children:(0,xe.jsx)(C.A,{title:e.address||"",children:(0,xe.jsx)("span",{style:{display:"inline-block",maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address})})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:0===At?e.quantity:(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.quantity||"",onChange:t=>Nt(e.customerid,t.target.value),inputProps:{min:0},sx:{width:64,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:0===At?"\u20b9".concat(Number(e.collectionamt||0).toFixed(2)):(0,xe.jsx)(S.A,{size:"small",type:"number",value:e.collectionamt?e.collectionamt:"",placeholder:"0",onChange:t=>{const n=Number(t.target.value);Pt(e.customerid,n>0?n:0)},inputProps:{min:0},InputProps:{startAdornment:(0,xe.jsx)(w.A,{position:"start",children:"\u20b9"})},sx:{width:90,"& .MuiOutlinedInput-root":{borderRadius:"8px",height:30}}})}),(0,xe.jsx)(I.A,{sx:me,children:e.distance}),(0,xe.jsxs)(I.A,{align:"right",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:700,color:"#1e293b"}),children:["\u20b9",Number((null===e||void 0===e?void 0:e.totalcharge)||0).toFixed(2)]}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:(0,xe.jsx)(C.A,{title:"Remove",children:(0,xe.jsx)(z.A,{size:"small",onClick:()=>zt(e),sx:{color:"#ef4444",p:.5},children:(0,xe.jsx)(ne.A,{style:{fontSize:13}})})})})]},e.customerid||e.firstname||t))),(0,xe.jsxs)(D.A,{sx:{bgcolor:"#fafbfc"},children:[(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:"Total"}),(0,xe.jsx)(I.A,{colSpan:2,sx:me}),(0,xe.jsx)(I.A,{align:"center",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:ut}),(0,xe.jsxs)(I.A,{align:"center",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:["\u20b9",Number(ft).toFixed(2)]}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800}),children:dt}),(0,xe.jsxs)(I.A,{align:"right",sx:(0,i.A)((0,i.A)({},me),{},{fontWeight:800,color:"#65387a"}),children:["\u20b9",Number(xt).toFixed(2)]}),(0,xe.jsx)(I.A,{sx:me})]})]})]})}),"preview"===Rt&&n&&(0,xe.jsx)(he.nV,{sx:{p:0},children:jt.map(((e,t)=>{var n;return(0,xe.jsx)(he.pg,{accent:"#d97706",header:(0,xe.jsxs)(f.A,{sx:{minWidth:0},children:[(0,xe.jsxs)(A.A,{sx:{fontSize:14,fontWeight:700,color:"#1e293b",lineHeight:1.2},children:[t+1,". ",e.firstname||"\u2014"]}),(0,xe.jsx)(A.A,{sx:{fontSize:12,color:"#64748b",mt:.25},children:e.address||"\u2014"})]}),children:(0,xe.jsxs)(he.FG,{columns:2,children:[(0,xe.jsx)(he.pY,{label:"Contact",value:e.contactno||"\u2014"}),(0,xe.jsx)(he.pY,{label:"Qty",value:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}),(0,xe.jsx)(he.pY,{label:"Cash",value:null!=e.collectionamt?"\u20b9".concat(Number(e.collectionamt).toFixed(2)):"\u2014"})]})},t)}))}),"preview"===Rt&&!n&&(0,xe.jsx)(W.A,{component:M.A,sx:{borderRadius:"10px",border:"1px solid #eef2f6",boxShadow:"none"},children:(0,xe.jsxs)(N.A,{size:"small",stickyHeader:!0,children:[(0,xe.jsx)(P.A,{sx:{bgcolor:"#f8fafc"},children:(0,xe.jsxs)(D.A,{children:[(0,xe.jsx)(I.A,{sx:ue,children:"#"}),(0,xe.jsx)(I.A,{sx:ue,children:"Name"}),(0,xe.jsx)(I.A,{sx:ue,children:"Contact"}),(0,xe.jsx)(I.A,{sx:ue,children:"Address"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Qty"}),(0,xe.jsx)(I.A,{sx:ue,align:"center",children:"Cash"})]})}),(0,xe.jsx)(R.A,{children:jt.map(((e,t)=>{var n;return(0,xe.jsxs)(D.A,{hover:!0,children:[(0,xe.jsx)(I.A,{sx:me,children:t+1}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{whiteSpace:"nowrap",color:"#1e293b",fontWeight:600}),children:e.firstname||"\u2014"}),(0,xe.jsx)(I.A,{sx:me,children:e.contactno||"\u2014"}),(0,xe.jsx)(I.A,{sx:(0,i.A)((0,i.A)({},me),{},{color:"#64748b",maxWidth:240}),children:(0,xe.jsx)(C.A,{title:e.address||"",children:(0,xe.jsx)("span",{style:{display:"inline-block",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",verticalAlign:"middle"},children:e.address||"\u2014"})})}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:null!==(n=e.quantity)&&void 0!==n?n:"\u2014"}),(0,xe.jsx)(I.A,{align:"center",sx:me,children:null!=e.collectionamt?"\u20b9".concat(Number(e.collectionamt).toFixed(2)):"\u2014"})]},t)}))})]})}),"empty"===Rt&&(()=>{const e=Ye&&ze&&Me,t=t=>{var n;e?(vt(t),qe([]),bt([]),St(""),0===t?null===(n=document.getElementById("upload-file"))||void 0===n||n.click():1===t&&(Ue(!0),Xe(""))):Yt("Please select Location, Client, and Business Location first.","warning",3e3)},n=n=>{let{value:i,icon:r,title:s,sub:o,accent:l}=n;return(0,xe.jsxs)(f.A,{role:"button",tabIndex:0,onClick:()=>t(i),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t(i))},sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",textAlign:"left",gap:1.25,px:1.5,py:1.25,borderRadius:"10px",border:"1.5px solid #eef2f6",bgcolor:"#fff",opacity:e?1:.6,cursor:e?"pointer":"not-allowed",transition:"all 0.18s ease","&:hover":e?{borderColor:l,boxShadow:"0 4px 12px -4px ".concat(l,"40"),transform:"translateY(-1px)"}:void 0},children:[(0,xe.jsx)(f.A,{sx:{width:32,height:32,borderRadius:"8px",background:"".concat(l,"15"),color:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:15,flexShrink:0},children:(0,xe.jsx)(r,{})}),(0,xe.jsxs)(f.A,{sx:{minWidth:0,flex:1},children:[(0,xe.jsx)(A.A,{sx:{fontWeight:700,fontSize:13,color:"#1e293b",lineHeight:1.15},children:s}),(0,xe.jsx)(A.A,{sx:{fontSize:11,color:"#94a3b8",lineHeight:1.25},noWrap:!0,children:o})]})]})};return(0,xe.jsxs)(g.A,{alignItems:"center",justifyContent:"center",spacing:1.5,sx:{height:"100%",minHeight:240,bgcolor:"rgba(24,144,255,0.03)",border:"1px dashed rgba(24,144,255,0.25)",borderRadius:"12px",p:3,textAlign:"center"},children:[(0,xe.jsx)(f.A,{sx:{width:56,height:56,borderRadius:"14px",bgcolor:"rgba(24,144,255,0.08)",color:"#1890ff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:28},children:(0,xe.jsx)(ie.A,{})}),(0,xe.jsx)(A.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:14},children:"Choose a Drop Source to begin"}),(0,xe.jsx)(A.A,{sx:{color:"#64748b",fontSize:12,maxWidth:360,mb:1},children:"Select a source from below or the left panel to import or pick your delivery customers."}),(0,xe.jsxs)(g.A,{direction:{xs:"column",sm:"row"},gap:1.5,sx:{width:"100%",maxWidth:480,mt:1},children:[n({value:0,icon:ae.CtR,title:"Excel / CSV",sub:"Bulk upload a sheet",accent:"#1890ff"}),n({value:1,icon:oe.YXz,title:"Selection",sub:"Pick saved customers",accent:"#65387a"})]})]})})()]})]})})]})]}),(0,xe.jsx)("input",{accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",id:"upload-file",type:"file",hidden:!0,onChange:e=>{const t=e.target.files[0];if(!t)return;const n=t.name.replace(/\.[^/.]+$/,"");St((e=>e?"".concat(e,", ").concat(n):n)),(e=>{try{var t;const n=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!n)return void kt("No file selected.","warning");const i=n.name.toLowerCase(),r=i.endsWith(".csv"),s=i.endsWith(".xls")||i.endsWith(".xlsx");if(!r&&!s)return void kt("Invalid file type. Please upload a CSV or Excel file.","warning");const o=(e,t)=>{const n={};for(const s in Mt)n[Wt(s)]=Mt[s];const i=e.map((e=>{const t={};for(const r in e){const s=Wt(r),o=n[s]||s;let l=e[r];"firstname"===o&&(l="string"===typeof(i=l)?i.replace(/^[\d.\s]+/,"").trim():i),t[o]=l}var i;return t})),r=Object.keys(Mt).filter((e=>e.trim().endsWith("*"))).filter((e=>!t.includes(Wt(e))));if(r.length>0)return kt("Missing required columns: ".concat(r.join(", ")),"warning",3e3),void bt([]);bt(i),kt("File uploaded successfully","success",2e3),kt("Press Continue to add as drop customers","info",2500)};if(r&&l().parse(n,{header:!0,dynamicTyping:!0,skipEmptyLines:!0,complete:e=>{var t;if(null===(t=e.data)||void 0===t||!t.length)return kt("CSV file is empty or has no valid rows.","warning"),void bt([]);const n=e.meta.fields.map(Wt);o(e.data,n)},error:e=>kt("CSV parsing failed: ".concat(e.message),"warning")}),s){const e=new FileReader;e.onload=e=>{try{const t=e.target.result,n=a.LF(t,{type:"binary"}),i=n.SheetNames[0],r=n.Sheets[i],s=a.Wp.sheet_to_json(r,{defval:""});if(null===s||void 0===s||!s.length)return kt("Excel file is empty or invalid.","warning"),void bt([]);const l=Object.keys(s[0]).map(Wt);o(s,l)}catch(t){kt("Error reading Excel: ".concat(t.message),"warning")}},e.readAsBinaryString(n)}}catch(n){kt("Unexpected error: ".concat(n.message),"warning")}})(e)}}),(0,xe.jsxs)(H.A,{open:Ze,onClose:()=>Ue(!1),fullWidth:!0,fullScreen:n,sx:{"& .MuiDialog-paper":{borderRadius:{xs:0,sm:"16px"},overflow:"hidden"}},children:[(0,xe.jsx)(T.A,{sx:{bgcolor:t.palette.primary.main,color:"white",py:2.5},children:(0,xe.jsxs)(g.A,{spacing:1.5,children:[(0,xe.jsx)(A.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Drop Customers (".concat(Ve.length||0,")")}),(0,xe.jsx)(L.A,{sx:{width:"100%"},children:(0,xe.jsx)(F.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address\u2026",value:Qe,onChange:e=>Xe(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,xe.jsx)(w.A,{position:"start",children:(0,xe.jsx)(re.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,xe.jsx)(z.A,{sx:{visibility:Qe?"visible":"hidden",p:.5},onClick:()=>Xe(""),children:(0,xe.jsx)(U.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,xe.jsx)(E.A,{}),(0,xe.jsx)(O.A,{sx:{p:2.5,bgcolor:"#fafbfc",minHeight:400,maxHeight:{xs:"none",sm:600}},children:0===(null===Ge||void 0===Ge?void 0:Ge.length)?(0,xe.jsx)(g.A,{alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,xe.jsx)(se.A,{description:"No saved customers found for this client"})}):(0,xe.jsx)(g.A,{spacing:0,children:null===Ge||void 0===Ge?void 0:Ge.map(((e,t)=>{const n=Ve.some((t=>t.customerid===e.customerid));return(0,xe.jsx)(B.A,{children:(0,xe.jsx)(J.A,{sx:{m:0,py:1,px:1.25,borderRadius:"10px","&:hover":{bgcolor:"rgba(24,144,255,0.04)"}},control:(0,xe.jsx)(V.A,{checked:n,onChange:t=>(async(e,t)=>{Se(!0);try{if(e.target.checked){const{roundedDistance:e,totalcharge:n}=await Ct(t);qe((r=>[...r,(0,i.A)((0,i.A)({},t),{},{distance:e,totalcharge:n})]))}else qe((e=>e.filter((e=>e.customerid!==t.customerid))))}catch(n){console.error("Failed to calculate distance:",n)}finally{Se(!1)}})(t,e)}),label:(0,xe.jsxs)(f.A,{sx:{width:"100%"},children:[(0,xe.jsxs)(A.A,{sx:{fontWeight:600,color:"#1e293b",fontSize:13.5},children:[e.firstname," (",e.contactno,")"]}),(0,xe.jsx)(A.A,{sx:{color:"#64748b",fontSize:12,mt:.25},children:e.address})]})})},e.customerid||t)}))})}),(0,xe.jsx)(E.A,{}),(0,xe.jsx)(q.A,{sx:{p:2,bgcolor:"#fafbfc"},children:(0,xe.jsx)(k.A,{variant:"outlined",color:0===Ve.length?"error":"primary",onClick:()=>Ue(!1),sx:{borderRadius:"10px",textTransform:"none",fontWeight:600,px:3},children:0===Ve.length?"Close":"Continue"})})]})]})}},42041:()=>{},62217:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUja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HWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},83686:()=>{},94826:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var i=n(59254),r=n(46639),s=n(62217),o=n(44414);const l=(0,i.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),a=(0,i.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),c=()=>(0,o.jsxs)(l,{children:[(0,o.jsx)(r.A,{color:"primary",size:80,thickness:6}),(0,o.jsx)(a,{children:(0,o.jsx)("img",{src:s,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); |