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QsL,QAAW,GAC3G,QAASF,KAAaC,GAMbE,EAAoBC,GAEzB,CACIA,EAAQC,QAAUjB,EAAegB,EAAQC,QACzCD,EAAQE,OAASlB,EAAegB,EAAQE,MAAO,SAC/CF,EAAQG,QAAUnB,EAAegB,EAAQG,OAAQ,UACjDH,EAAQI,OAASpB,EAAegB,EAAQI,MAAO,UACjDC,OAAOC,SAGJzB,EAAY,IAAI0B,IAAoB,CAC7C,CAAC,MAAO,YACR,CAAC,MAAO,YACR,CAAC,QAAS,YACV,CAAC,OAAQ,YACT,CAAC,MAAO,YACR,CAAC,SAAU,mCC/EfC,EAAOC,QAAUtI,2BCAjBqI,EAAOC,QAAUC","sources":["webpack://henrys-ecommerce/./lib/default-container/module-registration.js?41a8","webpack://henrys-ecommerce/./src/components/container-background-image/container-background-image-helper.ts?ce2e","webpack://henrys-ecommerce/./src/components/container-background-image/container-backgroud-image.tsx?e863","webpack://henrys-ecommerce/./src/components/base-components.tsx?daec","webpack://henrys-ecommerce/./src/modules/default-container/default-container.tsx?01c3","webpack://henrys-ecommerce/./src/utils/classnames.ts?a0ff","webpack://henrys-ecommerce/external var \"React\"?0d3b","webpack://henrys-ecommerce/external var \"ReactDOM\"?853b"],"sourcesContent":["const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['default-container'] = {\n c: () => require('@msdyn365-commerce-modules/core-components/dist/lib/modules/default-container/default-container'),\n $type: 'containerModule',\n da: [],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'default-container',\n p: 'core-components',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/core-components/dist/lib/modules/default-container'\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 * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, {\n constructViewportInformationForImage,\n getImageResizeUrl,\n getLargestGridSettingViewportName,\n getMinMaxWidth,\n IAny,\n IGeneric,\n IViewPort,\n Viewport\n} from '@msdyn365-commerce/core-internal';\nimport { cloneDeep as _cloneDeep } from 'lodash';\nimport {\n BackgroundImageRepeat,\n BackgroundImageSize,\n IBackgroundImageAttributes,\n IBackgroundImageLazyloadAttributes,\n IBackgroundImageProps,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst getBackgroundRepeatProperty = (size: string | undefined, repeat: string | undefined): BackgroundImageRepeat => {\n if (!size || size === 'cover') {\n return 'no-repeat';\n }\n switch (repeat) {\n case 'noRepeat':\n return 'no-repeat';\n case 'repeat':\n return 'repeat';\n default:\n return 'no-repeat';\n }\n};\n\nconst getBackgroundSizeProperty = (size: string | undefined): BackgroundImageSize => {\n switch (size) {\n case 'cover':\n return 'cover';\n case 'contain':\n return 'contain';\n case 'default':\n default:\n return undefined;\n }\n};\n\nconst getDefaultViewports = (): IViewPort => {\n return {\n xs: {\n w: 800,\n h: 600\n },\n sm: {\n w: 1200,\n h: 900\n },\n md: {\n w: 1600,\n h: 900\n },\n lg: {\n w: 1600,\n h: 700\n },\n xl: {\n w: 1600,\n h: 700\n }\n };\n};\n\nconst getAuthoringViewport = (moduleName: string | undefined, layout: string | undefined): IViewPort | undefined => {\n if (!msdyn365Commerce.isBrowser) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const authoringHelper = (window as any)._msdyn365.authoringHelper;\n if (!authoringHelper) {\n return;\n }\n\n // if authoring helper is setup, component is rendering from site builder. Build viewport based on layout selected.\n return constructViewportInformationForImage(moduleName, layout, 'backgroundImage', authoringHelper?.themeSettings) as IViewPort;\n};\n\nexport const buildBackgroundImageStylesByViewport = (props: IBackgroundImageProps): IGeneric => {\n const { containerType, image, request, configs } = props;\n\n const gridSettings = request.gridSettings ?? {};\n const imageSettings = image.imageSettings;\n\n const styles: IGeneric = {};\n\n const largestGridSettingViewportName = getLargestGridSettingViewportName(gridSettings);\n if (largestGridSettingViewportName && imageSettings) {\n // in site builder the layout may change, so use authoring viewports.\n const authoringViewPorts = getAuthoringViewport(containerType, configs?.layout);\n const imgSettings = {\n ...imageSettings,\n viewports: { ..._cloneDeep(authoringViewPorts || imageSettings.viewports || getDefaultViewports()) }\n };\n\n // Skip resizing width and height for background images.\n const skipWidthAndHeightSettings = true;\n Object.keys(imgSettings.viewports).map(vp => {\n const viewport = vp as Viewport;\n const minMaxWidth = getMinMaxWidth(gridSettings, imgSettings, viewport, largestGridSettingViewportName);\n const urlSrc = getImageResizeUrl(\n image.src,\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n imgSettings.viewports[viewport],\n imgSettings,\n skipWidthAndHeightSettings,\n image?.externalProvider,\n request?.apiSettings\n );\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n styles[viewport] = {\n maxWidth: minMaxWidth.max,\n minWidth: minMaxWidth.min,\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n minHeight: imgSettings.viewports[viewport]?.h,\n backgroundImage: urlSrc,\n backgroundRepeat: getBackgroundRepeatProperty(configs?.size, configs?.repeat),\n backgroundSize: getBackgroundSizeProperty(configs?.size),\n backgroundPosition: 'center center'\n };\n });\n }\n\n return styles;\n};\n\nexport const setStyleAttribute = (currentStyle: IBackgroundImageStyle): IGeneric => {\n let style: IGeneric = {};\n if (currentStyle) {\n style = { ...currentStyle };\n style['minWidth'] = undefined;\n style['width'] = '100%';\n if (currentStyle.backgroundImage) {\n style['backgroundImage'] = `url('${currentStyle.backgroundImage}')`;\n }\n }\n return style;\n};\n\nexport const getBackgroundImageLazyloadAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined,\n styles: IGeneric\n): IBackgroundImageLazyloadAttributes => {\n const attributes = {\n role: 'img',\n className: `${className} lazyload`,\n 'data-bgset': getDataBgSetAttribute(styles)\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n // On lazyload, lazysizes plugin should pick which background image to use based on data-bgset attribute.\n attributes['style']['backgroundImage'] = undefined;\n }\n return attributes;\n};\n\nexport const getBackgroundImageAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined\n): IBackgroundImageAttributes => {\n const attributes = {\n role: 'img',\n className\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n }\n return attributes;\n};\n\nexport const getBgSetMinMaxWidthAttribute = (style: IBackgroundImageStyle): string => {\n if (style.maxWidth) {\n return `[(max-width: ${style.maxWidth}px)]`;\n }\n return '';\n};\n\nexport const getDataBgSetAttribute = (styles: IGeneric): string => {\n const dataBgSetAttributes: string[] = [];\n Object.keys(styles).map(vp => {\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n if (styles[vp].backgroundImage) {\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n dataBgSetAttributes.push(`${styles[vp].backgroundImage} ${getBgSetMinMaxWidthAttribute(styles[vp])}`);\n }\n });\n\n return dataBgSetAttributes.join(' | ');\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport msdyn365Commerce, { getLargestGridSettingViewportName, IGeneric, isAuthoringEditEnabled } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { isEqual as _isEqual } from 'lodash';\nimport {\n buildBackgroundImageStylesByViewport,\n getBackgroundImageAttributes,\n getBackgroundImageLazyloadAttributes\n} from './container-background-image-helper';\nimport {\n IBackgroundImageAttributes,\n IBackgroundImageProps,\n IBackgroundImageState,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst BACKGROUND_IMAGE_CLASS_NAME = 'ms-container-background-image';\n\n/**\n * BackgroundImage component\n * @extends {React.PureComponent}\n */\nexport class BackgroundImage extends React.PureComponent {\n private stylesByViewport: IGeneric;\n private currentStyle: IBackgroundImageStyle | undefined;\n private mounted: boolean;\n\n constructor(props: IBackgroundImageProps, state: IBackgroundImageState) {\n super(props);\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this._onChangeHandler = this._onChangeHandler.bind(this);\n this.currentStyle = this._getCurrentStyle();\n this.mounted = false;\n this._componentResize = this._componentResize.bind(this);\n this._getCurrentStyle = this._getCurrentStyle.bind(this);\n this.state = { updateAttributes: false };\n }\n\n public componentDidMount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.addEventListener('resize', this._componentResize);\n this.mounted = true;\n this._componentResize();\n }\n }\n\n public componentWillUnmount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.removeEventListener('resize', this._componentResize);\n this.mounted = false;\n }\n }\n\n public shouldComponentUpdate(nextProps: IBackgroundImageProps, nextState: { updateAttributes: boolean }): boolean {\n if (\n this.state !== nextState ||\n this.props.request?.gridSettings !== nextProps.request?.gridSettings ||\n this.props.configs.repeat !== nextProps.configs.repeat ||\n this.props.configs.size !== nextProps.configs.size ||\n this.props.configs.layout !== nextProps.configs.layout ||\n this.props.image?.imageSettings !== nextProps.image?.imageSettings ||\n this.props.image?.src !== nextProps.image?.src\n ) {\n return true;\n }\n return false;\n }\n\n public render(): JSX.Element | null {\n const { children } = this.props;\n\n try {\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this.currentStyle = this._getCurrentStyle();\n\n if (this.currentStyle) {\n const backgroundImageClassName = isAuthoringEditEnabled(this.props.request)\n ? `${BACKGROUND_IMAGE_CLASS_NAME} ms-editable-field enabled`\n : BACKGROUND_IMAGE_CLASS_NAME;\n const processedAtributes = this._processAttributes(\n backgroundImageClassName,\n this.currentStyle,\n this.stylesByViewport,\n this._isLazyload()\n );\n const attributes = this._getAttributes(processedAtributes);\n const eventHandlers = isAuthoringEditEnabled(this.props.request) ? { onDoubleClick: this._onChangeHandler } : {};\n\n if (this.state.updateAttributes) {\n // Update component with the latest attributes.\n return (\n
\n {children}\n
\n );\n } else if (this._isLazyload()) {\n // On lazyload, only include the class name on the first render.\n return (\n
\n {children}\n
\n );\n } else {\n // On lazyload disabled, render the default attributes from server side.\n return (\n
\n {children}\n
\n );\n }\n } else {\n // in no style is found, return the container content.\n return <>{children};\n }\n } catch {\n // in case of any failure, return the container content.\n return <>{children};\n }\n }\n\n private _processAttributes(\n className: string,\n currentStyle: IBackgroundImageStyle,\n stylesByViewport: IGeneric,\n lazyLoad: boolean\n ) {\n if (lazyLoad) {\n return getBackgroundImageLazyloadAttributes(className, currentStyle, stylesByViewport);\n } else {\n return getBackgroundImageAttributes(className, currentStyle);\n }\n }\n\n private _getAttributes(processedAtributes: IBackgroundImageAttributes) {\n return { ...processedAtributes, style: { ...processedAtributes?.style } };\n }\n\n private _onChangeHandler(event: React.SyntheticEvent | { target: { value: string } }): void {\n if (event.target === (event as React.SyntheticEvent).currentTarget) {\n const binding: any = this.props.image;\n const eventTarget: any = event.target;\n binding.$type = eventTarget.value;\n }\n }\n\n private _componentResize(): void {\n if (msdyn365Commerce.isBrowser) {\n const selectedStyle = this._getCurrentStyle();\n\n if (this.mounted || (selectedStyle && !_isEqual(this.currentStyle, selectedStyle))) {\n this.setState({ updateAttributes: true });\n }\n }\n }\n\n private _getCurrentStyle(): IBackgroundImageStyle | undefined {\n if (msdyn365Commerce.isBrowser) {\n const winInnerWidth: number = window.innerWidth;\n let selectedStyle: IBackgroundImageStyle | undefined;\n Object.keys(this.stylesByViewport).map(vp => {\n if (\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n (this.stylesByViewport[vp]?.minWidth || this.stylesByViewport[vp]?.maxWidth) &&\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n (this.stylesByViewport[vp]?.minWidth || 0) <= winInnerWidth &&\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n winInnerWidth <= (this.stylesByViewport[vp]?.maxWidth || Number.MAX_SAFE_INTEGER)\n ) {\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n selectedStyle = this.stylesByViewport[vp];\n }\n });\n return selectedStyle;\n } else {\n return this._getDefaultStyle();\n }\n }\n\n private _isLazyload(): boolean {\n // Lazyload by default if nothing is specified\n return !this.props.image?.imageSettings?.disableLazyLoad;\n }\n\n private _getDefaultStyle(): IBackgroundImageStyle | undefined {\n const { request } = this.props;\n const largestGridSettingViewportName = getLargestGridSettingViewportName(request.gridSettings ?? {});\n // eslint-disable-next-line security/detect-object-injection -- bracket object notation with user input present leads to eslint security issue.\n return this.stylesByViewport[largestGridSettingViewportName];\n }\n\n private _getDefaultAttributes(): IBackgroundImageAttributes {\n const style = this._getDefaultStyle();\n const processedAtributes = style\n ? this._processAttributes(BACKGROUND_IMAGE_CLASS_NAME, style, this.stylesByViewport, this._isLazyload())\n : {};\n return this._getAttributes(processedAtributes);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent, IImageData, IRequestContext, Text } from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { BackgroundImage } from './container-background-image/container-backgroud-image';\n\n/**\n * Heading options\n */\nexport interface IHeadingComponentProps {\n /**\n * Heading text\n */\n headingText?: string;\n /**\n * Heading tag (h1, h2, h3, h4, h5, h6)\n */\n tag?: HeadingTag;\n /**\n * Heading text size (sm, md, lg, xl)\n */\n textSize?: TextSize;\n\n requestContext: IRequestContext;\n\n handleTextChange(event: ContentEditableEvent): string;\n}\n\nexport type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\nexport type TextSize = 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Container class options\n */\nexport interface IContainerProps {\n /**\n * CSS class name\n */\n className?: string;\n /**\n * Bootstrap supported container types\n */\n containerType?: string;\n /**\n * type name\n */\n typeName?: string;\n /**\n * id of container\n */\n id?: string;\n /**\n * React children\n */\n children: React.ReactNode;\n /**\n * Request context\n */\n request?: IRequestContext;\n /**\n * background image\n */\n backgroundImage?: IImageData;\n /**\n * background image repeat property\n */\n backgroundImageRepeat?: string;\n /**\n * background image size property\n */\n backgroundImageSize?: string;\n /**\n * module layout property\n */\n moduleLayout?: string;\n /**\n * background color\n */\n backgroundColor?: string;\n}\n\nconst getContainerType = (containerType: string | undefined) => {\n switch (containerType) {\n case 'container':\n return 'container';\n case 'fluid':\n default:\n return 'fluid';\n }\n};\n\n/**\n * HOC to create bootstrap container div. If no container type is specified children are rendered.\n * @param options IContainerClasses\n */\nexport const Container: React.SFC = (props: IContainerProps): JSX.Element => {\n const {\n containerType,\n className,\n typeName,\n id,\n children,\n backgroundImage,\n request,\n backgroundImageRepeat,\n backgroundImageSize,\n moduleLayout,\n backgroundColor\n } = props;\n const customClassName = className ? ` ${className}` : '';\n\n let containerContent = children;\n if (containerType) {\n containerContent =
{containerContent}
;\n }\n\n if (backgroundImage && backgroundImage.src && backgroundImage.imageSettings && request) {\n containerContent = (\n \n {containerContent}\n \n );\n }\n\n const containerStyle: React.CSSProperties | undefined = backgroundColor ? { backgroundColor } : undefined;\n\n return containerType ? (\n
\n {containerContent}\n
\n ) : (\n
\n {containerContent}\n
\n );\n};\n\nexport const HeadingComponent = (props: IHeadingComponentProps & { className: string }): JSX.Element | null => {\n const { tag, headingText, textSize, className } = props;\n const Tag = tag || 'h2';\n const classNameWithHeading = textSize ? `heading ${textSize} ${className}` : `heading ${className}`;\n return (\n (headingText && (\n \n )) ||\n null\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent } from '@msdyn365-commerce/core';\nimport { LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport * as React from 'react';\nimport { Container, HeadingComponent, IHeadingComponentProps } from '../../components/base-components';\nimport { colWidths } from '../../utils/classnames';\nimport { IDefaultContainerData } from './default-container.data';\nimport { childrenWidth as childrenWidthEnum, IDefaultContainerProps, layout as layoutEnum } from './default-container.props.autogenerated';\n\n/**\n *\n * CoreComponent component\n * @extends {React.PureComponent>}\n */\nclass DefaultContainer extends React.PureComponent> {\n constructor(props: IDefaultContainerProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { slots, telemetry, config, data } = this.props;\n telemetry.log(LogLevel.Debug, \"Default Container rendering for '{id}/{typeName}'\", {\n values: [this.props.id, this.props.typeName]\n });\n\n const heading = config.heading || data.heading;\n const headingProps: IHeadingComponentProps = {\n ...heading,\n handleTextChange: this.handleTextChange,\n requestContext: this.props.context.request\n };\n\n return (\n \n {heading && }\n {slots &&\n slots.content &&\n slots.content.map((children: React.ReactNode, index: number) => {\n return (\n
\n {children}\n
\n );\n })}\n \n );\n }\n\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.headingText = event.target.value);\n\n private _getChildColClassName(): string {\n const {\n config: { layout, childrenWidth }\n } = this.props;\n switch (layout) {\n case layoutEnum.flow:\n return childrenWidth === childrenWidthEnum.auto ? 'col-12 col-md' : this._getWidthClass(childrenWidth);\n case layoutEnum.stacked:\n default:\n return 'col-12';\n }\n }\n\n private _getWidthClass(s?: childrenWidthEnum): string {\n return colWidths.get(s || childrenWidthEnum.four) || 'col-12';\n }\n}\n\nexport default DefaultContainer;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport * as twoSlots from '../modules/default-container-2-slots/default-container-2-slots.props.autogenerated';\nimport * as threeSlots from '../modules/default-container-3-slots/default-container-3-slots.props.autogenerated';\n\n// eslint-disable-next-line security/detect-unsafe-regex\nconst sizePattern = /col(_(\\d|auto){1,2}){2,}/;\n\nexport interface IShowErrorOptions {\n isDebug?: boolean;\n isEditor?: boolean;\n}\n\nexport interface IViewPortOptions {\n xsmall?: threeSlots.xsmall | twoSlots.xsmall;\n small?: threeSlots.small | twoSlots.small;\n medium?: threeSlots.medium | twoSlots.medium;\n large?: threeSlots.large | twoSlots.large;\n}\n\nconst translatePrefix = (prefix: `large` | `medium` | `small` | `xsmall` | undefined) => {\n switch (prefix && prefix.toLowerCase()) {\n case 'large':\n return 'lg';\n case 'medium':\n return 'md';\n case 'small':\n return 'sm';\n case 'xsmall':\n default:\n return '';\n }\n};\n\n/**\n * converts config option and size to bootstrap col class name\n * If size is auto or config option is invalid col-auto will be returned\n * If size is xsmall or size is invalid col-{config} will be returned\n * @param config configuration option e.g. col_12_12\n * @param size bootstrap gridsize\n */\nexport const getColumnSizes = (config: string, size?: `large` | `medium` | `small` | `xsmall`): string[] | boolean => {\n if (!sizePattern.exec(config)) {\n return false;\n }\n const cols = config.split('_').slice(1);\n const translatedSize = translatePrefix(size);\n const sizePrefix = (translatedSize && `-${translatedSize}`) || '';\n return cols.map((colWidth: string) => `col${sizePrefix}-${colWidth}`);\n};\n\nexport const showErrors = (context?: ICoreContext): Boolean => {\n const { isDebug, isEditor }: IShowErrorOptions = (context && context.request && context.request.params) || {};\n return !!isDebug || !!isEditor;\n};\n\n/**\n * Converts viewport configuration into a two dimensional array of class names\n */\nexport const getColClassArray = (options: IViewPortOptions): string[][] =>\n (\n [\n options.xsmall && getColumnSizes(options.xsmall),\n options.small && getColumnSizes(options.small, 'small'),\n options.medium && getColumnSizes(options.medium, 'medium'),\n options.large && getColumnSizes(options.large, 'large')\n ].filter(Boolean)\n );\n\nexport const colWidths = new Map([\n ['one', 'col-md-1'],\n ['two', 'col-md-2'],\n ['three', 'col-md-3'],\n ['four', 'col-md-4'],\n ['six', 'col-md-6'],\n ['twelve', 'col-md-12']\n]);\n","module.exports = React;","module.exports = ReactDOM;"],"names":["binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","window","__bindings__","_objectSpread","getBackgroundRepeatProperty","size","repeat","getBackgroundSizeProperty","buildBackgroundImageStylesByViewport","props","_request$gridSettings","containerType","image","request","configs","gridSettings","imageSettings","styles","largestGridSettingViewportName","getLargestGridSettingViewportName","authoringViewPorts","getAuthoringViewport","moduleName","layout","msdyn365Commerce","isBrowser","authoringHelper","_msdyn365","constructViewportInformationForImage","themeSettings","imgSettings","viewports","_cloneDeep2","xs","w","h","sm","lg","xl","skipWidthAndHeightSettings","Object","keys","map","vp","_imgSettings$viewport","viewport","minMaxWidth","getMinMaxWidth","urlSrc","getImageResizeUrl","src","externalProvider","apiSettings","maxWidth","max","minWidth","min","minHeight","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","setStyleAttribute","currentStyle","style","undefined","getDataBgSetAttribute","dataBgSetAttributes","push","join","BACKGROUND_IMAGE_CLASS_NAME","BackgroundImage","React","constructor","state","super","this","stylesByViewport","_onChangeHandler","bind","_getCurrentStyle","mounted","_componentResize","updateAttributes","componentDidMount","addEventListener","componentWillUnmount","removeEventListener","shouldComponentUpdate","nextProps","nextState","_this$props$request","_nextProps$request","_this$props$image","_nextProps$image","_this$props$image2","_nextProps$image2","render","children","backgroundImageClassName","isAuthoringEditEnabled","processedAtributes","_processAttributes","_isLazyload","attributes","_getAttributes","eventHandlers","onDoubleClick","assign","className","_getDefaultAttributes","_unused","lazyLoad","getBackgroundImageLazyloadAttributes","role","getBackgroundImageAttributes","event","target","currentTarget","eventTarget","value","selectedStyle","_isEqual2","setState","winInnerWidth","innerWidth","_this$stylesByViewpor","_this$stylesByViewpor2","_this$stylesByViewpor3","_this$stylesByViewpor4","Number","MAX_SAFE_INTEGER","_getDefaultStyle","_this$props$image3","disableLazyLoad","getContainerType","Container","typeName","id","backgroundImageRepeat","backgroundImageSize","moduleLayout","backgroundColor","customClassName","containerContent","containerStyle","HeadingComponent","tag","headingText","textSize","Tag","classNameWithHeading","Text","text","editProps","onEdit","handleTextChange","requestContext","DefaultContainer","config","heading","slots","telemetry","data","log","LogLevel","Debug","values","headingProps","context","msdyn365__moduleLayout","content","index","_getChildColClassName","key","childrenWidth","_getWidthClass","s","colWidths","get","sizePattern","getColumnSizes","exec","cols","split","slice","translatedSize","prefix","toLowerCase","translatePrefix","sizePrefix","colWidth","showErrors","isDebug","isEditor","params","getColClassArray","options","xsmall","small","medium","large","filter","Boolean","Map","module","exports","ReactDOM"],"sourceRoot":""}