"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[2117],{25713:(e,n,t)=>{t.d(n,{A:()=>A});var a=t(98587),r=t(58168),i=t(9950),l=t(72004),o=t(3484),s=t(59254),c=t(18463),d=t(45558),h=t(1614);function u(e){return(0,h.Ay)("MuiCardActions",e)}(0,d.A)("MuiCardActions",["root","spacing"]);var p=t(44414);const m=["disableSpacing","className"],x=(0,s.Ay)("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,!t.disableSpacing&&n.spacing]}})((e=>{let{ownerState:n}=e;return(0,r.A)({display:"flex",alignItems:"center",padding:8},!n.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),A=i.forwardRef((function(e,n){const t=(0,c.b)({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:s}=t,d=(0,a.A)(t,m),h=(0,r.A)({},t,{disableSpacing:i}),A=(e=>{const{classes:n,disableSpacing:t}=e,a={root:["root",!t&&"spacing"]};return(0,o.A)(a,u,n)})(h);return(0,p.jsx)(x,(0,r.A)({className:(0,l.A)(A.root,s),ownerState:h,ref:n},d))}))},32117:(e,n,t)=>{t.r(n),t.d(n,{default:()=>K});var a=t(89379),r=t(9950),i=t(14857),l=t(25713),o=t(60899),s=t(93230),c=t(82053),d=t(44414);const h=e=>{let{title:n,secondary:t,sx:r}=e;const h=(0,i.A)();return(0,d.jsx)(l.A,{sx:(0,a.A)({position:"sticky",top:"30px",bgcolor:h.palette.background.default,zIndex:10,width:"100%"},r),children:(0,d.jsx)(o.Ay,{container:!0,children:(0,d.jsx)(o.Ay,{item:!0,xs:12,children:(0,d.jsxs)(s.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:2,sx:{flexWrap:"wrap"},children:[(0,d.jsx)(c.A,{variant:"h3",children:n}),t]})})})})};var u=t(26910),p=t(36150),m=t(13838),x=t(69780),A=t(9213),g=t(21671),b=t(25277),j=t(83274),f=t(77922),v=t(29925),w=t(1320),S=t(15769),y=t(34075),D=t(25333),C=t(16491),k=t(74745),M=t(85970),R=t(47644),P=t(4159),I=t.n(P);const W=(0,t(23235).A)((0,d.jsx)("path",{d:"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"}),"CalendarMonth");var z=t(81425),Y=t(50027),L=t(52351),N=t(35678),F=t(59212),O=t(20466),T=t(96646),E=t(36220);function H(e){return new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:2}).format(e)}function K(){const e=(0,i.A)(),n=(0,r.useRef)(null),t=(0,r.useRef)(null),[l,o]=(0,r.useState)(0),[P,E]=(0,r.useState)(I()().format("YYYY-MM-DD")),[K,q]=(0,r.useState)(I()().format("YYYY-MM-DD")),[V,X]=(0,r.useState)("All"),[_,B]=(0,r.useState)(!1),[U,J]=(0,r.useState)(null),[Z,G]=(0,r.useState)("Today"),[Q,$]=(0,r.useState)(0),[ee,ne]=(0,r.useState)(0),[te,ae]=(0,r.useState)(0),[re,ie]=(0,r.useState)(0),[le,oe]=(0,r.useState)(0),[se,ce]=(0,r.useState)(0),[de,he]=(0,r.useState)(0),[ue,pe]=(0,r.useState)(0),[me,xe]=(0,r.useState)([]),Ae=localStorage.getItem("userid"),[ge,be]=(0,r.useState)(!1),[je,fe]=(0,r.useState)(0),[ve,we]=(0,r.useState)(0),[Se,ye]=(0,r.useState)(null),[De,Ce]=(0,r.useState)(null),[ke,Me]=(0,r.useState)(0);(0,r.useEffect)((()=>{console.log("openRow",U)}),[U]),(0,r.useEffect)((()=>{we(0),ye(null),fe(0),Ce(null),J(null)}),[l]),(0,r.useEffect)((()=>{fe(0),Ce(null),J(null)}),[ve]);const Re=[{id:"s.no",numeric:!1,disablePadding:!0,label:"#",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"clients",numeric:"true",disablePadding:!1,label:ve?"Location":"Tenant",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"all",numeric:"center",disablePadding:!1,label:"All",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"orders",numeric:"center",disablePadding:!1,label:"orders",rowSpan:1,colSpan:3,bgcolor:"#ffcdd2"},{id:"deliveries",numeric:"center",disablePadding:!1,label:"deliveries",rowSpan:1,colSpan:3,bgcolor:"#f8bbd0"},{id:"Charges",numeric:"center",disablePadding:!1,label:"Collection Amt",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"kilometer",numeric:"center",disablePadding:!1,label:"Kms/Actual Kms",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"Amount",numeric:"center",disablePadding:!0,label:"Amount",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"},{id:"action",numeric:"center",disablePadding:!0,label:"Action",rowSpan:2,colSpan:1,bgcolor:"#f3e5f5"}],Pe=[{id:"pending",numeric:!1,disablePadding:!1,label:"pending",rowSpan:1,colSpan:1,bgcolor:"#ffcdd2"},{id:"cancelled",numeric:!1,disablePadding:!1,label:"cancelled",rowSpan:1,colSpan:1,bgcolor:"#ffcdd2"},{id:"completed",numeric:!1,disablePadding:!1,label:"completed",rowSpan:1,colSpan:1,bgcolor:"#ffcdd2"},{id:"pending",numeric:!1,disablePadding:!1,label:"pending",rowSpan:1,colSpan:1,bgcolor:"#f8bbd0"},{id:"cancelled",numeric:!1,disablePadding:!1,label:"cancelled",rowSpan:1,colSpan:1,bgcolor:"#f8bbd0"},{id:"completed",numeric:!1,disablePadding:!1,label:"completed",rowSpan:1,colSpan:1,bgcolor:"#f8bbd0"}],Ie=e=>0!==Number(e)?"red":"inherit",We=e=>(0,d.jsx)(c.A,{sx:{color:Ie(e)},children:e});function ze(){return(0,d.jsxs)(x.A,{children:[(0,d.jsx)(A.A,{children:Re.map((e=>(0,d.jsx)(g.A,{align:"center"==e.numeric?"center":"true"==e.numeric?"left":"right",padding:e.disablePadding?"none":"normal",rowSpan:e.rowSpan,colSpan:e.colSpan,sx:{bgcolor:e.bgcolor},children:e.label},e.id)))}),(0,d.jsx)(A.A,{children:Pe.map((e=>(0,d.jsx)(g.A,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",rowSpan:e.rowSpan,colSpan:e.colSpan,sx:{bgcolor:e.bgcolor},children:e.label},e.id)))})]})}const{data:Ye,isLoading:Le,isError:Ne,error:Fe}=(0,p.I)({queryKey:[l,ve,je,P,K],queryFn:ve?z.U6:z.DK}),{data:Oe}=(0,p.I)({queryKey:["tenantlist",l],queryFn:()=>(0,z.Mn)(l),enabled:0!==l}),{data:Te}=(0,p.I)({queryKey:["gettenantlocations",ve],queryFn:()=>(0,z.DL)(ve),enabled:0!==ve});(0,r.useEffect)((()=>{(()=>{let e=0,n=0,t=0,a=0,r=0,i=0,l=0,o=0;Ye&&Ye.forEach((s=>{e+=s.charges,n+=s.totalorders,t+=s.Orderspending,a+=s.orderscompleted,r+=s.orderscancelled,i+=s.deliveriespending,l+=s.deliveriescompleted,o+=s.deliveriescancelled})),$(e),ne(n),ae(t),ie(a),oe(r),ce(i),he(l),pe(o)})()}),[Ye]);return(0,r.useEffect)((()=>{(async()=>{try{const e=[...(await u.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(Ae))).data.details,{locationname:"All",applocationid:0}];console.log("fetchAppLocations",e),setLocations(e)}catch(e){console.log("locationRes",e)}})()}),[]),Ne&&console.log("An error has occurred:(isErrorReports) "+Fe.message),(0,d.jsxs)(d.Fragment,{children:[(ge||Le)&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(L.A,{})}),(0,d.jsx)(h,{title:"Orders Summary",secondary:(0,d.jsx)(F.A,{ref:n,locaName:V,setAppId:o,setLocoName:X,setPage:Me,sx:{minWidth:280,width:"100%",flex:{custom550:0}}})}),(0,d.jsxs)(s.A,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1,sx:{border:"1px solid",borderColor:"bg.main",p:2},children:[(0,d.jsx)(s.A,{children:P&&K&&(0,d.jsxs)(s.A,{direction:"row",gap:2,flexWrap:"wrap",children:[(0,d.jsx)(b.A,{label:"Orders-".concat(Z),color:"primary",variant:"light",size:"small"}),(0,d.jsx)(j.A,{title:"Date Filter",placement:"top",children:(0,d.jsx)(b.A,{label:(0,d.jsxs)(c.A,{noWrap:!0,color:"secondary",children:[I()(P).format("DD/MM/YYYY")," - ",I()(K).format("DD/MM/YYYY")]}),variant:"combined",color:"warning",size:"small",deleteIcon:(0,d.jsx)(W,{style:{fontSize:18}}),onDelete:()=>{B(!0)},onClick:()=>B(!0),sx:{cursor:"pointer"}})})]})}),(0,d.jsxs)(s.A,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"wrap",flexGrow:1,justifyContent:{xs:"start",custom950:"right"}},children:[(0,d.jsx)(f.A,{options:Oe||[],value:Se,sx:{minWidth:250,flex:{xs:1,custom950:0}},onOpen:e=>{l||(e.preventDefault(),(0,O.k)("Please select a your app location first!","warning",3e3),setTimeout((()=>{var e;null===(e=n.current)||void 0===e||e.focus()}),0))},onChange:(e,n,t)=>{"clear"===t?(we(0),ye(null),fe(0),Ce(null)):(we((null===n||void 0===n?void 0:n.tenantid)||0),ye(n),fe(n.locationid),Ce(null))},renderInput:e=>(0,d.jsx)(v.A,(0,a.A)((0,a.A)({},e),{},{inputRef:t,label:"Select Tenant"}))}),(0,d.jsx)(f.A,{options:Te||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:De,sx:{minWidth:250,flex:{xs:1,custom950:0}},onOpen:e=>{l||ve?ve||(e.preventDefault(),(0,O.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=t.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,O.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=n.current)||void 0===e||e.focus()}),0))},onChange:(e,n,t)=>{"clear"===t?(fe(0),Ce(null)):(fe(n.locationid||0),Ce(n))},renderInput:e=>(0,d.jsx)(v.A,(0,a.A)((0,a.A)({},e),{},{label:"Select Location"}))})]})]}),(0,d.jsxs)(Y.A,{content:!1,children:[(0,d.jsx)(w.A,{sx:{overflow:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:e.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:e.palette.primary.lighter,cursor:"pointer"}},children:(0,d.jsxs)(S.A,{children:[(0,d.jsx)(ze,{}),(0,d.jsxs)(y.A,{children:[Le&&(0,d.jsx)(T.r,{col:8}),0==(null===Ye||void 0===Ye?void 0:Ye.length)&&(0,d.jsx)(A.A,{children:(0,d.jsx)(g.A,{colSpan:13,rowSpan:40,children:(0,d.jsx)(s.A,{width:"100%",direction:"row",justifyContent:"center",children:(0,d.jsx)(m.A,{})})})}),(0!=(null===Ye||void 0===Ye?void 0:Ye.length)||Ye)&&(null===Ye||void 0===Ye?void 0:Ye.map(((e,n)=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(A.A,{children:[(0,d.jsx)(g.A,{children:n+1}),(0,d.jsx)(g.A,{align:"left",children:(0,d.jsxs)(s.A,{spacing:1,children:[(0,d.jsxs)(c.A,{sx:{whiteSpace:"noWrap"},children:[ve?e.locationname:e.tenantname," "]}),(0,d.jsxs)(c.A,{variant:"subtitle2",children:["Id : ",ve?e.locationid:e.tenantid," "]})]})}),(0,d.jsx)(g.A,{align:"center",children:We(e.totalorders)}),(0,d.jsx)(g.A,{align:"center",children:We(e.Orderspending)}),(0,d.jsx)(g.A,{align:"center",children:We(e.orderscancelled)}),(0,d.jsx)(g.A,{align:"center",children:We(e.orderscompleted)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriespending)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriescancelled)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriescompleted)}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(b.A,{size:"small",label:"\u20b9".concat(Number(e.collectionamt).toFixed(2)),variant:"combined",color:e.collectionamt?"warning":"secondary",sx:{cursor:"pointer",minWidth:80}})})," ",(0,d.jsxs)(g.A,{align:"center",children:[(0,d.jsx)(j.A,{title:"kms",placement:"top",children:(0,d.jsx)(b.A,{size:"small",label:"".concat(Number(e.kms).toFixed(2)),color:e.kms?"error":"secondary",variant:"combined",sx:{mb:1,cursor:"pointer",minWidth:80}})}),(0,d.jsx)("br",{}),(0,d.jsx)(j.A,{title:"Actual kms",placement:"bottom",children:(0,d.jsx)(b.A,{size:"small",label:Number(e.cumulativekms).toFixed(2),color:e.cumulativekms?"success":"secondary",variant:"combined",sx:{cursor:"pointer",minWidth:80}})})]}),(0,d.jsx)(g.A,{align:"right",children:(0,d.jsx)(j.A,{title:"Delivery Amount",placement:"top",children:(0,d.jsx)(b.A,{size:"small",label:H(e.charges>=e.deliveryamt?e.charges:e.deliveryamt),color:e.deliveryamt||e.charges?"primary":"secondary",variant:"combined",sx:{cursor:"pointer",minWidth:100}})})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(D.A,{"aria-label":"expand row",size:"small",onClick:()=>{if(ve){const n=U!==e.tenantname;if(J(n?e.tenantname:null),!n)return;xe([]),(async e=>{try{const n=await u.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getriderlocationsummary/?&tenantid=").concat(ve,"&locationid=").concat(e,"&fromdate=").concat(P,"&todate=").concat(K));console.log("riderRes",n.data.details),xe(n.data.details)}catch(n){console.log("riderRes",n)}})(e.locationid)}else{const n=U!==e.locationname;if(J(n?e.locationname:null),!n)return;xe([]),(async e=>{be(!0);try{const n=await u.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/getuserreportsummary/?&tenantid=").concat(e,"&fromdate=").concat(P,"&todate=").concat(K));console.log("riderRes",n.data.details),xe(n.data.details)}catch(n){console.log("riderRes",n)}finally{be(!1)}})(e.tenantid)}},sx:{bgcolor:U===e.tenantname?"primary.main":null,color:U===e.tenantname?"white":null,"&:hover":{bgcolor:U===e.tenantname?"primary.main":"#e1bee7"}},children:(0,d.jsx)(j.A,{title:"View Riders",placement:"top",children:ve?U===e.tenantname?(0,d.jsx)(R.A,{}):(0,d.jsx)(M.A,{}):U===e.locationname?(0,d.jsx)(R.A,{}):(0,d.jsx)(M.A,{})})})})]},e.tenantname||e.locationname),(ve?U===e.tenantname:U===e.locationname)&&(0,d.jsx)(A.A,{children:(0,d.jsx)(g.A,{style:{paddingBottom:0,paddingTop:0},colSpan:15,children:(0,d.jsx)(C.A,{sx:{margin:1,border:"1px solid",borderColor:"secondary.lighter"},children:(0,d.jsxs)(S.A,{size:"small",children:[(0,d.jsx)(x.A,{children:(0,d.jsxs)(A.A,{sx:{bgcolor:"primary.lighter"},children:[(0,d.jsx)(g.A,{children:"#"}),(0,d.jsx)(g.A,{children:"Rider"}),(0,d.jsx)(g.A,{align:"center",children:"Orders"}),(0,d.jsx)(g.A,{align:"center",children:"Deliveries"}),(0,d.jsx)(g.A,{align:"center",children:"Pending"}),(0,d.jsx)(g.A,{align:"center",children:"Cancelled"}),(0,d.jsx)(g.A,{align:"center",children:"Completed"}),(0,d.jsx)(g.A,{align:"center",children:"Collection Amt"}),(0,d.jsx)(g.A,{align:"center",children:"kms/Actual kms"}),(0,d.jsx)(g.A,{align:"center",children:"Charges"})]})}),(0,d.jsxs)(y.A,{children:[ge&&(0,d.jsx)(T.r,{col:5}),null===me||void 0===me?void 0:me.map(((e,n)=>(0,d.jsxs)(A.A,{children:[(0,d.jsx)(g.A,{children:n+1}),(0,d.jsx)(g.A,{align:"left",children:(0,d.jsxs)(s.A,{children:[(0,d.jsx)(c.A,{sx:{whiteSpace:"noWrap"},children:" ".concat(e.firstname," ").concat(e.lastname)}),(0,d.jsx)(c.A,{variant:"subtitle2",sx:{whiteSpace:"noWrap"},children:e.ridercontact}),(0,d.jsxs)(c.A,{variant:"subtitle2",sx:{whiteSpace:"noWrap"},children:["ID : ",e.userid]})]})}),(0,d.jsx)(g.A,{align:"center",children:We(e.orderscreated)}),(0,d.jsx)(g.A,{align:"center",children:We(e.totalorders)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriespending)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriescancelled)}),(0,d.jsx)(g.A,{align:"center",children:We(e.deliveriescompleted)}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(b.A,{size:"small",label:H(e.collectionamt),color:e.collectionamt?"warning":"secondary",variant:"combined",sx:{cursor:"pointer",minWidth:80}})}),(0,d.jsxs)(g.A,{align:"center",children:[(0,d.jsx)(j.A,{title:"kms",placement:"top",children:(0,d.jsx)(b.A,{size:"small",label:e.kms.toFixed(2),color:e.kms?"error":"secondary",variant:"combined",sx:{mb:1,cursor:"pointer",minWidth:80}})}),(0,d.jsx)("br",{}),(0,d.jsx)(j.A,{title:"Actual kms",placement:"top",children:(0,d.jsx)(b.A,{size:"small",label:e.cumulativekms.toFixed(2),color:e.cumulativekms?"success":"secondary",variant:"combined",sx:{cursor:"pointer",minWidth:80}})})]}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(j.A,{title:"Delivery Amount",placement:"top",children:(0,d.jsx)(b.A,{size:"small",label:H(e.charges>=e.deliveryamt?e.charges:e.deliveryamt),color:e.deliveryamt||e.charges?"primary":"secondary",variant:"combined",sx:{cursor:"pointer",minWidth:100}})})})]},e.tenantname)))]})]})})})})]})))),0!=(null===Ye||void 0===Ye?void 0:Ye.length)&&Ye&&(0,d.jsxs)(A.A,{sx:{},children:[(0,d.jsx)(g.A,{colSpan:2,children:(0,d.jsx)(c.A,{variant:"h5",children:"Total"})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(c.A,{variant:"h5",children:ee})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(c.A,{variant:"h5",children:te})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsxs)(c.A,{variant:"h5",children:[" ",le]})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(c.A,{variant:"h5",children:re})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(c.A,{variant:"h5",children:se})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsxs)(c.A,{variant:"h5",children:[" ",ue]})}),(0,d.jsx)(g.A,{align:"center",children:(0,d.jsx)(c.A,{variant:"h5",children:de})}),(0,d.jsx)(g.A,{}),(0,d.jsx)(g.A,{}),(0,d.jsx)(g.A,{align:"right",sx:{pr:-2},children:(0,d.jsx)(c.A,{variant:"h5",children:H(Q)})}),(0,d.jsx)(g.A,{})]})]})]})}),(0,d.jsx)(k.A,{})]}),(0,d.jsx)(N.A,{open:_,onClose:()=>B(!1),onSelect:e=>{E(e.startDate),q(e.endDate),G(e.label),console.log("Selected Date Range:",e)}})]})}I().extend(E)},35678:(e,n,t)=>{t.d(n,{A:()=>v});var a=t(9950),r=t(96583),i=t(40033),l=t(82053),o=t(28170),s=t(93230),c=t(82223),d=t(55916),h=t(4159),u=t.n(h),p=t(56712),m=t(81417),x=t(96600),A=t(53132),g=t(94289),b=t(57326),j=t(50624),f=t(44414);const v=e=>{let{open:n,onClose:t,onSelect:h}=e;const[v,w]=(0,a.useState)(null);return(0,f.jsxs)(r.A,{open:n,onClose:t,children:[(0,f.jsx)(i.A,{align:"left",children:(0,f.jsx)(l.A,{variant:"h4",children:"Select Filter Options"})}),(0,f.jsx)(o.A,{sx:{width:"100%"},className:"datedialog",children:(0,f.jsx)(d.U,{open:n,toggle:t,id:"daterange1",onChange:e=>{w({startDate:u()(e.startDate).format("YYYY-MM-DD"),endDate:u()(e.endDate).format("YYYY-MM-DD"),label:e.label||"custom"})},definedRanges:[{label:"Today",startDate:new Date,endDate:new Date},{label:"Yesterday",startDate:(0,p.A)(new Date,-1),endDate:(0,p.A)(new Date,-1)},{label:"Tomorrow",startDate:(0,p.A)(new Date,1),endDate:(0,p.A)(new Date,1)},{label:"This Week",startDate:(0,m.A)(new Date),endDate:(0,x.A)(new Date)},{label:"Last Week",startDate:(0,m.A)((0,A.A)(new Date,-1)),endDate:(0,x.A)((0,A.A)(new Date,-1))},{label:"Last 7 Days",startDate:(0,A.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,j.A)(new Date,-1)),endDate:(0,b.A)((0,j.A)(new Date,-1))}]})}),(0,f.jsx)(s.A,{direction:"row",justifyContent:"flex-end",sx:{width:"100%",p:2},children:(0,f.jsx)(c.A,{variant:"contained",size:"small",onClick:()=>{v?(h(v),t()):t()},children:"OK"})})]})}},47644:(e,n,t)=>{var a=t(24994);n.A=void 0;var r=a(t(79526)),i=t(44414);n.A=(0,r.default)((0,i.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp")},59212:(e,n,t)=>{t.d(n,{A:()=>u});var a=t(89379),r=t(9950),i=t(93230),l=t(41413),o=t(77922),s=t(29925),c=t(26910),d=t(31222),h=t(44414);const u=(0,r.forwardRef)(((e,n)=>{let{setAppId:t,setLocoName:u,setPage:p,sx:m,textfeildSx:x,textfieldSx:A,pill:g=!1,accentColor:b="#6366f1",icon:j,placeholder:f="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 n=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(n.data.status){const e=[...n.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),D=y("08"),C=y("26"),k=y("55"),M=y("18"),R=g?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:D,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:b},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(C)},"&.Mui-focused fieldset":{borderColor:b,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:b}}:{},P=g&&(0,h.jsx)(i.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,h.jsx)(l.A,{sx:{width:24,height:24,bgcolor:M,color:b,transition:"background-color 0.15s, color 0.15s"},children:j||(0,h.jsx)(d.HPi,{size:14})})});return(0,h.jsx)(o.A,{id:"location-autocomplete",options:w||[],getOptionLabel:e=>{var n;return null!==(n=null===e||void 0===e?void 0:e.locationname)&&void 0!==n?n:""},PaperComponent:v,sx:(0,a.A)({},m),onChange:(e,n,a)=>{"clear"===a?(null===t||void 0===t||t(0),null===u||void 0===u||u(""),null===p||void 0===p||p(0)):n&&(null===t||void 0===t||t(n.applocationid),null===u||void 0===u||u(n.locationname),null===p||void 0===p||p(0))},renderInput:e=>g?(0,h.jsx)(s.A,(0,a.A)((0,a.A)({},e),{},{inputRef:n,placeholder:f,InputProps:(0,a.A)((0,a.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,a.A)((0,a.A)({},R),A||x||{})})):(0,h.jsx)(s.A,(0,a.A)((0,a.A)({},e),{},{inputRef:n,label:"Select Zones",sx:(0,a.A)({},A||x||{})}))})}))},82917:(e,n,t)=>{t.d(n,{A:()=>I});var a=t(57528),r=t(98587),i=t(58168),l=t(9950),o=t(72004),s=t(88283),c=t(3484);function d(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function h(e){return parseFloat(e)}var u=t(97497),p=t(59254),m=t(18463),x=t(45558),A=t(1614);function g(e){return(0,A.Ay)("MuiSkeleton",e)}(0,x.A)("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);var b,j,f,v,w=t(44414);const S=["animation","className","component","height","style","variant","width"];let y,D,C,k;const M=(0,s.i7)(y||(y=b||(b=(0,a.A)(["\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.4;\n }\n\n 100% {\n opacity: 1;\n }\n"])))),R=(0,s.i7)(D||(D=j||(j=(0,a.A)(["\n 0% {\n transform: translateX(-100%);\n }\n\n 50% {\n /* +0.5s of delay between each loop */\n transform: translateX(100%);\n }\n\n 100% {\n transform: translateX(100%);\n }\n"])))),P=(0,p.Ay)("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[t.variant],!1!==t.animation&&n[t.animation],t.hasChildren&&n.withChildren,t.hasChildren&&!t.width&&n.fitContent,t.hasChildren&&!t.height&&n.heightAuto]}})((e=>{let{theme:n,ownerState:t}=e;const a=d(n.shape.borderRadius)||"px",r=h(n.shape.borderRadius);return(0,i.A)({display:"block",backgroundColor:n.vars?n.vars.palette.Skeleton.bg:(0,u.X4)(n.palette.text.primary,"light"===n.palette.mode?.11:.13),height:"1.2em"},"text"===t.variant&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:"".concat(r).concat(a,"/").concat(Math.round(r/.6*10)/10).concat(a),"&:empty:before":{content:'"\\00a0"'}},"circular"===t.variant&&{borderRadius:"50%"},"rounded"===t.variant&&{borderRadius:(n.vars||n).shape.borderRadius},t.hasChildren&&{"& > *":{visibility:"hidden"}},t.hasChildren&&!t.width&&{maxWidth:"fit-content"},t.hasChildren&&!t.height&&{height:"auto"})}),(e=>{let{ownerState:n}=e;return"pulse"===n.animation&&(0,s.AH)(C||(C=f||(f=(0,a.A)(["\n animation: "," 2s ease-in-out 0.5s infinite;\n "]))),M)}),(e=>{let{ownerState:n,theme:t}=e;return"wave"===n.animation&&(0,s.AH)(k||(k=v||(v=(0,a.A)(["\n position: relative;\n overflow: hidden;\n\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n\n &::after {\n animation: "," 2s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n ",",\n transparent\n );\n content: '';\n position: absolute;\n transform: translateX(-100%); /* Avoid flash during server-side hydration */\n bottom: 0;\n left: 0;\n right: 0;\n top: 0;\n }\n "]))),R,(t.vars||t).palette.action.hover)})),I=l.forwardRef((function(e,n){const t=(0,m.b)({props:e,name:"MuiSkeleton"}),{animation:a="pulse",className:l,component:s="span",height:d,style:h,variant:u="text",width:p}=t,x=(0,r.A)(t,S),A=(0,i.A)({},t,{animation:a,component:s,variant:u,hasChildren:Boolean(x.children)}),b=(e=>{const{classes:n,variant:t,animation:a,hasChildren:r,width:i,height:l}=e,o={root:["root",t,a,r&&"withChildren",r&&!i&&"fitContent",r&&!l&&"heightAuto"]};return(0,c.A)(o,g,n)})(A);return(0,w.jsx)(P,(0,i.A)({as:s,ref:n,className:(0,o.A)(b.root,l),ownerState:A},x,{style:(0,i.A)({width:p,height:d},h)}))}))},85970:(e,n,t)=>{var a=t(24994);n.A=void 0;var r=a(t(79526)),i=t(44414);n.A=(0,r.default)((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown")},96646:(e,n,t)=>{t.d(n,{r:()=>s});var a=t(9213),r=t(21671),i=t(82917),l=t(93230),o=t(44414);const s=e=>{let{rowsPerPage:n=5,col:t=1}=e;return(0,o.jsx)(o.Fragment,{children:Array.from(new Array(n)).map(((e,n)=>(0,o.jsxs)(a.A,{children:[(0,o.jsx)(r.A,{children:(0,o.jsx)(i.A,{variant:"circular",width:24,height:24})}),(0,o.jsx)(r.A,{children:(0,o.jsx)(i.A,{variant:"text",width:30})}),Array.from({length:t}).map(((e,n)=>(0,o.jsx)(r.A,{children:(0,o.jsxs)(l.A,{spacing:.5,children:[(0,o.jsx)(i.A,{variant:"text",width:100}),(0,o.jsx)(i.A,{variant:"text",width:80})]})},n))),(0,o.jsx)(r.A,{children:(0,o.jsx)(i.A,{variant:"text",width:150})}),(0,o.jsx)(r.A,{children:(0,o.jsx)(i.A,{variant:"rounded",width:60,height:24})}),(0,o.jsx)(r.A,{align:"center",children:(0,o.jsxs)(l.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,o.jsx)(i.A,{variant:"circular",width:28,height:28}),(0,o.jsx)(i.A,{variant:"circular",width:28,height:28})]})})]},n)))})}}}]);