{"version":3,"sources":["webpack:///./src/modules/citta-journal-posts/citta-journal-posts.tsx?d814","webpack:///./src/data-actions/geo-location/bing-maps-locations.ts?dfb7","webpack:///./src/modules/citta-freight-charges/citta-freight-charges.tsx?b724","webpack:///src/modules/interactive-feature-collection/interactive-feature-collection.view.tsx?5927","webpack:///./src/modules/citta-freight-charges/citta-freight-charges.view.tsx?30d5","webpack:///./src/modules/citta-journal-posts/citta-journal-posts.view.tsx?6e32","webpack:///./src/themes/citta/views/video-player.view.tsx?92a7","webpack:///src/modules/interactive-feature-collection/interactive-feature-collection.tsx?2538"],"names":["Market","CittaJournalPosts","React","constructor","props","super","moduleClassName","_renderLoadMore","displayedJournals","allJournals","this","state","length","className","onClick","_loadMore","_onType","e","categoryFilter","list","_getFilteredJournals","target","value","toLowerCase","setState","displayCount","slice","searchTerm","filter","journal","category","title","indexOf","subTitle","_setCategoryFilter","type","_renderCategoryFilter","categories","config","map","_renderSearch","onChange","placeholder","getMarket","url","arguments","undefined","indexOfCountry","market","split","NZ","toUpperCase","_getPostUrl","postUrl","context","request","requestUrl","href","_renderPosts","posts","post","imageUrl","src","alt","_formatDate","date","audience","journals","data","result","journalsFilteredByAudience","bind","componentDidMount","MsDyn365","isBrowser","window","decodeURI","location","search","urlParams","URLSearchParams","journalcategory","has","get","find","c","toLocaleLowerCase","container","document","querySelector","middle","children","Math","floor","scrollLeft","offsetLeft","offsetWidth","render","viewProps","_objectSpread","JournalsWrapper","moduleProps","classnames","loadMore","renderView","d","parseInt","newDisplayCount","BingMapsLocationsInput","lat","lon","apiKey","endPoint","getCacheKey","latitude","longitude","getCacheObjectType","dataCacheType","serviceEndpoint","createObservableDataAction","action","async","input","ctx","trace","callbackString","crypto","getRandomValues","Uint32Array","encodeURI","Promise","resolve","script","createElement","setAttribute","body","removeChild","resourceSets","resources","postalCode","address","appendChild","CittaFreightCharges","errorMessage","isOpen","freightResponse","isError","_productFreightAttribute","app","freightValue","_showAvailablityText","_checkFreightAttributes","prodAttributes","productAttributes","filterAttributes","attribute","Name","BooleanValue","_handleChange","ref","event","_handleSearch","preventDefault","postalCodeInput","_PostalCodeInputRef","current","postalCodeInputErrorMessage1","_isValidPostalCode","response","_getItemFreightCharges","Result","Message","postalCodeInputErrorMessage2","_getNewFreightCharges","test","_closeModal","_openModal","reaction","onUpdateQuantityFreightCheck","productQuantityState","productQuantity","catch","telemetry","error","that","navigator","geolocation","getCurrentPosition","position","coords","toString","code","PERMISSION_DENIED","responseObj","freightAttributeCheck","freightResponseCheck","CittaFreightChargesViewProps","ProductFreightContainer","ProductFreightAttribute","ProductFreightAttributeModal","ProductNoFreightAttribute","productFreightAmount","_renderProductFreightAmount","productFreightMessage","_renderProductFreightMessage","productFreightCalculate","_renderProductFreightCalculate","productFreightUpdate","_renderProductFreightUpdate","productFreightModel","_renderProductFreightModal","productNoFreight","_renderProductNoFreight","freightAttribute","itemLine","ItemId","product","Quantity","currentQuantity","callerContext","actionContext","dXC_GetFreightChargesForPDPAsync","bingAppKey","bingApiAppKey","bingApiEndpoint","bingApiEndPoint","searchInput","geoLocation","then","ChargesAmount","prevState","_getFormattedPrice","freightAmount","formattedPrice","cultureFormatter","formatCurrency","freight_estimatedShippingText","freightBasedOnCityName","freight_basedOnText","Button","id","freight_updateLocationLinkText","outline","freight_updateLocationLinkAltText","freightCheck","availableForLabelText","freight_availableForLabel","availableForValue","availableFor","Modal","autoFocus","fade","horizontalPosition","verticalPosition","zIndex","toggle","applicationNode","lightboxClassName","ModalHeader","modalHeader","ModalBody","name","role","autoComplete","onSubmit","Heading","text","formHeadingText","tag","postalCodeInputLabel","color","freight_postCode","freight_delivery","deliveryInfoBottom1","deliveryInfoBottom2","deliveryInfoBottom3","__decorate","observer","interactiveFeatureCollectionView","interactiveFeatureCollectionHeading","interactiveFeatureCollectionContainer","interactiveFeatureCollectionDesktopContainer","interactiveFeatureCollectionDesktopItems","interactiveFeatureCollectionMobileItems","interactiveFeatureCollectionMobileContainer","singleSlideCarouselComponentProps","singleSlideCarouselItemContainer","Module","Object","assign","Node","tileItem","index","keyIndex","key","CittaFreightChargesView","VideoPlayerView","_renderDesktop","playerResources","playAriaLabel","playLabel","pauseAriaLabel","pauseLabel","muteAriaLabel","muteLabel","unMuteAriaLabel","unMuteLabel","fullScreenAriaLabel","fullScreenLabel","exitFullScreenAriaLabel","exitFullScreenLabel","playingAriaLabel","playingLabel","pausedAriaLabel","pausedLabel","player","_renderMobile","imageSettingsDefault","disableLazyLoad","viewports","xs","q","w","h","image","mobileImage","_image$imageSettings","Image","altText","gridSettings","imageSettings","loadFailureBehavior","_renderVideoPlayerOverlay","buttonText","buttonLink","headerText","isMobile","_updateIsMobile","innerWidth","addEventListener","componentWillUnmount","removeEventListener","renderModuleAttributes","InteractiveFeatureCollection","_telemetryContent","getTelemetryObject","telemetryPageName","friendlyName","handleTextChange","item","itemsCounter","indexItem","itemCounter","isMosaic","_this$props$config$cl","_title$tag","interactiveItems","slots","interactiveFeatureItems","itemsFeatureCounter","SingleSlideCarousel","flipperPrevLabel","flipperPrevious","flipperNextLabel","flipperNext","parentId","telemetryContent","vertical","createHeading","Msdyn365","editProps","onEdit","requestContext","_getFeatureItem"],"mappings":";yGAcKA,E,isBAAL,SAAKA,GACDA,EAAA,SACAA,EAAA,SACAA,EAAA,SAHJ,CAAKA,MAAM,KAgCX,MAAMC,UAA0BC,gBAG5BC,YAAYC,GACRC,MAAMD,GAHF,KAAAE,gBAA0B,wBAoE1B,KAAAC,gBAAkB,KACtB,MAAM,kBAACC,EAAiB,YAAEC,GAAgBC,KAAKC,MAC/C,OAAIH,EAAkBI,QAAUH,EAAYG,OACjC,KAGPV,gBAAA,OAAKW,UAAU,mCACXX,gBAAA,KAAGY,QAASJ,KAAKK,WAAS,eAK9B,KAAAC,QAAWC,IACf,MAAM,eAAEC,GAAmBR,KAAKC,MAI1BQ,EAAQT,KAAKU,qBAAqBH,EAAEI,OAAOC,MAAMC,cAAeL,GAEtER,KAAKc,SAAS,CACVC,aALoB,GAMpBjB,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P,KAAM,YAEVqB,wCAAyCjR,KAAKN,MAAMiW,MAAMC,wBAC1D5E,yCACI6E,EAnCwB,GAoCxBH,EAAiB7T,IAAI,CAACsT,EAAuBzD,IACzCmD,EAA6B8B,gBAAgBxB,EAAMzD,EAAOmE,MAGtE,OAAO7V,KAAKN,MAAMoG,WAAWN,IAatBqP","file":"static/js/31.6709100b18c809d27c8e.chunk.js","sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\nimport { ICittaJournalPostsData } from './citta-journal-posts.data';\r\nimport { ICittaJournalPostsProps } from './citta-journal-posts.props.autogenerated';\r\nimport {IGetJournalPostData } from '../../data-actions/journal/get-journal-posts';\r\n\r\nenum Market {\r\n NZ = 'NZL',\r\n AU = 'AUS',\r\n US = 'USA'\r\n}\r\n\r\nexport interface ICittaJournalPostsViewProps extends ICittaJournalPostsProps {\r\n JournalsWrapper: IModuleProps;\r\n journals: React.ReactNode;\r\n loadMore: React.ReactNode;\r\n search: React.ReactNode;\r\n categories: React.ReactNode;\r\n}\r\n\r\n// const Categories = {\r\n// behindtheproduct: 'Città Behind the product',\r\n// styling: 'Stying'\r\n// }\r\n\r\nexport interface ICittaJournalPostsState {\r\n allJournals: any;\r\n displayedJournals: any;\r\n displayCount: number;\r\n searchTerm: string;\r\n categoryFilter: string;\r\n}\r\n\r\n/**\r\n *\r\n * CittaJournalPosts component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass CittaJournalPosts extends React.PureComponent, ICittaJournalPostsState> {\r\n private moduleClassName: string = 'journal-posts-wrapper';\r\n\r\n constructor(props: any) {\r\n super(props);\r\n const { audience } = props.config;\r\n const journals = props.data && props.data.journals && props.data.journals.result;\r\n let journalsFilteredByAudience = journals.posts && journals.posts.filter((post: any) => post.audience.indexOf(audience) != -1);\r\n\r\n this.state = {\r\n allJournals: journalsFilteredByAudience || [],\r\n displayedJournals: (journalsFilteredByAudience || []).slice(0, 6),\r\n displayCount: 6,\r\n searchTerm: '',\r\n categoryFilter: ''\r\n }\r\n this._loadMore = this._loadMore.bind(this);\r\n this._renderSearch = this._renderSearch.bind(this);\r\n this._renderCategoryFilter = this._renderCategoryFilter.bind(this);\r\n this._onType = this._onType.bind(this);\r\n this._getPostUrl = this._getPostUrl.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.isBrowser && typeof window !== 'undefined') {\r\n const { categories } = this.props.config;\r\n const url: string = decodeURI(window.location.search);\r\n const urlParams = new URLSearchParams(url);\r\n const journalcategory = urlParams.has('journalcategory') ? urlParams.get('journalcategory') : '';\r\n const category = categories?.find((c: String) => c.toLocaleLowerCase() === journalcategory?.toLocaleLowerCase());\r\n category && this._setCategoryFilter(category)\r\n }\r\n\r\n let container = document.querySelector(\".journal-posts-wrapper-categories ul\");\r\n if (container) {\r\n const middle = container.querySelector(\"li.active\") || container.children[Math.floor((container.children.length) / 2)];\r\n // @ts-ignore\r\n container.scrollLeft = middle.offsetLeft + middle.offsetWidth / 2 - container.offsetWidth / 2;\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {displayedJournals, allJournals} = this.state;\r\n\r\n if (!allJournals || !allJournals.length) {\r\n //TODO: create a better page in here for no posts found or something\r\n return
No journals found at the moment
\r\n }\r\n\r\n const viewProps: ICittaJournalPostsViewProps = {\r\n ...(this.props as ICittaJournalPostsProps ),\r\n JournalsWrapper: {\r\n moduleProps: this.props,\r\n className: classnames(this.moduleClassName)\r\n },\r\n journals: this._renderPosts(displayedJournals),\r\n loadMore: this._renderLoadMore(),\r\n search: this._renderSearch(),\r\n categories: this._renderCategoryFilter(),\r\n };\r\n\r\n return this.props.renderView(viewProps);\r\n }\r\n\r\n private _formatDate(date: string): string {\r\n const d = date.split('-');\r\n return `${parseInt(d[2], 10)}.${parseInt(d[1], 10)}.${d[0]}`\r\n }\r\n\r\n private _renderLoadMore = () => {\r\n const {displayedJournals, allJournals } = this.state;\r\n if (displayedJournals.length >= allJournals.length) {\r\n return null;\r\n }\r\n return (\r\n
\r\n Load More\r\n
\r\n )\r\n }\r\n\r\n private _onType = (e: React.ChangeEvent) => {\r\n const { categoryFilter } = this.state;\r\n\r\n const newDisplayCount = 10;\r\n\r\n const list = this._getFilteredJournals(e.target.value.toLowerCase(), categoryFilter)\r\n \r\n this.setState({\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount),\r\n searchTerm: e.target.value,\r\n })\r\n }\r\n\r\n private _getFilteredJournals = (searchTerm: string, categoryFilter: string) => {\r\n const { allJournals } = this.state;\r\n\r\n let list = allJournals.filter((journal: IGetJournalPostData) => {\r\n if (categoryFilter && journal.category !== categoryFilter) {\r\n return null;\r\n }\r\n return journal.title.toLowerCase().indexOf(searchTerm) !== -1 || \r\n journal.subTitle.toLowerCase().indexOf(searchTerm) !== -1 \r\n })\r\n\r\n return list\r\n }\r\n\r\n private _setCategoryFilter = (type: string) => {\r\n const { searchTerm } = this.state;\r\n\r\n const newDisplayCount = 6;\r\n\r\n let list = this._getFilteredJournals(searchTerm, type);\r\n this.setState({\r\n categoryFilter: type,\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount)\r\n })\r\n }\r\n\r\n private _renderCategoryFilter = () => {\r\n const { categories } = this.props.config;\r\n const { categoryFilter } = this.state;\r\n\r\n return (\r\n
\r\n
    \r\n
  • this._setCategoryFilter('')}>All
  • \r\n {categories?.map(category => {\r\n return
  • this._setCategoryFilter(category)}>{category}
  • \r\n })}\r\n
