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A,O,EAHRD,CAAeG,EAAAA,eAWrB,O,kHCRMC,EAAQ,CACZC,QAAS,SAAAC,GACP,IAAMC,EAAeD,EAAU,GAAK,GACpC,OAAOE,EAAAA,EAAAA,IAAP,eACiBD,EADjB,qBAEoBA,EAFpB,aAGWE,EAAAA,GAAAA,GAHX,gBAIkC,EAAfF,EAJnB,qBAKqC,EAAfA,EALtB,sGAgBFG,MAAO,CACLC,OAAOH,EAAAA,EAAAA,IAAF,oBACiBI,EAAAA,GAAAA,GADjB,QAGLC,MAAML,EAAAA,EAAAA,IAAF,oBACkBI,EAAAA,GAAAA,GADlB,QAGJE,MAAMN,EAAAA,EAAAA,IAAF,SACOI,EAAAA,GAAAA,GADP,qBAEkBA,EAAAA,GAAAA,GAFlB,UAOFG,EAAU,SAAC,GAA6C,IAA3CC,EAA2C,EAA3CA,QAASf,EAAkC,EAAlCA,SAAUK,EAAwB,EAAxBA,QAAYJ,GAAY,kBAC5D,OACE,2BAASM,IAAG,CAAGJ,EAAMC,QAAQC,GAAUF,EAAMM,MAAMM,GAAvC,QAAsDd,GAC/DD,IAWPc,EAAQE,aAAe,CACrBD,QAAS,QACTV,SAAS,GAGX","sources":["webpack://_N_E/./src/cms/models/DesignPage.js","webpack://_N_E/./src/shared/components/Layout.js","webpack://_N_E/./src/shared/components/Section.js"],"sourcesContent":["import { normalize, schema } from 'normalizr';\n\n/**\n * @typedef {Object} Component -\n * @property {number} BlockId -\n * @property {number} BlockComponentId -\n * @property {number} ComponentTypeId -\n * @property {string} ComponentType -\n * @property {string} Title -\n * @property {string} Subheading -\n * @property {string} Paragraph -\n * @property {string} ImageUrl -\n * @property {string} ImageCaption -\n * @property {string} Url -\n * @property {string} AddButton -\n * @property {string} ButtonText -\n * @property {string} ButtonUrl -\n * @property {string} OpenInNewTab -\n * @property {number=} InfographicTypeId -\n * @property {string} InfographicType -\n * @property {number=} ResourceTypeId -\n * @property {string} ResourceType -\n * @property {number} SortOrder -\n * @property {Array} Contents -\n */\n\n/**\n * @typedef {Object} Block\n * @property {number} CorePageId -\n * @property {number} BlockId -\n * @property {number} BlockTypeId -\n * @property {string} BlockType -\n * @property {string} BlockTitle -\n * @property {string} BlockLeadParagraph -\n * @property {string} BlockParagraph -\n * @property {string} BackgroundColor -\n * @property {number} SortOrder -\n * @property {Array} Components -\n */\n\n/**\n * A Page return from /cms/designpage\n * @typedef {Object} PageData\n * @property {number} CorePageId -\n * @property {number} Cat1Id -\n * @property {string} MetaTitle -\n * @property {string} MetaDescription -\n * @property {array} CurrentSubjects -\n * @property {array} MemberAccessLevels -\n * @property {string} PageUrl -\n * @property {string} HeroParagraph -\n * @property {string} HeroHeadline -\n * @property {number=} HeroImageId -\n * @property {string} HeroImageAltText -\n * @property {string} PageAlias -\n * @property {string} Body - Markup\n * @property {string} StatusCode - \"C\"\n * @property {string} DateLastUpdated -\n * @property {Array} Blocks -\n */\n\nfunction generateNormalizedData(data) {\n // prettier-ignore-start\n const content = new schema.Entity('Contents', {}, { idAttribute: 'ComponentContentId' });\n\n const component = new schema.Entity(\n 'Components',\n { Contents: [content] },\n { idAttribute: 'BlockComponentId' }\n );\n\n const block = new schema.Entity(\n 'Blocks',\n { Components: [component] },\n { idAttribute: 'BlockId' }\n );\n // prettier-ignore-end\n\n return normalize(data, {\n Blocks: [block],\n });\n}\n\nfunction formatNormalizedData(entities, result) {\n // These references are used below for sorting.\n const _entities = entities;\n const _result = result;\n const _blocks = _entities.Blocks;\n const _components = _entities.Components;\n const _contents = _entities.Contents;\n\n // Sort the Blocks by their SortOrder value\n _result.Blocks = _result.Blocks\n ? _result.Blocks.sort((a, b) => _blocks[a].SortOrder - _blocks[b].SortOrder)\n : [];\n\n // Sort the Blocks' Components by their SortOrder value\n _entities.Blocks = _blocks\n ? Object.keys(_blocks).reduce((acc, cur) => {\n const _block = _blocks[cur];\n _block.Components = _block.Components.sort((a, b) =>\n _components[a].SortOrder && _components[b].SortOrder\n ? _components[a].SortOrder - _components[b].SortOrder\n : _components[a].BlockComponentId - _components[b].BlockComponentId\n );\n acc[cur] = _block;\n return acc;\n }, {})\n : {};\n\n // Sort the Components' Contents by their SortOrder value\n _entities.Components = _components\n ? Object.keys(_components).reduce((acc, cur) => {\n const _component = _components[cur];\n _component.Contents = _component.Contents.sort(\n (a, b) => _contents[a].SortOrder - _contents[b].SortOrder\n );\n acc[cur] = _component;\n return acc;\n }, {})\n : {};\n\n return {\n ..._result,\n entities: _entities,\n };\n}\n\n/**\n * This uses normalizr to transform the data to a more friendly structure\n *\n * @param {PageData} data\n * @returns {{entities: {Components: {Object}, Blocks: {Object}}, result: {PageData}}} normalized data\n */\nexport function normalizeAndFormatPageData(data) {\n const normalizedData = generateNormalizedData(data);\n\n const { entities, result } = normalizedData;\n const normalizedPage = formatNormalizedData(entities, result);\n\n return normalizedPage;\n}\n\n/** A modal for the cms returned field for design pages */\nexport default class DesignPage {\n /**\n * @param {object} cmsResponseData\n */\n constructor(cmsResponseData) {\n const pageData = normalizeAndFormatPageData(cmsResponseData);\n\n this.entities = pageData.entities;\n this.CorePageId = pageData.CorePageId;\n this.Cat1Id = pageData.Cat1Id;\n this.MetaTitle = pageData.MetaTitle;\n this.MetaDescription = pageData.MetaDescription;\n this.CurrentSubjects = pageData.CurrentSubjects;\n this.MemberAccessLevels = pageData.MemberAccessLevels;\n this.PageUrl = pageData.PageUrl;\n this.HeroHeadline = pageData.HeroHeadline;\n this.HeroParagraph = pageData.HeroParagraph;\n this.HeroImageId = pageData.HeroImageId;\n this.HeroImageAltText = pageData.HeroImageAltText;\n this.PageAlias = pageData.PageAlias;\n this.Body = pageData.Body;\n this.StatusCode = pageData.StatusCode;\n this.DateLastUpdated = pageData.DateLastUpdated;\n this.Blocks = pageData.Blocks;\n }\n\n /**\n * @param {number} id BlockId\n * @returns {object} The block object\n */\n getBlockDataById(id) {\n return this.entities.Blocks[`${id}`];\n }\n\n /**\n * @param {number} id BlockTypeId\n * @returns {object} The block object\n */\n getBlockDataByTypeId(id) {\n const blocks = Object.values(this.entities.Blocks);\n return blocks.find(({ BlockTypeId }) => BlockTypeId === id);\n }\n\n /**\n * @param {number} id BlockId\n * @returns {Array} The objects to which the `result`'s blocks' Components[] refer\n */\n getComponentsDataByBlockId(id) {\n const componentIds = this.entities.Blocks[`${id}`].Components;\n return componentIds.reduce((acc, cur) => {\n acc.push(this.entities.Components[cur]);\n return acc;\n }, []);\n }\n\n /**\n * @param {number} id BlockComponentId\n * @returns {object} The component object\n */\n getComponentDataById(id) {\n return this.entities.Components[`${id}`];\n }\n}\n","import PropTypes from 'prop-types';\nimport React, { PureComponent } from 'react';\n\nclass Layout extends PureComponent {\n render() {\n const { children } = this.props;\n return <>{children};\n }\n}\n\nLayout.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default Layout;\n","import { css, jsx } from '@emotion/react';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { bp, colors } from '@/styles';\n\nconst style = {\n section: halfPad => {\n const paddingValue = halfPad ? 20 : 40;\n return css`\n padding-top: ${paddingValue}px;\n padding-bottom: ${paddingValue}px;\n @media ${bp.md} {\n padding-top: ${paddingValue * 2}px;\n padding-bottom: ${paddingValue * 2}px;\n }\n @media print {\n padding-top: 28px !important;\n padding-bottom: 28px !important;\n }\n &:empty {\n padding: 0;\n }\n `;\n },\n theme: {\n white: css`\n background-color: ${colors.white};\n `,\n gray: css`\n background-color: ${colors.accentGrayUltralight};\n `,\n blue: css`\n color: ${colors.white};\n background-color: ${colors.secondaryBlue};\n `,\n },\n};\n\nconst Section = ({ bgColor, children, halfPad, ...props }) => {\n return (\n
\n {children}\n
\n );\n};\n\nSection.propTypes = {\n bgColor: PropTypes.oneOf(['gray', 'white', 'blue']),\n children: PropTypes.node.isRequired,\n halfPad: PropTypes.bool,\n};\n\nSection.defaultProps = {\n bgColor: 'white',\n halfPad: false,\n};\n\nexport default Section;\n"],"names":["normalizeAndFormatPageData","data","normalizedData","content","schema","idAttribute","component","Contents","block","Components","normalize","Blocks","generateNormalizedData","normalizedPage","entities","result","_entities","_result","_blocks","_components","_contents","sort","a","b","SortOrder","Object","keys","reduce","acc","cur","_block","BlockComponentId","_component","formatNormalizedData","DesignPage","cmsResponseData","pageData","this","CorePageId","Cat1Id","MetaTitle","MetaDescription","CurrentSubjects","MemberAccessLevels","PageUrl","HeroHeadline","HeroParagraph","HeroImageId","HeroImageAltText","PageAlias","Body","StatusCode","DateLastUpdated","id","values","find","BlockTypeId","push","Layout","children","props","PureComponent","style","section","halfPad","paddingValue","css","bp","theme","white","colors","gray","blue","Section","bgColor","defaultProps"],"sourceRoot":""}