tocco-admin 3.10.30 → 3.10.32

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tocco-admin",
3
- "version": "3.10.30",
3
+ "version": "3.10.32",
4
4
  "description": "Alpha version of new tocco admin.",
5
5
  "license": "AGPL-3.0+",
6
6
  "main": "dist/index.js",
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunktocco_admin=self.webpackChunktocco_admin||[]).push([[246],{74208:(e,n,t)=>{t.d(n,{c:()=>En});var r,a,o,s,c,i,u=t(52536),l=t(3268),d=t.n(l),p=t(25480),f=t(28324),g=t(56188),w=t(25784),m=t(95020),x=t(98168),y=t(52328),v="two-factor-connector/INITIALIZE",O="two-factor-connector/SET_TWO_STEP_ACTIVE",b="two-factor-connector/SET_SECRET",h="two-factor-connector/SET_USER_NAME",j="two-factor-connector/REQUEST_SECRET",P="two-factor-connector/GO_TO_SECRET_VERIFICATION",S="two-factor-connector/GO_TO_START",E="two-factor-connector/GO_TO_SECRET",A="two-factor-connector/VERIFY_CODE",T="root/SUCCESS",k="root/SET_SETUP_SUCCESSFUL",U="root/GO_TO_RESULT",R=function(){return{type:v}},N=function(e){return{type:O,payload:{twoFactorActive:e}}},C=function(e){return{type:b,payload:{secret:e}}},_=function(e){return{type:h,payload:{username:e}}},D=function(){return{type:S}},M=function(){return{type:E}},I=function(e){return{type:k,payload:{setupSuccessful:e}}},F=function(){return{type:U}},L=t(69624),W=t(23152),q=t(86692),G=t(80560),V=G.cp.div.withConfig({displayName:"StyledButtonWrapper"})(r||(r=(0,q.c)(["\n display: flex;\n justify-content: flex-end;\n margin-top: ",";\n\n > "," {\n margin-right: 0;\n }\n"])),W.aU.space(.5),W.yi),H=G.cp.div.withConfig({displayName:"StyledMessageWrapper"})(a||(a=(0,q.c)(["\n display: grid;\n grid-template-columns: 9% 1fr;\n grid-column-gap: ",";\n"])),W.aU.space(-.5)),z=G.cp.span.withConfig({displayName:"StyledIconWrapper"})(o||(o=(0,q.c)(["\n display: flex;\n align-items: center;\n color: ",";\n font-size: ",";\n\n > * {\n max-width: 100%;\n }\n"])),(function(e){return e.isSuccessful?W.Il.color("signal.success"):W.Il.color("signal.danger")}),W.aU.font(10)),K=G.cp.div.withConfig({displayName:"StyledTextWrapper"})(s||(s=(0,q.c)(["\n display: flex;\n align-items: center;\n"]))),B=t(17624);const Q=function(e){var n=e.success,t=e.goToStart,r=e.setupSuccessful,a=e.intl;(0,W.sH)(n);var o=function(e){return a.formatMessage({id:e})};return r?(0,B.jsxs)(B.Fragment,{children:[c||(c=(0,B.jsxs)(H,{children:[(0,B.jsx)(z,{isSuccessful:!0,children:(0,B.jsx)(W.kz,{icon:"check"})}),(0,B.jsx)(K,{children:(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.successfulText"})})})]})),(0,B.jsx)(V,{children:(0,B.jsx)(W.q,{label:o("client.two-factor-connector.okButton"),ink:"primary",look:"raised",onClick:n})})]}):(0,B.jsxs)(B.Fragment,{children:[i||(i=(0,B.jsxs)(H,{children:[(0,B.jsx)(z,{isSuccessful:!1,children:(0,B.jsx)(W.kz,{icon:"times"})}),(0,B.jsx)(K,{children:(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.errorText"})})})]})),(0,B.jsx)(V,{children:(0,B.jsx)(W.q,{label:o("client.two-factor-connector.okButton"),ink:"primary",look:"raised",onClick:t})})]})};var Z={success:function(){return{type:T}},goToStart:D};const Y=(0,y.Ul)((function(e){return{setupSuccessful:e.twoFactorConnector.setupSuccessful}}),Z)((0,x.injectIntl)(Q));var X,$,J,ee,ne,te,re=G.cp.div.withConfig({displayName:"StyledQRCodeWrapper"})(X||(X=(0,q.c)(["\n display: flex;\n justify-content: center;\n margin: "," "," "," ",";\n"])),W.aU.space(1.2),W.aU.space(1),W.aU.space(1.5),W.aU.space(1)),ae=G.cp.div.withConfig({displayName:"StyledParagraph"})($||($=(0,q.c)(["\n display: flex;\n justify-content: center;\n margin-top: ",";\n margin-bottom: ",";\n"])),W.aU.space(-1),W.aU.space(-.9));const oe=function(e){var n=e.secret,t=e.goToSecretVerification;return(0,W.sH)(t),(0,B.jsxs)(B.Fragment,{children:[J||(J=(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.qrCodeInfo"})})),(0,B.jsx)(re,{children:(0,B.jsx)(W.We,{value:n.uri})}),ee||(ee=(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.secretInfo"})})),(0,B.jsx)(ae,{children:(0,B.jsx)(W.Oi.B,{children:n.secret})}),ne||(ne=(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.backupInfo"})})),(0,B.jsx)(V,{children:(0,B.jsx)(W.q,{ink:"primary",look:"raised",onClick:t,children:te||(te=(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.nextButton"}))})})]})};var se={goToSecretVerification:function(){return{type:P}}};const ce=(0,y.Ul)((function(e){return{secret:e.twoFactorConnector.secret}}),se)((0,x.injectIntl)(oe));var ie;const ue=function(e){var n=e.twoFactorActive,t=e.forced,r=e.requestSecret,a=e.intl;(0,W.sH)(r);var o=function(e){return a.formatMessage({id:e})};return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(W.Oi.P,{children:function(){if(n)return ie||(ie=(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.overwriteInfo"}));var e=o(t?"client.two-factor-connector.forcedInfo":"client.two-factor-connector.info");return(0,B.jsx)("span",{dangerouslySetInnerHTML:{__html:e}})}()}),(0,B.jsx)(V,{children:(0,B.jsx)(W.q,{label:o("client.two-factor-connector.nextButton"),ink:"primary",look:"raised",onClick:r})})]})};var le={initialize:R,requestSecret:function(){return{type:j}}};const de=(0,y.Ul)((function(e){return{twoFactorActive:e.twoFactorConnector.twoFactorActive,secret:e.twoFactorConnector.secret,forced:e.input.forced}}),le)((0,x.injectIntl)(ue));var pe,fe,ge=t(32920),we=t(57292),me=G.cp.div.withConfig({displayName:"StyledLoginFormInputWrapper"})(pe||(pe=(0,q.c)(["\n && {\n ","\n }\n"])),W.m4);const xe=function(e){var n=e.verifyCode,t=e.intl,r=(0,L.useState)(null),a=(0,ge.c)(r,2),o=a[0],s=a[1],c=function(e){return t.formatMessage({id:e})},i=o&&o.toString().length>=6,u=function(e){e&&(e.preventDefault(),e.stopPropagation()),i&&n(o)};(0,W.sH)(u);var l=we.c.isInAdminEmbedded();return(0,B.jsxs)(B.Fragment,{children:[fe||(fe=(0,B.jsx)(W.Oi.P,{children:(0,B.jsx)(x.FormattedMessage,{id:"client.two-factor-connector.verificationText"})})),(0,B.jsxs)("form",{onSubmit:u,children:[(0,B.jsx)(W._i,{hasValue:Boolean(o),id:"verification-input",label:c("client.two-factor-connector.verificationInputLabel"),labelPosition:l?"inside":"outside",children:(0,B.jsx)(me,{children:(0,B.jsx)(W.Ks,{type:"integer",value:o,events:{onChange:s},options:{format:"### ###",allowLeadingZeros:!0}})})}),(0,B.jsx)(V,{children:(0,B.jsx)(W.q,{label:c("client.two-factor-connector.okButton"),ink:"primary",look:"raised",type:"submit",disabled:!i})})]})]})};var ye={verifyCode:function(e){return{type:A,payload:{userCode:e}}}};const ve=(0,y.Ul)((function(e,n){return{}}),ye)((0,x.injectIntl)(xe));var Oe,be,he,je,Pe,Se,Ee=0,Ae=1,Te=2,ke=3;const Ue=function(e){var n=e.initialize,t=e.stage;(0,L.useEffect)((function(){n()}),[n]);return(0,B.jsxs)(B.Fragment,{children:[Se||(Se=(0,B.jsx)(w.c.Notifications,{})),function(){switch(t){case Ee:return Oe||(Oe=(0,B.jsx)(de,{}));case Ae:return be||(be=(0,B.jsx)(ce,{}));case Te:return he||(he=(0,B.jsx)(ve,{}));case ke:return je||(je=(0,B.jsx)(Y,{}));default:return Pe||(Pe=(0,B.jsx)(W.s5,{}))}}()]})};var Re={initialize:R};const Ne=(0,y.Ul)((function(e){return{stage:e.twoFactorConnector.stage}}),Re)((0,x.injectIntl)(Ue));function Ce(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function _e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){(0,u.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var De=function(e){return function(n){return _e(_e({},n),{},{stage:e})}},Me=(0,u.c)((0,u.c)((0,u.c)((0,u.c)((0,u.c)((0,u.c)((0,u.c)((0,u.c)({},O,m.c.singleTransferReducer("twoFactorActive")),b,m.c.singleTransferReducer("secret")),h,m.c.singleTransferReducer("username")),k,m.c.singleTransferReducer("setupSuccessful")),S,De(0)),E,De(1)),P,De(2)),U,De(3)),Ie={stage:null,twoFactorActive:null,secret:null,username:null,setupSuccessful:null};var Fe=t(33248),Le=t.n(Fe),We=t(19448),qe=t.n(We),Ge=t(94752),Ve=t(19912),He=t(90800),ze=Le().mark(on),Ke=Le().mark(cn),Be=Le().mark(un),Qe=Le().mark(dn),Ze=Le().mark(pn),Ye=Le().mark(fn),Xe=Le().mark(gn),$e=Le().mark(wn),Je=Le().mark(mn),en="relTwo_step_login_status",nn="1",tn=function(e){return e.twoFactorConnector.username},rn=function(e){return e.twoFactorConnector.secret},an=function(e){return e.input};function on(){var e,n,t,r,a,o;return Le().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,Ge.Ml)(an);case 2:if(e=s.sent,e.secret){s.next=14;break}return s.next=7,(0,Ge.Ml)(tn);case 7:return n=s.sent,s.next=10,(0,Ge.MN)(Ve.c.requestSaga,"principals/".concat(n,"/two-factor"),{method:"GET"});case 10:return t=s.sent,r=t.body,a=r.secret,o=r.totpUri,s.next=14,(0,Ge.Aj)(C({secret:a,uri:o}));case 14:return s.next=16,(0,Ge.Aj)(M());case 16:case"end":return s.stop()}}),ze)}function sn(e,n){return He.c.executeRequest(e,n).then(He.c.extractBody)}function cn(e,n,t,r){var a,o;return Le().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return a={secret:e,userCode:n,username:t,password:r},s.next=3,(0,Ge.MN)(sn,"login",{method:"POST",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"}),body:Object.keys(a).filter((function(e){return!!a[e]})).sort().map((function(e){return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(a[e]))})).join("&")});case 3:return o=s.sent,s.next=6,(0,Ge.Aj)(I(qe()(o,"TWOSTEPLOGIN_ACTIVATION.success",!1)));case 6:case"end":return s.stop()}}),Ke)}function un(e,n,t){var r;return Le().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,Ge.MN)(Ve.c.requestSaga,"principals/".concat(e,"/two-factor"),{method:"POST",body:{secret:n,code:t},acceptedStatusCodes:[400]});case 2:return r=a.sent,a.next=5,(0,Ge.Aj)(I(204===r.status));case 5:case"end":return a.stop()}}),Be)}function ln(e){var n=e.payload.userCode;return Le().mark((function e(){var t,r,a,o,s;return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ge.Ml)(tn);case 2:return t=e.sent,e.next=5,(0,Ge.Ml)(rn);case 5:return r=e.sent,a=r.secret,e.next=9,(0,Ge.Ml)(an);case 9:if(o=e.sent,s=o.password,!o.forced){e.next=17;break}return e.next=15,(0,Ge.MN)(cn,a,n,t,s);case 15:e.next=19;break;case 17:return e.next=19,(0,Ge.MN)(un,t,a,n);case 19:return e.next=21,(0,Ge.Aj)(F());case 21:case"end":return e.stop()}}),e)}))()}function dn(){var e,n;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,Ge.MN)(fn);case 2:return t.next=4,(0,Ge.Ml)(an);case 4:if(e=t.sent,!(n=e.secret)){t.next=9;break}return t.next=9,(0,Ge.Aj)(C(n));case 9:return t.next=11,(0,Ge.Aj)(D());case 11:case"end":return t.stop()}}),Qe)}function pn(){return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ge.Aj)(g.c.fireExternalEvent("onSuccess"));case 2:case"end":return e.stop()}}),Ze)}function fn(){var e,n,t,r,a;return Le().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,(0,Ge.MN)(gn);case 2:return e=o.sent,o.next=5,(0,Ge.Aj)(_(e));case 5:return n='username === "'.concat(e,'"'),o.next=8,(0,Ge.MN)(Ve.c.fetchEntitiesPage,"Principal",{where:n,paths:[en]});case 8:if(!((t=o.sent).length>1)){o.next=11;break}throw new Error("More than one user found for username ".concat(e));case 11:return r=qe()(t,"[0].paths.".concat(en,".value.key")),a=r===nn,o.next=15,(0,Ge.Aj)(N(a));case 15:case"end":return o.stop()}}),Ye)}function gn(){var e,n,t;return Le().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,Ge.Ml)(an);case 2:if(e=r.sent,!(n=e.username)){r.next=8;break}return r.abrupt("return",n);case 8:return r.next=10,(0,Ge.MN)(Ve.c.requestSaga,"principals");case 10:return t=r.sent,r.abrupt("return",t.body.username);case 12:case"end":return r.stop()}}),Xe)}function wn(){return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ge.Aj)(g.c.fireExternalEvent("onResize"));case 2:case"end":return e.stop()}}),$e)}function mn(){return Le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ge.Q7)([(0,Ge.y0)(j,on),(0,Ge.y0)(A,ln),(0,Ge.y0)(v,dn),(0,Ge.y0)(T,pn),(0,Ge.y0)(S,wn),(0,Ge.y0)(E,wn),(0,Ge.y0)(P,wn),(0,Ge.y0)(U,wn)]);case 2:case"end":return e.stop()}}),Je)}const xn={twoFactorConnector:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ie,n=arguments.length>1?arguments[1]:void 0,t=Me[n.type];return t?t(e,n):e}};var yn,vn=[mn];function On(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?On(Object(t),!0).forEach((function(n){(0,u.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):On(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var hn="two-factor-connector",jn=function(e,n,t,r){var a=yn||(yn=(0,B.jsx)(Ne,{})),o=p.c.createStore(xn,vn,n,hn);return w.c.addToStore(o,!0),f.c.addToStore(o,!0,["console","remote","notification"]),g.c.addToStore(o,(function(e){return p.c.getEvents(Pn,e.input)})),p.c.createApp(hn,a,o,{input:n,events:t,actions:[],publicPath:r,textResourceModules:["component","common",hn]})},Pn=["onSuccess","onCancel","onResize"],Sn=function(e){return p.c.useApp({initApp:jn,props:e,packageName:hn,externalEvents:Pn}).component};Sn.propTypes=bn(bn({},Pn.reduce((function(e,n){return bn(bn({},e),{},(0,u.c)({},n,d().func))}),{})),{},{username:d().string,password:d().string,secret:d().shape({secret:d().string.isRequired,uri:d().string.isRequired}),forced:d().bool});const En=Sn;p.c.createBundleableApp(hn,jn,Sn)},93246:(e,n,t)=>{t.d(n,{It:()=>ka,cp:()=>Ra});var r=t(25480),a=t(95020),o=t(8688),s=t(52536),c=t(3268),i=t.n(c),u=t(28324),l=t(56188),d=t(57292),p=t(4884),f=t(98168),g=t(52328),w="login/INITIALIZE",m="login/LOGIN",x="login/REQUEST_PASSWORD",y="login/CHECK_USERNAME",v=function(e,n,t,r){return{type:m,payload:{username:e,password:n,captchaToken:t,userCode:r}}},O=t(86692),b=t(69624),h=t(80560),j={USERNAME_FORM:"USERNAME_FORM",LOGIN_FORM:"LOGIN_FORM",PASSWORD_REQUEST:"PASSWORD_REQUEST",TWOSTEPLOGIN:"TWOSTEPLOGIN",PASSWORD_UPDATE:"PASSWORD_UPDATE",TWOSTEPLOGIN_ACTIVATION:"TWOSTEPLOGIN_ACTIVATION"},P="login/CHANGE_PAGE",S="login/SET_ENTRY_PAGE",E="login/SET_USERNAME",A="login/SET_PASSWORD",T="login/SET_CAPTCHA_KEY",k=function(e){return{type:S,payload:{entryPage:e}}},U=function(e){return{type:P,payload:{currentPage:e}}},R=function(e){return{type:E,payload:{username:e}}},N=function(e){return{type:A,payload:{password:e}}},C=function(e){return{type:T,payload:{captchaKey:e}}},_=t(1528),D=t(32920),M=t(33248),I=t.n(M),F=t(34812),L=t(23152),W=t(75872),q=t(17624);const G=(0,f.injectIntl)((function(e){var n,t=e.message,r=e.intl;return t&&t.text?(0,q.jsx)(L.m2.List,{children:(0,q.jsx)(L.m2.Item,{condition:t.negative?"danger":"base",label:(n=t.text,r.formatMessage({id:n}))})}):null}));var V,H=t(52822),z=(0,h.cp)(L.q).withConfig({displayName:"StyledLoginButton"})(V||(V=(0,O.c)(["\n &&& {\n font-size: ",";\n border-radius: ",";\n display: flex;\n justify-content: center;\n padding: 1.25rem 0;\n width: 100%;\n margin-top: 20px;\n margin-bottom: 10px;\n\n &:not(:last-child) {\n margin-right: 0;\n }\n }\n"])),L.aU.font(1.3),L.gn.radii("buttonLarge")),K=["disabled","pending","label"];function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}const Q=function(e){var n=e.disabled,t=e.pending,r=e.label,a=(0,H.c)(e,K);return(0,q.jsx)(z,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?B(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({disabled:n,pending:t,label:r,ink:"primary",look:"raised",type:"submit","data-cy":"btn-submit"},a))};const Z=function(e){var n=e.title,t=e.subtitle;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(L.Oi.H5,{children:(0,q.jsx)(f.FormattedMessage,{id:n})}),t&&(0,q.jsx)(L.Oi.P,{children:(0,q.jsx)(f.FormattedMessage,{id:t})})]})};const Y=function(e){var n=(0,b.useState)(!1),t=(0,D.c)(n,2),r=t[0],a=t[1];return[r,{onAnimationStart:function(e){"onAutoFillStart"===e.animationName&&a(!0)},onChange:function(n){e(n.target.value),a(!1)}}]};var X,$,J,ee,ne,te=h.cp.input.withConfig({displayName:"StyledLoginFormInput"})(X||(X=(0,O.c)(["\n /* stylelint-disable-next-line block-no-empty */\n @keyframes onAutoFillStart {\n from {\n }\n }\n\n &&&& {\n ","\n transition: background-color 50000s, color 50000s, filter 50000s;\n\n &:-webkit-autofill {\n animation-duration: 50000s;\n animation-name: onAutoFillStart;\n }\n padding-top: ",";\n padding-bottom: ",";\n }\n"])),L.cZ,L.aU.space(-.9),L.aU.space(-.9)),re=h.cp.div.withConfig({displayName:"StyledLoginFormInputWrapper"})($||($=(0,O.c)(["\n &&& {\n ","\n }\n"])),L.m4),ae=(0,h.cp)(L.q).withConfig({displayName:"StyledTransparentButton"})(J||(J=(0,O.c)(["\n &&& {\n margin-right: 0;\n background-color: transparent;\n padding: "," 0;\n width: 100%;\n justify-content: center;\n\n &:hover {\n background-color: transparent;\n }\n }\n"])),L.aU.space(-.1)),oe=h.cp.div.withConfig({displayName:"StyledLoginFormWrapper"})(ee||(ee=(0,O.c)(["\n "," {\n margin-top: ",";\n width: auto;\n flex-direction: column;\n\n "," {\n flex-grow: 1;\n }\n }\n"])),L.e$,L.aU.space(.47),L.yi);function se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ce(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?se(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}const ie=function(e){var n=e.captchaKey,t=e.changePage,r=e.intl,a=e.login,o=e.loginPending,s=e.message,c=e.password,i=e.recaptchaActivated,u=e.setPassword,l=e.setUsername,d=e.showTitle,p=e.username,f=e.entryPage,g=Y(l),w=(0,D.c)(g,2),m=w[0],x=w[1],y=Y(u),v=(0,D.c)(y,2),O=v[0],h=v[1],P=(0,b.useRef)(),S=f===j.USERNAME_FORM,E=function(e){return r.formatMessage({id:e})},A=W.c.usePrevious(i),T=(0,b.useCallback)(function(){var e=(0,_.c)(I().mark((function e(n){var t;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&n.preventDefault(),t=null,!i){e.next=7;break}return e.next=5,P.current.executeAsync();case 5:t=e.sent,P.current.reset();case 7:a(p,c,t);case 8:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[a,p,c,i]);(0,b.useEffect)((function(){i&&!A&&T()}),[i,A,T]);var k=!!p,U=!k;return(0,q.jsxs)(oe,{children:[d&&(ne||(ne=(0,q.jsx)(Z,{title:"client.login.form.title",subtitle:"client.login.form.introduction"}))),(0,q.jsxs)("form",{onSubmit:T,children:[(0,q.jsx)(L._i,{hasValue:!!p||m,id:"login-username",label:E("client.login.form.userPlaceholder"),immutable:S,labelPosition:"outside",children:(0,q.jsx)(re,{children:(0,q.jsx)(te,ce({autoFocus:U,name:"user","data-cy":"input-login-form_user",required:!0,type:"text",value:p,disabled:S,onFocus:function(e){return e.target.select()}},x))})}),(0,q.jsx)(L._i,{hasValue:!!c||O,id:"login-password",label:E("client.login.form.passwordPlaceholder"),labelPosition:"outside",children:(0,q.jsx)(re,{children:(0,q.jsx)(te,ce({autoFocus:k,name:"password","data-cy":"input-login-form_password",required:!0,type:"password",value:c,onFocus:function(e){return e.target.select()}},h))})}),(0,q.jsx)(G,{message:s}),n&&i&&(0,q.jsx)(F.c,{ref:P,badge:"bottomright",size:"invisible",sitekey:n,hl:r.locale}),(0,q.jsx)(Q,{disabled:o||""===p&&!m||""===c&&!O,label:E("client.login.form.button"),pending:o,"data-cy":"btn-login-form_login"}),(0,q.jsx)(ae,{label:E("client.login.form.forgotLink"),onClick:function(){return t(j.PASSWORD_REQUEST)},"data-cy":"btn-login-form_request"}),S&&(0,q.jsx)(ae,{label:E("client.login.form.backLink"),onClick:function(){return t(j.USERNAME_FORM)}})]})]})};var ue={changePage:U,setUsername:R,setPassword:N,login:v};const le=(0,g.Ul)((function(e){return{username:e.login.username,password:e.login.password,message:e.loginForm.message,loginPending:e.loginForm.loginPending,captchaKey:e.login.captchaKey,recaptchaActivated:e.loginForm.recaptchaActivated,entryPage:e.login.entryPage}}),ue)((0,f.injectIntl)(ie));var de,pe;const fe=function(e){var n=e.entryPage,t=e.username,r=e.requestPassword,a=e.intl,o=e.showTitle,s=e.pending,c=e.changePage,i=(0,b.useState)(t||""),u=(0,D.c)(i,2),l=u[0],d=u[1],p=n===j.USERNAME_FORM,g=function(e){return a.formatMessage({id:e})};return(0,q.jsxs)(oe,{children:[o&&(de||(de=(0,q.jsx)(Z,{title:"client.login.passwordRequest.title"}))),!p&&(pe||(pe=(0,q.jsx)(L.Oi.P,{children:(0,q.jsx)(f.FormattedMessage,{id:"client.login.passwordRequest.introduction"})}))),(0,q.jsxs)("form",{onSubmit:function(e){e.preventDefault(),r(l)},children:[(0,q.jsx)(L._i,{hasValue:Boolean(l),id:"login-username",label:g("client.login.form.userPlaceholder"),immutable:p,labelPosition:"outside",children:(0,q.jsx)(re,{children:(0,q.jsx)(te,{name:"user",onChange:function(e){d(e.target.value)},required:!0,type:"text",value:l,disabled:p,"data-cy":"input-password-request"})})}),(0,q.jsx)(Q,{disabled:!l||s,label:g("client.login.passwordRequest.button"),pending:s,"data-cy":"btn-password-request_submit"}),(0,q.jsx)(ae,{disabled:s,label:g("client.login.passwordRequest.abortButton"),name:"abort",onClick:function(){return c(j.LOGIN_FORM)},"data-cy":"btn-password-request_abort"})]})]})};var ge={changePage:U,requestPassword:function(e){return{type:x,payload:{username:e}}}};const we=(0,g.Ul)((function(e){return{username:e.login.username,pending:e.loginForm.loginPending,entryPage:e.login.entryPage}}),ge)((0,f.injectIntl)(fe));var me="INITIALIZED",xe="PasswordUpdateDialog/SET_SHOW_OLD_PASSWORD",ye="PasswordUpdateDialog/SET_STANDALONE",ve="PasswordUpdateDialog/SET_FORCED_UPDATE",Oe="PasswordUpdateDialog/SET_USERNAME_OR_PK",be="PasswordUpdateDialog/SET_CURRENT_USERNAME",he="PasswordUpdateDialog/CHECK_CURRENT_USER",je="PasswordUpdateDialog/SET_NEEDS_CAPTCHA",Pe=function(e){return{type:xe,payload:{showOldPasswordField:e}}},Se=function(e){return{type:ve,payload:{forcedUpdate:e}}},Ee=function(e){return{type:Oe,payload:{usernameOrPk:e}}},Ae=function(e){return{type:je,payload:{needsCaptcha:e}}},Te="PasswordUpdateDialog/UPDATE_OLD_PASSWORD",ke="PasswordUpdateDialog/UPDATE_NEW_PASSWORD",Ue="PasswordUpdateDialog/SET_NEW_PASSWORD",Re="PasswordUpdateDialog/SET_NEW_PASSWORD_VALIDATION_ERRORS",Ne="PasswordUpdateDialog/UPDATE_NEW_PASSWORD_REPEAT",Ce="PasswordUpdateDialog/SAVE_PASSWORD",_e="PasswordUpdateDialog/SAVE_PASSWORD_SUCCESS",De="PasswordUpdateDialog/SAVE_PASSWORD_FAILURE",Me="PasswordUpdateDialog/VALIDATE",Ie="PasswordUpdateDialog/RESET_PASSWORD_UPDATED_FAILED",Fe=function(e){return{type:Te,payload:{oldPassword:e}}},Le=function(e){return{type:Ue,payload:{newPassword:e}}},We=function(e){return{type:Re,payload:{errors:e}}},qe=function(){return{type:_e}},Ge=function(e,n){return{type:De,payload:{errorCode:e,validationMessages:n}}},Ve=function(){return{type:Me}},He=function(){return{type:Ie}};function ze(e){var n={};return e.forEach((function(e){n[e.ruleName]=e.message})),n}function Ke(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Be(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ke(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ke(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Qe={oldPassword:"",newPassword:"",newPasswordRepeat:"",newPasswordValidationErrors:null,passwordUpdatePending:!1,passwordUpdateFailed:!1,passwordUpdateErrorCode:null},Ze=(0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)({},Te,(function(e,n){var t=n.payload;return Be(Be({},e),{},{oldPassword:t.oldPassword})})),Ue,(function(e,n){var t=n.payload;return Be(Be({},e),{},{newPassword:t.newPassword})})),Re,(function(e,n){var t=n.payload;return Be(Be({},e),{},{newPasswordValidationErrors:t.errors})})),Ne,(function(e,n){var t=n.payload;return Be(Be({},e),{},{newPasswordRepeat:t.newPasswordRepeat})})),Ce,(function(e){return Be(Be({},e),{},{passwordUpdatePending:!0,passwordUpdateFailed:!1})})),_e,(function(e){return Qe})),De,(function(e,n){var t=n.payload;if(t.validationMessages){var r=ze(t.validationMessages);return Be(Be({},e),{},{passwordUpdatePending:!1,newPasswordValidationErrors:r})}return Be(Be({},e),{},{passwordUpdatePending:!1,passwordUpdateFailed:!0,passwordUpdateErrorCode:t.errorCode})})),Ie,(function(e,n){n.payload;return Be(Be({},e),{},{passwordUpdateFailed:!1})}));var Ye=t(94752),Xe=t(19912),$e={passwordUpdateSuccess:"password_update_success",passwordUpdateFailed:"password_update_failed"},Je=t(90800),en=t(86536),nn="loginForm/SET_MESSAGE",tn="loginForm/CLEAR_MESSAGE",rn="loginForm/SET_PENDING",an="loginForm/ACTIVATE_RECAPTCHA",on=function(e){return{type:nn,payload:{text:e,negative:arguments.length>1&&void 0!==arguments[1]&&arguments[1]}}},sn=function(){return{type:tn}},cn=function(){return{type:rn,payload:{pending:arguments.length>0&&void 0!==arguments[0]&&arguments[0]}}},un=function(){return{type:an}},ln="login/SET_SECRET",dn=function(e){return{type:ln,payload:{secret:e}}};function pn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function fn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pn(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gn=I().mark(Dn),wn=I().mark(Mn),mn=I().mark(Fn),xn=I().mark(Ln),yn=I().mark(Wn),vn=I().mark(qn),On=I().mark(Gn),bn=I().mark(Vn),hn=I().mark(Hn),jn=I().mark(zn),Pn=I().mark(Kn),Sn=I().mark(Zn),En=I().mark(Yn),An=I().mark(Xn),Tn=I().mark($n),kn=I().mark(Jn),Un=30,Rn=function(e){return e.login},Nn=function(e){return e.input};function Cn(e){var n=e.payload;return I().mark((function e(){var t,r,a,o;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Ml)(Rn);case 2:return t=e.sent,r=t.entryPage,e.next=6,(0,Ye.Aj)(cn(!0));case 6:return e.next=8,(0,Ye.MN)(Xe.c.requestSaga,"principals/".concat(n.username,"/password-reset"),{method:"POST"});case 8:return e.next=10,(0,Ye.Aj)(R(n.username));case 10:return e.next=12,(0,Ye.Aj)(U(j.LOGIN_FORM));case 12:return a=r===j.USERNAME_FORM,o=a?"client.login.from.passwordRequestedWithValidUsername":"client.login.from.passwordRequested",e.next=16,(0,Ye.Aj)(on(o));case 16:return e.next=18,(0,Ye.Aj)(cn(!1));case 18:case"end":return e.stop()}}),e)}))()}function _n(e,n){return new Promise((function(t){Je.c.executeRequest(e,n).then(Je.c.extractBody).then((function(e){return t(e)})).catch((function(e){o.c.logError("Failed to execute request",e),t({success:!1})}))}))}function Dn(e){return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.MN)(_n,"login",In(e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),gn)}function Mn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.MN)(_n,"session",{method:"POST"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),wn)}function In(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{method:"POST",headers:new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"}),body:Object.keys(e).filter((function(n){return!!e[n]})).sort().map((function(n){return"".concat(encodeURIComponent(n),"=").concat(encodeURIComponent(e[n]))})).join("&")}}function Fn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(U(j.TWOSTEPLOGIN));case 2:case"end":return e.stop()}}),mn)}function Ln(e){var n;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e[j.TWOSTEPLOGIN_ACTIVATION],t.next=3,(0,Ye.Aj)(dn(n));case 3:return t.next=5,(0,Ye.Aj)(U(j.TWOSTEPLOGIN_ACTIVATION));case 5:case"end":return t.stop()}}),xn)}function Wn(){var e;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.Ml)(Rn);case 2:return e=n.sent,n.next=5,(0,Ye.Aj)(Fe(e.password));case 5:return n.next=7,(0,Ye.Aj)(Ee(e.username));case 7:return n.next=9,(0,Ye.Aj)(Se(!0));case 9:return n.next=11,(0,Ye.Aj)(U(j.PASSWORD_UPDATE));case 11:case"end":return n.stop()}}),yn)}function qn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(on("client.login.form.blocked",!0));case 2:case"end":return e.stop()}}),vn)}function Gn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(on("client.login.form.failed",!0));case 2:case"end":return e.stop()}}),On)}function Vn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(on("client.login.form.invalidUsernameEmail",!0));case 2:case"end":return e.stop()}}),bn)}function Hn(){var e;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,zn();case 2:(e=n.sent)&&(window.location.href=e);case 4:case"end":return n.stop()}}),hn)}function zn(){var e,n,t,r;return I().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e=en.c.fromQueryString(window.location.search),!(n=e._redirect_url)){a.next=5;break}return a.abrupt("return",n);case 5:return a.next=7,(0,Ye.Ml)(Nn);case 7:return t=a.sent,r=t.redirectUrl,a.abrupt("return",r);case 10:case"end":return a.stop()}}),jn)}function Kn(e){var n;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,Ye.MN)(r.c.reinitialiseCache);case 2:return t.next=4,(0,Ye.Aj)(N(""));case 4:return n=e.timeout||Un,t.next=7,(0,Ye.Aj)(l.c.fireExternalEvent("loginSuccess",{timeout:n}));case 7:case"end":return t.stop()}}),Pn)}function Bn(e){var n=e.payload;return I().mark((function e(){var t,r,a,o,s;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.username,e.next=3,(0,Ye.Aj)(sn());case 3:return e.next=5,(0,Ye.Aj)(cn(!0));case 5:return e.next=7,(0,Ye.MN)(Xe.c.requestSaga,"client/username/check/".concat(t),{method:"GET"});case 7:if(r=e.sent,a=r.body,o=a.existingUser,s=a.validEmail,!o){e.next=14;break}return e.next=12,(0,Ye.Aj)(U(j.LOGIN_FORM));case 12:case 17:e.next=21;break;case 14:if(!s){e.next=19;break}return e.next=17,(0,Ye.Aj)(l.c.fireExternalEvent("register",{username:t}));case 19:return e.next=21,(0,Ye.MN)(Vn);case 21:return e.next=23,(0,Ye.Aj)(cn(!1));case 23:case"end":return e.stop()}}),e)}))()}function Qn(e){var n=e.payload;return I().mark((function e(){var t,r,a,o,s,c;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.username,r=n.password,a=n.captchaToken,o=n.userCode,s=fn(fn({username:t,password:r},a&&{captchaToken:a}),o&&{userCode:o}),e.next=4,(0,Ye.Aj)(cn(!0));case 4:return e.next=6,(0,Ye.MN)(Dn,s);case 6:if(!(c=e.sent).success){e.next=14;break}return e.next=10,(0,Ye.MN)(Kn,c);case 10:return e.next=12,(0,Ye.MN)(Hn);case 12:e.next=45;break;case 14:return e.next=16,(0,Ye.Aj)(U(j.LOGIN_FORM));case 16:if(!c.CAPTCHA){e.next=21;break}return e.next=19,(0,Ye.Aj)(un());case 19:case 24:case 29:case 34:case 39:e.next=43;break;case 21:if(!c.TWOSTEPLOGIN){e.next=26;break}return e.next=24,(0,Ye.MN)(Fn,c);case 26:if(!c.RESET_PASSWORD_REQUIRED){e.next=31;break}return e.next=29,(0,Ye.MN)(Wn);case 31:if(!c.LOGIN_BLOCKED){e.next=36;break}return e.next=34,(0,Ye.MN)(qn);case 36:if(!c.TWOSTEPLOGIN_ACTIVATION){e.next=41;break}return e.next=39,(0,Ye.MN)(Ln,c);case 41:return e.next=43,(0,Ye.MN)(Gn);case 43:return e.next=45,(0,Ye.Aj)(cn(!1));case 45:case"end":return e.stop()}}),e)}))()}function Zn(){var e;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.MN)(Mn);case 2:if(!(e=n.sent).success){n.next=6;break}return n.next=6,(0,Ye.MN)(Kn,e);case 6:return n.abrupt("return",e.success);case 7:case"end":return n.stop()}}),Sn)}function Yn(){var e;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.MN)(Xe.c.fetchServerSettings);case 2:return e=n.sent,n.next=5,(0,Ye.Aj)(C(e.captchaKey));case 5:case"end":return n.stop()}}),En)}function Xn(){var e;return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.MN)(Zn);case 2:return e=n.sent,n.next=5,(0,Ye.MN)(Yn);case 5:if(!e){n.next=8;break}return n.next=8,(0,Ye.MN)(Hn);case 8:case"end":return n.stop()}}),An)}function $n(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(sn());case 2:case"end":return e.stop()}}),Tn)}function Jn(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Q7)([(0,Ye.y0)(P,$n),(0,Ye.y0)(m,Qn),(0,Ye.y0)(y,Bn),(0,Ye.y0)(x,Cn),(0,Ye.y0)(w,Xn)]);case 2:case"end":return e.stop()}}),kn)}var et="PASSWORD_NOT_CHANGED";function nt(e,n,t,r){if("string"!=typeof e)return!1;var a=e.length-e.replace(n,"").length;return(null==t||a>=t)&&(null==r||a<=r)}var tt=(0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)({},et,(function(e,n){return"string"==typeof e&&"string"==typeof n&&e!==n})),"LENGTH",(function(e,n,t){return"string"==typeof e&&(void 0===t.params.min||null===t.params.min||e.length>=t.params.min)&&(void 0===t.params.max||null===t.params.max||e.length<=t.params.max)})),"CHARACTER_INSUFFICIENT_LOWERCASE",(function(e,n,t){return nt(e,/[a-z]/g,t.params.min,t.params.max)})),"CHARACTER_INSUFFICIENT_UPPERCASE",(function(e,n,t){return nt(e,/[A-Z]/g,t.params.min,t.params.max)})),"CHARACTER_INSUFFICIENT_DIGIT",(function(e,n,t){return nt(e,/[0-9]/g,t.params.min,t.params.max)}));const rt=function(e,n,t){var r={};return t&&t.forEach((function(t){var a=tt[t.name];a&&(!0!==a(e,n,t)&&(r[t.name]=!0))})),r};var at=I().mark(Ot),ot=I().mark(bt),st=I().mark(ht),ct=I().mark(jt),it=I().mark(St),ut=I().mark(Et),lt=I().mark(At),dt=I().mark(Tt);function pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?pt(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=function(e){return e.passwordUpdate.validationRules},wt=function(e){return e.input},mt=function(e){return e.passwordUpdate.dialog.usernameOrPk},xt=function(e){return e.passwordUpdate.password},yt=function(e){return e.passwordUpdate.dialog.standalone},vt=function(e){return e.intl};function Ot(e,n,t){var r,a;return I().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r={method:"POST",acceptedStatusCodes:[400],body:ft(ft({},n),{},{captchaToken:t})},o.prev=1,o.next=4,(0,Ye.MN)(Xe.c.requestSaga,"principals/".concat(e,"/password-update"),r);case 4:return a=o.sent,o.abrupt("return",a.ok?{error:null}:{error:a.body});case 8:return o.prev=8,o.t0=o.catch(1),o.abrupt("return",{error:{errorCode:"UNEXPECTED_ERROR",exception:o.t0}});case 11:case"end":return o.stop()}}),at,null,[[1,8]])}function bt(e,n){var t,r,a,o;return I().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(0,Ye.Ml)(vt);case 2:return t=s.sent,r=t.locale,a={method:"POST",body:n,queryParams:{locale:r}},s.prev=5,s.next=8,(0,Ye.MN)(Xe.c.requestSaga,"principals/".concat(e,"/password-validation"),a);case 8:return o=s.sent,s.abrupt("return",o.body);case 12:return s.prev=12,s.t0=s.catch(5),s.abrupt("return",{valid:!0,exception:s.t0});case 15:case"end":return s.stop()}}),ot,null,[[5,12]])}function ht(e){return I().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Ye.Aj)(Le(e.payload.newPassword));case 2:return n.next=4,(0,Ye.Aj)(Ve());case 4:case"end":return n.stop()}}),st)}function jt(){var e,n,t,r,a,o,s;return I().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,Ye.Ml)(gt);case 2:return e=c.sent,c.next=5,(0,Ye.Ml)(xt);case 5:if(n=c.sent,t=rt(n.newPassword,n.oldPassword,e),i=t,0===Object.keys(i).length&&i.constructor===Object){c.next=12;break}return c.next=10,(0,Ye.Aj)(We(t));case 10:case 24:c.next=29;break;case 12:return c.next=14,(0,Ye.Ml)(mt);case 14:return r=c.sent,c.next=17,(0,Ye.MN)(St);case 17:return a=c.sent,c.next=20,(0,Ye.MN)(bt,r,a);case 20:if(!0!==(o=c.sent).valid){c.next=26;break}return c.next=24,(0,Ye.Aj)(We({}));case 26:return s=ze(o.validationMessages),c.next=29,(0,Ye.Aj)(We(s));case 29:case"end":return c.stop()}var i}),ct)}function Pt(e){var n=e.payload.captchaToken;return I().mark((function e(){var t,r,a,o;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Ml)(mt);case 2:return t=e.sent,e.next=5,(0,Ye.MN)(St);case 5:return r=e.sent,e.next=8,(0,Ye.MN)(Ot,t,r,n);case 8:if(!(a=e.sent).error){e.next=21;break}if(!1!==a.error.valid){e.next=15;break}return e.next=13,(0,Ye.Aj)(Ge(null,a.error.validationMessages));case 13:e.next=17;break;case 15:return e.next=17,(0,Ye.Aj)(Ge(a.error.errorCode));case 17:return e.next=19,(0,Ye.Aj)(l.c.fireVisibilityStatusChangeEvent([$e.passwordUpdateFailed]));case 19:e.next=40;break;case 21:return e.next=23,(0,Ye.Ml)(yt);case 23:if(!e.sent){e.next=29;break}return e.next=27,(0,Ye.Aj)(l.c.fireExternalEvent("success",{newPassword:r.newPassword}));case 27:e.next=36;break;case 29:return e.next=31,(0,Ye.MN)(Et);case 31:return o=e.sent,e.next=34,(0,Ye.Aj)(N(o.payload.password));case 34:return e.next=36,(0,Ye.MN)(Qn,o);case 36:return e.next=38,(0,Ye.Aj)(qe());case 38:return e.next=40,(0,Ye.Aj)(l.c.fireVisibilityStatusChangeEvent([$e.passwordUpdateSuccess]));case 40:case"end":return e.stop()}}),e)}))()}function St(){var e,n;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,Ye.Ml)(wt);case 2:return e=t.sent,t.next=5,(0,Ye.Ml)(xt);case 5:return n=t.sent,t.abrupt("return",{oldPassword:e.oldPassword?e.oldPassword:n.oldPassword,newPassword:n.newPassword});case 7:case"end":return t.stop()}}),it)}function Et(){var e,n;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,Ye.Ml)(xt);case 2:return e=t.sent,t.next=5,(0,Ye.Ml)(mt);case 5:return n=t.sent,t.abrupt("return",{payload:{username:n,password:e.newPasswordRepeat}});case 7:case"end":return t.stop()}}),ut)}function At(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(He());case 2:case"end":return e.stop()}}),lt)}function Tt(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Q7)([(0,Ye.y0)(ke,ht),(0,Ye.y0)(Me,jt),(0,Ye.y0)(Ce,Pt),(0,Ye.y0)(ke,At),(0,Ye.y0)(Te,At),(0,Ye.y0)(Ne,At)]);case 2:case"end":return e.stop()}}),dt)}const kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qe,n=arguments.length>1?arguments[1]:void 0,t=Ze[n.type];return t?t(e,n):e};var Ut="PasswordUpdateDialog/FETCH_VALIDATION_RULES",Rt="PasswordUpdateDialog/SET_VALIDATION_RULES",Nt=function(e){return{type:Rt,payload:{rules:e}}},Ct=(0,s.c)({},Rt,(function(e,n){return n.payload.rules}));var _t=I().mark(Wt),Dt=I().mark(qt),Mt=function(e){return e.passwordUpdate.dialog},It=function(e){return e.intl};function Ft(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return I().mark((function t(){var r,a;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="principals/".concat(e,"/password-rules"),t.next=3,(0,Ye.MN)(Xe.c.requestSaga,r,{queryParams:{locale:n}});case 3:return a=t.sent,t.abrupt("return",a.body);case 5:case"end":return t.stop()}}),t)}))()}var Lt=function(e,n){return n||e.name!==et};function Wt(){var e,n,t,r,a,o,s;return I().wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,Ye.Ml)(Mt);case 2:return e=c.sent,n=e.usernameOrPk,t=e.showOldPasswordField,c.next=7,(0,Ye.Ml)(It);case 7:return r=c.sent,a=r.locale,c.next=11,(0,Ye.MN)(Ft,n,a);case 11:return o=c.sent,s=o.rules.filter((function(e){return Lt(e,t)})),c.next=15,(0,Ye.Aj)(Nt(s));case 15:case"end":return c.stop()}}),_t)}function qt(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Q7)([(0,Ye.y0)(Ut,Wt)]);case 2:case"end":return e.stop()}}),Dt)}const Gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0,t=Ct[n.type];return t?t(e,n):e};var Vt={INVALID_CREDENTIALS:"client.login.passwordUpdate.invalidCredentials",UNEXPECTED_ERROR:"client.login.passwordUpdate.unexpectedError"};const Ht=function(e){return(0,q.jsx)(L.m2.List,{children:(0,q.jsx)(L.m2.Item,{condition:L.Wn.condition.DANGER,children:(0,q.jsx)(f.FormattedMessage,{id:(n=e.errorCode,Vt[n]||"client.login.passwordUpdate.failure")})})});var n};const zt=function(e){return(0,q.jsx)(L.m2.List,{children:e.rules.map((function(n,t){var r=null,a=n.message;if(e.errors){var o=e.errors[n.name];!0===o?r=L.Wn.condition.DANGER:"string"==typeof o?(r=L.Wn.condition.DANGER,a=o):r=L.Wn.condition.SUCCESS}return(0,q.jsx)(L.m2.Item,{condition:r,label:a},t)}))})};var Kt,Bt,Qt=h.cp.input.attrs((function(e){return{type:"password"}})).withConfig({displayName:"StyledPasswordInput"})(Kt||(Kt=(0,O.c)(["\n &&&& {\n ","\n }\n"])),L.cZ),Zt=h.cp.div.withConfig({displayName:"StyledPasswordInputWrapper"})(Bt||(Bt=(0,O.c)(["\n && {\n ","\n }\n"])),L.m4);const Yt=function(e){var n=d.c.isInAdminEmbedded();return(0,q.jsx)(L._i,{hasValue:!!e.value,id:"".concat(e.name,"-input"),immutable:!0===e.readOnly,label:e.label,signal:e.value?void 0===e.valid?null:e.valid?L.Wn.condition.SUCCESS:L.Wn.condition.DANGER:null,labelPosition:n?"inside":"outside",children:(0,q.jsx)(Zt,{immutable:!0===e.readOnly,children:(0,q.jsx)(Qt,{id:"".concat(e.name,"-input"),value:e.value,onChange:function(n){return e.onChange(n.target.value)},disabled:!0===e.readOnly,immutable:!0===e.readOnly,onKeyDown:e.onKeyDown,autoFocus:e.autoFocus})})})};var Xt;const $t=h.cp.div(Xt||(Xt=(0,O.c)(["\n "," {\n width: 100%;\n }\n"])),L.yi);var Jt,er,nr,tr,rr;function ar(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function or(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ar(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ar(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var sr=h.cp.div.withConfig({displayName:"StyledValidationRulesWrapper"})(Jt||(Jt=(0,O.c)(["\n margin: 1rem;\n"])));const cr=function(e){var n=e.captchaKey,t=e.needsCaptcha,r=e.fetchValidationRules,a=e.forcedUpdate,o=e.initialized,s=e.checkCurrentUser,c=e.intl,i=e.password,u=e.savePassword,l=e.showOldPasswordField,d=e.showTitle,p=e.updateNewPassword,g=e.updateNewPasswordRepeat,w=e.updateOldPassword,m=e.validationRules,x=(0,b.useRef)();(0,b.useEffect)((function(){r()}),[r]),(0,b.useEffect)((function(){s()}),[s]),(0,b.useEffect)((function(){m&&o()}),[m,o]);var y=function(){var e=(0,_.c)(I().mark((function e(n){var r;return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),!0!==v()){e.next=11;break}if(!t){e.next=10;break}return e.next=5,x.current.executeAsync();case 5:r=e.sent,x.current.reset(),u(r),e.next=11;break;case 10:u();case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),v=function(){return!!i.newPasswordRepeat&&(i.newPassword===i.newPasswordRepeat&&!i.passwordUpdatePending)},O=function(e){return c.formatMessage({id:e})};if(!m)return er||(er=(0,q.jsx)(L.s5,{}));var h=i.passwordUpdatePending,j=!i.oldPassword&&l||i.passwordUpdatePending,P=!i.newPassword||i.passwordUpdatePending||i.newPasswordValidationErrors&&Object.keys(i.newPasswordValidationErrors).length>0;return(0,q.jsxs)($t,{children:[d&&(nr||(nr=(0,q.jsx)(Z,{title:"client.login.passwordUpdate.title"}))),a&&(tr||(tr=(0,q.jsx)(L.Oi.P,{children:(0,q.jsx)(f.FormattedMessage,{id:"client.login.passwordUpdate.introduction"})}))),(0,q.jsxs)("form",{onSubmit:y,children:[!0===l&&(0,q.jsx)(Yt,or({tabIndex:1,label:O("client.login.passwordUpdate.oldPassword"),name:"oldPassword",value:i.oldPassword,onChange:w,readOnly:h,autoFocus:!0},i.passwordUpdateFailed&&"INVALID_CREDENTIALS"===i.passwordUpdateErrorCode&&{valid:!1})),(0,q.jsx)(Yt,{tabIndex:2,label:O("client.login.passwordUpdate.newPassword"),name:"newPassword",value:i.newPassword,onChange:p,readOnly:j,autoFocus:!0!==l,valid:!P}),(0,q.jsx)(sr,{children:(0,q.jsx)(zt,{rules:m,errors:i.newPasswordValidationErrors,rulesNeutral:!i.newPassword})}),(0,q.jsx)(Yt,{tabIndex:3,label:O("client.login.passwordUpdate.newPasswordRepeat"),name:"newPasswordRepeat",value:i.newPasswordRepeat,onChange:g,readOnly:P,valid:v()}),i.newPasswordRepeat&&i.newPassword!==i.newPasswordRepeat&&(rr||(rr=(0,q.jsx)(L.m2.List,{children:(0,q.jsx)(L.m2.Item,{condition:"danger",label:(0,q.jsx)(f.FormattedMessage,{id:"client.login.passwordUpdate.noMatch"})})}))),!0===i.passwordUpdateFailed&&(0,q.jsx)(Ht,{errorCode:i.passwordUpdateErrorCode}),(0,q.jsx)(Q,{pending:i.passwordUpdatePending,disabled:!1===v(),label:O("client.login.passwordUpdate.saveButton")}),n&&t&&(0,q.jsx)(F.c,{ref:x,badge:"bottomright",size:"invisible",sitekey:n,hl:c.locale})]})]})};var ir={updateOldPassword:Fe,updateNewPassword:function(e){return{type:ke,payload:{newPassword:e}}},updateNewPasswordRepeat:function(e){return{type:Ne,payload:{newPasswordRepeat:e}}},fetchValidationRules:function(){return{type:Ut}},savePassword:function(e){return{type:Ce,payload:{captchaToken:e}}},initialized:function(){return{type:me}},checkCurrentUser:function(){return{type:he}}};const ur=(0,g.Ul)((function(e){return{password:e.passwordUpdate.password,validationRules:e.passwordUpdate.validationRules,showOldPasswordField:e.passwordUpdate.dialog.showOldPasswordField,forcedUpdate:e.passwordUpdate.dialog.forcedUpdate,captchaKey:e.login.captchaKey,needsCaptcha:e.passwordUpdate.dialog.needsCaptcha}}),ir)((0,f.injectIntl)(cr));var lr,dr=t(74208);const pr=function(e){var n=e.locale,t=e.username,r=e.password,a=e.secret,o=e.showTitle,s=e.changePage;return(0,q.jsxs)("div",{children:[o&&(lr||(lr=(0,q.jsx)(Z,{title:"client.login.form.title"}))),(0,q.jsx)(dr.c,{locale:n,username:t,password:r,secret:a,forced:!0,onSuccess:function(){s(j.LOGIN_FORM)}})]})};var fr={changePage:U};const gr=(0,g.Ul)((function(e){return{username:e.login.username,password:e.login.password,secret:e.twoStepLogin.secret,locale:e.intl.locale}}),fr)(pr);var wr,mr,xr,yr=h.cp.div.withConfig({displayName:"StyledTwoStepLogin"})(wr||(wr=(0,O.c)(["\n "," {\n width: 100%;\n }\n\n "," {\n ","\n padding-top: .7rem;\n padding-bottom: 0.7rem;\n }\n"])),L.yi,L.KW,L.cZ);const vr=function(e){var n=e.username,t=e.password,r=e.showTitle,a=e.loginPending,o=e.login,s=e.intl,c=(0,b.useState)(null),i=(0,D.c)(c,2),u=i[0],l=i[1],d=(0,b.useRef)();(0,b.useLayoutEffect)((function(){d.current.querySelector("input").focus()}),[]);var p=function(e){return s.formatMessage({id:e})};return(0,q.jsxs)(yr,{children:[r&&(mr||(mr=(0,q.jsx)(Z,{title:"client.login.form.title"}))),(0,q.jsxs)("form",{onSubmit:function(e){e.preventDefault(),o(n,t,null,u)},ref:d,children:[xr||(xr=(0,q.jsx)(L.Oi.P,{children:(0,q.jsx)(f.FormattedMessage,{id:"client.login.twoStepLogin.introduction"})})),(0,q.jsx)(L._i,{hasValue:!!u,id:"twoFactorCode-label",label:p("client.login.twoStepLogin.codePlaceholder"),labelPosition:"outside",children:(0,q.jsx)(re,{children:(0,q.jsx)(L.Ks,{type:"integer",value:u,events:{onChange:l},options:{format:"### ###",allowLeadingZeros:!0}})})}),(0,q.jsx)(Q,{disabled:!u||u.toString().length<6||a,label:p("client.login.form.button"),pending:a})]})]})};var Or={login:v};const br=(0,g.Ul)((function(e){return{username:e.login.username,password:e.login.password,loginPending:e.loginForm.loginPending}}),Or)((0,f.injectIntl)(vr));var hr;function jr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Pr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?jr(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}const Sr=function(e){var n=e.intl,t=e.checkUsername,r=e.loginPending,a=e.message,o=e.setUsername,s=e.showTitle,c=e.username,i=Y(o),u=(0,D.c)(i,2),l=u[0],d=u[1],p=function(e){return n.formatMessage({id:e})},f=(0,b.useCallback)(function(){var e=(0,_.c)(I().mark((function e(n){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n&&n.preventDefault(),t(c);case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[t,c]);return(0,q.jsxs)(oe,{children:[s&&(hr||(hr=(0,q.jsx)(Z,{title:"client.login.form.title",subtitle:"client.login.form.introduction"}))),(0,q.jsxs)("form",{onSubmit:f,children:[(0,q.jsx)(L._i,{hasValue:!!c||l,id:"login-username",label:p("client.login.form.userEmailPlaceholder"),labelPosition:"outside",children:(0,q.jsx)(re,{children:(0,q.jsx)(te,Pr({autoFocus:!0,name:"user",required:!0,type:"text",value:c,onFocus:function(e){return e.target.select()}},d))})}),(0,q.jsx)(G,{message:a}),(0,q.jsx)(Q,{disabled:!l&&(r||""===c),label:p("client.login.form.next"),pending:r})]})]})};var Er={setUsername:R,checkUsername:function(e){return{type:y,payload:{username:e}}}};const Ar=(0,g.Ul)((function(e){return{username:e.login.username,message:e.loginForm.message,loginPending:e.loginForm.loginPending}}),Er)((0,f.injectIntl)(Sr));var Tr,kr,Ur,Rr=(0,h.Ud)(Tr||(Tr=(0,O.c)(["\n .grecaptcha-badge {\n z-index: 9999999;\n opacity: .8;\n }\n"])));const Nr=function(e){var n,t,r,a,o,s=e.initialize,c=e.showTitle,i=e.currentPage;return(0,b.useEffect)((function(){s()}),[s]),(0,q.jsxs)(q.Fragment,{children:[kr||(kr=(0,q.jsx)(Rr,{})),function(){switch(i){case j.PASSWORD_UPDATE:return n||(n=(0,q.jsx)(ur,{showTitle:c}));case j.PASSWORD_REQUEST:return t||(t=(0,q.jsx)(we,{showTitle:c}));case j.TWOSTEPLOGIN:return r||(r=(0,q.jsx)(br,{showTitle:c}));case j.TWOSTEPLOGIN_ACTIVATION:return Ur||(Ur=(0,q.jsx)(gr,{}));case j.USERNAME_FORM:return a||(a=(0,q.jsx)(Ar,{showTitle:c}));default:return o||(o=(0,q.jsx)(le,{showTitle:c}))}}()]})};var Cr={initialize:function(){return{type:w}}};const _r=(0,g.Ul)((function(e,n){return{currentPage:n.currentPage||e.login.currentPage,showTitle:n.showTitle}}),Cr)((0,f.injectIntl)(Nr));var Dr=t(32612),Mr=t(88608),Ir=(0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)({},S,a.c.singleTransferReducer("entryPage")),P,a.c.singleTransferReducer("currentPage")),E,a.c.singleTransferReducer("username")),A,a.c.singleTransferReducer("password")),T,a.c.singleTransferReducer("captchaKey")),Fr={entryPage:void 0,currentPage:void 0,username:"",password:"",captchaKey:null};const Lr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fr,n=arguments.length>1?arguments[1]:void 0,t=Ir[n.type];return t?t(e,n):e};function Wr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function qr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wr(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Gr=(0,s.c)((0,s.c)((0,s.c)((0,s.c)({},nn,(function(e,n){var t=n.payload,r=t.text,a=t.negative;return qr(qr({},e),{},{message:{text:r,negative:a}})})),tn,(function(e){return qr(qr({},e),{},{message:{}})})),rn,(function(e,n){var t=n.payload;return qr(qr({},e),{},{loginPending:t.pending})})),an,(function(e){return qr(qr({},e),{},{recaptchaActivated:!0})})),Vr={message:{},loginPending:!1,recaptchaActivated:!1};const Hr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Vr,n=arguments.length>1?arguments[1]:void 0,t=Gr[n.type];return t?t(e,n):e};function zr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Kr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zr(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Br={showOldPasswordField:!0,forcedUpdate:!1,standalone:!0,usernameOrPk:"",needsCaptcha:!1},Qr=function(e){return function(n,t){var r=t.payload[e];return Kr(Kr({},n),{},(0,s.c)({},e,r))}},Zr=(0,s.c)((0,s.c)((0,s.c)((0,s.c)((0,s.c)({},xe,Qr("showOldPasswordField")),ve,Qr("forcedUpdate")),ye,Qr("standalone")),Oe,Qr("usernameOrPk")),je,Qr("needsCaptcha"));var Yr=t(11096),Xr=I().mark(na),$r=I().mark(ta),Jr=I().mark(ra),ea=function(e){return e.passwordUpdate.dialog.usernameOrPk};function na(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Q7)([(0,Ye.y0)(be,ta),(0,Ye.y0)(he,ra)]);case 2:case"end":return e.stop()}}),Xr)}function ta(){var e,n,t;return I().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e={acceptedStatusCodes:[403]},r.next=3,(0,Ye.MN)(Xe.c.requestSaga,"principals",e);case 3:if(403!==(n=r.sent).status){r.next=8;break}o.c.logError('input "username" on password-update is mandatory if no user is logged in'),r.next=11;break;case 8:return t=n.body.username,r.next=11,(0,Ye.Aj)(Ee(t));case 11:case"end":return r.stop()}}),$r)}function ra(){var e,n,t,r;return I().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,Ye.MN)(Yr.c.doRequest,"username");case 2:if(e=a.sent,"anonymous"!==e.username){a.next=9;break}return a.next=7,(0,Ye.Aj)(Ae(!0));case 7:a.next=18;break;case 9:return a.next=11,(0,Ye.Ml)(ea);case 11:return n=a.sent,t=Number.isNaN(Number.parseInt(n))?'username == "'.concat(n,'"'):"pk == ".concat(Number.parseInt(n)),a.next=15,(0,Ye.MN)(Xe.c.fetchEntityCount,"Principal",{where:"username == :currentUsername\n and (\n ".concat(t,'\n or not exists(relLogin_role.relRole where unique_id == "usermanager")\n )')});case 15:return r=a.sent,a.next=18,(0,Ye.Aj)(Ae(1===r));case 18:case"end":return a.stop()}}),Jr)}const aa=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Br,n=arguments.length>1?arguments[1]:void 0,t=Zr[n.type];return t?t(e,n):e};var oa=I().mark(ca),sa=I().mark(ia);function ca(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Aj)(l.c.fireExternalEvent("resize"));case 2:case"end":return e.stop()}}),oa)}function ia(){return I().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Ye.Q7)([(0,Ye.y0)(me,ca)]);case 2:case"end":return e.stop()}}),sa)}const ua={dialog:aa,password:kt,validationRules:Gt};var la=[na,ia,Tt,qt],da=(0,s.c)({},ln,a.c.singleTransferReducer("secret")),pa={secret:null};const fa=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pa,n=arguments.length>1?arguments[1]:void 0,t=da[n.type];return t?t(e,n):e},ga={login:Lr,loginForm:Hr,passwordUpdate:(0,Mr.TL)(ua),twoStepLogin:fa};var wa=[Jn].concat((0,Dr.c)(la));function ma(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}var xa="login",ya=["loginSuccess","register","resize"],va={username:j.USERNAME_FORM,"password-request":j.PASSWORD_REQUEST,login:j.LOGIN_FORM},Oa=function(e,n,t,a,o){var s,c=va[n.entryPage]||j.LOGIN_FORM,i=[Pe(!1),(s=!1,{type:ye,payload:{standalone:s}}),R(n.username||""),k(c),U(c)],p=!!n.showTitle,f=(0,q.jsx)(_r,{showTitle:p}),g=r.c.createStore(ga,wa,n,xa);return d.c.setInputEnvs(n),l.c.addToStore(g,(function(e){return r.c.getEvents(ya,e.input)})),u.c.addToStore(g,!0,["console","remote"]),r.c.createApp(xa,f,g,{input:n,actions:i,publicPath:a,textResourceModules:["login"],customTheme:o})},ba=function(e){return r.c.useApp({initApp:Oa,props:e,packageName:xa,externalEvents:ya}).component};ba.propTypes=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ma(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ma(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({showTitle:i().bool,locale:i().string,entryPage:i().oneOf(["username","login","password-request"]),username:i().string,setLocale:i().func,backendUrl:i().string,redirectUrl:i().string,appContext:p.c.propTypes},ya.reduce((function(e,n){return e[n]=i().func,e}),{}));const ha=function(e){var n=e.usernameOrPk,t=e.showTitle;return(0,q.jsx)(L.s5,{required:[n],children:(0,q.jsx)(_r,{currentPage:"PASSWORD_UPDATE",showTitle:t})})};const ja=(0,g.Ul)((function(e,n){return{usernameOrPk:e.passwordUpdate.dialog.usernameOrPk}}),{})((0,f.injectIntl)(ha));function Pa(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Sa(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pa(Object(t),!0).forEach((function(n){(0,s.c)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pa(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ea="password-update",Aa=["success","resize","onVisibilityStatusChange"],Ta=function(e,n,t,a,o){var s=!!n.showTitle,c=!!n.forcedUpdate,i=(0,q.jsx)(ja,{showTitle:s}),p=[Se(c)];"string"!=typeof n.username||0===n.username.length?p.push({type:be}):p.push(Ee(n.username)),"boolean"==typeof n.showOldPasswordField&&p.push(Pe(n.showOldPasswordField));var f=r.c.createStore(ga,wa,n,Ea);return d.c.setInputEnvs(n),l.c.addToStore(f,(function(e){return r.c.getEvents(Aa,e.input)})),u.c.addToStore(f,!0,["console","remote"]),r.c.createApp(Ea,i,f,{input:n,actions:p,publicPath:a,textResourceModules:["login"],customTheme:o})},ka=function(e){return r.c.useApp({initApp:Ta,props:e,packageName:Ea,externalEvents:Aa}).component};ka.propTypes=Sa({username:i().string,showTitle:i().bool,showOldPasswordField:i().bool,oldPassword:i().string,backendUrl:i().string,appContext:p.c.propTypes},Aa.reduce((function(e,n){return Sa(Sa({},e),{},(0,s.c)({},n,i().func))}),{}));var Ua="login";const Ra=ba;r.c.createBundleableApp(Ua,Oa,ba),r.c.createBundleableApp("password-update",Ta,ka)}}]);