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AWC,GAAAA,CAAW,kBAAmBN,KAAK/D,MAAMoB,OAAOgD,WAC3DE,IAAK,MAETlE,eAAgB,CACZgE,UAAWC,GAAAA,CAAW,uBAAwBN,KAAK/D,MAAMoB,OAAOgD,WAChEE,IAAK,QAIb,OAAOP,KAAK/D,MAAMuE,WAAWL,IAIrC,W,sGCpCO,MAAMnE,EAAyDC,IAClE,MAAM,WAAEC,EAAF,WAAcE,EAAd,eAA0BC,GAAmBJ,EACnD,OAAKC,GAAoC,IAAtBA,EAAWI,OAK1BmB,IAAAA,cAACC,EAAAA,OAAMC,OAAAA,OAAAA,GAAKvB,GACNF,EAAW8B,KAAI,CAACC,EAAqBC,IAE/BT,IAAAA,cAACU,EAAAA,KAAIR,OAAAA,OAAAA,GAAKtB,EAAc,CAAE+B,IAAKF,IAC1BD,OARjBhC,EAAME,QAAQI,UAAU2D,MAAM,+CACvB,OAef,K,MC7BAO,EAAOC,QAAUjD,O,OCAjBgD,EAAOC,QAAUC,W","sources":["webpack://mattressfirm/./src/themes/mattressfirm/views/footer-category.view.tsx?df00","webpack://mattressfirm/./lib/footer-category/module-registration.js?7500","webpack://mattressfirm/./src/modules/footer-category/footer-category.tsx?e0bd","webpack://mattressfirm/./src/modules/footer-category/footer-category.view.tsx?fdce","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IFooterCategoryViewProps } from '@msdyn365-commerce-modules/footer';\r\nimport { addThrottledEvent, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { ReactNode, useEffect, useState } from 'react';\r\n\r\n// VSI Customization - START\r\nimport MsDyn365, { ICoreContext } from '@msdyn365-commerce/core';\r\nimport AccordionItem from 'mfcl/AccordionItem';\r\nimport { IFooterCategoryProps } from '../definition-extensions/footer-category.ext.props.autogenerated';\r\n// VSI Customization - END\r\n\r\nexport const FooterCategoryView: React.FC> = props => {\r\n const { categories, context, FooterList, FooterListItem } = props;\r\n if (!categories || !categories.length) {\r\n props.context.telemetry.warning('Footer content is empty, module wont render');\r\n return null;\r\n }\r\n\r\n // VSI Customization - START\r\n\r\n // isMobile state used to check viewport for accordion view\r\n const [isMobile, setIsMobile] = useState(props.context.request.device.Type === 'Mobile');\r\n useEffect(() => {\r\n MsDyn365.isBrowser && addThrottledEvent(window, 'resize', () => updateViewPort(context, setIsMobile));\r\n updateViewPort(context, setIsMobile);\r\n });\r\n\r\n const accordionItemHeading = categories[0] && (categories[0] as JSX.Element).props.config.heading?.text;\r\n const enableAccordion = props.config.enableAccordion;\r\n\r\n return (\r\n \r\n {!isMobile || !enableAccordion ? (\r\n categories.map((category: ReactNode, index: number) => {\r\n return (\r\n \r\n {category}\r\n \r\n );\r\n })\r\n ) : (\r\n {\r\n // first footer-item is heading\r\n if (index === 0) {\r\n return;\r\n }\r\n return (\r\n \r\n {category}\r\n \r\n );\r\n })}\r\n // need to set this to prevent accordion from getting focused on load\r\n focused={0}\r\n />\r\n )}\r\n \r\n );\r\n};\r\n\r\n// update isMobile state when window is resized\r\nconst updateViewPort = (context: ICoreContext, updateState: React.Dispatch>): void => {\r\n let viewport = 'xs';\r\n\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n viewport = 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n viewport = 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n viewport = 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n viewport = 'lg';\r\n } else {\r\n viewport = 'xl';\r\n }\r\n }\r\n }\r\n\r\n viewport === 'xs' || viewport === 'sm' ? updateState(true) : updateState(false);\r\n};\r\n\r\n// VSI Customization - END\r\n\r\nexport default FooterCategoryView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['footer-category'] = {\n c: () => require('@msdyn365-commerce-modules/footer/dist/lib/modules/footer-category/footer-category'),\n $type: 'containerModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'footer-category',\n p: 'footer',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/footer/dist/lib/modules/footer-category'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|themes|mattressfirm|views|footer-category'] = {\n c: () => require('partner/themes/mattressfirm/views/footer-category.view.tsx'),\n cn: '__local__-__local__-footer-category'\n };\nviewDictionary['@msdyn365-commerce-modules|footer|modules|footer-category|footer-category'] = {\n c: () => require('@msdyn365-commerce-modules/footer/dist/lib/modules/footer-category/footer-category.view.js'),\n cn: '@msdyn365-commerce-modules-footer-footer-category'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IFooterCategoryConfig, IFooterCategoryProps } from './footer-category.props.autogenerated';\n\nexport interface IFooterCategoryViewProps extends IFooterCategoryProps {\n categories: React.ReactNode[];\n FooterList: IModuleProps;\n FooterListItem: INodeProps;\n}\n\n/**\n *\n * FooterCategory component.\n * @extends {React.PureComponent>}\n */\nclass FooterCategory extends React.PureComponent> {\n public render(): JSX.Element | null {\n if (!this.props.slots || !this.props.slots.content || this.props.slots.content.length === 0) {\n this.props.context.telemetry.error('footer slots content is empty, module wont render');\n return null;\n }\n const viewprops = {\n ...this.props,\n categories: this.props.slots.content,\n FooterList: {\n moduleProps: this.props,\n className: classnames('ms-footer__list', this.props.config.className),\n tag: 'ul'\n },\n FooterListItem: {\n className: classnames('ms-footer__list-item', this.props.config.className),\n tag: 'li'\n }\n };\n\n return this.props.renderView(viewprops) as React.ReactElement;\n }\n}\n\nexport default FooterCategory;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport React, { ReactNode } from 'react';\n\nimport { IFooterCategoryViewProps } from './footer-category';\n\nexport const FooterCategoryView: React.FC = props => {\n const { categories, FooterList, FooterListItem } = props;\n if (!categories || categories.length === 0) {\n props.context.telemetry.error('Footer content is empty, module wont render');\n return null;\n }\n return (\n \n { categories.map((category: ReactNode, index: number) => {\n return (\n \n {category}\n \n );\n })}\n \n );\n};\n\nexport default FooterCategoryView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["FooterCategoryView","props","categories","context","FooterList","FooterListItem","length","telemetry","warning","isMobile","setIsMobile","useState","request","device","Type","useEffect","MsDyn365","addThrottledEvent","window","updateViewPort","accordionItemHeading","config","heading","text","enableAccordion","React","Module","Object","AccordionItem","title","id","content","map","category","index","Node","key","focused","updateState","viewport","innerWidth","gridSettings","xs","w","sm","md","lg","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","__bindings__","viewDictionary","cn","FooterCategory","render","this","slots","error","viewprops","moduleProps","className","classnames","tag","renderView","module","exports","ReactDOM"],"sourceRoot":""}