\r\n
\r\n )\r\n }\r\n\r\n private _renderSearch = () => {\r\n return (\r\n
\r\n \r\n
\r\n )\r\n }\r\n\r\n private _loadMore(): void {\r\n const { displayCount, searchTerm, categoryFilter } = this.state;\r\n\r\n const newDisplayCount = displayCount + 3;\r\n let list = this._getFilteredJournals(searchTerm, categoryFilter);\r\n this.setState({\r\n displayCount: newDisplayCount,\r\n displayedJournals: list.slice(0, newDisplayCount)\r\n })\r\n }\r\n\r\n private getMarket = (url: string = ''): string => {\r\n let indexOfCountry = 3;\r\n if (url.indexOf('test.') > 0 || url.indexOf('cittab.') > 0) {\r\n indexOfCountry = 4;\r\n }\r\n let market = (url && url.length > 0) \r\n ? (url.indexOf('//') > -1 \r\n ? ((url.split('/')[indexOfCountry] === undefined || (url.split('/')[indexOfCountry].length > 2 && url.split('/')[indexOfCountry].toLowerCase() !== 'international' && url.split('/')[indexOfCountry].toLowerCase() !== 'us') || url.split('/')[indexOfCountry] === '') \r\n ? Market.NZ \r\n : url.split('/')[indexOfCountry].toUpperCase()) \r\n : Market.NZ) \r\n : '';\r\n\r\n return market;\r\n };\r\n\r\n private _getPostUrl = (postUrl: string) => {\r\n const url = this.props.context.request.url && this.props.context.request.url.requestUrl && this.props.context.request.url.requestUrl.href;\r\n\r\n if (postUrl.indexOf('https://') !== -1) {\r\n return postUrl;\r\n }\r\n\r\n const market = this.getMarket(url);\r\n\r\n if (market === 'AU') {\r\n return `\\/au${postUrl}`\r\n } else if (market.toLowerCase() === 'international' || market.toLowerCase() === 'us') { \r\n return `/${market.toLowerCase()}${postUrl}`\r\n }\r\n \r\n return postUrl;\r\n }\r\n\r\n private _renderPosts = (posts: IGetJournalPostData[]) => {\r\n if (!posts.length) {\r\n return
We can't find any journals to match that
\r\n }\r\n\r\n return posts.map((post: IGetJournalPostData) => {\r\n return (\r\n \r\n );\r\n })\r\n };\r\n}\r\n\r\nexport default CittaJournalPosts;\r\n","import { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput } from '@msdyn365-commerce/core';\r\nimport { BingMapsLocationsResult } from '../../models/bing-maps-data';\r\nimport { GeoLocationPostalCode } from '../../models/search-by-lat-lon-data';\r\n\r\n/**\r\n * Input class for the azure maps search fuzzy API\r\n */\r\nexport class BingMapsLocationsInput implements IActionInput {\r\n public latitude: string;\r\n public longitude: string;\r\n public serviceEndpoint: string;\r\n public apiKey?: string;\r\n\r\n constructor(lat: string, lon: string, apiKey: string, endPoint: string) {\r\n this.latitude = lat;\r\n this.longitude = lon;\r\n this.apiKey = apiKey;\r\n this.serviceEndpoint = endPoint;\r\n }\r\n\r\n public getCacheKey = () => `BingMapsLocationAPI-${this.latitude}-${this.longitude}`;\r\n public getCacheObjectType = () => 'BingMapsLocationAPIResponse';\r\n public dataCacheType = (): CacheType => 'none'; // Don't cache this. Its against bing maps TOS\r\n}\r\n\r\n/**\r\n * Calls azure maps search fuzzy API\r\n */\r\nexport async function getLocations(input: BingMapsLocationsInput, ctx: IActionContext): Promise {\r\n if (!input.apiKey) {\r\n ctx.trace(`[BingMapsLocations] No Bing Maps API key provided`);\r\n\r\n return undefined;\r\n }\r\n\r\n const callbackString = `bingMapsSearchCallback_${crypto.getRandomValues(new Uint32Array(1))[0]}`;\r\n\r\n const requestUrl =\r\n `${encodeURI(input.serviceEndpoint)}/${encodeURI(input.latitude)},${encodeURI(input.longitude)}?key=${encodeURI(input.apiKey)}&jsonp=${callbackString}`;\r\n\r\n return new Promise((resolve) => {\r\n const script = document.createElement('script');\r\n script.setAttribute('type', 'text/javascript');\r\n script.setAttribute('src', requestUrl);\r\n\r\n window[callbackString] = (data: BingMapsLocationsResult) => {\r\n delete window[callbackString];\r\n document.body.removeChild(script);\r\n if (data && data.resourceSets && data.resourceSets.length > 0 && data.resourceSets[0].resources.length > 0) {\r\n resolve({\r\n postalCode: data.resourceSets[0].resources[0].address.postalCode\r\n });\r\n }\r\n resolve(undefined);\r\n };\r\n document.body.appendChild(script);\r\n });\r\n}\r\n\r\nexport default createObservableDataAction({\r\n action: >getLocations,\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\nimport { Button, Heading, IModuleProps, INodeProps, Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport { AttributeValue, IContext } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { reaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { dXC_GetFreightChargesForPDPAsync } from '../../data-actions/generated/DataActionExtension.g';\r\nimport { IDXC_GetFreightChargesServiceResponse, IDXC_ItemLine } from '../../data-actions/generated/DataServiceEntities.g';\r\nimport geoLocation, { BingMapsLocationsInput } from '../../data-actions/geo-location/bing-maps-locations';\r\nimport { IGetFreightChargesServiceResponse } from '../../models/GetFreightChargesServiceResponse';\r\nimport { ICittaFreightChargesData } from './citta-freight-charges.data';\r\nimport { ICittaFreightChargesProps } from './citta-freight-charges.props.autogenerated';\r\n\r\ninterface IFreightChargeState {\r\n errorMessage: string;\r\n isOpen: boolean;\r\n postalCode?: string;\r\n latitude: string;\r\n longitude: string;\r\n freightResponse?: IGetFreightChargesServiceResponse;\r\n isError: boolean;\r\n}\r\n\r\nexport interface ICittaFreightChargesViewProps extends ICittaFreightChargesProps {\r\n ProductFreightContainer: IModuleProps;\r\n ProductFreightAttribute: INodeProps;\r\n ProductNoFreightAttribute: INodeProps;\r\n ProductFreightAttributeModal: INodeProps;\r\n productFreightAmount: React.ReactNode;\r\n productFreightMessage: React.ReactNode;\r\n productFreightCalculate: React.ReactNode;\r\n productFreightUpdate: React.ReactNode;\r\n productFreightModel: React.ReactNode;\r\n productNoFreight: React.ReactNode;\r\n freightAttribute: boolean;\r\n freightResponseCheck: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * CittaFreightCharges component\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nclass CittaFreightCharges extends React.PureComponent, IFreightChargeState> {\r\n\r\n public state: IFreightChargeState = {\r\n errorMessage: '',\r\n isOpen: false,\r\n postalCode: '',\r\n latitude: '',\r\n longitude: '',\r\n freightResponse: undefined,\r\n isError: false\r\n };\r\n\r\n private _productFreightAttribute: string = this.props.context.app.config.freightValue && this.props.context.app.config.freightValue.toUpperCase() || 'FREIGHT ITEM';\r\n private _PostalCodeInputRef: React.RefObject;\r\n private _showAvailablityText: boolean = false;\r\n\r\n constructor(props: ICittaFreightChargesProps) {\r\n super(props);\r\n this._PostalCodeInputRef = React.createRef();\r\n this._closeModal = this._closeModal.bind(this);\r\n this._openModal = this._openModal.bind(this);\r\n this._handleSearch = this._handleSearch.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n reaction(\r\n () => this.props.config.onUpdateQuantityFreightCheck && this.props.data.productQuantityState.result && this.props.data.productQuantityState.result.productQuantity && this.props.data.productQuantityState.result.productQuantity,\r\n () => {\r\n if (this.props.config.onUpdateQuantityFreightCheck && this.props.data.productQuantityState.result && this.props.data.productQuantityState.result.productQuantity && this.props.data.productQuantityState.result.productQuantity) {\r\n this._getNewFreightCharges(this.state.postalCode).catch(e => {\r\n this.props.telemetry.error(`Something went wrong ------${e}`);\r\n });\r\n }\r\n }\r\n );\r\n\r\n // tslint:disable-next-line: no-this-assignment\r\n const that = this;\r\n const freightAttribute: AttributeValue[] | undefined = this.props.data.productAttributes.result;\r\n if (freightAttribute && this._checkFreightAttributes()) {\r\n if (navigator && navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(\r\n async position => {\r\n this.setState({ latitude: position.coords.latitude.toString(), longitude: position.coords.longitude.toString() });\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges();\r\n this.setState({ isOpen: false, freightResponse: response, errorMessage: '' });\r\n },\r\n error => {\r\n if (error.code === error.PERMISSION_DENIED) {\r\n that.setState({ isOpen: false, errorMessage: '' });\r\n }\r\n });\r\n }\r\n } else {\r\n this.setState({ isOpen: false, freightResponse: undefined, errorMessage: '' });\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const config = this.props.config;\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const freightAttributeCheck = this._checkFreightAttributes();\r\n let freightResponseCheck: boolean = false;\r\n if (responseObj && this.state.postalCode && !this.state.isError) {\r\n freightResponseCheck = true;\r\n }\r\n const CittaFreightChargesViewProps = {\r\n ...this.props,\r\n ProductFreightContainer: {\r\n moduleProps: this.props,\r\n className: classnames('product-freight-charges', config.className)\r\n },\r\n ProductFreightAttribute: {\r\n className: 'product-freight'\r\n },\r\n ProductFreightAttributeModal: {\r\n className: ''\r\n },\r\n ProductNoFreightAttribute: {\r\n className: ''\r\n },\r\n productFreightAmount: this._renderProductFreightAmount(),\r\n productFreightMessage: this._renderProductFreightMessage(),\r\n productFreightCalculate: this._renderProductFreightCalculate(),\r\n productFreightUpdate: this._renderProductFreightUpdate(),\r\n productFreightModel: this._renderProductFreightModal(),\r\n productNoFreight: this._renderProductNoFreight(),\r\n freightAttribute: freightAttributeCheck,\r\n freightResponseCheck: freightResponseCheck\r\n };\r\n return this.props.renderView(CittaFreightChargesViewProps) as React.ReactElement;\r\n }\r\n\r\n private _checkFreightAttributes = (): boolean => {\r\n const prodAttributes: AttributeValue[] | undefined = this.props && this.props.data && this.props.data.productAttributes && this.props.data.productAttributes.result;\r\n if (prodAttributes && prodAttributes.length) {\r\n const filterAttributes = prodAttributes.filter(\r\n attribute => attribute.Name && attribute.Name.toUpperCase() === this._productFreightAttribute\r\n );\r\n if (filterAttributes && filterAttributes.length) {\r\n if (!filterAttributes[0].BooleanValue) {\r\n this._showAvailablityText = true;\r\n }\r\n return filterAttributes[0].BooleanValue || false;\r\n } else {\r\n this._showAvailablityText = false;\r\n return false;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n private _handleChange = (ref: React.RefObject) => (event: React.ChangeEvent) => {\r\n this.setState({ errorMessage: '' });\r\n }\r\n\r\n private _handleSearch = async (e: React.MouseEvent | React.KeyboardEvent | React.FormEvent): Promise => {\r\n e.preventDefault();\r\n const postalCodeInput = this._PostalCodeInputRef && this._PostalCodeInputRef.current ? this._PostalCodeInputRef.current.value : '';\r\n if (postalCodeInput.length > 4) {\r\n this.setState({ errorMessage: this.props.config.postalCodeInputErrorMessage1! });\r\n } else if (!this._isValidPostalCode(postalCodeInput)) {\r\n this.setState({ errorMessage: this.props.config.postalCodeInputErrorMessage2! });\r\n } else {\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges(postalCodeInput);\r\n if (response.Result === 'false') {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n } else if (response && response.Result) {\r\n this.setState({ errorMessage: '', freightResponse: response, postalCode: postalCodeInput, isError: false });\r\n } else if (response && !response.Result) {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n }\r\n }\r\n }\r\n\r\n private _getNewFreightCharges = async (postalCode?: string): Promise => {\r\n const response: IDXC_GetFreightChargesServiceResponse = await this._getItemFreightCharges(postalCode);\r\n if (response.Result === 'false') {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n } else if (response && response.Result) {\r\n this.setState({ errorMessage: '', freightResponse: response, isError: false });\r\n } else if (response && !response.Result) {\r\n this.setState({ errorMessage: response.Message!, isError: true });\r\n }\r\n }\r\n\r\n private _getItemFreightCharges(postalCode?: string): Promise {\r\n const itemId = this.props && this.props.data && this.props.data.product && this.props.data.product.result ? this.props.data.product.result.ItemId : '';\r\n const response: IGetFreightChargesServiceResponse = { ChargesAmount: 0 };\r\n const itemLine: IDXC_ItemLine = { ItemId: itemId, Quantity: this.props.data.currentQuantity.result };\r\n const ctx: IContext = { callerContext: this.props.context.actionContext };\r\n\r\n if (!postalCode) {\r\n const bingAppKey = this.props && this.props.config && this.props.config.bingApiAppKey ? this.props.config.bingApiAppKey : '';\r\n const bingApiEndpoint = this.props && this.props.config && this.props.config.bingApiEndPoint || '';\r\n const searchInput: BingMapsLocationsInput = new BingMapsLocationsInput(this.state.latitude, this.state.longitude, bingAppKey, bingApiEndpoint);\r\n geoLocation(searchInput, this.props.context.actionContext).then(\r\n (result) => {\r\n if (result) {\r\n postalCode = result.postalCode;\r\n this.setState({ postalCode: postalCode });\r\n dXC_GetFreightChargesForPDPAsync(ctx, postalCode!, itemLine).then(\r\n (responseObj) => {\r\n if (responseObj) {\r\n if (responseObj.Result === 'false') {\r\n this.setState({ errorMessage: responseObj.Message!, isError: true });\r\n } else {\r\n this.setState({ errorMessage: '', freightResponse: responseObj, isError: false });\r\n }\r\n } else {\r\n this.setState({ isError: true });\r\n }\r\n }\r\n );\r\n } else {\r\n postalCode = '';\r\n return;\r\n }\r\n });\r\n } else {\r\n this.setState({ postalCode: postalCode });\r\n return dXC_GetFreightChargesForPDPAsync(ctx, postalCode, itemLine);\r\n }\r\n return Promise.resolve(response);\r\n }\r\n\r\n private _closeModal(): void {\r\n this.setState(prevState => ({\r\n isOpen: !prevState.isOpen\r\n }));\r\n }\r\n private _openModal(): void {\r\n this.setState(prevState => ({\r\n isOpen: !prevState.isOpen\r\n }));\r\n }\r\n\r\n private _isValidPostalCode = (postalCode: string): boolean => {\r\n const regex = /^[0-9]+[0-9]*$/;\r\n return regex.test(postalCode);\r\n }\r\n\r\n private _getFormattedPrice(freightAmount: number): React.ReactNode {\r\n const formattedPrice = this.props.context.cultureFormatter.formatCurrency(freightAmount);\r\n return (\r\n {formattedPrice}\r\n );\r\n }\r\n\r\n private _renderProductFreightAmount(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n if (responseObj) {\r\n return (\r\n
\r\n {this._getFormattedPrice(responseObj.ChargesAmount)} {this.props.resources.freight_estimatedShippingText}\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private _renderProductFreightMessage(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const resources = this.props.resources;\r\n const postalCode = this.state.postalCode || '';\r\n const freightBasedOnCityName = responseObj && postalCode ? `${resources.freight_basedOnText}: ${postalCode}` : '';\r\n return (\r\n
{freightBasedOnCityName}
\r\n );\r\n }\r\n\r\n private _renderProductFreightUpdate(): React.ReactNode {\r\n const resources = this.props.resources;\r\n return (\r\n
\r\n \r\n {resources.freight_updateLocationLinkText}\r\n \r\n
\r\n );\r\n }\r\n\r\n private _renderProductFreightCalculate(): React.ReactNode {\r\n const resources = this.props.resources;\r\n return (\r\n
\r\n \r\n {resources.freight_updateLocationLinkAltText}\r\n \r\n
\r\n );\r\n }\r\n private _renderProductNoFreight(): React.ReactNode | null {\r\n const { config, resources } = this.props;\r\n const showAvailablityTextConfig = config.freightCheck ? config.freightCheck : false;\r\n // Show availability based in freight attribute as configured in appsetting and module configuration\r\n if (showAvailablityTextConfig && this._showAvailablityText) {\r\n const availableForLabelText = resources.freight_availableForLabel ? resources.freight_availableForLabel : 'Available for';\r\n const availableForValue = config.availableFor ? config.availableFor : 'Click & Collect';\r\n return (\r\n
\r\n {availableForLabelText}\r\n {availableForValue}\r\n
\r\n );\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private _renderProductFreightModal(): React.ReactNode {\r\n const responseObj: IGetFreightChargesServiceResponse | undefined = this.state.freightResponse;\r\n const { config, resources } = this.props;\r\n return (\r\n \r\n {config.modalHeader}\r\n \r\n
\r\n
\r\n \r\n

{config.postalCodeInputLabel}

\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n {this.state.errorMessage ?
\r\n {this.state && this.state.errorMessage ?\r\n \r\n {this.state.errorMessage}\r\n : null\r\n }\r\n
: null}\r\n {responseObj ?\r\n
\r\n
\r\n
\r\n

{resources.freight_postCode}

\r\n

{this.state.postalCode ? this.state.postalCode : ''}

\r\n
\r\n
\r\n

{resources.freight_delivery}

\r\n

{responseObj ? this._getFormattedPrice(responseObj.ChargesAmount) : null}

\r\n
\r\n
\r\n
\r\n

{config.deliveryInfoBottom1}

\r\n

{config.deliveryInfoBottom2}

\r\n

{config.deliveryInfoBottom3}

\r\n
\r\n
: null}\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n\r\n}\r\n\r\nexport default CittaFreightCharges;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport React, { ReactNode } from 'react';\n\nimport { IInteractiveFeatureCollectionViewProps } from './interactive-feature-collection';\n\n/**\n * Feature Collection View.\n * @param props - Feature Collection view props.\n * @returns Feature Collection View.\n */\nexport const interactiveFeatureCollectionView: React.FC = props => {\n const {\n title,\n interactiveFeatureCollectionHeading,\n interactiveFeatureCollectionContainer,\n interactiveFeatureCollectionDesktopContainer,\n interactiveFeatureCollectionDesktopItems,\n interactiveFeatureCollectionMobileItems,\n interactiveFeatureCollectionMobileContainer,\n singleSlideCarouselComponentProps,\n singleSlideCarouselItemContainer\n } = props;\n return (\n \n {title}\n {interactiveFeatureCollectionDesktopItems}\n \n \n {interactiveFeatureCollectionMobileItems &&\n interactiveFeatureCollectionMobileItems.map((tileItem: ReactNode, index: number) => {\n const keyIndex = `interactive-feature-carousel-item__${index}`;\n return (\n \n {tileItem}\n \n );\n })}\n \n \n \n );\n};\n\nexport default interactiveFeatureCollectionView;\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ICittaFreightChargesViewProps } from './citta-freight-charges';\r\n\r\nconst CittaFreightChargesView: React.FC = props => {\r\n const { ProductFreightContainer, productFreightAmount, productFreightMessage, productFreightCalculate, productFreightUpdate,\r\n productFreightModel, productNoFreight, freightAttribute, ProductFreightAttribute, ProductFreightAttributeModal, ProductNoFreightAttribute, freightResponseCheck } = props;\r\n if (freightAttribute) {\r\n return (\r\n \r\n {freightResponseCheck ?\r\n \r\n {productFreightAmount}\r\n {productFreightMessage}\r\n {productFreightUpdate}\r\n :\r\n \r\n {productFreightCalculate}\r\n }\r\n \r\n {productFreightModel}\r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n {productNoFreight}\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default CittaFreightChargesView;\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 { Module } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport * as React from 'react';\r\nimport { ICittaJournalPostsViewProps } from './citta-journal-posts';\r\n\r\nexport default (props: ICittaJournalPostsViewProps) => {\r\n\r\n return (\r\n \r\n {props.categories}\r\n {props.search}\r\n \r\n
\r\n {props.journals}\r\n
\r\n {props.loadMore}\r\n
\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\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport { IVideoPlayerViewProps } from '@msdyn365-commerce-modules/video-player/src/modules/video-player/video-player';\r\n// import { IPlayerResources } from '@msdyn365-commerce/components/dist/types/videoplayer/components/data/player-resources';\r\nimport { Image } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport { IVideoPlayerProps } from '../definition-extensions/video-player.ext.props.autogenerated';\r\n\r\ninterface IVideoPlayerState {\r\n isMobile: boolean;\r\n }\r\n\r\n/**\r\n *\r\n * VideoPlayer component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class VideoPlayerView extends React.PureComponent, IVideoPlayerState> {\r\n constructor(props: IVideoPlayerViewProps) {\r\n //@ts-ignore\r\n super(props);\r\n this.state = {isMobile: false};\r\n }\r\n\r\n public componentDidMount(): void {\r\n this._updateIsMobile();\r\n window.addEventListener('resize', this._updateIsMobile);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window.removeEventListener('resize', this._updateIsMobile);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n return (\r\n \r\n
\r\n {this.state.isMobile ? this._renderMobile() : this._renderDesktop()}\r\n {this._renderVideoPlayerOverlay()}\r\n
\r\n \r\n );\r\n }\r\n\r\n private _renderDesktop = (): React.ReactNode | null => {\r\n const playerResources: any = {\r\n playAriaLabel: this.props.config.playLabel ? this.props.config.playLabel : '',\r\n pauseAriaLabel: this.props.config.pauseLabel ? this.props.config.pauseLabel : '',\r\n muteAriaLabel: this.props.config.muteLabel ? this.props.config.muteLabel : '',\r\n unMuteAriaLabel: this.props.config.unMuteLabel ? this.props.config.unMuteLabel: '',\r\n fullScreenAriaLabel: this.props.config.fullScreenLabel ? this.props.config.fullScreenLabel : '',\r\n exitFullScreenAriaLabel: this.props.config.exitFullScreenLabel ? this.props.config.exitFullScreenLabel : '',\r\n playingAriaLabel: this.props.config.playingLabel ? this.props.config.playingLabel : '',\r\n pausedAriaLabel: this.props.config.pausedLabel ? this.props.config.pausedLabel : '',\r\n ...this.props.resources\r\n };\r\n if (this.props.player) {\r\n return React.cloneElement(this.props.player as React.ReactElement, {playerResources});\r\n }\r\n return null;\r\n };\r\n\r\n private _renderMobile = (): React.ReactNode | null => {\r\n const imageSettingsDefault = {\r\n disableLazyLoad: true,\r\n viewports: {\r\n xs: { q: `q=80&w=770&h=500&m=6`, w: 770, h: 500 }\r\n }\r\n };\r\n const image = this.props.config.mobileImage;\r\n\r\n if (image) {\r\n return (\r\n
\r\n {image && }\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private _renderVideoPlayerOverlay = (): React.ReactNode | null => {\r\n const { buttonText, buttonLink, headerText, horizontalPosition } = this.props.config;\r\n if (buttonText || headerText) {\r\n return (\r\n
\r\n { headerText &&
{headerText}
}\r\n { buttonText && {buttonText}\r\n }\r\n
\r\n );\r\n }\r\n return null;\r\n };\r\n\r\n private _updateIsMobile = () => {\r\n this.setState({\r\n isMobile: window.innerWidth < 768\r\n });\r\n }\r\n}\r\n\r\nexport default VideoPlayerView;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n getTelemetryObject,\n IComponentNodeProps,\n IModuleProps,\n INodeProps,\n ISingleSlideCarouselProps,\n ITelemetryContent,\n NodeTag,\n SingleSlideCarousel\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\nimport { IInteractiveFeatureCollectionProps } from './interactive-feature-collection.props.autogenerated';\n\n/**\n * Interactive Feature Collection view props.\n */\nexport interface IInteractiveFeatureCollectionViewProps extends IInteractiveFeatureCollectionProps<{}> {\n title: React.ReactNode;\n interactiveFeatureCollectionHeading: INodeProps;\n interactiveFeatureCollectionContainer: IModuleProps;\n interactiveFeatureCollectionDesktopContainer: INodeProps;\n interactiveFeatureCollectionDesktopItems: React.ReactNode[];\n interactiveFeatureCollectionMobileContainer: INodeProps;\n interactiveFeatureCollectionMobileItems: React.ReactNode[];\n singleSlideCarouselComponentProps: INodeProps;\n singleSlideCarouselItemContainer: INodeProps;\n}\n\n/**\n *\n * InteractiveFeatureCollection component.\n * @extends {React.PureComponent>}\n */\nexport class InteractiveFeatureCollection extends React.PureComponent> {\n private readonly _telemetryContent: ITelemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n private static _getFeatureItem(item: React.ReactNode, index: number, itemsCounter: number): React.ReactNode {\n const keyIndex = `interactive-feature-mosaic-item__${index}`;\n return (\n \n {React.cloneElement(item as React.ReactElement, { indexItem: index, itemCounter: itemsCounter, isMosaic: true })}\n \n );\n }\n\n public constructor(props: IInteractiveFeatureCollectionProps) {\n super(props);\n }\n\n public render(): JSX.Element | null {\n const { resources } = this.props;\n const { title, className } = this.props.config;\n const interactiveItems = this.props.slots && this.props.slots.interactiveFeatureItems;\n const itemsFeatureCounter = interactiveItems && interactiveItems.length;\n const singleSlideCarouselComponentProps: IComponentNodeProps = {\n tag: SingleSlideCarousel,\n className: this.props.config.className ?? '',\n flipperPrevLabel: resources.flipperPrevious,\n flipperNextLabel: resources.flipperNext,\n parentId: this.props.id,\n telemetryContent: this._telemetryContent,\n vertical: false\n };\n const initItemsFeatureCounter = 0;\n const createHeading = title && (\n \n );\n const viewProps = {\n ...this.props,\n title: createHeading,\n interactiveFeatureCollectionHeading: {\n className: 'ms-interactive-feature-collection__heading'\n },\n interactiveFeatureCollectionContainer: {\n moduleProps: this.props,\n className: classnames('ms-interactive-feature-collection', className)\n },\n interactiveFeatureCollectionDesktopContainer: {\n tag: 'div' as NodeTag,\n className: 'ms-interactive-feature-collection-desktop'\n },\n interactiveFeatureCollectionMobileContainer: {\n tag: 'div' as NodeTag,\n className: 'ms-interactive-feature-collection-mobile'\n },\n singleSlideCarouselComponentProps,\n singleSlideCarouselItemContainer: {\n tag: 'li' as NodeTag,\n className: 'ms-interactive-feature-collection-carousel',\n role: 'listitem'\n },\n interactiveFeatureCollectionMobileItems: this.props.slots.interactiveFeatureItems,\n interactiveFeatureCollectionDesktopItems:\n itemsFeatureCounter > initItemsFeatureCounter &&\n interactiveItems.map((item: React.ReactNode, index: number) =>\n InteractiveFeatureCollection._getFeatureItem(item, index, itemsFeatureCounter)\n )\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * To handle text change.\n * @param event - To handle text change event.\n * @name - HandleTextChange\n * @public\n * @returns - The Text value.\n */\n public handleTextChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.title!.text = event.target.value);\n}\n\nexport default InteractiveFeatureCollection;\n"],"sourceRoot":""}