Files
Express_console_build/build/static/js/6849.2250b254.chunk.js

1 line
38 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6849],{23787:(e,t,n)=>{n.d(t,{FG:()=>u,nV:()=>x,pY:()=>p,pg:()=>h});var o=n(89379),r=n(80045),i=n(93230),l=n(2235),a=n(16491),s=n(82053),c=n(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:n=!1,onScroll:l,sx:a}=e,s=(0,r.A)(e,d);return(0,c.jsx)(i.A,(0,o.A)((0,o.A)({spacing:1.25,onScroll:l,sx:(0,o.A)((0,o.A)({p:1.5},n&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),a)},s),{},{children:t}))},h=e=>{let{accent:t="#662582",header:n,footer:r,selected:i=!1,onClick:s,children:d,sx:x}=e;return(0,c.jsxs)(l.A,{elevation:0,onClick:s,sx:(0,o.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:i?t:"#e2e8f0",background:i?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(a.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(a.A,{sx:{p:1.5,pl:2},children:[n,d,r]})]})},u=e=>{let{children:t,columns:n=2,sx:r}=e;return(0,c.jsx)(a.A,{sx:(0,o.A)({display:"grid",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))"),gap:1,mt:1.25},r),children:t})},p=e=>{let{label:t,value:n,children:o,full:r=!1,align:i="left"}=e;return(0,c.jsxs)(a.A,{sx:{gridColumn:r?"1 / -1":"auto",minWidth:0,textAlign:i},children:[(0,c.jsx)(s.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(a.A,{sx:{mt:.25,minWidth:0},children:void 0!==o?o:(0,c.jsx)(s.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==n&&void 0!==n?n:"\u2014"})})]})}},27001:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(93230),r=n(16491),i=n(82053),l=n(44414);function a(e){let{title:t,subtitle:n,live:a=!1,action:s}=e;return(0,l.jsxs)(o.A,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:{xs:2,md:2.5}},children:[(0,l.jsxs)(r.A,{sx:{minWidth:0},children:[(0,l.jsx)(i.A,{variant:"h3",sx:{fontWeight:700,letterSpacing:"-0.02em",color:"grey.800"},children:t}),n&&(0,l.jsxs)(o.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[a&&(0,l.jsx)(r.A,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:"success.main",boxShadow:"0 0 0 3px rgba(16,185,129,0.18)"}}),(0,l.jsx)(i.A,{variant:"caption",sx:{color:"text.secondary",fontWeight:500},children:n})]})]}),s&&(0,l.jsx)(r.A,{sx:{flexShrink:0,width:{xs:"100%",sm:"auto"}},children:s})]})}},35678:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(9950),r=n(96583),i=n(40033),l=n(82053),a=n(28170),s=n(93230),c=n(82223),d=n(55916),x=n(4159),h=n.n(x),u=n(56712),p=n(81417),m=n(96600),j=n(53132),g=n(94289),b=n(57326),f=n(50624),A=n(44414);const v=e=>{let{open:t,onClose:n,onSelect:x}=e;const[v,w]=(0,o.useState)(null);return(0,A.jsxs)(r.A,{open:t,onClose:n,children:[(0,A.jsx)(i.A,{align:"left",children:(0,A.jsx)(l.A,{variant:"h4",children:"Select Filter Options"})}),(0,A.jsx)(a.A,{sx:{width:"100%"},className:"datedialog",children:(0,A.jsx)(d.U,{open:t,toggle:n,id:"daterange1",onChange:e=>{w({startDate:h()(e.startDate).format("YYYY-MM-DD"),endDate:h()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,u.A)(new Date,-1),endDate:(0,u.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,u.A)(new Date,1),endDate:(0,u.A)(new Date,1)},{label:"This Week",startDate:(0,p.A)(new Date),endDate:(0,m.A)(new Date)},{label:"Last Week",startDate:(0,p.A)((0,j.A)(new Date,-1)),endDate:(0,m.A)((0,j.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,j.A)(new Date,-1),endDate:new Date},{label:"This Month",startDate:(0,g.A)(new Date),endDate:(0,b.A)(new Date)},{label:"Last Month",startDate:(0,g.A)((0,f.A)(new Date,-1)),endDate:(0,b.A)((0,f.A)(new Date,-1))}]})}),(0,A.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,A.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(x(v),n()):n()},children:"OK"})})]})}},36803:(e,t,n)=>{n.d(t,{A:()=>x});var o=n(48089),r=n(50704),i=n(93230),l=n(16491),a=n(82053),s=n(82917),c=n(41413),d=n(44414);function x(e){let{title:t,value:n,icon:x,color:h="#662582",caption:u,loading:p=!1}=e;return(0,d.jsx)(o.A,{sx:{height:"100%"},children:(0,d.jsx)(r.A,{sx:{p:{xs:1.75,md:2},"&:last-child":{pb:{xs:1.75,md:2}}},children:(0,d.jsxs)(i.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,d.jsxs)(l.A,{sx:{minWidth:0,flex:1},children:[(0,d.jsx)(a.A,{variant:"body2",sx:{fontWeight:500,color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),p?(0,d.jsx)(s.A,{variant:"rounded",sx:{width:72,height:30,mt:.5},animation:"wave"}):(0,d.jsx)(a.A,{sx:{mt:.25,fontWeight:700,letterSpacing:"-0.015em",color:"grey.800",lineHeight:1.15,fontSize:{xs:"1.375rem",md:"1.5rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n}),u&&(0,d.jsx)(a.A,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary"},children:u})]}),x&&(0,d.jsx)(c.A,{variant:"rounded",sx:{width:42,height:42,borderRadius:2,bgcolor:"".concat(h,"14"),color:h,flexShrink:0},children:x})]})})})}},56311:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(89379),r=n(9950),i=n(2660),l=n(2046),a=n(83274),s=n(25333),c=n(97125),d=n(7762),x=n(52097),h=n(44414);const u=e=>{let{value:t,onChange:n,onDebouncedChange:u,debounceTime:p=500,placeholder:m="Search (ctrl+k)",sx:j}=e;const g=(0,r.useRef)(null),[b]=(0,x.d7)(t,p);return(0,r.useEffect)((()=>{u&&u(b)}),[b,u]),(0,r.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=g.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===g.current&&g.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(i.A,{sx:(0,o.A)({},j),inputRef:g,placeholder:m,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>n(e.target.value),startAdornment:(0,h.jsx)(l.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(a.A,{title:"Clear",children:(0,h.jsx)(s.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>n(""),children:(0,h.jsx)(d.A,{})})})})}},56849:(e,t,n)=>{n.r(t),n.d(t,{default:()=>oe});var o=n(89379),r=n(9950),i=n(26910),l=n(36150),a=n(2235),s=n(41413),c=n(83274),d=n(16491),x=n(82053),h=n(14857),u=n(47223),p=n(60899),m=n(93230),j=n(77922),g=n(29925),b=n(25333),f=n(33738),A=n(1320),v=n(15769),w=n(69780),S=n(9213),y=n(21671),C=n(34075),k=n(74745),z=n(25277),D=n(31222),W=n(4159),I=n.n(W),M=n(81425),Y=n(52351),P=n(35678),N=n(59212),T=n(27001),R=n(36803),F=n(56311),O=n(23787),L=n(96646),K=n(20466),B=n(44414),H=n(36220);I().extend(H);const E={radiusPill:999,radiusCard:14,shadowSoft:"0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05)",shadowMd:"0 1px 3px rgba(15, 23, 42, 0.06)",shadowPop:"0 12px 32px rgba(15, 23, 42, 0.12)",textPrimary:"#0f172a",textSecondary:"#64748b",textMuted:"#94a3b8",borderSubtle:"#e2e8f0",divider:"#f1f5f9",surface:"#ffffff",surfaceAlt:"#f8fafc"},Z=(e,t)=>"".concat(e).concat(t),U=e=>Z(e,"08"),X=e=>Z(e,"18"),q=e=>Z(e,"26"),$=e=>Z(e,"55"),V="#662582",G="#9255AB",J=e=>(0,B.jsx)(a.A,(0,o.A)((0,o.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:E.shadowPop,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),_=e=>{let{color:t,selected:n,size:o=24,children:r}=e;return(0,B.jsx)(s.A,{sx:{width:o,height:o,bgcolor:n?t:X(t),color:n?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:r})},Q=e=>{let{color:t,icon:n,label:o,tooltip:r,minWidth:i=80}=e;return(0,B.jsx)(c.A,{title:r||"",placement:"top",children:(0,B.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat($(t)),color:t,fontSize:11,fontWeight:800,minWidth:i,justifyContent:"center",whiteSpace:"nowrap"},children:[n,o]})})},ee=e=>{let{value:t,color:n="#ef4444",icon:o}=e;const r=Number(t)||0;return 0===r?(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textMuted,fontWeight:700},children:"0"}):(0,B.jsxs)(d.A,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:.875,py:.25,borderRadius:999,bgcolor:"#ffffff",border:"1px solid ".concat($(n)),color:n,fontSize:12,fontWeight:800,minWidth:36,justifyContent:"center"},children:[o,r]})},te=e=>({"& .MuiOutlinedInput-root":{borderRadius:"10px",bgcolor:"#ffffff",fontWeight:600,"& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(q(e))},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:1.5}}});function ne(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(Number(e)||0)}function oe(){const e=(0,h.A)(),t=(0,u.A)(e.breakpoints.down("md")),n=(0,r.useRef)(null),W=(0,r.useRef)(null),[H,Z]=(0,r.useState)(0),[oe,re]=(0,r.useState)(I()().format("YYYY-MM-DD")),[ie,le]=(0,r.useState)(I()().format("YYYY-MM-DD")),[ae,se]=(0,r.useState)("All"),[ce,de]=(0,r.useState)(!1),[xe,he]=(0,r.useState)(null),[ue,pe]=(0,r.useState)("Today"),[me,je]=(0,r.useState)([]),[ge,be]=(0,r.useState)(!1),[fe,Ae]=(0,r.useState)(0),[ve,we]=(0,r.useState)(0),[Se,ye]=(0,r.useState)(null),[Ce,ke]=(0,r.useState)(null),[ze,De]=(0,r.useState)(""),[We,Ie]=(0,r.useState)(""),[,Me]=(0,r.useState)(0);(0,r.useEffect)((()=>{we(0),ye(null),Ae(0),ke(null),he(null)}),[H]),(0,r.useEffect)((()=>{Ae(0),ke(null),he(null)}),[ve]);const{data:Ye,isLoading:Pe,isError:Ne,error:Te}=(0,l.I)({queryKey:[H,ve,fe,oe,ie],queryFn:ve?M.U6:M.DK}),{data:Re}=(0,l.I)({queryKey:["tenantlist",H],queryFn:()=>(0,M.Mn)(H),enabled:0!==H}),{data:Fe}=(0,l.I)({queryKey:["gettenantlocations",ve],queryFn:()=>(0,M.DL)(ve),enabled:0!==ve}),Oe=(0,r.useMemo)((()=>Array.isArray(Ye)?Ye:[]),[Ye]),Le=(0,r.useMemo)((()=>{if(!We)return Oe;const e=We.toLowerCase().trim();return Oe.filter((t=>[t.tenantname,t.locationname,String(t.tenantid||""),String(t.locationid||"")].filter(Boolean).some((t=>String(t).toLowerCase().includes(e)))))}),[Oe,We]),Ke=(0,r.useMemo)((()=>Le.reduce(((e,t)=>(e.totalOrders+=Number(t.totalorders)||0,e.orderPend+=Number(t.Orderspending)||0,e.orderComplete+=Number(t.orderscompleted)||0,e.orderCancel+=Number(t.orderscancelled)||0,e.deliPend+=Number(t.deliveriespending)||0,e.deliComplete+=Number(t.deliveriescompleted)||0,e.deliCancel+=Number(t.deliveriescancelled)||0,e.collection+=Number(t.collectionamt)||0,e.kms+=Number(t.kms)||0,e.cumulativekms+=Number(t.cumulativekms)||0,e.amount+=Math.max(Number(t.charges)||0,Number(t.deliveryamt)||0),e)),{totalOrders:0,orderPend:0,orderComplete:0,orderCancel:0,deliPend:0,deliComplete:0,deliCancel:0,collection:0,kms:0,cumulativekms:0,amount:0})),[Le]),Be=async e=>{be(!0);try{var t;const n=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getuserreportsummary/?tenantid=").concat(e,"&fromdate=").concat(oe,"&todate=").concat(ie));je(Array.isArray(null===(t=n.data)||void 0===t?void 0:t.details)?n.data.details:[])}catch(n){(0,K.k)((null===n||void 0===n?void 0:n.message)||"Failed to load rider breakdown","error",2e3),je([])}finally{be(!1)}},He=async e=>{be(!0);try{var t;const n=await i.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationsummary/?tenantid=").concat(ve,"&locationid=").concat(e,"&fromdate=").concat(oe,"&todate=").concat(ie));je(Array.isArray(null===(t=n.data)||void 0===t?void 0:t.details)?n.data.details:[])}catch(n){(0,K.k)((null===n||void 0===n?void 0:n.message)||"Failed to load rider breakdown","error",2e3),je([])}finally{be(!1)}};Ne&&console.warn("ordersSummary error:",null===Te||void 0===Te?void 0:Te.message);const Ee=[{key:"orders",label:"Total Orders",color:V,icon:D.HU2,value:Ke.totalOrders},{key:"pending",label:"Orders Pending",color:"#f59e0b",icon:D.G6c,value:Ke.orderPend},{key:"completed",label:"Orders Completed",color:"#10b981",icon:D.cAP,value:Ke.orderComplete},{key:"amount",label:"Total Amount",color:"#0ea5e9",icon:D.S75,value:ne(Ke.amount)}],Ze=Boolean(ve);return(0,B.jsxs)(B.Fragment,{children:[(ge||Pe)&&(0,B.jsx)(Y.A,{}),(0,B.jsx)(T.A,{title:"Orders Summary",subtitle:"Live \xb7 ".concat(ae||"All Zones"," \xb7 ").concat(ue),live:!0,action:(0,B.jsx)(N.A,{ref:n,locaName:ae,setAppId:Z,setLocoName:se,setPage:Me,pill:!0,accentColor:V,icon:(0,B.jsx)(D.HPi,{size:14}),placeholder:"Select Zone",paperComponent:J,sx:{width:{xs:"100%",sm:280},zIndex:100}})}),(0,B.jsx)(p.Ay,{container:!0,spacing:{xs:2,md:2.5},sx:{mb:{xs:1.5,md:2}},children:Ee.map((e=>{var t;const n=e.icon;return(0,B.jsx)(p.Ay,{item:!0,xs:6,sm:6,md:3,children:(0,B.jsx)(R.A,{title:e.label,value:null!==(t=e.value)&&void 0!==t?t:0,icon:(0,B.jsx)(n,{size:20}),color:e.color,loading:Pe})},e.key)}))}),(0,B.jsx)(a.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:E.radiusCard/8,borderTopRightRadius:E.radiusCard/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:E.borderSubtle,borderBottom:0,background:"#fff"},children:(0,B.jsxs)(m.A,{direction:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:"space-between",spacing:1.25,children:[(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1.25,flexWrap:"wrap",children:[(0,B.jsx)(c.A,{title:"Date Filter",placement:"top",children:(0,B.jsxs)(d.A,{onClick:()=>de(!0),sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.75,borderRadius:999,cursor:"pointer",bgcolor:U("#f59e0b"),border:"1.5px solid ".concat($("#f59e0b")),color:"#f59e0b",fontWeight:800,fontSize:12,transition:"all 0.18s","&:hover":{borderColor:"#f59e0b",boxShadow:"0 0 0 3px ".concat(q("#f59e0b"))}},children:[(0,B.jsx)(D.Ki0,{size:14}),"Orders \xb7 ",ue," \xb7 ",I()(oe).format("DD/MM/YY")," \u2013 ",I()(ie).format("DD/MM/YY")]})}),(0,B.jsx)(j.A,{options:Re||[],value:Se,getOptionLabel:e=>(null===e||void 0===e?void 0:e.tenantname)||(null===e||void 0===e?void 0:e.label)||"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.tenantid)===(null===t||void 0===t?void 0:t.tenantid),PaperComponent:J,sx:(0,o.A)({minWidth:{xs:"100%",sm:220}},te(V)),onOpen:e=>{H||(e.preventDefault(),(0,K.k)("Please select a Zone first!","warning",3e3),setTimeout((()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"!==n&&t?(we((null===t||void 0===t?void 0:t.tenantid)||0),ye(t),Ae((null===t||void 0===t?void 0:t.locationid)||0),ke(null)):(we(0),ye(null),Ae(0),ke(null))},renderInput:e=>(0,B.jsx)(g.A,(0,o.A)((0,o.A)({},e),{},{inputRef:W,placeholder:"Select Tenant",size:"small",InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,B.jsx)(_,{color:V,size:24,selected:Boolean(Se),children:(0,B.jsx)(D.nZo,{size:14})}),e.InputProps.startAdornment]})})}))}),(0,B.jsx)(j.A,{options:Fe||[],value:Ce,getOptionLabel:e=>null!==e&&void 0!==e&&e.locationname?"".concat(e.locationname).concat(e.suburb?" (".concat(e.suburb,")"):""):"",isOptionEqualToValue:(e,t)=>(null===e||void 0===e?void 0:e.locationid)===(null===t||void 0===t?void 0:t.locationid),PaperComponent:J,sx:(0,o.A)({minWidth:{xs:"100%",sm:220}},te("#0ea5e9")),onOpen:e=>{H||ve?ve||(e.preventDefault(),(0,K.k)("Please select a Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=W.current)||void 0===e?void 0:e.focus()}),0)):(e.preventDefault(),(0,K.k)("Please select Zone and Tenant first!","warning",3e3),setTimeout((()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.focus()}),0))},onChange:(e,t,n)=>{"clear"!==n&&t?(Ae((null===t||void 0===t?void 0:t.locationid)||0),ke(t)):(Ae(0),ke(null))},renderInput:e=>(0,B.jsx)(g.A,(0,o.A)((0,o.A)({},e),{},{placeholder:"Select Location",size:"small",InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5},children:[(0,B.jsx)(_,{color:"#0ea5e9",size:24,selected:Boolean(Ce),children:(0,B.jsx)(D.gwi,{size:14})}),e.InputProps.startAdornment]})})}))})]}),(0,B.jsx)(d.A,{sx:{width:{xs:"100%",md:280,lg:320},flex:{xs:"1 1 100%",md:"0 0 auto"}},children:(0,B.jsx)(F.A,{value:ze,onChange:De,onDebouncedChange:Ie,placeholder:"Search ".concat(Ze?"locations":"tenants"," (ctrl+k)"),sx:{m:0,width:"100%",borderRadius:999,bgcolor:"#ffffff","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused fieldset":{borderColor:"#662582",borderWidth:1.5},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(q(V))}}})})]})}),(0,B.jsxs)(a.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:E.radiusCard/8,borderBottomRightRadius:E.radiusCard/8,border:"1px solid",borderColor:E.borderSubtle,overflow:"hidden",background:"#fff"},children:[t?(0,B.jsxs)(B.Fragment,{children:[Pe&&(0,B.jsx)(O.nV,{children:[0,1,2,3].map((e=>(0,B.jsx)(O.pg,{accent:E.borderSubtle,children:(0,B.jsx)(d.A,{sx:{height:96}})},e)))}),!Pe&&0===Le.length&&(0,B.jsxs)(m.A,{alignItems:"center",spacing:1.5,sx:{py:6,px:2},children:[(0,B.jsx)(s.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:E.textMuted},children:(0,B.jsx)(D.Z2J,{size:28})}),(0,B.jsxs)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:E.textPrimary},children:["No ",Ze?"locations":"tenants"," to show"]}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textSecondary,textAlign:"center",maxWidth:360},children:We?"Try a different keyword.":Ne?"Something went wrong fetching the summary. Try a different filter.":"Pick a zone, tenant, or date range to load the summary."})]}),!Pe&&Le.length>0&&(0,B.jsx)(O.nV,{children:Le.map(((e,t)=>{const n=Ze?e.locationname:e.tenantname,o=xe===n,r=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0),i=Ze?"#0ea5e9":V;return(0,B.jsxs)(O.pg,{accent:i,selected:o,header:(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,B.jsx)(_,{color:i,size:36,children:Ze?(0,B.jsx)(D.gwi,{size:18}):(0,B.jsx)(D.nZo,{size:18})}),(0,B.jsxs)(m.A,{sx:{minWidth:0,flex:1},children:[(0,B.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:E.textPrimary},noWrap:!0,children:(Ze?e.locationname:e.tenantname)||"\u2014"}),(0,B.jsxs)(x.A,{variant:"caption",sx:{color:E.textSecondary},children:["ID #",Ze?e.locationid:e.tenantid]})]}),(0,B.jsx)(c.A,{title:o?"Hide rider breakdown":"View rider breakdown",placement:"top",children:(0,B.jsx)(b.A,{size:"small",onClick:()=>{const t=!o;he(t?n:null),t&&(je([]),Ze?He(e.locationid):Be(e.tenantid))},sx:{flexShrink:0,bgcolor:o?V:X(V),color:o?"#fff":V,border:"1px solid ".concat($(V)),"&:hover":{bgcolor:V,color:"#fff"}},children:o?(0,B.jsx)(D.Xbk,{size:16}):(0,B.jsx)(D.j1Q,{size:16})})})]}),children:[(0,B.jsxs)(O.FG,{columns:3,children:[(0,B.jsx)(O.pY,{label:"All",align:"center",children:(0,B.jsx)(ee,{value:e.totalorders,color:V,icon:(0,B.jsx)(D.F6S,{size:11})})}),(0,B.jsx)(O.pY,{label:"Ord Pending",align:"center",children:(0,B.jsx)(ee,{value:e.Orderspending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:11})})}),(0,B.jsx)(O.pY,{label:"Ord Cancelled",align:"center",children:(0,B.jsx)(ee,{value:e.orderscancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:11})})}),(0,B.jsx)(O.pY,{label:"Ord Completed",align:"center",children:(0,B.jsx)(ee,{value:e.orderscompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:11})})}),(0,B.jsx)(O.pY,{label:"Del Pending",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriespending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:11})})}),(0,B.jsx)(O.pY,{label:"Del Cancelled",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:11})})}),(0,B.jsx)(O.pY,{label:"Del Completed",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:11})})}),(0,B.jsx)(O.pY,{label:"Collection",align:"center",children:(0,B.jsx)(Q,{color:"#f59e0b",icon:(0,B.jsx)(D.YHz,{size:11}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection Amount",minWidth:90})}),(0,B.jsx)(O.pY,{label:"Amount",align:"center",children:(0,B.jsx)(Q,{color:V,icon:(0,B.jsx)(D.YHz,{size:11}),label:ne(r).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,B.jsx)(O.pY,{label:"KMS",align:"center",children:(0,B.jsx)(Q,{color:"#ef4444",icon:(0,B.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,B.jsx)(O.pY,{label:"Actual KMS",align:"center",children:(0,B.jsx)(Q,{color:"#10b981",icon:(0,B.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})})]}),(0,B.jsx)(f.A,{in:o,timeout:"auto",unmountOnExit:!0,children:(0,B.jsxs)(d.A,{sx:{mt:1.5},children:[(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{mb:1},children:[(0,B.jsx)(_,{color:V,size:24,selected:!0,children:(0,B.jsx)(D.Itr,{size:12})}),(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:E.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:"Rider Breakdown"})]}),ge||me&&0!==me.length?(0,B.jsx)(m.A,{spacing:1,children:me.map(((e,t)=>{const n=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,B.jsxs)(O.pg,{accent:V,children:[(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,B.jsx)(_,{color:V,size:28,children:(0,B.jsx)(D.LTk,{size:14})}),(0,B.jsxs)(m.A,{sx:{minWidth:0},children:[(0,B.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:E.textPrimary},noWrap:!0,children:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"\u2014"}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textSecondary},children:e.ridercontact||"ID #".concat(e.userid)})]})]}),(0,B.jsxs)(O.FG,{columns:3,children:[(0,B.jsx)(O.pY,{label:"Orders",align:"center",children:(0,B.jsx)(ee,{value:e.orderscreated,color:V,icon:(0,B.jsx)(D.F6S,{size:10})})}),(0,B.jsx)(O.pY,{label:"Deliveries",align:"center",children:(0,B.jsx)(ee,{value:e.totalorders,color:"#0ea5e9",icon:(0,B.jsx)(D.F6S,{size:10})})}),(0,B.jsx)(O.pY,{label:"Pending",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriespending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:10})})}),(0,B.jsx)(O.pY,{label:"Cancelled",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:10})})}),(0,B.jsx)(O.pY,{label:"Completed",align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:10})})}),(0,B.jsx)(O.pY,{label:"Collection",align:"center",children:(0,B.jsx)(Q,{color:"#f59e0b",icon:(0,B.jsx)(D.YHz,{size:10}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection",minWidth:80})}),(0,B.jsx)(O.pY,{label:"KMS",align:"center",children:(0,B.jsx)(Q,{color:"#ef4444",icon:(0,B.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"})}),(0,B.jsx)(O.pY,{label:"Actual KMS",align:"center",children:(0,B.jsx)(Q,{color:"#10b981",icon:(0,B.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})}),(0,B.jsx)(O.pY,{label:"Amount",align:"center",children:(0,B.jsx)(Q,{color:V,icon:(0,B.jsx)(D.YHz,{size:10}),label:ne(n).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]})]},"".concat(e.userid,"-").concat(t))}))}):(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textMuted,display:"block",py:1,textAlign:"center"},children:"No rider activity for this row."})]})})]},"".concat(n,"-").concat(t))}))})]}):(0,B.jsx)(A.A,{sx:{maxHeight:{xs:"calc(100vh - 280px)",md:"calc(100vh - 240px)"},"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-thumb":{backgroundColor:$(V),borderRadius:8,"&:hover":{backgroundColor:V}},"&::-webkit-scrollbar-track":{backgroundColor:E.surfaceAlt}},children:(0,B.jsxs)(v.A,{stickyHeader:!0,sx:{minWidth:{xs:1080,md:1200}},children:[(0,B.jsxs)(w.A,{children:[(0,B.jsxs)(S.A,{sx:{"& th":{backgroundColor:E.surfaceAlt,color:E.textSecondary,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(E.borderSubtle),py:{xs:1,md:1.25},px:{xs:1,md:1.5}}},children:[(0,B.jsx)(y.A,{rowSpan:2,children:"#"}),(0,B.jsx)(y.A,{rowSpan:2,children:Ze?"Location":"Tenant"}),(0,B.jsx)(y.A,{align:"center",rowSpan:2,children:"All"}),(0,B.jsx)(y.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(U("#ef4444")," !important"),color:"#ef4444 !important"},children:"Orders"}),(0,B.jsx)(y.A,{align:"center",colSpan:3,sx:{bgcolor:"".concat(U("#10b981")," !important"),color:"#10b981 !important"},children:"Deliveries"}),(0,B.jsx)(y.A,{align:"center",rowSpan:2,children:"Collection"}),(0,B.jsx)(y.A,{align:"center",rowSpan:2,children:"KMS / Actual"}),(0,B.jsx)(y.A,{align:"center",rowSpan:2,children:"Amount"}),(0,B.jsx)(y.A,{align:"right",rowSpan:2,children:"Action"})]}),(0,B.jsxs)(S.A,{sx:{"& th":{backgroundColor:E.surfaceAlt,color:E.textSecondary,fontSize:{xs:10,md:10.5},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(E.borderSubtle),py:{xs:.75,md:1},px:{xs:1,md:1.5}}},children:[(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#ef4444")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#ef4444")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#ef4444")," !important"),color:"#10b981 !important"},children:"Completed"}),(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#10b981")," !important"),color:"#f59e0b !important"},children:"Pending"}),(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#10b981")," !important"),color:"#ef4444 !important"},children:"Cancelled"}),(0,B.jsx)(y.A,{align:"center",sx:{bgcolor:"".concat(U("#10b981")," !important"),color:"#10b981 !important"},children:"Completed"})]})]}),(0,B.jsxs)(C.A,{children:[Pe&&(0,B.jsx)(L.r,{col:9}),!Pe&&0===Le.length&&(0,B.jsx)(S.A,{children:(0,B.jsx)(y.A,{colSpan:13,sx:{py:6},children:(0,B.jsxs)(m.A,{alignItems:"center",spacing:1.5,children:[(0,B.jsx)(s.A,{sx:{width:64,height:64,bgcolor:X("#94a3b8"),color:E.textMuted},children:(0,B.jsx)(D.Z2J,{size:28})}),(0,B.jsxs)(x.A,{variant:"subtitle1",sx:{fontWeight:700,color:E.textPrimary},children:["No ",Ze?"locations":"tenants"," to show"]}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textSecondary,textAlign:"center",maxWidth:360},children:We?"Try a different keyword.":Ne?"Something went wrong fetching the summary. Try a different filter.":"Pick a zone, tenant, or date range to load the summary."})]})})}),Le.map(((e,t)=>{const n=Ze?e.locationname:e.tenantname,o=xe===n,i=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,B.jsxs)(r.Fragment,{children:[(0,B.jsxs)(S.A,{sx:{transition:"background-color 0.15s","& td":{borderBottom:o?"none":"1px solid ".concat(E.divider),py:{xs:1,md:1.25},px:{xs:1,md:1.5}},"&:hover":{backgroundColor:o?"#fff":E.surfaceAlt},bgcolor:o?U(V):"transparent"},children:[(0,B.jsx)(y.A,{children:(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:E.textMuted},children:String(t+1).padStart(2,"0")})}),(0,B.jsx)(y.A,{children:(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,B.jsx)(_,{color:Ze?"#0ea5e9":V,size:36,children:Ze?(0,B.jsx)(D.gwi,{size:18}):(0,B.jsx)(D.nZo,{size:18})}),(0,B.jsxs)(m.A,{children:[(0,B.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:E.textPrimary,whiteSpace:"nowrap"},children:(Ze?e.locationname:e.tenantname)||"\u2014"}),(0,B.jsxs)(x.A,{variant:"caption",sx:{color:E.textSecondary},children:["ID #",Ze?e.locationid:e.tenantid]})]})]})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.totalorders,color:V,icon:(0,B.jsx)(D.F6S,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.Orderspending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.orderscancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.orderscompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriespending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:11})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(Q,{color:"#f59e0b",icon:(0,B.jsx)(D.YHz,{size:11}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection Amount",minWidth:90})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,B.jsx)(Q,{color:"#ef4444",icon:(0,B.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,B.jsx)(Q,{color:"#10b981",icon:(0,B.jsx)(D.xI$,{size:11}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(Q,{color:V,icon:(0,B.jsx)(D.YHz,{size:11}),label:ne(i).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})}),(0,B.jsx)(y.A,{align:"right",children:(0,B.jsx)(c.A,{title:o?"Hide rider breakdown":"View rider breakdown",placement:"top",children:(0,B.jsx)(b.A,{size:"small",onClick:()=>{const t=!o;he(t?n:null),t&&(je([]),Ze?He(e.locationid):Be(e.tenantid))},sx:{bgcolor:o?V:X(V),color:o?"#fff":V,border:"1px solid ".concat($(V)),"&:hover":{bgcolor:V,color:"#fff"}},children:o?(0,B.jsx)(D.Xbk,{size:16}):(0,B.jsx)(D.j1Q,{size:16})})})})]}),o&&(0,B.jsx)(S.A,{children:(0,B.jsx)(y.A,{colSpan:13,sx:{p:0,borderBottom:"1px solid ".concat(E.divider),bgcolor:U(V)},children:(0,B.jsx)(f.A,{in:o,timeout:"auto",unmountOnExit:!0,children:(0,B.jsx)(d.A,{sx:{p:{xs:1,md:2}},children:(0,B.jsxs)(a.A,{elevation:0,sx:{borderRadius:E.radiusCard/8,border:"1px solid",borderColor:E.borderSubtle,overflow:"hidden",boxShadow:E.shadowSoft},children:[(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,sx:{px:2,py:1.25,background:"#ffffff",borderBottom:"1px solid ".concat(E.borderSubtle)},children:[(0,B.jsx)(_,{color:V,size:28,selected:!0,children:(0,B.jsx)(D.Itr,{size:14})}),(0,B.jsxs)(x.A,{variant:"caption",sx:{fontWeight:700,color:E.textPrimary,letterSpacing:.6,textTransform:"uppercase"},children:["Rider Breakdown \xb7 ",Ze?e.locationname:e.tenantname]})]}),(0,B.jsxs)(v.A,{size:"small",children:[(0,B.jsx)(w.A,{children:(0,B.jsxs)(S.A,{sx:{"& th":{backgroundColor:E.surfaceAlt,color:E.textSecondary,fontSize:10,fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(E.borderSubtle),py:1,px:1.5}},children:[(0,B.jsx)(y.A,{children:"#"}),(0,B.jsx)(y.A,{children:"Rider"}),(0,B.jsx)(y.A,{align:"center",children:"Orders"}),(0,B.jsx)(y.A,{align:"center",children:"Deliveries"}),(0,B.jsx)(y.A,{align:"center",children:"Pending"}),(0,B.jsx)(y.A,{align:"center",children:"Cancelled"}),(0,B.jsx)(y.A,{align:"center",children:"Completed"}),(0,B.jsx)(y.A,{align:"center",children:"Collection"}),(0,B.jsx)(y.A,{align:"center",children:"KMS / Actual"}),(0,B.jsx)(y.A,{align:"center",children:"Amount"})]})}),(0,B.jsxs)(C.A,{children:[ge&&(0,B.jsx)(L.r,{col:6}),ge||me&&0!==me.length?me.map(((e,t)=>{const n=Math.max(Number(e.charges)||0,Number(e.deliveryamt)||0);return(0,B.jsxs)(S.A,{sx:{"& td":{borderBottom:"1px solid ".concat(E.divider),py:1,px:1.5},"&:hover":{backgroundColor:E.surfaceAlt}},children:[(0,B.jsx)(y.A,{children:(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:700,color:E.textMuted},children:String(t+1).padStart(2,"0")})}),(0,B.jsx)(y.A,{children:(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:.75,children:[(0,B.jsx)(_,{color:V,size:28,children:(0,B.jsx)(D.LTk,{size:14})}),(0,B.jsxs)(m.A,{children:[(0,B.jsx)(x.A,{variant:"subtitle2",sx:{fontWeight:700,color:E.textPrimary,whiteSpace:"nowrap"},children:"".concat(e.firstname||""," ").concat(e.lastname||"").trim()||"\u2014"}),(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textSecondary},children:e.ridercontact||"ID #".concat(e.userid)})]})]})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.orderscreated,color:V,icon:(0,B.jsx)(D.F6S,{size:10})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.totalorders,color:"#0ea5e9",icon:(0,B.jsx)(D.F6S,{size:10})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriespending,color:"#f59e0b",icon:(0,B.jsx)(D.tX0,{size:10})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescancelled,color:"#ef4444",icon:(0,B.jsx)(D.uDv,{size:10})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(ee,{value:e.deliveriescompleted,color:"#10b981",icon:(0,B.jsx)(D.mU9,{size:10})})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(Q,{color:"#f59e0b",icon:(0,B.jsx)(D.YHz,{size:10}),label:Number(e.collectionamt||0).toFixed(2),tooltip:"Collection",minWidth:80})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsxs)(m.A,{direction:"column",spacing:.5,alignItems:"center",children:[(0,B.jsx)(Q,{color:"#ef4444",icon:(0,B.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.kms||0).toFixed(2)," km"),tooltip:"KMS"}),(0,B.jsx)(Q,{color:"#10b981",icon:(0,B.jsx)(D.xI$,{size:10}),label:"".concat(Number(e.cumulativekms||0).toFixed(2)," km"),tooltip:"Actual KMS"})]})}),(0,B.jsx)(y.A,{align:"center",children:(0,B.jsx)(Q,{color:V,icon:(0,B.jsx)(D.YHz,{size:10}),label:ne(n).replace("\u20b9","").trim(),tooltip:"Total Amount",minWidth:100})})]},"".concat(e.userid,"-").concat(t))})):(0,B.jsx)(S.A,{children:(0,B.jsx)(y.A,{colSpan:10,sx:{py:3},children:(0,B.jsx)(x.A,{variant:"caption",sx:{color:E.textMuted,textAlign:"center",display:"block"},children:"No rider activity for this row."})})})]})]})]})})})})})]},"".concat(n,"-").concat(t))}))]})]})}),Le.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(k.A,{}),(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1.5,flexWrap:"wrap",sx:{px:2,py:1.5,background:"#ffffff"},children:[(0,B.jsxs)(m.A,{direction:"row",alignItems:"center",spacing:1,flexWrap:"wrap",children:[(0,B.jsx)(x.A,{variant:"caption",sx:{fontWeight:800,color:E.textSecondary,letterSpacing:.6,textTransform:"uppercase"},children:"Grand Total"}),(0,B.jsx)(z.A,{size:"small",label:"".concat(Ke.totalOrders," orders"),sx:{fontWeight:700,bgcolor:X(V),color:V,border:"1px solid ".concat($(V))}}),(0,B.jsx)(z.A,{size:"small",label:"".concat(Ke.deliComplete," delivered"),sx:{fontWeight:700,bgcolor:X("#10b981"),color:"#10b981",border:"1px solid ".concat($("#10b981"))}}),(0,B.jsx)(z.A,{size:"small",label:"".concat(Ke.deliPend," pending"),sx:{fontWeight:700,bgcolor:X("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat($("#f59e0b"))}})]}),(0,B.jsx)(z.A,{label:ne(Ke.amount),sx:{fontWeight:800,fontSize:13,color:"#fff",background:"linear-gradient(135deg, ".concat(V," 0%, ").concat(G," 100%)"),boxShadow:"0 6px 16px ".concat(q(V))}})]})]})]}),(0,B.jsx)(P.A,{open:ce,onClose:()=>de(!1),onSelect:e=>{re(e.startDate),le(e.endDate),pe(e.label)}})]})}},59212:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(89379),r=n(9950),i=n(93230),l=n(41413),a=n(77922),s=n(29925),c=n(26910),d=n(31222),x=n(44414);const h=(0,r.forwardRef)(((e,t)=>{let{setAppId:n,setLocoName:h,setPage:u,sx:p,textfeildSx:m,textfieldSx:j,pill:g=!1,accentColor:b="#6366f1",icon:f,placeholder:A="Select Zone",paperComponent:v}=e;const[w,S]=(0,r.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,r.useEffect)((()=>{0===w.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[w.length]);const y=e=>"".concat(b).concat(e),C=y("26"),k=y("18"),z=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"10px",bgcolor:"#ffffff",fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s","& fieldset":{borderColor:"#e2e8f0",borderWidth:1},"&:hover fieldset":{borderColor:"#cbd5e1"},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:b,borderWidth:1.5}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:"#94a3b8"}}:{},D=g&&(0,x.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(l.A,{sx:{width:24,height:24,bgcolor:k,color:b,transition:"background-color 0.15s, color 0.15s"},children:f||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(a.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,o.A)({},p),onChange:(e,t,o)=>{"clear"===o?(null===n||void 0===n||n(0),null===h||void 0===h||h(""),null===u||void 0===u||u(0)):t&&(null===n||void 0===n||n(t.applocationid),null===h||void 0===h||h(t.locationname),null===u||void 0===u||u(0))},renderInput:e=>g?(0,x.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,placeholder:A,InputProps:(0,o.A)((0,o.A)({},e.InputProps),{},{startAdornment:D}),sx:(0,o.A)((0,o.A)({},z),j||m||{})})):(0,x.jsx)(s.A,(0,o.A)((0,o.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,o.A)({},j||m||{})}))})}))},96646:(e,t,n)=>{n.d(t,{r:()=>s});var o=n(9213),r=n(21671),i=n(82917),l=n(93230),a=n(44414);const s=e=>{let{rowsPerPage:t=5,col:n=1}=e;return(0,a.jsx)(a.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,a.jsxs)(o.A,{children:[(0,a.jsx)(r.A,{children:(0,a.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,a.jsx)(r.A,{children:(0,a.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:n}).map(((e,t)=>(0,a.jsx)(r.A,{children:(0,a.jsxs)(l.A,{spacing:.5,children:[(0,a.jsx)(i.A,{variant:"text",width:100}),(0,a.jsx)(i.A,{variant:"text",width:80})]})},t))),(0,a.jsx)(r.A,{children:(0,a.jsx)(i.A,{variant:"text",width:150})}),(0,a.jsx)(r.A,{children:(0,a.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,a.jsx)(r.A,{align:"center",children:(0,a.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,a.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,a.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]);