{"version":3,"sources":["webpack:///./src/themes/stemichelle-new/views/overflow-container.view.tsx?5960","webpack:///./src/modules/overflow-container/overflow-container.view.tsx?e822","webpack:///./src/components/Price.tsx?5177","webpack:///./src/modules/product-price/product-price.tsx?6d5a","webpack:///./src/themes/smwe/views/wine-finder-by-zip.view.tsx?1dba","webpack:///./src/modules/wine-finder-by-zip/wine-finder-by-zip.view.tsx?e28a","webpack:///./src/modules/wine-finder-by-zip/wine-finder-by-zip.tsx?7308","webpack:///./src/modules/home-carousel/home-carousel.tsx?ba62","webpack:///./src/modules/instagram-integration/instagram-integration.view.tsx?e250","webpack:///./src/modules/instagram-integration/instagram-integration.tsx?8290","webpack:///./src/themes/elicit/views/overflow-container.view.tsx?c583","webpack:///./src/themes/fth/views/overflow-container.view.tsx?849c","webpack:///./src/themes/h3-theme/views/wine-finder-by-zip.view.tsx?5baf","webpack:///./src/themes/blend/views/overflow-container.view.tsx?a4b4","webpack:///./src/modules/tasting-notes/tasting-notes.tsx?2c27","webpack:///./src/modules/overflow-container/overflow-container.tsx?219d"],"names":["OverflowContainerView","props","btn","content","currentClass","config","cssClassName","React","className","classnames","Price","render","this","_showStrikethroughPricing","_renderCurrentPriceWithOriginalPrice","_renderCurrentPrice","originalPrice","currentPrice","originalStartingPrice","startingValue","currentStartingPrice","originalEndingPrice","endingValue","currentEndingPrice","initialPrice","_formatCurrency","finalPrice","priceRange","_formatPriceRange","undefined","originalPriceText","currentPriceText","savingsText","includeClassName","classNames","isRange","_rangeHelper","concat","text","itemProp","price","freePriceText","currencyFormatter","Intl","NumberFormat","locale","style","currencyDisplay","currency","currencyCode","format","rangeFormatText","match","rangeRegex","replace","_","initial","ProductPriceModule","constructor","_onKeyedInPriceChange","targetPrice","priceInput","Number","target","value","getKeyedInPrice","createKeyedInPrice","context","actionContext","getKeyedInPriceError","createKeyedInPriceError","_renderKeyedInPrice","data","keyedInPrice","result","isNaN","hidden","htmlFor","Input","id","type","min","onChange","_mapPriceFromSimpleProductAction","productPrice","channelConfiguration","requestContext","priceType","priceDisplayType","_mapNumberToIPriceRange","CustomerContextualPrice","BasePrice","Math","max","TradeAgreementPrice","AdjustedPrice","Currency","resources","priceFree","reaction","product","RecordId","affiliationId","app","wineClubSetup","actionInput","PriceForSelectedVariantInput","apiSettings","channelId","request","user","customerAccountNumber","getPriceForSelectedVariant","catch","error","telemetry","warning","loginGated","isAuthenticated","e","priceData","Behavior","KeyInPriceValue","_getFormattedPrice","cultureFormatter","formatCurrency","observer","WineFinderByZipView","super","_queryZipcode","_handleQueryZipcodeChange","bind","_keyup","_doQuery","onKeyUp","disabled","_isInvalid","onClick","event","keyCode","test","window","open","wineBrandUrl","__decorate","observable","placeholder","WineFinderByZip","renderView","HomeCarousel","defaultImageSettings","viewports","xs","q","w","h","lg","lazyload","_handleKeyPress","_previousSlide","_nextSlide","currentSlide","slides","homeCarouselSlides","filter","slide","scrollThreshold","_randomizeStart","_autoAdvance","_restartAutoAdvance","_handleTouchStart","_handleTouchEnd","_selectorSlideChange","componentDidMount","document","addEventListener","homeCarouselRandomize","length","homeCarouselInterval","componentWillUnmount","removeEventListener","_getCarousel","currentClassName","selectorList","indicatorList","slideList","map","index","push","_getSelector","_getIndicator","_getSlide","onTouchStart","onTouchEnd","_getNext","homeCarousel_next","isCurrentSelector","role","key","slideSelector","isCurrentIndicator","isCurrentSlide","href","link","linkUrl","destinationUrl","ariaLabel","openInNewTab","rel","_getLogo","logo","RichTextComponent","_getLink","_getBackgroundImage","backgroundImage","logoMobile","backgroundImageMobile","linkText","image","Image","Object","gridSettings","imageSettings","startSlide","round","random","cycleInterval","setInterval","clearInterval","element","currentTarget","getAttribute","touches","scrollStart","screenX","changedTouches","delta","InstagramIntegrationView","src","token","frameBorder","scrolling","width","height","InstagramIntegration","_scriptLoaded","_scriptSrc","_isScriptLoaded","_injectScript","script","createElement","onload","head","appendChild","querySelector","_handleHowToBuyNav","_smoothVerticalScrolling","_scrollingHelper","url","requestUrl","search","includes","location","hash","parentContainer","ReactDOM","parentNode","history","pushState","origin","title","pathname","time","where","eAmt","getBoundingClientRect","top","curTime","setTimeout","scrollBy","TastingNotes","tastingNotesAttributeName","productAttributes","productSpecificationData","tastingNotes","find","attribute","Name","toLowerCase","tastingNotesContent","_getContent","TextValue","split","forEach","note","_getImage","imageSearchUrl","altText","OverflowContainer","_OPENED_CLASS","_CLOSED_CLASS","_handleClickOutsideOverflow","overflow","pulldownElement","getElementById","state","isOverflowExpandedState","contains","setState","expandedState","openByDefault","_toggleExpansion","closeOnClickOff","body","_jsxContent","_jsxBtn","_currentClass","slots","module","btnText","openText","closeText"],"mappings":"8FAAA,4CAeeA,UAXsDC,IACjE,MAAM,IAAEC,EAAF,QAAOC,EAAP,aAAgBC,EAAcC,QAAQ,aAAEC,IAAmBL,EAEjE,OACIM,uBAAKC,UAAWC,IAAWL,EAAcE,IACpCJ,EACAC,K,oCCTb,uBAaeH,UAVsDC,IACjE,MAAM,QAAEE,EAAF,aAAWC,EAAcC,QAAQ,aAAEC,IAAmBL,EAE5D,OACIM,uBAAKC,UAAW,GAAGJ,KAAgBE,GAAgB,MAC9CH,K,6LCDC,MAAOO,UAAcH,gBASxBI,SAEH,OAAQC,KAAKC,4BAA8BD,KAAKE,uCAAyCF,KAAKG,qBAAoB,KAAU,KAGxHF,4BACJ,MAAM,cAAEG,EAAF,aAAiBC,GAAiBL,KAAKX,MAC7C,GAAIe,GAAiBC,EAAc,CAC/B,MAAMC,EAAwBF,EAAcG,cACtCC,EAAuBH,EAAaE,cACpCE,EAAsBL,EAAcM,YAAcN,EAAcM,YAAc,EAC9EC,EAAqBN,EAAaK,YAAcL,EAAaK,YAAc,EAEjF,OAAQJ,EAAwBE,GAC3BC,EAAsBE,EAG/B,OAAO,EAGHT,uCACJ,MAAM,cAAEK,EAAF,YAAiBG,GAAgBV,KAAKX,MAAMe,cAC5CQ,EAAeZ,KAAKa,gBAAgBN,GACpCO,EAAad,KAAKa,gBAAgBH,GAClCK,EAAaH,GAAgBE,EAAad,K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AAe,KA5CvBzS,KAAKqS,MAAQ,CACTC,0BAA2BtS,KAAKX,MAAMI,OAAOiT,cAC7CD,eAAe,GAGnBzS,KAAK2S,iBAAmB3S,KAAK2S,iBAAiBpL,KAAKvH,MAGhDiK,oBACCjK,KAAKX,MAAMI,OAAOmT,iBAClB1I,SAAS2I,MAAQ3I,SAAS2I,KAAK1I,iBAAiB,YAAanK,KAAKiS,6BAInE1H,uBACCvK,KAAKX,MAAMI,OAAOmT,iBAClB1I,SAAS2I,MAAQ3I,SAAS2I,KAAKrI,oBAAoB,YAAaxK,KAAKiS,6BAA6B,GAInGlS,SACH,MAAMV,EAAK,OACJW,KAAKX,OADD,IAEPE,QAASS,KAAK8S,YACdxT,IAAKU,KAAK+S,QACVvT,aAAcQ,KAAKgT,gBAEvB,OAAOhT,KAAKX,MAAMmJ,WAAWnJ,GAGzBsT,mBACJ3S,KAAKwS,SAAS,CACVF,yBAA0BtS,KAAKqS,MAAMC,wBACrCG,eAAgBzS,KAAKqS,MAAMI,gBAgBZ,kBACnB,MAAMlT,EAAUS,KAAKX,MAAM4T,MAAM1T,QAEjC,OACII,uBAAKC,UAAU,8BACVL,GAAWA,EAAQuL,IAAI,CAACoI,EAAQnI,IAC7BpL,gBAACA,WAAc,CAAC+L,IAAKX,GAChBmI,KAOI,oBACrB,OAAQlT,KAAKqS,MAAMC,wBAA2BtS,KAAK+R,cAAgB/R,KAAKgS,cAGzD,cACf,MAAM1S,EAAMU,KAAKX,MAAMI,OAAOH,IACxB6T,EAAWnT,KAAKqS,MAAMC,yBAA2BhT,aAAA,EAAAA,EAAK8T,WAAY,SAAU9T,aAAA,EAAAA,EAAK+T,YAAa,SACpG,OAAQ1T,0BAAQkI,QAAS7H,KAAK2S,iBAAgB,gBAAiB3S,KAAKqS,MAAMI,cAAe7S,UAAU,0BAA0BuT,IAItHrB","file":"static/js/22.3b136de6c339798f173b.chunk.js","sourcesContent":["import classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IOverflowContainerViewProps } from '../../../modules/overflow-container/overflow-container';\r\n\r\nconst OverflowContainerView: React.FC = props => {\r\n const { btn, content, currentClass, config: { cssClassName } } = props;\r\n\r\n return (\r\n
\r\n {btn}\r\n {content}\r\n
\r\n );\r\n};\r\n\r\nexport default OverflowContainerView;\r\n","\r\nimport * as React from 'react';\r\nimport { IOverflowContainerViewProps } from './overflow-container';\r\n\r\nconst OverflowContainerView: React.FC = props => {\r\n const { content, currentClass, config: { cssClassName } } = props;\r\n\r\n return (\r\n
\r\n {content}\r\n
\r\n );\r\n};\r\n\r\nexport default OverflowContainerView;","import classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IPriceProps } from './Price.props';\r\n\r\n/**\r\n * Price component\r\n * @extends {React.PureComponent}\r\n */\r\nexport default class Price extends React.PureComponent {\r\n public static defaultProps: Partial = {\r\n rangeFormatText: '{0} - {1}',\r\n originalPriceText: 'Original Price',\r\n currentPriceText: 'Current Price'\r\n };\r\n\r\n private static rangeRegex: RegExp = /(?:(\\{0\\})|(\\{1\\}))/gm;\r\n\r\n public render(): JSX.Element | null {\r\n // yield null on undefined result for enzyme\r\n return (this._showStrikethroughPricing() ? this._renderCurrentPriceWithOriginalPrice() : this._renderCurrentPrice(true)) || null;\r\n }\r\n\r\n private _showStrikethroughPricing(): boolean {\r\n const { originalPrice, currentPrice } = this.props;\r\n if (originalPrice && currentPrice) {\r\n const originalStartingPrice = originalPrice.startingValue;\r\n const currentStartingPrice = currentPrice.startingValue;\r\n const originalEndingPrice = originalPrice.endingValue ? originalPrice.endingValue : 0;\r\n const currentEndingPrice = currentPrice.endingValue ? currentPrice.endingValue : 0;\r\n\r\n return (originalStartingPrice > currentStartingPrice) ||\r\n (originalEndingPrice > currentEndingPrice);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _renderCurrentPriceWithOriginalPrice(): JSX.Element | null {\r\n const { startingValue, endingValue } = this.props.originalPrice!;\r\n const initialPrice = this._formatCurrency(startingValue);\r\n const finalPrice = this._formatCurrency(endingValue);\r\n const priceRange = initialPrice && finalPrice ? this._formatPriceRange(initialPrice, finalPrice) : undefined;\r\n\r\n return (\r\n \r\n {priceRange && (\r\n \r\n {priceRange}\r\n {this._renderCurrentPrice(false)}\r\n \r\n )}\r\n {!priceRange && (\r\n \r\n {this.props.originalPriceText} {initialPrice} {this.props.currentPriceText} {this._renderCurrentPrice(false)}\r\n \r\n \r\n \r\n )}\r\n {this.props.savingsText && {this.props.savingsText}}\r\n \r\n );\r\n }\r\n\r\n private _renderCurrentPrice(includeClassName: boolean): JSX.Element | undefined {\r\n const { currentPrice, className } = this.props;\r\n const classNames = className && includeClassName ? [className] : [];\r\n const initialPrice = currentPrice ? this._formatCurrency(currentPrice.startingValue) : undefined;\r\n const finalPrice = currentPrice ? this._formatCurrency(currentPrice.endingValue as number) : undefined;\r\n const isRange = initialPrice && finalPrice;\r\n const priceRange = isRange ? this._formatPriceRange(initialPrice!, finalPrice!) : undefined;\r\n return isRange\r\n ? (priceRange && this._rangeHelper({ className: classNames.concat('price-range'), text: priceRange })) as JSX.Element\r\n : (initialPrice && this._rangeHelper({ className: classNames, text: initialPrice })) as JSX.Element;\r\n }\r\n\r\n private _rangeHelper({ className, text }: { className: string[]; text: string }): JSX.Element {\r\n return {` ${text || ''}`};\r\n }\r\n\r\n private _formatCurrency(price: number | undefined): string | undefined {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (price === 0 && this.props.freePriceText) {\r\n return this.props.freePriceText;\r\n }\r\n\r\n if (this.props.currencyFormatter) {\r\n return this.props.currencyFormatter(price);\r\n }\r\n\r\n return new Intl.NumberFormat(\r\n this.props.locale,\r\n { style: 'currency', currencyDisplay: 'symbol', currency: this.props.currencyCode }).format(price);\r\n }\r\n\r\n private _formatPriceRange(initialPrice: string, finalPrice: string): string | undefined {\r\n if (!this.props.rangeFormatText!.match(Price.rangeRegex)) {\r\n return;\r\n }\r\n return this.props.rangeFormatText!.replace(Price.rangeRegex, (_: string, initial: string) => initial ? initialPrice : finalPrice);\r\n }\r\n}\r\n","/*---------------------------------------------------------------------------------------------\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 { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ChannelConfiguration, ProductPrice } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport Input from 'reactstrap/lib/Input';\r\nimport Price from '../../components/Price';\r\nimport getKeyedInPrice, { createKeyedInPrice } from '../../dataActions/get-keyed-in-price';\r\nimport getKeyedInPriceError, { createKeyedInPriceError } from '../../dataActions/get-keyed-in-price-error';\r\nimport getPriceForSelectedVariant, { PriceForSelectedVariantInput } from './data-actions/get-price-for-selected-variant';\r\nimport { IPrice, IPriceRange, IProductPriceData } from './product-price.data';\r\nimport { IProductPriceProps } from './product-price.props.autogenerated';\r\n\r\n/**\r\n *\r\n * ProductPrice component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass ProductPriceModule extends React.Component> {\r\n public async componentDidMount(): Promise {\r\n reaction(\r\n () => this.props.data.product.result ? this.props.data.product.result.RecordId : null,\r\n () => {\r\n if (this.props.context &&\r\n this.props.data.product.result &&\r\n this.props.config.priceDisplayType === 'affiliationPrice' &&\r\n (this.props.config.affiliationId || this.props.context.app.config.wineClubSetup.affiliationId)) {\r\n const actionInput = new PriceForSelectedVariantInput(\r\n this.props.data.product.result.RecordId,\r\n // @ts-ignore\r\n +this.props.context.actionContext.requestContext.apiSettings.channelId,\r\n this.props.data.product.result,\r\n this.props.context.request.user.customerAccountNumber,\r\n this.props.config.affiliationId || this.props.context.app.config.wineClubSetup.affiliationId\r\n );\r\n\r\n getPriceForSelectedVariant(actionInput, this.props.context.actionContext)\r\n .catch(error => {\r\n this.props.telemetry.warning('Unable to update Price for Product');\r\n this.props.telemetry.error(error);\r\n });\r\n }\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (this.props.config.loginGated && !this.props.context.request.user.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n let content: IProductPriceData;\r\n try {\r\n content = this.props.data;\r\n } catch (e) {\r\n this.props.telemetry.error(`Something went wrong ------${e}`);\r\n return
{e}
;\r\n }\r\n\r\n const priceData = this._mapPriceFromSimpleProductAction(\r\n content.productPrice.result,\r\n content.channelConfiguration.result,\r\n this.props.context.request);\r\n\r\n const product = this.props.data.product.result;\r\n const isPriceKeyedIn = product && product.Behavior && product.Behavior.KeyInPriceValue;\r\n if (isPriceKeyedIn) {\r\n return (\r\n
\r\n {this._renderKeyedInPrice()}\r\n
\r\n );\r\n }\r\n return (\r\n
\r\n {this._getFormattedPrice(priceData, this.props.context.cultureFormatter.formatCurrency)}\r\n
\r\n );\r\n }\r\n\r\n private _onKeyedInPriceChange = (targetPrice: React.ChangeEvent) => {\r\n const priceInput = Number(targetPrice && targetPrice.target && targetPrice.target.value);\r\n void getKeyedInPrice(createKeyedInPrice(priceInput), this.props.context.actionContext);\r\n\r\n if (priceInput < 25 || priceInput > 500) {\r\n void getKeyedInPriceError(createKeyedInPriceError('Please enter a price between $25 and $500.'), this.props.context.actionContext);\r\n } else {\r\n void getKeyedInPriceError(createKeyedInPriceError(''), this.props.context.actionContext);\r\n }\r\n };\r\n\r\n private _renderKeyedInPrice = () => {\r\n let price: number | undefined = this.props.data.keyedInPrice.result;\r\n if (!price || isNaN(price)) {\r\n price = undefined;\r\n }\r\n return (\r\n
\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n private _getFormattedPrice(priceData: IPrice | null, currencyFormatter: (price: string | number, currencyCode?: string) => string): JSX.Element | null {\r\n if (!priceData) {\r\n return null;\r\n }\r\n const { currentPrice, originalPrice } = priceData;\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _mapPriceFromSimpleProductAction = (productPrice: ProductPrice | undefined, channelConfiguration: ChannelConfiguration | undefined, requestContext: IRequestContext | undefined): IPrice | null => {\r\n if (productPrice && requestContext) {\r\n let priceType;\r\n if (this.props.config.priceDisplayType === 'affiliationPrice' || this.props.config.priceDisplayType === 'currentPrice') {\r\n priceType = this._mapNumberToIPriceRange(productPrice.CustomerContextualPrice);\r\n } else if (this.props.config.priceDisplayType === 'basePrice') {\r\n priceType = this._mapNumberToIPriceRange(productPrice.BasePrice || 0);\r\n }\r\n\r\n // if price type wasnt set, then set it to the default type used previously\r\n if (!priceType) {\r\n // AKA 'currentPrice' - this is by default\r\n priceType = this._mapNumberToIPriceRange(Math.max(productPrice.BasePrice || 0, productPrice.TradeAgreementPrice || 0, productPrice.AdjustedPrice || 0));\r\n }\r\n\r\n const originalPrice = priceType;\r\n const currentPrice = priceType;\r\n\r\n return {\r\n locale: requestContext.locale,\r\n currencyCode: (channelConfiguration && channelConfiguration.Currency) || 'USD',\r\n freePriceText: this.props.resources.priceFree,\r\n currentPrice,\r\n originalPrice\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n private _mapNumberToIPriceRange = (price: number | undefined): IPriceRange | undefined => {\r\n if (price !== undefined) {\r\n return {\r\n startingValue: price\r\n };\r\n }\r\n\r\n return undefined;\r\n };\r\n}\r\n\r\nexport default ProductPriceModule;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IWineFinderByZipViewProps } from '../../../modules/wine-finder-by-zip/./wine-finder-by-zip';\r\n\r\n/**\r\n * Class definition responsible for redirecting to findusawine.com to find local wine retailers based on the user inputted zipcode\r\n */\r\n@observer\r\nexport class WineFinderByZipView extends React.PureComponent {\r\n /**\r\n * field representing the location being typed in by the user\r\n */\r\n @observable private _queryZipcode: string = '';\r\n\r\n public constructor(props: IWineFinderByZipViewProps) {\r\n super(props);\r\n this._handleQueryZipcodeChange = this._handleQueryZipcodeChange.bind(this);\r\n this._keyup = this._keyup.bind(this);\r\n this._doQuery = this._doQuery.bind(this);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n /**\r\n * handles changes for the zipcode entered\r\n */\r\n private _handleQueryZipcodeChange(event: React.ChangeEvent): void {\r\n this._queryZipcode = event.target.value;\r\n }\r\n\r\n /**\r\n * checks if the enter/return key has been pressed to submit a zipcode query\r\n */\r\n private _keyup(event: React.KeyboardEvent): void {\r\n if (event.keyCode === 13 && !this._isInvalid()) {\r\n this._doQuery();\r\n }\r\n }\r\n\r\n /**\r\n * process to disable the Search button if the user's text input is not a 5 digit entry (findusawine.com does not support 9 digit zip codes)\r\n */\r\n private _isInvalid(): boolean {\r\n const regex = /^\\d{5}$/;\r\n return (!regex.test(this._queryZipcode));\r\n }\r\n\r\n /**\r\n * process to send the zip code query to findusawine.com\r\n */\r\n private _doQuery(): void {\r\n window.open(`https://www.findusawine.com/${this.props.config.wineBrandUrl}/locate/domestic-results?location=${this._queryZipcode}&product_key=&header=&retail=true&restaurant=true`, '_blank');\r\n }\r\n\r\n}\r\n\r\nexport default WineFinderByZipView;","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IWineFinderByZipViewProps } from './wine-finder-by-zip';\r\n\r\n/**\r\n * Class definition responsible for redirecting to findusawine.com to find local wine retailers based on the user inputted zipcode\r\n */\r\n@observer\r\nexport class WineFinderByZipView extends React.Component {\r\n /**\r\n * field representing the location being typed in by the user\r\n */\r\n @observable private _queryZipcode: string = '';\r\n\r\n public constructor(props: IWineFinderByZipViewProps) {\r\n super(props);\r\n this._handleQueryZipcodeChange = this._handleQueryZipcodeChange.bind(this);\r\n this._keyup = this._keyup.bind(this);\r\n this._doQuery = this._doQuery.bind(this);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * handles changes for the zipcode entered\r\n */\r\n private _handleQueryZipcodeChange(event: React.ChangeEvent): void {\r\n this._queryZipcode = event.target.value;\r\n }\r\n\r\n /**\r\n * checks if the enter/return key has been pressed to submit a zipcode query\r\n */\r\n private _keyup(event: React.KeyboardEvent): void {\r\n if (event.keyCode === 13 && !this._isInvalid()) {\r\n this._doQuery();\r\n }\r\n }\r\n\r\n /**\r\n * process to disable the Search button if the user's text input is not a 5 digit entry (findusawine.com does not support 9 digit zip codes)\r\n */\r\n private _isInvalid(): boolean {\r\n const regex = /^\\d{5}$/;\r\n return (!regex.test(this._queryZipcode));\r\n }\r\n\r\n /**\r\n * process to send the zip code query to findusawine.com\r\n */\r\n private _doQuery(): void {\r\n window.open(`https://www.findusawine.com/${this.props.config.wineBrandUrl}/locate/domestic-results?location=${this._queryZipcode}&product_key=&header=&retail=true&restaurant=true`, '_blank');\r\n }\r\n\r\n}\r\n\r\nexport default WineFinderByZipView;","/*---------------------------------------------------------------------------------------------\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 * as React from 'react';\r\n\r\nimport { IWineFinderByZipData } from './wine-finder-by-zip.data';\r\nimport { IWineFinderByZipProps } from './wine-finder-by-zip.props.autogenerated';\r\n\r\nexport interface IWineFinderByZipViewProps extends IWineFinderByZipProps {\r\n\r\n}\r\n\r\n/**\r\n *\r\n * WineFinderByZip component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass WineFinderByZip extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default WineFinderByZip;\r\n","import { IImageData, IImageSettings, Image, RichTextComponent } from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IHomeCarouselProps, IHomeCarouselSlidesData, ILinkData } from './home-carousel.props.autogenerated';\r\n\r\n/**\r\n *\r\n * HomeCarousel component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass HomeCarousel extends React.Component> {\r\n\r\n //==========================================================================\r\n // VARIABLES\r\n //==========================================================================\r\n\r\n @observable private currentSlide: number;\r\n private slides: IHomeCarouselSlidesData[];\r\n private scrollThreshold: number;\r\n private scrollStart: number | undefined;\r\n private cycleInterval?: ReturnType;\r\n private defaultImageSettings: IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=24&h=24&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=24&h=24&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n //==========================================================================\r\n // LIFE CYCLE\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n constructor(props: IHomeCarouselProps<{}>) {\r\n super(props);\r\n this.currentSlide = 0;\r\n this.slides = props.config.homeCarouselSlides ? props.config.homeCarouselSlides.filter(slide => (!slide.hidden)) : [];\r\n this.scrollThreshold = 100;\r\n this._randomizeStart = this._randomizeStart.bind(this);\r\n this._autoAdvance = this._autoAdvance.bind(this);\r\n this._restartAutoAdvance = this._restartAutoAdvance.bind(this);\r\n this._previousSlide = this._previousSlide.bind(this);\r\n this._nextSlide = this._nextSlide.bind(this);\r\n this._handleTouchStart = this._handleTouchStart.bind(this);\r\n this._handleTouchEnd = this._handleTouchEnd.bind(this);\r\n this._handleKeyPress = this._handleKeyPress.bind(this);\r\n this._selectorSlideChange = this._selectorSlideChange.bind(this);\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public componentDidMount(): void {\r\n document.addEventListener('keyup', this._handleKeyPress);\r\n\r\n if (this.props.config.homeCarouselRandomize && this.slides) {\r\n this._randomizeStart(this.slides.length);\r\n }\r\n\r\n if (this.props.config.homeCarouselInterval && this.slides) {\r\n this._autoAdvance();\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public componentWillUnmount(): void {\r\n document.removeEventListener('keyup', this._handleKeyPress);\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n if (!this.slides) {\r\n return null;\r\n }\r\n return this._getCarousel;\r\n }\r\n\r\n //==========================================================================\r\n // RENDER METHODS\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private get _getCarousel(): JSX.Element {\r\n const currentClassName = this.slides && this.slides[this.currentSlide].className;\r\n const selectorList = [] as JSX.Element[];\r\n const indicatorList = [] as JSX.Element[];\r\n const slideList = [] as JSX.Element[];\r\n this.slides.map((slide, index) => {\r\n selectorList.push(\r\n this._getSelector(slide, index)\r\n );\r\n indicatorList.push(\r\n this._getIndicator(index)\r\n );\r\n slideList.push(\r\n this._getSlide(slide, index)\r\n );\r\n });\r\n return (\r\n \r\n
\r\n {selectorList}\r\n {this._getNext(this.props.resources.homeCarousel_next)}\r\n
\r\n
\r\n {slideList}\r\n
\r\n
\r\n {indicatorList}\r\n
\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getSelector(slide: IHomeCarouselSlidesData, index: number): JSX.Element {\r\n const isCurrentSelector = index === this.currentSlide;\r\n return (\r\n \r\n
{slide.slideSelector}
\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getNext(text: string): JSX.Element {\r\n return (\r\n \r\n
\r\n
{text}
\r\n
\r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getIndicator(index: number): JSX.Element {\r\n const isCurrentIndicator = index === this.currentSlide;\r\n return (\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getSlide(slide: IHomeCarouselSlidesData, index: number): JSX.Element {\r\n const isCurrentSlide = index === this.currentSlide;\r\n return (\r\n \r\n
\r\n
\r\n {this._getLogo(slide.logo)}\r\n \r\n {this._getLink(slide.link)}\r\n
\r\n
\r\n {this._getBackgroundImage(slide.backgroundImage)}\r\n
\r\n
\r\n
\r\n
\r\n {this._getLogo(slide.logoMobile || slide.logo)}\r\n
\r\n
\r\n {this._getBackgroundImage(slide.backgroundImageMobile)}\r\n
\r\n
\r\n \r\n );\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getLink(link: ILinkData | undefined): JSX.Element | null {\r\n if (link && link.linkUrl.destinationUrl && link.linkText) {\r\n return (\r\n \r\n {link.linkText}\r\n \r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getLogo(image: IImageData | undefined): JSX.Element | null {\r\n if (image) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _getBackgroundImage(image: IImageData | undefined): JSX.Element | null {\r\n if (image) {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n //==========================================================================\r\n // HANDLE METHODS\r\n //==========================================================================\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _randomizeStart(max: number): void {\r\n // tslint:disable-next-line:insecure-random\r\n const startSlide: number = Math.round(Math.random() * (max - 1));\r\n this.currentSlide = startSlide;\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _autoAdvance(): void {\r\n const { homeCarouselInterval } = this.props.config;\r\n if (homeCarouselInterval && this.slides) {\r\n this.cycleInterval = setInterval(this._nextSlide, homeCarouselInterval);\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _restartAutoAdvance(): void {\r\n if (this.cycleInterval) {\r\n clearInterval(this.cycleInterval);\r\n this._autoAdvance();\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _selectorSlideChange(element: React.MouseEvent): void {\r\n const index = element.currentTarget.getAttribute('data-id')!;\r\n this.currentSlide = +index;\r\n this._restartAutoAdvance();\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _previousSlide(): void {\r\n this.currentSlide = (this.currentSlide > 0) ? this.currentSlide - 1 : this.slides.length - 1;\r\n this._restartAutoAdvance();\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _nextSlide(): void {\r\n this.currentSlide = (this.currentSlide < this.slides.length - 1) ? this.currentSlide + 1 : 0;\r\n this._restartAutoAdvance();\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _handleTouchStart(event: React.TouchEvent): void {\r\n if (event.touches.length === 0) {\r\n this.scrollStart = undefined;\r\n } else {\r\n this.scrollStart = event.touches[0].screenX;\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n private _handleTouchEnd(event: React.TouchEvent): void {\r\n if (event.changedTouches.length > 0 && this.scrollStart !== undefined) {\r\n const newTarget: number = event.changedTouches[0].screenX;\r\n const delta = newTarget - this.scrollStart;\r\n\r\n if (delta > this.scrollThreshold) {\r\n this._previousSlide();\r\n }\r\n\r\n if (delta < -this.scrollThreshold) {\r\n this._nextSlide();\r\n }\r\n }\r\n\r\n this.scrollStart = undefined;\r\n\r\n return;\r\n }\r\n\r\n //------------------------------------------------------\r\n //------------------------------------------------------\r\n // tslint:disable-next-line:no-any\r\n private _handleKeyPress = (event: any) => {\r\n if (event.keyCode === 37) {\r\n this._previousSlide();\r\n } else if (event.keyCode === 39) {\r\n this._nextSlide();\r\n }\r\n };\r\n}\r\n\r\nexport default HomeCarousel;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport * as React from 'react';\r\nimport { IInstagramIntegrationViewProps } from './instagram-integration';\r\n\r\n/**\r\n * Loads a Wayin script that embeds Instagram images for a configurable API Token\r\n */\r\nexport class InstagramIntegrationView extends React.PureComponent {\r\n\r\n public constructor(props: IInstagramIntegrationViewProps) {\r\n super(props);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n // tslint:disable-next-line: react-iframe-missing-sandbox\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default InstagramIntegrationView;","/*---------------------------------------------------------------------------------------------\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 * as React from 'react';\r\n\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport { IInstagramIntegrationData } from './instagram-integration.data';\r\nimport { IInstagramIntegrationProps } from './instagram-integration.props.autogenerated';\r\nexport interface IInstagramIntegrationViewProps extends IInstagramIntegrationProps { }\r\n\r\n/**\r\n *\r\n * InstagramIntegration component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass InstagramIntegration extends React.Component> {\r\n\r\n @observable public _scriptLoaded: boolean = false;\r\n private _scriptSrc: string = 'https://us-display.wayin.com/ui/ngx.embed.min.js';\r\n\r\n public constructor(props: IInstagramIntegrationProps<{}>) {\r\n super(props);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (!this._isScriptLoaded) {\r\n this._injectScript();\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n if (this._scriptLoaded) {\r\n return this.props.renderView(this.props) ||
;\r\n }\r\n return
;\r\n }\r\n\r\n private _injectScript(): void {\r\n const script = document.createElement('script');\r\n\r\n script.onload = () => { this._scriptLoaded = true; };\r\n script.src = 'https://us-display.wayin.com/ui/ngx.embed.min.js';\r\n\r\n document.head.appendChild(script);\r\n }\r\n\r\n private get _isScriptLoaded(): boolean {\r\n return !!document.querySelector(`script[src='${this._scriptSrc}']`);\r\n }\r\n}\r\n\r\nexport default InstagramIntegration;\r\n","\r\nimport * as React from 'react';\r\nimport { IOverflowContainerViewProps } from '../../../modules/overflow-container/overflow-container';\r\n\r\nconst OverflowContainerView: React.FC = props => {\r\n const { btn, content, currentClass, config: { cssClassName } } = props;\r\n\r\n return (\r\n
\r\n {btn}\r\n {content}\r\n
\r\n );\r\n};\r\n\r\nexport default OverflowContainerView;","import classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IOverflowContainerViewProps } from '../../../modules/overflow-container/overflow-container';\r\n\r\nconst OverflowContainerView: React.FC = props => {\r\n const { btn, content, currentClass, config: { cssClassName } } = props;\r\n\r\n return (\r\n
\r\n {btn}\r\n {content}\r\n
\r\n );\r\n};\r\n\r\nexport default OverflowContainerView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport { IWineFinderByZipViewProps } from '../../../modules/wine-finder-by-zip/./wine-finder-by-zip';\r\n\r\n/**\r\n * Class definition responsible for redirecting to findusawine.com to find local wine retailers based on the user inputted zipcode\r\n */\r\n@observer\r\nexport class WineFinderByZipView extends React.PureComponent {\r\n /**\r\n * field representing the location being typed in by the user\r\n */\r\n @observable private _queryZipcode: string = '';\r\n\r\n public constructor(props: IWineFinderByZipViewProps) {\r\n super(props);\r\n this._handleQueryZipcodeChange = this._handleQueryZipcodeChange.bind(this);\r\n this._doQuery = this._doQuery.bind(this);\r\n this._handleHowToBuyNav = this._handleHowToBuyNav.bind(this);\r\n this._keyup = this._keyup.bind(this);\r\n this._smoothVerticalScrolling = this._smoothVerticalScrolling.bind(this);\r\n this._scrollingHelper = this._scrollingHelper.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n window.addEventListener('hashchange', this._handleHowToBuyNav);\r\n // remove includes statment before going live (only check for location hash)\r\n if (this.props.context.request.url.requestUrl.search.includes('divId=how-to-buy') || location.hash === '#how-to-buy') {\r\n this._handleHowToBuyNav();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window.removeEventListener('hashchange', this._handleHowToBuyNav);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n /**\r\n * handles changes for the zipcode entered\r\n */\r\n private _handleQueryZipcodeChange(event: React.ChangeEvent): void {\r\n this._queryZipcode = event.target.value;\r\n }\r\n\r\n /**\r\n * checks if the enter/return key has been pressed to submit a zipcode query\r\n */\r\n private _keyup(event: React.KeyboardEvent): void {\r\n if (event.keyCode === 13 && !this._isInvalid()) {\r\n this._doQuery();\r\n }\r\n }\r\n\r\n /**\r\n * process to disable the Search button if the user's text input is not a 5 digit entry (findusawine.com does not support 9 digit zip codes)\r\n */\r\n private _isInvalid(): boolean {\r\n const regex = /^\\d{5}$/;\r\n return (!regex.test(this._queryZipcode));\r\n }\r\n\r\n /**\r\n * process to send the zip code query to findusawine.com\r\n */\r\n private _doQuery(): void {\r\n window.open(`https://www.findusawine.com/${this.props.config.wineBrandUrl}/locate/domestic-results?location=${this._queryZipcode}&product_key=&header=&retail=true&restaurant=true`, '_blank');\r\n }\r\n\r\n /**\r\n * handles navigation to the #how-to-buy anchor tag (to be slightly modified before going live)\r\n */\r\n private _handleHowToBuyNav(): void {\r\n if (location.hash === '#how-to-buy' || !location.hash) {\r\n // eslint-disable-next-line react/no-find-dom-node\r\n const parentContainer = ReactDOM.findDOMNode(this)!.parentNode as Element;\r\n this._smoothVerticalScrolling(parentContainer, 300, 'top');\r\n // following if statement to be removed. only required while we utilize a query parameter for how-to-buy\r\n if (this.props.context.request.url.requestUrl.search.includes('divId=how-to-buy')) {\r\n history.pushState({}, '', `${this.props.context.request.url.requestUrl.origin}/?domain=www.h3wines.com`);\r\n } else {\r\n history.pushState('', document.title, window.location.pathname + window.location.search);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * custom process to scroll to an element (since smooth scrolling with window.ScrollTo is not supported by Safari and IE)\r\n */\r\n private _smoothVerticalScrolling(e: Element, time: number, where: string): void {\r\n const eTop = e.getBoundingClientRect().top;\r\n const eAmt = eTop / 100;\r\n let curTime = 0;\r\n while (curTime <= time) {\r\n window.setTimeout(this._scrollingHelper, curTime, eAmt, where);\r\n curTime += time / 100;\r\n }\r\n }\r\n\r\n /**\r\n * helper process for _SmoothVerticalScrolling\r\n */\r\n private _scrollingHelper(eAmt: number, where: string): void {\r\n if (where === 'center' || where === '') {\r\n window.scrollBy(0, eAmt / 2);\r\n }\r\n if (where === 'top') {\r\n window.scrollBy(0, eAmt / 1.044);\r\n }\r\n }\r\n\r\n}\r\n\r\nexport default WineFinderByZipView;","\r\nimport * as React from 'react';\r\nimport { IOverflowContainerViewProps } from '../../../modules/overflow-container/overflow-container';\r\n\r\nconst OverflowContainerView: React.FC = props => {\r\n const { btn, content, currentClass, config: { cssClassName } } = props;\r\n\r\n return (\r\n
\r\n {btn}\r\n {content}\r\n
\r\n );\r\n};\r\n\r\nexport default OverflowContainerView;","import { Image } from '@msdyn365-commerce/core';\r\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { ITastingNotesData } from './tasting-notes.data';\r\nimport { ITastingNotesProps } from './tasting-notes.props.autogenerated';\r\n\r\n/**\r\n *\r\n * TastingNotes component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass TastingNotes extends React.PureComponent> {\r\n\r\n private tastingNotesAttributeName: string = 'visual tasting notes';\r\n\r\n // =========================================================================\r\n // PUBLIC METHODS\r\n // =========================================================================\r\n\r\n // ------------------------------------------------------\r\n // ------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n const content: ITastingNotesData = this.props.data;\r\n const productAttributes = content && content.productSpecificationData && content.productSpecificationData.result;\r\n const tastingNotes = productAttributes && productAttributes.find(\r\n attribute => attribute.Name && (attribute.Name.toLowerCase() === this.tastingNotesAttributeName)\r\n );\r\n if (tastingNotes) {\r\n const tastingNotesContent = this._getContent(tastingNotes);\r\n return (\r\n
\r\n {tastingNotesContent}\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n // =========================================================================\r\n // PRIVATE METHODS\r\n // =========================================================================\r\n\r\n // ------------------------------------------------------\r\n // ------------------------------------------------------\r\n private _getContent(tastingNotes: AttributeValue | undefined): JSX.Element[] | null {\r\n if (tastingNotes && tastingNotes.TextValue) {\r\n const tastingNotesContent: JSX.Element[] = [];\r\n const tastingNotesList = tastingNotes.TextValue.replace(/\\s/g, '').toLowerCase().split(',');\r\n tastingNotesList.forEach(note => {\r\n tastingNotesContent.push(\r\n
\r\n {this._getImage(note)}\r\n
\r\n );\r\n });\r\n return tastingNotesContent;\r\n }\r\n return null;\r\n }\r\n\r\n // ------------------------------------------------------\r\n // ------------------------------------------------------\r\n private _getImage(note: string): JSX.Element {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default TastingNotes;\r\n","/*---------------------------------------------------------------------------------------------\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 * as React from 'react';\r\n\r\nimport { IOverflowContainerProps } from './overflow-container.props.autogenerated';\r\n\r\nexport interface IOverflowContainerViewProps extends IOverflowContainerProps<{}> {\r\n content: React.ReactNode;\r\n btn: React.ReactNode;\r\n currentClass: string;\r\n}\r\n\r\ninterface IOverflowContainerData {\r\n isOverflowExpandedState: boolean;\r\n expandedState: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * OverflowContainer component\r\n * @extends {React.PureComponent, IOverflowContainerData>}\r\n */\r\nclass OverflowContainer extends React.PureComponent, IOverflowContainerData> {\r\n private readonly _OPENED_CLASS: string = 'overflow-container-opened';\r\n private readonly _CLOSED_CLASS: string = 'overflow-container-closed';\r\n\r\n constructor(props: IOverflowContainerProps<{}>) {\r\n super(props);\r\n\r\n this.state = {\r\n isOverflowExpandedState: !!this.props.config.openByDefault,\r\n expandedState: false\r\n };\r\n\r\n this._toggleExpansion = this._toggleExpansion.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (this.props.config.closeOnClickOff) {\r\n document.body && document.body.addEventListener('mousedown', this._handleClickOutsideOverflow);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (this.props.config.closeOnClickOff) {\r\n document.body && document.body.removeEventListener('mousedown', this._handleClickOutsideOverflow, false);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const props: IOverflowContainerViewProps = {\r\n ...this.props,\r\n content: this._jsxContent,\r\n btn: this._jsxBtn,\r\n currentClass: this._currentClass\r\n };\r\n return this.props.renderView(props) as JSX.Element;\r\n }\r\n\r\n private _toggleExpansion(): void {\r\n this.setState({\r\n isOverflowExpandedState: !this.state.isOverflowExpandedState,\r\n expandedState: !this.state.expandedState\r\n });\r\n }\r\n\r\n // tslint:disable-next-line:no-any\r\n private _handleClickOutsideOverflow = (event: any) => {\r\n const overflow:boolean = event.target.className === 'overflow-container-btn';\r\n const pulldownElement = document.getElementById('overflow-container-content');\r\n if (this.state.isOverflowExpandedState && !pulldownElement?.contains(event.target) && !overflow) {\r\n this.setState({\r\n isOverflowExpandedState: false,\r\n expandedState: false\r\n });\r\n }\r\n };\r\n\r\n private get _jsxContent(): JSX.Element | null {\r\n const content = this.props.slots.content;\r\n\r\n return (\r\n
\r\n {content && content.map((module, index) => (\r\n \r\n {module}\r\n \r\n ))}\r\n
\r\n );\r\n }\r\n\r\n private get _currentClass(): string {\r\n return (this.state.isOverflowExpandedState) ? this._OPENED_CLASS : this._CLOSED_CLASS;\r\n }\r\n\r\n private get _jsxBtn(): JSX.Element {\r\n const btn = this.props.config.btn;\r\n const btnText = (this.state.isOverflowExpandedState) ? btn?.openText || 'Close' : btn?.closeText || 'Expand';\r\n return ();\r\n }\r\n}\r\n\r\nexport default OverflowContainer;\r\n"],"sourceRoot":""}