"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[3074],{83074:function(e,t,a){a.r(t);var r=a(77439),o=a(57223),i=a(64964),n=a(4481),s=a(11927),l=a(47939),c=a(29240),d=a(73130),p=a(26211),g=a(46266),m=a(48778),h=a(18054);t.default=(0,n.Z)((function(e){return(0,s.Z)({paper:{borderRadius:8,display:"flex",flexDirection:"column",alignItems:"center",width:800,height:424,margin:"auto",position:"absolute",top:"50%",left:"50%",marginLeft:-400,marginTop:-212,"&.MuiPaper-root":{borderRadius:8}},submit:{margin:"30px 0px 16px",height:40,boxShadow:"none",padding:"16px 30px"},mainContainer:{position:"relative",height:424},theOcean:{borderTopLeftRadius:8,borderBottomLeftRadius:8,background:"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;"},oceanBg:{backgroundImage:"url(/images/BG_Illustration.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"bottom left",height:"100%",width:324},theLogin:{padding:"40px 45px 20px 45px"},extraDetailsContainer:{fontStyle:"italic",color:"#9C9C9C",transition:"all .2s ease-in-out",padding:"0 5px",marginTop:5,overflow:"auto"},errorLabel:{color:"#000",fontSize:18,fontWeight:500,marginLeft:5},simpleError:{marginTop:5,padding:"2px 5px",fontSize:16,color:"#000"},messageIcon:{color:"#C72C48",display:"flex","& svg":{width:32,height:32}},errorTitle:{display:"flex",alignItems:"center"}})}))((function(e){var t=e.classes,a=(0,o.useState)(""),n=(0,r.Z)(a,2),s=n[0],u=n[1],x=(0,o.useState)(""),f=(0,r.Z)(x,2),b=f[0],v=f[1],Z=(0,o.useState)(!0),j=(0,r.Z)(Z,2),S=j[0],C=j[1];return(0,o.useEffect)((function(){if(S){var e=window.location.search,t=new URLSearchParams(e),a=t.get("code"),r=t.get("state"),o=t.get("error"),n=t.get("errorDescription");o||n?(u(o||""),v(n||""),C(!1)):i.Z.invoke("POST","/api/v1/login/oauth2/auth",{code:a,state:r}).then((function(){var e="/";localStorage.getItem("redirect-path")&&""!==localStorage.getItem("redirect-path")&&(e="".concat(localStorage.getItem("redirect-path")),localStorage.setItem("redirect-path","")),C(!1),l.Z.push(e)})).catch((function(e){u(e.errorMessage),v(e.detailedError),C(!1)}))}}),[S]),""!==s||""!==b?(0,h.jsx)(o.Fragment,{children:(0,h.jsx)(c.Z,{className:t.paper,children:(0,h.jsxs)(d.ZP,{container:!0,className:t.mainContainer,children:[(0,h.jsx)(d.ZP,{item:!0,xs:7,className:t.theOcean,children:(0,h.jsx)("div",{className:t.oceanBg})}),(0,h.jsxs)(d.ZP,{item:!0,xs:5,className:t.theLogin,children:[(0,h.jsxs)("div",{className:t.errorTitle,children:[(0,h.jsx)("span",{className:t.messageIcon,children:(0,h.jsx)(m.Z,{})}),(0,h.jsx)("span",{className:t.errorLabel,children:"Error from IDP"})]}),(0,h.jsx)("div",{className:t.simpleError,children:s}),(0,h.jsx)(p.Z,{variant:"body1",gutterBottom:!0,component:"div",className:t.extraDetailsContainer,children:b}),(0,h.jsx)(g.Z,{component:"a",href:"/login",type:"submit",variant:"contained",color:"primary",className:t.submit,children:"Back to Login"})]})]})})}):null}))}}]);
//# sourceMappingURL=3074.5a901533.chunk.js.map