1 line
43 KiB
JavaScript
1 line
43 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4776],{84776:function(e,n,t){t.r(n);var i=t(1413),r=t(93433),s=t(74165),o=t(15861),a=t(29439),c=t(47313),l=t(58467),d=t(56573),_=t(42897),A=t(41627),E=t(24904),x=t(76035),h=t(58873),P=t(26446),u=t(10165),R=t(94469),p=t(42832),T=t(48119),f=t(61113),Z=t(96467),C=t(99881),g=t(33249),S=t(90891),j=t(16783),m=t(69099),I=t(33604),D=t(9019),v=t(85281),b=t(51629),O=t(66835),L=t(23477),U=t(24076),y=t(67478),F=t(57861),N=t(66212),H=t(44758),M=t(61689),B=t(47131),w=t(4117),Y=t(84488),k=t(1550),K=t(65033),W=t(19536),z=t(43909),V=t(25718),q=t(97316),G=t(11577),X=t(10658),Q=t.n(X),J=t(19860),$=t(50661),ee=t(11829),ne=t(25057),te=t(90842),ie=t(22539),re=t(57829),se=t(70501),oe=t(46417),ae=t(91635);Q().extend(ae);var ce=16,le="0 8px 24px rgba(15, 23, 42, 0.08)",de="#0f172a",_e="#64748b",Ae="#94a3b8",Ee="#e2e8f0",xe="#f8fafc",he=function(e,n){return"".concat(e).concat(n)},Pe=function(e){return he(e,"08")},ue=function(e){return he(e,"26")},Re=function(e){return he(e,"55")},pe="#662582",Te="#9255AB",fe={pending:{label:"Pending",color:"#f59e0b",icon:ie.Ley},assigned:{label:"Assigned",color:"#0ea5e9",icon:ie.Z5O},confirmed:{label:"Confirmed",color:"#10b981",icon:ie.ZSR},modified:{label:"Modified",color:"#06b6d4",icon:ie.Y8K},processing:{label:"Processing",color:pe,icon:ie.dKE},active:{label:"Active",color:"#8b5cf6",icon:ie.ili},closed:{label:"Closed",color:"#06b6d4",icon:ie.ZSR},completed:{label:"Completed",color:"#10b981",icon:ie.ZSR},cancelled:{label:"Cancelled",color:"#ef4444",icon:ie.B4e}},Ze=function(e){var n=e.status,t=e.size,i=void 0===t?"md":t;if(!n)return null;var r=fe[String(n).toLowerCase()]||{label:n,color:Ae,icon:ie.Y8K},s=r.icon,o="lg"===i?1.25:1,a="lg"===i?.5:.375,c="lg"===i?12:11;return(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:o,py:a,borderRadius:999,bgcolor:Pe(r.color),border:"1px solid ".concat(Re(r.color)),color:r.color,fontSize:c,fontWeight:800,whiteSpace:"nowrap"},children:[(0,oe.jsx)(s,{size:12})," ",r.label]})};n.default=function(){var e=(0,c.useState)([]),n=(0,a.Z)(e,2),t=n[0],X=n[1],ae=(0,c.useState)(!0),Ae=(0,a.Z)(ae,2),he=Ae[0],fe=Ae[1],Ce=(0,l.TH)(),ge=(0,c.useState)(""),Se=(0,a.Z)(ge,2),je=Se[0],me=Se[1],Ie=(0,c.useState)(""),De=(0,a.Z)(Ie,2),ve=De[0],be=De[1],Oe=(0,c.useState)(""),Le=(0,a.Z)(Oe,2),Ue=Le[0],ye=Le[1],Fe=(0,c.useState)(""),Ne=(0,a.Z)(Fe,2),He=Ne[0],Me=Ne[1],Be=(0,c.useState)(!1),we=(0,a.Z)(Be,2),Ye=we[0],ke=we[1],Ke=(0,c.useState)(""),We=(0,a.Z)(Ke,2),ze=We[0],Ve=We[1],qe=(0,c.useState)(""),Ge=(0,a.Z)(qe,2),Xe=Ge[0],Qe=Ge[1],Je=(0,c.useState)(!1),$e=(0,a.Z)(Je,2),en=$e[0],nn=$e[1],tn=(0,c.useState)(""),rn=(0,a.Z)(tn,2),sn=rn[0],on=rn[1],an=(0,c.useState)(""),cn=(0,a.Z)(an,2),ln=cn[0],dn=(cn[1],(0,c.useState)("")),_n=(0,a.Z)(dn,2),An=_n[0],En=_n[1],xn=(0,c.useState)(""),hn=(0,a.Z)(xn,2),Pn=hn[0],un=hn[1],Rn=(0,c.useState)(""),pn=(0,a.Z)(Rn,2),Tn=pn[0],fn=pn[1],Zn=(0,c.useState)(""),Cn=(0,a.Z)(Zn,2),gn=Cn[0],Sn=Cn[1],jn=(0,c.useState)([]),mn=(0,a.Z)(jn,2),In=mn[0],Dn=mn[1],vn=(0,c.useState)(""),bn=(0,a.Z)(vn,2),On=bn[0],Ln=bn[1],Un=(0,c.useState)(""),yn=(0,a.Z)(Un,2),Fn=yn[0],Nn=yn[1],Hn=(0,c.useState)([]),Mn=(0,a.Z)(Hn,2),Bn=Mn[0],wn=Mn[1],Yn=(0,c.useState)([]),kn=(0,a.Z)(Yn,2),Kn=kn[0],Wn=kn[1],zn=(0,c.useState)(""),Vn=(0,a.Z)(zn,2),qn=Vn[0],Gn=Vn[1],Xn=(0,c.useState)(""),Qn=(0,a.Z)(Xn,2),Jn=Qn[0],$n=Qn[1],et=(0,c.useState)(""),nt=(0,a.Z)(et,2),tt=nt[0],it=(nt[1],(0,c.useState)("")),rt=(0,a.Z)(it,2),st=rt[0],ot=(rt[1],(0,c.useState)("")),at=(0,a.Z)(ot,2),ct=at[0],lt=at[1],dt=(0,c.useState)(""),_t=(0,a.Z)(dt,2),At=_t[0],Et=(_t[1],(0,c.useState)("")),xt=(0,a.Z)(Et,2),ht=xt[0],Pt=(xt[1],(0,c.useState)([])),ut=(0,a.Z)(Pt,2),Rt=ut[0],pt=ut[1],Tt=(0,c.useState)({shifts:0,assigned:0,remaining:0,shiftid:0,price:0}),ft=(0,a.Z)(Tt,2),Zt=ft[0],Ct=ft[1],gt=(0,c.useState)(0),St=(0,a.Z)(gt,2),jt=(St[0],St[1]),mt=(0,l.TH)().state,It=(0,c.useState)(""),Dt=(0,a.Z)(It,2),vt=Dt[0],bt=Dt[1],Ot=(0,l.s0)(),Lt=(0,c.useState)(["",""]),Ut=(0,a.Z)(Lt,2),yt=Ut[0],Ft=Ut[1],Nt=(0,c.useState)(""),Ht=(0,a.Z)(Nt,2),Mt=Ht[0],Bt=Ht[1],wt=(0,c.useState)(!1),Yt=(0,a.Z)(wt,2),kt=Yt[0],Kt=Yt[1];(0,c.useEffect)((function(){console.log("categoryarr"),console.log(t,ve,gn,tt,st)}),[Rt]),(0,c.useEffect)((function(){mt&&(Gn(mt.orderheaderid),$n(mt.tenantid)),console.log(mt),console.log(Date.now())}),[]),(0,c.useEffect)((function(){mt&&(Gn(mt.orderheaderid),$n(mt.tenantid)),console.log(mt),console.log(Date.now())}),[mt.orderheaderid,mt.tenantid]);var Wt=(0,J.Z)(),zt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.next=3,d.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getordersbystatus?tenantid=").concat(Jn)).then((function(e){console.log(e);var n=e.data.Details.find((function(e){return e.orderheaderid==qn}));console.log("result"),console.log(n),Dn(n.orderaddons),Sn(n.venuetype),Ln(n.remarks),Bt(n.startdate),Ve(n.tenantname),be(""),Qe(n.tenantaddress),Me(n.eventname),ye(Q()(n.orderdate).format("MM/DD/YYYY")||""),me(n.orderid),on(n.orderstatus),En(n.taxamount),un(n.orderamount),fn(n.ordervalue),Nn(Q()(n.cancelled).format("MM/DD/YYYY")||""),lt(n.pending),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Vt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.next=3,d.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getorderdetails?orderheaderid=").concat(qn)).then((function(e){console.log("res"),console.log(e),X(e.data.Details||[]),console.log("categoryarr"),pt(e.data.Details),console.log(e.data.Details),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.prev=1,e.next=4,d.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getassignedinfo?orderdetailid=").concat(n)).then((function(e){console.log(e),e.data.status&&wn(e.data.Details),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 4:e.next=10;break;case 6:e.prev=6,e.t0=e.catch(1),console.log(e.t0),fe(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(n){return e.apply(this,arguments)}}(),Gt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.put("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/cancel"),{orderheaderid:parseInt(qn),orderstatus:"cancelled",cancelled:Q()().format("YYYY-MM-DD HH:mm:ss"),unserviceable:kt?0:1}).then((function(e){console.log(e),e.data.status&&qn&&Jn&&(zt(),Vt())})).catch((function(e){console.log(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={orderheaderid:qn,orderprocessid:n.orderprocessid,orderdetailid:n.orderdetailid,orderstatus:"pending",pending:Q()().format("YYYY-MM-DD HH:mm:ss"),status:1},console.log(t),e.next=4,d.Z.put("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/updateprocessstatus"),t).then((function(e){console.log(e),"Successful"===e.data.message&&((0,te.yv)("Role unassigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Zt.assigned>Zt.shifts&&Qt(n),zt(),Vt(),ke(!1),ti(),Jt(),setTimeout((function(){ti()}),2e3))})).catch((function(e){console.log(e)}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Qt=function(e){console.log(e);var n=[e.userfcmtoken],t={notifications:[{notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Un-Asigned",message:"".concat(e.firstname," has been Un-assigned to the order ").concat(je),configid:2,tenantid:Jn,orderheaderid:qn,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:je,success:0,orderstatus:"assigned",processing:Q()().format("YYYY-MM-DD HH:mm:ss"),notifytype:2,notifyreason:"Staff Un-Assigned"}],fcmmodel:{priority:"high",registration_ids:n,data:{Title:"Staff Un-Asigned",message:"A Staff has been Un-assigned to the order ".concat(je),tenantid:Jn,orderheaderid:qn,orderid:je,configid:2},notification:{body:"An order has been Un-assigned ".concat(je),title:"Legendary",sound:"ring",content_available:!0,click_action:"FLUTTER_NOTIFICATION_CLICK"}}};console.log("grpnotifyobj unassign"),console.log(t),ni(t)};(0,c.useEffect)((function(){console.log(qn),qn&&Jn?(zt(),Vt(),ti(),console.log(Ce.state||"")):fe(!1),console.log(qn,Jn)}),[qn,Jn,vt]);var Jt=function(){nn(!1),Wn([]),Ft(["",""])};(0,c.useEffect)((function(){console.log(Zt)}));var $t=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){var n,t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t=[],Kn.map((function(e){n.push({orderprocessid:0,processdate:Q()().format("YYYY-MM-DD HH:mm:ss"),tenantid:Jn,orderheaderid:qn,orderdetailid:e.orderdetailid,productid:e.productid,userid:e.userid,orderstatus:"pending",pending:"".concat(Q()(ct).format("YYYY-MM-DD")," ").concat(Q()(ct).format("HH:mm:ss")),starttime:"".concat(Q()(tt).format("YYYY-MM-DD")," ").concat(Q()(tt).format("HH:mm:ss")),endtime:"".concat(Q()(st).format("YYYY-MM-DD")," ").concat(Q()(st).format("HH:mm:ss")),appuserid:parseInt(localStorage.getItem("appuserid")),shiftid:e.shiftid,userrate:e.userrate,productrate:e.productrate}),Kn.map((function(e){t.push({notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(je),configid:2,tenantid:Jn,orderheaderid:qn,orderprocessid:0,shiftid:e.shiftid,userid:e.userid,orderid:je,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK",firstname:e.firstname})}))})),console.log("arr"),console.log(n),e.next=7,d.Z.post("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/createorderprocess"),n).then((function(e){console.log(e),"Successfully created"===e.data.message&&((0,te.yv)("Roles assigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),console.log(ht,"","",qn,t[0].shiftid),nn(!1),Vt(),ti())})).catch((function(e){console.log(e)}));case 7:console.log(n);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ei=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){var t,i;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.userfcmtoken,i={notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(je),configid:2,tenantid:Jn,orderheaderid:qn,orderprocessid:n.orderprocessid,shiftid:n.shiftid,userid:n.userid,orderid:je,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK"},console.log(i,t),e.next=5,d.Z.post("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/utils/notification/send"),{priority:"high",registration_ids:[t],data:i,notification:{body:"A Staff has been assigned to ".concat(je),title:"Legendary",sound:"ring",content_available:!0}},{headers:{Authorization:"Bearer ".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_STAFF_TOKEN)}}).then((function(e){console.log(e),(0,te.yv)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})})).catch((function(e){console.log(e)}));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ni=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),e.next=3,d.Z.post("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/utils/notification/sendall"),n,{headers:{Authorization:"Bearer ".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_STAFF_TOKEN)}}).then((function(e){console.log(e),e.data.status&&((0,te.yv)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),zt())})).catch((function(e){console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ti=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.get("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getorderstatuscount?orderheaderid=").concat(qn)).then((function(e){e.data.status?(console.log(e),bt(e.data.pendingcount),zt()):(bt(e.data.pendingcount),zt())})).catch((function(e){console.log(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function ii(e){var n=e.open,t=e.handleClose,i=(0,c.useState)(""),r=(0,a.Z)(i,2),s=r[0],o=r[1];return(0,oe.jsxs)(R.Z,{open:n,onClose:function(){return t(!1)},maxWidth:"xs",PaperProps:{sx:{borderRadius:3}},children:[(0,oe.jsx)(re.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(Pe("#ef4444")," 0%, ").concat(Pe("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(Ee)},children:(0,oe.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,oe.jsx)(T.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40},children:(0,oe.jsx)(P.Z,{})}),(0,oe.jsxs)(p.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h5",sx:{fontWeight:800,color:de},children:"Cancel Order"}),(0,oe.jsx)(f.Z,{variant:"caption",sx:{color:_e,fontWeight:600},children:"Confirm to permanently cancel this order"})]})]})}),(0,oe.jsx)(Z.Z,{sx:{pt:3},children:(0,oe.jsxs)(p.Z,{alignItems:"center",spacing:2.5,children:[(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:Pe("#f59e0b"),border:"1px solid ".concat(Re("#f59e0b")),color:"#f59e0b",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:12})," ",je.slice(4)]}),kt&&(0,oe.jsxs)(C.Z,{color:"warning",variant:"border",icon:(0,oe.jsx)($.Z,{}),children:[(0,oe.jsx)(g.Z,{children:"Order is within 24Hrs time frame. The order will be invoiced with standard pricing as agreed."}),(0,oe.jsx)(S.Z,{href:"https://thelegendarystaff.com/",target:"_blank",children:"Terms & Condition link"})]}),(0,oe.jsx)(f.Z,{variant:"body1",align:"center",sx:{color:_e,fontWeight:600},children:"Please type in the order number to confirm."}),(0,oe.jsx)(j.Z,{type:"text",fullWidth:!0,onChange:function(e){return o(e.target.value)},error:s!==je.slice(4),value:s,placeholder:je.slice(4)}),(0,oe.jsxs)(p.Z,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,oe.jsx)(m.Z,{fullWidth:!0,onClick:function(){return t(!1)},variant:"outlined",sx:{borderRadius:999,py:1,borderColor:Ee,color:_e,fontWeight:700,"&:hover":{borderColor:_e,bgcolor:xe}},children:"No"}),(0,oe.jsx)(m.Z,{fullWidth:!0,variant:"contained",autoFocus:!0,onClick:function(){s===je.slice(4)&&(Gt(),t(!0))},sx:{borderRadius:999,py:1,bgcolor:"#ef4444",fontWeight:700,boxShadow:"0 6px 18px ".concat(ue("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]})}return(0,oe.jsxs)(oe.Fragment,{children:[he&&(0,oe.jsx)(G.Z,{}),(0,oe.jsx)(ii,{open:Ye,handleClose:function(){ke(!1)}}),(0,oe.jsxs)(R.Z,{maxWidth:!1,fullWidth:!0,open:en,onClose:Jt,scroll:"paper",TransitionComponent:z.S,children:[(0,oe.jsxs)(I.Z,{sx:{background:"linear-gradient(135deg, ".concat(Pe(pe)," 0%, ").concat(Pe(Te)," 100%)"),borderBottom:"1px solid ".concat(Ee),p:{xs:2,sm:2.5}},children:[(0,oe.jsxs)(p.Z,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,children:[(0,oe.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,oe.jsx)(T.Z,{sx:{bgcolor:pe,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ue(pe))},children:(0,oe.jsx)(ie.Z5O,{size:20})}),(0,oe.jsxs)(p.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h4",sx:{fontWeight:800,color:de,lineHeight:1.1},children:"Assign Roles"}),(0,oe.jsxs)(f.Z,{variant:"caption",sx:{color:_e,fontWeight:600},children:[ze," \xb7 ",ln]})]})]}),(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:Pe("#f59e0b"),border:"1px solid ".concat(Re("#f59e0b")),color:"#f59e0b",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:12})," ",je]})]}),(0,oe.jsxs)(D.ZP,{container:!0,sx:{pt:2},spacing:1.5,children:[(0,oe.jsx)(D.ZP,{item:!0,sm:6,xs:12,children:(0,oe.jsxs)(re.Z,{onClick:function(){return jt((function(e){return 0===e?1:0}))},sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.625,borderRadius:999,cursor:"pointer",bgcolor:pe,color:"#fff",fontWeight:800,fontSize:12,boxShadow:"0 6px 18px ".concat(ue(pe))},children:[(0,oe.jsx)(T.Z,{sx:{width:22,height:22,bgcolor:"rgba(255,255,255,0.22)",color:"#fff"},children:(0,oe.jsx)(ie.Z5O,{size:12})}),ln||"Role"]})}),(0,oe.jsx)(D.ZP,{item:!0,sm:6,xs:12,children:(0,oe.jsx)(p.Z,{direction:"row",justifyContent:{xs:"flex-start",sm:"flex-end"},spacing:1,flexWrap:"wrap",useFlexGap:!0,children:[{label:"Required",value:Zt.shifts,color:pe},{label:"Assigned",value:Zt.assigned,color:"#10b981"},{label:"Remaining",value:Zt.remaining,color:"#ef4444"}].map((function(e){var n;return(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.625,px:1,py:.5,borderRadius:999,bgcolor:Pe(e.color),border:"1px solid ".concat(Re(e.color)),color:e.color,fontSize:11.5,fontWeight:800},children:[e.label,(0,oe.jsx)(re.Z,{sx:{minWidth:22,height:18,px:.5,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:11,fontWeight:800,bgcolor:"#fff",color:e.color,border:"1px solid ".concat(Re(e.color))},children:null!==(n=e.value)&&void 0!==n?n:0})]},e.label)}))})})]})]}),(0,oe.jsx)(Z.Z,{dividers:!0,children:0===Bn.length?(0,oe.jsx)(oe.Fragment,{children:he?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(p.Z,{alignItems:"center",children:(0,oe.jsx)(v.Z,{})})}):(0,oe.jsx)(f.Z,{children:"No Staffs Available"})}):(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(L.Z,{children:(0,oe.jsxs)(U.Z,{children:[(0,oe.jsx)(y.Z,{children:"#"}),(0,oe.jsx)(y.Z,{children:"Staff"}),(0,oe.jsx)(y.Z,{children:"Category"}),(0,oe.jsx)(y.Z,{children:"Price"}),(0,oe.jsx)(y.Z,{children:"Experience"}),(0,oe.jsx)(y.Z,{children:"Level"}),(0,oe.jsx)(y.Z,{children:"City"}),(0,oe.jsx)(y.Z,{children:"Action"}),(0,oe.jsx)(y.Z,{})]})}),(0,oe.jsx)(F.Z,{children:Bn.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsxs)(U.Z,{sx:{backgroundColor:Kn.find((function(n){return n.userid==e.userid}))?"#f5f5f5":"",":hover":{backgroundColor:Kn.find((function(n){return n.userid==e.userid}))?"#f5f5f5 !important":""}},children:[(0,oe.jsx)(y.Z,{component:"th",scope:"row",padding:"none",children:n+1}),(0,oe.jsx)(y.Z,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,oe.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,oe.jsx)(T.Z,{alt:"",size:"sm",src:"",sx:{width:"25px",height:"25px"}}),(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"caption",children:e.firstname}),(0,oe.jsx)(f.Z,{variant:"caption",color:"textSecondary",children:e.contactno})]})]})}),(0,oe.jsx)(y.Z,{align:"left",children:(0,oe.jsxs)(p.Z,{direction:"column",alignItems:"flex-start",children:[(0,oe.jsx)(f.Z,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,oe.jsx)(N.Z,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,oe.jsx)(y.Z,{children:e.rolecost}),(0,oe.jsxs)(y.Z,{align:"left",children:[e.experience," Years"]}),(0,oe.jsx)(y.Z,{align:"left",children:(0,oe.jsx)(N.Z,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,oe.jsx)(y.Z,{align:"left",children:e.city}),(0,oe.jsx)(y.Z,{align:"left",children:e.orderdetailid!==At?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(H.Z,{disabled:0!==e.orderdetailid,checked:!!Kn.find((function(n){return n.userid==e.userid})),onClick:function(n){if(console.log(Zt),Zt.remaining>=0){if(n.target.checked&&0!=Zt.remaining){var t=Kn;t.push({userid:e.userid,orderdetailid:At,productid:ht,shiftid:Zt.shiftid,userrate:Zt.price,productrate:e.rolecost,firstname:e.firstname}),Wn((0,r.Z)(t));var s=Zt;s.assigned++,s.remaining=s.shifts-s.assigned,Ct((0,i.Z)({},s))}else if(Zt.assigned!=Zt.shifts||0===Zt.remaining&&!n.target.checked){var o=Kn,a=o.findIndex((function(n){return n.userid===e.userid}));o.splice(a,1),Wn((0,r.Z)(o));var c=Zt;c.assigned--,c.remaining=c.shifts-c.assigned,Ct((0,i.Z)({},c))}console.log(Kn)}}})}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(N.Z,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,oe.jsx)(M.Z,{title:"Unassign",children:(0,oe.jsx)(B.Z,{color:"error",onClick:function(){console.log(e),Xt(e)},children:(0,oe.jsx)(ee.Z,{})})}),(0,oe.jsx)(M.Z,{title:"Send Notification",children:(0,oe.jsx)(B.Z,{color:"info",onClick:function(){console.log(e),ei(e)},children:(0,oe.jsx)(u.Z,{})})})]})}),(0,oe.jsx)(y.Z,{children:e.orderid&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(N.Z,{label:e.orderid,color:"warning",size:"small",variant:"light"})})})]})},n)}))})]})})}),(0,oe.jsx)(w.Z,{children:(0,oe.jsxs)(p.Z,{sx:{mt:2},direction:"row",justifyContent:"flex-end",spacing:5,children:[Bn.length>0&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(m.Z,{sx:{width:"130px"},variant:"contained",onClick:$t,children:"OK"}),(0,oe.jsx)(m.Z,{sx:{width:"130px"},color:"warning",variant:"contained",onClick:function(){Wn([]);var e=Zt;e.remaining=e.shifts,e.assigned=0,Ct(e)},children:"clear"})]}),(0,oe.jsx)(m.Z,{sx:{width:"130px"},color:"error",variant:"contained",onClick:function(){Jt()},children:"Close"})]})})]}),(0,oe.jsxs)(D.ZP,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,oe.jsx)(se.Z,{elevation:0,sx:{position:"sticky",top:"60px",zIndex:5,mb:2,p:{xs:1.5,sm:2,md:2.5},borderRadius:ce/8,border:"1px solid",borderColor:Ee,background:"linear-gradient(135deg, ".concat(Pe(pe)," 0%, ").concat(Pe(Te)," 100%)"),boxShadow:le},children:(0,oe.jsxs)(p.Z,{direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",spacing:{xs:1.5,md:2},children:[(0,oe.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,oe.jsx)(B.Z,{onClick:function(){return history.back()},sx:{bgcolor:"#fff",border:"1px solid ".concat(Ee),borderRadius:999,color:de,"&:hover":{bgcolor:Pe(pe),borderColor:Re(pe),color:pe}},children:(0,oe.jsx)(ie.KYK,{size:18})}),(0,oe.jsx)(T.Z,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:pe,color:"#fff",boxShadow:"0 6px 18px ".concat(ue(pe))},children:(0,oe.jsx)(ie.VHP,{size:22})}),(0,oe.jsxs)(p.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h3",sx:{fontWeight:800,color:de,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Order Details"}),(0,oe.jsxs)(p.Z,{direction:"row",alignItems:"center",spacing:.75,flexWrap:"wrap",useFlexGap:!0,sx:{mt:.75},children:[(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:Pe("#f59e0b"),border:"1px solid ".concat(Re("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:11}),""===je?(0,oe.jsx)(Y.Z,{sx:{width:80},animation:"wave"}):je]}),(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:Pe(pe),border:"1px solid ".concat(Re(pe)),color:pe,fontSize:11,fontWeight:800},children:[(0,oe.jsx)(ie.dKE,{size:11}),""===Ue?(0,oe.jsx)(Y.Z,{sx:{width:80},animation:"wave"}):Ue]}),(0,oe.jsx)(Ze,{status:sn})]})]})]}),(0,oe.jsxs)(p.Z,{direction:"row",spacing:1.5,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[("pending"===sn||"assigned"===sn||"confirmed"===sn||"modified"===sn)&&(0,oe.jsx)(M.Z,{title:"Edit",children:(0,oe.jsx)(m.Z,{variant:"outlined",sx:{borderRadius:999,borderColor:Re(pe),color:pe,fontWeight:700,px:2,"&:hover":{borderColor:pe,bgcolor:Pe(pe),boxShadow:"0 0 0 3px ".concat(ue(pe))}},startIcon:(0,oe.jsx)(ie.zmo,{size:16}),onClick:function(e){e.stopPropagation(),Q()(Q()().format("MM-DD-YYYY")).isBefore(Q()(Q()(Mt).format("MM-DD-YYYY")))?Ot("/editorder",{state:{orderheaderid:qn,tenantid:Jn}}):(0,te.yv)("Order cannot be edited.\n Order date is not valid at this time",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:4e3,style:{whiteSpace:"pre-line"}})},children:"Edit Order"})}),"cancelled"!==sn&&""!==sn&&"completed"!==sn&&"closed"!==sn&&(0,oe.jsx)(m.Z,{variant:"outlined",sx:{borderRadius:999,borderColor:Re("#ef4444"),color:"#ef4444",fontWeight:700,px:2,"&:hover":{borderColor:"#ef4444",bgcolor:Pe("#ef4444"),boxShadow:"0 0 0 3px ".concat(ue("#ef4444"))}},onClick:function(){Q()(Mt).diff(Q()(),"m")/60>24?(Kt(!1),ke(!0)):(Kt(!0),ke(!0))},startIcon:(0,oe.jsx)(V.Z,{}),children:"Cancel Order"}),"cancelled"===sn&&(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:Pe("#ef4444"),border:"1px solid ".concat(Re("#ef4444")),color:"#ef4444",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.B4e,{size:12})," Cancelled on ",Fn]})]})]})}),(0,oe.jsx)(D.ZP,{item:!0,xs:12,sx:{mt:-2},children:(0,oe.jsx)(q.Z,{content:!1,width:"100%",children:(0,oe.jsxs)(D.ZP,{container:!0,spacing:2.5,sx:{p:2.5},children:[(0,oe.jsx)(D.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(q.Z,{sx:{height:"100%"},children:(0,oe.jsxs)(p.Z,{spacing:1,children:[(0,oe.jsx)(f.Z,{variant:"h5",children:"Client"}),(0,oe.jsx)(f.Z,{color:"secondary",children:""===ze?(0,oe.jsx)(Y.Z,{sx:{width:"40%"},animation:"wave"}):ze}),(0,oe.jsx)(k.Z,{sx:{width:"100%"},children:(0,oe.jsx)(f.Z,{color:"secondary",children:""===Xe?(0,oe.jsx)(Y.Z,{sx:{width:"90%"},animation:"wave"}):Xe})})]})})}),(0,oe.jsx)(D.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(q.Z,{sx:{height:"100%"},children:(0,oe.jsxs)(p.Z,{spacing:1,children:[(0,oe.jsx)(f.Z,{variant:"h5",children:"Event"}),(0,oe.jsx)(k.Z,{sx:{width:"100%"},children:(0,oe.jsx)(f.Z,{color:"secondary",children:""===He?(0,oe.jsx)(Y.Z,{sx:{width:"40%"},animation:"wave"}):He})})]})})}),Rt.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsx)(D.ZP,{item:!0,xs:12,children:(0,oe.jsxs)(q.Z,{sx:{opacity:0==e.shiftstatus?"":"0.7"},children:[(0,oe.jsxs)(p.Z,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{md:"center",xs:"flex-start"},spacing:2,sx:{p:2},children:[(0,oe.jsxs)(p.Z,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{md:"center",xs:"flex-start"},children:[(0,oe.jsxs)(f.Z,{variant:"h5",children:["Shift ",n+1]}),(0,oe.jsxs)(f.Z,{color:"secondary",children:[(0,oe.jsx)(_.Z,{})," ","",e.locationaddress]}),1===e.shiftstatus&&(0,oe.jsx)(N.Z,{label:"Cancelled",color:"secondary"})]}),(0,oe.jsx)(p.Z,{direction:"row",spacing:1,children:e.ordercontacts.map((function(e){return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(M.Z,{title:e.contactname,children:(0,oe.jsx)(T.Z,{sx:{bgcolor:"#2196f3",width:30,height:30},alt:"A",children:e.contactname.charAt(0).toUpperCase()})})})}))})]}),(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(L.Z,{children:(0,oe.jsxs)(U.Z,{children:[(0,oe.jsx)(y.Z,{children:"#"}),(0,oe.jsx)(y.Z,{children:"Role"}),(0,oe.jsx)(y.Z,{children:"Start Date"}),(0,oe.jsx)(y.Z,{children:"End Date"}),(0,oe.jsx)(y.Z,{children:"Unpaid break"}),(0,oe.jsx)(y.Z,{children:"Count"}),(0,oe.jsx)(y.Z,{children:"Assigned"}),(0,oe.jsx)(y.Z,{children:"Attire"}),(0,oe.jsx)(y.Z,{children:"Price"}),(0,oe.jsx)(y.Z,{children:"Amount"}),(0,oe.jsx)(y.Z,{children:"Action"})]})}),(0,oe.jsxs)(F.Z,{children:[0===e.orderdetails.length&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(U.Z,{children:[(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsxs)(y.Z,{children:[(0,oe.jsx)(Y.Z,{animation:"wave"}),(0,oe.jsx)(Y.Z,{animation:"wave"})]}),(0,oe.jsxs)(y.Z,{children:[(0,oe.jsx)(Y.Z,{animation:"wave"}),(0,oe.jsx)(Y.Z,{animation:"wave"})]}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsx)(Y.Z,{animation:"wave"})})]})}),e.orderdetails.map((function(e,t){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(U.Z,{sx:{"&:last-child td, &:last-child th":{border:0},opacity:0==e.status?"":"0.7"},children:[(0,oe.jsx)(y.Z,{children:t+1}),(0,oe.jsx)(y.Z,{children:e.productname}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body1",children:Q()(e.starttime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.starttime).format("hh:mm A")})]})}),(0,oe.jsxs)(y.Z,{children:[" ",(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body1",children:Q()(e.endtime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.endtime).format("hh:mm A")})]})]}),(0,oe.jsx)(y.Z,{children:e.unpaidbreak||0}),(0,oe.jsx)(y.Z,{align:"center",children:(0,oe.jsx)(N.Z,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,oe.jsx)(y.Z,{align:"center",children:(0,oe.jsx)(N.Z,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,oe.jsx)(y.Z,{width:"100px"}),(0,oe.jsxs)(y.Z,{children:["$",e.price]}),(0,oe.jsxs)(y.Z,{children:["$",e.landingamount]}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{direction:"row",children:[(0,oe.jsx)(M.Z,{title:"Expand",children:(0,oe.jsx)(B.Z,{"aria-label":"expand row",style:{color:Wt.palette.primary.main},onClick:function(){wn([]),Ft(yt[0]===n&&yt[1]===t?["",""]:[n,t]),qt(e.orderdetailid)},children:yt[0]===n&&yt[1]===t?(0,oe.jsx)(x.Z,{}):(0,oe.jsx)(h.Z,{})})}),"cancelled"===sn&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(B.Z,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,oe.jsx)(A.Z,{})})}),1===e.status&&(0,oe.jsx)(M.Z,{title:"Cancelled",children:(0,oe.jsx)(B.Z,{sx:{minWidth:"10px !important"},children:(0,oe.jsx)(V.Z,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,oe.jsx)(M.Z,{title:"Assigned count is greater than ordered count",children:(0,oe.jsx)(B.Z,{color:"warning",children:(0,oe.jsx)(ne.Z,{})})})]})})]},t+1),(0,oe.jsx)(U.Z,{sx:{p:2},children:(0,oe.jsx)(y.Z,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:11,sx:{width:"100%"},children:(0,oe.jsx)(K.Z,{in:yt[0]===n&&yt[1]===t,timeout:"auto",unmountOnExit:!0,children:(0,oe.jsx)(q.Z,{sx:{width:"100%"},children:0===Bn.length?(0,oe.jsx)(oe.Fragment,{children:he?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(p.Z,{alignItems:"center",children:(0,oe.jsx)(v.Z,{})})}):(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(p.Z,{sx:{p:1},children:(0,oe.jsx)(f.Z,{children:"No Staffs has been Assigned"})})})}):(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(L.Z,{children:(0,oe.jsxs)(U.Z,{children:[(0,oe.jsx)(y.Z,{children:"#"}),(0,oe.jsx)(y.Z,{children:"Staff"}),(0,oe.jsx)(y.Z,{children:"Start Time"}),(0,oe.jsx)(y.Z,{children:"End Time"}),(0,oe.jsx)(y.Z,{children:"Pay Rate"}),(0,oe.jsx)(y.Z,{align:"center",children:"Clockin"}),(0,oe.jsx)(y.Z,{align:"center",children:"Clockout"}),(0,oe.jsx)(y.Z,{children:"Hours Worked"}),(0,oe.jsx)(y.Z,{children:"Status"})]})}),(0,oe.jsx)(F.Z,{children:Bn.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsxs)(U.Z,{sx:{},children:[(0,oe.jsx)(y.Z,{component:"th",scope:"row",padding:"none",children:n+1}),(0,oe.jsx)(y.Z,{align:"left",children:(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"caption",children:e.staffname}),(0,oe.jsx)(D.ZP,{children:(0,oe.jsx)(N.Z,{label:e.productname,color:"info",variant:"light",size:"small"})})]})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.Starttime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"caption",children:Q()(e.Starttime).format("hh:mm A")})]})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.Endtime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"caption",children:Q()(e.Endtime).format("hh:mm A")})]})}),(0,oe.jsx)(y.Z,{children:e.rolecost}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{spacing:.5,alignItems:"center",children:[(0,oe.jsx)(N.Z,{label:e.clockin?Q()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,oe.jsx)(N.Z,{label:e.clockin?Q()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(p.Z,{spacing:.5,alignItems:"center",children:[(0,oe.jsx)(N.Z,{label:e.clockout?Q()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,oe.jsx)(N.Z,{label:e.clockout?Q()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,oe.jsx)(y.Z,{children:e.hoursworked}),(0,oe.jsx)(y.Z,{align:"left",children:(0,oe.jsxs)(p.Z,{direction:"row",children:["pending"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,oe.jsx)(N.Z,{label:"Closed",color:"info",size:"small"})]})})]})},n)}))})]})})})})})})]})}))]})]})})]})})},e.locationaddress)})),(0,oe.jsx)(D.ZP,{item:!0,xs:12,children:(0,oe.jsx)(W.Z,{sx:{borderWidth:1}})}),(0,oe.jsx)(D.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(q.Z,{title:"Order Addons",sx:{height:"100%"},children:(0,oe.jsx)(D.ZP,{container:!0,spacing:2,children:(In||[]).map((function(e){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsx)(D.ZP,{item:!0,children:(0,oe.jsx)(N.Z,{icon:(0,oe.jsx)(E.Z,{}),variant:"outlined",color:"error",label:e.addon})})},e.addon)}))})})}),(0,oe.jsx)(D.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(q.Z,{title:"Total",sx:{height:"100%"},children:(0,oe.jsxs)(p.Z,{spacing:2,children:[(0,oe.jsxs)(p.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{color:Wt.palette.grey[500],children:"Sub Total:"}),(0,oe.jsxs)(f.Z,{children:["$",""===Pn?(0,oe.jsx)(Y.Z,{sx:{width:"30px"}}):Pn]})]}),(0,oe.jsxs)(p.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{color:Wt.palette.grey[500],children:"Tax:"}),(0,oe.jsx)(f.Z,{children:""===An?(0,oe.jsx)(Y.Z,{sx:{width:"30px"}}):An})]}),(0,oe.jsxs)(p.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{variant:"subtitle1",children:"Grand Total:"}),(0,oe.jsx)(f.Z,{variant:"subtitle1",children:""===Tn?(0,oe.jsx)(Y.Z,{sx:{width:"30px"}}):"$".concat(Tn)})]})]})})}),(0,oe.jsx)(D.ZP,{item:!0,xs:12,children:(0,oe.jsxs)(p.Z,{direction:"column",sx:{mt:2},children:[(0,oe.jsx)(f.Z,{color:"secondary",children:"Other Instructions:"}),(0,oe.jsx)(f.Z,{sx:{ml:3},children:On})]})})]})})})]})]})}}}]); |