{"version":3,"sources":["webpack:///./src/Avensia.Common/Features/ResetPassword/ResetPasswordPage.tsx"],"names":["__webpack_require__","r","__webpack_exports__","tslib__WEBPACK_IMPORTED_MODULE_0__","react__WEBPACK_IMPORTED_MODULE_1__","react__WEBPACK_IMPORTED_MODULE_1___default","n","_glitz_react__WEBPACK_IMPORTED_MODULE_2__","_avensia_scope__WEBPACK_IMPORTED_MODULE_3__","Shared_PageLayout_index__WEBPACK_IMPORTED_MODULE_4__","Shared_Fields_Toggle__WEBPACK_IMPORTED_MODULE_5__","Shared_Button_Feedback__WEBPACK_IMPORTED_MODULE_6__","Shared_Style__WEBPACK_IMPORTED_MODULE_7__","_glitz_core__WEBPACK_IMPORTED_MODULE_8__","Shared_Button__WEBPACK_IMPORTED_MODULE_9__","MainWrapper","Object","width","margin","top","left","right","padding","Small","maxWidth","Large","HeadingWrapper","div","paddingTop","paddingRight","paddingBottom","paddingLeft","Title","h4","marginRight","marginTop","marginBottom","TokenError","color","fontWeight","display","justifyContent","textAlign","ErrorMessage","ShowPasswordWrapper","span","marginLeft","fontSize","PasswordField","input","height","bottom","border","xy","style","FormBottom","PageDescription","SuccessMessage1","ButtonWrapper","alignItems","BkgPattern","backgroundImage","backgroundPosition","backgroundRepeat","position","zIndex","MenuBkg","background","Medium","_super","ResetPassword","props","_this","call","this","onSubmit","e","preventDefault","newPassword","state","trim","setState","changeFailedMessage","token","searchParams","get","email","url","location","pathname","set","feedback","push","then","result","success","resetPasswordSuccessful","Promise","resolve","reject","message","catch","onPasswordFieldInput","target","value","onShowPassword","showPassword","currentTarget","checked","prototype","render","isValid","window","IS_IN_EDIT_MODE","isTokenValid","FeedbackButton","Button","a","createElement","Fragment","appearance","Narrow","for","content","newPasswordTitle","component","mainContent","invalidTokenMessage","required","type","minLength","placeholder","newPasswordLabel","onChange","css","outlineWidth","showPasswordLabel","Primary","submitButtonCaption","passwordResetConfirmation","Component"],"mappings":"2FAAAA,EAAAC,EAAAC,GAAA,IAAAC,EAAAH,E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AAKhD,KAAKH,MAAMoD,QAAQe,yBAK9ChE,KAAKK,MAAMiB,yBACV3F,EAAAgH,EAAAC,cAAC7D,EAAe,KACdpD,EAAAgH,EAAAC,cAAC9G,EAAA,GAAYkH,IAAKhD,KAAKH,MAAMoD,QAAQgB,iCAQrDrE,EAhIkC,CACNjE,EAAAgH,EAAMuB","file":"assets/resetpassword.chunk.7d470dd3d26675103cf5.js","sourcesContent":["/**\r\n * @ComponentFor ResetPasswordPageViewModel\r\n */\r\n\r\nimport React from 'react';\r\nimport { styled } from '@glitz/react';\r\nimport { URLX, postJson, currentUrl, pathCombine, EpiProperty, epiPropertyValue, Breakpoint } from '@avensia/scope';\r\nimport ResetPasswordPageViewModel from './ResetPasswordPageViewModel.type';\r\nimport ResetPasswordResultViewModel from './ResetPasswordResultViewModel.type';\r\nimport { Main, Part, Appearance } from 'Shared/PageLayout/index';\r\nimport { Checkbox } from 'Shared/Fields/Toggle';\r\nimport { connectWithFeedback, ConnectPropType } from 'Shared/Button/Feedback';\r\nimport * as style from 'Shared/Style';\r\nimport { media } from '@glitz/core';\r\nimport { Appearance as ButtonAppearance } from 'Shared/Button';\r\n\r\ntype StateType = {\r\n showPassword?: boolean;\r\n resetPasswordSuccessful?: boolean;\r\n newPassword?: string;\r\n changeFailedMessage?: string;\r\n};\r\n\r\ntype ConnectedProps = ResetPasswordPageViewModel & ConnectPropType;\r\n\r\nconst MainWrapper = styled(Main, {\r\n width: '100%',\r\n margin: {\r\n top: '19px',\r\n left: 'auto',\r\n right: 'auto',\r\n },\r\n padding: {\r\n left: '28px',\r\n right: '28px',\r\n },\r\n ...media(style.mediaMinQueries[Breakpoint.Small], {\r\n maxWidth: 700,\r\n margin: {\r\n top: '80px',\r\n },\r\n padding: {\r\n left: '4vw',\r\n right: '4vw',\r\n },\r\n }),\r\n ...media(style.mediaMinQueries[Breakpoint.Large], {\r\n maxWidth: 800,\r\n padding: {\r\n left: '8vw',\r\n right: '8vw',\r\n },\r\n }),\r\n});\r\n\r\nconst HeadingWrapper = styled.div({\r\n ...media(style.mediaMinQueries[Breakpoint.Small], {\r\n paddingTop: '70px',\r\n paddingRight: 0,\r\n paddingBottom: 0,\r\n paddingLeft: 0,\r\n }),\r\n});\r\n\r\nconst Title = styled.h4({\r\n marginRight: '46px',\r\n marginTop: '14px',\r\n marginBottom: '8px',\r\n});\r\n\r\nconst TokenError = styled.div({\r\n color: '#FF0000',\r\n fontWeight: 'bold',\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n marginBottom: 20,\r\n textAlign: 'center',\r\n});\r\n\r\nconst ErrorMessage = styled.div({\r\n color: '#FF0000',\r\n fontWeight: 'bold',\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n marginBottom: 20,\r\n textAlign: 'center',\r\n});\r\nconst ShowPasswordWrapper = styled.span({\r\n marginLeft: 9,\r\n fontSize: 16,\r\n fontWeight: 300,\r\n color: style.secondaryDarker,\r\n});\r\nconst PasswordField = styled.input({\r\n width: '100%',\r\n marginBottom: style.large,\r\n height: 39,\r\n padding: {\r\n top: 10,\r\n bottom: 10,\r\n left: 12,\r\n },\r\n border: {\r\n xy: {\r\n style: 'solid',\r\n color: style.tertiaryLightest,\r\n width: 1,\r\n },\r\n },\r\n});\r\n\r\nconst FormBottom = styled.div({\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n});\r\n\r\nconst PageDescription = styled.div({\r\n marginBottom: '8px',\r\n});\r\n\r\nconst SuccessMessage1 = styled.div({});\r\n\r\nconst ButtonWrapper = styled.div({\r\n display: 'flex',\r\n alignItems: 'center',\r\n margin: {\r\n top: '35px',\r\n },\r\n justifyContent: 'center',\r\n});\r\n\r\nconst BkgPattern = styled.div({\r\n ...media(style.mediaMinQueries[Breakpoint.Small], {\r\n backgroundImage:\r\n 'url(' +\r\n require('../Shared/Image/PatternLeft.png') +\r\n '), url(' +\r\n require('../Shared/Image/PatternRight.png') +\r\n ') ',\r\n backgroundPosition: 'top left, top right',\r\n backgroundRepeat: 'repeat-y',\r\n position: 'absolute',\r\n top: 0,\r\n bottom: 0,\r\n width: '100%',\r\n zIndex: -1,\r\n }),\r\n});\r\n\r\nconst MenuBkg = styled.div({\r\n position: 'fixed',\r\n ...media(style.mediaMinQueries[Breakpoint.Small], {\r\n position: 'absolute',\r\n }),\r\n background: style.primaryDark,\r\n zIndex: -1,\r\n top: 0,\r\n width: '100%',\r\n height: '65px',\r\n ...media(style.mediaMinQueries[Breakpoint.Medium], {\r\n height: '80px',\r\n }),\r\n});\r\n\r\nexport default connectWithFeedback()(\r\n class ResetPassword extends React.Component {\r\n newPasswordElement: any;\r\n\r\n constructor(props: ConnectedProps) {\r\n super(props);\r\n this.state = {\r\n showPassword: false,\r\n newPassword: '',\r\n changeFailedMessage: '',\r\n resetPasswordSuccessful: false,\r\n };\r\n }\r\n\r\n onSubmit = (e: React.FormEvent) => {\r\n e.preventDefault();\r\n const newPassword = this.state.newPassword.trim();\r\n if (!newPassword) {\r\n return;\r\n }\r\n\r\n this.setState({ changeFailedMessage: '' });\r\n const token = currentUrl().searchParams.get('token');\r\n const email = currentUrl().searchParams.get('email');\r\n const url = new URLX(pathCombine(location.pathname, 'UpdatePassword'));\r\n url.searchParams.set('newPassword', newPassword);\r\n url.searchParams.set('token', token);\r\n url.searchParams.set('email', email);\r\n\r\n this.props.feedback.push(\r\n postJson(url)\r\n .then((result: ResetPasswordResultViewModel) => {\r\n if (result.success) {\r\n this.setState({ resetPasswordSuccessful: true });\r\n return Promise.resolve();\r\n } else {\r\n return Promise.reject(result.message);\r\n }\r\n })\r\n .catch(e => {\r\n this.setState({ changeFailedMessage: e });\r\n return Promise.reject(null);\r\n }),\r\n );\r\n };\r\n\r\n onPasswordFieldInput = (e: React.FormEvent) => {\r\n this.setState({\r\n newPassword: (e.target as HTMLInputElement).value,\r\n changeFailedMessage: '',\r\n });\r\n };\r\n\r\n onShowPassword = (e: React.ChangeEvent) => {\r\n this.setState({ showPassword: e.currentTarget.checked });\r\n };\r\n\r\n render() {\r\n const isValid = window.IS_IN_EDIT_MODE || this.props.isTokenValid;\r\n const FeedbackButton = this.props.feedback.Button;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {isValid &&\r\n !this.state.resetPasswordSuccessful && (\r\n \r\n )}\r\n \r\n \r\n {!isValid && (\r\n \r\n \r\n \r\n )}\r\n {isValid &&\r\n !this.state.resetPasswordSuccessful && (\r\n
\r\n \r\n {!!this.state.changeFailedMessage && {this.state.changeFailedMessage}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {this.state.resetPasswordSuccessful && (\r\n \r\n \r\n \r\n )}\r\n
\r\n
\r\n \r\n );\r\n }\r\n },\r\n);\r\n"],"sourceRoot":""}