(this["webpackJsonpcustomer-portal"]=this["webpackJsonpcustomer-portal"]||[]).push([[0],{295:function(e,t,n){},362:function(e,t,n){},363:function(e,t,n){},487:function(e,t,n){},489:function(e,t,n){"use strict";n.r(t),t.default=n.p+"static/media/medatech-logo.d9b936ff.png"},490:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a),r=n(34),s=n.n(r),i=(n(362),n(363),n(5)),o=n(4),l=n(18),u=n(6),d=n(321),j=n(625),b=n(602),O=n(618),h=n(626),m=n(631),x=n(627),f=n(629),g=n(200),p=n(589),S=n(628),v=n(630),E=n(616),T=n(319),C=n.n(T),A=n(320),k=n.n(A),y=n(610),D=n(585),w=n(587),P=n(300),N=n.n(P),I=n(305),R=n.n(I),L=n(49),U=n(61),F=n(70),M=n(20),W=n.n(M),B=n(296),_=new(function(){function e(){Object(U.a)(this,e)}return Object(F.a)(e,[{key:"login",value:function(e){return W.a.post("/customer_portal/login",e)}},{key:"logout",value:function(){localStorage.removeItem("token"),window.location.reload()}},{key:"getCurrentUser",value:function(){var e=localStorage.getItem("token");if(e)var t=Object(B.a)(e);return t}},{key:"changePassword",value:function(e){return W.a.post("/customer_portal/changePassword",e)}},{key:"forgotPassword",value:function(e){return W.a.post("/customer_portal/forgotPassword",e)}}]),e}());n.p;var G=n(303),z=n.n(G),Y=n(304),X=n.n(Y),q=n(301),V=n.n(q),K=n(1),Q=Object(K.jsx)("div",{children:_.getCurrentUser()?Object(K.jsxs)(K.Fragment,{children:[Object(K.jsxs)(y.a,{button:!0,component:L.b,to:"/dashboard",children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(N.a,{})}),Object(K.jsx)(w.a,{primary:"Dashboard"})]}),Object(K.jsxs)(y.a,{button:!0,component:L.b,to:"/dashboard/kanban",children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(V.a,{})}),Object(K.jsx)(w.a,{primary:"Kanban Board"})]}),Object(K.jsx)(p.a,{}),Object(K.jsxs)(y.a,{button:!0,component:L.b,to:"/dashboard/servicecalls",children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(z.a,{})}),Object(K.jsx)(w.a,{primary:"Service Calls"})]}),Object(K.jsxs)(y.a,{button:!0,component:L.b,to:"/dashboard/createservicecall",children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(X.a,{})}),Object(K.jsx)(w.a,{primary:"Create Service Call"})]})]}):Object(K.jsx)(K.Fragment,{children:Object(K.jsxs)(y.a,{button:!0,component:L.b,to:"/login",children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(R.a,{})}),Object(K.jsx)(w.a,{primary:"Login"})]})})}),H=n(641),Z=n(642),J=n(638),$=n(645),ee=n(636),te=n(612),ne=n(637),ae=n(329);function ce(){var e=localStorage.getItem("token");return e?{"x-access-token":e}:{}}var re=new(function(){function e(){Object(U.a)(this,e)}return Object(F.a)(e,[{key:"getItemsForSale",value:function(){return W.a.get("/customer_portal/itemsForSale",{headers:ce()})}},{key:"getOrders",value:function(){return W.a.get("/customer_portal/orders",{headers:ce()})}},{key:"getCustomerOrders",value:function(){return W.a.get("/customer_portal/customerOrders",{headers:ce()})}},{key:"getOrderItems",value:function(e){return W.a.get("/customer_portal/orderItems/".concat(e),{headers:ce()})}},{key:"getShipments",value:function(){return W.a.get("/customer_portal/shipments",{headers:ce()})}},{key:"getCustomerShipments",value:function(){return W.a.get("/customer_portal/customerShipments",{headers:ce()})}},{key:"getShipmentItems",value:function(e,t){return W.a.get("/customer_portal/shipmentItems/".concat(e,"/").concat(t),{headers:ce()})}},{key:"getInvoices",value:function(){return W.a.get("/customer_portal/invoices",{headers:ce()})}},{key:"getCustomerInfo",value:function(e){return W.a.get("/customer_portal/getCustomerInfo",{headers:ce()})}},{key:"getCustomerInvoices",value:function(){return W.a.get("/customer_portal/customerInvoices",{headers:ce()})}},{key:"getInvoiceItems",value:function(e,t,n){return W.a.get("/customer_portal/invoiceItems/".concat(e,"/").concat(t,"/").concat(n),{headers:ce()})}},{key:"getCustomerParts",value:function(){return W.a.get("/customer_portal/customerParts",{headers:ce()})}},{key:"createOrder",value:function(e){return W.a.post("/customer_portal/createOrder",e,{headers:ce()})}},{key:"getUserNotifications",value:function(){return W.a.get("/customer_portal/userNotifications",{headers:ce()})}},{key:"setNotificationRead",value:function(e){return W.a.post("/customer_portal/userNotifications",e,{headers:ce()})}},{key:"createTask",value:function(e){return W.a.post("/customer_portal/createTask",e,{headers:ce()})}},{key:"updateTask",value:function(e){return W.a.patch("/customer_portal/updateTask",e,{headers:ce()})}},{key:"getServiceCalls",value:function(){return W.a.get("/customer_portal/servicecalls",{headers:ce()})}},{key:"getServiceCall",value:function(e){return W.a.get("/customer_portal/servicecall/".concat(e),{headers:ce()})}},{key:"getServiceCallExternalRemarks",value:function(e){return W.a.get("/customer_portal/servicecall/remarks/".concat(e),{headers:ce()})}},{key:"getTaskExplanation",value:function(e){return W.a.get("/customer_portal/taskExplanation/".concat(e),{headers:ce()})}},{key:"getTaskAttachments",value:function(e){return W.a.get("/customer_portal/taskAttachments/".concat(e),{headers:ce()})}},{key:"getCallStatuses",value:function(){return W.a.get("/customer_portal/callStatuses",{headers:ce()})}},{key:"getStatusLang2",value:function(e){return W.a.get("/customer_portal/statusLang2/".concat(e),{headers:ce()})}},{key:"getCallTypes",value:function(){return W.a.get("/customer_portal/callTypes",{headers:ce()})}},{key:"getCallSeverities",value:function(){return W.a.get("/customer_portal/callSeverities",{headers:ce()})}},{key:"getCustomerContacts",value:function(){return W.a.get("/customer_portal/customerContacts",{headers:ce()})}},{key:"getUserProjects",value:function(){return W.a.get("/customer_portal/userProjects",{headers:ce()})}},{key:"getProjectTasks",value:function(e){return W.a.get("/customer_portal/projectTasks/".concat(e),{headers:ce()})}},{key:"getProjectWBS",value:function(e){return W.a.get("/customer_portal/projectWBS/".concat(e),{headers:ce()})}},{key:"getGanttWBS",value:function(e){return W.a.get("/customer_portal/ganttWBS/".concat(e),{headers:ce()})}},{key:"getSCAttachments",value:function(e){return W.a.get("/customer_portal/scAttachments/".concat(e),{headers:ce()})}},{key:"getTaskStatuses",value:function(){return W.a.get("/customer_portal/taskStatuses",{headers:ce()})}},{key:"getTaskTypes",value:function(){return W.a.get("/customer_portal/taskTypes",{headers:ce()})}},{key:"getTaskSizes",value:function(){return W.a.get("/customer_portal/taskSizes",{headers:ce()})}},{key:"getUsers",value:function(){return W.a.get("/customer_portal/users",{headers:ce()})}},{key:"getCustomerStatements",value:function(){return W.a.get("/customer_portal/customerStatements",{headers:ce()})}},{key:"addServiceCallComment",value:function(e){return W.a.post("/customer_portal/addServiceCallComment",e,{headers:ce()})}},{key:"updateServiceCall",value:function(e){return W.a.patch("/customer_portal/updateServiceCall",e,{headers:ce()})}},{key:"updateCallStatus",value:function(e){return W.a.post("/customer_portal/updateCallStatus",e,{headers:ce()})}},{key:"changeTaskStatus",value:function(e){return W.a.patch("/customer_portal/changeTaskStatus",e,{headers:ce()})}},{key:"CreateServiceCall",value:function(e){return W.a.post("/customer_portal/createServiceCall",e,{headers:ce()})}},{key:"addServiceCallAttachment",value:function(e){return W.a.post("/customer_portal/addServiceCallAttachment",e,{headers:ce()})}},{key:"getCustomerSignup",value:function(e){return W.a.get("/customer_portal/CustomerSignup/".concat(e))}},{key:"checkContact",value:function(e){return W.a.get("/customer_portal/check_contact/".concat(e))}},{key:"checkUser",value:function(e){return W.a.get("/customer_portal/check_user/".concat(e))}},{key:"createContact",value:function(e){return W.a.post("/customer_portal/CreateContact/",e)}},{key:"createUser",value:function(e){return W.a.post("/customer_portal/CreateUser/",e)}},{key:"downloadOrderPdf",value:function(e){return W()({url:"/customer_portal/downloadOrderPdf",method:"POST",responseType:"blob",headers:ce(),data:{ORDNAME:e}})}},{key:"downloadInvoicePdf",value:function(e){return W()({url:"/customer_portal/downloadInvoicePdf",method:"POST",responseType:"blob",headers:ce(),data:{IVNUM:e}})}},{key:"downloadShipmentPdf",value:function(e){return W()({url:"/customer_portal/downloadShipmentPdf",method:"POST",responseType:"blob",headers:ce(),data:{DOCNO:e}})}},{key:"downloadStatementPdf",value:function(e){return W()({url:"/customer_portal/downloadStatementPdf",method:"POST",responseType:"blob",headers:ce(),data:{STATEMENTNO:e}})}}]),e}()),se=n(112),ie=n.n(se),oe=n(111),le=n.n(oe),ue=n(639),de=n(640),je=n(21),be=n(634),Oe=n(619),he=function(){return Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(be.a,{}),Object(K.jsx)(Oe.a,{variant:"rectangular",height:50,style:{marginBottom:10}}),Object(je.a)(Array(25)).map((function(e,t){return Object(K.jsx)(Oe.a,{variant:"rectangular",height:25,style:{marginBottom:5}},t)}))]})},me=n(93),xe=n.n(me),fe=n(33),ge=n(621),pe=n(500);function Se(e,t,n){return t[n]e[n]?1:0}function ve(e,t){return"desc"===e?function(e,n){return Se(e,n,t)}:function(e,n){return-Se(e,n,t)}}function Ee(e,t){var n=e.map((function(e,t){return[e,t]}));return n.sort((function(e,n){var a=t(e[0],n[0]);return 0!==a?a:e[1]-n[1]})),n.map((function(e){return e[0]}))}var Te=n(620),Ce=n(591);function Ae(e){var t=e.order,n=e.orderBy,a=e.onRequestSort;return Object(K.jsx)(ee.a,{children:Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{}),e.headCells.map((function(e){return Object(K.jsx)(J.a,{align:"center",padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,children:Object(K.jsxs)(Te.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(c=e.id,function(e){return a(e,c)}),children:[Object(K.jsx)("b",{children:e.label}),n===e.id?Object(K.jsx)(h.a,{component:"span",sx:Ce.a,children:"desc"===t?"sorted descending":"sorted ascending"}):null]})},e.id);var c}))]})})}var ke=function(e){var t=e.title;return Object(K.jsxs)(x.a,{sx:{pl:{sm:2},pr:{xs:1,sm:1}},children:[Object(K.jsx)(g.a,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div",children:t}),")"]})};n(307),n(623);var ye=[{id:"CURDATE",numeric:!1,disablePadding:!0,label:"Date"},{id:"ORDNAME",numeric:!0,disablePadding:!1,label:"Order No."},{id:"REFERENCE",numeric:!0,disablePadding:!1,label:"Cust. P.O."},{id:"QPRICE",numeric:!0,disablePadding:!1,label:"Price ex. VAT"},{id:"TOTPRICE",numeric:!0,disablePadding:!1,label:"Total Price"},{id:"ORDSTATUSDES",numeric:!0,disablePadding:!1,label:"Order Status"},{id:"NAME",numeric:!1,disablePadding:!0,label:"Contact"},{id:"ACTION",numeric:!0,disablePadding:!1,label:"Action"}];function De(e){var t=e.row,n=Object(a.useState)(!1),r=Object(i.a)(n,2),s=r[0],o=r[1],l=Object(a.useState)([]),u=Object(i.a)(l,2),d=u[0],j=u[1],b=Object(a.useState)(!0),O=Object(i.a)(b,2),m=O[0],x=O[1],f=Object(fe.b)(),p=f.enqueueSnackbar,v=(f.closeSnackbar,function(){s?o(!s):(x(!1),re.getOrderItems(t.ORDNAME).then((function(e){j(e.data.value),x(!0),o(!s)})).catch((function(e){console.log(e)})))});return Object(K.jsxs)(c.a.Fragment,{children:[Object(K.jsxs)(ne.a,{sx:{"& > *":{borderBottom:"unset"}},children:[Object(K.jsx)(J.a,{children:m?Object(K.jsx)(S.a,{"aria-label":"expand row",size:"small",onClick:v,children:s?Object(K.jsx)(le.a,{}):Object(K.jsx)(ie.a,{})}):Object(K.jsx)(ue.a,{size:28})}),Object(K.jsx)(J.a,{component:"th",scope:"row",children:new Date(t.CURDATE).toLocaleDateString("en-GB")}),Object(K.jsx)(J.a,{align:"center",children:t.ORDNAME}),Object(K.jsx)(J.a,{align:"center",children:t.REFERENCE}),Object(K.jsxs)(J.a,{align:"center",children:[t.CODE," ",t.QPRICE.toLocaleString()]}),Object(K.jsxs)(J.a,{align:"center",children:[t.CODE," ",t.TOTPRICE.toLocaleString()]}),Object(K.jsx)(J.a,{align:"center",children:Object(K.jsx)(ge.a,{style:{color:function(e){switch(e){case"Draft":return"#00ff00";case"Confirmed":return"#fe9e00";case"In Progress":return"#5ab963";case"Completed":return"#80ffff";case"Assm Opened":case"Partial Assm":case"Assembled":return"#ff80ff";case"Paid":return"#ffff00";case"Canceled":return"#ff0000";default:return"black"}}(t.ORDSTATUSDES)},label:t.ORDSTATUSDES})}),Object(K.jsx)(J.a,{align:"center",children:t.NAME}),Object(K.jsx)(J.a,{align:"center",children:Object(K.jsx)(S.a,{onClick:function(){return e=t.ORDNAME,void re.downloadOrderPdf(e).then((function(t){var n=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=n,a.setAttribute("download","".concat(e,".pdf")),document.body.appendChild(a),a.click()})).catch((function(e){console.log(e.response),p("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(K.jsx)(xe.a,{})})})]}),Object(K.jsx)(ne.a,{children:Object(K.jsx)(J.a,{style:{paddingBottom:0,paddingTop:0,paddingLeft:100,backgroundColor:"#F8F8F8"},colSpan:8,children:Object(K.jsx)(de.a,{in:s,timeout:"auto",unmountOnExit:!0,onClick:v,children:Object(K.jsxs)(h.a,{sx:{margin:1},children:[Object(K.jsx)(g.a,{variant:"h6",gutterBottom:!0,component:"div",children:"Order Items"}),m?Object(K.jsxs)(H.a,{size:"small","aria-label":"order-items",children:[Object(K.jsx)(ee.a,{children:Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{children:Object(K.jsx)("b",{children:"Part No."})}),Object(K.jsx)(J.a,{children:Object(K.jsx)("b",{children:"Part Name"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Quantity"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Balance"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Price"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Total Price ex. VAT"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Total Price"})})]})}),Object(K.jsx)(Z.a,{children:d.map((function(e,t){return Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{component:"th",scope:"row",children:e.PARTNAME}),Object(K.jsx)(J.a,{children:e.PDES}),Object(K.jsx)(J.a,{align:"right",children:e.TQUANT}),Object(K.jsx)(J.a,{align:"right",children:e.TBALANCE}),Object(K.jsxs)(J.a,{align:"right",children:[e.CODE," ",e.PRICE]}),Object(K.jsxs)(J.a,{align:"right",children:[e.CODE," ",e.QPRICE]}),Object(K.jsxs)(J.a,{align:"right",children:[e.CODE," ",e.VATPRICE]})]},t)}))})]}):Object(K.jsx)(ue.a,{})]})})})})]})}function we(){var e=Object(a.useState)("asc"),t=Object(i.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),s=Object(i.a)(r,2),o=s[0],l=s[1],u=Object(a.useState)([]),d=Object(i.a)(u,2),j=d[0],b=(d[1],Object(a.useState)(0)),O=Object(i.a)(b,2),m=O[0],x=O[1],f=Object(a.useState)(5),g=Object(i.a)(f,2),p=g[0],S=g[1],v=Object(a.useState)([]),E=Object(i.a)(v,2),T=E[0],C=E[1],A=Object(a.useState)(!1),k=Object(i.a)(A,2),y=k[0],D=k[1];Object(a.useEffect)((function(){re.getCustomerOrders().then((function(e){C(e.data.value),D(!0)})).catch((function(e){console.log(e)}))}),[]);return y?Object(K.jsx)(h.a,{sx:{width:"100%"},children:Object(K.jsxs)(ae.a,{sx:{width:"100%",mb:2},children:[Object(K.jsx)(ke,{title:"Orders"}),Object(K.jsx)($.a,{children:Object(K.jsxs)(H.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(K.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:T.length,headCells:ye}),Object(K.jsx)(Z.a,{children:T.slice().sort(ve(n,o)).slice(m*p,m*p+p).map((function(e,t){return Object(K.jsx)(De,{row:e},t)}))})]})}),Object(K.jsx)(te.a,{rowsPerPageOptions:[5,10,25],component:"div",count:T.length,rowsPerPage:p,page:m,onPageChange:function(e,t){x(t)},onRowsPerPageChange:function(e){S(parseInt(e.target.value,10)),x(0)}})]})}):Object(K.jsx)(he,{})}var Pe=function(){return Object(K.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(K.jsx)(E.a,{item:!0,xs:12,children:Object(K.jsx)(we,{})})})},Ne=[{id:"CURDATE",numeric:!1,disablePadding:!0,label:"Date"},{id:"DOCNO",numeric:!0,disablePadding:!1,label:"Shipment No."},{id:"REFERENCE",numeric:!0,disablePadding:!1,label:"Cust. P.O."},{id:"QPRICE",numeric:!0,disablePadding:!1,label:"Price ex. VAT"},{id:"TOTPRICE",numeric:!0,disablePadding:!1,label:"Total Price"},{id:"STATDES",numeric:!0,disablePadding:!1,label:"Shipment Status"},{id:"ACTION",numeric:!0,disablePadding:!1,label:"Action"}];function Ie(e){var t=e.row,n=Object(a.useState)(!1),r=Object(i.a)(n,2),s=r[0],o=r[1],l=Object(a.useState)([]),u=Object(i.a)(l,2),d=u[0],j=u[1],b=Object(a.useState)(!0),O=Object(i.a)(b,2),m=O[0],x=O[1],f=Object(fe.b)(),p=f.enqueueSnackbar,v=(f.closeSnackbar,function(){s?o(!s):(x(!1),re.getShipmentItems(t.DOCNO,t.TYPE).then((function(e){j(e.data.value),x(!0),o(!s)})).catch((function(e){console.log(e)})))});return Object(K.jsxs)(c.a.Fragment,{children:[Object(K.jsxs)(ne.a,{sx:{"& > *":{borderBottom:"unset"}},children:[Object(K.jsx)(J.a,{children:m?Object(K.jsx)(S.a,{"aria-label":"expand row",size:"small",onClick:v,children:s?Object(K.jsx)(le.a,{}):Object(K.jsx)(ie.a,{})}):Object(K.jsx)(ue.a,{size:28})}),Object(K.jsx)(J.a,{component:"th",scope:"row",children:new Date(t.CURDATE).toLocaleDateString("en-GB")}),Object(K.jsx)(J.a,{align:"center",children:t.DOCNO}),Object(K.jsx)(J.a,{align:"center",children:t.REFERENCE}),Object(K.jsxs)(J.a,{align:"center",children:[t.CODE," ",t.QPRICE.toLocaleString()]}),Object(K.jsxs)(J.a,{align:"center",children:[t.CODE," ",t.TOTPRICE.toLocaleString()]}),Object(K.jsx)(J.a,{align:"center",children:Object(K.jsx)(ge.a,{style:{color:function(e){switch(e){case"Draft":return"#00ff00";case"Final":return"#ffd233";case"Canceled":return"#f56b62";default:return"black"}}(t.STATDES)},label:t.STATDES})}),Object(K.jsx)(J.a,{align:"center",children:Object(K.jsx)(S.a,{onClick:function(){return e=t.DOCNO,void re.downloadShipmentPdf(e).then((function(t){var n=window.URL.createObjectURL(new Blob([t.data])),a=document.createElement("a");a.href=n,a.setAttribute("download","".concat(e,".pdf")),document.body.appendChild(a),a.click()})).catch((function(e){console.log(e.response),p("File not found. Please contact system manager.",{variant:"error"})}));var e},children:Object(K.jsx)(xe.a,{})})})]}),Object(K.jsx)(ne.a,{children:Object(K.jsx)(J.a,{style:{paddingBottom:0,paddingTop:0,paddingLeft:100,backgroundColor:"#F8F8F8"},colSpan:8,children:Object(K.jsx)(de.a,{in:s,timeout:"auto",unmountOnExit:!0,onClick:v,children:Object(K.jsxs)(h.a,{sx:{margin:1},children:[Object(K.jsx)(g.a,{variant:"h6",gutterBottom:!0,component:"div",children:"Shipped Items"}),m?Object(K.jsxs)(H.a,{size:"small","aria-label":"purchases",children:[Object(K.jsx)(ee.a,{children:Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{children:Object(K.jsx)("b",{children:"Part No."})}),Object(K.jsx)(J.a,{children:Object(K.jsx)("b",{children:"Part Name"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Quantity"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Price"})}),Object(K.jsx)(J.a,{align:"right",children:Object(K.jsx)("b",{children:"Total Price ex. VAT"})})]})}),Object(K.jsx)(Z.a,{children:d.map((function(e,t){return Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{component:"th",scope:"row",children:e.PARTNAME}),Object(K.jsx)(J.a,{children:e.PDES}),Object(K.jsx)(J.a,{align:"right",children:e.TQUANT}),Object(K.jsxs)(J.a,{align:"right",children:[e.CODE," ",e.PRICE]}),Object(K.jsxs)(J.a,{align:"right",children:[e.CODE," ",e.QPRICE]})]},t)}))})]}):Object(K.jsx)(ue.a,{})]})})})})]})}function Re(){var e=Object(a.useState)("asc"),t=Object(i.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)("calories"),s=Object(i.a)(r,2),o=s[0],l=s[1],u=Object(a.useState)([]),d=Object(i.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(0),m=Object(i.a)(O,2),x=m[0],f=m[1],g=Object(a.useState)(5),p=Object(i.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)([]),T=Object(i.a)(E,2),C=T[0],A=T[1],k=Object(a.useState)(!1),y=Object(i.a)(k,2),D=y[0],w=y[1];Object(a.useEffect)((function(){re.getCustomerShipments().then((function(e){A(e.data.value),w(!0)})).catch((function(e){console.log(e)}))}),[]);return D?Object(K.jsx)(h.a,{sx:{width:"100%"},children:Object(K.jsxs)(ae.a,{sx:{width:"100%",mb:2},children:[Object(K.jsx)(ke,{title:"Shipments"}),Object(K.jsx)($.a,{children:Object(K.jsxs)(H.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(K.jsx)(Ae,{numSelected:j.length,order:n,orderBy:o,onSelectAllClick:function(e){if(e.target.checked){var t=C.map((function(e){return e.name}));b(t)}else b([])},onRequestSort:function(e,t){c(o===t&&"asc"===n?"desc":"asc"),l(t)},rowCount:C.length,headCells:Ne}),Object(K.jsx)(Z.a,{children:C.slice().sort(ve(n,o)).slice(x*S,x*S+S).map((function(e,t){return Object(K.jsx)(Ie,{row:e},t)}))})]})}),Object(K.jsx)(te.a,{rowsPerPageOptions:[5,10,25],component:"div",count:C.length,rowsPerPage:S,page:x,onPageChange:function(e,t){f(t)},onRowsPerPageChange:function(e){v(parseInt(e.target.value,10)),f(0)}})]})}):Object(K.jsx)(he,{})}var Le=function(){return Object(K.jsx)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:Object(K.jsx)(E.a,{item:!0,xs:12,children:Object(K.jsx)(Re,{})})})},Ue=n(40),Fe=n(613),Me=n(330),We=n(614),Be=n(609),_e=n(124),Ge=n.n(_e),ze=n(491),Ye=n(646),Xe=n(123),qe=n.n(Xe),Ve=n(308),Ke=n.n(Ve),Qe=n(309),He=n.n(Qe);function Ze(e){return Number.parseFloat(e).toFixed(2)}var Je=[{id:"PARTDES",numeric:!1,disablePadding:!0,label:"Item Description"},{id:"PARTNAME",numeric:!0,disablePadding:!1,label:"Item Number"},{id:"BASEPLPRICE",numeric:!0,disablePadding:!1,label:"Price"},{id:"VAT Price",numeric:!0,disablePadding:!1,label:"VAT Price"},{id:"QUANTITY",numeric:!0,disablePadding:!1,label:"Quantity"},{id:"total-price",numeric:!0,disablePadding:!1,label:"Total Price"}];function $e(e){var t=e.order,n=e.orderBy,a=e.onRequestSort;return Object(K.jsx)(ee.a,{children:Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{padding:"checkbox"}),Je.map((function(e){return Object(K.jsx)(J.a,{align:e.numeric?"right":"left",padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,children:Object(K.jsxs)(Te.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(c=e.id,function(e){a(e,c)}),children:[Object(K.jsx)("b",{children:e.label}),n===e.id?Object(K.jsx)(h.a,{component:"span",sx:Ce.a,children:"desc"===t?"sorted descending":"sorted ascending"}):null]})},e.id);var c}))]})})}var et=function(e){var t=e.numSelected;return Object(K.jsxs)(x.a,{sx:Object(l.a)({pl:{sm:2},pr:{xs:1,sm:1}},t>0&&{bgcolor:function(e){return Object(ze.a)(e.palette.primary.main,e.palette.action.activatedOpacity)}}),children:[t>0?Object(K.jsxs)(g.a,{sx:{flex:"1 1 100%"},color:"inherit",variant:"subtitle1",component:"div",children:[t," selected"]}):Object(K.jsx)(g.a,{sx:{flex:"1 1 100%"},variant:"h6",id:"tableTitle",component:"div",children:"Items in Order"}),t>0?Object(K.jsx)(Ye.a,{title:"Delete",children:Object(K.jsx)(S.a,{onClick:e.onDelete,children:Object(K.jsx)(qe.a,{})})}):Object(K.jsx)(Ye.a,{title:"Filter list",children:Object(K.jsx)(S.a,{children:Object(K.jsx)(Ke.a,{})})})]})};function tt(e){var t=a.useState("asc"),n=Object(i.a)(t,2),c=n[0],r=n[1],s=a.useState("calories"),o=Object(i.a)(s,2),l=o[0],u=o[1],d=a.useState([]),j=Object(i.a)(d,2),b=j[0],O=j[1],m=e.items;return Object(K.jsx)(h.a,{sx:{width:"100%"},children:Object(K.jsxs)(ae.a,{sx:{width:"100%",mb:2},children:[Object(K.jsx)(et,{}),Object(K.jsx)($.a,{children:Object(K.jsxs)(H.a,{sx:{minWidth:750},"aria-labelledby":"tableTitle",size:"medium",children:[Object(K.jsx)($e,{numSelected:b.length,order:c,orderBy:l,onSelectAllClick:function(e){if(e.target.checked){var t=m.map((function(e){return e.PARTNAME}));O(t)}else O([])},onRequestSort:function(e,t){r(l===t&&"asc"===c?"desc":"asc"),u(t)},rowCount:m.length}),Object(K.jsxs)(Z.a,{children:[Ee(m,ve(c,l)).map((function(t,n){var a,c=(a=t.PARTNAME,-1!==b.indexOf(a)),r="enhanced-table-checkbox-".concat(n);return Object(K.jsxs)(ne.a,{hover:!0,role:"checkbox","aria-checked":c,tabIndex:-1,selected:c,children:[Object(K.jsx)(J.a,{padding:"checkbox"}),Object(K.jsx)(J.a,{component:"th",id:r,scope:"row",padding:"none",children:t.PARTDES}),Object(K.jsx)(J.a,{align:"right",children:t.PARTNAME}),Object(K.jsxs)(J.a,{align:"right",children:[t.BASEPLCODE," ",Ze(t.BASEPLPRICE)]}),Object(K.jsxs)(J.a,{align:"right",children:[t.BASEPLCODE," ",Ze(t.VATPRICE)]}),Object(K.jsxs)(J.a,{align:"right",children:[Object(K.jsx)(S.a,{onClick:function(n){return e.onDecrement(t,n)},children:Object(K.jsx)(He.a,{})}),t.QUANTITY,Object(K.jsx)(S.a,{onClick:function(n){return e.onIncrement(t,n)},children:Object(K.jsx)(Ge.a,{})})]}),Object(K.jsxs)(J.a,{align:"right",children:[t.BASEPLCODE," ",Ze(t.VATPRICE*t.QUANTITY)]})]},n)})),Object(K.jsxs)(ne.a,{children:[Object(K.jsx)(J.a,{colSpan:6,align:"right",children:Object(K.jsx)("b",{children:"Total Price"})}),Object(K.jsx)(J.a,{align:"right",children:function(){for(var e=0,t=0;t0){var n=p.findIndex((function(e){return e.PARTNAME===u.PARTNAME}));console.log(u.PARTNAME),n>-1?(t[n].QUANTITY=parseInt(u.QUANTITY)+parseInt(O),S(t)):(u.QUANTITY=O,S((function(e){return[].concat(Object(je.a)(e),[u])})))}else console.log("Quantity must be greater than 0.")},children:"Add"})}),Object(K.jsx)(E.a,{item:!0,md:12,children:Object(K.jsx)(tt,{items:p,onDecrement:function(e){var t=Object(je.a)(p),n=p.findIndex((function(t){return t.PARTNAME===e.PARTNAME}));1===t[n].QUANTITY?t.splice(n,1):t[n].QUANTITY-=1,S(t)},onIncrement:function(e){var t=Object(je.a)(p),n=p.findIndex((function(t){return t.PARTNAME===e.PARTNAME}));t[n].QUANTITY=parseInt(t[n].QUANTITY)+1,S(t)}})}),Object(K.jsx)(E.a,{item:!0,md:12,children:Object(K.jsx)(Me.a,{disabled:0===p.length,onClick:function(){console.log(p);for(var e=Object(je.a)(p),t=[],n=0;n0?r.map((function(e,t){return Object(K.jsxs)(ct.a,{onClick:function(){return 0===e.READ?function(e,t){re.setNotificationRead({ID:e}).then((function(e){var n=Object(je.a)(r);n[t].READ=1,s(n),console.log(r)})).catch((function(e){console.log(e)}))}(e.ID,t):null},selected:0===e.READ,children:[Object(K.jsx)(D.a,{children:Object(K.jsx)(ft.a,{fontSize:"small"})}),Object(K.jsxs)(w.a,{children:[e.ORDNAME," has been changed to ",e.ORDSTATUSDES," ",x.format(new Date(e.DATE))]})]},t)})):Object(K.jsx)(g.a,{children:"No notifications."})})]}):Object(K.jsx)(ue.a,{})}var vt=n(28),Et=n.n(vt),Tt=n(42),Ct=n(647),At=n(648),kt=n(125),yt=n(99),Dt=n.n(yt),wt=n(181),Pt=n.n(wt),Nt=n(43),It=(n(223),n(295),n(128)),Rt=n(503);function Lt(){var e=c.a.useState(!0),t=Object(i.a)(e,2),n=t[0];t[1];return Object(K.jsx)("div",{children:Object(K.jsx)(Rt.a,{sx:{color:"#fff",zIndex:function(e){return e.zIndex.drawer+1}},open:n,children:Object(K.jsx)(ue.a,{color:"inherit"})})})}var Ut=function(e){return{sx:{bgcolor:Mt(e),fontSize:16,width:30,height:30},children:Ft(e)}},Ft=function(e){var t=e.charAt(0),n=e.charAt(e.length-1);return t.toUpperCase()+n.toUpperCase()},Mt=function(e){var t,n=0;for(t=0;t>8*t&255).toString(16)).slice(-2)}return a},Wt=function(e){return new Date(e).toLocaleDateString("en-GB",{month:"short",day:"numeric"})},Bt=function(e){return new Promise((function(t,n){return function(e,t){var n=new FileReader;n.readAsDataURL(e),n.onload=function(){return t(n.result)},n.onerror=function(e){}}(e,(function(e){return t({data:{link:e}})}))}))},_t=function(e,t,n){var a=document.createElement("a");a.href=e,a.download=t+"."+n,a.click()},Gt=n(311),zt=n.n(Gt),Yt=function(e){return Object(K.jsx)(E.a,{item:!0,md:3,children:Object(K.jsx)(Ct.a,{children:Object(K.jsx)(At.a,{children:Object(K.jsxs)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:[Object(K.jsxs)("b",{children:[e.subject,":"]})," ",e.info]})})})})},Xt=function(){var e,t=Object(fe.b)(),n=t.enqueueSnackbar,r=(t.closeSnackbar,Object(a.useState)(!1)),s=Object(i.a)(r,2),o=s[0],l=s[1],u=Object(Ue.h)().docno,d=Object(a.useState)(null),j=Object(i.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(null),m=Object(i.a)(h,2),x=m[0],f=m[1],p=Object(a.useState)(!0),T=Object(i.a)(p,2),C=T[0],A=T[1],k=Object(a.useState)(0),y=Object(i.a)(k,2),D=(y[0],y[1],Object(a.useState)(_.getCurrentUser().name)),w=Object(i.a)(D,2),P=w[0],N=(w[1],Object(a.useState)([])),I=Object(i.a)(N,2),R=I[0],L=I[1],U=Object(It.a)({accept:"*",readAs:"DataURL"}),F=Object(i.a)(U,2),M=F[0],W=F[1],B=(W.plainFiles,W.filesContent),G=W.clear,z=Object(a.useState)([]),Y=Object(i.a)(z,2),X=Y[0],q=Y[1],V=Object(a.useState)(!0),Q=Object(i.a)(V,2),H=(Q[0],Q[1],Object(a.useState)(!1)),Z=Object(i.a)(H,2),J=Z[0],$=Z[1],ee=function(e){console.info(B[0]),G(),L([])},te=(Nt.EditorState.createEmpty(),c.a.useState()),ne=Object(i.a)(te,2),ae=ne[0],ce=ne[1],se=function(){var e=Object(Tt.a)(Et.a.mark((function e(){var t,n,a,c;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re.getServiceCall(u);case 2:if(1!==(t=e.sent.data).value.length){e.next=21;break}return e.next=6,re.getStatusLang2(t.value[0].CALLSTATUSCODE);case 6:return n=e.sent.data,e.next=9,re.getSCAttachments(u);case 9:return a=e.sent.data.value,t.ESTATDES=n.value[0].ESTATDES,t.CHANGEFLAG=n.value[0].CHANGEFLAG,O(t),e.next=15,re.getServiceCallExternalRemarks(u);case 15:c=e.sent.data,f(c),q(a),A(!1),e.next=22;break;case 21:$(!0);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(a.useEffect)(Object(Tt.a)(Et.a.mark((function e(){return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:se();case 1:case"end":return e.stop()}}),e)}))),[C]),Object(a.useEffect)((function(){if(B){var e=B;L((function(t){return t.concat(e)}))}}),[B]);return Object(K.jsx)(K.Fragment,{children:C&&!1===J?Object(K.jsx)(Lt,{}):J?Object(K.jsx)("div",{children:Object(K.jsx)("p",{children:Object(K.jsx)(Be.a,{severity:"error",children:Object(K.jsx)("b",{children:"Sorry!..Invalid Service Call Number"})})})}):Object(K.jsxs)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:[Object(K.jsxs)(E.a,{container:!0,spacing:1,direction:"row",alignItems:"center",children:[Object(K.jsx)(Yt,{subject:"Ticket Number",info:b.value[0].DOCNO}),Object(K.jsx)(Yt,{subject:"Subject",info:b.value[0].ZEMG_SVC_DETAILS}),Object(K.jsx)(Yt,{subject:"Customer",info:b.value[0].CDES}),Object(K.jsx)(Yt,{subject:"Contact",info:b.value[0].NAME}),Object(K.jsx)(Yt,{subject:"Type of Call ",info:b.value[0].CALLTYPECODE}),Object(K.jsx)(Yt,{subject:"Cust. Reference",info:b.value[0].REFERENCE}),Object(K.jsx)(Yt,{subject:"Status",info:null!==(e=b.value[0].ESTATDES)&&void 0!==e?e:b.value[0].CALLSTATUSCODE})]}),"Y"===b.CHANGEFLAG?Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(Ct.a,{sx:{mt:2,mb:2},children:Object(K.jsxs)(At.a,{children:[Object(K.jsxs)("div",{sx:{display:"flex",flexDirection:"row"},children:[Object(K.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(K.jsx)("b",{children:"Add a Comment"})}),Object(K.jsx)(S.a,{children:Object(K.jsx)(zt.a,{})})]}),Object(K.jsx)(kt.Editor,{wrapperClassName:"wrapperClassName",editorState:ae,editorStyle:{overflow:"hidden",minHeight:"20vh"},onEditorStateChange:function(e){ce(e)},toolbar:{image:{uploadCallback:Bt,previewImage:!0}}})]})}),Object(K.jsx)(Me.a,{onClick:function(){return M()},variant:"outlined",startIcon:Object(K.jsx)(Pt.a,{}),children:"Add File"}),Object(K.jsx)(Me.a,{variant:"contained",sx:{marginLeft:"77.5%"},onClick:function(){if(1===Object(Nt.convertToRaw)(ae.getCurrentContent()).blocks.length&""===Object(Nt.convertToRaw)(ae.getCurrentContent()).blocks[0].text)n("You can not submit an empty comment.",{variant:"error"});else{l(!0);var e=Nt.EditorState.createEmpty();ce(e);var t,a=(new Date).toLocaleString("en-GB"),c=[];for(var r in B){var s={EXTFILEDES:B[r].name.split(".")[0],EXTFILENAME:B[r].content};"msg"===B[r].name.split(".")[1]&&(s.SUFFIX=".msg"),"lic"===B[r].name.split(".")[1]&&(s.SUFFIX=".lic"),c.push(s)}t=0!==c.length?a+Dt()(Object(Nt.convertToRaw)(ae.getCurrentContent()))+"
"+c.length+" files attached.
"+"

".concat(P,"


"):a+Dt()(Object(Nt.convertToRaw)(ae.getCurrentContent()))+"

".concat(P,"


");b.CALLSTATUSCODE;var i={DOCNO:u,TEXT:t,APPEND:!0,SIGNATURE:!1,EXTFILES:c};re.updateServiceCall(i).then((function(e){n("Service call updated succesfully.",{variant:"success"}),l(!1),ee(),A(!0)})).catch((function(e){n("Error updating service call.",{variant:"error"}),l(!1),ee(),A(!0)}))}},children:"Update Ticket"})]}):null,0!=(null===R||void 0===R?void 0:R.length)?Object(K.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(K.jsx)(qe.a,{onClick:ee})}):Object(K.jsx)(K.Fragment,{}),null===R||void 0===R?void 0:R.map((function(e,t){return Object(K.jsx)(ge.a,{label:e.name})})),1==C||1==o?Object(K.jsx)(Lt,{}):null,Object(K.jsx)(Ct.a,{sx:{mt:2},children:Object(K.jsxs)(At.a,{children:[Object(K.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(K.jsx)("b",{children:"Description"})}),Object(K.jsx)("div",{style:{overflow:"auto"},dangerouslySetInnerHTML:{__html:x.TEXT.replaceAll("../../system/mail/","https://priority.medatecherp.co.uk/primail/")}})]})}),Object(K.jsx)(Ct.a,{sx:{mt:2},children:Object(K.jsxs)(At.a,{children:[Object(K.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(K.jsx)("b",{children:"Attachments"})}),null===X||void 0===X?void 0:X.map((function(e,t){return Object(K.jsx)(ge.a,{label:e.EXTFILEDES+"."+e.SUFFIX,color:"primary",size:"small",sx:{mr:1,mb:1},onClick:function(){return _t(e.EXTFILENAME,e.EXTFILEDES,e.SUFFIX)}},t)}))]})})]})})},qt=(n(483),n(484),n(485),n(486),n(14)),Vt=n(323),Kt=n(83),Qt=n(97),Ht=n(312),Zt=(n(487),n(649)),Jt=n(608),$t=function(){var e=Object(a.useState)(null),t=Object(i.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)(null),s=Object(i.a)(r,2),o=s[0],u=s[1],d=Object(a.useState)(!0),j=Object(i.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)({global:{value:null,matchMode:qt.a.CONTAINS},DOCNO:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.STARTS_WITH}]},ZEMG_SVC_DETAILS:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.STARTS_WITH}]},REFERENCE:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.STARTS_WITH}]},NAME:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.STARTS_WITH}]},STARTDATE:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.DATE_IS}]},CALLTYPECODE:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.EQUALS}]},CDES:{operator:qt.b.OR,constraints:[{value:null,matchMode:qt.a.EQUALS}]},CALLSTATUSCODE:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.EQUALS}]},STATUSDATE:{operator:qt.b.AND,constraints:[{value:null,matchMode:qt.a.DATE_IS}]}}),m=Object(i.a)(h,2),x=m[0],f=m[1],g=Object(a.useState)(""),p=Object(i.a)(g,2),S=p[0],v=p[1],E=Object(a.useState)(!0),T=Object(i.a)(E,2),C=T[0],A=T[1];Object(a.useEffect)((function(){console.log("Use effect"),re.getServiceCalls().then((function(e){u(k(e.data.value)),re.getCallStatuses().then((function(e){c(e.data.value),A(!1)})).catch((function(e){console.log(e)}))})).catch((function(e){console.log(e)}))}),[]);var k=function(e){return Object(je.a)(e||[]).map((function(e){return e.STARTDATE=new Date(e.STARTDATE),e.STATUSDATE=new Date(e.STATUSDATE),e}))},y=function(e){return e.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric"})},D=function(e){var t=e.target.value,n=Object(l.a)({},x);n.global.value=t,f(n),v(t)},w=function(e){return Object(K.jsx)(Ht.a,{value:e.value,onChange:function(t){return e.filterCallback(t.value,e.index)},dateFormat:"dd/mm/yy",placeholder:"dd/mm/yyyy",mask:"99/99/9999"})},P=function(e){O(e.target.checked)},N=Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)("h5",{className:"m-0",children:"Service Calls"}),Object(K.jsx)(Zt.a,{control:Object(K.jsx)(Jt.a,{onChange:P,checked:b,name:"gilad"}),label:"Show Only Active Tickets"})," ",Object(K.jsxs)("span",{className:"p-input-icon-left",children:[Object(K.jsx)("i",{className:"pi pi-search"}),Object(K.jsx)(Qt.a,{value:S,onChange:D,placeholder:"Keyword Search"})]})]});return C?Object(K.jsx)(he,{}):Object(K.jsx)("div",{className:"datatable-doc-demo",children:Object(K.jsx)("div",{className:"card",children:Object(K.jsxs)(Vt.a,{value:function(e,t){return(b?e.filter((function(e){return"Y"===e.ACTIVEFLAG})):e).map((function(e){var n=t.find((function(t){return t.CODE===e.CALLSTATUSCODE}));return n&&n.ESTATDES?Object(l.a)(Object(l.a)({},e),{},{CALLSTATUSCODE:n.ESTATDES}):e}))}(o,n),paginator:!0,className:"p-datatable-customers",header:N,rows:10,breakpoint:"960px",paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",rowsPerPageOptions:[10,25,50],dataKey:"id",rowHover:!0,filters:x,filterDisplay:"menu",loading:C,responsiveLayout:"stack",globalFilterFields:["DOCNO","ZEMG_SVC_DETAILS","REFERENCE","NAME","STARTDATE","ZEMG_SEVDES","CALLTYPECODE","CALLSTATUSCODE","STATUSDATE"],emptyMessage:"No service calls found.",currentPageReportTemplate:"Showing {first} to {last} of {totalRecords} entries",children:[Object(K.jsx)(Kt.a,{field:"DOCNO",header:"Ticket ID",filterField:"DOCNO",sortable:!0,body:function(e){return Object(K.jsx)(L.b,{style:{textDecoration:"none",color:"blue"},to:"/dashboard/servicecall/".concat(e.DOCNO),sx:{mt:3},children:e.DOCNO})},filter:!0,filterPlaceholder:"Search by Ticket ID"}),Object(K.jsx)(Kt.a,{field:"ZEMG_SVC_DETAILS",header:"Subject",sortable:!0,filter:!0,filterPlaceholder:"Search by Subject"}),Object(K.jsx)(Kt.a,{field:"REFERENCE",header:"Cust. Ref",sortable:!0,filter:!0,filterPlaceholder:"Search by Reference"}),Object(K.jsx)(Kt.a,{field:"NAME",header:"Contact",sortable:!0,filter:!0,filterPlaceholder:"Search by Contact"}),Object(K.jsx)(Kt.a,{field:"STARTDATE",header:"Open Date",sortable:!0,filterField:"STARTDATE",dataType:"date",body:function(e){return y(e.STARTDATE)},filter:!0,filterPlaceholder:"Search by Open Date",filterElement:w}),Object(K.jsx)(Kt.a,{field:"CALLTYPECODE",header:"Classification",sortable:!0,filter:!0,filterPlaceholder:"Search by Classification"}),Object(K.jsx)(Kt.a,{field:"ZEMG_SEVDES",header:"Call Severity",sortable:!0,filter:!0,filterPlaceholder:"Search by Call Severity"}),Object(K.jsx)(Kt.a,{field:"CALLSTATUSCODE",header:"Status",sortable:!0,filter:!0,filterPlaceholder:"Search by Status"}),Object(K.jsx)(Kt.a,{field:"STATUSDATE",header:"Update Date",sortable:!0,filterField:"STATUSDATE",dataType:"date",body:function(e){return y(e.STATUSDATE)},filter:!0,filterPlaceholder:"Search by Update Date",filterElement:w})]})})})},en=function(){return Object(K.jsx)(v.a,{maxWidth:!1,sx:{mt:4,mb:4},children:Object(K.jsx)($t,{})})};function tn(e){var t=e.items,n=e.onChange,c=e.labelname,r=e.title,s=e.description,o=e.required,u=e.disabled,d=a.useState(!1),j=Object(i.a)(d,2),b=j[0],O=j[1],h=b&&0===t.length;return Object(K.jsx)(Fe.a,{sx:{m:1},disabled:u,fullWidth:!0,open:b,onOpen:function(){O(!0)},onClose:function(){O(!1)},onChange:n,isOptionEqualToValue:function(e,t){return""===c?e===t:e[c]===t[c]},getOptionLabel:function(e){return""===c?e+(s?": "+e[s]:""):e[c]+(s?": "+e[s]:"")},options:t,loading:h,renderInput:function(e){return Object(K.jsx)(pe.a,Object(l.a)(Object(l.a)({required:o},e),{},{label:r,InputProps:Object(l.a)(Object(l.a)({},e.InputProps),{},{endAdornment:Object(K.jsxs)(a.Fragment,{children:[h?Object(K.jsx)(ue.a,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})})}))}})}var nn=function(e){var t=Object(a.useState)(!0),n=Object(i.a)(t,2),c=n[0],r=n[1],s=Object(a.useState)(""),o=Object(i.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)([]),j=Object(i.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)([]),m=Object(i.a)(h,2),x=m[0],f=m[1],p=Object(a.useState)([]),T=Object(i.a)(p,2),C=T[0],A=T[1],k=Object(a.useState)(),y=Object(i.a)(k,2),D=y[0],w=y[1],P=Object(fe.b)(),N=P.enqueueSnackbar,I=(P.closeSnackbar,Nt.EditorState.createEmpty()),R=Object(a.useState)(""),L=Object(i.a)(R,2),U=L[0],F=L[1],M=Object(a.useState)(I),W=Object(i.a)(M,2),B=W[0],G=W[1],z=Object(a.useState)(_.getCurrentUser().name),Y=Object(i.a)(z,2),X=Y[0],q=(Y[1],Object(It.a)({accept:"*",readAs:"DataURL"})),V=Object(i.a)(q,2),Q=V[0],H=V[1],Z=H.plainFiles,J=H.filesContent,$=H.clear,ee=Object(a.useState)(!1),te=Object(i.a)(ee,2),ne=te[0],ae=te[1],ce=Object(a.useState)(""),se=Object(i.a)(ce,2),ie=se[0],oe=se[1];Object(a.useEffect)((function(){var e=function(){var e=Object(Tt.a)(Et.a.mark((function e(){var t,n;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re.getCallSeverities();case 2:t=e.sent,n=t.data.value.filter((function(e){return"Undefined"!==e.SEVDES})),O(n);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),t=function(){var e=Object(Tt.a)(Et.a.mark((function e(){var t;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,re.getCustomerContacts();case 2:t=e.sent,f(t.data.value);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t().catch(console.error),e().catch(console.error),r(!1)}),[c]);return Object(K.jsxs)(v.a,{maxWidth:"lg",sx:{mt:4,mb:4},children:[""!=ie?Object(K.jsx)(Ue.a,{to:"/dashboard/servicecall/".concat(ie)}):null,1==c||1==ne?Object(K.jsx)(Lt,{}):null,Object(K.jsxs)(E.a,{container:!0,spacing:2,children:[Object(K.jsx)(E.a,{item:!0,md:8,children:Object(K.jsx)(pe.a,{sx:{m:1},fullWidth:!0,required:!0,onChange:function(e){return F(e.target.value)},label:"Subject",inputProps:{maxLength:48}})}),Object(K.jsx)(E.a,{item:!0,md:4,children:Object(K.jsx)(pe.a,{sx:{m:1},fullWidth:!0,onChange:function(e){return u(e.target.value)},label:"Customer's Reference",inputProps:{maxLength:12}})}),Object(K.jsx)(E.a,{item:!0,md:4,children:Object(K.jsx)(tn,{required:!0,title:"Call Severity",labelname:"SEVDES",items:b,onChange:function(e,t){return w(t)}})}),Object(K.jsx)(E.a,{item:!0,md:4,children:Object(K.jsx)(tn,{required:!0,title:"Contact",labelname:"NAME",items:x,onChange:function(e,t){return A(t)}})}),Object(K.jsxs)(E.a,{item:!0,md:12,children:[Object(K.jsx)(Ct.a,{sx:{mt:2},children:Object(K.jsxs)(At.a,{children:[Object(K.jsx)(g.a,{sx:{fontSize:14},gutterBottom:!0,children:Object(K.jsx)("b",{children:"Details"})}),Object(K.jsx)(kt.Editor,{wrapperClassName:"wrapperClassName",editorStyle:{overflow:"hidden",minHeight:"40vh"},editorState:B,onEditorStateChange:function(e){G(e)},toolbar:{image:{uploadCallback:Bt,previewImage:!0}}})]})}),Object(K.jsx)("p",{}),Object(K.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(K.jsx)(Me.a,{onClick:function(){return Q()},variant:"outlined",startIcon:Object(K.jsx)(Pt.a,{}),children:"Add File"}),Object(K.jsx)(Me.a,{variant:"contained",onClick:function(){if(1===Object(Nt.convertToRaw)(B.getCurrentContent()).blocks.length&""===Object(Nt.convertToRaw)(B.getCurrentContent()).blocks[0].text)N("You can not submit an empty comment.",{variant:"error"});else if(/^ *$/.test(U))N("Please fill out the Subject field.",{variant:"error"});else if(void 0!=(null===D||void 0===D?void 0:D.SEV))if(void 0!=(null===C||void 0===C?void 0:C.NAME)){ae(!0);var e,t=(new Date).toLocaleString("en-GB"),n=[];for(var a in J){var c={EXTFILEDES:J[a].name.split(".")[0],EXTFILENAME:J[a].content};"msg"===J[a].name.split(".")[1]&&(c.SUFFIX=".msg"),"lic"===J[a].name.split(".")[1]&&(c.SUFFIX=".lic"),n.push(c)}e=0!==n.length?t+Dt()(Object(Nt.convertToRaw)(B.getCurrentContent()))+"
"+n.length+" files attached.
"+"

".concat(X,"


"):t+Dt()(Object(Nt.convertToRaw)(B.getCurrentContent()))+"

".concat(X,"


");var s={DETAILS:U,CALLTYPECODE:"From Portal",ZEMG_SEVNAME:null===D||void 0===D?void 0:D.SEVNAME,TEXT:e,APPEND:!0,SIGNATURE:!1,REFERENCE:l,NAME:null===C||void 0===C?void 0:C.NAME,EXTFILES:n};re.CreateServiceCall(s).then((function(e){void 0!=e.data.DOCNO?(N("Service Call ".concat(e.data.DOCNO," successfully created!"),{variant:"success"}),$(),r(!0),oe(e.data.DOCNO)):(N("Error creating service call.",{variant:"error"}),ae(!1))})).catch((function(e){e.response.data.message?N(e.response.data.message,{variant:"error"}):N("Error creating service call.",{variant:"error"}),ae(!1)}))}else N("Please select a Contact.",{variant:"error"});else N("Please select a Call Severity.",{variant:"error"})},children:"Submit"})]}),0!=Z.length?Object(K.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(K.jsx)(qe.a,{onClick:function(e){$()}})}):Object(K.jsx)(K.Fragment,{}),Z.map((function(e,t){return Object(K.jsx)(ge.a,{label:e.name})}))]})]})]})},an=n(600),cn=n(650),rn=n(499),sn=n(233),on=n(505),ln=n(504),un=n(185),dn=n.n(un),jn=n(313),bn=n.n(jn),On=n(191),hn=n(598),mn=n(183);function xn(e){var t=e.open,n=e.description,c=e.loading,r=e.attachments,s=e.handleClose,o=(e.refreshTasks,e.handleTaskStatusChange),u=e.task,d=u.SUBJECT,j=u.STATDES,b=u.USERLOGIN,O=(u.CUSTNOTETYPEDES,u.CUSTNOTE),h=(u.EXTFILEFLAG,u.CURDATE),m=u.TILLDATE,x=u.STIME,f=u.ETIME,p=u.WBS,v=u.ACTDES,E=[b,u.USERLOGIN2,u.USERLOGIN3,u.USERLOGIN4,u.USERLOGIN5,u.USERLOGIN6,u.USERLOGIN7,u.USERLOGIN8],T=Object(On.a)("div")({marginBottom:16}),C=Object(a.useState)(!1),A=Object(i.a)(C,2),k=A[0],y=A[1],D=Object(fe.b)(),w=(D.enqueueSnackbar,D.closeSnackbar,Object(mn.b)());return Object(K.jsx)("div",{children:Object(K.jsxs)(rn.a,{open:t,onClose:s,scroll:"paper","aria-labelledby":"scroll-dialog-title","aria-describedby":"scroll-dialog-description",children:[Object(K.jsx)("div",{children:Object(K.jsxs)(ln.a,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",fontWeight:"bold"},id:"scroll-dialog-title",children:[null!==d&&void 0!==d?d:"Task Subject",Object(K.jsx)(Ye.a,{placement:"right",title:"Cancel task.",children:Object(K.jsx)(S.a,{disabled:k,onClick:function(){w({description:"This will cancel the task."}).then((function(){y(!0),o(j,"Cancelled",O),s()})).catch((function(){console.log("Confirmation declined.")}))},color:"error","aria-label":"cancel-task",component:"label",children:Object(K.jsx)(hn.a,{})})})]})}),c?Object(K.jsx)(be.a,{}):null,Object(K.jsxs)(sn.a,{dividers:!c,sx:{minHeight:"50vh",minWidth:"30vw"},children:[Object(K.jsxs)(T,{children:[Object(K.jsx)(g.a,{variant:"subtitle2",children:"Members"}),Object(K.jsx)("div",{style:{display:"flex",flexDirection:"row"},children:null===E||void 0===E?void 0:E.filter((function(e){return e})).map((function(e,t){return Object(K.jsx)(Ye.a,{style:{marginRight:8},title:e,children:Object(K.jsx)(rt.a,Object(l.a)({},Ut(e)))},t)}))})]}),p?Object(K.jsxs)(T,{children:[Object(K.jsx)(g.a,{variant:"subtitle2",children:"WBS"}),Object(K.jsx)(g.a,{children:p+": "+v})]}):null,Object(K.jsxs)(T,{children:[Object(K.jsx)(g.a,{variant:"subtitle2",children:"Dates"}),Object(K.jsx)(Ye.a,{placement:"left",title:"Start and end date.",children:Object(K.jsx)(ge.a,{icon:Object(K.jsx)(bn.a,{}),size:"small",label:Wt(h)+" - "+Wt(m)})}),Object(K.jsx)(Ye.a,{sx:{ml:1},placement:"right",title:"Start and end time.",children:Object(K.jsx)(ge.a,{icon:Object(K.jsx)(dn.a,{}),size:"small",label:x+" - "+f})})]}),Object(K.jsxs)(T,{children:[Object(K.jsx)(g.a,{variant:"subtitle2",children:"Description"}),Object(K.jsx)(on.a,{id:"scroll-dialog-description",tabIndex:-1,children:c?Object(K.jsx)(Oe.a,{}):Object(K.jsx)("div",{dangerouslySetInnerHTML:{__html:n}})})]})]}),r.length>0?Object(K.jsxs)(sn.a,{dividers:!0,children:[Object(K.jsx)(g.a,{children:"Attachments"}),null===r||void 0===r?void 0:r.map((function(e,t){return Object(K.jsx)(ge.a,{label:e.EXTFILEDES+"."+e.SUFFIX,color:"primary",size:"small",sx:{mr:1,mb:1},onClick:function(){return _t(e.EXTFILENAME,e.EXTFILEDES,e.SUFFIX)}},t)}))]}):null]})})}var fn=n(314),gn=n.n(fn),pn=function(e){var t,n=e.task,c=n.SUBJECT,r=n.USERLOGIN,s=n.CUSTNOTETYPEDES,o=n.CUSTNOTE,u=n.EXTFILEFLAG,d=n.CURDATE,j=n.TILLDATE,b=n.ACTDES,O=(n.STIME,n.ETIME,n.WBS),h=n.USERLOGIN2,m=n.USERLOGIN3,x=n.USERLOGIN4,f=n.USERLOGIN5,p=n.USERLOGIN6,S=n.USERLOGIN7,v=n.USERLOGIN8,E=n.ZMED_TASKSIZENAME,T=e.refreshTasks,C=e.handleTaskStatusChange,A=[r,h,m,x,f,p,S,v],k=Object(a.useState)(!1),y=Object(i.a)(k,2),D=y[0],w=y[1],P=Object(a.useState)("There is no description."),N=Object(i.a)(P,2),I=N[0],R=N[1],L=Object(a.useState)([]),U=Object(i.a)(L,2),F=U[0],M=U[1],W=Object(a.useState)(!1),B=Object(i.a)(W,2),_=B[0],G=B[1],z=function(){G(!0),re.getTaskExplanation(o).then((function(e){e.data.hasOwnProperty("error")?(console.log(e.data),R("There is no description."),G(!1)):(R(e.data.TEXT),console.log(e.data),G(!1))})).catch((function(e){console.log(e),G(!1)}))},Y=function(){re.getTaskAttachments(o).then((function(e){e.data.hasOwnProperty("error")?console.log(e.data):(console.log(e.data),M(e.data.value))})).catch((function(e){console.log(e)}))};return Object(K.jsxs)(Ct.a,{onClick:function(){D||(z(),"Y"===u&&Y(),w(!0))},sx:{mb:2},children:[Object(K.jsx)(xn,{open:D,description:I,handleClose:function(){w(!1)},task:e.task,loading:_,attachments:F,refreshTasks:T,handleTaskStatusChange:C}),Object(K.jsxs)(At.a,{sx:{display:"flex",flexDirection:"column"},children:[Object(K.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Object(K.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[s?Object(K.jsx)(Ye.a,{enterDelay:500,placement:"top",title:"Task type.",children:Object(K.jsx)(ge.a,{label:s,color:"primary",size:"small",sx:{bgcolor:Mt(s),mr:1}})}):null,E?Object(K.jsx)(Ye.a,{enterDelay:500,placement:"top",title:"Task size.",children:Object(K.jsx)(ge.a,{label:E,color:"primary",size:"small",sx:{bgcolor:(t=E,"S"===t?"#00FF00":"M"===t?"#FFA500":"L"===t?"#FF0000":"XL"===t?"#8b0000":void 0)}})}):null]}),u?Object(K.jsx)(Ye.a,{enterDelay:500,placement:"top",title:"Includes attachments.",children:Object(K.jsx)(gn.a,{color:"disabled"})}):null]}),Object(K.jsx)(g.a,{sx:{fontWeight:"bold",mt:1},component:"div",children:null!==c&&void 0!==c?c:"Task Subject"}),Object(K.jsx)(g.a,{sx:{mb:1},variant:"subtitle2",children:null!=O?O+": "+b:null}),Object(K.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Object(K.jsx)(Ye.a,{enterDelay:500,title:"Start and end date.",children:Object(K.jsx)(ge.a,{icon:Object(K.jsx)(dn.a,{}),size:"small",label:Wt(d)+" - "+Wt(j)})}),Object(K.jsx)(cn.a,{sx:{"& .MuiAvatar-root":{width:30,height:30,fontSize:16}},max:2,children:null===A||void 0===A?void 0:A.filter((function(e){return e})).map((function(e,t){return Object(K.jsx)(Ye.a,{title:e,children:Object(K.jsx)(rt.a,Object(l.a)({},Ut(e)))},t)}))})]})]})]})},Sn=n(126),vn=n(506),En=n(603),Tn=n(324),Cn=n(227),An=n(73),kn=n.n(An),yn=n(599);function Dn(e){var t=e.disabled,n=e.taskTypes,c=e.taskSizes,r=e.users,s=e.projectWBS,o=e.project,u=e.handleUpdateTasks,d=e.STATDES,j=Object(a.useState)(!1),b=Object(i.a)(j,2),O=b[0],h=b[1],m=Object(a.useState)(!1),x=Object(i.a)(m,2),f=x[0],p=x[1],E=Object(a.useState)(),T=Object(i.a)(E,2),C=T[0],A=T[1],k=Object(a.useState)(),y=Object(i.a)(k,2),D=y[0],w=y[1],P=Object(a.useState)(),N=Object(i.a)(P,2),I=N[0],R=N[1],L=Object(a.useState)(),U=Object(i.a)(L,2),F=U[0],M=U[1],W=Object(a.useState)(),B=Object(i.a)(W,2),_=B[0],G=B[1],z=Object(a.useState)(kn()()),Y=Object(i.a)(z,2),X=Y[0],q=Y[1],V=Object(a.useState)(kn()()),Q=Object(i.a)(V,2),H=Q[0],Z=Q[1],J=Object(fe.b)(),$=J.enqueueSnackbar,ee=(J.closeSnackbar,Nt.EditorState.createEmpty()),te=Object(a.useState)(ee),ne=Object(i.a)(te,2),ce=ne[0],se=ne[1],ie=Object(It.a)({accept:"*",readAs:"DataURL"}),oe=Object(i.a)(ie,2),le=oe[0],ue=oe[1],de=ue.plainFiles,je=ue.filesContent,be=ue.clear,Oe=function(){h(!1)},he=function(){M(),A(),w(),R(),Oe(),p(!1)};return Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(Me.a,{disabled:t,size:"small",variant:"contained",startIcon:Object(K.jsx)(Ge.a,{}),color:"inherit",onClick:function(){h(!0)},children:"Add a Task"}),Object(K.jsx)("div",{children:Object(K.jsxs)(rn.a,{open:O,onClose:Oe,children:[Object(K.jsx)(ln.a,{children:"Add a Task"}),Object(K.jsxs)(sn.a,{children:[Object(K.jsx)(pe.a,{autoFocus:!0,margin:"dense",id:"subject",label:"Subject",type:"subject",fullWidth:!0,variant:"standard",autoComplete:"off",value:C,onChange:function(e){return A(e.target.value)},sx:{mb:2}}),Object(K.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(K.jsx)(tn,{required:!0,title:"Assigned To",labelname:"USERLOGIN",items:r,onChange:function(e,t){return M(t)}}),Object(K.jsx)(tn,{title:"WBS",labelname:"WBS",items:s,onChange:function(e,t){return G(t)},description:"ACTDES"})]}),Object(K.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(K.jsx)(tn,{title:"Task Type",labelname:"CUSTNOTETYPEDES",items:n,onChange:function(e,t){return w(t)}}),Object(K.jsx)(tn,{title:"Task Size",labelname:"SIZENAME",items:c,onChange:function(e,t){return R(t)},description:"SIZEDES"})]}),Object(K.jsx)(Tn.a,{dateAdapter:Cn.a,children:Object(K.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},disableGutters:!0,children:[Object(K.jsx)(En.a,{disablePast:!0,ampm:!1,label:"Start Date & Time",value:X,onChange:function(e){return q(e)},renderInput:function(e){return Object(K.jsx)(pe.a,Object(l.a)({fullWidth:!0,sx:{m:1}},e))}}),Object(K.jsx)(En.a,{disablePast:!0,ampm:!1,label:"End Date & Time",value:H,onChange:function(e){return Z(e)},renderInput:function(e){return Object(K.jsx)(pe.a,Object(l.a)({fullWidth:!0,sx:{m:1}},e))}})]})}),Object(K.jsxs)(v.a,{maxWidth:!1,sx:{mt:1},children:[Object(K.jsx)(g.a,{variant:"subtitle",children:"Explanation of Task"}),Object(K.jsx)(ae.a,{children:Object(K.jsx)(kt.Editor,{editorStyle:{height:"150px"},editorState:ce,onEditorStateChange:function(e){se(e)},toolbar:{image:{uploadCallback:Bt,previewImage:!0}}})})]}),Object(K.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex",flexWrap:"wrap",gap:"3px",mt:1},children:[0!=de.length?Object(K.jsx)(S.a,{color:"error","aria-label":"delete",component:"label",children:Object(K.jsx)(hn.a,{onClick:function(e){be()}})}):Object(K.jsx)(K.Fragment,{}),de.map((function(e,t){return Object(K.jsx)(ge.a,{label:e.name})}))]})]}),Object(K.jsxs)(vn.a,{children:[Object(K.jsx)(Me.a,{onClick:function(){return le()},variant:"outlined",startIcon:Object(K.jsx)(yn.a,{}),children:"Add File"}),Object(K.jsx)(Me.a,{onClick:Oe,children:"Cancel"}),Object(K.jsx)(Me.a,{disabled:f,onClick:function(){var e,t,n;if(1===Object(Nt.convertToRaw)(ce.getCurrentContent()).blocks.length&""===Object(Nt.convertToRaw)(ce.getCurrentContent()).blocks[0].text)$("The task must have an explanation.",{variant:"error"});else if(C)if(void 0!==F){p(!0);var a=[];for(var c in je){var r={EXTFILEDES:je[c].name.split(".")[0],EXTFILENAME:je[c].content};a.push(r)}console.log(a);var s={SUBJECT:C,CUSTNOTETYPEDES:null!==(e=null===D||void 0===D?void 0:D.CUSTNOTETYPEDES)&&void 0!==e?e:"",ZMED_TASKSIZENAME:null!==(t=null===I||void 0===I?void 0:I.SIZENAME)&&void 0!==t?t:"",USERLOGIN:null===F||void 0===F?void 0:F.USERLOGIN,CURDATE:X.format("YYYY-MM-DD"),TILLDATE:H.format("YYYY-MM-DD"),STIME:X.format("HH:mm"),ETIME:H.format("HH:mm"),PROJDOCNO:o.DOCNO,WBS:null!==(n=null===_||void 0===_?void 0:_.WBS)&&void 0!==n?n:"",STATDES:d,TEXT:Dt()(Object(Nt.convertToRaw)(null===ce||void 0===ce?void 0:ce.getCurrentContent())),CUSTNOTEEXTFILES:a};console.log(s),re.createTask(s).then((function(e){$("Task created succesfully.",{variant:"success"}),u(e.data),he(),console.log(e)})).catch((function(e){$("Error creating task.",{variant:"error"}),he(),console.log(e)}))}else $("Please select an Assigned To.",{variant:"error"});else $("Please fill out the Subject field.",{variant:"error"})},children:"Add"})]})]})})]})}var wn=Object(an.a)(ae.a)({marginLeft:15,padding:8,display:"flex",flexDirection:"column",top:0,bottom:0,maxHeight:"75vh",width:250,minWidth:250,background:"#ebecf0",overflow:"auto",position:"relative"}),Pn=function(e){var t=e.title,n=e.tasks,a=e.project,c=e.taskTypes,r=e.taskSizes,s=e.users,i=e.projectWBS,o=e.handleUpdateTasks,u=e.refreshTasks,d=e.handleTaskStatusChange;return Object(K.jsx)(Sn.c,{droppableId:t,type:"COLUMN",children:function(e,j){return Object(K.jsx)("div",Object(l.a)(Object(l.a)({},e.droppableProps),{},{ref:e.innerRef,children:Object(K.jsxs)(wn,{children:[Object(K.jsx)(g.a,{component:"h2",variant:"h6",color:"inherit",gutterBottom:!0,children:t||"Title"}),Object(K.jsx)("div",{style:{overflowY:"auto"},children:null===n||void 0===n?void 0:n.map((function(e,t){return Object(K.jsx)(Sn.b,{draggableId:e.CUSTNOTE.toString(),index:t,type:"TASK",children:function(t,n){return Object(K.jsx)("div",Object(l.a)(Object(l.a)(Object(l.a)({ref:t.innerRef},t.draggableProps),t.dragHandleProps),{},{children:Object(K.jsx)(pn,{task:e,refreshTasks:u,handleTaskStatusChange:d},e.CUSTNOTE)}))}},e.CUSTNOTE.toString())}))}),e.placeholder,Object(K.jsx)(Dn,{disabled:""===a,taskTypes:c,taskSizes:r,users:s,project:a,projectWBS:i,handleUpdateTasks:o,STATDES:t})]})}))}})},Nn=function(){return Object(K.jsx)(K.Fragment,{children:Object(je.a)(Array(6)).map((function(e,t){return Object(K.jsx)(Oe.a,{sx:{marginLeft:2,padding:8,display:"flex",flexDirection:"column"},variant:"rectangular",width:250,height:"75vh",style:{marginBottom:5}},t)}))})},In=function(){var e=Object(a.useState)([]),t=Object(i.a)(e,2),n=t[0],c=t[1],r=Object(a.useState)(""),s=Object(i.a)(r,2),o=s[0],u=s[1],d=Object(a.useState)([]),j=Object(i.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(!0),m=Object(i.a)(h,2),x=m[0],f=m[1],g=Object(fe.b)(),p=g.enqueueSnackbar,S=(g.closeSnackbar,Object(a.useState)()),E=Object(i.a)(S,2),T=E[0],C=E[1],A=Object(a.useState)([]),k=Object(i.a)(A,2),y=k[0],D=k[1],w=Object(a.useState)([]),P=Object(i.a)(w,2),N=P[0],I=P[1],R=Object(a.useState)([]),L=Object(i.a)(R,2),U=L[0],F=L[1],M=Object(a.useState)([]),W=Object(i.a)(M,2),B=W[0],_=W[1],G=Object(a.useState)(kn()()),z=Object(i.a)(G,2),Y=(z[0],z[1],Object(a.useState)(kn()())),X=Object(i.a)(Y,2),q=(X[0],X[1],Object(a.useMemo)((function(){if(!T)return b;var e=b.map((function(e){var t,n=null===e||void 0===e||null===(t=e.TASKS)||void 0===t?void 0:t.filter((function(e){var t=!0;for(var n in T)if(T[n]&&(void 0===e[n]||e[n]!==T[n])){t=!1;break}return t}));return Object(l.a)(Object(l.a)({},e),{},{TASKS:n})}));return e}),[T,b]));function V(e,t){return t.forEach((function(t){var n=e.find((function(e){return e.STATDES===t.STATDES}));void 0!==n&&(n.TASKS||(n.TASKS=[]),n.TASKS.push(Object.assign({},t)))})),e}var Q=function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.USERLOGIN&&t.add(e.USERLOGIN),e.USERLOGIN2&&t.add(e.USERLOGIN2),e.USERLOGIN3&&t.add(e.USERLOGIN3),e.USERLOGIN4&&t.add(e.USERLOGIN4),e.USERLOGIN5&&t.add(e.USERLOGIN5),e.USERLOGIN6&&t.add(e.USERLOGIN6),e.USERLOGIN7&&t.add(e.USERLOGIN7),e.USERLOGIN8&&t.add(e.USERLOGIN8)}))})),Object(je.a)(t)};function H(e,t){return e.filter((function(e){return void 0!==t.find((function(t){return t.STATDES===e.STATDES}))}))}Object(a.useEffect)(Object(Tt.a)(Et.a.mark((function e(){var t,n,a,r,s,o;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([re.getTaskStatuses(),re.getUserProjects()]);case 3:t=e.sent,n=Object(i.a)(t,2),a=n[0],r=n[1],s=a.data.value,o=s.push({STATDES:"Cancelled"}),console.log(o),O(s),c(r.data.value),f(!1),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.log(e.t0);case 18:case"end":return e.stop()}}),e,null,[[0,15]])}))),[]),Object(a.useEffect)(Object(Tt.a)(Et.a.mark((function e(){var t,n,a,c,r;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all([re.getTaskTypes(),re.getTaskSizes(),re.getUsers()]);case 3:t=e.sent,n=Object(i.a)(t,3),a=n[0],c=n[1],r=n[2],D(a.data.value),I(c.data.value),F(r.data.value),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),console.log(e.t0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])}))),[]);var Z=function(e){o&&J(e,o)},J=function(){var e=Object(Tt.a)(Et.a.mark((function e(t,n){return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!==n&&(f(!0),u(n),void 0!=b&&O(((t=b).forEach((function(e){e.TASKS&&delete e.TASKS})),t)),re.getProjectTasks(n.DOCNO).then((function(e){var t=H(e.data.value,b),n=V(b,t);O(n),console.log(n),console.log(Q(n)),f(!1)})).catch((function(e){console.log(e)})),re.getProjectWBS(n.DOCNO).then((function(e){_(e.data.value)})).catch((function(e){console.log(e)})));case 1:case"end":return e.stop()}var t}),e)})));return function(t,n){return e.apply(this,arguments)}}(),$=function(){var e=Object(Tt.a)(Et.a.mark((function e(t,n){return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:re.changeTaskStatus({CUSTNOTE:t,STATDES:n}).then((function(e){console.log(e)})).catch((function(e){p("Error updating task status in Priority.",{variant:"error"}),console.log(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ee=function(e,t,n){var a=function(e,t,n,a){var c=e.find((function(e){return e.STATDES===t}));if(!c||!c.TASKS)return null;var r=c.TASKS.findIndex((function(e){return e.CUSTNOTE===a}));if(-1===r)return null;var s=c.TASKS.splice(r,1),o=Object(i.a)(s,1)[0],l=e.find((function(e){return e.STATDES===n}));if(!l)return null;l.TASKS||(l.TASKS=[]);return l.TASKS.push(o),e}(Object(je.a)(b),e,t,n);$(n,t),O(a)},te=function(){var e=Object(Tt.a)(Et.a.mark((function e(t){var n,a,c;return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.destination){e.next=2;break}return e.abrupt("return");case 2:n=t.source.droppableId,a=t.destination.droppableId,c=parseInt(t.draggableId),ee(n,a,c);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var ne=function(e){var t=V(Object(je.a)(b),[e]);O(t)};return Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(v.a,{maxWidth:!1,sx:{display:"flex"},children:Object(K.jsx)(Me.a,{disabled:!o||x,onClick:Z,sx:{m:1},size:"small",variant:"contained",children:"Refresh Tasks"})}),Object(K.jsxs)(v.a,{maxWidth:!1,sx:{display:"flex"},children:[Object(K.jsx)(tn,{title:"Project",labelname:"DOCNO",items:n,onChange:J,description:"PROJDES"}),Object(K.jsx)(tn,{disabled:""===o,title:"Assigned To",labelname:"",items:Q(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{USERLOGIN:t}))}}),Object(K.jsx)(tn,{disabled:""===o,title:"WBS",labelname:"",items:function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.WBS&&t.add(e.WBS)}))})),Object(je.a)(t)}(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{WBS:t}))}}),Object(K.jsx)(tn,{disabled:""===o,title:"Task Type",labelname:"",items:function(e){if(!e)return[];var t=new Set;return e.forEach((function(e){e.TASKS&&e.TASKS.forEach((function(e){e.CUSTNOTETYPEDES&&t.add(e.CUSTNOTETYPEDES)}))})),Object(je.a)(t)}(b),onChange:function(e,t){return C(Object(l.a)(Object(l.a)({},T),{},{CUSTNOTETYPEDES:t}))}})]}),Object(K.jsx)(Sn.a,{onDragEnd:te,children:Object(K.jsx)(v.a,{maxWidth:!1,sx:{display:"flex",mt:2,mb:4},children:x?Object(K.jsx)(Nn,{}):null===q||void 0===q?void 0:q.filter((function(e){return"Cancelled"!==e.STATDES})).map((function(e){return Object(K.jsx)(Pn,{title:e.STATDES,tasks:e.TASKS,project:o,taskTypes:y,taskSizes:N,users:U,projectWBS:B,handleUpdateTasks:ne,refreshTasks:Z,handleTaskStatusChange:ee},e.DOCSTATUSSORT)}))})})]})},Rn=n(100);var Ln=function(e){return Object(K.jsx)(g.a,{component:"h2",variant:"h6",color:"primary",gutterBottom:!0,children:e.children})},Un=n(624),Fn=n(651),Mn=n(652),Wn=n(601);function Bn(e){var t=e.title,n=e.data,r=e.statusLabel,s=n.hasOwnProperty("value"),o=Object(a.useState)([]),l=Object(i.a)(o,2),u=l[0],d=l[1];return Object(a.useEffect)((function(){s&&r&&d(function(){var e,t={},a=Object(Rn.a)(n.value);try{for(a.s();!(e=a.n()).done;){var c=e.value[r];t[c]?t[c]+=1:t[c]=1}}catch(s){a.e(s)}finally{a.f()}return t}())}),[n]),Object(K.jsxs)(c.a.Fragment,{children:[Object(K.jsxs)(ae.a,{sx:{p:2,display:"flex",flexDirection:"column",minHeight:120},children:[Object(K.jsx)(Ln,{children:t}),s?Object(K.jsxs)(g.a,{component:"p",variant:"h4",children:[n.value.length," ",t]}):Object(K.jsx)(be.a,{})]}),Object(K.jsxs)(Un.a,{disabled:0===u.length,children:[Object(K.jsx)(Fn.a,{expandIcon:Object(K.jsx)(Wn.a,{}),"aria-controls":"panel1a-content",id:"panel1a-header",children:Object(K.jsx)(g.a,{children:"Status Breakdown"})}),Object(K.jsx)(Mn.a,{children:Object(K.jsx)("div",{children:Object.entries(u).map((function(e){var t=Object(i.a)(e,2),n=t[0],a=t[1];return Object(K.jsxs)(g.a,{color:"text.secondary",sx:{flex:1},children:[n,": ",a]},n)}))})})]})]})}var _n=n(187),Gn=[{type:"string",label:"Task ID"},{type:"string",label:"Task Name"},{type:"string",label:"Resource"},{type:"date",label:"Start Date"},{type:"date",label:"End Date"},{type:"number",label:"Duration"},{type:"number",label:"Percent Complete"},{type:"string",label:"Dependencies"}],zn={height:750,annotations:{style:"line",items:[{id:"Today",type:"line",mode:"horizontal",scaleID:"x",value:(new Date).toISOString(),style:{stroke:"red",strokeWidth:10}}]},gantt:{criticalPathEnabled:!1,defaultStartDateMillis:new Date,sortTasks:!1,innerGridHorizLine:{stroke:"#ffe0b2",strokeWidth:2},arrow:{angle:100,width:2,color:"green",radius:0}}};var Yn=function(){var e=function(e){return e.map((function(e){return[e.WBS,"".concat(e.WBS,": ").concat(e.ACTDES," ").concat(100===e.EXECPERCENT?"\u2705":""),e.WBS.substring(0,1),new Date(e.STARTDATE),new Date(e.ENDDATE),(t=new Date(e.ENDDATE)-new Date(e.STARTDATE),24*t*60*60*1e3/864e5+1),e.EXECPERCENT,e.PROJACTPRED_SUBFORM.filter((function(t){return t.WBS!==e.WBS})).map((function(e){return e.WBS})).join(", ")];var t}))},t=Object(a.useState)([]),n=Object(i.a)(t,2),c=n[0],r=n[1],s=Object(a.useState)(""),o=Object(i.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)([]),j=Object(i.a)(d,2),b=j[0],O=j[1],h=[Gn].concat(Object(je.a)(e(b)));return Object(a.useEffect)(Object(Tt.a)(Et.a.mark((function e(){return Et.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:re.getUserProjects().then((function(e){r(e.data.value)})).catch((function(e){console.log(e)}));case 1:case"end":return e.stop()}}),e)}))),[]),Object(a.useEffect)((function(){l&&re.getGanttWBS(l.DOCNO).then((function(t){var n=t.data.value[0].PROJACTS_SUBFORM;n[0].STARTDATE=new Date,n[0].ENDDATE=new Date,console.log(e(n)),console.log(n),O(n),zn.height=42*t.data.value[0].PROJACTS_SUBFORM.length})).catch((function(e){console.log(e)}))}),[l]),Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(v.a,{maxWidth:!1,sx:{mt:2,display:"flex",maxWidth:500},children:Object(K.jsx)(tn,{title:"Project",labelname:"DOCNO",items:c,onChange:function(e,t){return u(t)},description:"PROJDES"})}),Object(K.jsx)(v.a,{maxWidth:!1,sx:{mt:2,display:"flex"},children:0!==b.length?Object(K.jsx)(_n.a,{chartType:"Gantt",width:"100%",height:"50%",data:h,options:zn,chartEvents:[{callback:function(e){e.chartWrapper,e.google;!function(){for(var e=document.querySelectorAll("[id^=reactgooglegraph]")[0],t=e.getElementsByTagName("svg")[0].getElementsByTagName("g")[1].getElementsByTagName("text"),n=Number(t[0].getAttribute("y"))-25,a=0;a0?(a=t.data.value[0].ZMED_COMPANYCODE,r=t.data.value[0].CUSTDES,a===C?(c(e),n("Verification success.Please enter the user details",{variant:"success"}),l(!0),S(r)):(c(e),n("Invalid Company Code. Verification Failed",{variant:"error"}))):(c(e),n("Customer ID Not Exist",{variant:"error"}))})).catch((function(e){console.log("error:",e)})))},variant:"contained",sx:{mt:3,mb:2},children:"Verify Company"}),Object(K.jsx)(ia,{sx:{mt:1}})]})," "]}):Object(K.jsx)(K.Fragment,{}),o?Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(g.a,{component:"h1",variant:"h5",children:"User Sign Up"}),Object(K.jsxs)(h.a,{component:"form",noValidate:!0,sx:{mt:1},children:[Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,id:"firstname",label:"Firstname",name:"firstname",autoComplete:"firstname",inputProps:{maxLength:16},onChange:function(e){return R(e.target.value)},autoFocus:!0}),Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,id:"lastname",label:"Lastname",name:"lastname",autoComplete:"lastname",inputProps:{maxLength:20},onChange:function(e){return M(e.target.value)},autoFocus:!0}),Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,id:"email",label:"Email",name:"email",autoComplete:"email",onChange:function(e){q(e.target.value),Z(e.target.value)},autoFocus:!0}),Object(K.jsx)(pe.a,{margin:"normal",fullWidth:!0,id:"phone",label:"Phone",name:"phone",autoComplete:"phone",onChange:function(e){return G(e.target.value)},autoFocus:!0}),Object(K.jsx)(Me.a,{type:"submit",fullWidth:!0,sx:{mt:3,backgroundColor:"#C00932",color:"white","&:hover":{backgroundColor:"#C00932"}},disabled:""===I||""===F||""===X||""===H,onClick:function(t){e=n("User Signup is in progress...",{variant:"warning"}),t.preventDefault();var a=I+" "+F;re.checkContact(a).then((function(e){0===e.data.value.length?function(){var e={FIRSTNAME:I,LASTNAME:F,EMAIL:X,FIRM:p,PHONENUM:_,CUSTNAME:O};re.createContact(e).then((function(e){200===e.status||201===e.status?se(e.data.NAME):n("Contact Creation Failed",{variant:"error"})})).catch((function(e){console.log("error:",e)}))}():se(a)})).catch((function(e){console.log("error:",e)}))},children:"Sign up"}),Object(K.jsx)(ia,{sx:{mt:1}})]})]}):Object(K.jsx)(K.Fragment,{})," "]})})]})]})}function ua(e){return Object(K.jsxs)(g.a,Object(l.a)(Object(l.a)({variant:"body2",color:"text.secondary",align:"center"},e),{},{children:["Copyright \xa9 ",Object(K.jsx)(na.a,{color:"inherit",href:"https://medatechuk.com/",children:"Medatech UK"})," ",(new Date).getFullYear(),"."]}))}oa=Object(d.a)(oa,{palette:{red:oa.palette.augmentColor({color:{main:"#C00932"},name:"red"})}});var da=Object(d.a)();function ja(){var e=Object(fe.b)(),t=e.enqueueSnackbar,n=(e.closeSnackbar,c.a.useState(!1)),a=Object(i.a)(n,2),r=a[0],s=a[1],u=c.a.useState(!1),d=Object(i.a)(u,2),O=d[0],m=d[1],x=c.a.useState({}),f=Object(i.a)(x,2),p=f[0],S=f[1],v=c.a.useState(!1),T=Object(i.a)(v,2),C=T[0],A=T[1],k=function(e){return S((function(t){return Object(l.a)(Object(l.a)({},t),{},Object(o.a)({},e.target.name,e.target.value))}))};return Object(K.jsxs)(j.a,{theme:da,children:[r?Object(K.jsx)(Ue.a,{to:"/dashboard"}):null,C?Object(K.jsx)(la,{}):Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)("div",{className:"banner-container",children:Object(K.jsx)("div",{className:"banner-background",children:Object(K.jsxs)("div",{className:"banner-content",children:[Object(K.jsx)("img",{src:sa,alt:"Medatech Logo",className:"logo"}),Object(K.jsx)("a",{onClick:function(){return window.open("https://www.medatechuk.com/training-courses","_blank")},className:"banner-text",children:"Training courses now available, click here to view available dates and topics"})]})})}),Object(K.jsxs)(E.a,{container:!0,component:"main",sx:{height:"100vh"},children:[Object(K.jsx)(b.a,{}),Object(K.jsx)(E.a,{item:!0,xs:!1,sm:4,md:7,sx:{backgroundImage:"url(".concat(ra,")"),backgroundRepeat:"no-repeat",backgroundColor:function(e){return"light"===e.palette.mode?e.palette.grey[50]:e.palette.grey[900]},backgroundSize:"60%",backgroundPosition:"center"}}),Object(K.jsx)(E.a,{item:!0,xs:12,sm:8,md:5,component:ae.a,elevation:6,square:!0,children:Object(K.jsxs)(h.a,{sx:{my:8,mx:4,display:"flex",flexDirection:"column",alignItems:"center"},children:[Object(K.jsx)(rt.a,{sx:{m:1,bgcolor:"primary.main"},children:Object(K.jsx)(ca.a,{})}),Object(K.jsx)(g.a,{component:"h1",variant:"h5",children:O?"Change Password":"Sign in"}),Object(K.jsxs)(h.a,{component:"form",noValidate:!0,onSubmit:function(e){e.preventDefault();var n=new FormData(e.currentTarget);O?n.get("password")==n.get("confirmpassword")?_.changePassword(n).then((function(e){200==e.status?(t("Successfully changed password! Please login.",{variant:"success"}),m(!1)):t("Problem occurred changing password.",{variant:"error"})})):t("Passwords do not match.",{variant:"warning"}):_.login(n).then((function(e){1==e.data.newUser?(t("Please change your password.",{variant:"warning"}),m(!0)):(t("Successfully logged in!",{variant:"success"}),localStorage.setItem("token",e.data.token),s(!0),window.location.reload())})).catch((function(e){t(e.response.data.message,{variant:"error"})}))},sx:{mt:1},children:[Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,id:"username",label:"Username",name:"username",autoComplete:"username",onChange:k,sx:{pointerEvents:O?"none":"auto"},autoFocus:!0}),Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,name:"password",label:O?"New Password":"Password",type:"password",id:"password",autoComplete:"current-password",onChange:k}),O?Object(K.jsx)(pe.a,{margin:"normal",required:!0,fullWidth:!0,name:"confirmpassword",label:"Confirm Password",type:"password",id:"confirmpassword",onChange:k}):null,O?Object(K.jsx)(Me.a,{type:"submit",fullWidth:!0,variant:"contained",sx:{mt:3,mb:2},children:"Change Password"}):Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)(Me.a,{type:"submit",fullWidth:!0,variant:"contained",sx:{mt:3},children:"Sign In"}),Object(K.jsx)(Me.a,{type:"submit",fullWidth:!0,onClick:function(e){e.preventDefault(),A(!0)},sx:{mt:1},children:"Sign Up"}),Object(K.jsx)(Me.a,{onClick:function(e){console.log(p),_.forgotPassword(p).then((function(e){t("Email has been sent to the contact",{variant:"success"})})).catch((function(e){t("User not exist",{variant:"error"})}))},fullWidth:!0,sx:{mt:3},children:"Forgot password?"})]}),Object(K.jsx)(ua,{sx:{mt:1}})]})]})})]})]})]})}var ba=function(){return Object(K.jsx)("div",{className:"App",children:Object(K.jsx)(mn.a,{children:Object(K.jsx)(fe.a,{children:Object(K.jsx)(L.a,{children:Object(K.jsxs)(Ue.d,{children:[Object(K.jsx)(bt,{exact:!0,path:"/",children:Object(K.jsx)(Ue.a,{to:"/dashboard"})}),Object(K.jsx)(bt,{path:"/dashboard",component:ta}),Object(K.jsx)(Ue.b,{exact:!0,path:"/login",component:ja}),Object(K.jsx)(bt,{component:ta})]})})})})})},Oa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,653)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,s=t.getTTFB;n(e),a(e),c(e),r(e),s(e)}))};s.a.render(Object(K.jsx)(c.a.StrictMode,{children:Object(K.jsx)(ba,{})}),document.getElementById("root")),Oa()}},[[490,1,2]]]); //# sourceMappingURL=main.59369c44.chunk.js.map