@crystaldesign/diva-support 24.15.0-beta.2 → 24.15.0-beta.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 276.diva-support.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[276],{9276:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ne});var r=n(7363),a=n(4727),o=n(4658),i=n(4988),s=n(747),l=n.n(s),c=n(523),u=n(9420),d=n(501),h=n(8623),p=n(3096),v=n(7995),g=n(789),x=n(5515),w=n.n(x),f=n(7514);function OpenId(){var e,t,n,r=(0,a.KH)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.$G)().t,l=null===(e=i.state)||void 0===e?void 0:e.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(null==l?void 0:l.google)&&(0,f.jsxs)(v.Z,{className:w()(c.FI,c.lk),onClick:function onClick(){var e;return i.openOAuthLogin("google",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.google")]}),(null==l?void 0:l.microsoft)&&(0,f.jsxs)(v.Z,{className:w()(c.FI,c.Eg),onClick:function onClick(){var e;return i.openOAuthLogin("microsoft",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.microsoft")]}),(null==l?void 0:l.generic)&&(0,f.jsxs)(v.Z,{className:c.FI,style:{backgroundColor:null!==(t=l.generic.backgroundColor)&&void 0!==t?t:o.theme.palette.secondary.main,color:null!==(n=l.generic.color)&&void 0!==n?n:o.theme.palette.secondary.contrastText},onClick:function onClick(){var e;return i.openOAuthLogin("genericOpenId",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{style:l.generic.logo?{backgroundImage:"url(".concat(l.generic.logo,")")}:{}}),s("auth.login.generic")]})]})}var j=n(4680),m=(0,j.jl)("Framework","Login");const y=(0,u.Pi)((function Login(){var e,t,n,s,u=(0,a.KH)(),x=u.authorizationStore,w=u.authorizationHandler,j=(0,r.useState)("enter"),y=(0,i.Z)(j,2),k=y[0],C=y[1],M=(0,r.useState)(null!==(e=null===(t=x.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),S=(0,i.Z)(M,2),Z=S[0],L=S[1],b=(0,r.useState)(""),N=(0,i.Z)(b,2),z=N[0],I=N[1],E=(0,r.useState)(""),P=(0,i.Z)(E,2),D=P[0],O=P[1],F=(0,r.useState)(!1),R=(0,i.Z)(F,2),A=R[0],T=R[1],_=(0,r.useState)(x.state.invitationId),U=(0,i.Z)(_,2),$=U[0],B=U[1],G=(0,r.useState)("LOGIN"==(null===(n=x.state)||void 0===n?void 0:n.type)?x.state.error:void 0),H=(0,i.Z)(G,2),K=H[0],V=H[1],Q=(0,g.$G)().t,W=function(){var e=(0,o.Z)(l().mark((function _callee(){var e,t;return l().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,$){n.next=6;break}return n.next=4,w.getInvitationValue("id",Z);case 4:(e=n.sent)&&(e.isNewUser&&(x.close(),x.showRegister(void 0,Z,!0)),B(!0),T(!0));case 6:return n.next=8,w.fetchLoginProvider({email:Z});case 8:"standard"==(t=n.sent).provider?C("login"):x.openOAuthLogin(t.provider,x.state.organizationId,x.state.invitationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),m.error(new d.GE("Error while fetching login provider",{cause:n.t0})),V("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),Y=function(){var e=(0,o.Z)(l().mark((function _callee2(){return l().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.fl)(x.login(Z,z,!1,x.state.organizationId,x.state.invitationId,D));case 3:L(""),I(""),V(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),m.error(new d.GE("Error while logging in",{cause:e.t0})),V($?"auth.error.passwordotp":"auth.error.password");case 12:case"end":return e.stop()}}),_callee2,null,[[0,8]])})));return function onLogin(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.Z)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:x.showRequestNewPassword(Z);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),J="enter"==k&&0==Z.length||"enter"!=k&&0==z.length;A&&!J&&(J=0==D.length);var X=null===(s=x.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Q("auth.title.login")}),(0,f.jsx)("p",{children:Q("auth.text.login","")}),!!K&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Q(K)})]}),(0,f.jsx)(OpenId,{}),((null==X?void 0:X.generic)||(null==X?void 0:X.google)||(null==X?void 0:X.microsoft))&&X.standard&&(0,f.jsx)("div",{className:c.kr,children:"or"}),(null==X?void 0:X.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(p.Z,{id:"username",value:Z,autoComplete:"username",autoFocus:!0,placeholder:Q("auth.input.email"),onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&W()}}),(0,f.jsx)(p.Z,{value:z,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Q("auth.input.password"),onChange:function onChange(e){return I(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&Y()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[A&&(0,f.jsx)(p.Z,{value:D,type:"text",autoFocus:!0,placeholder:Q("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.TL,onClick:function reset(){C("enter"),L(""),I(""),V(void 0)},children:(0,f.jsx)(p.Z,{value:Z,readOnly:!0,placeholder:Q("auth.input.email")})}),(0,f.jsx)(p.Z,{value:z,type:"password",id:"password",autoFocus:!0,placeholder:Q("auth.input.password"),onChange:function onChange(e){return I(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&Y()}}),(0,f.jsx)("div",{className:c.p4,style:{textAlign:"right"},onClick:q,children:Q("auth.button.forgotpassword")})]}),(0,f.jsx)(v.Z,{id:"submit",disabled:J,onClick:"enter"==k?W:Y,children:Q("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,j.jl)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.KH)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,x=(0,r.useState)(t),w=(0,i.Z)(x,2),j=w[0],m=w[1],y=(0,r.useState)(!1),C=(0,i.Z)(y,2),M=C[0],S=C[1],Z=(0,r.useState)(),L=(0,i.Z)(Z,2),b=L[0],N=L[1],z=(0,r.useState)(),I=(0,i.Z)(z,2),E=I[0],P=I[1],D=(0,g.$G)().t,O=function(){var e=(0,o.Z)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,P(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:j});case 5:P(!1),h.toggleLoading("SendPassword"),S(!0),N(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.GE("Error while sending password recovery mail",{cause:e.t0})),N("auth.error.resetpassword"),P(!1),h.toggleLoading("SendPassword");case 17:case"end":return e.stop()}}),_callee,null,[[0,11]])})));return function resetPassword(){return e.apply(this,arguments)}}();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:D("auth.title.resetpassword")}),(0,f.jsx)("p",{children:D("auth.info.resetdescription")}),!!b&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:D(b)})]}),M&&(0,f.jsxs)("div",{className:c.Vp,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:D("auth.info.resetpassword")})]}),!M&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{value:j,autoFocus:!0,placeholder:D("auth.input.email"),onChange:function onChange(e){return m(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(v.Z,{disabled:0==j.length,onClick:O,children:D("auth.button.resetpassword")})]}),M&&(0,f.jsx)(v.Z,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:D("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.$G)().t;return(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),"INVALID"==t&&(0,f.jsx)("div",{children:r("auth.error.verifypassword")}),"SERVER"==t&&(0,f.jsx)("div",{children:n})]})}var C=(0,j.jl)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.KH)(),u=s.configurationStore,h=s.authorizationStore,x=s.apiHandler,w=(s.loadingAndErrorStore,(0,r.useState)("")),j=(0,i.Z)(w,2),m=j[0],y=j[1],k=(0,r.useState)(""),M=(0,i.Z)(k,2),S=M[0],Z=M[1],L=(0,r.useState)(!1),b=(0,i.Z)(L,2),N=b[0],z=b[1],I=(0,r.useState)(),E=(0,i.Z)(I,2),P=E[0],D=E[1],O=(0,r.useState)(""),F=(0,i.Z)(O,2),R=F[0],A=F[1],T=(0,r.useRef)(null),_=(0,g.$G)().t;(0,r.useEffect)((function(){m===S&&D(void 0)}),[m,S]);var U=function(){var e=(0,o.Z)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(A(_("auth.error.verifypasswordserver")),!(m.length<8||m!==S)){e.next=4;break}return D("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,x.resetPassword({password:m,token:n});case 7:z(!0),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),$(e.t0);case 13:case"end":return e.stop()}}),_callee,null,[[4,10]])})));return function resetPassword(){return e.apply(this,arguments)}}(),$=function handleError(e){if(e instanceof d.GE){if("AUTH_0003"===e.name)A(_("auth.error.verifypasswordtokenerror",{errormsg:_("auth.error.tokenexpired")}));else A(_("auth.error.verifypasswordserver",e.message));C.error(e)}C.error(new d.GE("Error while resetting password",{cause:e})),D("SERVER")};return"SERVER"===P?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:P,authErrorsg:R}),(0,f.jsx)(v.Z,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:_("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:_("auth.title.verifypassword")}),N&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.Vp,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:_("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(v.Z,{onClick:function goToLogin(){h.close(),h.showLogin()},children:_("auth.button.login")})]}),!N&&(0,f.jsxs)(f.Fragment,{children:[P&&(0,f.jsx)(Errormessage,{hasError:P,authErrorsg:R}),(0,f.jsxs)("form",{children:[(0,f.jsx)(p.Z,{value:m,autoFocus:!0,placeholder:_("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return y(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=T.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(p.Z,{ref:T,value:S,placeholder:_("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return Z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(v.Z,{disabled:!m||!S,onClick:U,children:_("auth.button.save")})]})]})}var M=n(5486);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=e.invitationOrgId,u=(0,a.KH)(),d=u.authorizationStore,h=u.authorizationHandler,p=(0,r.useState)(""),x=(0,i.Z)(p,2),w=x[0],j=x[1],m=(0,g.$G)().t,y=function(){var e=(0,o.Z)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showLogin(void 0,void 0,s,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),k=function(){var e=(0,o.Z)(l().mark((function _callee2(){var e;return l().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showRegister(n,e));case 4:case"end":return t.stop()}}),_callee2)})));return function toRegister(){return e.apply(this,arguments)}}();function checkInvitation(){return _checkInvitation.apply(this,arguments)}function _checkInvitation(){return _checkInvitation=(0,o.Z)(l().mark((function _callee3(){var e,t,n;return l().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return t=null===(e=d.state)||void 0===e?void 0:e.invitationId,r.next=3,h.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return j("Invitation not found"),r.abrupt("return",void 0);case 10:case"end":return r.stop()}}),_callee3)}))),_checkInvitation.apply(this,arguments)}return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:m("auth.title.welcome")}),(0,f.jsx)("p",{children:m("auth.info.welcomedescription")}),w&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:m(w)})]}),t&&!w&&(0,f.jsx)(v.Z,{onClick:k,children:m("auth.title.register")}),!t&&!w&&(0,f.jsx)(v.Z,{onClick:y,children:m("auth.button.login")})]})}var S=n(217),Z=n(7726),L=n(4062),b=n(9074),N=n(1522),z=n(4039),I=n(7843),E=n(8815),P=n(5739),D=n(883),O=n(3966),F=n(431);function getSwitchBaseUtilityClass(e){return(0,F.ZP)("PrivateSwitchBase",e)}(0,O.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const R=(0,I.ZP)(D.Z)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),A=(0,I.ZP)("input",{shouldForwardProp:z.Z})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),T=r.forwardRef((function SwitchBase(e,t){const{autoFocus:n,checked:r,checkedIcon:a,className:o,defaultChecked:i,disabled:s,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:d,inputProps:h,inputRef:p,name:v,onBlur:g,onChange:x,onFocus:w,readOnly:j,required:m=!1,tabIndex:y,type:k,value:C,...M}=e,[S,b]=(0,E.Z)({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),z=(0,P.Z)();let I=s;z&&void 0===I&&(I=z.disabled);const D="checkbox"===k||"radio"===k,O={...e,checked:S,disabled:I,disableFocusRipple:l,edge:c},F=(e=>{const{classes:t,checked:n,disabled:r,edge:a}=e,o={root:["root",n&&"checked",r&&"disabled",a&&`edge${(0,N.Z)(a)}`],input:["input"]};return(0,L.Z)(o,getSwitchBaseUtilityClass,t)})(O);return(0,f.jsxs)(R,{component:"span",className:(0,Z.Z)(F.root,o),centerRipple:!0,focusRipple:!l,disabled:I,tabIndex:null,role:void 0,onFocus:e=>{w&&w(e),z&&z.onFocus&&z.onFocus(e)},onBlur:e=>{g&&g(e),z&&z.onBlur&&z.onBlur(e)},ownerState:O,ref:t,...M,children:[(0,f.jsx)(A,{autoFocus:n,checked:r,defaultChecked:i,className:F.input,disabled:I,id:D?d:void 0,name:v,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;b(t),x&&x(e,t)},readOnly:j,ref:p,required:m,ownerState:O,tabIndex:y,type:k,..."checkbox"===k&&void 0===C?{}:{value:C},...h}),S?a:u]})}));var _=n(6177);const U=(0,_.Z)((0,f.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),$=(0,_.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),B=(0,_.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(e){return(0,F.ZP)("MuiCheckbox",e)}const G=(0,O.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var H=n(518),K=n(8981),V=n(2893);const Q=(0,I.ZP)(T,{shouldForwardProp:e=>(0,z.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,N.Z)(n.size)}`],"default"!==n.color&&t[`color${(0,N.Z)(n.color)}`]]}})((0,H.Z)((({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,K.Z)()).map((([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}}))),...Object.entries(e.palette).filter((0,K.Z)()).map((([t])=>({props:{color:t},style:{[`&.${G.checked}, &.${G.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${G.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}))),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})))),W=(0,f.jsx)($,{}),Y=(0,f.jsx)(U,{}),q=(0,f.jsx)(B,{}),J=r.forwardRef((function Checkbox(e,t){const n=(0,V.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:a=W,color:o="primary",icon:i=Y,indeterminate:s=!1,indeterminateIcon:l=q,inputProps:c,size:u="medium",disableRipple:d=!1,className:h,...p}=n,v=s?l:i,g=s?l:a,x={...n,disableRipple:d,color:o,indeterminate:s,size:u},w=(e=>{const{classes:t,indeterminate:n,color:r,size:a}=e,o={root:["root",n&&"indeterminate",`color${(0,N.Z)(r)}`,`size${(0,N.Z)(a)}`]},i=(0,L.Z)(o,getCheckboxUtilityClass,t);return{...t,...i}})(x);return(0,f.jsx)(Q,{type:"checkbox",inputProps:{"data-indeterminate":s,...c},icon:r.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:r.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:x,ref:t,className:(0,Z.Z)(w.root,h),disableRipple:d,...p,classes:w})}));var X=(0,j.jl)("Framework","Register");const ee=(0,u.Pi)((function Register(){var e,t,n,s,u,x,w=(0,a.KH)(),j=w.authorizationStore,m=w.configurationStore,y=(0,g.$G)().t,k=(0,r.useState)(null!==(e=null===(t=j.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),C=(0,i.Z)(k,2),M=C[0],Z=C[1],L=(0,r.useState)(""),b=(0,i.Z)(L,2),N=b[0],z=b[1],I=(0,r.useState)(""),E=(0,i.Z)(I,2),P=E[0],D=E[1],O=(0,r.useState)(""),F=(0,i.Z)(O,2),R=F[0],A=F[1],T=(0,r.useState)(""),_=(0,i.Z)(T,2),U=_[0],$=_[1],B=(0,r.useState)(""),G=(0,i.Z)(B,2),H=G[0],K=G[1],V=(0,r.useState)(""),Q=(0,i.Z)(V,2),W=Q[0],Y=Q[1],q=(0,r.useState)(!1),ee=(0,i.Z)(q,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.Z)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,h.fl)(j.register(M,N,U,R,null===(e=j.state)||void 0===e?void 0:e.invitationId,W));case 3:Z(""),z(""),D(""),$(""),A(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),K("auth.error.invitationotp"),X.error(new d.GE("Error while registering",{cause:t.t0}));case 14:case"end":return t.stop()}}),_callee,null,[[0,10]])})));return function onRegister(){return e.apply(this,arguments)}}(),ae=null===(n=j.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=W&&""!==W&&N==P&&""!=N&&null!=N&&te:N==P&&""!=N&&null!=N&&te},ie=null===(s=j.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:y("auth.title.register")}),(0,f.jsx)("p",{children:y("auth.text.register","")}),!!H&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:y(H)})]}),(0,f.jsx)(OpenId,{}),((null==ie?void 0:ie.generic)||(null==ie?void 0:ie.google)||(null==ie?void 0:ie.microsoft))&&ie.standard&&(0,f.jsx)("div",{className:c.kr,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(p.Z,{type:"text",value:W,placeholder:y("auth.input.otp"),onChange:function onChange(e){return Y(e.target.value)}}),(0,f.jsx)(p.Z,{value:U,autoFocus:!0,placeholder:y("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(p.Z,{value:R,autoFocus:!0,placeholder:y("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return A(e.target.value)}}),(0,f.jsx)(p.Z,{value:M,autoComplete:"email",autoFocus:!0,placeholder:y("auth.input.email"),disabled:!0}),(0,f.jsx)(p.Z,{value:N,type:"password",autoFocus:!0,placeholder:y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)}}),(0,f.jsx)(p.Z,{value:P,type:"password",autoFocus:!0,placeholder:y("auth.input.repeatpassword"),onChange:function onChange(e){return D(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(J,{name:"checkAGB",checked:te,onClick:function onClick(){return ne(!te)}}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",fontSize:9},children:[(0,f.jsx)("span",{children:y("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=m.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:y("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(x=m.navigation.privacyUrl)&&void 0!==x?x:"https://www.diva-portal.de/datenschutz",children:y("auth.privacypolicy")})]})]})]}),(0,f.jsx)(S.Z,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:y("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(v.Z,{disabled:!oe(),onClick:oe()?re:void 0,children:y("auth.input.login")})]})]})}));var te=(0,u.Pi)((function(){var e,t=(0,a.KH)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(y,{});case"REQUEST_NEW_PASSWORD":return(0,f.jsx)(RequestNewPassword,{initEmail:t.state.email});case"CHANGE_PASSWORD":return(0,f.jsx)(ChangePassword,{token:t.state.token});case"WELCOME":return(0,f.jsx)(WelcomeScreen,{isNewUser:t.state.isNewUser,invitationId:t.state.invitationId,invitationOrgId:t.state.invitationOrgId});case"REGISTER":return(0,f.jsx)(ee,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const ne=(0,u.Pi)((function Auth(){var e,t,n,o=(0,a.KH)(),i=o.authorizationStore,s=o.configurationStore,l=o.dataStore,u=(o.authorizationHandler,(0,r.useMemo)((function(){var e,t,n,r="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgMTAwMCAyOTMuNjUiPjxwYXRoIGQ9Ik0yNTAuODksMTQ3LjNjLTMuMTgtNzQtMzAuNC0xNDMuMTgtMTQxLjczLTE0My4xOEwwLDQuMjZBMzA3Ljg2LDMwNy44NiwwLDAsMSwyNi4xMiw2MC43aDc0LjJjNTIuODYsMCw3NiwyNS42OCw3OC42MSw4NS4yOSwyLjY2LDYxLjgxLTE4LjI5LDg3LjkyLTcxLjE1LDg3LjkySDc5LjJsLTQ2LjcxLjUyYTI4Ny4yOSwyODcuMjksMCwwLDEtMjAsNTMuODhoMTA5YzExMS4zMiwwLDEzMi42Ny02NywxMjkuNDgtMTQxTTMwNi44NCwyODloNzEuMjNWMGEzMDAuMDcsMzAwLjA3LDAsMCwxLTcxLjIzLDI1LjkyWm0zMTguOC42Mkw3MjYuNTkuODVhMzAwLDMwMCwwLDAsMS04My42NSwzMi4yNEw1NzcuMTEsMjI0LDUxMS4yOSwzMy4wOUEzMDAsMzAwLDAsMCwxLDQyNy42NC44NWwxMDEsMjg4Ljc2Wm0zNzQuMzYsNEw4OTkuMDUsNC45MUg4MDJMNzc1LjE0LDgxLjc0LDcwMS4wNSwyOTMuNjVBMzAwLjMyLDMwMC4zMiwwLDAsMSw3ODUsMjYxLjM1bDYuNzktMjEsMTkuMTQtNTcuNTRMODUwLjUyLDYybDQwLjA3LDEyMC44NSwxOC43LDU3LjU0LDcsMjFBMzAwLjIsMzAwLjIsMCwwLDEsMTAwMCwyOTMuNjUiIGZpbGw9IiNiM2IzYjMiLz48L3N2Zz4=";if(null!==(e=l.organization)&&void 0!==e&&e.logoUrl)r=null===(n=l.organization)||void 0===n?void 0:n.logoUrl;else if(null!==(t=s.navigation)&&void 0!==t&&t.logoUrl){var a;r=null===(a=s.navigation)||void 0===a?void 0:a.logoUrl}return r}),[null===(e=s.navigation)||void 0===e?void 0:e.logoUrl,null===(t=l.organization)||void 0===t?void 0:t.logoUrl]));return null==i.state?(0,f.jsx)(f.Fragment,{}):(0,f.jsxs)("div",{className:c.I8,children:[(0,f.jsxs)("div",{className:c.NB,children:[(0,f.jsx)("div",{className:c.tn,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(te,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(M.p,{settings:{contentBoxProps:(0,h.ZN)(s.authentication.contentBox.props)}})})]})}))}}]);
2
+ "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[276],{9276:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ne});var r=n(7363),a=n(4727),o=n(4658),i=n(4988),s=n(747),l=n.n(s),c=n(523),u=n(9420),d=n(501),h=n(8623),p=n(3096),v=n(7995),g=n(789),x=n(5515),w=n.n(x),f=n(7514);function OpenId(){var e,t,n,r=(0,a.KH)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.$G)().t,l=null===(e=i.state)||void 0===e?void 0:e.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(null==l?void 0:l.google)&&(0,f.jsxs)(v.Z,{className:w()(c.FI,c.lk),onClick:function onClick(){var e;return i.openOAuthLogin("google",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.google")]}),(null==l?void 0:l.microsoft)&&(0,f.jsxs)(v.Z,{className:w()(c.FI,c.Eg),onClick:function onClick(){var e;return i.openOAuthLogin("microsoft",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{}),s("auth.login.microsoft")]}),(null==l?void 0:l.generic)&&(0,f.jsxs)(v.Z,{className:c.FI,style:{backgroundColor:null!==(t=l.generic.backgroundColor)&&void 0!==t?t:o.theme.palette.secondary.main,color:null!==(n=l.generic.color)&&void 0!==n?n:o.theme.palette.secondary.contrastText},onClick:function onClick(){var e;return i.openOAuthLogin("genericOpenId",i.state.organizationId,null===(e=i.state)||void 0===e?void 0:e.invitationId)},children:[(0,f.jsx)("div",{style:l.generic.logo?{backgroundImage:"url(".concat(l.generic.logo,")")}:{}}),s("auth.login.generic")]})]})}var j=n(4680),m=(0,j.jl)("Framework","Login");const y=(0,u.Pi)((function Login(){var e,t,n,s,u=(0,a.KH)(),x=u.authorizationStore,w=u.authorizationHandler,j=(0,r.useState)("enter"),y=(0,i.Z)(j,2),k=y[0],C=y[1],M=(0,r.useState)(null!==(e=null===(t=x.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),S=(0,i.Z)(M,2),Z=S[0],L=S[1],b=(0,r.useState)(""),N=(0,i.Z)(b,2),z=N[0],I=N[1],E=(0,r.useState)(""),P=(0,i.Z)(E,2),D=P[0],O=P[1],F=(0,r.useState)(!1),R=(0,i.Z)(F,2),A=R[0],T=R[1],_=(0,r.useState)(x.state.invitationId),U=(0,i.Z)(_,2),$=U[0],B=U[1],G=(0,r.useState)("LOGIN"==(null===(n=x.state)||void 0===n?void 0:n.type)?x.state.error:void 0),H=(0,i.Z)(G,2),K=H[0],V=H[1],Q=(0,g.$G)().t,W=function(){var e=(0,o.Z)(l().mark((function _callee(){var e,t;return l().wrap((function _callee$(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,$){n.next=6;break}return n.next=4,w.getInvitationValue("id",Z);case 4:(e=n.sent)&&(e.isNewUser&&(x.close(),x.showRegister(void 0,Z,!!e.useotp)),B(!0),e.useotp&&T(!0));case 6:return n.next=8,w.fetchLoginProvider({email:Z});case 8:"standard"==(t=n.sent).provider?C("login"):x.openOAuthLogin(t.provider,x.state.organizationId,x.state.invitationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),m.error(new d.GE("Error while fetching login provider",{cause:n.t0})),V("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),Y=function(){var e=(0,o.Z)(l().mark((function _callee2(){return l().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,h.fl)(x.login(Z,z,!1,x.state.organizationId,x.state.invitationId,D));case 3:L(""),I(""),V(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),m.error(new d.GE("Error while logging in",{cause:e.t0})),V($?"auth.error.passwordotp":"auth.error.password");case 12:case"end":return e.stop()}}),_callee2,null,[[0,8]])})));return function onLogin(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.Z)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:x.showRequestNewPassword(Z);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),J="enter"==k&&0==Z.length||"enter"!=k&&0==z.length;A&&!J&&(J=0==D.length);var X=null===(s=x.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Q("auth.title.login")}),(0,f.jsx)("p",{children:Q("auth.text.login","")}),!!K&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Q(K)})]}),(0,f.jsx)(OpenId,{}),((null==X?void 0:X.generic)||(null==X?void 0:X.google)||(null==X?void 0:X.microsoft))&&X.standard&&(0,f.jsx)("div",{className:c.kr,children:"or"}),(null==X?void 0:X.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(p.Z,{id:"username",value:Z,autoComplete:"username",autoFocus:!0,placeholder:Q("auth.input.email"),onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&W()}}),(0,f.jsx)(p.Z,{value:z,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Q("auth.input.password"),onChange:function onChange(e){return I(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&Y()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[A&&(0,f.jsx)(p.Z,{value:D,type:"text",autoFocus:!0,placeholder:Q("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.TL,onClick:function reset(){C("enter"),L(""),I(""),V(void 0)},children:(0,f.jsx)(p.Z,{value:Z,readOnly:!0,placeholder:Q("auth.input.email")})}),(0,f.jsx)(p.Z,{value:z,type:"password",id:"password",autoFocus:!0,placeholder:Q("auth.input.password"),onChange:function onChange(e){return I(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&Y()}}),(0,f.jsx)("div",{className:c.p4,style:{textAlign:"right"},onClick:q,children:Q("auth.button.forgotpassword")})]}),(0,f.jsx)(v.Z,{id:"submit",disabled:J,onClick:"enter"==k?W:Y,children:Q("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,j.jl)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.KH)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,x=(0,r.useState)(t),w=(0,i.Z)(x,2),j=w[0],m=w[1],y=(0,r.useState)(!1),C=(0,i.Z)(y,2),M=C[0],S=C[1],Z=(0,r.useState)(),L=(0,i.Z)(Z,2),b=L[0],N=L[1],z=(0,r.useState)(),I=(0,i.Z)(z,2),E=I[0],P=I[1],D=(0,g.$G)().t,O=function(){var e=(0,o.Z)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,P(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:j});case 5:P(!1),h.toggleLoading("SendPassword"),S(!0),N(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.GE("Error while sending password recovery mail",{cause:e.t0})),N("auth.error.resetpassword"),P(!1),h.toggleLoading("SendPassword");case 17:case"end":return e.stop()}}),_callee,null,[[0,11]])})));return function resetPassword(){return e.apply(this,arguments)}}();return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:D("auth.title.resetpassword")}),(0,f.jsx)("p",{children:D("auth.info.resetdescription")}),!!b&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:D(b)})]}),M&&(0,f.jsxs)("div",{className:c.Vp,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:D("auth.info.resetpassword")})]}),!M&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.Z,{value:j,autoFocus:!0,placeholder:D("auth.input.email"),onChange:function onChange(e){return m(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(v.Z,{disabled:0==j.length,onClick:O,children:D("auth.button.resetpassword")})]}),M&&(0,f.jsx)(v.Z,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:D("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.$G)().t;return(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),"INVALID"==t&&(0,f.jsx)("div",{children:r("auth.error.verifypassword")}),"SERVER"==t&&(0,f.jsx)("div",{children:n})]})}var C=(0,j.jl)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.KH)(),u=s.configurationStore,h=s.authorizationStore,x=s.apiHandler,w=(s.loadingAndErrorStore,(0,r.useState)("")),j=(0,i.Z)(w,2),m=j[0],y=j[1],k=(0,r.useState)(""),M=(0,i.Z)(k,2),S=M[0],Z=M[1],L=(0,r.useState)(!1),b=(0,i.Z)(L,2),N=b[0],z=b[1],I=(0,r.useState)(),E=(0,i.Z)(I,2),P=E[0],D=E[1],O=(0,r.useState)(""),F=(0,i.Z)(O,2),R=F[0],A=F[1],T=(0,r.useRef)(null),_=(0,g.$G)().t;(0,r.useEffect)((function(){m===S&&D(void 0)}),[m,S]);var U=function(){var e=(0,o.Z)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(A(_("auth.error.verifypasswordserver")),!(m.length<8||m!==S)){e.next=4;break}return D("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,x.resetPassword({password:m,token:n});case 7:z(!0),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),$(e.t0);case 13:case"end":return e.stop()}}),_callee,null,[[4,10]])})));return function resetPassword(){return e.apply(this,arguments)}}(),$=function handleError(e){if(e instanceof d.GE){if("AUTH_0003"===e.name)A(_("auth.error.verifypasswordtokenerror",{errormsg:_("auth.error.tokenexpired")}));else A(_("auth.error.verifypasswordserver",e.message));C.error(e)}C.error(new d.GE("Error while resetting password",{cause:e})),D("SERVER")};return"SERVER"===P?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:P,authErrorsg:R}),(0,f.jsx)(v.Z,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:_("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:_("auth.title.verifypassword")}),N&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.Vp,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:_("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(v.Z,{onClick:function goToLogin(){h.close(),h.showLogin()},children:_("auth.button.login")})]}),!N&&(0,f.jsxs)(f.Fragment,{children:[P&&(0,f.jsx)(Errormessage,{hasError:P,authErrorsg:R}),(0,f.jsxs)("form",{children:[(0,f.jsx)(p.Z,{value:m,autoFocus:!0,placeholder:_("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return y(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=T.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(p.Z,{ref:T,value:S,placeholder:_("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return Z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(v.Z,{disabled:!m||!S,onClick:U,children:_("auth.button.save")})]})]})}var M=n(5486);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=e.invitationOrgId,u=(0,a.KH)(),d=u.authorizationStore,h=u.authorizationHandler,p=(0,r.useState)(""),x=(0,i.Z)(p,2),w=x[0],j=x[1],m=(0,g.$G)().t,y=function(){var e=(0,o.Z)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showLogin(void 0,void 0,s,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),k=function(){var e=(0,o.Z)(l().mark((function _callee2(){var e;return l().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,checkInvitation();case 2:(e=t.sent)&&(d.close(),d.showRegister(n,e));case 4:case"end":return t.stop()}}),_callee2)})));return function toRegister(){return e.apply(this,arguments)}}();function checkInvitation(){return _checkInvitation.apply(this,arguments)}function _checkInvitation(){return _checkInvitation=(0,o.Z)(l().mark((function _callee3(){var e,t,n;return l().wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return t=null===(e=d.state)||void 0===e?void 0:e.invitationId,r.next=3,h.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return j("Invitation not found"),r.abrupt("return",void 0);case 10:case"end":return r.stop()}}),_callee3)}))),_checkInvitation.apply(this,arguments)}return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:m("auth.title.welcome")}),(0,f.jsx)("p",{children:m("auth.info.welcomedescription")}),w&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:m(w)})]}),t&&!w&&(0,f.jsx)(v.Z,{onClick:k,children:m("auth.title.register")}),!t&&!w&&(0,f.jsx)(v.Z,{onClick:y,children:m("auth.button.login")})]})}var S=n(217),Z=n(7726),L=n(4062),b=n(9074),N=n(1522),z=n(4039),I=n(7843),E=n(8815),P=n(5739),D=n(883),O=n(3966),F=n(431);function getSwitchBaseUtilityClass(e){return(0,F.ZP)("PrivateSwitchBase",e)}(0,O.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const R=(0,I.ZP)(D.Z)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),A=(0,I.ZP)("input",{shouldForwardProp:z.Z})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),T=r.forwardRef((function SwitchBase(e,t){const{autoFocus:n,checked:r,checkedIcon:a,className:o,defaultChecked:i,disabled:s,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:d,inputProps:h,inputRef:p,name:v,onBlur:g,onChange:x,onFocus:w,readOnly:j,required:m=!1,tabIndex:y,type:k,value:C,...M}=e,[S,b]=(0,E.Z)({controlled:r,default:Boolean(i),name:"SwitchBase",state:"checked"}),z=(0,P.Z)();let I=s;z&&void 0===I&&(I=z.disabled);const D="checkbox"===k||"radio"===k,O={...e,checked:S,disabled:I,disableFocusRipple:l,edge:c},F=(e=>{const{classes:t,checked:n,disabled:r,edge:a}=e,o={root:["root",n&&"checked",r&&"disabled",a&&`edge${(0,N.Z)(a)}`],input:["input"]};return(0,L.Z)(o,getSwitchBaseUtilityClass,t)})(O);return(0,f.jsxs)(R,{component:"span",className:(0,Z.Z)(F.root,o),centerRipple:!0,focusRipple:!l,disabled:I,tabIndex:null,role:void 0,onFocus:e=>{w&&w(e),z&&z.onFocus&&z.onFocus(e)},onBlur:e=>{g&&g(e),z&&z.onBlur&&z.onBlur(e)},ownerState:O,ref:t,...M,children:[(0,f.jsx)(A,{autoFocus:n,checked:r,defaultChecked:i,className:F.input,disabled:I,id:D?d:void 0,name:v,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;b(t),x&&x(e,t)},readOnly:j,ref:p,required:m,ownerState:O,tabIndex:y,type:k,..."checkbox"===k&&void 0===C?{}:{value:C},...h}),S?a:u]})}));var _=n(6177);const U=(0,_.Z)((0,f.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),$=(0,_.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),B=(0,_.Z)((0,f.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(e){return(0,F.ZP)("MuiCheckbox",e)}const G=(0,O.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);var H=n(518),K=n(8981),V=n(2893);const Q=(0,I.ZP)(T,{shouldForwardProp:e=>(0,z.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${(0,N.Z)(n.size)}`],"default"!==n.color&&t[`color${(0,N.Z)(n.color)}`]]}})((0,H.Z)((({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter((0,K.Z)()).map((([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,b.Fq)(e.palette[t].main,e.palette.action.hoverOpacity)}}}))),...Object.entries(e.palette).filter((0,K.Z)()).map((([t])=>({props:{color:t},style:{[`&.${G.checked}, &.${G.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${G.disabled}`]:{color:(e.vars||e).palette.action.disabled}}}))),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})))),W=(0,f.jsx)($,{}),Y=(0,f.jsx)(U,{}),q=(0,f.jsx)(B,{}),J=r.forwardRef((function Checkbox(e,t){const n=(0,V.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:a=W,color:o="primary",icon:i=Y,indeterminate:s=!1,indeterminateIcon:l=q,inputProps:c,size:u="medium",disableRipple:d=!1,className:h,...p}=n,v=s?l:i,g=s?l:a,x={...n,disableRipple:d,color:o,indeterminate:s,size:u},w=(e=>{const{classes:t,indeterminate:n,color:r,size:a}=e,o={root:["root",n&&"indeterminate",`color${(0,N.Z)(r)}`,`size${(0,N.Z)(a)}`]},i=(0,L.Z)(o,getCheckboxUtilityClass,t);return{...t,...i}})(x);return(0,f.jsx)(Q,{type:"checkbox",inputProps:{"data-indeterminate":s,...c},icon:r.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:r.cloneElement(g,{fontSize:g.props.fontSize??u}),ownerState:x,ref:t,className:(0,Z.Z)(w.root,h),disableRipple:d,...p,classes:w})}));var X=(0,j.jl)("Framework","Register");const ee=(0,u.Pi)((function Register(){var e,t,n,s,u,x,w=(0,a.KH)(),j=w.authorizationStore,m=w.configurationStore,y=(0,g.$G)().t,k=(0,r.useState)(null!==(e=null===(t=j.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),C=(0,i.Z)(k,2),M=C[0],Z=C[1],L=(0,r.useState)(""),b=(0,i.Z)(L,2),N=b[0],z=b[1],I=(0,r.useState)(""),E=(0,i.Z)(I,2),P=E[0],D=E[1],O=(0,r.useState)(""),F=(0,i.Z)(O,2),R=F[0],A=F[1],T=(0,r.useState)(""),_=(0,i.Z)(T,2),U=_[0],$=_[1],B=(0,r.useState)(""),G=(0,i.Z)(B,2),H=G[0],K=G[1],V=(0,r.useState)(""),Q=(0,i.Z)(V,2),W=Q[0],Y=Q[1],q=(0,r.useState)(!1),ee=(0,i.Z)(q,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.Z)(l().mark((function _callee(){var e;return l().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,h.fl)(j.register(M,N,U,R,null===(e=j.state)||void 0===e?void 0:e.invitationId,ae?W:void 0));case 3:Z(""),z(""),D(""),$(""),A(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),K("auth.error.invitationotp"),X.error(new d.GE("Error while registering",{cause:t.t0}));case 14:case"end":return t.stop()}}),_callee,null,[[0,10]])})));return function onRegister(){return e.apply(this,arguments)}}(),ae=null===(n=j.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=W&&""!==W&&N==P&&""!=N&&null!=N&&te:N==P&&""!=N&&null!=N&&te},ie=null===(s=j.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:y("auth.title.register")}),(0,f.jsx)("p",{children:y("auth.text.register","")}),!!H&&(0,f.jsxs)("div",{className:c.vU,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:y(H)})]}),(0,f.jsx)(OpenId,{}),((null==ie?void 0:ie.generic)||(null==ie?void 0:ie.google)||(null==ie?void 0:ie.microsoft))&&ie.standard&&(0,f.jsx)("div",{className:c.kr,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(p.Z,{type:"text",value:W,placeholder:y("auth.input.otp"),onChange:function onChange(e){return Y(e.target.value)}}),(0,f.jsx)(p.Z,{value:U,autoFocus:!0,placeholder:y("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(p.Z,{value:R,autoFocus:!0,placeholder:y("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return A(e.target.value)}}),(0,f.jsx)(p.Z,{value:M,autoComplete:"email",autoFocus:!0,placeholder:y("auth.input.email"),disabled:!0}),(0,f.jsx)(p.Z,{value:N,type:"password",autoFocus:!0,placeholder:y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)}}),(0,f.jsx)(p.Z,{value:P,type:"password",autoFocus:!0,placeholder:y("auth.input.repeatpassword"),onChange:function onChange(e){return D(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(J,{name:"checkAGB",checked:te,onClick:function onClick(){return ne(!te)}}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",fontSize:9},children:[(0,f.jsx)("span",{children:y("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=m.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:y("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(x=m.navigation.privacyUrl)&&void 0!==x?x:"https://www.diva-portal.de/datenschutz",children:y("auth.privacypolicy")})]})]})]}),(0,f.jsx)(S.Z,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:y("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(v.Z,{disabled:!oe(),onClick:oe()?re:void 0,children:y("auth.input.login")})]})]})}));var te=(0,u.Pi)((function(){var e,t=(0,a.KH)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(y,{});case"REQUEST_NEW_PASSWORD":return(0,f.jsx)(RequestNewPassword,{initEmail:t.state.email});case"CHANGE_PASSWORD":return(0,f.jsx)(ChangePassword,{token:t.state.token});case"WELCOME":return(0,f.jsx)(WelcomeScreen,{isNewUser:t.state.isNewUser,invitationId:t.state.invitationId,invitationOrgId:t.state.invitationOrgId});case"REGISTER":return(0,f.jsx)(ee,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const ne=(0,u.Pi)((function Auth(){var e,t,n,o=(0,a.KH)(),i=o.authorizationStore,s=o.configurationStore,l=o.dataStore,u=(o.authorizationHandler,(0,r.useMemo)((function(){var e,t,n,r="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgMTAwMCAyOTMuNjUiPjxwYXRoIGQ9Ik0yNTAuODksMTQ3LjNjLTMuMTgtNzQtMzAuNC0xNDMuMTgtMTQxLjczLTE0My4xOEwwLDQuMjZBMzA3Ljg2LDMwNy44NiwwLDAsMSwyNi4xMiw2MC43aDc0LjJjNTIuODYsMCw3NiwyNS42OCw3OC42MSw4NS4yOSwyLjY2LDYxLjgxLTE4LjI5LDg3LjkyLTcxLjE1LDg3LjkySDc5LjJsLTQ2LjcxLjUyYTI4Ny4yOSwyODcuMjksMCwwLDEtMjAsNTMuODhoMTA5YzExMS4zMiwwLDEzMi42Ny02NywxMjkuNDgtMTQxTTMwNi44NCwyODloNzEuMjNWMGEzMDAuMDcsMzAwLjA3LDAsMCwxLTcxLjIzLDI1LjkyWm0zMTguOC42Mkw3MjYuNTkuODVhMzAwLDMwMCwwLDAsMS04My42NSwzMi4yNEw1NzcuMTEsMjI0LDUxMS4yOSwzMy4wOUEzMDAsMzAwLDAsMCwxLDQyNy42NC44NWwxMDEsMjg4Ljc2Wm0zNzQuMzYsNEw4OTkuMDUsNC45MUg4MDJMNzc1LjE0LDgxLjc0LDcwMS4wNSwyOTMuNjVBMzAwLjMyLDMwMC4zMiwwLDAsMSw3ODUsMjYxLjM1bDYuNzktMjEsMTkuMTQtNTcuNTRMODUwLjUyLDYybDQwLjA3LDEyMC44NSwxOC43LDU3LjU0LDcsMjFBMzAwLjIsMzAwLjIsMCwwLDEsMTAwMCwyOTMuNjUiIGZpbGw9IiNiM2IzYjMiLz48L3N2Zz4=";if(null!==(e=l.organization)&&void 0!==e&&e.logoUrl)r=null===(n=l.organization)||void 0===n?void 0:n.logoUrl;else if(null!==(t=s.navigation)&&void 0!==t&&t.logoUrl){var a;r=null===(a=s.navigation)||void 0===a?void 0:a.logoUrl}return r}),[null===(e=s.navigation)||void 0===e?void 0:e.logoUrl,null===(t=l.organization)||void 0===t?void 0:t.logoUrl]));return null==i.state?(0,f.jsx)(f.Fragment,{}):(0,f.jsxs)("div",{className:c.I8,children:[(0,f.jsxs)("div",{className:c.NB,children:[(0,f.jsx)("div",{className:c.tn,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(te,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(M.p,{settings:{contentBoxProps:(0,h.ZN)(s.authentication.contentBox.props)}})})]})}))}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 617.diva-support.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[617],{5617:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ModalsWrapper});var o=t(7363),a=t(9420),l=t(4727),i=t(1578),r=t(5310),d=t(9400),s=t(4415),c=t(1824),m=t(9763),u=t(3379),p=t.n(u),h=t(7795),v=t.n(h),x=t(569),f=t.n(x),g=t(3565),y=t.n(g),b=t(9216),j=t.n(b),k=t(4589),w=t.n(k),Z=t(5297),P={};P.styleTagTransform=w(),P.setAttributes=y(),P.insert=f().bind(null,"head"),P.domAPI=v(),P.insertStyleElement=j();p()(Z.Z,P);Z.Z&&Z.Z.locals&&Z.Z.locals;var E=t(789),S=t(4988),C=t(5054),I={};I.styleTagTransform=w(),I.setAttributes=y(),I.insert=f().bind(null,"head"),I.domAPI=v(),I.insertStyleElement=j();p()(C.ZP,I);C.ZP&&C.ZP.locals&&C.ZP.locals;var F=t(7514);const D=(0,a.Pi)((function Progress(e){var n=e.children,t=e.progress,a=(0,o.useState)(),l=(0,S.Z)(a,2),i=l[0],r=l[1];return(0,o.useEffect)((function(){r(t)}),[t]),(0,F.jsxs)("div",{className:C.YS,children:[!!n&&n,(0,F.jsx)("div",{className:C.l9,children:(0,F.jsx)("div",{className:C.YJ,style:{width:100*(null!=i?i:0)+"%"},children:(0,F.jsx)("div",{className:C.zn})})})]})}));var z=t(3697),A=t(1682);const M=(0,a.Pi)((function Modal(){var e,n=(0,l.KH)().contentStore,t=(0,E.$G)().t,a=function onAccept(e){var t,o=n.modal;n.closeModal(),null==o||null===(t=o.callback)||void 0===t||t.call(o,!o.content||e)},u=function onReject(){var e,t=n.modal;n.closeModal(),null==t||null===(e=t.callback)||void 0===e||e.call(t,!1)},p=(0,o.useCallback)((function(e){n.modal&&"Escape"===e.key&&u()}),[]);(0,o.useEffect)((function(){return document.addEventListener("keydown",p,!1),function(){document.removeEventListener("keydown",p,!1)}}),[]),(0,o.useEffect)((function(){return document.addEventListener("keydown",h,!1),function(){document.removeEventListener("keydown",h,!1)}}),[]);var h=(0,o.useCallback)((function(e){if(n.modal)if("Enter"!==e.key||n.modal.doNotAcceptOnEnter)"ESC"!==e.key&&"Escape"!=e.key||(u(),e.preventDefault());else{var t=document.getElementById("diva-modal-form");if(!t)return;a(new FormData(t)),e.preventDefault()}}),[]);if(!n.modal)return(0,F.jsx)(F.Fragment,{});var v=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(s.Z,{style:n.modal.maxWidth?{maxWidth:n.modal.maxWidth}:void 0,children:n.modal.iFrame?(0,F.jsx)(IFrame,{link:n.modal.iFrame}):"string"==typeof n.modal.text&&null==n.modal.content?(0,F.jsx)(c.Z,{component:"div",dangerouslySetInnerHTML:{__html:function tryDecodeURIComponent(e){try{return decodeURIComponent(e)}catch(n){return e}}(n.modal.text)}}):(0,F.jsxs)(c.Z,{component:"div",children:[n.modal.text,n.modal.content&&n.modal.content]})}),(n.modal.reject||n.modal.accept)&&(0,F.jsxs)(d.Z,{children:[n.modal.reject&&(0,F.jsx)(i.Z,{color:"primary",onClick:u,children:"string"==typeof n.modal.reject?t(n.modal.reject):t("modal.reject")}),n.modal.accept&&(0,F.jsx)(i.Z,{color:"primary",type:"submit",id:"diva-dialog-submitbtn",children:"string"==typeof n.modal.accept?t(n.modal.accept):t("modal.accept")})]}),(0,F.jsxs)("div",{style:{margin:10},children:[n.modal.image&&(0,F.jsx)("img",{src:n.modal.image,style:{maxWidth:480}}),void 0!==n.modal.progress&&(0,F.jsx)(D,{progress:n.modal.progress}),null===(e=n.modal.actions)||void 0===e?void 0:e.map((function(e){var o;return(0,F.jsx)(i.Z,{fullWidth:!0,style:{marginBottom:10},variant:null!==(o=e.variant)&&void 0!==o?o:"contained",color:"primary",onClick:function onClick(){return function onSelect(e,t){var o,a=n.modal;0!=t&&n.closeModal(),null==a||null===(o=a.callback)||void 0===o||o.call(a,e)}(e.id,e.closeable)},children:t(e.text)})}))]})]}),x=!0===n.modal.fullscreen||"mobile"==n.modal.fullscreen&&n.containerDimensions.isMobile;return(0,F.jsx)("div",{className:Z.I,id:"diva-dialog",children:(0,F.jsxs)(r.Z,{open:!0,disablePortal:!0,hideBackdrop:!0,disableEnforceFocus:!0,style:{position:"absolute",zIndex:0},maxWidth:"lg",fullScreen:x,PaperProps:{style:{width:n.modal.width,height:n.modal.height}},children:[(0,F.jsx)(m.Z,{children:n.modal.title}),n.modal.rejectByIcon&&(0,F.jsx)(z.Z,{onClick:u,style:{position:"absolute",right:8,top:8,zIndex:1000001},size:"large",children:(0,F.jsx)(A.Z,{})}),n.modal.dontRenderForm&&v,!n.modal.dontRenderForm&&(0,F.jsx)("form",{id:"diva-modal-form",autoComplete:"off",onSubmit:function onSubmit(e){e.preventDefault(),a(new FormData(e.target))},children:v})]})})}));function IFrame(e){var n=e.link;return(0,F.jsx)("iframe",{style:{border:0,width:"100%",height:"99%"},src:n})}function ModalsWrapper(){return(0,F.jsx)(M,{})}},5297:(e,n,t)=>{t.d(n,{I:()=>r,Z:()=>d});var o=t(8081),a=t.n(o),l=t(3645),i=t.n(l)()(a());i.push([e.id,".index-module--AtOcs {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: rgba(255, 255, 255, 0.6);\n z-index: 1001;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n",""]);var r="index-module--AtOcs";const d=i},5054:(e,n,t)=>{t.d(n,{YJ:()=>s,YS:()=>r,ZP:()=>m,l9:()=>d,zn:()=>c});var o=t(8081),a=t.n(o),l=t(3645),i=t.n(l)()(a());i.push([e.id,".index-module--Pww9z {\n display: flex;\n width: 100%;\n}\n\n.index-module--thPSh {\n height: 10px;\n position: relative;\n border-radius: 5px;\n width: 100%;\n}\n\n@keyframes index-module--_9_PO {\n from {\n background-position-x: 0;\n }\n to {\n background-position-x: 113px;\n }\n}\n\n.index-module--HhvXv {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n transition: width 0.4s ease-out;\n overflow: hidden;\n border-radius: 5px;\n}\n.index-module--f7imw {\n border-radius: 5px;\n height: 100%;\n background-color: var(--diva-theme-palette-primary-main);\n background-image: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 10px,\n var(--diva-theme-palette-secondary-dark) 10px,\n var(--diva-theme-palette-secondary-dark) 20px\n );\n animation: index-module--_9_PO 4s linear infinite;\n will-change: background-position;\n}\n",""]);var r="index-module--Pww9z",d="index-module--thPSh",s="index-module--HhvXv",c="index-module--f7imw";const m=i}}]);
2
+ "use strict";(self.webpackChunkCrystaldesignDivaSupport=self.webpackChunkCrystaldesignDivaSupport||[]).push([[617],{5617:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ModalsWrapper});var o=t(7363),a=t(9420),l=t(4727),i=t(1578),r=t(5310),d=t(9400),s=t(4415),c=t(1824),m=t(9763),u=t(3379),p=t.n(u),h=t(7795),v=t.n(h),f=t(569),x=t.n(f),g=t(3565),y=t.n(g),b=t(9216),j=t.n(b),k=t(4589),w=t.n(k),Z=t(5297),P={};P.styleTagTransform=w(),P.setAttributes=y(),P.insert=x().bind(null,"head"),P.domAPI=v(),P.insertStyleElement=j();p()(Z.Z,P);Z.Z&&Z.Z.locals&&Z.Z.locals;var E=t(789),S=t(4988),C=t(5054),I={};I.styleTagTransform=w(),I.setAttributes=y(),I.insert=x().bind(null,"head"),I.domAPI=v(),I.insertStyleElement=j();p()(C.ZP,I);C.ZP&&C.ZP.locals&&C.ZP.locals;var F=t(7514);const D=(0,a.Pi)((function Progress(e){var n=e.children,t=e.progress,a=(0,o.useState)(),l=(0,S.Z)(a,2),i=l[0],r=l[1];return(0,o.useEffect)((function(){r(t)}),[t]),(0,F.jsxs)("div",{className:C.YS,children:[!!n&&n,(0,F.jsx)("div",{className:C.l9,children:(0,F.jsx)("div",{className:C.YJ,style:{width:100*(null!=i?i:0)+"%"},children:(0,F.jsx)("div",{className:C.zn})})})]})}));var z=t(3697),A=t(1682);const M=(0,a.Pi)((function Modal(){var e,n=(0,l.KH)().contentStore,t=(0,E.$G)().t,a=function onAccept(e){var t,o=n.modal;n.closeModal(),null==o||null===(t=o.callback)||void 0===t||t.call(o,!o.content||e)},u=function onReject(){var e,t=n.modal;n.closeModal(),null==t||null===(e=t.callback)||void 0===e||e.call(t,!1)},p=(0,o.useCallback)((function(e){n.modal&&"Escape"===e.key&&u()}),[]);(0,o.useEffect)((function(){return document.addEventListener("keydown",p,!1),function(){document.removeEventListener("keydown",p,!1)}}),[]),(0,o.useEffect)((function(){return document.addEventListener("keydown",h,!1),function(){document.removeEventListener("keydown",h,!1)}}),[]);var h=(0,o.useCallback)((function(e){if(n.modal)if("Enter"!==e.key||n.modal.doNotAcceptOnEnter)"ESC"!==e.key&&"Escape"!=e.key||(u(),e.preventDefault());else{var t=document.getElementById("diva-modal-form");if(!t)return;a(new FormData(t)),e.preventDefault()}}),[]);if(!n.modal)return(0,F.jsx)(F.Fragment,{});var v="string"==typeof n.modal.text?t(n.modal.text):n.modal.text,f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(s.Z,{style:n.modal.maxWidth?{maxWidth:n.modal.maxWidth}:void 0,children:n.modal.iFrame?(0,F.jsx)(IFrame,{link:n.modal.iFrame}):"string"==typeof v&&null==n.modal.content?(0,F.jsx)(c.Z,{component:"div",dangerouslySetInnerHTML:{__html:function tryDecodeURIComponent(e){try{return decodeURIComponent(e)}catch(n){return e}}(v)}}):(0,F.jsxs)(c.Z,{component:"div",children:[v,n.modal.content&&n.modal.content]})}),(n.modal.reject||n.modal.accept)&&(0,F.jsxs)(d.Z,{children:[n.modal.reject&&(0,F.jsx)(i.Z,{color:"primary",onClick:u,children:"string"==typeof n.modal.reject?t(n.modal.reject):t("modal.reject")}),n.modal.accept&&(0,F.jsx)(i.Z,{color:"primary",type:"submit",id:"diva-dialog-submitbtn",children:"string"==typeof n.modal.accept?t(n.modal.accept):t("modal.accept")})]}),(0,F.jsxs)("div",{style:{margin:10},children:[n.modal.image&&(0,F.jsx)("img",{src:n.modal.image,style:{maxWidth:480}}),void 0!==n.modal.progress&&(0,F.jsx)(D,{progress:n.modal.progress}),null===(e=n.modal.actions)||void 0===e?void 0:e.map((function(e){var o;return(0,F.jsx)(i.Z,{fullWidth:!0,style:{marginBottom:10},variant:null!==(o=e.variant)&&void 0!==o?o:"contained",color:"primary",onClick:function onClick(){return function onSelect(e,t){var o,a=n.modal;0!=t&&n.closeModal(),null==a||null===(o=a.callback)||void 0===o||o.call(a,e)}(e.id,e.closeable)},children:t(e.text)})}))]})]}),x=!0===n.modal.fullscreen||"mobile"==n.modal.fullscreen&&n.containerDimensions.isMobile;return(0,F.jsx)("div",{className:Z.I,id:"diva-dialog",children:(0,F.jsxs)(r.Z,{open:!0,disablePortal:!0,hideBackdrop:!0,disableEnforceFocus:!0,style:{position:"absolute",zIndex:0},maxWidth:"lg",fullScreen:x,PaperProps:{style:{width:n.modal.width,height:n.modal.height}},children:[(0,F.jsx)(m.Z,{children:"string"==typeof n.modal.title?t(n.modal.title):n.modal.title}),n.modal.rejectByIcon&&(0,F.jsx)(z.Z,{onClick:u,style:{position:"absolute",right:8,top:8,zIndex:1000001},size:"large",children:(0,F.jsx)(A.Z,{})}),n.modal.dontRenderForm&&f,!n.modal.dontRenderForm&&(0,F.jsx)("form",{id:"diva-modal-form",autoComplete:"off",onSubmit:function onSubmit(e){e.preventDefault(),a(new FormData(e.target))},children:f})]})})}));function IFrame(e){var n=e.link;return(0,F.jsx)("iframe",{style:{border:0,width:"100%",height:"99%"},src:n})}function ModalsWrapper(){return(0,F.jsx)(M,{})}},5297:(e,n,t)=>{t.d(n,{I:()=>r,Z:()=>d});var o=t(8081),a=t.n(o),l=t(3645),i=t.n(l)()(a());i.push([e.id,".index-module--AtOcs {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: rgba(255, 255, 255, 0.6);\n z-index: 1001;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n",""]);var r="index-module--AtOcs";const d=i},5054:(e,n,t)=>{t.d(n,{YJ:()=>s,YS:()=>r,ZP:()=>m,l9:()=>d,zn:()=>c});var o=t(8081),a=t.n(o),l=t(3645),i=t.n(l)()(a());i.push([e.id,".index-module--Pww9z {\n display: flex;\n width: 100%;\n}\n\n.index-module--thPSh {\n height: 10px;\n position: relative;\n border-radius: 5px;\n width: 100%;\n}\n\n@keyframes index-module--_9_PO {\n from {\n background-position-x: 0;\n }\n to {\n background-position-x: 113px;\n }\n}\n\n.index-module--HhvXv {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n transition: width 0.4s ease-out;\n overflow: hidden;\n border-radius: 5px;\n}\n.index-module--f7imw {\n border-radius: 5px;\n height: 100%;\n background-color: var(--diva-theme-palette-primary-main);\n background-image: repeating-linear-gradient(\n 45deg,\n transparent,\n transparent 10px,\n var(--diva-theme-palette-secondary-dark) 10px,\n var(--diva-theme-palette-secondary-dark) 20px\n );\n animation: index-module--_9_PO 4s linear infinite;\n will-change: background-position;\n}\n",""]);var r="index-module--Pww9z",d="index-module--thPSh",s="index-module--HhvXv",c="index-module--f7imw";const m=i}}]);