{"version":3,"sources":["_platform/src/components/LoginForm/LoginForm.js","_platform/src/components/FormHint/FormHint.js","_platform/src/components/FormPlaceholder/FormPlaceholder.js","_platform/src/components/FormHelpText/FormHelpText.js","_platform/src/components/FormLabel/FormLabel.js","_platform/src/utils/formValidation.js","_platform/src/utils/sanitiseHTML.js","_platform/src/components/FormInput/FormInput.js","_platform/src/components/StatusMessage/StatusMessage.js","_platform/src/components/FormCheckbox/FormCheckbox.js"],"names":["defaultFormLabels","labelUserName","labelPassword","labelRememberMe","LoginForm","props","initialValues","onSubmitForm","status","_props$theme$settings","theme","settingsApp","labels","Object","_codebuild_output_src1621477444_src_HP_Platinum_Club_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_0__","formLabels","react__WEBPACK_IMPORTED_MODULE_1___default","a","createElement","className","react_final_form__WEBPACK_IMPORTED_MODULE_3__","onSubmit","render","_ref","handleSubmit","submitting","method","name","component","FormInput","type","required","validate","label","placeholder","disabled","loginRememberMeEnabled","loginUseSessionStorage","FormCheckbox","_components_StatusMessage_StatusMessage__WEBPACK_IMPORTED_MODULE_8__","variant","statusDetails","message","_components_Button_Button__WEBPACK_IMPORTED_MODULE_5__","loginPasswordResetShow","passwordResetEnabled","passwordResetPagePath","react_router_dom__WEBPACK_IMPORTED_MODULE_9__","to","loginPasswordResetLabel","defaultProps","withTheme","Hint","concat","children","StyledHint","styled","_templateObject","customInputHintColor","gray600","customInputHintFontSize","react__WEBPACK_IMPORTED_MODULE_0__","__webpack_require__","react__WEBPACK_IMPORTED_MODULE_0___default","n","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_1__","FormPlaceholder","inline","py","pl","undefined","FormHelpText","StyledFormHelpText","htmlValue","dangerouslySetInnerHTML","__html","sanitiseHTML","div","Indicator","span","withConfig","displayName","componentId","formPreferOptionalIndicator","CustomLabel","react__WEBPACK_IMPORTED_MODULE_2___default","_StyledLabel","htmlFor","isRequiredIndicator","isRequired","preferOptional","optionalText","formIndicatorOptionalText","requiredText","formIndicatorRequiredText","d","__webpack_exports__","isValid","touched","valid","value","dompurify__WEBPACK_IMPORTED_MODULE_0__","dompurify__WEBPACK_IMPORTED_MODULE_0___default","dompurify","addHook","node","setAttribute","hasAttribute","StyledInput","inputInline","p","_codebuild_output_src1621477444_src_HP_Platinum_Club_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_5__","react__WEBPACK_IMPORTED_MODULE_7___default","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_9__","css","_templateObject2","primary","_this$props","this","input","immutable","meta","helpText","hint","iHaveSuppliedAnExternalLabel","rest","_components_FormHelpText_FormHelpText__WEBPACK_IMPORTED_MODULE_10__","_components_FormLabel_FormLabel__WEBPACK_IMPORTED_MODULE_12__","_components_FormHint_FormHint__WEBPACK_IMPORTED_MODULE_11__","_components_FormPlaceholder_FormPlaceholder__WEBPACK_IMPORTED_MODULE_13__","assign","control","id","error","Component","_components_MessageBox_MessageBox__WEBPACK_IMPORTED_MODULE_1__","StatusMessage","CustomFormCheck","FormCheck","CustomCheckbox","Checkbox","customCheckboxDisabledBackground","gray300","_templateObject3","StyledCheckbox","useHelpTextAsLabel","_codebuild_output_src1621477444_src_HP_Platinum_Club_Lori_FED_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_0__","_smooth_ui_core_sc__WEBPACK_IMPORTED_MODULE_4__","_components_FormHelpText_FormHelpText__WEBPACK_IMPORTED_MODULE_5__","toString","_components_FormPlaceholder_FormPlaceholder__WEBPACK_IMPORTED_MODULE_7__","_components_FormHint_FormHint__WEBPACK_IMPORTED_MODULE_6__"],"mappings":"oMAmCMA,EAAoB,CACxBC,cAAe,oBACfC,cAAe,WACfC,gBAAiB,kBAGbC,EAAY,SAAAC,GAAS,IAEvBC,EAIED,EAJFC,cACAC,EAGE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N,CAGEO,GAAIb,EAAM5F,KACVwG,SAAO,EACPhG,SAAUA,EACVgE,MAAOF,YAAQwB,EAAKvB,QAASuB,EAAKtB,OAClCC,MAAOmB,EAAMnB,MAAQmB,EAAMnB,MAAMiD,gBAAa/E,KAGlDe,EAAApE,EAAAC,cAACiI,EAAA,EAAD,CACE5D,QAASgC,EAAM5F,KACfR,UAAS,GAAAkC,OAAKmE,EAAY,WAAa,GAA9B,KAAAnE,OACP4F,EAAqB,oBAAsB,KAG5CA,EACC5D,EAAApE,EAAAC,cAACkI,EAAA,EAAD,CAAc3E,UAAWiD,EAAUvG,UAAU,sBAE7Cc,EAEFoD,EAAApE,EAAAC,cAAC4D,EAAD,CAAWU,oBAAqBA,IAtDtCC,EAwDUD,EAvDVE,EAwDUmC,EAAKnH,MAAMC,YAAYwE,4BAvDjCQ,EAwDUkC,EAAKnH,MAAMC,YAAYiF,0BAvDjCC,EAwDUgC,EAAKnH,MAAMC,YAAYmF,+BAtDdxB,IAAfmB,EAAiC,KAEjCA,IAAeC,EACVG,GAEJJ,GAAcC,EACVC,EAEF,QAkDF6B,GACCnC,EAAApE,EAAAC,cAACoI,EAAA,EAAD,CAAiBnF,QAAM,GACJ,SAAhBoD,EAAMnB,QAAoC,IAAhBmB,EAAMnB,MAAiB,OAAS,QAIhEuB,EAAOtC,EAAApE,EAAAC,cAACqI,EAAA,EAAD,KAAW5B,GAAmB,KACrCF,EAAKvB,UAAYuB,EAAKtB,MACrBd,EAAApE,EAAAC,cAACiI,EAAA,EAAD,CAAiBhD,MAAOsB,EAAKtB,OAAQsB,EAAKY,OACxC,OAiBRW,EAAe9F,aAAe,CAC5Bf,UAAU,EACVuF,cAAUpD,EACVqD,KAAM,GACNH,WAAW,EACXrD,QAAQ,EACRqB,yBAAqBlB,EACrB2E,wBAAoB3E,GAGPnB,gBAAU6F","file":"static/js/loginForm.1b8b41f8.chunk.js","sourcesContent":["/**\n * LoginForm\n *\n * This component relies on a LoginProvider-like component to supply data and\n * the submit methods via props.\n *\n * Usage:\n *\n * \n * \n * \n *\n * disableMeta on the LoginProvider, and formLabels on this component are optional props\n */\n\n// Core imports\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\n// Style, SEO and settings\nimport { withTheme } from '@smooth-ui/core-sc';\n\n// Component features\nimport { Form, Field } from 'react-final-form';\nimport { required } from '../../utils/formValidation'; // _platform\nimport Button, { ButtonBlock } from '../../components/Button/Button'; // _platform\nimport FormCheckbox from '../../components/FormCheckbox/FormCheckbox'; // _platform\nimport FormInput from '../../components/FormInput/FormInput'; // _platform\nimport StatusMessage from '../../components/StatusMessage/StatusMessage'; // _platform\nimport { Link } from 'react-router-dom';\n\n// Default form labels\n// These will be _shallow merged_ with props.formLabels (if provided)\n// Usage (from parent component):\n// \nconst defaultFormLabels = {\n labelUserName: 'User Name / Email',\n labelPassword: 'Password',\n labelRememberMe: 'Remember Login',\n};\n\nconst LoginForm = props => {\n const {\n initialValues,\n onSubmitForm,\n status,\n theme: { settingsApp = {} },\n } = props;\n const labels = { ...defaultFormLabels, ...props.formLabels }; // Merge props with default values\n const { labelUserName, labelPassword, labelRememberMe } = labels;\n // We could avoid merging into the labels const, then destructuring it, however leaving as 2 steps for legibility\n\n return (\n
\n (\n
\n \n {/* TODO: Form validation */}\n \n {!!settingsApp.loginRememberMeEnabled &&\n !settingsApp.loginUseSessionStorage && (\n \n )}\n\n \n {status.statusDetails.message ||\n (status.status === 'error' && (\n

\n Login Failed. Please remember that passwords are case\n sensitive.\n

\n ))}\n
\n\n \n \n \n \n )}\n />\n {settingsApp.loginPasswordResetShow &&\n settingsApp.passwordResetEnabled &&\n settingsApp.passwordResetPagePath && (\n
\n \n {settingsApp.loginPasswordResetLabel || 'Reset Password'}\n \n
\n )}\n
\n );\n};\nLoginForm.propTypes = {\n formLabels: PropTypes.shape({\n labelUserName: PropTypes.string,\n labelPassword: PropTypes.string,\n labelRememberMe: PropTypes.string,\n }),\n initialValues: PropTypes.object,\n onSubmitForm: PropTypes.func.isRequired,\n status: PropTypes.object.isRequired,\n theme: PropTypes.object,\n};\n\nLoginForm.defaultProps = {\n formLabels: defaultFormLabels,\n initialValues: {},\n theme: { settingsApp: {} },\n};\n\nexport default withTheme(LoginForm);\n","/**\n * FormInput Hint\n *\n * Used to display a hint above the input box\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@smooth-ui/core-sc';\n\nconst Hint = props => (\n
{props.children}
\n);\n\nHint.propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n};\n\nHint.defaultProps = {\n className: '',\n};\n\nconst StyledHint = styled(Hint)`\n color: ${props => props.theme.customInputHintColor || props.theme.gray600};\n font-size: ${props => props.theme.customInputHintFontSize || '0.875em'};\n margin-bottom: 0.5em;\n`;\n\nexport default StyledHint;\n","/**\n * FormPlaceholder\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { Box } from '@smooth-ui/core-sc';\n\nconst FormPlaceholder = ({ children, inline }) => (\n \n {children}\n \n);\n\nFormPlaceholder.propTypes = {\n children: PropTypes.node,\n inline: PropTypes.bool,\n};\n\nFormPlaceholder.defaultProps = {\n children: undefined,\n inline: undefined,\n};\n\nexport default FormPlaceholder;\n","/**\n * Form Fields Help Text\n *\n * Used to display a help text above the input label\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@smooth-ui/core-sc';\nimport sanitiseHTML from '_platform/src/utils/sanitiseHTML';\n\nconst FormHelpText = props => (\n \n {props.htmlValue && (\n \n )}\n {props.children}\n \n);\n\nFormHelpText.propTypes = {\n children: PropTypes.node,\n className: PropTypes.string,\n htmlValue: PropTypes.string,\n};\n\nFormHelpText.defaultProps = {\n children: undefined,\n className: '',\n htmlValue: undefined,\n};\n\nconst StyledFormHelpText = styled.div`\n &.helptext-as-label {\n display: inline;\n\n > div {\n display: inline;\n }\n }\n\n :not(.helptext-as-label) {\n margin-bottom: 0.5em;\n margin-top: 1.5em;\n }\n`;\n\nexport default FormHelpText;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Label, styled, withTheme } from '@smooth-ui/core-sc';\nimport 'styled-components/macro'; // For the CSS prop on elements\n\nconst Indicator = styled.span`\n ${props =>\n props.theme.settingsApp.formPreferOptionalIndicator\n ? `\n font-weight: normal;\n padding-left: 0.25em;\n `\n : 'color: red;'}\n`;\n\nconst whichIndicator = (\n isRequired,\n preferOptional,\n optionalText,\n requiredText\n) => {\n if (isRequired === undefined) return null;\n\n if (isRequired && !preferOptional) {\n return requiredText;\n }\n if (!isRequired && preferOptional) {\n return optionalText;\n }\n return null;\n};\n\nconst CustomLabel = props => {\n return (\n \n {props.children}:\n \n {whichIndicator(\n props.isRequiredIndicator,\n props.theme.settingsApp.formPreferOptionalIndicator,\n props.theme.settingsApp.formIndicatorOptionalText,\n props.theme.settingsApp.formIndicatorRequiredText\n )}\n \n \n );\n};\n\nCustomLabel.propTypes = {\n children: PropTypes.node.isRequired,\n htmlFor: PropTypes.string.isRequired,\n isRequiredIndicator: PropTypes.bool,\n theme: PropTypes.object.isRequired,\n};\n\nCustomLabel.defaultProps = {\n isRequiredIndicator: undefined,\n};\n\nexport default withTheme(CustomLabel);\n","/**\n * Form Validation utilities\n */\n\n// Return `valid` value as expected by control inputs Smooth-UI\nexport const isValid = (touched, valid) => {\n if (!touched) return undefined;\n if (valid) return true;\n if (!valid) return false;\n};\n\n// Required\nexport const required = value => (value ? undefined : 'Required');\n\n// Required with custom message\n// Usage: field.required && requiredWithMessage(field.requiredMessage || 'Required')\n// Check if the field is required, if so issue requiredWithMessage.\n// IMPORTANT: Must provide fallback message, otherwise the method won't run\nexport const requiredWithMessage = message => value =>\n value ? undefined : message;\n\n// Email address - matching the API\nexport const validEmail = value =>\n /\\b[a-zA-Z0-9._%\\-+NULL]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,6}\\b/.test(value) // eslint-disable-line no-useless-escape\n ? undefined\n : 'Please enter a valid email address';\n\n// Numbers only\nexport const validNumber = value =>\n isNaN(value) ? 'Must be a number' : undefined;\n\n// Minimum value\n// Usage: minValue(20)\nexport const minValue = min => value =>\n isNaN(value) || value >= min ? undefined : `Must be greater than ${min}`;\n\n// Compose validators\n// Usage: composeValidators(required, validNumber, minValue(20))\nexport const composeValidators = (...validators) => value =>\n validators.reduce((error, validator) => error || validator(value), undefined);\n","import dompurify from 'dompurify';\n\n// Add a hook to make all links open a new window\ndompurify.addHook('afterSanitizeAttributes', function(node) {\n // set all elements owning target to target=_blank\n if ('target' in node) {\n node.setAttribute('target', '_blank');\n // prevent https://www.owasp.org/index.php/Reverse_Tabnabbing\n node.setAttribute('rel', 'noopener noreferrer');\n }\n // set non-HTML/MathML links to xlink:show=new\n if (\n !node.hasAttribute('target') &&\n (node.hasAttribute('xlink:href') || node.hasAttribute('href'))\n ) {\n node.setAttribute('xlink:show', 'new');\n }\n});\n\nexport default dompurify.sanitize;\n","/**\n * FormInput\n */\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n ControlFeedback,\n css,\n FormGroup,\n Input,\n styled,\n} from '@smooth-ui/core-sc';\nimport FormHelpText from '../../components/FormHelpText/FormHelpText'; // _platform\nimport FormHint from '../../components/FormHint/FormHint'; // _platform\nimport FormLabel from '../../components/FormLabel/FormLabel'; // _platform\nimport FormPlaceholder from '../../components/FormPlaceholder/FormPlaceholder'; // _platform\nimport { isValid } from '../../utils/formValidation'; // _platform\n\n// Prevent inputInline from being passed through to DOM\nconst StyledInput = styled(({ inputInline, ...p }) => )`\n ${props =>\n props.inputInline\n ? css`\n display: inline-block;\n width: auto;\n `\n : null}\n\n :hover {\n border-color: ${props =>\n props.valid === undefined ? props.theme.primary : undefined};\n }\n`;\n\nclass FormInput extends Component {\n render() {\n const {\n input,\n inputInline,\n immutable,\n meta,\n helpText,\n label,\n hint,\n iHaveSuppliedAnExternalLabel,\n isRequiredIndicator,\n ...rest\n } = this.props;\n\n if (\n process.env.NODE_ENV === 'development' &&\n !label &&\n !iHaveSuppliedAnExternalLabel\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Dev: FormInput '${input && input.name}' does not have label specified`\n );\n }\n\n return (\n \n {helpText && }\n {label ? (\n \n {label}\n \n ) : null}\n {hint ? {hint} : null}\n {immutable && {input.value}}\n {!immutable && (\n \n )}\n\n {meta.touched && !meta.valid ? (\n {meta.error}\n ) : null}\n \n );\n }\n}\n\nFormInput.propTypes = {\n helpText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n iHaveSuppliedAnExternalLabel: PropTypes.bool,\n immutable: PropTypes.bool,\n input: PropTypes.object.isRequired,\n inputInline: PropTypes.bool,\n isRequiredIndicator: PropTypes.bool,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n meta: PropTypes.object.isRequired,\n};\n\nFormInput.defaultProps = {\n helpText: undefined,\n hint: '',\n iHaveSuppliedAnExternalLabel: undefined,\n immutable: false,\n inputInline: false,\n isRequiredIndicator: undefined,\n label: undefined,\n};\n\nexport default FormInput;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport MessageBox from '../../components/MessageBox/MessageBox'; // _platform\n\nconst StatusMessage = props => {\n if (!props.children) return null;\n\n return props.variant === 'success' || props.variant === 'error' ? (\n \n ) : null;\n};\n\nStatusMessage.propTypes = {\n variant: PropTypes.string,\n};\n\nStatusMessage.defaultProps = {\n variant: undefined,\n};\n\nexport default StatusMessage;\n","/**\n * FormCheckbox\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport {\n ControlFeedback,\n FormGroup,\n FormCheck,\n Checkbox,\n FormCheckLabel,\n styled,\n withTheme,\n} from '@smooth-ui/core-sc';\nimport FormHelpText from '../../components/FormHelpText/FormHelpText'; // _platform\nimport FormHint from '../../components/FormHint/FormHint'; // _platform\nimport FormPlaceholder from '../../components/FormPlaceholder/FormPlaceholder'; // _platform\nimport { isValid } from '../../utils/formValidation'; // _platform\n\nconst CustomFormCheck = styled(FormCheck)`\n align-items: flex-start;\n`;\n\nconst CustomCheckbox = styled(Checkbox)`\n /* Reset z-index to prevent showing over dropdowns and select elements */\n justify-content: flex-start;\n min-width: 25px;\n z-index: 0;\n\n &:hover > .sui-checkbox-content {\n border-color: ${props =>\n props.valid === undefined ? props.theme.primary : undefined};\n }\n\n input:disabled + .sui-checkbox-content {\n background-color: ${props =>\n props.theme.customCheckboxDisabledBackground || props.theme.gray300};\n }\n`;\n\nconst Indicator = styled.span`\n ${props =>\n props.theme.settingsApp.formPreferOptionalIndicator\n ? `\n font-weight: normal;\n padding-left: 0.25em;\n `\n : 'color: red;'}\n`;\n\nconst whichIndicator = (\n isRequired,\n preferOptional,\n optionalText,\n requiredText\n) => {\n if (isRequired === undefined) return null;\n\n if (isRequired && !preferOptional) {\n return requiredText;\n }\n if (!isRequired && preferOptional) {\n return optionalText;\n }\n return null;\n};\n\nconst StyledCheckbox = ({\n input,\n inline,\n disabled,\n immutable,\n isRequiredIndicator,\n meta,\n helpText,\n label,\n hint,\n useHelpTextAsLabel,\n ...rest\n}) => (\n \n {helpText && !useHelpTextAsLabel && }\n \n {!immutable && (\n \n )}\n \n {useHelpTextAsLabel ? (\n \n ) : (\n label\n )}\n \n {whichIndicator(\n isRequiredIndicator,\n rest.theme.settingsApp.formPreferOptionalIndicator,\n rest.theme.settingsApp.formIndicatorOptionalText,\n rest.theme.settingsApp.formIndicatorRequiredText\n )}\n \n \n {immutable && (\n \n {input.value === 'true' || input.value === true ? ' Yes' : ' No'}\n \n )}\n \n {hint ? {hint} : null}\n {meta.touched && !meta.valid ? (\n {meta.error}\n ) : null}\n \n);\n\nStyledCheckbox.propTypes = {\n disabled: PropTypes.bool,\n helpText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n immutable: PropTypes.bool,\n inline: PropTypes.bool,\n input: PropTypes.object.isRequired,\n isRequiredIndicator: PropTypes.bool,\n label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,\n meta: PropTypes.object.isRequired,\n useHelpTextAsLabel: PropTypes.bool,\n};\n\nStyledCheckbox.defaultProps = {\n disabled: false,\n helpText: undefined,\n hint: '',\n immutable: false,\n inline: false,\n isRequiredIndicator: undefined,\n useHelpTextAsLabel: undefined,\n};\n\nexport default withTheme(StyledCheckbox);\n"],"sourceRoot":""}