Files
Express_console_build/build/static/js/9297.c1d141e7.chunk.js

1 line
26 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9297],{23787:(e,r,i)=>{i.d(r,{FG:()=>h,nV:()=>x,pY:()=>A,pg:()=>p});var n=i(22555),s=i(53986),l=i(71392),t=i(55235),o=i(48738),c=i(2866),a=i(65908);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:r,scroll:i=!1,onScroll:t,sx:o}=e,c=(0,s.A)(e,d);return(0,a.jsx)(l.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:t,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),o)},c),{},{children:r}))},p=e=>{let{accent:r="#662582",header:i,footer:s,selected:l=!1,onClick:c,children:d,sx:x}=e;return(0,a.jsxs)(t.A,{elevation:0,onClick:c,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:l?r:"#e2e8f0",background:l?"".concat(r,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,a.jsx)(o.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:r}}),(0,a.jsxs)(o.A,{sx:{p:1.5,pl:2},children:[i,d,s]})]})},h=e=>{let{children:r,columns:i=2,sx:s}=e;return(0,a.jsx)(o.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},s),children:r})},A=e=>{let{label:r,value:i,children:n,full:s=!1,align:l="left"}=e;return(0,a.jsxs)(o.A,{sx:{gridColumn:s?"1 / -1":"auto",minWidth:0,textAlign:l},children:[(0,a.jsx)(c.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:r}),(0,a.jsx)(o.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,a.jsx)(c.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},47659:(e,r,i)=>{i.d(r,{A:()=>d});var n=i(22555),s=i(84007),l=i(75953),t=i(48738),o=i(2866),c=i(1939),a=i(65908);const d=e=>{let{primary:r,secondary:i,percentage:d,color:x,sx:p}=e;return(0,a.jsx)(s.A,{elevation:0,sx:(0,n.A)({background:x,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},p),children:(0,a.jsxs)(l.A,{children:[(0,a.jsx)(t.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,a.jsx)(o.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,a.jsxs)(c.Ay,{container:!0,spacing:0,children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:i})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"subtitle2",color:"inherit",children:r})})]})]})})}},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDK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ky/RmNrlV3wVneHWrw427/hHc7C+k/IJEFZ1KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},89297:(e,r,i)=>{i.r(r),i.d(r,{default:()=>E});var n=i(22555),s=i(71392),l=i(2866),t=i(81062),o=i(23440),c=i(11969),a=i(80911),d=i(15227),x=i(1939),p=i(83209),h=i(72486),A=i(54016),m=i(50755),j=i(1596),u=i(81802),v=i(58571),g=i(17488),y=i(86270),f=i(85672),b=i(69039),k=i(76264),S=i(23787),Y=i(96515),W=i(46077),z=i.n(W),C=i(59008),D=i(70775),w=i(81425),R=i(20466),M=i(68320),T=i(68220),J=i(52351),K=i(94826),F=i(38464),P=i(47659),I=i(28478),N=i(48952),Z=i(15172),B=i(68070),G=i(65908),H=i(22686);z().extend(H);const L=e=>{let{list:r,aiMode:i}=e;return r&&0!==r.length?(0,G.jsx)(S.nV,{children:r.map(((e,r)=>{const n="Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary";return(0,G.jsx)(S.pg,{header:(0,G.jsxs)(s.A,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:1,children:[(0,G.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,G.jsxs)(l.A,{sx:{fontWeight:800,color:"#94a3b8"},children:["#",r+1]}),1==i&&(0,G.jsx)(t.A,{size:"small",color:"primary",label:e.zone_name})]}),(0,G.jsx)(t.A,{size:"small",label:e.ordertype,color:n})]}),children:(0,G.jsxs)(S.FG,{children:[(0,G.jsx)(S.pY,{label:"Tenant",full:!0,children:(0,G.jsx)(o.A,{title:e.tenantaddress,children:(0,G.jsxs)(s.A,{children:[(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:e.tenantsuburb}),(0,G.jsx)(l.A,{noWrap:!0,variant:"body2",children:e.applocation})]})})}),(0,G.jsxs)(S.pY,{label:"Order Location",full:!0,children:[(0,G.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,G.jsx)(o.A,{title:"Order Id",children:(0,G.jsx)(l.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,G.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,G.jsx)(o.A,{title:"Ordered date",children:(0,G.jsxs)(s.A,{children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]})}),"-",(0,G.jsx)(o.A,{title:"Delivery date",children:(0,G.jsxs)(s.A,{children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})})]})]}),(0,G.jsx)(S.pY,{label:"Pickup",children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcontactno}),(0,G.jsx)(o.A,{title:e.pickupaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})}),(0,G.jsx)(S.pY,{label:"Delivery",children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycontactno}),(0,G.jsx)(o.A,{title:e.deliveryaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})}),e.ordernotes?(0,G.jsx)(S.pY,{label:"Notes",value:e.ordernotes,full:!0}):null,1==i&&(0,G.jsxs)(S.pY,{label:"Rider",full:!0,children:[(0,G.jsx)(l.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,G.jsxs)(l.A,{children:["ID : ",e.userid]})]}),(0,G.jsx)(S.pY,{label:"Profit",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"Charges",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,G.jsx)(o.A,{title:"Amount",placement:"left",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,G.jsx)(S.pY,{label:"KMS",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"KMS",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,G.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r)}))}):(0,G.jsx)(s.A,{alignItems:"center",sx:{py:4},children:(0,G.jsx)(F.A,{})})},E=()=>{var e,r,i,S,W,H,E;const O=(0,b.A)(),q=(0,k.A)(O.breakpoints.down("md")),V=(0,Y.Zp)(),U=(0,Y.zy)();console.log("location.state",U.state);const[Q,X]=(0,f.useState)(null),[_,$]=(0,f.useState)(null),[ee,re]=(0,f.useState)([]),[ie,ne]=(0,f.useState)(!1),se=null===(e=U.state)||void 0===e?void 0:e.deliverylist,le=null===(r=U.state)||void 0===r?void 0:r.zoneData,te=null===(i=U.state)||void 0===i?void 0:i.metaData,oe=null===(S=U.state)||void 0===S?void 0:S.riderToken,ce=null===(W=U.state)||void 0===W?void 0:W.appId,ae=null===(H=U.state)||void 0===H?void 0:H.aiMode,de=null===(E=U.state)||void 0===E?void 0:E.reassignOrders;(0,f.useEffect)((()=>{console.log("aiMode",ae),console.log("riderToken",oe),console.log("zoneData",le),console.log("metaData",te),console.log("reassignOrders",de)}),[]),(0,f.useEffect)((()=>{if(null===se||void 0===se||!se.length)return;const e=se.map((e=>{const r=Number(e.cumulativekms||0),i=Number(e.minkm||0),s=Number(e.baseprice||0),l=Number(e.priceperkm||0);return r<=i?(0,n.A)((0,n.A)({},e),{},{deliveryamt:s}):(0,n.A)((0,n.A)({},e),{},{deliveryamt:(r-i)*l+s})}));re(e),console.log("finaldeliveryList",e)}),[se]);const{data:xe=[],isLoading:pe,isError:he,error:Ae}=(0,M.I)({queryKey:["paymentmodes"],queryFn:w.HY}),{data:me=[],isLoading:je,isError:ue,error:ve,refetch:ge}=(0,M.I)({queryKey:["ridersList",ce],queryFn:w.Sd,enabled:0!==ce}),ye=(0,T.n)({mutationFn:w.k3,onSuccess:()=>{(0,R.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,R.k)(e.message,"error",2e3)}}),fe=(0,T.n)({mutationFn:w.H2,onSuccess:(e,r)=>{console.log("data",e),console.log("varialbles",r),ye.mutate(Q.userfcmtoken||oe),"accepted"==e.status&&(0,R.k)("Delivery Created Successfully","success",2e3),setTimeout((()=>{ne(!1),V("/nearle/deliveries")}),2e3)},onError:e=>{(0,R.k)(e.message,"error",4e3)}});return(0,G.jsxs)(C.A,{content:!1,title:(0,G.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,G.jsxs)(o.A,{title:"Back to orders",placement:"top",children:[(0,G.jsx)(c.A,{onClick:()=>V("/nearle/orders"),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,G.jsx)(B.eQE,{size:22})})," "]}),(0,G.jsx)(l.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]}),secondary:(0,G.jsx)(a.A,{sx:{m:2},color:"primary",variant:"contained",startIcon:(0,G.jsx)(D.A,{}),children:"Re-Assign"}),children:[(pe||je||ie)&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(J.A,{}),(0,G.jsx)(K.A,{})]}),(0,G.jsx)(d.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:pe||je||ie,children:(0,G.jsx)(K.A,{color:"inherit"})}),1==ae&&(0,G.jsx)(s.A,{sx:{m:2},children:(0,G.jsxs)(x.Ay,{container:!0,spacing:2,children:[(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:3,children:(0,G.jsx)(P.A,{secondary:null===te||void 0===te?void 0:te.total_orders,primary:"Orders",percentage:(0,G.jsx)(I.A,{}),color:O.palette.success.main,sx:{cursor:"pointer"}})}),(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:3,children:(0,G.jsx)(P.A,{secondary:null===te||void 0===te?void 0:te.total_riders,primary:"Riders",percentage:(0,G.jsx)(N.bsz,{}),color:O.palette.warning.main})}),(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:3,children:(0,G.jsx)(P.A,{secondary:null===le||void 0===le?void 0:le.length,primary:"Zones",percentage:(0,G.jsx)(Z.us2,{}),color:O.palette.info.main})}),(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:3,children:(0,G.jsx)(P.A,{secondary:null===le||void 0===le?void 0:le.length,primary:"Kilometer",percentage:(0,G.jsx)(Z.us2,{}),color:O.palette.error.main})})]})}),q?(0,G.jsx)(L,{list:ee,aiMode:ae}):(0,G.jsx)(p.A,{sx:{maxHeight:"calc(100vh - 250px)",overflow:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:O.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:O.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:O.palette.primary.lighter,cursor:"pointer"}},children:(0,G.jsxs)(h.A,{stickyHeader:!0,children:[(0,G.jsx)(A.A,{children:(0,G.jsxs)(m.A,{sx:{backgroundColor:"red"},children:[(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"#"}),1==ae&&(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Zone "}),(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Tenant "}),(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"order Location"}),(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Pickup "}),(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Delivery"}),(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Notes"}),1==ae&&(0,G.jsx)(j.A,{sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Rider"}),(0,G.jsx)(j.A,{align:"center",sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Type"}),(0,G.jsx)(j.A,{align:"center",sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Profit"}),(0,G.jsx)(j.A,{align:"center",sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"Charges"}),(0,G.jsx)(j.A,{align:"center",sx:{position:"sticky !important",backgroundColor:O.palette.secondary.light},children:"KMS"})]})}),(0,G.jsxs)(u.A,{children:[0==(null===ee||void 0===ee?void 0:ee.length)&&(0,G.jsx)(m.A,{children:(0,G.jsx)(j.A,{colSpan:10,children:(0,G.jsx)(F.A,{})})}),ee&&1==ae?null===ee||void 0===ee?void 0:ee.map(((e,r)=>(0,G.jsx)(f.Fragment,{children:(0,G.jsxs)(m.A,{sx:{},children:[(0,G.jsx)(j.A,{children:(0,G.jsxs)(l.A,{children:[" ",r+1]})}),1==ae&&(0,G.jsx)(j.A,{children:(0,G.jsx)(t.A,{color:"primary",label:e.zone_name})}),(0,G.jsx)(j.A,{children:(0,G.jsxs)(o.A,{title:e.tenantaddress,children:[(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,G.jsxs)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,G.jsx)("br",{})]}),(0,G.jsx)(l.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,G.jsxs)(j.A,{align:"left",children:[(0,G.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,G.jsx)(o.A,{title:"Order Id",children:(0,G.jsx)(l.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,G.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,G.jsxs)(o.A,{title:"Ordered date",children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,G.jsxs)(o.A,{title:"Delivery date",children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,G.jsx)(j.A,{align:"left",children:(0,G.jsx)(s.A,{direction:"row",spacing:1,children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcontactno}),(0,G.jsx)(o.A,{title:e.pickupaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,G.jsx)(j.A,{align:"left",children:(0,G.jsx)(s.A,{direction:"row",spacing:1,children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycontactno}),(0,G.jsx)(o.A,{title:e.deliveryaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,G.jsx)(j.A,{align:"left",children:e.ordernotes}),1==ae&&(0,G.jsxs)(j.A,{align:"left",children:[(0,G.jsx)(l.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,G.jsxs)(l.A,{children:["ID : ",e.userid]})]}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsx)(t.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"Charges",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,G.jsx)(o.A,{title:"Amount",placement:"left",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"KMS",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,G.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r))):null===ee||void 0===ee?void 0:ee.map(((e,r)=>(0,G.jsx)(f.Fragment,{children:(0,G.jsxs)(m.A,{sx:{},children:[(0,G.jsx)(j.A,{children:(0,G.jsxs)(l.A,{children:[" ",r+1]})}),(0,G.jsx)(j.A,{children:(0,G.jsxs)(o.A,{title:e.tenantaddress,children:[(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,G.jsxs)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,G.jsx)("br",{})]}),(0,G.jsx)(l.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,G.jsxs)(j.A,{align:"left",children:[(0,G.jsx)(o.A,{title:e.locationaddress,placement:"top",children:(0,G.jsx)(l.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,G.jsx)(o.A,{title:"Order Id",children:(0,G.jsx)(l.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,G.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,G.jsxs)(o.A,{title:"Ordered date",children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,G.jsxs)(o.A,{title:"Delivery date",children:[(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"12px"},children:z()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,G.jsx)(l.A,{noWrap:!0,sx:{fontSize:"11px"},children:z()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,G.jsx)(j.A,{align:"left",children:(0,G.jsx)(s.A,{direction:"row",spacing:1,children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.pickupcontactno}),(0,G.jsx)(o.A,{title:e.pickupaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,G.jsx)(j.A,{align:"left",children:(0,G.jsx)(s.A,{direction:"row",spacing:1,children:(0,G.jsxs)(s.A,{direction:"column",children:[(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycustomer}),(0,G.jsx)(l.A,{variant:"caption",children:e.deliverycontactno}),(0,G.jsx)(o.A,{title:e.deliveryaddress,children:(0,G.jsx)(l.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,G.jsx)(j.A,{align:"left",children:e.ordernotes}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsx)(t.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"Charges",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,G.jsx)(o.A,{title:"Amount",placement:"left",children:(0,G.jsx)(t.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,G.jsx)(j.A,{align:"center",children:(0,G.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,G.jsx)(o.A,{title:"KMS",placement:"top",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,G.jsx)(o.A,{title:"Cumulative Kms",placement:"right",children:(0,G.jsx)(t.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r)))]})]})}),(0,G.jsx)(v.A,{}),0==ae&&(0,G.jsxs)(x.Ay,{container:!0,spacing:2,sx:{p:2},children:[(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:6,children:(0,G.jsx)(g.A,{id:"free-solo-demo",options:xe,renderInput:e=>(0,G.jsx)(y.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Payment"})),onChange:(e,r,i)=>{if("clear"!==i){if(r){console.log("Selected:",r),$(r);const e=null===ee||void 0===ee?void 0:ee.map((e=>(0,n.A)((0,n.A)({},e),{},{paymenttype:r.apptypeid})));re(e)}}else $(null)}})}),(0,G.jsx)(x.Ay,{item:!0,xs:12,sm:6,children:(0,G.jsx)(g.A,{id:"free-solo-demo",options:me,renderInput:e=>(0,G.jsx)(y.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Rider"})),onChange:(e,r,i)=>{if("clear"!==i){if(r){X(r),console.log("Selected:",r);const e=null===ee||void 0===ee?void 0:ee.map((e=>(0,n.A)((0,n.A)({},e),{},{userid:r.userid,userfcmtoken:r.userfcmtoken})));re(e)}}else X(null)}})})]}),(0,G.jsx)(v.A,{}),(0,G.jsxs)(s.A,{display:"flex",flexDirection:{xs:"column",sm:"row"},gap:2,alignItems:{xs:"stretch",sm:"center"},justifyContent:"end",sx:{p:2},children:[(0,G.jsx)(a.A,{fullWidth:q,variant:"contained",color:"secondary",startIcon:(0,G.jsx)(D.A,{}),onClick:()=>{V("/nearle/orders")},children:"Back"}),(0,G.jsx)(a.A,{fullWidth:q,sx:{my:{xs:0,sm:2}},variant:"contained",disabled:0===ae&&(!Q||!_),onClick:async()=>{ne(!0),fe.mutate({deliveries:ee})},children:"Assign Orders"})]})]})}},94826:(e,r,i)=>{i.d(r,{A:()=>a});var n=i(60308),s=i(12010),l=i(62217),t=i(65908);const o=(0,n.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,n.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,t.jsxs)(o,{children:[(0,t.jsx)(s.A,{color:"primary",size:80,thickness:6}),(0,t.jsx)(c,{children:(0,t.jsx)("img",{src:l,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]);