{"version":3,"sources":["../node_modules/memoize-one/dist/memoize-one.esm.js","_platform/src/components/MessageBox/MessageBox.js","_platform/src/utils/checkPermissions.js","_platform/src/utils/checkRoles.js","_platform/src/utils/PrivateComponent.js","components/CustomComponents/CustomHeaderNav/HeaderNavContainer.js","components/CustomComponents/CustomHeaderNav/HeaderNavMenuToggleButton.js","components/CustomComponents/CustomHeaderNav/HeaderNavTopLevel.js","components/CustomComponents/CustomHeaderNav/HeaderNavSubLevel.js","components/CustomComponents/CustomHeaderNav/HeaderNavLink.js","components/CustomComponents/CustomHeaderNav/HeaderNav.js"],"names":["safeIsNaN","Number","isNaN","value","areInputsEqual","newInputs","lastInputs","length","i","first","second","__webpack_exports__","resultFn","isEqual","lastThis","lastResult","lastArgs","calledOnce","newArgs","_i","arguments","this","apply","StyledAlert","styled","Alert","_templateObject","Title","div","_templateObject2","Multiline","_templateObject3","MessageBox","_ref","children","_ref$title","title","undefined","_ref$variant","variant","react__WEBPACK_IMPORTED_MODULE_1___default","a","createElement","defaultProps","checkPermissions","currentUser","requiredPermissions","Array","isArray","permissions","some","item","indexOf","propTypes","PropTypes","object","isRequired","array","checkPermissionsMemoized","memoizeOne","checkRoles","requiredRoles","roles","checkRolesMemoized","PrivateComponent","_this$props","props","deniedPermissions","deniedRoles","displayError","errorMessage","publicOnly","redirectOnError","tempAuthAllowed","user","_this$props2","currentUserTemp","UnauthorisedComponent","react_default","RedirectOnErrorComponent","react_router","push","to","userObject","token","userId","Component","mapStateToProps","createStructuredSelector","selectCurrentUser","selectCurrentUserTemp","connect","nav","down","css","thd","openMobileMenu","button","HeaderNavMenuToggleButton_templateObject","HeaderNavMenuToggleButton_templateObject2","transparentize","ul","HeaderNavTopLevel_templateObject","up","HeaderNavTopLevel_templateObject2","HeaderNavSubLevel_templateObject","theme","customSubMenuBackground","customHeaderBackground","HeaderNavSubLevel_templateObject2","depth","NavLink","HeaderNavLink_templateObject","concat","HeaderNavLink_templateObject2","HeaderNavLink_templateObject3","Overlay","HeaderNav_templateObject","p","customMobileMenuOverlayBackground","isMobileMenuOpen","SubMenu","parent","onCloseMobileMenu","HeaderNavSubLevel","map","inMenu","menuPath","key","menuId","HeaderNavLink","activeClassName","onClick","itemName","HeaderNav","_this","Object","classCallCheck","possibleConstructorReturn","getPrototypeOf","call","onMobileMenuToggle","setState","prevState","state","_this2","menu","Fragment","HeaderNavMenuToggleButton","HeaderNavContainer","HeaderNavTopLevel","showLoginInMenu","settingsApp","loginPagePath","exact","HeaderNav_SubMenu","showLogoutInMenu","logoutPagePath","withTheme"],"mappings":"+FAAA,IAAAA,EAAAC,OAAAC,OAAA,SAAAC,GACA,wBAAAA,UAeA,SAAAC,EAAAC,EAAAC,GACA,GAAAD,EAAAE,SAAAD,EAAAC,OACA,SAGA,QAAAC,EAAA,EAAiBA,EAAAH,EAAAE,OAAsBC,IACvC,GAlBAC,EAkBAJ,EAAAG,GAlBAE,EAkBAJ,EAAAE,KAjBAC,IAAAC,GAIAV,EAAAS,IAAAT,EAAAU,IAcA,SAnBA,IAAAD,EAAAC,EAuBA,SAkCeC,EAAA,EA/Bf,SAAAC,EAAAC,GAKA,IAAAC,OAJA,IAAAD,IACAA,EAAAT,GAIA,IACAW,EADAC,EAAA,GAEAC,GAAA,EAoBA,OAlBA,WAGA,IAFA,IAAAC,EAAA,GAEAC,EAAA,EAAoBA,EAAAC,UAAAb,OAAuBY,IAC3CD,EAAAC,GAAAC,UAAAD,GAGA,OAAAF,GAAAH,IAAAO,MAAAR,EAAAK,EAAAF,GACAD,GAGAA,EAAAH,EAAAU,MAAAD,KAAAH,GACAD,GAAA,EACAH,EAAAO,KACAL,EAAAE,EACAH,2WCnDA,IAAMQ,EAAcC,YAAOC,IAAPD,CAAHE,KAIJC,EAAQH,IAAOI,IAAVC,KAILC,EAAYN,IAAOI,IAAVG,KAIhBC,EAAa,SAAAC,GAA0D,IAAvDC,EAAuDD,EAAvDC,SAAuDC,EAAAF,EAA7CG,aAA6C,IAAAD,OAArCE,EAAqCF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kBvH,GAGLyH,sBAAUxB","file":"static/js/headerNav.8c68584f.chunk.js","sourcesContent":["var safeIsNaN = Number.isNaN || function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n};\n\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n\n return false;\n}\n\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = areInputsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n function memoized() {\n var newArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n\n return memoized;\n}\n\nexport default memoizeOne;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Alert, styled } from '@smooth-ui/core-sc';\n\nconst StyledAlert = styled(Alert)`\n margin-top: 1rem;\n`;\n\nexport const Title = styled.div`\n font-weight: bold;\n`;\n\nexport const Multiline = styled.div`\n white-space: pre-line;\n`;\n\nconst MessageBox = ({ children, title = undefined, variant = 'primary' }) => {\n return (\n \n {title ? {title} : null}\n {children}\n \n );\n};\n\nMessageBox.propTypes = {\n children: PropTypes.node.isRequired,\n title: PropTypes.string,\n variant: PropTypes.string,\n};\n\nMessageBox.defaultProps = {\n title: undefined,\n variant: 'primary',\n};\n\nexport default MessageBox;\n","/**\n * Check Permissions - Check if the user has ANY of the required permissions\n *\n * @param {object} currentUser The user object containing the permissions property\n * @param {array} requiredPermissions The array of required permissions\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkPermissions = (currentUser, requiredPermissions) => {\n if (\n !requiredPermissions ||\n !Array.isArray(requiredPermissions) ||\n !currentUser ||\n !currentUser.permissions ||\n !Array.isArray(currentUser.permissions)\n )\n return false;\n\n return currentUser.permissions.some(\n item => requiredPermissions.indexOf(item) >= 0\n );\n};\n\ncheckPermissions.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredPermissions: PropTypes.array.isRequired,\n};\n\nconst checkPermissionsMemoized = memoizeOne(checkPermissions);\n\nexport default checkPermissionsMemoized;\n","/**\n * Check Roles - Check if the user has ANY of the required roles\n *\n * @param {object} currentUser The user object containing the roles property\n * @param {array} requiredRoles The array of required roles\n *\n */\n\nimport memoizeOne from 'memoize-one';\nimport PropTypes from 'prop-types';\n\nconst checkRoles = (currentUser, requiredRoles) => {\n if (\n !requiredRoles ||\n !Array.isArray(requiredRoles) ||\n !currentUser ||\n !currentUser.roles ||\n !Array.isArray(currentUser.roles)\n )\n return false;\n\n return currentUser.roles.some(item => requiredRoles.indexOf(item) >= 0);\n};\n\ncheckRoles.propTypes = {\n currentUser: PropTypes.object.isRequired,\n requiredRoles: PropTypes.array.isRequired,\n};\n\nconst checkRolesMemoized = memoizeOne(checkRoles);\n\nexport default checkRolesMemoized;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { createStructuredSelector } from 'reselect';\nimport { Redirect } from 'react-router-dom';\nimport {\n selectCurrentUser,\n selectCurrentUserTemp,\n} from '../containers/App/selectors'; // _platform\nimport checkPermissions from '../utils/checkPermissions'; // _platform\nimport checkRoles from '../utils/checkRoles'; // _platform\nimport MessageBox from '../components/MessageBox/MessageBox'; // _platform\n\n/**\n * Private Component - HoC to determine whether a component should be displayed\n * based on authentication, permissions and/or roles\n *\n * TODO: Extend with prop to supply function to determine permission `verifyFn` similar to LoadAsync\n *\n * The `user` prop can be either currentUser or currentUserTemp, depending on what the parent component determines is applicable.\n * If the `user` prop is not supplied, then this component will retrieve the user data via the App selectors.\n * The `tempAuthAllowed` prop determines whether currentUserTemp can be used\n *\n * `publicOnly` prop inverts the check so that the child component is only displayed to unauthenticated users (use `PublicComponent`)\n *\n * `deniedPermissions` and `deniedRoles` props take precedence over `requiredPermissions` and `requiredRoles`.\n * For example, if the props are `requiredRoles={['Administrator']} deniedRoles={['Administrator']}`,\n * users with the `Administrator` role will be denied access to the child component.\n *\n * If the checks determine that the access should be denied to the child component:\n * - By default the child component is skipped silently\n * - If the `redirectOnError` prop is supplied, the user will be redirected to the supplied local path\n * - Otherwise, if the `displayError` prop is supplied, the user will be shown an error\n * which can be customised via the `errorMessage` prop\n */\n\nclass PrivateComponent extends Component {\n render() {\n const {\n deniedPermissions,\n deniedRoles,\n displayError,\n errorMessage,\n publicOnly,\n redirectOnError,\n requiredPermissions,\n requiredRoles,\n tempAuthAllowed,\n user,\n } = this.props;\n const { currentUser, currentUserTemp } = this.props;\n\n const UnauthorisedComponent = displayError ? (\n \n {errorMessage || 'Unauthorised'}\n \n ) : null;\n\n const RedirectOnErrorComponent = redirectOnError ? (\n \n ) : null;\n\n // Determine which user object to use\n // 1. Use `user` prop if supplied\n // 2. If `tempAuthAllowed` prop:\n // 1. Is true: use `currentUserTemp` if available, if not use currentUser\n // 3. Is false: use currentUser\n //\n // Check for user.token and currentUserTemp.token to ensure they're not the\n // default empty objects. Cleaner than using Object.keys\n let userObject = {};\n if (user && user.token && user.userId) {\n userObject = user;\n } else if (tempAuthAllowed && currentUserTemp && currentUserTemp.token) {\n userObject = currentUserTemp;\n } else {\n userObject = currentUser;\n }\n\n // Invert the check if the publicOnly prop is supplied - used in PublicComponent\n if (publicOnly) {\n return !userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular permissions if supplied\n if (\n !!userObject.token &&\n ((deniedPermissions && checkPermissions(userObject, deniedPermissions)) ||\n (requiredPermissions &&\n !checkPermissions(userObject, requiredPermissions)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n // Check granular roles if supplied\n if (\n !!userObject.token &&\n ((deniedRoles && checkRoles(userObject, deniedRoles)) ||\n (requiredRoles && !checkRoles(userObject, requiredRoles)))\n ) {\n return RedirectOnErrorComponent || UnauthorisedComponent;\n }\n\n return !!userObject.token\n ? this.props.children\n : RedirectOnErrorComponent || UnauthorisedComponent;\n }\n}\n\nPrivateComponent.propTypes = {\n children: PropTypes.node.isRequired,\n currentUser: PropTypes.object.isRequired,\n currentUserTemp: PropTypes.object.isRequired,\n deniedPermissions: PropTypes.array,\n deniedRoles: PropTypes.array,\n displayError: PropTypes.bool,\n errorMessage: PropTypes.string,\n publicOnly: PropTypes.bool, // Inverts PrivateComponent - displays component to unauthenticated users only. Used by PublicComponent wrapper\n redirectOnError: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n requiredPermissions: PropTypes.array,\n requiredRoles: PropTypes.array,\n tempAuthAllowed: PropTypes.bool,\n user: PropTypes.object,\n};\n\nPrivateComponent.defaultProps = {\n deniedPermissions: undefined,\n deniedRoles: undefined,\n displayError: false,\n errorMessage: undefined,\n publicOnly: false,\n redirectOnError: undefined,\n requiredPermissions: undefined,\n requiredRoles: undefined,\n tempAuthAllowed: false,\n user: {},\n};\n\nconst mapStateToProps = createStructuredSelector({\n currentUser: selectCurrentUser(),\n currentUserTemp: selectCurrentUserTemp(),\n});\n\nexport default connect(\n mapStateToProps,\n null\n)(PrivateComponent);\n","import { css, down, styled, thd } from '@smooth-ui/core-sc';\n\nexport default styled.nav`\n transition: all 0.3s ease 0s;\n\n ${down(\n 'lg',\n css`\n background-color: ${thd('customMenuBackground', '#fff')};\n height: 100vh;\n overflow-y: scroll;\n position: fixed;\n right: ${props => (props.openMobileMenu ? '0' : '-240px')};\n top: 0;\n visibility: ${props => (props.openMobileMenu ? 'visible' : 'hidden')};\n width: 240px;\n z-index: 100;\n `\n )};\n`;\n","import { css, down, styled, thd } from '@smooth-ui/core-sc';\nimport { transparentize } from 'polished';\n\nexport default styled.button`\n display: none;\n\n ${down(\n 'lg',\n css`\n background-color: ${props =>\n props.openMobileMenu ? transparentize(0.25, '#151d29') : 'transparent'};\n border: none;\n display: inline-block;\n font-size: 0.75rem;\n height: 54px;\n position: absolute;\n right: ${props => (props.openMobileMenu ? '250px' : '10px')};\n text-transform: uppercase;\n top: 11px;\n transition: all 0.3s ease 0s;\n width: 54px;\n z-index: ${props => (props.openMobileMenu ? '1' : '0')};\n `\n )};\n\n & > span {\n background-color: ${props =>\n props.openMobileMenu ? '' : thd('customMenuColor', '#fff')};\n display: block;\n height: 4px;\n left: 7px;\n position: absolute;\n right: 7px;\n top: 15px;\n\n &::after,\n &::before {\n background-color: ${thd('customMenuColor', '#fff')};\n content: '';\n display: block;\n height: 4px;\n left: 0;\n position: absolute;\n width: 100%;\n }\n\n &::before {\n top: -8px;\n ${props =>\n props.openMobileMenu ? 'top: 0; transform: rotate(45deg)' : ''};\n }\n &::after {\n bottom: -8px;\n ${props =>\n props.openMobileMenu ? 'bottom: 0; transform: rotate(-45deg)' : ''};\n }\n }\n\n & > div {\n color: ${thd('customMenuColor', '#fff')};\n position: absolute;\n bottom: 4px;\n left: 50%;\n transform: translateX(-50%);\n }\n`;\n","import { css, styled, up } from '@smooth-ui/core-sc';\n\nexport default styled.ul`\n list-style: none;\n margin: 0;\n padding: 0;\n position: relative;\n transition: all 0.3s ease 0s;\n\n ${up(\n 'lg',\n css`\n display: flex;\n justify-content: center;\n text-align: center;\n\n & > li {\n display: inline-block;\n position: relative;\n }\n\n li > ul {\n display: none;\n }\n li:hover > ul,\n li > ul:hover {\n display: block;\n }\n `\n )}\n`;\n","import { css, styled, up } from '@smooth-ui/core-sc';\n\nexport default styled.ul`\n background-color: ${props =>\n props.theme.customSubMenuBackground ||\n props.theme.customHeaderBackground ||\n '#fff'};\n display: block;\n list-style: none;\n margin: 0;\n min-width: 180px;\n padding: 0;\n\n ${up(\n 'lg',\n css`\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0.25rem 2rem;\n text-align: left;\n ${props =>\n props.depth === 2 &&\n css`\n position: absolute;\n top: 100%;\n z-index: 100;\n `}\n\n li {\n position: relative;\n }\n `\n )}\n`;\n","import { css, styled, thd, up } from '@smooth-ui/core-sc';\nimport { NavLink } from 'react-router-dom';\n\nexport default styled(NavLink)`\n border-left: 3px solid transparent;\n color: ${thd('customMenuColor', '#54707c')};\n display: block;\n font-size: 20px;\n font-weight: 550;\n font-variation-settings: 'wght' 550;\n padding: 0.5em;\n ${props =>\n props.depth && props.depth > 1 && `padding-left: ${props.depth - 1}em;`}\n text-decoration: none;\n\n &:hover {\n color: ${thd('customMenuHighlightColor', '#000')};\n }\n\n &:focus,\n &.menu-active:focus {\n outline: none;\n box-shadow: 0 0 0 0.2rem ${thd('customMenuFocus', 'rgba(84,112,124,0.25)')}\n inset;\n }\n\n &.menu-active {\n border-left-color: ${thd('customMenuHighlightColor', '#54707c')};\n color: ${thd('customMenuHighlightColor', '#000')};\n font-weight: bold;\n }\n\n ${up(\n 'lg',\n css`\n font-size: 16px;\n ${props =>\n // If it's the top level\n (!props.depth || props.depth < 2) &&\n css`\n border-left: 0 none;\n border-bottom: 5px solid transparent;\n margin-left: 0.7rem;\n margin-right: 0.7rem;\n padding: 0.25em 0.2em;\n `}\n\n &.menu-active {\n //border-bottom: 5px solid ${thd('secondary', 'gold')};\n &:hover {\n color: ${thd('customMenuHighlightColor', '#000')};\n }\n }\n `\n )}\n`;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport NavContainer from './HeaderNavContainer';\nimport MenuToggleButton from './HeaderNavMenuToggleButton';\nimport TopLevel from './HeaderNavTopLevel';\nimport SubLevel from './HeaderNavSubLevel';\nimport HeaderNavLink from './HeaderNavLink';\nimport PrivateComponent from '_platform/src/utils/PrivateComponent';\nimport { styled, withTheme } from '@smooth-ui/core-sc';\n\nconst Overlay = styled.div`\n background-color: ${p =>\n p.theme.customMobileMenuOverlayBackground || 'rgba(0, 0, 0, 0.5)'};\n bottom: 0;\n height: 100vh;\n left: 0;\n opacity: ${p => (p.isMobileMenuOpen ? '1' : '0')};\n position: fixed;\n right: 0;\n top: 0;\n transition: opacity 0.3s ease 0s;\n visibility: ${p => (p.isMobileMenuOpen ? 'visible' : 'hidden')};\n z-index: 1;\n`;\n\nconst SubMenu = ({ depth, parent, onCloseMobileMenu }) => (\n \n {parent.children.map(\n item =>\n item.inMenu &&\n !!item.menuPath && (\n
  • \n \n {item.itemName}\n \n {item.children && item.children.length > 0 && (\n \n )}\n
  • \n )\n )}\n
    \n);\n\nSubMenu.propTypes = {\n depth: PropTypes.number, // eslint-disable-line react/require-default-props\n onCloseMobileMenu: PropTypes.func.isRequired,\n parent: PropTypes.object.isRequired,\n};\n\nclass HeaderNav extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n isMobileMenuOpen: false,\n };\n }\n\n onMobileMenuToggle = () => {\n this.setState(prevState => ({\n isMobileMenuOpen: !prevState.isMobileMenuOpen,\n }));\n };\n\n render() {\n if (!this.props.menu || this.props.menu.length < 1) {\n return null;\n }\n\n return (\n \n {/* Keyboard event is handled on the button (enter/space/escape) */}\n {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */}\n this.setState({ isMobileMenuOpen: false })}\n />\n \n \n
    {this.state.isMobileMenuOpen ? 'Close' : 'Menu'}
    \n \n \n \n {this.props.showLoginInMenu && (\n
  • \n \n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false })\n }\n >\n Log In\n \n
  • \n )}\n {this.props.menu &&\n this.props.menu.map(\n item =>\n item.inMenu &&\n !!item.menuPath && (\n
  • \n \n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false })\n }\n >\n {item.itemName}\n \n {item.children && item.children.length > 0 && (\n \n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false })\n }\n />\n )}\n
  • \n )\n )}\n {this.props.showLogoutInMenu && (\n \n
  • \n \n this.state.isMobileMenuOpen &&\n this.setState({ isMobileMenuOpen: false })\n }\n >\n Logout\n \n
  • \n
    \n )}\n
    \n
    \n
    \n );\n }\n}\n\nHeaderNav.propTypes = {\n menu: PropTypes.array,\n showLoginInMenu: PropTypes.bool,\n showLogoutInMenu: PropTypes.bool,\n theme: PropTypes.object.isRequired,\n};\n\nHeaderNav.defaultProps = {\n menu: undefined,\n showLoginInMenu: undefined,\n showLogoutInMenu: undefined,\n};\n\nexport default withTheme(HeaderNav);\n"],"sourceRoot":""}