"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[6914],{76914:function(e,t,a){a.r(t);var r=a(29439),o=a(72791),i=a(16871),n=a(81207),s=a(25787),l=a(11135),c=a(62666),d=a(10703),p=a(61889),g=a(20890),h=a(75952),m=a(15146),u=a(80184);t.default=(0,s.Z)((function(e){return(0,l.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,i.s0)(),s=(0,o.useState)(""),l=(0,r.Z)(s,2),x=l[0],f=l[1],b=(0,o.useState)(""),v=(0,r.Z)(b,2),j=v[0],C=v[1],S=(0,o.useState)(!0),Z=(0,r.Z)(S,2),k=Z[0],w=Z[1];return(0,o.useEffect)((function(){if(k){var e=window.location.search,t=new URLSearchParams(e),r=t.get("code"),o=t.get("state"),i=t.get("error"),s=t.get("errorDescription");i||s?(f(i||""),C(s||""),w(!1)):n.Z.invoke("POST","/api/v1/login/oauth2/auth",{code:r,state:o}).then((function(){var e="/";localStorage.getItem("redirect-path")&&""!==localStorage.getItem("redirect-path")&&(e="".concat(localStorage.getItem("redirect-path")),localStorage.setItem("redirect-path","")),w(!1),a(e)})).catch((function(e){f(e.errorMessage),C(e.detailedError),w(!1)}))}}),[k,a]),""!==x||""!==j?(0,u.jsx)(o.Fragment,{children:(0,u.jsx)(d.Z,{className:t.paper,children:(0,u.jsxs)(p.ZP,{container:!0,className:t.mainContainer,children:[(0,u.jsx)(p.ZP,{item:!0,xs:7,className:t.theOcean,children:(0,u.jsx)("div",{className:t.oceanBg})}),(0,u.jsxs)(p.ZP,{item:!0,xs:5,className:t.theLogin,children:[(0,u.jsxs)("div",{className:t.errorTitle,children:[(0,u.jsx)("span",{className:t.messageIcon,children:(0,u.jsx)(m.Z,{})}),(0,u.jsx)("span",{className:t.errorLabel,children:"Error from IDP"})]}),(0,u.jsx)("div",{className:t.simpleError,children:x}),(0,u.jsx)(g.Z,{variant:"body1",gutterBottom:!0,component:"div",className:t.extraDetailsContainer,children:j}),(0,u.jsx)(h.z,{id:"back-to-login",onClick:function(){window.location.href="".concat(c.F,"login")},type:"submit",variant:"callAction",fullWidth:!0,children:"Back to Login"})]})]})})}):null}))},15146:function(e,t,a){var r=a(64836);t.Z=void 0;var o=r(a(45649)),i=a(80184),n=(0,o.default)((0,i.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline");t.Z=n}}]);
//# sourceMappingURL=6914.57144791.chunk.js.map