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AA,GACPtC,OAAOoE,aAAaC,gBAAkB,IACtCA,I,MCtC3BE,EAAOC,QAAUpG,O,OCAjBmG,EAAOC,QAAUC,W","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/herbal-intro-block/herbal-intro-block.tsx?a185","webpack://Msdyn365.Commerce.Online/./src/modules/herbal-intro-block/herbal-intro-block.view.tsx?4a8f","webpack://Msdyn365.Commerce.Online/./lib/herbal-intro-block/module-registration.js?9697","webpack://Msdyn365.Commerce.Online/external var \"React\"?0d3b","webpack://Msdyn365.Commerce.Online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IHerbalIntroBlockConfig, IHerbalIntroBlockProps } from './herbal-intro-block.props.autogenerated';\r\n\r\nexport interface IHerbalIntroBlockState {\r\n intervalId: number;\r\n currentCount: number;\r\n}\r\nexport interface IHerbalIntroBlockViewProps extends IHerbalIntroBlockProps<{}> {\r\n state: IHerbalIntroBlockState;\r\n text?: React.ReactNode;\r\n image?: React.ReactNode;\r\n className?: string;\r\n contentBlockContainer: IModuleProps;\r\n imageContainer: INodeProps;\r\n detailsContainer: INodeProps;\r\n contentBlockAnchorTag?: INodeProps;\r\n imageLink?: string;\r\n duration?: number;\r\n}\r\n\r\n/**\r\n * Site-builder configuration for the module.\r\n */\r\nexport interface IHerbalIntroBlockFullConfig extends IHerbalIntroBlockConfig {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention -- This field comes from SDK.\r\n msdyn365__moduleLayout?: string;\r\n}\r\n\r\n/**\r\n * ContentCard component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class HerbalIntroBlock extends React.PureComponent, IHerbalIntroBlockState> {\r\n constructor(props: IHerbalIntroBlockProps<{}>, state: IHerbalIntroBlockState) {\r\n super(props);\r\n this.timer = this.timer.bind(this);\r\n this.state = {\r\n intervalId: 1,\r\n currentCount: 0\r\n };\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n request: { user }\r\n }\r\n } = this.props;\r\n if (!user.token) {\r\n this.setState({ currentCount: 1 });\r\n const duration = this.props.config?.duration;\r\n\r\n if (duration !== undefined) {\r\n var intervalId = window.setInterval(this.timer, duration * 1000);\r\n // store intervalId in the state so it can be accessed later:\r\n this.setState({ intervalId: intervalId });\r\n }\r\n } else {\r\n const videoBanner: HTMLMediaElement | null = document.querySelector('.msc-videoplayer__video');\r\n if (videoBanner) {\r\n videoBanner.removeAttribute('loop');\r\n setTimeout(() => {\r\n videoBanner.pause();\r\n }, 100);\r\n }\r\n const videoBannerText: HTMLElement | null = document.querySelector('.ed-banner-video');\r\n if (videoBannerText) {\r\n videoBannerText.classList.add('hidden-intro');\r\n }\r\n }\r\n\r\n window.addEventListener('scroll', () => {\r\n const videoBannerText: HTMLElement | null = document.querySelector('.ed-banner-video');\r\n const scrollY = window.scrollY;\r\n if (videoBannerText) {\r\n if (scrollY >= 100) {\r\n videoBannerText.classList.add('ed-banner-video--hide');\r\n } else {\r\n videoBannerText.classList.remove('ed-banner-video--hide');\r\n }\r\n }\r\n });\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n // use intervalId from the state to clear the interval\r\n clearInterval(this.state.intervalId);\r\n }\r\n\r\n private timer(el: any): void {\r\n var newCount = this.state.currentCount - 1;\r\n if (newCount >= 0) {\r\n this.setState({ currentCount: newCount });\r\n } else {\r\n clearInterval(this.state.intervalId);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n // console.log(this.state);\r\n const { paragraph, image, className } = this.props.config;\r\n const imageProps = {\r\n gridSettings: this.props.context.request.gridSettings ?? {},\r\n imageSettings: image?.imageSettings\r\n };\r\n const contentBlockText = paragraph && ;\r\n const contentBlockImage = (\r\n // @ts-ignore\r\n \r\n );\r\n\r\n if (!contentBlockText) {\r\n this.props.context.telemetry.error('Content block content is empty, module wont render.');\r\n return null;\r\n }\r\n const contentBlockviewProps = {\r\n ...this.props,\r\n text: contentBlockText,\r\n image: contentBlockImage,\r\n moduleClass: this.props.config.className,\r\n contentBlockContainer: {\r\n moduleProps: this.props,\r\n className: this.state.currentCount ? classnames('ms-content-block ms-intro-page', className) : 'ms-content-block d-none'\r\n },\r\n imageContainer: { className: 'ms-background-container' },\r\n detailsContainer: { className: 'ms-content-container' },\r\n contentBlockAnchorTag: {\r\n tag: 'a',\r\n className: 'ms-content-block__link',\r\n role: 'link'\r\n },\r\n imageLink: this._getImageLink()\r\n };\r\n return this.props.renderView(contentBlockviewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Get image link.\r\n */\r\n private _getImageLink(): string | null {\r\n const { imageLink } = this.props.config;\r\n if (imageLink?.destinationUrl) {\r\n return imageLink.destinationUrl;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default HerbalIntroBlock;\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IHerbalIntroBlockViewProps } from './herbal-intro-block';\r\n\r\n/**\r\n * Render Additional Content.\r\n * @param additionalContent - Additional content view props.\r\n * @returns JSX Element.\r\n */\r\n\r\nconst HerbalIntroBlockView: React.FC = props => {\r\n const { contentBlockContainer, imageContainer, detailsContainer, text, image, contentBlockAnchorTag, imageLink } = props;\r\n\r\n if (imageLink) {\r\n return (\r\n \r\n {text}\r\n \r\n {image}\r\n \r\n \r\n );\r\n }\r\n return (\r\n \r\n {text}\r\n {image}\r\n \r\n );\r\n};\r\n\r\nexport default HerbalIntroBlockView;\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['herbal-intro-block'] = {\n c: () => require('partner/modules/herbal-intro-block/herbal-intro-block.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'herbal-intro-block',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/herbal-intro-block'\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__|modules|herbal-intro-block|herbal-intro-block'] = {\n c: () => require('partner/modules/herbal-intro-block/herbal-intro-block.view.tsx'),\n cn: '__local__-__local__-herbal-intro-block'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["HerbalIntroBlock","React","constructor","props","state","super","this","timer","bind","intervalId","currentCount","context","request","user","token","videoBanner","document","querySelector","removeAttribute","setTimeout","pause","videoBannerText","classList","add","_this$props$config","setState","duration","config","undefined","window","setInterval","addEventListener","scrollY","remove","componentWillUnmount","clearInterval","el","newCount","render","_this$props$context$r","_this$props$config$im","paragraph","image","className","imageProps","gridSettings","imageSettings","contentBlockText","Msdyn365","text","contentBlockImage","Object","assign","requestContext","editProps","key","moduleType","typeName","imagePropertyName","moduleId","id","layout","msdyn365__moduleLayout","shouldSkipToMainImage","telemetry","error","contentBlockviewProps","_objectSpread","moduleClass","contentBlockContainer","moduleProps","classnames","imageContainer","detailsContainer","contentBlockAnchorTag","tag","role","imageLink","_getImageLink","renderView","destinationUrl","Module","Node","href","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}