@crystaldesign/diva-core 24.9.0-beta.2 → 24.9.0-beta.4

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,4 +1,4 @@
1
- import { i as styleInject, u as useDivaCoreContext } from './index-2951cf75.js';
1
+ import { i as styleInject, u as useDivaCoreContext } from './index-a1b47249.js';
2
2
  import { useState, useEffect, useCallback } from 'react';
3
3
  import { observer } from 'mobx-react-lite';
4
4
  import Button from '@material-ui/core/Button';
@@ -41,7 +41,7 @@ import HelpOutline from '@material-ui/icons/HelpOutline';
41
41
  import * as Styles from '@material-ui/styles';
42
42
 
43
43
  (function() {
44
- const env = {"STAGE":"production","VERSION":"24.9.0-beta.2"};
44
+ const env = {"STAGE":"production","VERSION":"24.9.0-beta.4"};
45
45
  try {
46
46
  if (process) {
47
47
  process.env = Object.assign({}, process.env);
@@ -9135,7 +9135,7 @@ var SideMenu$1 = observer(SideMenu);
9135
9135
  function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9136
9136
  function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9137
9137
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
9138
- return import('./ModalsWrapper-d5f3ebea.js');
9138
+ return import('./ModalsWrapper-1ea962a5.js');
9139
9139
  });
9140
9140
  function Fullscreen() {
9141
9141
  var _useDivaCoreContext = useDivaCoreContext(),
@@ -9540,10 +9540,10 @@ function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
9540
9540
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9541
9541
  var LOG$4 = getLogger('Framework', 'Root');
9542
9542
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
9543
- return import('./index-d2c81991.js');
9543
+ return import('./index-d3fafad8.js');
9544
9544
  });
9545
9545
  var LazyModals = /*#__PURE__*/React.lazy(function () {
9546
- return import('./ModalsWrapper-d5f3ebea.js');
9546
+ return import('./ModalsWrapper-1ea962a5.js');
9547
9547
  });
9548
9548
  function Content() {
9549
9549
  var context = useDivaCoreContext();
@@ -1,4 +1,4 @@
1
- import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, a as getLogger, e as error, b as separator, I as Input, r as resetInput, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-2951cf75.js';
1
+ import { u as useDivaCoreContext, B as Button, s as socialButton, g as google, m as microsoft, a as getLogger, e as error, b as separator, I as Input, r as resetInput, l as link, c as success, d as auth, f as loginBox, h as logoContainer } from './index-a1b47249.js';
2
2
  import { useState, useRef, useEffect, useMemo } from 'react';
3
3
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
4
4
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
@@ -1,4 +1,4 @@
1
- export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, j as useDivaCore } from './index-2951cf75.js';
1
+ export { k as AnalyticsHandler, A as AuthorizationHandler, o as ClientArticleHandler, C as Content, H as HelpButton, O as ONE_DAY_UNIX, n as OrganizationHandler, P as ProductHandler, R as RequestStatus, S as SupportHandler, D as default, a as getLogger, j as useDivaCore } from './index-a1b47249.js';
2
2
  export { DivaError, default as DivaUtils } from '@crystaldesign/diva-utils';
3
3
  export { Trans, useTranslation } from 'react-i18next';
4
4
  export * from '@crystaldesign/basket-model';
@@ -1 +1 @@
1
- {"version":3,"file":"LoadingAndErrorStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/LoadingAndErrorStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,SAAS,MAAM,aAAa,CAAC;AAIpC,MAAM,CAAC,OAAO;IAOA,OAAO,CAAC,IAAI;IANxB,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,YAAY,CAAC,CAAqB;IAC1C,OAAO,CAAC,OAAO,CAAC,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAAC,CAAqB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAO;gBAEA,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM;IAwB1D,OAAO,CAAC,eAAe;IAKvB,IAAI,YAAY;;;MAKf;IAED,IAAI,SAAS,YAEZ;IAED,IAAI,KAAK,uBAER;IAED,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS;IAgCnC,IAAI,WAAW,8BAEd;IAED,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO;CAS7D"}
1
+ {"version":3,"file":"LoadingAndErrorStore.d.ts","sourceRoot":"","sources":["../../../../../src/store/LoadingAndErrorStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,SAAS,MAAM,aAAa,CAAC;AAKpC,MAAM,CAAC,OAAO;IAOA,OAAO,CAAC,IAAI;IANxB,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,YAAY,CAAC,CAAqB;IAC1C,OAAO,CAAC,OAAO,CAAC,CAAqB;IACrC,OAAO,CAAC,QAAQ,CAAC,CAAqB;IACtC,OAAO,CAAC,IAAI,CAAC,CAAO;gBAEA,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,EAAE,MAAM;IAwB1D,OAAO,CAAC,eAAe;IAKvB,IAAI,YAAY;;;MAKf;IAED,IAAI,SAAS,YAEZ;IAED,IAAI,KAAK,uBAER;IAED,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS;IAgCnC,IAAI,WAAW,8BAEd;IAED,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO;CAS7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/ApplicationLogger/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,OAAkB,EAAE,WAAW,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAoBnG,qBAAa,iBAAiB;IAGhB,OAAO,CAAC,MAAM;IAAe,OAAO,CAAC,SAAS;IAAU,OAAO,CAAC,cAAc;IAF1F,OAAO,CAAC,YAAY,CAAkC;gBAElC,MAAM,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,EAAU,cAAc,GAAE,OAAe;IAC3G;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EACf,KAAK,EACL,OAAO,EACP,MAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE;YAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;QAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAoBD;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAO;IA8BjG;;;;;SAKK;IACL,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAO,EAAE,OAAO,CAAC,EAAE,OAAO;IAoCjJ;;;;;;OAMG;IACH,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE;IAIrI,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,KAAK;IAYL;;OAEG;IACH,aAAa;IAWb,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK/C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK9C,KAAK,CAAC,KAAK,EAAE,SAAS;IAetB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,2BAA2B;IAKnC,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;CAQpB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,QAEhF;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAS/D;AAID,wBAAgB,YAAY,SAE3B;AACD,wBAAgB,eAAe,SAG9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/utils/ApplicationLogger/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,OAAkB,EAAE,WAAW,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAqBnG,qBAAa,iBAAiB;IAGhB,OAAO,CAAC,MAAM;IAAe,OAAO,CAAC,SAAS;IAAU,OAAO,CAAC,cAAc;IAF1F,OAAO,CAAC,YAAY,CAAkC;gBAElC,MAAM,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,EAAU,cAAc,GAAE,OAAe;IAC3G;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EACf,KAAK,EACL,OAAO,EACP,MAAW,EACX,OAAO,EACP,WAAW,EACX,SAAS,GACV,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE;YAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;SAAE,CAAC;QAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAoBD;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAO;IA8BjG;;;;;SAKK;IACL,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAO,EAAE,OAAO,CAAC,EAAE,OAAO;IAoCjJ;;;;;;OAMG;IACH,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE;IAIrI,OAAO,CAAC,iBAAiB;IAUzB;;OAEG;IACH,KAAK;IAYL;;OAEG;IACH,aAAa;IAWb,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK/C,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE;IAK9C,KAAK,CAAC,KAAK,EAAE,SAAS;IAetB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,2BAA2B;IAKnC,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;CAQpB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,QAEhF;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAS/D;AAID,wBAAgB,YAAY,SAE3B;AACD,wBAAgB,eAAe,SAG9B"}
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 397.diva-core.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[397],{7397:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ModalsWrapper});var o=t(1594),a=t(970),l=t(6926),i=t(696),d=t(4487),r=t(8126),s=t(1742),c=t(9897),m=t(5214),u=t(5835),p=t.n(u),x=t(9120),h=t.n(x),v=t(1148),f=t.n(v),g=t(3035),y=t.n(g),b=t(4959),k=t.n(b),j=t(5004),A=t.n(j),w=t(5247),E={};E.styleTagTransform=A(),E.setAttributes=y(),E.insert=f().bind(null,"head"),E.domAPI=h(),E.insertStyleElement=k();p()(w.A,E);w.A&&w.A.locals&&w.A.locals;var C=t(9681),F=t(8742),I=t(9433),N={};N.styleTagTransform=A(),N.setAttributes=y(),N.insert=f().bind(null,"head"),N.domAPI=h(),N.insertStyleElement=k();p()(I.Ay,N);I.Ay&&I.Ay.locals&&I.Ay.locals;var P=t(2246);const S=(0,a.PA)((function Progress(e){var n=e.children,t=e.progress,a=(0,o.useState)(),l=(0,F.A)(a,2),i=l[0],d=l[1];return(0,o.useEffect)((function(){d(t)}),[t]),(0,P.jsxs)("div",{className:I.iE,children:[!!n&&n,(0,P.jsx)("div",{className:I.Ux,children:(0,P.jsx)("div",{className:I.JW,style:{width:100*(null!=i?i:0)+"%"},children:(0,P.jsx)("div",{className:I.si})})})]})}));var W=t(9874),D=t(9824);const B=(0,a.PA)((function Modal(){var e,n=(0,l.IB)().contentStore,t=(0,C.B)().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",x,!1),function(){document.removeEventListener("keydown",x,!1)}}),[]);var x=(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,P.jsx)(P.Fragment,{});var h=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s.A,{style:n.modal.maxWidth?{maxWidth:n.modal.maxWidth}:void 0,children:n.modal.iFrame?(0,P.jsx)(IFrame,{link:n.modal.iFrame}):"string"==typeof n.modal.text&&null==n.modal.content?(0,P.jsx)(c.A,{component:"div",dangerouslySetInnerHTML:{__html:function tryDecodeURIComponent(e){try{return decodeURIComponent(e)}catch(n){return e}}(n.modal.text)}}):(0,P.jsxs)(c.A,{component:"div",children:[n.modal.text,n.modal.content&&n.modal.content]})}),(n.modal.reject||n.modal.accept)&&(0,P.jsxs)(r.A,{children:[n.modal.reject&&(0,P.jsx)(i.A,{color:"primary",onClick:u,children:"string"==typeof n.modal.reject?t(n.modal.reject):t("modal.reject")}),n.modal.accept&&(0,P.jsx)(i.A,{color:"primary",type:"submit",id:"diva-dialog-submitbtn",children:"string"==typeof n.modal.accept?t(n.modal.accept):t("modal.accept")})]}),(0,P.jsxs)("div",{style:{margin:10},children:[n.modal.image&&(0,P.jsx)("img",{src:n.modal.image,style:{maxWidth:480}}),void 0!==n.modal.progress&&(0,P.jsx)(S,{progress:n.modal.progress}),null===(e=n.modal.actions)||void 0===e?void 0:e.map((function(e){var o;return(0,P.jsx)(i.A,{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)})}))]})]}),v=!0===n.modal.fullscreen||"mobile"==n.modal.fullscreen&&n.containerDimensions.isMobile;return(0,P.jsx)("div",{className:w.L,id:"diva-dialog",children:(0,P.jsxs)(d.A,{open:!0,disablePortal:!0,hideBackdrop:!0,disableEnforceFocus:!0,style:{position:"absolute",zIndex:0},maxWidth:"lg",fullScreen:v,PaperProps:{style:{width:n.modal.width,height:n.modal.height}},children:[(0,P.jsx)(m.A,{children:n.modal.title}),n.modal.rejectByIcon&&(0,P.jsx)(W.A,{onClick:u,style:{position:"absolute",right:8,top:8,zIndex:1000001},children:(0,P.jsx)(D.A,{})}),n.modal.dontRenderForm&&h,!n.modal.dontRenderForm&&(0,P.jsx)("form",{id:"diva-modal-form",autoComplete:"off",onSubmit:function onSubmit(e){e.preventDefault(),a(new FormData(e.target))},children:h})]})})}));function IFrame(e){var n=e.link;return(0,P.jsx)("iframe",{style:{border:0,width:"100%",height:"99%"},src:n})}function ModalsWrapper(){return(0,P.jsx)(B,{})}},5247:(e,n,t)=>{t.d(n,{A:()=>r,L:()=>d});var o=t(8634),a=t.n(o),l=t(2083),i=t.n(l)()(a());i.push([e.id,".index-module--FNUcb {\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 d="index-module--FNUcb";const r=i},9433:(e,n,t)=>{t.d(n,{Ay:()=>m,JW:()=>s,Ux:()=>r,iE:()=>d,si:()=>c});var o=t(8634),a=t.n(o),l=t(2083),i=t.n(l)()(a());i.push([e.id,".index-module--g6NeA {\n display: flex;\n width: 100%;\n}\n\n.index-module--kevPi {\n height: 10px;\n position: relative;\n border-radius: 5px;\n width: 100%;\n}\n\n@keyframes index-module--ButXs {\n from {\n background-position-x: 0;\n }\n to {\n background-position-x: 113px;\n }\n}\n\n.index-module--a3VsQ {\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--fTtUx {\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--ButXs 4s linear infinite;\n will-change: background-position;\n}\n",""]);var d="index-module--g6NeA",r="index-module--kevPi",s="index-module--a3VsQ",c="index-module--fTtUx";const m=i}}]);
2
+ "use strict";(self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[397],{7397:(e,n,t)=>{t.r(n),t.d(n,{default:()=>ModalsWrapper});var o=t(1594),a=t(970),l=t(8180),i=t(696),d=t(4487),r=t(8126),s=t(1742),c=t(9897),m=t(5214),u=t(5835),p=t.n(u),x=t(9120),h=t.n(x),v=t(1148),f=t.n(v),g=t(3035),y=t.n(g),b=t(4959),k=t.n(b),j=t(5004),A=t.n(j),w=t(5247),E={};E.styleTagTransform=A(),E.setAttributes=y(),E.insert=f().bind(null,"head"),E.domAPI=h(),E.insertStyleElement=k();p()(w.A,E);w.A&&w.A.locals&&w.A.locals;var C=t(9681),F=t(8742),I=t(9433),N={};N.styleTagTransform=A(),N.setAttributes=y(),N.insert=f().bind(null,"head"),N.domAPI=h(),N.insertStyleElement=k();p()(I.Ay,N);I.Ay&&I.Ay.locals&&I.Ay.locals;var P=t(2246);const S=(0,a.PA)((function Progress(e){var n=e.children,t=e.progress,a=(0,o.useState)(),l=(0,F.A)(a,2),i=l[0],d=l[1];return(0,o.useEffect)((function(){d(t)}),[t]),(0,P.jsxs)("div",{className:I.iE,children:[!!n&&n,(0,P.jsx)("div",{className:I.Ux,children:(0,P.jsx)("div",{className:I.JW,style:{width:100*(null!=i?i:0)+"%"},children:(0,P.jsx)("div",{className:I.si})})})]})}));var W=t(9874),D=t(9824);const B=(0,a.PA)((function Modal(){var e,n=(0,l.IB)().contentStore,t=(0,C.B)().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",x,!1),function(){document.removeEventListener("keydown",x,!1)}}),[]);var x=(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,P.jsx)(P.Fragment,{});var h=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s.A,{style:n.modal.maxWidth?{maxWidth:n.modal.maxWidth}:void 0,children:n.modal.iFrame?(0,P.jsx)(IFrame,{link:n.modal.iFrame}):"string"==typeof n.modal.text&&null==n.modal.content?(0,P.jsx)(c.A,{component:"div",dangerouslySetInnerHTML:{__html:function tryDecodeURIComponent(e){try{return decodeURIComponent(e)}catch(n){return e}}(n.modal.text)}}):(0,P.jsxs)(c.A,{component:"div",children:[n.modal.text,n.modal.content&&n.modal.content]})}),(n.modal.reject||n.modal.accept)&&(0,P.jsxs)(r.A,{children:[n.modal.reject&&(0,P.jsx)(i.A,{color:"primary",onClick:u,children:"string"==typeof n.modal.reject?t(n.modal.reject):t("modal.reject")}),n.modal.accept&&(0,P.jsx)(i.A,{color:"primary",type:"submit",id:"diva-dialog-submitbtn",children:"string"==typeof n.modal.accept?t(n.modal.accept):t("modal.accept")})]}),(0,P.jsxs)("div",{style:{margin:10},children:[n.modal.image&&(0,P.jsx)("img",{src:n.modal.image,style:{maxWidth:480}}),void 0!==n.modal.progress&&(0,P.jsx)(S,{progress:n.modal.progress}),null===(e=n.modal.actions)||void 0===e?void 0:e.map((function(e){var o;return(0,P.jsx)(i.A,{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)})}))]})]}),v=!0===n.modal.fullscreen||"mobile"==n.modal.fullscreen&&n.containerDimensions.isMobile;return(0,P.jsx)("div",{className:w.L,id:"diva-dialog",children:(0,P.jsxs)(d.A,{open:!0,disablePortal:!0,hideBackdrop:!0,disableEnforceFocus:!0,style:{position:"absolute",zIndex:0},maxWidth:"lg",fullScreen:v,PaperProps:{style:{width:n.modal.width,height:n.modal.height}},children:[(0,P.jsx)(m.A,{children:n.modal.title}),n.modal.rejectByIcon&&(0,P.jsx)(W.A,{onClick:u,style:{position:"absolute",right:8,top:8,zIndex:1000001},children:(0,P.jsx)(D.A,{})}),n.modal.dontRenderForm&&h,!n.modal.dontRenderForm&&(0,P.jsx)("form",{id:"diva-modal-form",autoComplete:"off",onSubmit:function onSubmit(e){e.preventDefault(),a(new FormData(e.target))},children:h})]})})}));function IFrame(e){var n=e.link;return(0,P.jsx)("iframe",{style:{border:0,width:"100%",height:"99%"},src:n})}function ModalsWrapper(){return(0,P.jsx)(B,{})}},5247:(e,n,t)=>{t.d(n,{A:()=>r,L:()=>d});var o=t(8634),a=t.n(o),l=t(2083),i=t.n(l)()(a());i.push([e.id,".index-module--FNUcb {\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 d="index-module--FNUcb";const r=i},9433:(e,n,t)=>{t.d(n,{Ay:()=>m,JW:()=>s,Ux:()=>r,iE:()=>d,si:()=>c});var o=t(8634),a=t.n(o),l=t(2083),i=t.n(l)()(a());i.push([e.id,".index-module--g6NeA {\n display: flex;\n width: 100%;\n}\n\n.index-module--kevPi {\n height: 10px;\n position: relative;\n border-radius: 5px;\n width: 100%;\n}\n\n@keyframes index-module--ButXs {\n from {\n background-position-x: 0;\n }\n to {\n background-position-x: 113px;\n }\n}\n\n.index-module--a3VsQ {\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--fTtUx {\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--ButXs 4s linear infinite;\n will-change: background-position;\n}\n",""]);var d="index-module--g6NeA",r="index-module--kevPi",s="index-module--a3VsQ",c="index-module--fTtUx";const m=i}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 89.diva-core.umd.min.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[89],{7089:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Z});var r=n(1594),a=n(6926),o=n(6557),i=n(8742),s=n(3106),l=n.n(s),c=n(5298),u=n(970),d=n(6666),h=n(7975),v=n(4020),p=n(1240),g=n(9681),x=n(2919),w=n.n(x),f=n(2246);function OpenId(){var e,t,n,r=(0,a.IB)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.B)().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)(p.A,{className:w()(c.Ob,c.q7),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)(p.A,{className:w()(c.Ob,c.l$),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)(p.A,{className:c.Ob,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 m=n(5051),j=(0,m.tZ)("Framework","Login");const A=(0,u.PA)((function Login(){var e,t,n,s,u=(0,a.IB)(),x=u.authorizationStore,w=u.authorizationHandler,m=(0,r.useState)("enter"),A=(0,i.A)(m,2),k=A[0],y=A[1],C=(0,r.useState)(null!==(e=null===(t=x.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),M=(0,i.A)(C,2),L=M[0],N=M[1],S=(0,r.useState)(""),I=(0,i.A)(S,2),b=I[0],z=I[1],E=(0,r.useState)(""),D=(0,i.A)(E,2),P=D[0],O=D[1],F=(0,r.useState)(!1),T=(0,i.A)(F,2),_=T[0],B=T[1],R=(0,r.useState)(x.state.invitationId),U=(0,i.A)(R,2),$=U[0],H=U[1],V=(0,r.useState)("LOGIN"==(null===(n=x.state)||void 0===n?void 0:n.type)?x.state.error:void 0),K=(0,i.A)(V,2),Q=K[0],W=K[1],Y=(0,g.B)().t,G=function(){var e=(0,o.A)(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",L);case 4:(e=n.sent)&&(e.isNewUser&&(x.close(),x.showRegister(void 0,L,!0)),H(!0),B(!0));case 6:return n.next=8,w.fetchLoginProvider({email:L});case 8:"standard"==(t=n.sent).provider?y("login"):x.openOAuthLogin(t.provider,x.state.organizationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),j.error(new d.p$("Error while fetching login provider",{cause:n.t0})),W("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.A)(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.gP)(x.login(L,b,!1,x.state.organizationId,x.state.invitationId,P));case 3:N(""),z(""),W(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),j.error(new d.p$("Error while logging in",{cause:e.t0})),W($?"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)}}(),Z=function(){var e=(0,o.A)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:x.showRequestNewPassword(L);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),X="enter"==k&&0==L.length||"enter"!=k&&0==b.length;_&&!X&&(X=0==P.length);var J=null===(s=x.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Y("auth.title.login")}),(0,f.jsx)("p",{children:Y("auth.text.login","")}),!!Q&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Y(Q)})]}),(0,f.jsx)(OpenId,{}),((null==J?void 0:J.generic)||(null==J?void 0:J.google)||(null==J?void 0:J.microsoft))&&J.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==J?void 0:J.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{id:"username",value:L,autoComplete:"username",autoFocus:!0,placeholder:Y("auth.input.email"),onChange:function onChange(e){return N(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&G()}}),(0,f.jsx)(v.A,{value:b,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[_&&(0,f.jsx)(v.A,{value:P,type:"text",autoFocus:!0,placeholder:Y("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.eK,onClick:function reset(){y("enter"),N(""),z(""),W(void 0)},children:(0,f.jsx)(v.A,{value:L,readOnly:!0,placeholder:Y("auth.input.email")})}),(0,f.jsx)(v.A,{value:b,type:"password",id:"password",autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}}),(0,f.jsx)("div",{className:c.nf,style:{textAlign:"right"},onClick:Z,children:Y("auth.button.forgotpassword")})]}),(0,f.jsx)(p.A,{id:"submit",disabled:X,onClick:"enter"==k?G:q,children:Y("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,m.tZ)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.IB)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,x=(0,r.useState)(t),w=(0,i.A)(x,2),m=w[0],j=w[1],A=(0,r.useState)(!1),y=(0,i.A)(A,2),C=y[0],M=y[1],L=(0,r.useState)(),N=(0,i.A)(L,2),S=N[0],I=N[1],b=(0,r.useState)(),z=(0,i.A)(b,2),E=z[0],D=z[1],P=(0,g.B)().t,O=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,D(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:m});case 5:D(!1),h.toggleLoading("SendPassword"),M(!0),I(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.p$("Error while sending password recovery mail",{cause:e.t0})),I("auth.error.resetpassword"),D(!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:P("auth.title.resetpassword")}),(0,f.jsx)("p",{children:P("auth.info.resetdescription")}),!!S&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P(S)})]}),C&&(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P("auth.info.resetpassword")})]}),!C&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(v.A,{value:m,autoFocus:!0,placeholder:P("auth.input.email"),onChange:function onChange(e){return j(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(p.A,{disabled:0==m.length,onClick:O,children:P("auth.button.resetpassword")})]}),C&&(0,f.jsx)(p.A,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:P("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.B)().t;return(0,f.jsxs)("div",{className:c.z3,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 y=(0,m.tZ)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.IB)(),u=s.configurationStore,h=s.authorizationStore,x=s.apiHandler,w=(s.loadingAndErrorStore,(0,r.useState)("")),m=(0,i.A)(w,2),j=m[0],A=m[1],k=(0,r.useState)(""),C=(0,i.A)(k,2),M=C[0],L=C[1],N=(0,r.useState)(!1),S=(0,i.A)(N,2),I=S[0],b=S[1],z=(0,r.useState)(),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),F=(0,i.A)(O,2),T=F[0],_=F[1],B=(0,r.useRef)(null),R=(0,g.B)().t;(0,r.useEffect)((function(){j===M&&P(void 0)}),[j,M]);var U=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(_(R("auth.error.verifypasswordserver")),!(j.length<8||j!==M)){e.next=4;break}return P("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,x.resetPassword({password:j,token:n});case 7:b(!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.p$){if("AUTH_0003"===e.name)_(R("auth.error.verifypasswordtokenerror",{errormsg:R("auth.error.tokenexpired")}));else _(R("auth.error.verifypasswordserver",e.message));y.error(e)}y.error(new d.p$("Error while resetting password",{cause:e})),P("SERVER")};return"SERVER"===D?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:T}),(0,f.jsx)(p.A,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:R("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:R("auth.title.verifypassword")}),I&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:R("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(p.A,{onClick:function goToLogin(){h.close(),h.showLogin()},children:R("auth.button.login")})]}),!I&&(0,f.jsxs)(f.Fragment,{children:[D&&(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:T}),(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{value:j,autoFocus:!0,placeholder:R("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return A(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=B.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(v.A,{ref:B,value:M,placeholder:R("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(p.A,{disabled:!j||!M,onClick:U,children:R("auth.button.save")})]})]})}var C=n(6261);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=(0,a.IB)(),u=s.authorizationStore,d=s.authorizationHandler,h=(0,r.useState)(""),v=(0,i.A)(h,2),x=v[0],w=v[1],m=(0,g.B)().t,j=function(){var e=(0,o.A)(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)&&(u.close(),u.showLogin(void 0,void 0,void 0,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),A=function(){var e=(0,o.A)(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)&&(u.close(),u.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.A)(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=u.state)||void 0===e?void 0:e.invitationId,r.next=3,d.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return w("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")}),x&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:m(x)})]}),t&&!x&&(0,f.jsx)(p.A,{onClick:A,children:m("auth.title.register")}),!t&&!x&&(0,f.jsx)(p.A,{onClick:j,children:m("auth.button.login")})]})}var M=n(1113),L=n(250),N=n(120),S=(n(3886),n(203)),I=n(4134),b=n(8686),z=r.createContext();const E=z;var D=n(6224),P=n(9874),O=r.forwardRef((function SwitchBase(e,t){var n=e.autoFocus,a=e.checked,o=e.checkedIcon,i=e.classes,s=e.className,l=e.defaultChecked,c=e.disabled,u=e.icon,d=e.id,h=e.inputProps,v=e.inputRef,p=e.name,g=e.onBlur,x=e.onChange,w=e.onFocus,f=e.readOnly,m=e.required,j=e.tabIndex,A=e.type,k=e.value,y=(0,N.A)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),C=(0,b.A)({controlled:a,default:Boolean(l),name:"SwitchBase",state:"checked"}),M=(0,I.A)(C,2),z=M[0],D=M[1],O=function useFormControl_useFormControl(){return r.useContext(E)}(),F=c;O&&void 0===F&&(F=O.disabled);var T="checkbox"===A||"radio"===A;return r.createElement(P.A,(0,L.A)({component:"span",className:(0,S.A)(i.root,s,z&&i.checked,F&&i.disabled),disabled:F,tabIndex:null,role:void 0,onFocus:function handleFocus(e){w&&w(e),O&&O.onFocus&&O.onFocus(e)},onBlur:function handleBlur(e){g&&g(e),O&&O.onBlur&&O.onBlur(e)},ref:t},y),r.createElement("input",(0,L.A)({autoFocus:n,checked:a,defaultChecked:l,className:i.input,disabled:F,id:T&&d,name:p,onChange:function handleInputChange(e){var t=e.target.checked;D(t),x&&x(e,t)},readOnly:f,ref:v,required:m,tabIndex:j,type:A,value:k},h)),z?o:u)}));const F=(0,D.A)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(O);var T=n(5261);const _=(0,T.A)(r.createElement("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"),B=(0,T.A)(r.createElement("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");var R=n(4287);const U=(0,T.A)(r.createElement("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");var $=n(433),H=r.createElement(B,null),V=r.createElement(_,null),K=r.createElement(U,null),Q=r.forwardRef((function Checkbox(e,t){var n=e.checkedIcon,a=void 0===n?H:n,o=e.classes,i=e.color,s=void 0===i?"secondary":i,l=e.icon,c=void 0===l?V:l,u=e.indeterminate,d=void 0!==u&&u,h=e.indeterminateIcon,v=void 0===h?K:h,p=e.inputProps,g=e.size,x=void 0===g?"medium":g,w=(0,N.A)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=d?v:c,m=d?v:a;return r.createElement(F,(0,L.A)({type:"checkbox",classes:{root:(0,S.A)(o.root,o["color".concat((0,$.A)(s))],d&&o.indeterminate),checked:o.checked,disabled:o.disabled},color:s,inputProps:(0,L.A)({"data-indeterminate":d},p),icon:r.cloneElement(f,{fontSize:void 0===f.props.fontSize&&"small"===x?x:f.props.fontSize}),checkedIcon:r.cloneElement(m,{fontSize:void 0===m.props.fontSize&&"small"===x?x:m.props.fontSize}),ref:t},w))}));const W=(0,D.A)((function styles(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,R.Rv)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,R.Rv)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(Q);var Y=(0,m.tZ)("Framework","Register");const G=(0,u.PA)((function Register(){var e,t,n,s,u,x,w=(0,a.IB)(),m=w.authorizationStore,j=w.configurationStore,A=(0,g.B)().t,k=(0,r.useState)(null!==(e=null===(t=m.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),y=(0,i.A)(k,2),C=y[0],L=y[1],N=(0,r.useState)(""),S=(0,i.A)(N,2),I=S[0],b=S[1],z=(0,r.useState)(""),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),F=(0,i.A)(O,2),T=F[0],_=F[1],B=(0,r.useState)(""),R=(0,i.A)(B,2),U=R[0],$=R[1],H=(0,r.useState)(""),V=(0,i.A)(H,2),K=V[0],Q=V[1],G=(0,r.useState)(""),q=(0,i.A)(G,2),Z=q[0],X=q[1],J=(0,r.useState)(!1),ee=(0,i.A)(J,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.A)(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.gP)(m.register(C,I,U,T,null===(e=m.state)||void 0===e?void 0:e.invitationId,Z));case 3:L(""),b(""),P(""),$(""),_(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),Q("auth.error.invitationotp"),Y.error(new d.p$("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=m.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=Z&&""!==Z&&I==D&&""!=I&&null!=I&&te:I==D&&""!=I&&null!=I&&te},ie=null===(s=m.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:A("auth.title.register")}),(0,f.jsx)("p",{children:A("auth.text.register","")}),!!K&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:A(K)})]}),(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.me,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(v.A,{type:"text",value:Z,placeholder:A("auth.input.otp"),onChange:function onChange(e){return X(e.target.value)}}),(0,f.jsx)(v.A,{value:U,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(v.A,{value:T,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return _(e.target.value)}}),(0,f.jsx)(v.A,{value:C,autoComplete:"email",autoFocus:!0,placeholder:A("auth.input.email"),disabled:!0}),(0,f.jsx)(v.A,{value:I,type:"password",autoFocus:!0,placeholder:A("auth.input.password"),onChange:function onChange(e){return b(e.target.value)}}),(0,f.jsx)(v.A,{value:D,type:"password",autoFocus:!0,placeholder:A("auth.input.repeatpassword"),onChange:function onChange(e){return P(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(W,{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:A("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=j.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:A("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(x=j.navigation.privacyUrl)&&void 0!==x?x:"https://www.diva-portal.de/datenschutz",children:A("auth.privacypolicy")})]})]})]}),(0,f.jsx)(M.A,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:A("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(p.A,{disabled:!oe(),onClick:oe()?re:void 0,children:A("auth.input.login")})]})]})}));var q=(0,u.PA)((function(){var e,t=(0,a.IB)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(A,{});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});case"REGISTER":return(0,f.jsx)(G,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const Z=(0,u.PA)((function Auth(){var e,t,n,o=(0,a.IB)(),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.j2,children:[(0,f.jsxs)("div",{className:c.TG,children:[(0,f.jsx)("div",{className:c.r$,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(q,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(C.s,{settings:{contentBoxProps:(0,h.HO)(s.authentication.contentBox.props)}})})]})}))}}]);
2
+ "use strict";(self.webpackChunkCrystaldesignDivaCore=self.webpackChunkCrystaldesignDivaCore||[]).push([[89],{7089:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Z});var r=n(1594),a=n(8180),o=n(6557),i=n(8742),s=n(3106),l=n.n(s),c=n(5298),u=n(970),d=n(6666),h=n(7975),v=n(4020),p=n(1240),g=n(9681),x=n(2919),w=n.n(x),f=n(2246);function OpenId(){var e,t,n,r=(0,a.IB)(),o=r.configurationStore,i=r.authorizationStore,s=(0,g.B)().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)(p.A,{className:w()(c.Ob,c.q7),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)(p.A,{className:w()(c.Ob,c.l$),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)(p.A,{className:c.Ob,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 m=n(5051),j=(0,m.tZ)("Framework","Login");const A=(0,u.PA)((function Login(){var e,t,n,s,u=(0,a.IB)(),x=u.authorizationStore,w=u.authorizationHandler,m=(0,r.useState)("enter"),A=(0,i.A)(m,2),k=A[0],y=A[1],C=(0,r.useState)(null!==(e=null===(t=x.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),M=(0,i.A)(C,2),L=M[0],N=M[1],S=(0,r.useState)(""),I=(0,i.A)(S,2),b=I[0],z=I[1],E=(0,r.useState)(""),D=(0,i.A)(E,2),P=D[0],O=D[1],F=(0,r.useState)(!1),T=(0,i.A)(F,2),_=T[0],B=T[1],R=(0,r.useState)(x.state.invitationId),U=(0,i.A)(R,2),$=U[0],H=U[1],V=(0,r.useState)("LOGIN"==(null===(n=x.state)||void 0===n?void 0:n.type)?x.state.error:void 0),K=(0,i.A)(V,2),Q=K[0],W=K[1],Y=(0,g.B)().t,G=function(){var e=(0,o.A)(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",L);case 4:(e=n.sent)&&(e.isNewUser&&(x.close(),x.showRegister(void 0,L,!0)),H(!0),B(!0));case 6:return n.next=8,w.fetchLoginProvider({email:L});case 8:"standard"==(t=n.sent).provider?y("login"):x.openOAuthLogin(t.provider,x.state.organizationId),n.next=16;break;case 12:n.prev=12,n.t0=n.catch(0),j.error(new d.p$("Error while fetching login provider",{cause:n.t0})),W("auth.error.password");case 16:case"end":return n.stop()}}),_callee,null,[[0,12]])})));return function onContinue(){return e.apply(this,arguments)}}(),q=function(){var e=(0,o.A)(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.gP)(x.login(L,b,!1,x.state.organizationId,x.state.invitationId,P));case 3:N(""),z(""),W(void 0),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(0),j.error(new d.p$("Error while logging in",{cause:e.t0})),W($?"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)}}(),Z=function(){var e=(0,o.A)(l().mark((function _callee3(){return l().wrap((function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:x.showRequestNewPassword(L);case 1:case"end":return e.stop()}}),_callee3)})));return function resetPassword(){return e.apply(this,arguments)}}(),X="enter"==k&&0==L.length||"enter"!=k&&0==b.length;_&&!X&&(X=0==P.length);var J=null===(s=x.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:Y("auth.title.login")}),(0,f.jsx)("p",{children:Y("auth.text.login","")}),!!Q&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{id:"loginerrortext",children:Y(Q)})]}),(0,f.jsx)(OpenId,{}),((null==J?void 0:J.generic)||(null==J?void 0:J.google)||(null==J?void 0:J.microsoft))&&J.standard&&(0,f.jsx)("div",{className:c.me,children:"or"}),(null==J?void 0:J.standard)&&(0,f.jsxs)(f.Fragment,{children:["enter"==k&&(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{id:"username",value:L,autoComplete:"username",autoFocus:!0,placeholder:Y("auth.input.email"),onChange:function onChange(e){return N(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&G()}}),(0,f.jsx)(v.A,{value:b,id:"password",type:"password",autoComplete:"current-password",hidden:!0,autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}})]}),"login"==k&&(0,f.jsxs)("form",{children:[_&&(0,f.jsx)(v.A,{value:P,type:"text",autoFocus:!0,placeholder:Y("auth.input.otp"),onChange:function onChange(e){return O(e.target.value)}}),(0,f.jsx)("label",{className:c.eK,onClick:function reset(){y("enter"),N(""),z(""),W(void 0)},children:(0,f.jsx)(v.A,{value:L,readOnly:!0,placeholder:Y("auth.input.email")})}),(0,f.jsx)(v.A,{value:b,type:"password",id:"password",autoFocus:!0,placeholder:Y("auth.input.password"),onChange:function onChange(e){return z(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&q()}}),(0,f.jsx)("div",{className:c.nf,style:{textAlign:"right"},onClick:Z,children:Y("auth.button.forgotpassword")})]}),(0,f.jsx)(p.A,{id:"submit",disabled:X,onClick:"enter"==k?G:q,children:Y("enter"==k?"auth.button.continue":"auth.button.login")})]})]})}));var k=(0,m.tZ)("Framework","RequestNewPassword");function RequestNewPassword(e){var t=e.initEmail,n=(0,a.IB)(),s=n.authorizationStore,u=n.apiHandler,h=n.loadingAndErrorStore,x=(0,r.useState)(t),w=(0,i.A)(x,2),m=w[0],j=w[1],A=(0,r.useState)(!1),y=(0,i.A)(A,2),C=y[0],M=y[1],L=(0,r.useState)(),N=(0,i.A)(L,2),S=N[0],I=N[1],b=(0,r.useState)(),z=(0,i.A)(b,2),E=z[0],D=z[1],P=(0,g.B)().t,O=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,D(!0),h.toggleLoading("SendPassword"),e.next=5,u.sendPasswordRecoveryMail({email:m});case 5:D(!1),h.toggleLoading("SendPassword"),M(!0),I(void 0),e.next=17;break;case 11:e.prev=11,e.t0=e.catch(0),k.error(new d.p$("Error while sending password recovery mail",{cause:e.t0})),I("auth.error.resetpassword"),D(!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:P("auth.title.resetpassword")}),(0,f.jsx)("p",{children:P("auth.info.resetdescription")}),!!S&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P(S)})]}),C&&(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:P("auth.info.resetpassword")})]}),!C&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(v.A,{value:m,autoFocus:!0,placeholder:P("auth.input.email"),onChange:function onChange(e){return j(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&O()}}),(0,f.jsx)(p.A,{disabled:0==m.length,onClick:O,children:P("auth.button.resetpassword")})]}),C&&(0,f.jsx)(p.A,{disabled:E,onClick:function toLogin(){s.close(),s.showLogin()},children:P("auth.button.login")})]})}function Errormessage(e){var t=e.hasError,n=e.authErrorsg,r=(0,g.B)().t;return(0,f.jsxs)("div",{className:c.z3,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 y=(0,m.tZ)("Framework","cfhange-password");function ChangePassword(e){var t,n=e.token,s=(0,a.IB)(),u=s.configurationStore,h=s.authorizationStore,x=s.apiHandler,w=(s.loadingAndErrorStore,(0,r.useState)("")),m=(0,i.A)(w,2),j=m[0],A=m[1],k=(0,r.useState)(""),C=(0,i.A)(k,2),M=C[0],L=C[1],N=(0,r.useState)(!1),S=(0,i.A)(N,2),I=S[0],b=S[1],z=(0,r.useState)(),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),F=(0,i.A)(O,2),T=F[0],_=F[1],B=(0,r.useRef)(null),R=(0,g.B)().t;(0,r.useEffect)((function(){j===M&&P(void 0)}),[j,M]);var U=function(){var e=(0,o.A)(l().mark((function _callee(){return l().wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(_(R("auth.error.verifypasswordserver")),!(j.length<8||j!==M)){e.next=4;break}return P("INVALID"),e.abrupt("return");case 4:return e.prev=4,e.next=7,x.resetPassword({password:j,token:n});case 7:b(!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.p$){if("AUTH_0003"===e.name)_(R("auth.error.verifypasswordtokenerror",{errormsg:R("auth.error.tokenexpired")}));else _(R("auth.error.verifypasswordserver",e.message));y.error(e)}y.error(new d.p$("Error while resetting password",{cause:e})),P("SERVER")};return"SERVER"===D?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:T}),(0,f.jsx)(p.A,{onClick:function onClickRequestNewPassword(){h.showRequestNewPassword("")},children:R("auth.button.resetpassword")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:R("auth.title.verifypassword")}),I&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:c.kX,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:R("auth.info.verifypassword")})]}),(null===(t=u.authentication.resetPassword)||void 0===t?void 0:t.returnToLogin)&&(0,f.jsx)(p.A,{onClick:function goToLogin(){h.close(),h.showLogin()},children:R("auth.button.login")})]}),!I&&(0,f.jsxs)(f.Fragment,{children:[D&&(0,f.jsx)(Errormessage,{hasError:D,authErrorsg:T}),(0,f.jsxs)("form",{children:[(0,f.jsx)(v.A,{value:j,autoFocus:!0,placeholder:R("auth.input.password"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return A(e.target.value)},onKeyPress:function onKeyPress(e){var t;return"Enter"==e.key&&(null===(t=B.current)||void 0===t?void 0:t.focus())}}),(0,f.jsx)(v.A,{ref:B,value:M,placeholder:R("auth.input.verifypassword"),type:"password",autoComplete:"new-password",onChange:function onChange(e){return L(e.target.value)},onKeyPress:function onKeyPress(e){return"Enter"==e.key&&U()}})]}),(0,f.jsx)(p.A,{disabled:!j||!M,onClick:U,children:R("auth.button.save")})]})]})}var C=n(6261);function WelcomeScreen(e){var t=e.isNewUser,n=e.invitationId,s=(0,a.IB)(),u=s.authorizationStore,d=s.authorizationHandler,h=(0,r.useState)(""),v=(0,i.A)(h,2),x=v[0],w=v[1],m=(0,g.B)().t,j=function(){var e=(0,o.A)(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)&&(u.close(),u.showLogin(void 0,void 0,void 0,n,e));case 4:case"end":return t.stop()}}),_callee)})));return function toLogin(){return e.apply(this,arguments)}}(),A=function(){var e=(0,o.A)(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)&&(u.close(),u.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.A)(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=u.state)||void 0===e?void 0:e.invitationId,r.next=3,d.getInvitationValue("email",t);case 3:if(!(n=r.sent)){r.next=8;break}return r.abrupt("return",n.email);case 8:return w("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")}),x&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:m(x)})]}),t&&!x&&(0,f.jsx)(p.A,{onClick:A,children:m("auth.title.register")}),!t&&!x&&(0,f.jsx)(p.A,{onClick:j,children:m("auth.button.login")})]})}var M=n(1113),L=n(250),N=n(120),S=(n(3886),n(203)),I=n(4134),b=n(8686),z=r.createContext();const E=z;var D=n(6224),P=n(9874),O=r.forwardRef((function SwitchBase(e,t){var n=e.autoFocus,a=e.checked,o=e.checkedIcon,i=e.classes,s=e.className,l=e.defaultChecked,c=e.disabled,u=e.icon,d=e.id,h=e.inputProps,v=e.inputRef,p=e.name,g=e.onBlur,x=e.onChange,w=e.onFocus,f=e.readOnly,m=e.required,j=e.tabIndex,A=e.type,k=e.value,y=(0,N.A)(e,["autoFocus","checked","checkedIcon","classes","className","defaultChecked","disabled","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"]),C=(0,b.A)({controlled:a,default:Boolean(l),name:"SwitchBase",state:"checked"}),M=(0,I.A)(C,2),z=M[0],D=M[1],O=function useFormControl_useFormControl(){return r.useContext(E)}(),F=c;O&&void 0===F&&(F=O.disabled);var T="checkbox"===A||"radio"===A;return r.createElement(P.A,(0,L.A)({component:"span",className:(0,S.A)(i.root,s,z&&i.checked,F&&i.disabled),disabled:F,tabIndex:null,role:void 0,onFocus:function handleFocus(e){w&&w(e),O&&O.onFocus&&O.onFocus(e)},onBlur:function handleBlur(e){g&&g(e),O&&O.onBlur&&O.onBlur(e)},ref:t},y),r.createElement("input",(0,L.A)({autoFocus:n,checked:a,defaultChecked:l,className:i.input,disabled:F,id:T&&d,name:p,onChange:function handleInputChange(e){var t=e.target.checked;D(t),x&&x(e,t)},readOnly:f,ref:v,required:m,tabIndex:j,type:A,value:k},h)),z?o:u)}));const F=(0,D.A)({root:{padding:9},checked:{},disabled:{},input:{cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}},{name:"PrivateSwitchBase"})(O);var T=n(5261);const _=(0,T.A)(r.createElement("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"),B=(0,T.A)(r.createElement("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");var R=n(4287);const U=(0,T.A)(r.createElement("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");var $=n(433),H=r.createElement(B,null),V=r.createElement(_,null),K=r.createElement(U,null),Q=r.forwardRef((function Checkbox(e,t){var n=e.checkedIcon,a=void 0===n?H:n,o=e.classes,i=e.color,s=void 0===i?"secondary":i,l=e.icon,c=void 0===l?V:l,u=e.indeterminate,d=void 0!==u&&u,h=e.indeterminateIcon,v=void 0===h?K:h,p=e.inputProps,g=e.size,x=void 0===g?"medium":g,w=(0,N.A)(e,["checkedIcon","classes","color","icon","indeterminate","indeterminateIcon","inputProps","size"]),f=d?v:c,m=d?v:a;return r.createElement(F,(0,L.A)({type:"checkbox",classes:{root:(0,S.A)(o.root,o["color".concat((0,$.A)(s))],d&&o.indeterminate),checked:o.checked,disabled:o.disabled},color:s,inputProps:(0,L.A)({"data-indeterminate":d},p),icon:r.cloneElement(f,{fontSize:void 0===f.props.fontSize&&"small"===x?x:f.props.fontSize}),checkedIcon:r.cloneElement(m,{fontSize:void 0===m.props.fontSize&&"small"===x?x:m.props.fontSize}),ref:t},w))}));const W=(0,D.A)((function styles(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},indeterminate:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,R.Rv)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,R.Rv)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiCheckbox"})(Q);var Y=(0,m.tZ)("Framework","Register");const G=(0,u.PA)((function Register(){var e,t,n,s,u,x,w=(0,a.IB)(),m=w.authorizationStore,j=w.configurationStore,A=(0,g.B)().t,k=(0,r.useState)(null!==(e=null===(t=m.state)||void 0===t?void 0:t.email)&&void 0!==e?e:""),y=(0,i.A)(k,2),C=y[0],L=y[1],N=(0,r.useState)(""),S=(0,i.A)(N,2),I=S[0],b=S[1],z=(0,r.useState)(""),E=(0,i.A)(z,2),D=E[0],P=E[1],O=(0,r.useState)(""),F=(0,i.A)(O,2),T=F[0],_=F[1],B=(0,r.useState)(""),R=(0,i.A)(B,2),U=R[0],$=R[1],H=(0,r.useState)(""),V=(0,i.A)(H,2),K=V[0],Q=V[1],G=(0,r.useState)(""),q=(0,i.A)(G,2),Z=q[0],X=q[1],J=(0,r.useState)(!1),ee=(0,i.A)(J,2),te=ee[0],ne=ee[1],re=function(){var e=(0,o.A)(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.gP)(m.register(C,I,U,T,null===(e=m.state)||void 0===e?void 0:e.invitationId,Z));case 3:L(""),b(""),P(""),$(""),_(""),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(0),Q("auth.error.invitationotp"),Y.error(new d.p$("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=m.state)||void 0===n?void 0:n.useOtp,oe=function validPassword(){return ae?null!=Z&&""!==Z&&I==D&&""!=I&&null!=I&&te:I==D&&""!=I&&null!=I&&te},ie=null===(s=m.state)||void 0===s?void 0:s.loginMethods;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h1",{children:A("auth.title.register")}),(0,f.jsx)("p",{children:A("auth.text.register","")}),!!K&&(0,f.jsxs)("div",{className:c.z3,children:[(0,f.jsx)("span",{}),(0,f.jsx)("div",{children:A(K)})]}),(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.me,children:"or"}),(null==ie?void 0:ie.standard)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("form",{children:[ae&&(0,f.jsx)(v.A,{type:"text",value:Z,placeholder:A("auth.input.otp"),onChange:function onChange(e){return X(e.target.value)}}),(0,f.jsx)(v.A,{value:U,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.name"),onChange:function onChange(e){return $(e.target.value)}}),(0,f.jsx)(v.A,{value:T,autoFocus:!0,placeholder:A("backoffice.form.userdetails.items.familyName"),onChange:function onChange(e){return _(e.target.value)}}),(0,f.jsx)(v.A,{value:C,autoComplete:"email",autoFocus:!0,placeholder:A("auth.input.email"),disabled:!0}),(0,f.jsx)(v.A,{value:I,type:"password",autoFocus:!0,placeholder:A("auth.input.password"),onChange:function onChange(e){return b(e.target.value)}}),(0,f.jsx)(v.A,{value:D,type:"password",autoFocus:!0,placeholder:A("auth.input.repeatpassword"),onChange:function onChange(e){return P(e.target.value)}}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,alignItems:"center"},children:[(0,f.jsx)(W,{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:A("auth.acceptprivacyandagb")}),(0,f.jsxs)("span",{children:[(0,f.jsx)("a",{target:"_blank",href:null!==(u=j.navigation.tosUrl)&&void 0!==u?u:"https://www.diva-portal.de/agb",children:A("auth.GeneralTerms")}),", ",(0,f.jsx)("a",{target:"_blank",href:null!==(x=j.navigation.privacyUrl)&&void 0!==x?x:"https://www.diva-portal.de/datenschutz",children:A("auth.privacypolicy")})]})]})]}),(0,f.jsx)(M.A,{style:{color:"#FF8C00",marginTop:10,fontSize:14},hidden:oe(),children:A("auth.input.passwordsnotmatch")})]}),(0,f.jsx)(p.A,{disabled:!oe(),onClick:oe()?re:void 0,children:A("auth.input.login")})]})]})}));var q=(0,u.PA)((function(){var e,t=(0,a.IB)().authorizationStore;switch(null===(e=t.state)||void 0===e?void 0:e.type){case"LOGIN":return(0,f.jsx)(A,{});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});case"REGISTER":return(0,f.jsx)(G,{});case"INVITATION_EXPIRED":return(0,f.jsx)("h1",{children:"Abgelaufen"});default:return(0,f.jsx)(f.Fragment,{})}}));const Z=(0,u.PA)((function Auth(){var e,t,n,o=(0,a.IB)(),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.j2,children:[(0,f.jsxs)("div",{className:c.TG,children:[(0,f.jsx)("div",{className:c.r$,style:{height:null!==(n=s.configuration.loginLogoHeight)&&void 0!==n?n:50,backgroundImage:"url(".concat(u,")")}}),(0,f.jsx)(q,{})]}),s.authentication.contentBox&&(0,f.jsx)("div",{style:{width:"calc(100% - 400px)",height:"100%",position:"relative",overflow:"hidden"},children:(0,f.jsx)(C.s,{settings:{contentBoxProps:(0,h.HO)(s.authentication.contentBox.props)}})})]})}))}}]);