"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8597],{68597:function(e,r,n){n.r(r),n.d(r,{default:function(){return ve}});var o=n(74165),i=n(15861),t=n(29439),s=n(47313),c=n(56573),l=n(41962),a=n(48119),d=n(61113),x=n(57829),h=n(70501),u=n(42832),p=n(61689),g=n(69099),j=n(9019),f=n(84488),Z=n(54882),m=n(47131),b=n(51629),v=n(66835),w=n(23477),y=n(24076),D=n(67478),S=n(57861),k=n(65033),z=n(94469),C=n(96467),W=n(22539),R=n(10658),M=n.n(R),I=n(25223),Y=n(99004),A=n(59376),L=n(34605),B=n(78392),P=n(41156),N=n(98589),F=n(79254),T=n(11577),E=n(19860),H=n(71049),K=n(46417),O=n(91635);M().extend(O);var U="0 14px 40px rgba(15, 23, 42, 0.10)",_="0 8px 24px rgba(15, 23, 42, 0.08)",q="#0f172a",V="#64748b",G="#94a3b8",Q="#e2e8f0",J="#f1f5f9",X="#f8fafc",$=function(e,r){return"".concat(e).concat(r)},ee=function(e){return $(e,"08")},re=function(e){return $(e,"18")},ne=function(e){return $(e,"26")},oe=function(e){return $(e,"55")},ie="#662582",te="#9255AB",se="#f59e0b",ce="#0ea5e9",le="#6366f1",ae="#06b6d4",de="#8b5cf6",xe="#14b8a6",he="#f97316",ue="#ef4444",pe="#10b981",ge="#f59e0b",je="#ef4444",fe="#10b981",Ze=function(e){var r=e.color,n=e.selected,o=e.size,i=void 0===o?24:o,t=e.children;return(0,K.jsx)(a.Z,{sx:{width:i,height:i,bgcolor:n?r:re(r),color:n?"#fff":r,transition:"background-color 0.15s, color 0.15s"},children:t})},me=function(e){var r=e.value,n=e.color,o=e.icon,i=e.isMoney,t=void 0!==i&&i,s=e.minWidth,c=Number(r),l=t?be(c):Number.isFinite(c)?c:r||0;return!Number.isFinite(c)||0===c?(0,K.jsx)(d.Z,{variant:"caption",sx:{color:G,fontWeight:700},children:l}):(0,K.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:ee(n),border:"1px solid ".concat(oe(n)),color:n,fontSize:12,fontWeight:800,whiteSpace:"nowrap",minWidth:s},children:[o,l]})};function be(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e||0)}function ve(){(0,E.Z)();var e=localStorage.getItem("tenantid"),r=(0,s.useState)(M()().format("YYYY-MM-DD")),n=(0,t.Z)(r,2),R=n[0],O=n[1],$=(0,s.useState)(M()().format("YYYY-MM-DD")),ve=(0,t.Z)($,2),we=ve[0],ye=ve[1],De=(0,s.useState)(!1),Se=(0,t.Z)(De,2),ke=Se[0],ze=Se[1],Ce=(0,s.useState)("Today"),We=(0,t.Z)(Ce,2),Re=We[0],Me=We[1],Ie=(0,s.useState)([]),Ye=(0,t.Z)(Ie,2),Ae=Ye[0],Le=Ye[1],Be=(0,s.useState)(null),Pe=(0,t.Z)(Be,2),Ne=Pe[0],Fe=Pe[1],Te=(0,s.useState)(""),Ee=(0,t.Z)(Te,2),He=Ee[0],Ke=Ee[1],Oe=(0,s.useState)(""),Ue=(0,t.Z)(Oe,2),_e=Ue[0],qe=Ue[1],Ve=(0,s.useRef)(null);(0,s.useEffect)((function(){var e=setTimeout((function(){return qe(He)}),350);return function(){return clearTimeout(e)}}),[He]),(0,s.useEffect)((function(){var e=function(e){"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),Ve.current&&Ve.current.focus()),"Escape"===e.key&&document.activeElement===Ve.current&&Ve.current.blur()};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}),[]);var Ge=(0,l.a)({queryKey:[e,R,we],queryFn:H.RQ}),Qe=Ge.isLoading,Je=Ge.isError,Xe=Ge.data,$e=Ge.error,er=function(){var r=(0,i.Z)((0,o.Z)().mark((function r(n){var i;return(0,o.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,c.Z.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationreportsummary/?&fromdate=").concat(R,"&todate=").concat(we,"&userid=").concat(n,"&tenantid=").concat(e));case 3:i=r.sent,Le(i.data.details||[]),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),console.log("tenantRes",r.t0);case 10:case"end":return r.stop()}}),r,null,[[0,7]])})));return function(e){return r.apply(this,arguments)}}();if(Je)return"An error has occurred:(isErrorReports) "+$e.message;var rr=(Xe||[]).filter((function(e){var r=_e.trim().toLowerCase();return!r||(String(e.firstname||"").toLowerCase().includes(r)||String(e.lastname||"").toLowerCase().includes(r)||String(e.userid||"").toLowerCase().includes(r))})),nr=rr.reduce((function(e,r){return e.deliveries+=Number(r.totalorders||0),e.pending+=Number(r.pending||0),e.delivered+=Number(r.delivered||0),e.charges+=Number(r.deliveryamt||0),e}),{deliveries:0,pending:0,delivered:0,charges:0}),or=[{key:"riders",label:"Riders",color:ie,icon:W.te,value:rr.length},{key:"deliveries",label:"Deliveries",color:ce,icon:W.ili,value:nr.deliveries},{key:"pending",label:"Pending",color:se,icon:W.Ley,value:nr.pending},{key:"delivered",label:"Delivered",color:pe,icon:W.ZSR,value:nr.delivered}];return(0,K.jsxs)(K.Fragment,{children:[Qe&&(0,K.jsx)(T.Z,{}),(0,K.jsx)(h.Z,{elevation:0,sx:{mb:{xs:1,md:1.25},px:{xs:1.5,sm:2},py:{xs:1,sm:1.25},borderRadius:2,border:"1px solid",borderColor:Q,background:"linear-gradient(135deg, ".concat(ee(ie)," 0%, ").concat(ee(te)," 100%)"),boxShadow:_},children:(0,K.jsxs)(u.Z,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1,sm:1.5},children:[(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1.25,children:[(0,K.jsx)(a.Z,{variant:"rounded",sx:{width:36,height:36,bgcolor:ie,color:"#fff",borderRadius:1.5,boxShadow:"0 4px 12px ".concat(ne(ie))},children:(0,K.jsx)(W.te,{size:19})}),(0,K.jsxs)(u.Z,{spacing:.125,children:[(0,K.jsx)(d.Z,{variant:"h3",sx:{fontWeight:800,color:q,lineHeight:1.1,fontSize:{xs:"1.1rem",sm:"1.25rem",md:"1.375rem"}},children:"Riders Summary"}),(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:.75,children:[(0,K.jsx)(x.Z,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,K.jsxs)(d.Z,{sx:{fontSize:11.5,color:V,fontWeight:600},children:["Live \xb7 ",rr.length," riders \xb7 ",Re]})]})]})]}),(0,K.jsx)(p.Z,{title:"Filter by date range",arrow:!0,children:(0,K.jsx)(g.Z,{onClick:function(){return ze(!0)},disableElevation:!0,variant:"outlined",size:"small",startIcon:(0,K.jsx)(W.sHf,{size:15}),sx:{height:32,px:1.25,borderRadius:1.5,textTransform:"none",fontSize:12.5,fontWeight:700,letterSpacing:.1,bgcolor:"#fff",borderColor:Q,color:q,"&:hover":{bgcolor:"#fff",borderColor:ie,color:ie,boxShadow:"0 0 0 3px ".concat(ne(ie))}},children:R&&we?"".concat(M()(R).format("DD MMM")," \u2013 ").concat(M()(we).format("DD MMM")):"All time"})})]})}),(0,K.jsx)(j.ZP,{container:!0,spacing:{xs:1,sm:1.25,md:1.5},children:or.map((function(e){var r=e.icon;return(0,K.jsx)(j.ZP,{item:!0,xs:6,sm:6,md:3,children:(0,K.jsxs)(h.Z,{elevation:0,sx:{position:"relative",overflow:"hidden",px:{xs:1.25,sm:1.5},py:{xs:.875,sm:1.125},borderRadius:2,border:"1px solid",borderColor:Q,background:"#fff",transition:"transform 0.15s, box-shadow 0.15s, border-color 0.15s","&:hover":{transform:"translateY(-1px)",boxShadow:_,borderColor:oe(e.color)}},children:[(0,K.jsx)(x.Z,{sx:{position:"absolute",top:0,left:0,bottom:0,width:3,background:e.color}}),(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,sx:{pl:.5},children:[(0,K.jsxs)(u.Z,{spacing:.125,sx:{minWidth:0,flex:1},children:[(0,K.jsx)(d.Z,{sx:{color:V,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:10.5,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.2},children:e.label}),(0,K.jsx)(d.Z,{sx:{fontWeight:800,color:q,lineHeight:1.15,fontSize:{xs:"0.95rem",sm:"1.1rem",md:"1.2rem"}},noWrap:!0,children:Qe?(0,K.jsx)(f.Z,{sx:{width:40},animation:"wave"}):e.isMoney?be(e.value):e.value})]}),(0,K.jsx)(a.Z,{variant:"rounded",sx:{width:30,height:30,bgcolor:re(e.color),color:e.color,borderRadius:1.25,flexShrink:0},children:(0,K.jsx)(r,{size:15})})]})]})},e.key)}))}),(0,K.jsx)(h.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},p:{xs:1,md:1.125},borderRadius:2,border:"1px solid",borderColor:Q,background:"#fff",boxShadow:U},children:(0,K.jsxs)(u.Z,{direction:{xs:"column",md:"row"},spacing:1.25,alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",children:[(0,K.jsx)(x.Z,{sx:{width:{xs:"100%",md:360}},children:(0,K.jsxs)(x.Z,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:999,bgcolor:ee(ie),border:"1.5px solid ".concat(oe(ie)),transition:"all 0.18s","&:focus-within":{borderColor:ie,boxShadow:"0 0 0 3px ".concat(ne(ie))}},children:[(0,K.jsx)(W.vU7,{size:16,style:{color:ie,flexShrink:0}}),(0,K.jsx)(Z.ZP,{inputRef:Ve,placeholder:"Search rider name (ctrl+k)",value:He,onChange:function(e){return Ke(e.target.value)},autoComplete:"off",sx:{flex:1,fontSize:13,fontWeight:600,color:q,"& input::placeholder":{color:G,opacity:1}}}),He&&(0,K.jsx)(m.Z,{size:"small",onClick:function(){return Ke("")},sx:{p:.25,color:ie},children:(0,K.jsx)(W.lUB,{size:14})})]})}),(0,K.jsxs)(u.Z,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[(0,K.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ee(ie),border:"1px solid ".concat(oe(ie)),color:ie,fontSize:11,fontWeight:800},children:[(0,K.jsx)(W.VHP,{size:12})," Orders \xb7 ",Re]}),R&&we&&(0,K.jsxs)(x.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:999,bgcolor:ee("#f59e0b"),border:"1px solid ".concat(oe("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,K.jsx)(W.dKE,{size:12})," ",M()(R).format("DD/MM/YY")," \u2013 ",M()(we).format("DD/MM/YY")]})]})]})}),(0,K.jsx)(h.Z,{elevation:0,sx:{mt:{xs:1,md:1.25},borderRadius:2,border:"1px solid",borderColor:Q,overflow:"hidden",background:"#fff"},children:(0,K.jsx)(b.Z,{sx:{minHeight:320,maxHeight:{xs:"calc(100vh - 320px)",md:"calc(100vh - 300px)"},overflow:"auto","&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:oe(ie),borderRadius:8,"&:hover":{backgroundColor:ie}},"&::-webkit-scrollbar-track":{backgroundColor:X}},children:(0,K.jsxs)(v.Z,{stickyHeader:!0,size:"small",sx:{minWidth:1300},children:[(0,K.jsx)(w.Z,{children:(0,K.jsxs)(y.Z,{sx:{"& th":{backgroundColor:X,color:V,fontSize:10.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Q),py:.75,px:1}},children:[(0,K.jsx)(D.Z,{children:"#"}),(0,K.jsx)(D.Z,{children:"Rider"}),(0,K.jsx)(D.Z,{align:"center",children:"Deliveries"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(se," !important")},children:"Pending"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(ce," !important")},children:"Assigned"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(le," !important")},children:"Accepted"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(ae," !important")},children:"Arrived"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(de," !important")},children:"Picked"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(xe," !important")},children:"Active"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(he," !important")},children:"Skipped"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(ue," !important")},children:"Cancelled"}),(0,K.jsx)(D.Z,{align:"center",sx:{color:"".concat(pe," !important")},children:"Delivered"}),(0,K.jsx)(D.Z,{align:"center",children:"Kms"}),(0,K.jsx)(D.Z,{align:"center",children:"COD / PLA"}),(0,K.jsx)(D.Z,{align:"center",children:"Action"})]})}),(0,K.jsxs)(S.Z,{children:[Qe&&0===rr.length&&Array.from({length:10}).map((function(e,r){return(0,K.jsx)(y.Z,{children:Array.from({length:15}).map((function(e,r){return(0,K.jsx)(D.Z,{sx:{borderBottom:"1px solid ".concat(J),py:.625,px:1},children:(0,K.jsx)(f.Z,{animation:"wave",height:20})},r)}))},"sk-".concat(r))})),!Qe&&0===rr.length&&(0,K.jsx)(y.Z,{children:(0,K.jsx)(D.Z,{colSpan:15,sx:{py:7,borderBottom:"none"},children:(0,K.jsxs)(u.Z,{alignItems:"center",spacing:1.25,children:[(0,K.jsx)(a.Z,{variant:"rounded",sx:{width:56,height:56,bgcolor:re("#94a3b8"),color:G,borderRadius:2},children:(0,K.jsx)(W.te,{size:26})}),(0,K.jsx)(d.Z,{sx:{fontWeight:700,color:q,fontSize:14},children:"No riders to show"}),(0,K.jsx)(d.Z,{sx:{color:V,fontSize:12},children:He?"Try a different rider name or clear the search.":"Adjust the date range above."}),He&&(0,K.jsx)(g.Z,{size:"small",onClick:function(){return Ke("")},sx:{mt:.5,height:28,textTransform:"none",fontSize:12,fontWeight:700,color:ie,borderRadius:1.25,"&:hover":{bgcolor:ee(ie)}},startIcon:(0,K.jsx)(W.lUB,{size:14}),children:"Clear search"})]})})}),rr.map((function(e,r){return(0,K.jsxs)(s.Fragment,{children:[(0,K.jsxs)(y.Z,{sx:{cursor:"pointer",transition:"background-color 0.12s, box-shadow 0.12s","& td":{borderBottom:"1px solid ".concat(J),py:.625,px:1,verticalAlign:"middle"},backgroundColor:Ne===e.userid?ee(ie):"transparent",boxShadow:Ne===e.userid?"inset 3px 0 0 ".concat(ie):"none","&:hover":{backgroundColor:Ne===e.userid?re(ie):ee(ie),boxShadow:"inset 3px 0 0 ".concat(ie)}},children:[(0,K.jsx)(D.Z,{children:(0,K.jsx)(d.Z,{sx:{fontWeight:700,fontSize:12,color:G},children:r+1})}),(0,K.jsx)(D.Z,{children:(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1,children:[(0,K.jsx)(Ze,{color:ie,size:28,selected:!0,children:String(e.firstname||"?").charAt(0).toUpperCase()}),(0,K.jsxs)(u.Z,{spacing:.125,children:[(0,K.jsxs)(d.Z,{sx:{fontSize:12.5,fontWeight:700,color:q,lineHeight:1.25},noWrap:!0,children:[e.firstname," ",e.lastname]}),(0,K.jsxs)(d.Z,{sx:{fontSize:10.5,fontWeight:600,color:G,lineHeight:1.3},children:["Id : ",e.userid]})]})]})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.totalorders,color:ie,icon:(0,K.jsx)(W.ByW,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.pending,color:se,icon:(0,K.jsx)(W.Ley,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.assigned,color:ce,icon:(0,K.jsx)(W.Z5O,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.accepted,color:le,icon:(0,K.jsx)(W.ZSR,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.arrived,color:ae,icon:(0,K.jsx)(W.ZSR,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.picked,color:de,icon:(0,K.jsx)(W.ili,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.active,color:xe,icon:(0,K.jsx)(W.ili,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.skipped,color:he,icon:(0,K.jsx)(W.B4e,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.cancelled,color:ue,icon:(0,K.jsx)(W.B4e,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.delivered,color:pe,icon:(0,K.jsx)(W.ZSR,{size:11})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(p.Z,{title:"Cumulative Kms",placement:"top",children:(0,K.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,K.jsx)(me,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:ge,icon:(0,K.jsx)(W.v93,{size:11})})})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsxs)(u.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,K.jsx)(p.Z,{title:"Pay on Delivery",children:(0,K.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,K.jsx)(me,{value:e.payondelivery,color:je,icon:(0,K.jsx)(W.vCl,{size:11}),isMoney:!0})})}),(0,K.jsx)(p.Z,{title:"Pay Later",children:(0,K.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,K.jsx)(me,{value:e.Paylater,color:fe,icon:(0,K.jsx)(W.vCl,{size:11}),isMoney:!0})})})]})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(p.Z,{title:Ne===e.userid?"Collapse locations":"View locations",children:(0,K.jsx)(m.Z,{size:"small",onClick:function(){er(e.userid),Fe(Ne===e.userid?null:e.userid)},sx:{bgcolor:Ne===e.userid?ie:ee(ie),border:"1px solid ".concat(Ne===e.userid?ie:oe(ie)),color:Ne===e.userid?"#fff":ie,borderRadius:999,p:.75,transition:"all 0.18s","&:hover":{bgcolor:Ne===e.userid?ie:re(ie),borderColor:ie,boxShadow:"0 0 0 3px ".concat(ne(ie))}},children:Ne===e.userid?(0,K.jsx)(W.rWj,{size:14}):(0,K.jsx)(W.Ix0,{size:14})})})})]}),Ne===e.userid&&(0,K.jsx)(y.Z,{children:(0,K.jsx)(D.Z,{colSpan:15,sx:{p:0,borderBottom:"1px solid ".concat(J),bgcolor:X},children:(0,K.jsx)(k.Z,{in:Ne===e.userid,timeout:"auto",unmountOnExit:!0,children:(0,K.jsxs)(x.Z,{sx:{p:{xs:1.5,md:2}},children:[(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1.25},children:[(0,K.jsx)(Ze,{color:ie,size:22,selected:!0,children:(0,K.jsx)(W.c7Z,{size:12})}),(0,K.jsxs)(d.Z,{variant:"subtitle2",sx:{fontWeight:800,color:q},children:["Locations \xb7 ",e.firstname," ",e.lastname]})]}),(0,K.jsx)(h.Z,{elevation:0,sx:{borderRadius:2,border:"1px solid",borderColor:Q,overflow:"hidden",background:"#fff"},children:(0,K.jsxs)(v.Z,{size:"small",children:[(0,K.jsx)(w.Z,{children:(0,K.jsxs)(y.Z,{sx:{"& th":{backgroundColor:ee(ie),color:ie,fontSize:10.5,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(oe(ie)),py:.75}},children:[(0,K.jsx)(D.Z,{align:"center",children:"#"}),(0,K.jsx)(D.Z,{children:"Location"}),(0,K.jsx)(D.Z,{align:"center",children:"All"}),(0,K.jsx)(D.Z,{align:"center",children:"Pending"}),(0,K.jsx)(D.Z,{align:"center",children:"Completed"}),(0,K.jsx)(D.Z,{align:"center",children:"Cancelled"}),(0,K.jsx)(D.Z,{align:"center",children:"Kms"}),(0,K.jsx)(D.Z,{align:"center",children:"COD / PLA"})]})}),(0,K.jsx)(S.Z,{children:Ae&&Ae.length>0?Ae.map((function(e,r){return(0,K.jsxs)(y.Z,{sx:{"& td":{borderBottom:"1px solid ".concat(J),py:.5,px:1},"&:hover":{backgroundColor:ee(ie),boxShadow:"inset 3px 0 0 ".concat(ie)}},children:[(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(d.Z,{sx:{fontWeight:700,color:V,fontSize:12},children:r+1})}),(0,K.jsx)(D.Z,{children:(0,K.jsxs)(u.Z,{children:[(0,K.jsx)(d.Z,{variant:"caption",sx:{fontWeight:700,color:q},noWrap:!0,children:e.locationname}),(0,K.jsxs)(d.Z,{variant:"caption",sx:{color:G,fontSize:10},children:["Id : ",e.locationid]})]})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.totalorders,color:ie,icon:(0,K.jsx)(W.ByW,{size:10})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.deliveriespending,color:se,icon:(0,K.jsx)(W.Ley,{size:10})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.deliveriescompleted,color:pe,icon:(0,K.jsx)(W.ZSR,{size:10})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.deliveriescancelled,color:ue,icon:(0,K.jsx)(W.B4e,{size:10})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsx)(me,{value:e.cumulativekms?Number(parseFloat(e.cumulativekms).toFixed(2)):0,color:ge,icon:(0,K.jsx)(W.v93,{size:10})})}),(0,K.jsx)(D.Z,{align:"center",children:(0,K.jsxs)(u.Z,{direction:"row",spacing:.5,justifyContent:"center",children:[(0,K.jsx)(p.Z,{title:"Pay on Delivery",children:(0,K.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,K.jsx)(me,{value:e.payondelivery,color:je,icon:(0,K.jsx)(W.vCl,{size:10}),isMoney:!0})})}),(0,K.jsx)(p.Z,{title:"Pay Later",children:(0,K.jsx)(x.Z,{sx:{display:"inline-block"},children:(0,K.jsx)(me,{value:e.paylater,color:fe,icon:(0,K.jsx)(W.vCl,{size:10}),isMoney:!0})})})]})})]},"".concat(e.locationid,"-").concat(r))})):(0,K.jsx)(y.Z,{children:(0,K.jsx)(D.Z,{colSpan:8,sx:{py:3,borderBottom:"none"},children:(0,K.jsxs)(u.Z,{alignItems:"center",spacing:1,children:[(0,K.jsx)(a.Z,{sx:{width:40,height:40,bgcolor:re("#94a3b8"),color:G},children:(0,K.jsx)(W.c7Z,{size:18})}),(0,K.jsx)(d.Z,{variant:"caption",sx:{color:V,fontWeight:700},children:"No location data for this rider"})]})})})})]})})]})})})})]},"".concat(e.userid,"-").concat(r))}))]})]})})}),(0,K.jsxs)(z.Z,{open:ke,onClose:function(){return ze(!1)},PaperProps:{sx:{borderRadius:3}},children:[(0,K.jsx)(x.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(ee(ie)," 0%, ").concat(ee(te)," 100%)"),borderBottom:"1px solid ".concat(Q)},children:(0,K.jsxs)(u.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,K.jsx)(a.Z,{sx:{bgcolor:ie,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ne(ie))},children:(0,K.jsx)(W.sHf,{size:20})}),(0,K.jsxs)(u.Z,{children:[(0,K.jsx)(d.Z,{variant:"h5",sx:{fontWeight:800,color:q},children:"Select Date Range"}),(0,K.jsx)(d.Z,{variant:"caption",sx:{color:V,fontWeight:600},children:"Filter rider activity by a date range or preset"})]})]})}),(0,K.jsx)(C.Z,{sx:{width:"100%"},className:"datedialog",children:(0,K.jsx)(I.D,{open:ke,toggle:function(){return ze(!ke)},id:"daterange1",onChange:function(e){"All"===e.label?(O(""),ye(""),Me("All"),ze(!1)):(O(M()(e.startDate).format("YYYY-MM-DD")),ye(M()(e.endDate).format("YYYY-MM-DD")),Me(e.label||""))},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,Y.Z)(new Date,-1),endDate:(0,Y.Z)(new Date,-1)},{label:"Tomorrow",startDate:(0,Y.Z)(new Date,1),endDate:(0,Y.Z)(new Date,1)},{label:"This Week",startDate:(0,A.Z)(new Date),endDate:(0,L.Z)(new Date)},{label:"Last Week",startDate:(0,A.Z)((0,B.Z)(new Date,-1)),endDate:(0,L.Z)((0,B.Z)(new Date,-1))},{label:"Last 7 Days",startDate:(0,B.Z)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,P.Z)(new Date),endDate:(0,N.Z)(new Date)},{label:"Last Month",startDate:(0,P.Z)((0,F.Z)(new Date,-1)),endDate:(0,N.Z)((0,F.Z)(new Date,-1))},{label:"All",startDate:new Date,endDate:(0,Y.Z)(new Date,-1)}]})}),(0,K.jsxs)(u.Z,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{width:"100%",p:2,borderTop:"1px solid ".concat(J)},children:[(0,K.jsx)(g.Z,{variant:"outlined",onClick:function(){return ze(!1)},sx:{borderRadius:999,px:2.5,borderColor:Q,color:V,fontWeight:700,"&:hover":{borderColor:V,bgcolor:X}},children:"Cancel"}),(0,K.jsx)(g.Z,{variant:"contained",onClick:function(){return ze(!1)},sx:{borderRadius:999,px:3,bgcolor:ie,fontWeight:700,boxShadow:"0 6px 18px ".concat(ne(ie)),"&:hover":{bgcolor:"#4D1C61"}},children:"Apply"})]})]})]})}}}]);