Files
Express_console_build/build/static/js/768.77cfb3b5.chunk.js

2 lines
42 KiB
JavaScript

/*! For license information please see 768.77cfb3b5.chunk.js.LICENSE.txt */
(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[768],{795:(e,t,n)=>{"use strict";t.CSVLink=void 0;var r=i(n(91078)),a=i(n(49462));function i(e){return e&&e.__esModule?e:{default:e}}r.default,t.CSVLink=a.default},8010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PropsNotForwarded=t.defaultProps=t.propTypes=void 0;var r,a=n(9950),i=((r=a)&&r.__esModule,n(11942));t.propTypes={data:(0,i.oneOfType)([i.string,i.array,i.func]).isRequired,headers:i.array,target:i.string,separator:i.string,filename:i.string,uFEFF:i.bool,onClick:i.func,asyncOnClick:i.bool,enclosingCharacter:i.string},t.defaultProps={separator:",",filename:"generatedBy_react-csv.csv",uFEFF:!0,asyncOnClick:!1,enclosingCharacter:'"'},t.PropsNotForwarded=["data","headers"]},17322:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>we});var r=n(89379),a=n(9950),i=n(27182),o=n(26910),l=n(60010),s=n(36150),c=n(13838),d=n(14857),u=n(99810),p=n(49029),h=n(47113),f=n(33516),x=n(82215),m=n(2527),v=n.n(m),g=(n(55392),n(4159)),y=n.n(g),A=n(93230),b=n(82053),j=n(25277),w=n(16491),k=n(57560),S=n(94826),C=n(44414),M=n(36220);y().extend(M);const z=new(v().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),W=new(v().Icon)({iconUrl:"https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],shadowSize:[41,41]}),P=e=>{let{coordinates:t,additionalProps:n,order:r,setMapOpen:i}=e;console.log("additionalProps",n);const o=(0,a.useRef)(null),l=(0,d.A)(),[s,c]=(0,a.useState)([]),[m,v]=(0,a.useState)(!1);if((0,a.useEffect)((()=>{if(o.current&&t.length>0){const e=[[Math.min(...t.map((e=>e.lat))),Math.min(...t.map((e=>e.lng)))],[Math.max(...t.map((e=>e.lat))),Math.max(...t.map((e=>e.lng)))]];o.current.fitBounds(e)}}),[t]),(0,a.useEffect)((()=>{(async()=>{if(v(!0),t.length<2)return c([]),void v(!1);const e=t[0],n=t[t.length-1],r="https://router.project-osrm.org/route/v1/driving/".concat(e.lng,",").concat(e.lat,";").concat(n.lng,",").concat(n.lat,"?overview=full&geometries=geojson");try{var a;const e=await fetch(r),t=await e.json();if(null!==(a=t.routes)&&void 0!==a&&a.length){const e=t.routes[0].geometry.coordinates.map((e=>{let[t,n]=e;return{lat:n,lng:t}}));c(e)}}catch(i){console.error("OSRM Error:",i)}finally{v(!1)}})()}),[t]),!t||0===t.length)return null;const g=t[0],M=t[t.length-1],P=t[Math.floor(t.length/2)],O=e=>{let{label:t,value:n}=e;return(0,C.jsxs)(A.A,{direction:"row",spacing:1,alignItems:"center",children:[(0,C.jsxs)(b.A,{variant:"subtitle1",sx:{fontWeight:600},children:[t,":"]}),(0,C.jsx)(j.A,{label:n||"0.00",color:"primary",sx:{fontWeight:700}})]})};return(0,C.jsxs)(w.A,{sx:{width:"100%",height:"100vh",position:"relative",overflow:"hidden"},children:[m&&(0,C.jsx)(S.A,{}),(0,C.jsx)(j.A,{label:"Close",icon:(0,C.jsx)(k.A,{style:{fontSize:18}}),onClick:()=>i(!1),sx:{position:"absolute",top:12,right:12,zIndex:2e3,bgcolor:l.palette.error.main,color:"#fff",fontWeight:600,borderRadius:"12px",px:1.5,py:.5,boxShadow:l.shadows[4],cursor:"pointer","& .MuiChip-icon":{color:"#fff"}}}),(0,C.jsxs)(u.W,{center:P,zoom:14,scrollWheelZoom:!0,style:{height:"100%",width:"100%"},ref:o,children:[(0,C.jsx)(p.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),(0,C.jsx)(h.p,{position:g,icon:z,children:(0,C.jsx)(f.m,{direction:"bottom",children:"Pickup: ".concat(y()(n.riderStart).format("DD-MM-YYYY hh:mm A"))})}),(0,C.jsx)(h.p,{position:M,icon:W,children:(0,C.jsx)(f.m,{direction:"bottom",children:"Drop: ".concat(y()(n.riderEnd).format("DD-MM-YYYY hh:mm A"))})}),s.length>0&&(0,C.jsx)(x.R,{positions:s,pathOptions:{color:"blue",weight:5}})]}),(0,C.jsx)(w.A,{sx:{position:"absolute",bottom:0,width:"100%",bgcolor:"rgba(255,255,255,0.96)",p:2,boxShadow:l.shadows[3],zIndex:1500},children:(0,C.jsxs)(A.A,{direction:"row",flexWrap:"wrap",rowGap:1.5,columnGap:3,alignItems:"center",children:[(0,C.jsx)(O,{label:"Tenant",value:null===r||void 0===r?void 0:r.tenantname}),(0,C.jsx)(O,{label:"Rider",value:null===r||void 0===r?void 0:r.ridername}),(0,C.jsx)(O,{label:"Pickup",value:null===r||void 0===r?void 0:r.pickupcustomer}),(0,C.jsx)(O,{label:"Drop",value:null===r||void 0===r?void 0:r.deliverycustomer}),(0,C.jsx)(O,{label:"Kms",value:null===r||void 0===r?void 0:r.kms}),(0,C.jsx)(O,{label:"Actual Kms",value:null===r||void 0===r?void 0:r.actualkms}),(0,C.jsx)(O,{label:"Rider Kms",value:null===r||void 0===r?void 0:r.riderkms})]})})]})};var O=n(43302),D=n(41557),L=n(55158),R=n(77922),I=n(29925),_=n(28810),E=n(83274),Y=n(82223),T=n(1320),F=n(15769),N=n(69780),H=n(9213),U=n(21671),V=n(34075),q=n(82917),K=n(74745),B=n(96583),G=n(40033),J=n(28170),Q=n(249),Z=n(26050),$=n(79739),X=n(58168);const ee={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 327c-29.9 0-58 11.6-79.2 32.8A111.6 111.6 0 00400 439c0 29.9 11.7 58 32.8 79.2A111.6 111.6 0 00512 551c29.9 0 58-11.7 79.2-32.8C612.4 497 624 468.9 624 439c0-29.9-11.6-58-32.8-79.2S541.9 327 512 327zm342.6-37.9a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 615c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}}]},name:"environment",theme:"filled"};var te=n(61187),ne=function(e,t){return a.createElement(te.A,(0,X.A)({},e,{ref:t,icon:ee}))};const re=a.forwardRef(ne);var ae=n(19474);const ie={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};var oe=function(e,t){return a.createElement(te.A,(0,X.A)({},e,{ref:t,icon:ie}))};const le=a.forwardRef(oe);var se=n(64367),ce=n(81425),de=n(50027),ue=n(90376),pe=n(52351),he=n(8881),fe=n(35678),xe=n(56311),me=n(58691),ve=n(59212),ge=n(20466);function ye(e){let{rows:t=5,columns:n=6,height:r=40}=e;return(0,C.jsx)(C.Fragment,{children:[...Array(t)].map(((e,t)=>(0,C.jsx)(H.A,{children:[...Array(n)].map(((e,t)=>(0,C.jsx)(U.A,{children:(0,C.jsx)(q.A,{variant:"rectangular",height:r,width:70,animation:"wave"})},t)))},t)))})}var Ae=n(36220);y().extend(Ae);const be=(e,t,n)=>{(0,he.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:n||1500})},je=[{id:"sno",disablePadding:!1,label:"#"},{id:"map",disablePadding:!1,label:"^"},{id:"tenantname",disablePadding:!1,label:"Client"},{id:"Pickup loco",disablePadding:!1,label:"Pickup"},{id:"Delivery loco",disablePadding:!1,label:"Drop"},{id:"order status",disablePadding:!1,label:"status"},{id:"assigned",disablePadding:!1,label:"assigned"},{id:"Accepted",disablePadding:!1,label:"Accepted"},{id:"arrived",disablePadding:!1,label:"arrived"},{id:"picked",disablePadding:!1,label:"picked"},{id:"active",disablePadding:!1,label:"active"},{id:"Delivered",disablePadding:!1,label:"Delivered"},{id:"cancelled",disablePadding:!1,label:"cancelled"},{id:" notes",disablePadding:!1,label:"NOTES"},{id:"kms",disablePadding:!1,label:"KMS",numeric:"center"},{id:"charges",numeric:"center",label:"Charges",disablePadding:!1}];function we(){const e=(0,d.A)(),t=(0,a.useRef)(),n=(0,a.useRef)(),u=(0,a.useRef)(null),p=(0,a.useRef)(null),h=localStorage.getItem("userid"),[f,x]=(0,a.useState)(0),[m,v]=(0,a.useState)(50),[g,w]=(0,a.useState)("All"),[k,M]=(0,a.useState)(y()().format("YYYY-MM-DD")),[z,W]=(0,a.useState)(y()().format("YYYY-MM-DD")),[X,ee]=(0,a.useState)(!1),[te,ne]=(0,a.useState)(!1),[ie,oe]=(0,a.useState)("Today"),[Ae,we]=(0,a.useState)(0),[ke,Se]=(0,a.useState)(""),[Ce,Me]=(0,a.useState)(""),[ze,We]=(0,a.useState)([]),[Pe,Oe]=(0,a.useState)(),[De,Le]=(0,a.useState)(),[Re,Ie]=(0,a.useState)({}),[_e,Ee]=(0,a.useState)(!1);let[Ye,Te]=(0,a.useState)(0),[Fe,Ne]=(0,a.useState)(0),[He,Ue]=(0,a.useState)(0),[Ve,qe]=(0,a.useState)(0),[Ke,Be]=(0,a.useState)(0),[Ge,Je]=(0,a.useState)(0),[Qe,Ze]=(0,a.useState)(0),[$e,Xe]=(0,a.useState)(0),[et,tt]=(0,a.useState)(0);const[nt,rt]=(0,a.useState)(0),[at,it]=(0,a.useState)("All"),[ot,lt]=(0,a.useState)(0),[st,ct]=(0,a.useState)(0),[dt,ut]=(0,a.useState)(null),[pt,ht]=(0,a.useState)(null),[ft,xt]=(0,a.useState)(),[mt,vt]=(0,a.useState)(null),[gt,yt]=(0,a.useState)(!1),[At,bt]=(0,a.useState)(!1),jt=[{id:0,status:"All",statusLow:"All",count:Ye},{id:1,status:"Pending",statusLow:"pending",count:He},{id:2,status:"Accepted",statusLow:"accepted",count:Ke},{id:3,status:"Arrived",statusLow:"arrived",count:$e},{id:4,status:"Picked",statusLow:"picked",count:Ge},{id:5,status:"Active",statusLow:"active",count:Qe},{id:6,status:"Delivered",statusLow:"delivered",count:Fe},{id:7,status:"Skipped",statusLow:"skipped",count:et},{id:8,status:"Cancelled",statusLow:"cancelled",count:Ve}];function wt(e,t,n,r){const a=(n-e)*(Math.PI/180),i=(r-t)*(Math.PI/180),o=Math.sin(a/2)*Math.sin(a/2)+Math.cos(e*(Math.PI/180))*Math.cos(n*(Math.PI/180))*Math.sin(i/2)*Math.sin(i/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}(0,a.useEffect)((()=>{ct(0),ut(null),lt(0),ht(null),xt(null),vt(null)}),[Ae]),(0,a.useEffect)((()=>{lt(0),ht(null),vt(null)}),[st]),(0,a.useEffect)((()=>{vt(null)}),[ot]);const kt=async e=>{bt(!0),console.log("deliveryid",e);try{const t=await o.A.get("".concat("https://jupiter.nearle.app/live/api/v3","/deliveries/getdeliverylogs/?deliveryid=").concat(e));console.log("getdeliverylogs",t.data.details);const n=t.data.details;if(0!=n.length){Oe(n[0].logdate),Le(n[n.length-1].logdate);const e=n.map((e=>({lat:e.latitude,lng:e.longitude})));console.log("coData",e),We(e);const t=function(e){let t=0;for(let n=0;n<e.length-1;n++){const{lat:r,lng:a}=e[n],{lat:i,lng:o}=e[n+1],l=wt(r,a,i,o);console.log("distance",l),t+=l}return t}(e);console.log("Total distance traveled:",t,"km"),ne(!0)}else null!=n&&n||be("No Logs Found ","error",2e3)}catch(t){console.log("getdeliverylogs",t)}finally{bt(!1)}},{data:St,isLoading:Ct,isError:Mt,error:zt,fetchNextPage:Wt,hasNextPage:Pt,isFetchingNextPage:Ot}=(0,l.q)({queryKey:["fetchdeliveries",Ae,h,at,k,z,m,Ce,st,ot,(null===ft||void 0===ft?void 0:ft.userid)||0],queryFn:ce.tL,getNextPageParam:e=>{var t;return null!==(t=e.nextPage)&&void 0!==t?t:void 0},refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0}),Dt=(null===St||void 0===St?void 0:St.pages.flatMap((e=>e.rows)))||[];(0,a.useEffect)((()=>{if(!Pt)return;const e=new IntersectionObserver((e=>{e[0].isIntersecting&&Wt()}),{root:document.querySelector(".MuiTableContainer-root"),rootMargin:"0px",threshold:1});return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[Pt,Wt]);const{data:Lt,isLoading:Rt,isError:It,error:_t}=(0,s.I)({queryKey:["tenantlist",Ae],queryFn:()=>(0,ce.Mn)(Ae),enabled:0!==Ae}),{data:Et,isLoading:Yt,isError:Tt,error:Ft}=(0,s.I)({queryKey:["getriderbydelivery",k,z,Ae,st,ot],queryFn:()=>(0,ce.aY)(k,z,Ae,st,ot),enabled:0!=Ae}),{data:Nt,isLoading:Ht,isError:Ut,error:Vt}=(0,s.I)({queryKey:["gettenantlocations",st],queryFn:()=>(0,ce.DL)(st),enabled:0!==st});(0,a.useEffect)((()=>{(async()=>{Ee(!0);try{await o.A.get(0==Ae?"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?fromdate=").concat(k,"&todate=").concat(z):"".concat("https://jupiter.nearle.app/live/api/v1","/deliveries/deliverysummary/?applocationid=").concat(Ae,"&tenantid=").concat(st,"&locationid=").concat(ot,"&fromdate=").concat(k,"&todate=").concat(z,"&userid=").concat((null===ft||void 0===ft?void 0:ft.userid)||0)).then((e=>{console.log("fetchcountres",e.data.details),Te(e.data.details.total),"All"==at&&rt(e.data.details.total),Ue(e.data.details.pending),Be(e.data.details.accepted),Xe(e.data.details.arrived),Je(e.data.details.picked),Ze(e.data.details.active),Ne(e.data.details.delivered),tt(e.data.details.skipped),qe(e.data.details.cancelled)})).catch((e=>{console.log(e),(0,he.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})}))}catch(e){console.log(e)}finally{Ee(!1)}})()}),[Ae,k,z,at,st,ot,ft]);const qt=null===Dt||void 0===Dt?void 0:Dt.map((e=>({tenantname:e.tenantname,tenantcity:e.tenantcity,tenantcontactno:e.tenantcontactno,rider:e.ridername,orderid:e.orderid,paymenttype:64==e.paymenttype?"Pay Later":42==e.paymenttype?"Pay on Delivery":"Digital",deliverydate:e.deliverydate,orderstatus:e.orderstatus,ordernotes:e.ordernotes,kms:e.kms,cumulativekms:e.cumulativekms,assigntime:e.assigntime,starttime:e.starttime,arrivaltime:e.arrivaltime,pickuptime:e.pickuptime,deliverytime:e.deliverytime,canceltime:e.canceltime,deliverycharge:e.deliverycharges,deliveryamt:e.deliveryamt,pickupcustomer:e.pickupcustomer,pickupcontactno:e.pickupcontactno,Pickupaddress:e.pickupaddress,pickupsuburb:e.pickupsuburb,pickupcity:e.applocation,pickuplat:e.pickuplat,pickuplong:e.pickuplon,deliverycustomer:e.deliverycustomer,deliverycontactno:e.deliverycontactno,deliveryaddress:e.deliveryaddress,deliverysuburb:e.locationsuburb,deliverylat:e.deliverylat,deliverylong:e.deliverylong,locationname:e.locationname,locationsuburb:e.pickuplocation,deliverylocation:e.deliverylocation,locationcontactno:e.locationcontactno})));function Kt(e){return y()(e).format("DD/MM/YYYY ")}function Bt(e){return y()(e).format(" hh:mm A")}console.log("csvData",qt);const Gt=Mt?"An error has occurred: (fetchDeliveries) ".concat(zt.message):It?"An error has occurred: (getTenants) ".concat(_t.message):Ut?"An error has occurred: (gettenantlocations) ".concat(Vt.message):Tt?"An error has occurred: (getriderbydelivery) ".concat(Ft.message):null;return(0,a.useEffect)((()=>{Gt&&(console.log("errormessage",Gt),be(Gt,"warning",2e3))}),[Gt]),(0,C.jsxs)(C.Fragment,{children:[(_e||Rt||Ht||At||Yt||Ot)&&(0,C.jsx)("div",{children:(0,C.jsx)(pe.A,{})}),Ct&&(0,C.jsx)(L.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:Ct}),(0,C.jsx)(i.A,{title:"Orders Details",secondary:(0,C.jsxs)(A.A,{display:"flex",flexDirection:"row",alignItems:"center ",gap:3,flexWrap:"wrap",children:[(0,C.jsx)(ve.A,{ref:u,locaName:g,setAppId:we,setLocoName:w,setPage:x,sx:{minWidth:250,maxWidth:1e3,flex:1}}),(0,C.jsx)(R.A,{options:Lt||[],value:dt,sx:{minWidth:250,maxWidth:1e3,flex:1},onOpen:e=>{Ae||(e.preventDefault(),(0,ge.k)("Please select a your app location first!","warning",3e3),setTimeout((()=>{var e;null===(e=u.current)||void 0===e||e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(ct(0),ut(null),lt(0),ht(null)):(ct((null===t||void 0===t?void 0:t.tenantid)||0),ut(t),lt(t.locationid),ht(null))},renderInput:e=>(0,C.jsx)(I.A,(0,r.A)((0,r.A)({},e),{},{inputRef:p,label:"Select Tenant"}))}),(0,C.jsx)(R.A,{options:Nt||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,value:pt,sx:{minWidth:250,maxWidth:1e3,flex:1},onOpen:e=>{Ae||st?st||(e.preventDefault(),(0,ge.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=p.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,ge.k)("Please select a your Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=u.current)||void 0===e||e.focus()}),0))},onChange:(e,t,n)=>{"clear"===n?(lt(0),ht(null)):(lt(t.locationid||0),ht(t))},renderInput:e=>(0,C.jsx)(I.A,(0,r.A)((0,r.A)({},e),{},{label:"Select Location"}))})]})}),(0,C.jsx)(de.A,{content:!1,title:(0,C.jsxs)(A.A,{sx:{m:2},gap:3,children:[(0,C.jsxs)(A.A,{direction:"row",alignItems:"center",gap:2,flexWrap:"wrap",sx:{},children:[k&&z&&(0,C.jsxs)(A.A,{direction:"row",alignItems:"center",gap:2,flexWrap:"wrap",children:[(0,C.jsx)(_.A,{badgeContent:ke?0:nt,max:"".concat(Ye),color:"primary",sx:{bgcolor:"#f3e5f5",p:.2,borderRadius:"3px",color:"#7b1fa2"},children:"Orders-".concat(ie)}),(0,C.jsx)(E.A,{title:"Date Filter",placement:"top",children:(0,C.jsx)(j.A,{label:(0,C.jsxs)(b.A,{noWrap:!0,color:"secondary",children:[y()(k).format("DD/MM/YYYY")," - ",y()(z).format("DD/MM/YYYY")]}),variant:"combined",color:"warning",size:"small",deleteIcon:(0,C.jsx)(se.A,{style:{fontSize:18}}),onDelete:()=>{ee(!0)},onClick:()=>ee(!0),sx:{cursor:"pointer"}})})]}),(0,C.jsx)(Y.A,{variant:"outlined",size:"small",startIcon:(0,C.jsx)(D.A,{}),onClick:()=>{yt(!0),setTimeout((()=>{v("")}),0)},children:"Export Report"})]}),(0,C.jsxs)(A.A,{display:"flex",flexDirection:"row",gap:2,alignItems:"center",sx:{},flexWrap:"wrap",children:[(0,C.jsx)(R.A,{id:"combo-box-demo",label:at,options:jt,getOptionLabel:e=>"".concat(e.status),sx:{minWidth:250,maxWidth:1e3,flex:1},onChange:(e,t,n)=>{"clear"===n?(it("All"),rt(jt[0].count)):(console.log("status",t),it(t.statusLow),rt(t.count))},renderInput:e=>(0,C.jsx)(I.A,(0,r.A)((0,r.A)({},e),{},{label:"Select Status"}))}),(0,C.jsx)(R.A,{id:"combo-box-demo",value:mt,options:Et||[],getOptionLabel:e=>"".concat(e.firstname," ").concat(e.lastname),sx:{minWidth:250,maxWidth:1e3,flex:1},onOpen:()=>{Ae||(0,ge.k)("Select App Location First","warning",2e3)},onChange:(e,t,n)=>{"clear"===n?(xt(null),vt(null)):(xt(t),vt(t))},renderInput:e=>(0,C.jsx)(I.A,(0,r.A)((0,r.A)({},e),{},{label:"Select Rider"}))}),(0,C.jsx)(xe.A,{value:ke,onChange:Se,onDebouncedChange:Me,sx:{minWidth:250,maxWidth:1e3,flex:1}})]})]}),children:(0,C.jsxs)(T.A,{ref:n,onScroll:e=>{const{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t+r>=n-50&&Pt&&!Ot&&Wt()},sx:{maxHeight:"calc(100vh - 200px)",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,C.jsxs)(F.A,{stickyHeader:!0,"aria-label":"sticky table",children:[(0,C.jsx)(N.A,{sx:{"& th":{borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"2px solid ".concat(e.palette.divider," !important")}},children:(0,C.jsx)(H.A,{sx:{width:"100%"},children:je.map((e=>(0,C.jsx)(U.A,{sx:{position:"sticky !important",width:"100%"},children:e.label},e.id)))})}),(0,C.jsx)(V.A,{children:Ct?(0,C.jsx)(ye,{rows:16,columns:30,height:15}):0==(null===Dt||void 0===Dt?void 0:Dt.length)?(0,C.jsx)(H.A,{children:(0,C.jsx)(U.A,{colSpan:15,sx:{"&:hover":{bgcolor:"white"}},children:(0,C.jsx)(c.A,{description:"No Orders Found"})})}):null===Dt||void 0===Dt?void 0:Dt.map(((t,n)=>(0,C.jsxs)(H.A,{children:[(0,C.jsxs)(U.A,{sx:{width:"10px"},children:[" ",f*m+n+1]}),(0,C.jsx)(U.A,{sx:{width:"10px",cursor:"pointer"},onClick:()=>{if("delivered"!=t.orderstatus)return null;console.log("row",t),kt(t.deliveryid),Ie(t),Ee(!0),setTimeout((()=>{Ee(!1)}),500)},children:"delivered"==t.orderstatus?(0,C.jsx)(re,{style:{color:e.palette.primary.main}}):(0,C.jsx)(ae.A,{style:{color:e.palette.secondary.main}})}),(0,C.jsxs)(U.A,{sx:{textAlign:"start",whiteSpace:"nowrap"},children:[t.tenantname,(0,C.jsx)(E.A,{title:"OrderId",children:(0,C.jsx)(b.A,{variant:"body2",noWrap:!0,sx:{cursor:"pointer"},children:t.orderid})}),(0,C.jsx)(b.A,{noWrap:!0,variant:"body2",children:y()(t.deliverydate).utc().format("DD/MM/YYYY")}),(0,C.jsx)(b.A,{noWrap:!0,variant:"body2",children:y()(t.deliverydate).utc().format("hh:mm A")})]}),(0,C.jsx)(U.A,{align:"left",children:(0,C.jsx)(A.A,{direction:"row",spacing:1,children:(0,C.jsxs)(A.A,{direction:"column",children:[(0,C.jsx)(b.A,{noWrap:!0,children:t.pickupcustomer}),(0,C.jsx)(b.A,{variant:"caption",color:"textSecondary",children:t.pickupcontactno}),(0,C.jsx)(E.A,{title:t.Pickupaddress||t.pickupsuburb,children:(0,C.jsx)(b.A,{noWrap:!0,variant:"caption",color:"textSecondary",sx:{cursor:"pointer",textOverflow:"ellipsis"},children:" ".concat(t.pickupsuburb||t.Pickupaddress.slice(0,20)+"...")})}),(0,C.jsx)(b.A,{noWrap:!0,variant:"caption",color:"textSecondary",children:t.applocation})]})})}),(0,C.jsx)(U.A,{align:"left",children:(0,C.jsx)(A.A,{direction:"row",spacing:1,children:(0,C.jsxs)(A.A,{direction:"column",children:[(0,C.jsx)(b.A,{sx:{whiteSpace:"nowrap"},children:t.deliverycustomer}),(0,C.jsx)(b.A,{variant:"caption",color:"textSecondary",children:t.deliverycontactno}),(0,C.jsx)(E.A,{title:t.deliveryaddress,children:(0,C.jsx)(b.A,{variant:"caption",color:"textSecondary",sx:{cursor:"pointer"},children:"".concat(t.deliverysuburb||t.deliveryaddress.slice(0,20)+"...")})})]})})}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsxs)(A.A,{direction:"row",sx:{mb:1},children:["created"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Created",color:"primary",size:"small",sx:{minWidth:80}}),"pending"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Pending",color:"warning",size:"small",sx:{minWidth:80}}),"accepted"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Accepted",size:"small",sx:{bgcolor:e.palette.chip.accept,color:"white",minWidth:80}}),"arrived"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Arrived",size:"small",sx:{bgcolor:e.palette.chip.arrive,color:"white",minWidth:80}}),"picked"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Picked",color:"info",size:"small",sx:{minWidth:80}}),"active"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Active",color:"info",size:"small",sx:{minWidth:80}}),"delivered"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Delivered",color:"success",size:"small",sx:{minWidth:80}}),"skipped"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Skipped",color:"secondary",size:"small",sx:{minWidth:80}}),"cancelled"===t.orderstatus&&(0,C.jsx)(j.A,{label:"Cancelled",color:"error",size:"small",sx:{minWidth:80}})]}),(0,C.jsxs)(E.A,{title:t.ridername,children:[(0,C.jsx)(b.A,{variant:"subtitle2",display:"block",sx:{cursor:"pointer",whiteSpace:"nowrap"},children:t.ridername}),(0,C.jsxs)(b.A,{variant:"subtitle2",display:"block",sx:{cursor:"pointer",whiteSpace:"nowrap"},children:["ID : ",t.userid]})]})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.assigntime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.assigntime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.assigntime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.assigntime)})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.acceptedtime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.acceptedtime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.acceptedtime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.acceptedtime)})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.arrivaltime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.arrivaltime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.arrivaltime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.arrivaltime)})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.pickuptime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.pickuptime)}),(0,C.jsxs)(A.A,{direction:"row",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.pickuptime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.pickuptime)}),"active"===t.deliverystatus&&(0,C.jsx)(O.cxC,{fontSize:"large",style:{color:"green",marginLeft:"8px"}})]})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.starttime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.starttime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.starttime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.starttime)})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.deliverytime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.deliverytime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.deliverytime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.deliverytime)})]}),(0,C.jsxs)(U.A,{align:"left",children:[(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"12px"},children:""===t.canceltime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:80,height:14}):Kt(t.canceltime)}),(0,C.jsx)(b.A,{noWrap:!0,sx:{fontSize:"13px"},variant:"h5",children:""===t.canceltime?(0,C.jsx)(q.A,{animation:!1,variant:"text",width:60,height:18}):Bt(t.canceltime)})]}),(0,C.jsx)(U.A,{align:"left",children:(0,C.jsx)(b.A,{variant:"caption",children:t.ordernotes||(0,C.jsx)(q.A,{animation:!1,variant:"text",width:40,height:18})})}),(0,C.jsx)(U.A,{align:"center",children:(0,C.jsxs)(A.A,{direction:"column",spacing:1,children:[(0,C.jsx)(E.A,{title:" KMS",placement:"top",children:(0,C.jsx)(j.A,{label:"cancelled"===t.deliverystatus||""==t.kms?0:t.kms,size:"small",variant:"light",color:"error",sx:{minWidth:80,border:"1px solid #e96969",cursor:"pointer"}})}),(0,C.jsx)(E.A,{title:"Actual KMS",placement:"left",children:(0,C.jsx)(j.A,{label:t.cumulativekms,size:"small",color:"success",variant:"light",onClick:()=>{},sx:{minWidth:80,border:"1px solid #76ff03 ",cursor:"pointer"}})}),(0,C.jsx)(E.A,{title:"Rider KMS",children:(0,C.jsx)(j.A,{label:t.previouskms||("cancelled"==t.deliverystatus?"0.00":t.kms),size:"small",color:"info",variant:"light",onClick:()=>{},sx:{minWidth:80,border:"1px solid #03a9f4 ",cursor:"pointer"}})})]})}),(0,C.jsx)(U.A,{align:"center",children:(0,C.jsxs)(A.A,{direction:"column",spacing:1,children:[(0,C.jsx)(E.A,{title:" Delivery Charge",placement:"top",children:(0,C.jsx)(j.A,{label:"cancelled"===t.orderstatus||""==t.deliverycharges?"\u20b9 ".concat(0,".00"):"\u20b9 ".concat(t.deliverycharges,".00"),size:"small",variant:"light",color:"error",sx:{minWidth:80,border:"1px solid #e96969",cursor:"pointer"}})}),(0,C.jsx)(E.A,{title:"Delivery Amount",children:(0,C.jsx)(j.A,{label:""==t.deliveryamt?"\u20b9 ".concat(0,".00"):"\u20b9 ".concat(t.deliveryamt,".00"),size:"small",color:"success",variant:"light",sx:{minWidth:80,border:"1px solid #76ff03 ",cursor:"pointer"}})})]})})]},t.name)))})]}),(0,C.jsx)(K.A,{}),0!==(null===Dt||void 0===Dt?void 0:Dt.length)&&(0,C.jsx)(A.A,{justifyContent:"center",alignItems:"center",sx:{width:"100%",py:2},children:(0,C.jsx)(A.A,{ref:t,style:{textAlign:"center",width:"100%"},children:Ot||Pt?(0,C.jsx)(me.A,{}):"No More Orders Details"})})]})}),(0,C.jsxs)(B.A,{open:gt,onClose:()=>yt(!1),fullWidth:!0,maxWidth:"sm",children:[(0,C.jsx)(G.A,{sx:{bgcolor:"primary.main",color:"white"},children:(0,C.jsx)(b.A,{variant:"h3",children:"Export Report"})}),(0,C.jsxs)(J.A,{children:[Ct&&(0,C.jsx)(S.A,{}),(0,C.jsxs)(Q.A,{gap:2,sx:{width:"100%"},children:[(0,C.jsx)(Z.Ay,{sx:{bgcolor:"primary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:g||"None",color:g?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"App Location"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"secondary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:(null===dt||void 0===dt?void 0:dt.tenantname)||"None",color:null!==dt&&void 0!==dt&&dt.tenantname?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Tenant"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"primary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:(null===pt||void 0===pt?void 0:pt.locationname)||"None",color:null!==pt&&void 0!==pt&&pt.locationname?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Business Location"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"secondary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:at||"None",color:at?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Status"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"primary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:mt?"".concat(mt.firstname," ").concat(mt.lastname):"None",color:mt?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Rider"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"secondary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:ke||"None",color:ke?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Keyword"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"primary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:k||"None",color:k?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"Start Date"})}),(0,C.jsx)(Z.Ay,{sx:{bgcolor:"secondary.lighter"},secondaryAction:(0,C.jsx)(j.A,{size:"small",label:z||"None",color:z?"primary":"secondary"}),children:(0,C.jsx)(b.A,{variant:"h5",fontWeight:500,children:"End Date"})})]})]}),(0,C.jsxs)($.A,{sx:{width:"100%",bgcolor:"secondary.lighter"},children:[(0,C.jsx)(Y.A,{color:"error",variant:"contained",startIcon:(0,C.jsx)(le,{}),onClick:()=>{yt(!1)},sx:{},children:"Close"}),(0,C.jsx)(ue.pK,{data:qt,filename:"Orders_Detail_".concat(y()().format("YYYY-MM-DD_HHmmss"),".csv"),label:"Download CSV",style:{m:1},btnLoading:Ct,onClick:()=>{setTimeout((()=>yt(!1)),0)}})]})]}),(0,C.jsx)(fe.A,{open:X,onClose:()=>ee(!1),onSelect:e=>{M(e.startDate),W(e.endDate),oe(e.label),console.log("Selected Date Range:",e)}}),(0,C.jsx)(B.A,{open:te,onClose:()=>{ne(!1)},fullScreen:!0,fullWidth:!0,children:ze&&(0,C.jsx)("div",{children:(0,C.jsx)(P,{coordinates:ze,additionalProps:{riderStart:Pe,riderEnd:De},order:Re,setMapOpen:ne})})})]})}},19474:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(58168),a=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 289.1a362.49 362.49 0 00-79.9-115.7 370.83 370.83 0 00-118.2-77.8C610.7 76.6 562.1 67 512 67c-50.1 0-98.7 9.6-144.5 28.5-44.3 18.3-84 44.5-118.2 77.8A363.6 363.6 0 00169.4 289c-19.5 45-29.4 92.8-29.4 142 0 70.6 16.9 140.9 50.1 208.7 26.7 54.5 64 107.6 111 158.1 80.3 86.2 164.5 138.9 188.4 153a43.9 43.9 0 0022.4 6.1c7.8 0 15.5-2 22.4-6.1 23.9-14.1 108.1-66.8 188.4-153 47-50.4 84.3-103.6 111-158.1C867.1 572 884 501.8 884 431.1c0-49.2-9.9-97-29.4-142zM512 880.2c-65.9-41.9-300-207.8-300-449.1 0-77.9 31.1-151.1 87.6-206.3C356.3 169.5 431.7 139 512 139s155.7 30.5 212.4 85.9C780.9 280 812 353.2 812 431.1c0 241.3-234.1 407.2-300 449.1zm0-617.2c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 551c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 439c0-29.9 11.7-58 32.8-79.2C454 338.6 482.1 327 512 327c29.9 0 58 11.6 79.2 32.8C612.4 381 624 409.1 624 439c0 29.9-11.6 58-32.8 79.2z"}}]},name:"environment",theme:"outlined"};var o=n(61187),l=function(e,t){return a.createElement(o.A,(0,r.A)({},e,{ref:t,icon:i}))};const s=a.forwardRef(l)},25713:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(98587),a=n(58168),i=n(9950),o=n(72004),l=n(3484),s=n(59254),c=n(18463),d=n(45558),u=n(1614);function p(e){return(0,u.Ay)("MuiCardActions",e)}(0,d.A)("MuiCardActions",["root","spacing"]);var h=n(44414);const f=["disableSpacing","className"],x=(0,s.Ay)("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,a.A)({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),m=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiCardActions"}),{disableSpacing:i=!1,className:s}=n,d=(0,r.A)(n,f),u=(0,a.A)({},n,{disableSpacing:i}),m=(e=>{const{classes:t,disableSpacing:n}=e,r={root:["root",!n&&"spacing"]};return(0,l.A)(r,p,t)})(u);return(0,h.jsx)(x,(0,a.A)({className:(0,o.A)(m.root,s),ownerState:u,ref:t},d))}))},27182:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(89379),a=(n(9950),n(14857)),i=n(25713),o=n(60899),l=n(93230),s=n(82053),c=n(44414);const d=e=>{let{title:t,secondary:n,sx:d}=e;const u=(0,a.A)();return(0,c.jsx)(i.A,{sx:(0,r.A)({position:"sticky",top:"30px",bgcolor:u.palette.background.default,zIndex:10,width:"100%"},d),children:(0,c.jsx)(o.Ay,{container:!0,children:(0,c.jsx)(o.Ay,{item:!0,xs:12,children:(0,c.jsxs)(l.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:2,sx:{flexWrap:"wrap"},children:[(0,c.jsx)(s.A,{variant:"h3",children:t}),n]})})})})}},33516:(e,t,n)=>{"use strict";n.d(t,{m:()=>l});var r=n(464),a=n(69995),i=n(2527),o=n(9950);const l=(0,r.wk)((function(e,t){const n=new i.Tooltip(e,t.overlayContainer);return(0,a.Q)(n,t)}),(function(e,t,n,r){let{position:a}=n;(0,o.useEffect)((function(){const n=t.overlayContainer;if(null==n)return;const{instance:i}=e,o=e=>{e.tooltip===i&&(null!=a&&i.setLatLng(a),i.update(),r(!0))},l=e=>{e.tooltip===i&&r(!1)};return n.on({tooltipopen:o,tooltipclose:l}),n.bindTooltip(i),function(){n.off({tooltipopen:o,tooltipclose:l}),null!=n._map&&n.unbindTooltip()}}),[e,t,r,a])}))},41557:(e,t,n)=>{"use strict";var r=n(24994);t.A=void 0;var a=r(n(79526)),i=n(44414);t.A=(0,a.default)((0,i.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zm-8 2V5h2v6h1.17L12 13.17 9.83 11zm-6 7h14v2H5z"}),"DownloadOutlined")},46411:(e,t,n)=>{e.exports=n(795)},49462:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(9950),l=(r=o)&&r.__esModule?r:{default:r},s=n(87924),c=n(8010);var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.buildURI=n.buildURI.bind(n),n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"buildURI",value:function(){return s.buildURI.apply(void 0,arguments)}},{key:"handleLegacy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(window.navigator.msSaveOrOpenBlob){e.preventDefault();var n=this.props,r=n.data,a=n.headers,i=n.separator,o=n.filename,l=n.enclosingCharacter,c=n.uFEFF,d=t&&"function"===typeof r?r():r,u=new Blob([c?"\ufeff":"",(0,s.toCSV)(d,a,i,l)]);return window.navigator.msSaveBlob(u,o),!1}}},{key:"handleAsyncClick",value:function(e){var t=this;this.props.onClick(e,(function(n){!1!==n?t.handleLegacy(e,!0):e.preventDefault()}))}},{key:"handleSyncClick",value:function(e){!1===this.props.onClick(e)?e.preventDefault():this.handleLegacy(e)}},{key:"handleClick",value:function(){var e=this;return function(t){if("function"===typeof e.props.onClick)return e.props.asyncOnClick?e.handleAsyncClick(t):e.handleSyncClick(t);e.handleLegacy(t)}}},{key:"render",value:function(){var e=this,t=this.props,n=t.data,r=t.headers,i=t.separator,o=t.filename,s=t.uFEFF,c=t.children,d=(t.onClick,t.asyncOnClick,t.enclosingCharacter),u=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["data","headers","separator","filename","uFEFF","children","onClick","asyncOnClick","enclosingCharacter"]),p="undefined"===typeof window?"":this.buildURI(n,s,r,i,d);return l.default.createElement("a",a({download:o},u,{ref:function(t){return e.link=t},target:"_self",href:p,onClick:this.handleClick()}),c)}}]),t}(l.default.Component);d.defaultProps=c.defaultProps,d.propTypes=c.propTypes,t.default=d},64367:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(23235),a=n(44414);const i=(0,r.A)((0,a.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")},79739:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(98587),a=n(58168),i=n(9950),o=n(72004),l=n(3484),s=n(59254),c=n(18463),d=n(45558),u=n(1614);function p(e){return(0,u.Ay)("MuiDialogActions",e)}(0,d.A)("MuiDialogActions",["root","spacing"]);var h=n(44414);const f=["className","disableSpacing"],x=(0,s.Ay)("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})((e=>{let{ownerState:t}=e;return(0,a.A)({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})})),m=i.forwardRef((function(e,t){const n=(0,c.b)({props:e,name:"MuiDialogActions"}),{className:i,disableSpacing:s=!1}=n,d=(0,r.A)(n,f),u=(0,a.A)({},n,{disableSpacing:s}),m=(e=>{const{classes:t,disableSpacing:n}=e,r={root:["root",!n&&"spacing"]};return(0,l.A)(r,p,t)})(u);return(0,h.jsx)(x,(0,a.A)({className:(0,o.A)(m.root,i),ownerState:u,ref:t},d))}))},87924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var a=t.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},i=t.isJsons=function(e){return Array.isArray(e)&&e.every((function(e){return"object"===("undefined"===typeof e?"undefined":n(e))&&!(e instanceof Array)}))},o=t.isArrays=function(e){return Array.isArray(e)&&e.every((function(e){return Array.isArray(e)}))},l=t.jsonsHeaders=function(e){return Array.from(e.map((function(e){return Object.keys(e)})).reduce((function(e,t){return new Set([].concat(r(e),r(t)))}),[]))},s=t.jsons2arrays=function(e,t){var n=t=t||l(e),a=t;i(t)&&(n=t.map((function(e){return e.label})),a=t.map((function(e){return e.key})));var o=e.map((function(e){return a.map((function(t){return c(t,e)}))}));return[n].concat(r(o))},c=t.getHeaderValue=function(e,t){var n=e.replace(/\[([^\]]+)]/g,".$1").split(".").reduce((function(e,t,n,r){var a=e[t];if(void 0!==a&&null!==a)return a;r.splice(1)}),t);return void 0===n?e in t?t[e]:"":n},d=t.elementOrEmpty=function(e){return"undefined"===typeof e||null===e?"":e},u=t.joiner=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:'"';return e.filter((function(e){return e})).map((function(e){return e.map((function(e){return d(e)})).map((function(e){return""+n+e+n})).join(t)})).join("\n")},p=t.arrays2csv=function(e,t,n,a){return u(t?[t].concat(r(e)):e,n,a)},h=t.jsons2csv=function(e,t,n,r){return u(s(e,t),n,r)},f=t.string2csv=function(e,t,n,r){return t?t.join(n)+"\n"+e:e.replace(/"/g,'""')},x=t.toCSV=function(e,t,n,r){if(i(e))return h(e,t,n,r);if(o(e))return p(e,t,n,r);if("string"===typeof e)return f(e,t,n);throw new TypeError('Data should be a "String", "Array of arrays" OR "Array of objects" ')};t.buildURI=function(e,t,n,r,i){var o=x(e,n,r,i),l=a()?"application/csv":"text/csv",s=new Blob([t?"\ufeff":"",o],{type:l}),c="data:"+l+";charset=utf-8,"+(t?"\ufeff":"")+o,d=window.URL||window.webkitURL;return"undefined"===typeof d.createObjectURL?c:d.createObjectURL(s)}},91078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(9950),o=(r=i)&&r.__esModule?r:{default:r},l=n(87924),s=n(8010);var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={},n}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"buildURI",value:function(){return l.buildURI.apply(void 0,arguments)}},{key:"componentDidMount",value:function(){var e=this.props,t=e.data,n=e.headers,r=e.separator,a=e.enclosingCharacter,i=e.uFEFF,o=e.target,l=e.specs,s=e.replace;this.state.page=window.open(this.buildURI(t,i,n,r,a),o,l,s)}},{key:"getWindow",value:function(){return this.state.page}},{key:"render",value:function(){return null}}]),t}(o.default.Component);c.defaultProps=Object.assign(s.defaultProps,{target:"_blank"}),c.propTypes=s.propTypes,t.default=c},98114:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(58168),a=n(9950);const i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};var o=n(61187),l=function(e,t){return a.createElement(o.A,(0,r.A)({},e,{ref:t,icon:i}))};const s=a.forwardRef(l)}}]);