{"version":3,"sources":["webpack:///src/modules/store-selector/store-selector.view.tsx?b873","webpack:///src/modules/store-selector/components/pickup-option-list.tsx?9a9c","webpack:///src/modules/store-selector/components/store-selector-location-line-item/date-time-helpers.ts?89f3","webpack:///src/modules/store-selector/components/store-selector-location-line-item/store-selector-location-line-item.components.tsx?5a50","webpack:///src/modules/store-selector/components/store-selector-location-lines.tsx?0668","webpack:///src/modules/store-selector/components/store-selector-search-form.tsx?1a99","webpack:///src/modules/store-selector/components/store-selector-small-components.tsx?c26d","webpack:///src/modules/store-selector/store-selector.tsx?ce13"],"names":["props","BodyContainerProps","FooterContainerProps","HeaderContainerProps","HeaderProps","ModuleProps","locationsMessage","search","state","spinner","locationsList","noLocationsMessage","terms","isSearchInProgress","super","_onSelect","async","e","preventDefault","deliveryCode","currentTarget","getAttribute","length","this","onChange","_rendeDeliveryOptions","bind","_pickupListOptionMenu","expandSiteOptions","pickupListOptionMenuText","pickupmodeList","className","onClick","role","ref","map","delivery","key","Code","tabIndex","Description","expandSiteOptionsState","setState","secondsToTime","seconds","undefined","hours","Math","floor","ampm","divisorForMinutes","getShortTimeString","day","resources","days","monday","tuesday","wednesday","thursday","friday","saturday","sunday","getFullTimeString","mondayFull","tuesdayFull","wednesdayFull","thursdayFull","fridayFull","saturdayFull","sundayFull","buildHoursDisplayInfo","startDay","endDay","hoursInfo","startDayShort","startDayFull","endDayShort","endDayFull","timeRange","shouldMergeLines","firstLine","secondLine","isClosed","openTime","closeTime","getStoreHoursData","storeHours","dateForLookup","buildStoreHoursString","closedText","StoreSelectorLocationLineItemComponentActions","deliveryMode","handlers","onSelected","location","onSetAsPreferredStore","OrgUnitNumber","onRemovePreferredStore","renderStoreHours","RegularStoreHours","storeHoursList","mondayHours","tuesdayHours","wednesdayHours","thursdayHours","fridayHours","saturdayHours","sundayHours","periodStart","periodEnd","push","buildStoreHours","displayTime","title","storeOpenFrom","OpenFrom","storeOpenTo","OpenTo","matchDeliveryOptions","productdeliveryOptions","storePickUpOptionList","deliveryOption","pickup","find","_delivery","StoreSelectorLocationLineItemComponent","hideStockStatus","isCurrentLocation","isInStock","stockStatusLabel","storeLocatorView","index","preferredStoreLocationId","isPreferredStoreEnabled","isLocationDisabled","telemetryContent","productPickUpOptionList","storeName","OrgUnitName","distanceAsString","distance","preferredDistanceUnit","buildDistanceString","Distance","storeAddress","Address","phoneNumber","contacts","allPhoneContacts","filter","contact","ContactTypeValue","IsPrivate","primaryPhoneContact","IsPrimary","Locator","extractPhoneNumber","Contacts","resourceLabel","inStock","outOfStock","stockLabel","stockText","canSelectLocation","pickupInStoreButtonText","selectLocation","pickupInStoreAriaLabel","selectLocationAriaLabelFormat","replace","isPreferredStore","payLoad","PickupInStore","attributes","contentAction","etext","PreferredStore","preferredStoreAttr","RemovePreferredStore","RemovePreferredStoreAttr","deliveryOptionList","contactInfoHeader","storeHoursHeader","availabilityInfoHeader","currentLocation","onLocationSelected","preferredStoreAriaLabel","preferredStoreText","setAsPreferredStoreTextAriaLabel","setAsPreferredStoreText","_scrollIntoView","selectedLocationDiv","selectedLocationRef","current","parent","parentElement","scrollTop","offsetTop","clientHeight","_isCurrentLocation","alreadySelectedLocation","_isProductInStock","ItemAvailabilities","enableOutOfStockCheck","AvailableQuantity","_stockInventoryLabel","availabilityWithHours","ProductInventoryInformation","i","OrgUnitAvailability","OrgUnitLocation","InventoryLocationId","InventLocationId","StockLevelLabel","_mapResources","contactText","timeText","availabilityText","storeHoursClosedText","outOfStockText","inStockText","selectedStoreLocationText","selectStoreText","selectStoreAriaFormatText","storeHoursMondayText","storeHoursTuesdayText","storeHoursWednesdayText","storeHoursThursdayText","storeHoursFridayText","storeHoursSaturdayText","storeHoursSundayText","storeHoursMondayFullText","storeHoursTuesdayFullText","storeHoursWednesdayFullText","storeHoursThursdayFullText","storeHoursFridayFullText","storeHoursSaturdayFullText","storeHoursSundayFullText","storeCounter","prevProps","selectedStoreLocationId","locations","_stores","_sortStores","show","displayList","store","_renderStoreLocation","orgUnitLocation","deliveryOptions","OrgUnitPickUpDeliveryModes","selected","StoreHours","toString","DeliveryOptions","productPickUpDeliveryOptions","stores","value","searchBoxRef","_handleKeyPressPrev","event","keyCode","onShowAllStores","_searchTextChanged","inputValue","target","searchTermChanged","_onSubmit","blur","performSearch","SearchStore","storeSearchAttributes","ShowAllStore","showAllStoreAttributes","ToggleMapView","toggleMapViewAttributes","searchButtonAriaLabel","searchPlaceholderText","seeAllStoresText","viewListText","viewMapText","id","isMapDisabled","showAllStores","locatorView","onToggleListMapViewState","toggleButtonText","name","autoComplete","onSubmit","type","searchInputAriaLabel","placeholder","color","onKeyUp","StoreSelectorEmptyMessage","emptyLocationsText","StoreSelectorWaiting","StoreSelectorTermsOfService","link","requestContext","onTextChange","editableLink","ariaLabel","linkText","linkUrl","destinationUrl","openInNewTab","editProps","StoreSelectorFoundLocationsMessage","searchRadius","isSeeAllStore","storeCountMessage","milesShortText","storeCountMessageInKm","storeAllCountMessage","handleLinkTextChange","config","termsOfServiceLink","handleHeadingChange","heading","_attachMapAutoSuggest","autoSuggestOptions","context","telemetry","actionContext","channel","data","storeSelectorStateManager","result","isMapApiLoaded","autoSuggestManager","Microsoft","Maps","loadModule","callback","options","countryCode","ChannelCountryRegionISOCode","AutosuggestManager","attachAutosuggest","_onSuggestionSelected","errorCallback","debug","credentials","BingMapsApiKey","_searchTermChanged","formattedSuggestion","_performSearch","_setPreferredStore","storeId","cookies","mode","storeLocations","availabilitiesWithHours","preferedStore","setPreferredStoreLocation","isConsentGiven","Latitude","Longitude","_removePreferredStore","clearPreferredStore","_setSelectedStore","setSelectedStoreLocationId","searchTerm","isSeeAllStoreValue","geoLocate","trim","_updateLocations","latitude","longitude","_getAndUpdateStoreLocation","style","isDialogOpen","navigator","geolocation","getCurrentPosition","position","coords","error","PERMISSION_DENIED","timeout","_closeDialog","closeDialog","_setOrgUnitStoreInformation","styleDefault","setOrgUnitStoreInformation","showMapViewLink","isDialog","orgUnitStoreInformation","Promise","resolve","catch","message","radius","lookupRadius","calRadius","distanceUnitValue","searchRadiusUnit","modeDefault","preferredStore","lat","long","lastInlineStoreLocation","lastInlineShownStoreInfo","setLastInlineStoreInfo","orgUnitLocationsInput","orgUnitLocations","product","input","RecordId","warning","_onOrgUnitLocationSelected","request","telemetryPageName","friendlyName","autoSuggestionEnabled","setTimeout","BingMapsEnabled","loadMapApi","lang","market","DefaultLanguageId","then","isSameContext","nextProps","setAsPreferredStore","app","appConfig","inlineView","hideInventory","listMapViewState","showLocationView","isMapModuleLoaded","StoreSelectorActions","toggleListMapViewState","configHeading","storeLocatorHeaderText","storeSelectorHeaderText","kilometersShortText","viewProps","tag","moduleProps","autoFocus","fade","isOpen","onClosed","horizontalPosition","verticalPosition","toggle","text","onEdit","outOfStockThreshold","enableStockCheck","StoreId","headerText","callbacks","selectedLocation","getAndUpdateUserLocation","attachMapAutoSuggest","onSuggestionSelected","setPreferredStore","removePreferredStore","setSelectedStore","renderView"],"mappings":"qJA8Ce,UApC8CA,IACzD,MAAM,mBACFC,EADE,qBAEFC,EAFE,qBAGFC,EAHE,YAIFC,EAJE,YAKFC,EALE,iBAQFC,EARE,OASFC,EATE,MAUFC,EAVE,QAWFC,EAXE,cAYFC,EAZE,mBAaFC,EAbE,MAcFC,GAAUZ,EAEd,OACI,gBAAC,SAAM,iBAAKK,GACR,gBAAC,OAAI,iBAAKF,GACLC,GAEL,gBAAC,OAAI,iBAAKH,GACLK,EACAC,EACAC,EAAMK,mBAAqBJ,EAAU,gCACjCC,GAAgCC,IAGzC,gBAAC,OAAI,iBAAKT,GACLU,M,gOCnBV,MAAM,UAAyB,gBAGlC,YAAYZ,GACRc,MAAMd,GA6CO,KAAAe,UAAYC,UACzBC,EAAEC,iBACF,MAAMC,EAAeF,EAAEG,cAAcC,aAAa,cAC9CF,GAAgBA,EAAaG,OAAS,SAChCC,KAAKvB,MAAMwB,SAASL,IAhD9BI,KAAKE,sBAAwBF,KAAKE,sBAAsBC,KAAKH,MAC7DA,KAAKI,sBAAwB,cAC7B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lO,wBAAyBA,EACzB+G,YAAaA,EACb7G,iBAAkBhH,KAAKgH,iBACvBD,mBAAoB/G,KAAKf,MAAM8H,mBAC/BwH,6BAA8ByE,aAAF,YAAEA,EAA2BL,eAA7B,uBAAE,EAAoC1E,uBAAtC,aAAE,EAAqDK,kBAG3FlP,mBAAoB,gBAAC2R,EAAyB,CAACjP,UAAWA,IAC1DzC,MAAO,gBAAC6R,EAA2B,CAACC,KAAMmB,EAAoBjB,aAAcrR,KAAKoS,qBAAsBhB,eAAgBpR,KAAKvB,MAAMkU,QAAQ0F,UAG1I0C,WAAY,4BACPvI,IAAqBpC,EAActO,EAAU+X,uBAAyB/X,EAAUgY,0BAGrFkB,UAAW,CACP9L,kBAAmBlP,KAAKkU,mBACxB7E,cAAerP,KAAKoU,eACpBmC,YAAavW,KAAKsW,aAClB2E,iBAAkBjb,KAAKoY,2BACvB8C,yBAA0B,KACtBlb,KAAK2V,6BAAqCmB,QAAQC,WAEtDoE,qBAAsBnb,KAAKyS,sBAC3B2I,qBAAsBpb,KAAKoY,2BAC3BiD,kBAAmBrb,KAAKqU,mBACxBiH,qBAAsBtb,KAAKgV,sBAC3BuG,iBAAkBvb,KAAKkV,kBACvBwB,2BAA4B1W,KAAKwW,+BAIzC,OAAOxW,KAAKvB,MAAM+c,WAAWxB,KA7R/B,EAAa,sBADlB,YACK,GA2oBS","file":"static/js/15.7a8f0c14808ff47b.chunk.js","sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IStoreSelectorViewProps } from './store-selector';\n\nconst StoreSelectorView: React.FC = props => {\n const {\n BodyContainerProps,\n FooterContainerProps,\n HeaderContainerProps,\n HeaderProps,\n ModuleProps,\n\n // HeaderText,\n locationsMessage,\n search,\n state,\n spinner,\n locationsList,\n noLocationsMessage,\n terms } = props;\n\n return (\n \n \n {HeaderProps}\n \n \n {locationsMessage}\n {search}\n {state.isSearchInProgress ? spinner : <>\n {locationsList ? locationsList : noLocationsMessage}\n }\n \n \n {terms}\n \n \n );\n};\n\nexport default StoreSelectorView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { DeliveryOption } from '@msdyn365-commerce/retail-proxy';\nimport * as React from 'react';\n\nexport interface IPickUpOptionListProps {\n pickupListOptionMenuText: string;\n pickupmodeList?: DeliveryOption[];\n onChange(deliveryCode: string): Promise;\n}\n\nexport interface IPickOptionListState {\n expandSiteOptions: boolean;\n}\n\n/**\n * Simple Pickup option dropdown with Button to get menu option.\n */\nexport class PickUpOptionList extends React.PureComponent {\n private readonly _pickupListOptionMenu: React.RefObject;\n\n constructor(props: IPickUpOptionListProps) {\n super(props);\n this._rendeDeliveryOptions = this._rendeDeliveryOptions.bind(this);\n this._pickupListOptionMenu = React.createRef();\n this.state = {\n expandSiteOptions: false\n };\n }\n\n public render(): JSX.Element {\n const {\n pickupListOptionMenuText,\n pickupmodeList\n } = this.props;\n\n return (\n
\n \n {this.state.expandSiteOptions ?
    \n { pickupmodeList?.map((delivery: DeliveryOption) => {\n return (
  • \n \n \n {delivery.Description}\n \n \n
  • );\n })}\n
: null}\n
\n );\n }\n\n private _rendeDeliveryOptions(): void {\n const expandSiteOptionsState = this.state.expandSiteOptions;\n this.setState({\n expandSiteOptions: !expandSiteOptionsState\n });\n }\n\n private readonly _onSelect = async (e: React.MouseEvent): Promise => {\n e.preventDefault();\n const deliveryCode = e.currentTarget.getAttribute('data-value');\n if (deliveryCode && deliveryCode.length > 0) {\n await this.props.onChange(deliveryCode);\n }\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { RegularStoreHours } from '@msdyn365-commerce/retail-proxy';\nimport get from 'lodash/get';\n\nimport { IStoreSelectorLocationLineItemResources } from '.';\n\nexport interface IHoursDisplayInfo {\n startDayShort: string;\n startDayFull: string;\n endDayShort?: string;\n endDayFull?: string;\n timeRange: string;\n}\n\ninterface IHoursInfo {\n isClosed: boolean;\n openTime?: number;\n closeTime?: number;\n}\n\ntype DayType = 'MON' | 'TUE' | 'WED' | 'THU' | 'FRI' | 'SAT' | 'SUN';\n\nexport const secondsToTime = (seconds: number | undefined): string | undefined => {\n if (seconds === undefined) {\n return undefined;\n }\n let hours = Math.floor(seconds / (60 * 60));\n const ampm = hours >= 12 ? 'pm' : 'am';\n hours %= 12;\n hours = hours ? hours : 12;\n const divisorForMinutes = seconds % (60 * 60);\n const minutes =\n Math.floor(divisorForMinutes / 60) < 10 ? `0${Math.floor(divisorForMinutes / 60)}` : Math.floor(divisorForMinutes / 60);\n return `${hours}:${minutes} ${ampm}`;\n\n};\n\nconst getShortTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\n switch (day) {\n case 'MON':\n return resources.days.monday;\n case 'TUE':\n return resources.days.tuesday;\n case 'WED':\n return resources.days.wednesday;\n case 'THU':\n return resources.days.thursday;\n case 'FRI':\n return resources.days.friday;\n case 'SAT':\n return resources.days.saturday;\n default: // Case 'SUN':\n return resources.days.sunday;\n }\n};\n\nconst getFullTimeString = (day: DayType, resources: IStoreSelectorLocationLineItemResources): string => {\n switch (day) {\n case 'MON':\n return resources.days.mondayFull;\n case 'TUE':\n return resources.days.tuesdayFull;\n case 'WED':\n return resources.days.wednesdayFull;\n case 'THU':\n return resources.days.thursdayFull;\n case 'FRI':\n return resources.days.fridayFull;\n case 'SAT':\n return resources.days.saturdayFull;\n default: // Case 'SUN':\n return resources.days.sundayFull;\n }\n};\n\nconst buildHoursDisplayInfo = (startDay: DayType, endDay: DayType, hoursInfo: string, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo => {\n return {\n startDayShort: getShortTimeString(startDay, resources),\n startDayFull: getFullTimeString(startDay, resources),\n endDayShort: startDay !== endDay ? getShortTimeString(endDay, resources) : undefined,\n endDayFull: startDay !== endDay ? getFullTimeString(endDay, resources) : undefined,\n timeRange: hoursInfo\n };\n};\n\nconst shouldMergeLines = (firstLine: IHoursInfo, secondLine: IHoursInfo): boolean => {\n if (firstLine.isClosed && secondLine.isClosed) {\n return true;\n }\n\n if (!firstLine.isClosed && !secondLine.isClosed) {\n return firstLine.openTime === secondLine.openTime && firstLine.closeTime === secondLine.closeTime;\n }\n\n return false;\n};\n\nconst getStoreHoursData = (storeHours: RegularStoreHours, dateForLookup: string): IHoursInfo => {\n return {\n isClosed: get(storeHours, `IsClosedOn${dateForLookup}`, false),\n openTime: get(storeHours, `${dateForLookup}OpenTime`, undefined),\n closeTime: get(storeHours, `${dateForLookup}CloseTime`, undefined)\n };\n};\n\nconst buildStoreHoursString = (hoursInfo: IHoursInfo, resources: IStoreSelectorLocationLineItemResources): string => {\n if (hoursInfo.isClosed) {\n return resources.closedText;\n }\n const openFrom: string | undefined = secondsToTime(hoursInfo.openTime);\n const openTo: string | undefined = secondsToTime(hoursInfo.closeTime);\n\n return `${openFrom}–${openTo}`;\n\n};\n\nexport const buildStoreHours = (storeHours: RegularStoreHours, resources: IStoreSelectorLocationLineItemResources): IHoursDisplayInfo[] => {\n const storeHoursList: IHoursDisplayInfo[] = [];\n\n const mondayHours = getStoreHoursData(storeHours, 'Monday');\n const tuesdayHours = getStoreHoursData(storeHours, 'Tuesday');\n const wednesdayHours = getStoreHoursData(storeHours, 'Wednesday');\n const thursdayHours = getStoreHoursData(storeHours, 'Thursday');\n const fridayHours = getStoreHoursData(storeHours, 'Friday');\n const saturdayHours = getStoreHoursData(storeHours, 'Saturday');\n const sundayHours = getStoreHoursData(storeHours, 'Sunday');\n\n let periodStart: DayType = 'MON';\n let periodEnd: DayType = 'MON';\n\n if (!shouldMergeLines(mondayHours, tuesdayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(mondayHours, resources), resources));\n\n periodStart = 'TUE';\n }\n periodEnd = 'TUE';\n\n if (!shouldMergeLines(tuesdayHours, wednesdayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(tuesdayHours, resources), resources));\n\n periodStart = 'WED';\n }\n periodEnd = 'WED';\n\n if (!shouldMergeLines(wednesdayHours, thursdayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(wednesdayHours, resources), resources));\n\n periodStart = 'THU';\n }\n periodEnd = 'THU';\n\n if (!shouldMergeLines(thursdayHours, fridayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(thursdayHours, resources), resources));\n\n periodStart = 'FRI';\n }\n periodEnd = 'FRI';\n\n if (!shouldMergeLines(fridayHours, saturdayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(fridayHours, resources), resources));\n\n periodStart = 'SAT';\n }\n periodEnd = 'SAT';\n\n if (!shouldMergeLines(saturdayHours, sundayHours)) {\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(saturdayHours, resources), resources));\n\n periodStart = 'SUN';\n }\n periodEnd = 'SUN';\n\n storeHoursList.push(buildHoursDisplayInfo(periodStart, periodEnd, buildStoreHoursString(sundayHours, resources), resources));\n\n return storeHoursList;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n DeliveryOption,\n OrgUnitContact,\n OrgUnitLocation,\n StoreHours\n} from '@msdyn365-commerce/retail-proxy';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { PickUpOptionList } from '../pickup-option-list';\nimport { buildStoreHours, IHoursDisplayInfo, secondsToTime } from './date-time-helpers';\n\nexport interface IStoreSelectorLocationLineItemResources {\n contactInfoHeader: string;\n storeHoursHeader: string;\n availabilityInfoHeader: string;\n\n closedText: string;\n\n outOfStock: string;\n inStock: string;\n\n currentLocation: string;\n selectLocation: string;\n selectLocationAriaLabelFormat: string;\n setAsPreferredStoreText: string;\n setAsPreferredStoreTextAriaLabel: string;\n preferredStoreText: string;\n preferredStoreAriaLabel: string;\n\n days: {\n monday: string;\n tuesday: string;\n wednesday: string;\n thursday: string;\n friday: string;\n saturday: string;\n sunday: string;\n mondayFull: string;\n tuesdayFull: string;\n wednesdayFull: string;\n thursdayFull: string;\n fridayFull: string;\n saturdayFull: string;\n sundayFull: string;\n };\n}\n\nexport interface IStoreSelectorLocationLineItemProps {\n location: OrgUnitLocation;\n storeHours?: StoreHours;\n\n hideStockStatus?: boolean;\n isInStock?: boolean;\n isCurrentLocation?: boolean;\n\n resources: IStoreSelectorLocationLineItemResources;\n stockStatusLabel?: string;\n storeLocatorView?: boolean;\n isPreferredStoreEnabled?: boolean;\n index: string;\n preferredStoreLocationId: string | null;\n storePickUpOptionList?: DeliveryOption[];\n productPickUpOptionList?: DeliveryOption[];\n\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n preferredDistanceUnit: string;\n isLocationDisabled?: boolean;\n handlers: {\n onSelected(location: OrgUnitLocation, deliveryMode?: string): void;\n onSetAsPreferredStore(locationId: string | undefined): void;\n onRemovePreferredStore(): void;\n };\n}\n\nconst StoreSelectorLocationLineItemComponentActions = {\n onLocationSelected(props: IStoreSelectorLocationLineItemProps, deliveryMode?: string): void {\n props.handlers.onSelected(props.location, deliveryMode);\n },\n onSetAsPreferredStore(props: IStoreSelectorLocationLineItemProps): void {\n props.handlers.onSetAsPreferredStore(props.location.OrgUnitNumber);\n },\n onRemovePreferredStore(props: IStoreSelectorLocationLineItemProps): void {\n props.handlers.onRemovePreferredStore();\n }\n};\n\nconst renderStoreHours = (storeHours: StoreHours | undefined, location: OrgUnitLocation, resources: IStoreSelectorLocationLineItemResources): JSX.Element | null => {\n // First, use the store hours. This will allow listing day by day houts\n if (storeHours && storeHours.RegularStoreHours) {\n const storeHoursList: IHoursDisplayInfo[] = buildStoreHours(storeHours.RegularStoreHours, resources);\n\n return (\n
\n {storeHoursList.map(displayTime => (\n
\n {displayTime.endDayShort ? (\n
\n \n {displayTime.startDayShort}\n \n –\n \n {displayTime.endDayShort}\n \n
\n ) : (\n
\n \n {displayTime.startDayShort}\n \n
\n )}\n
\n {displayTime.timeRange}\n
\n
\n ))}\n
\n );\n }\n\n // If that fails, fall back to using the OpenFrom and OpenTo properties on the location\n const storeOpenFrom: string | undefined = secondsToTime(location.OpenFrom);\n const storeOpenTo: string | undefined = secondsToTime(location.OpenTo);\n\n return (\n
\n {storeOpenFrom}\n -\n {storeOpenTo}\n
\n );\n\n};\n\nconst buildDistanceString = (distance: number | undefined, preferredDistanceUnit: string, isLocationDisabled?: boolean): string | undefined => {\n if (distance === undefined || isLocationDisabled) {\n return undefined;\n } else if (distance < 1) {\n return `(<1 ${preferredDistanceUnit})`;\n }\n return `(${Math.floor(distance)} ${preferredDistanceUnit})`;\n\n};\n\nconst extractPhoneNumber = (contacts: OrgUnitContact[] | undefined): string | undefined => {\n if (!contacts) {\n return undefined;\n }\n\n const allPhoneContacts = contacts.filter(contact => contact.ContactTypeValue === 1 && !contact.IsPrivate);\n\n if (allPhoneContacts && allPhoneContacts.length > 0) {\n const primaryPhoneContact = allPhoneContacts.find(contact => contact.IsPrimary);\n\n if (primaryPhoneContact) {\n return primaryPhoneContact.Locator;\n }\n\n return allPhoneContacts[0].Locator;\n }\n\n return undefined;\n};\n\nconst StoreSelectorLocationLineItem: React.FC = (props: IStoreSelectorLocationLineItemProps) => {\n const onClick = () => {\n StoreSelectorLocationLineItemComponentActions.onLocationSelected(props);\n };\n\n const onChange = async (deliveryCode: string): Promise => {\n StoreSelectorLocationLineItemComponentActions.onLocationSelected(props, deliveryCode);\n };\n\n const {\n hideStockStatus,\n isCurrentLocation,\n isInStock,\n location,\n resources,\n storeHours,\n stockStatusLabel,\n storeLocatorView,\n index,\n preferredStoreLocationId,\n isPreferredStoreEnabled,\n isLocationDisabled,\n telemetryContent,\n storePickUpOptionList,\n productPickUpOptionList\n } = props;\n\n const storeName: string | undefined = location.OrgUnitName;\n const distanceAsString: string | undefined = buildDistanceString(location.Distance, props.preferredDistanceUnit, isLocationDisabled);\n const storeAddress: string | undefined = location.Address;\n const phoneNumber: string | undefined = extractPhoneNumber(location.Contacts);\n\n const resourceLabel = isInStock ? resources.inStock : resources.outOfStock;\n const stockLabel = stockStatusLabel ? stockStatusLabel : undefined;\n const stockText: string | undefined = (hideStockStatus) ? undefined : (stockLabel ? stockLabel : resourceLabel);\n const canSelectLocation = hideStockStatus || isInStock;\n const pickupInStoreButtonText: string = resources.selectLocation;\n const pickupInStoreAriaLabel: string = resources.selectLocationAriaLabelFormat.replace('{StoreName}', storeName || '');\n const isPreferredStore = preferredStoreLocationId === location.OrgUnitNumber;\n const payLoad: IPayLoad = getPayloadObject('click', telemetryContent!, TelemetryConstant.PickupInStore);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.PreferredStore;\n const preferredStoreAttr = getTelemetryAttributes(telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.RemovePreferredStore;\n const RemovePreferredStoreAttr = getTelemetryAttributes(telemetryContent!, payLoad);\n const deliveryOptionList = matchDeliveryOptions(productPickUpOptionList, storePickUpOptionList);\n\n const setAsPreferredStore = () => {\n StoreSelectorLocationLineItemComponentActions.onSetAsPreferredStore(props);\n };\n const removePreferredStore = () => {\n StoreSelectorLocationLineItemComponentActions.onRemovePreferredStore(props);\n };\n\n return (\n
\n
\n {storeLocatorView && \n {index}\n }\n \n {storeName}\n \n {distanceAsString ? \n {' '}\n {distanceAsString}\n : false}\n
\n
\n
\n

\n {resources.contactInfoHeader}\n

\n {storeAddress && (\n
\n \n \n {storeAddress}\n \n
\n )}\n {phoneNumber && (\n
\n \n \n {phoneNumber}\n \n
\n )}\n
\n
\n

\n {resources.storeHoursHeader}\n

\n {renderStoreHours(storeHours, location, resources)}\n
\n {\n !storeLocatorView &&\n
\n

\n {resources.availabilityInfoHeader}\n

\n {stockText &&

\n {stockText}\n

}\n {isCurrentLocation ? (\n

\n {resources.currentLocation}\n

\n ) : (canSelectLocation ? deliveryOptionList.length === 0 ? (\n \n {pickupInStoreButtonText}\n \n ) : : (\n false\n ))}\n
\n }\n {\n isPreferredStoreEnabled ? (isPreferredStore ? \n {resources.preferredStoreText}\n : \n {resources.setAsPreferredStoreText}\n ) : null\n }\n
\n
\n );\n};\n\nconst matchDeliveryOptions = (productdeliveryOptions: DeliveryOption[] | undefined, storePickUpOptionList: DeliveryOption[] | undefined): DeliveryOption[] => {\n const deliveryOption: DeliveryOption[] = [];\n productdeliveryOptions?.map(delivery => {\n const pickup = (storePickUpOptionList?.find(_delivery => _delivery.Code === delivery.Code));\n if (pickup) {\n deliveryOption.push(pickup);\n }\n });\n\n return deliveryOption;\n};\n\nexport const StoreSelectorLocationLineItemComponent = StoreSelectorLocationLineItem as (props: IStoreSelectorLocationLineItemProps) => JSX.Element;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { DeliveryOption, ItemAvailability, OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observable } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IStoreSelectorResources } from '../store-selector.props.autogenerated';\nimport { IStoreSelectorLocationLineItemResources, StoreSelectorLocationLineItemComponent } from './store-selector-location-line-item';\n\nexport interface IStoreSelectorLocationLinesProps {\n locations?: IFullOrgUnitAvailability[];\n resources: IStoreSelectorResources;\n preferredDistanceUnit?: string;\n\n alreadySelectedLocation?: OrgUnitLocation;\n outOfStockThreshold: number;\n enableOutOfStockCheck: boolean;\n storeLocatorView?: boolean;\n selectedStoreLocationId?: string;\n isPreferredStoreEnabled?: boolean;\n displayList?: boolean;\n isLocationDisabled?: boolean;\n productPickUpDeliveryOptions?: DeliveryOption[];\n onClick: ((locationId: string | undefined) => void);\n preferredStoreLocationId: string | null;\n onSetAsPreferredStore: ((locationId: string | undefined) => void);\n onRemovePreferredStore: (() => void);\n\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n onLocationSelected(location: OrgUnitLocation | undefined): void;\n}\n\n/**\n * Displays all the location line items, or null if none exists.\n */\n@observer\nexport class StoreSelectorLocationLines extends React.PureComponent {\n private readonly selectedLocationRef: React.RefObject;\n\n @observable private _stores: IFullOrgUnitAvailability[] | undefined;\n\n private storeCounter: number;\n\n public constructor(props: IStoreSelectorLocationLinesProps) {\n super(props);\n this.selectedLocationRef = React.createRef();\n this.storeCounter = 0;\n }\n\n public componentDidUpdate(prevProps: IStoreSelectorLocationLinesProps): void {\n if (this.props.selectedStoreLocationId !== prevProps.selectedStoreLocationId) {\n this._scrollIntoView();\n }\n }\n\n public componentDidMount(): void {\n if (this.props.locations) {\n this._stores = this._sortStores(this.props.locations);\n }\n }\n\n public render(): JSX.Element | null {\n if (!this._stores || this._stores.length === 0) {\n return null;\n }\n\n this.storeCounter = 0;\n\n return (\n
\n {\n this._stores.map((store, index) => {\n return this._renderStoreLocation(store, index);\n })\n }\n
\n );\n }\n\n private _renderStoreLocation(store: IFullOrgUnitAvailability, index: number): JSX.Element | undefined {\n const orgUnitLocation = store?.OrgUnitAvailability?.OrgUnitLocation;\n const selectedStoreLocationId = this.props.selectedStoreLocationId;\n const deliveryOptions = store?.OrgUnitPickUpDeliveryModes;\n return orgUnitLocation && (\n {\n this.props.onClick(orgUnitLocation.OrgUnitNumber);\n }}\n ref={selectedStoreLocationId === orgUnitLocation.OrgUnitNumber ? this.selectedLocationRef : undefined}\n >\n \n \n );\n }\n\n private _sortStores(stores: IFullOrgUnitAvailability[]): IFullOrgUnitAvailability[] {\n const isPreferredStore = (value: IFullOrgUnitAvailability) => this.props.isPreferredStoreEnabled && this.props.preferredStoreLocationId &&\n value?.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === this.props.preferredStoreLocationId;\n\n return [\n ...stores.filter(isPreferredStore),\n ...stores.filter(store => !isPreferredStore(store))\n ];\n }\n\n private readonly _scrollIntoView = () => {\n const selectedLocationDiv = this.selectedLocationRef.current;\n const parent = selectedLocationDiv?.parentElement;\n if (selectedLocationDiv && parent) {\n if (parent.scrollTop > selectedLocationDiv.offsetTop) {\n parent.scrollTop = selectedLocationDiv.offsetTop;\n } else if (selectedLocationDiv.offsetTop + selectedLocationDiv.clientHeight > parent.scrollTop + parent.clientHeight) {\n parent.scrollTop = selectedLocationDiv.offsetTop + selectedLocationDiv.clientHeight - parent.clientHeight;\n }\n }\n };\n\n private readonly _isCurrentLocation = (location: OrgUnitLocation | undefined): boolean => (this.props.alreadySelectedLocation && location && this.props.alreadySelectedLocation.OrgUnitNumber === location.OrgUnitNumber) || false;\n\n private readonly _isProductInStock = (ItemAvailabilities: ItemAvailability[] | undefined): boolean => {\n if (!this.props.enableOutOfStockCheck) {\n return true;\n }\n\n if (ItemAvailabilities && ItemAvailabilities.length > 0) {\n return ItemAvailabilities[0].AvailableQuantity ? ItemAvailabilities[0].AvailableQuantity > 0 : false;\n }\n\n return false;\n };\n\n private readonly _stockInventoryLabel = (availabilityWithHours: IFullOrgUnitAvailability | undefined): string | undefined => {\n if (availabilityWithHours?.ProductInventoryInformation &&\n availabilityWithHours?.ProductInventoryInformation.length > 0) {\n for (let i = 0; i < availabilityWithHours.ProductInventoryInformation.length; i++) {\n if (availabilityWithHours.OrgUnitAvailability?.OrgUnitLocation?.InventoryLocationId === availabilityWithHours.ProductInventoryInformation[i].InventLocationId) {\n return availabilityWithHours.ProductInventoryInformation[i].StockLevelLabel;\n }\n\n }\n }\n\n return undefined;\n };\n\n private readonly _mapResources = (resources: IStoreSelectorResources): IStoreSelectorLocationLineItemResources => {\n return {\n contactInfoHeader: resources.contactText,\n storeHoursHeader: resources.timeText,\n availabilityInfoHeader: resources.availabilityText,\n\n closedText: resources.storeHoursClosedText,\n outOfStock: resources.outOfStockText,\n inStock: resources.inStockText,\n\n currentLocation: resources.selectedStoreLocationText,\n selectLocation: resources.selectStoreText,\n selectLocationAriaLabelFormat: resources.selectStoreAriaFormatText,\n setAsPreferredStoreText: resources.setAsPreferredStoreText,\n setAsPreferredStoreTextAriaLabel: resources.setAsPreferredStoreTextAriaLabel,\n preferredStoreText: resources.preferredStoreText,\n preferredStoreAriaLabel: resources.preferredStoreAriaLabel,\n\n days: {\n monday: resources.storeHoursMondayText,\n tuesday: resources.storeHoursTuesdayText,\n wednesday: resources.storeHoursWednesdayText,\n thursday: resources.storeHoursThursdayText,\n friday: resources.storeHoursFridayText,\n saturday: resources.storeHoursSaturdayText,\n sunday: resources.storeHoursSundayText,\n mondayFull: resources.storeHoursMondayFullText,\n tuesdayFull: resources.storeHoursTuesdayFullText,\n wednesdayFull: resources.storeHoursWednesdayFullText,\n thursdayFull: resources.storeHoursThursdayFullText,\n fridayFull: resources.storeHoursFridayFullText,\n saturdayFull: resources.storeHoursSaturdayFullText,\n sundayFull: resources.storeHoursSundayFullText\n }\n };\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { DeliveryOption } from '@msdyn365-commerce/retail-proxy';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent, KeyCodes, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IStoreSelectorSearchFormProps {\n resources: {\n searchInputAriaLabel: string;\n searchButtonAriaLabel: string;\n searchPlaceholderText: string;\n seeAllStoresText: string;\n viewListText: string;\n viewMapText: string;\n };\n\n id: string;\n value: string;\n isMapDisabled?: boolean;\n showAllStores?: boolean;\n displayList?: boolean;\n locatorView?: boolean;\n productPickUpDeliveryOptions?: DeliveryOption[];\n\n /** The telemetry content */\n telemetryContent?: ITelemetryContent;\n onShowAllStores(): void;\n onToggleListMapViewState(): void;\n performSearch(searchTerm: string): Promise;\n searchTermChanged(searchTerm: string): Promise;\n}\n\n/**\n * Simple search form consisting of search text and a search button.\n */\nexport class StoreSelectorSearchForm extends React.PureComponent {\n private readonly searchBoxRef: React.RefObject = React.createRef();\n\n private readonly storeSearchAttributes: Msdyn365.IDictionary | undefined;\n\n private readonly showAllStoreAttributes: Msdyn365.IDictionary | undefined;\n\n private readonly toggleMapViewAttributes: Msdyn365.IDictionary | undefined;\n\n constructor(props: IStoreSelectorSearchFormProps) {\n super(props);\n this.state = { value: '' };\n this._handleKeyPressPrev = this._handleKeyPressPrev.bind(this);\n const payLoad: IPayLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.SearchStore);\n this.storeSearchAttributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.ShowAllStore;\n this.showAllStoreAttributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n payLoad.contentAction.etext = TelemetryConstant.ToggleMapView;\n this.toggleMapViewAttributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n }\n\n public render(): JSX.Element {\n const {\n resources: { searchButtonAriaLabel, searchPlaceholderText, seeAllStoresText, viewListText, viewMapText },\n id,\n value,\n isMapDisabled,\n showAllStores,\n displayList,\n locatorView,\n onShowAllStores,\n onToggleListMapViewState\n } = this.props;\n\n const toggleButtonText = displayList ? viewMapText : viewListText;\n\n return (\n
\n \n
}\n {locatorView && }\n \n );\n }\n\n /**\n * Calls method display result.\n * @param { React.KeyboardEvent} event The first number.\n */\n private readonly _handleKeyPressPrev = (event: React.KeyboardEvent): void => {\n if (event.keyCode === KeyCodes.Enter || event.keyCode === KeyCodes.Space) {\n this.props.onShowAllStores();\n }\n };\n\n private readonly _searchTextChanged = async (e: React.ChangeEvent): Promise => {\n const inputValue: string = e.target.value;\n\n await this.props.searchTermChanged(inputValue);\n };\n\n private readonly _onSubmit = async (e: React.SyntheticEvent): Promise => {\n e.preventDefault(); // Prevents form submission\n this.searchBoxRef.current?.blur();\n await this.props.performSearch(this.props.value);\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IStoreSelectorResources, ITermsOfServiceLinkData } from '../store-selector.props.autogenerated';\n\nexport interface IStoreSelectorEmptyMessageProps {\n resources: IStoreSelectorResources;\n}\nexport const StoreSelectorEmptyMessage: React.FC = ({ resources }) => (\n
\n

\n {resources.emptyLocationsText}\n

\n
\n);\n\nexport const StoreSelectorWaiting: React.FC = () => (\n
\n);\n\nexport interface IStoreSelectorTermsOfServiceProps {\n link?: ITermsOfServiceLinkData;\n requestContext: Msdyn365.IRequestContext;\n onTextChange?(event: Msdyn365.ContentEditableEvent): void;\n}\n\nexport const StoreSelectorTermsOfService: React.FC = ({ link, requestContext, onTextChange }) => {\n if (link) {\n const editableLink: Msdyn365.ILinksData = {\n ariaLabel: link.ariaLabel,\n className: 'ms-store-select__terms-link',\n linkText: link.linkText,\n linkUrl: link.linkUrl.destinationUrl,\n openInNewTab: link.openInNewTab,\n role: 'link'\n };\n\n return (\n
\n \n
\n );\n\n }\n return null;\n};\n\nexport interface IStoreSelectorFoundLocationsMessage {\n resources: IStoreSelectorResources;\n locations?: IFullOrgUnitAvailability[];\n searchRadius: number;\n preferredDistanceUnit: string;\n isSeeAllStore: boolean;\n}\nexport const StoreSelectorFoundLocationsMessage: React.FC = ({ locations, searchRadius, resources, isSeeAllStore, preferredDistanceUnit }) => {\n if (locations) {\n const storeCountMessage = preferredDistanceUnit === resources.milesShortText ? resources.storeCountMessage : resources.storeCountMessageInKm;\n return (\n
\n { isSeeAllStore ? resources.storeAllCountMessage\n .replace('{count}', locations.length.toString()) : storeCountMessage\n .replace('{count}', locations.length.toString())\n .replace('{radius}', searchRadius.toString())}\n
\n );\n }\n\n return null;\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\n/// \n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { OrgUnitLocation } from '@msdyn365-commerce/retail-proxy';\nimport { IStoreInfo } from '@msdyn365-commerce-modules/bopis-utilities';\nimport { getFullAvailableInventoryNearby, GetFullAvailableInventoryNearbyInput, getOrgUnitLocationsByArea, GetOrgUnitLocationsByAreaInput, IFullOrgUnitAvailability } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, Modal, ModalBody, ModalFooter, ModalHeader, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport {\n StoreSelectorEmptyMessage,\n StoreSelectorFoundLocationsMessage,\n StoreSelectorLocationLines,\n StoreSelectorSearchForm,\n StoreSelectorTermsOfService,\n StoreSelectorWaiting\n} from './components';\nimport { IStoreSelectorData } from './store-selector.data';\nimport { IStoreSelectorProps, mode as modeEnum, searchRadiusUnit, style as styleEnum } from './store-selector.props.autogenerated';\n\nexport interface IStoreSelectorState {\n isSearchInProgress: boolean;\n searchTerm?: string;\n isSeeAllStoreValue: boolean;\n isLocationDisabled?: boolean;\n}\n\nexport interface IStoreSelectorViewProps extends IStoreSelectorProps {\n state: IStoreSelectorState;\n\n // Containers:\n ModuleProps: IModuleProps;\n BodyContainerProps: INodeProps;\n FooterContainerProps: INodeProps;\n HeaderContainerProps: INodeProps;\n HeaderProps?: React.ReactNode;\n\n // Components\n locationsMessage?: React.ReactNode;\n search?: React.ReactNode;\n spinner?: React.ReactNode;\n locationsList?: React.ReactNode;\n noLocationsMessage?: React.ReactNode;\n terms?: React.ReactNode;\n headerText?: React.ReactNode;\n\n callbacks: {\n closeDialog(): Promise;\n searchTermChanged(searchTerm: string): Promise;\n performSearch(searchTerm: string): Promise;\n selectedLocation(location: OrgUnitLocation | undefined): Promise;\n getAndUpdateUserLocation(): Promise;\n attachMapAutoSuggest(): Promise;\n onSuggestionSelected(result: Microsoft.Maps.ISuggestionResult): Promise;\n setPreferredStore(storeId: string | undefined): Promise;\n removePreferredStore(): Promise;\n setSelectedStore(storeId: string | undefined): Promise;\n setOrgUnitStoreInformation(location: OrgUnitLocation | undefined): Promise;\n };\n}\n\n/**\n *\n * Pick Up In Store module.\n * @extends React.Component>}\n */\n@observer\nclass StoreSelector extends React.Component, IStoreSelectorState> {\n private autoSuggestManager: Microsoft.Maps.AutosuggestManager | undefined;\n\n private readonly telemetryContent: ITelemetryContent;\n\n constructor(props: IStoreSelectorProps) {\n super(props);\n this.state = { isSearchInProgress: true, searchTerm: '', isSeeAllStoreValue: false };\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public componentDidMount(): void {\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: {\n channel\n }\n }\n },\n config: {\n autoSuggestionEnabled\n }\n } = this.props;\n\n // Adding Timeout to make sure it loads the data based upon the preferred store.\n setTimeout(() => {\n this._getAndUpdateStoreLocation();\n }, 0);\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result && this.props.data.storeSelectorStateManager.result.isDialogOpen,\n async () => {\n const context = this.props.data.storeSelectorStateManager.result?.context;\n if (context?.id === this.props.id) {\n this._getAndUpdateStoreLocation();\n }\n }\n );\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result && this.props.data.storeSelectorStateManager.result.context && this.props.data.storeSelectorStateManager.result.context.id,\n async () => {\n const context = this.props.data.storeSelectorStateManager.result?.context;\n if (!context || (context?.id === this.props.id)) {\n await this._searchTermChanged('');\n this._getAndUpdateStoreLocation();\n }\n }\n );\n\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n if (this.props.data.storeSelectorStateManager.result?.loadMapApi) {\n this.props.data.storeSelectorStateManager.result?.loadMapApi({\n key: channel?.BingMapsApiKey,\n lang: this.props.context?.actionContext?.requestContext?.channel?.ChannelCountryRegionISOCode,\n market: this.props.context?.actionContext?.requestContext?.channel?.DefaultLanguageId\n }).then().catch();\n }\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.loadMapApi,\n () => {\n this.props.data.storeSelectorStateManager.result?.loadMapApi({\n key: channel?.BingMapsApiKey,\n lang: this.props.context?.actionContext?.requestContext?.channel?.ChannelCountryRegionISOCode,\n market: this.props.context?.actionContext?.requestContext?.channel?.DefaultLanguageId\n });\n }\n );\n\n if (autoSuggestionEnabled) {\n when(\n () => {\n const isMapApiLoaded = !!this.props.data.storeSelectorStateManager.result?.isMapApiLoaded;\n const isDialogOpen = !!this.props.data.storeSelectorStateManager.result?.isDialogOpen;\n const isSameContext = this.props.data.storeSelectorStateManager.result?.context?.id === this.props.id;\n return isMapApiLoaded && isDialogOpen && isSameContext;\n },\n async () => {\n setTimeout(async () => {\n await this._attachMapAutoSuggest();\n }, 0);\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: IStoreSelectorProps): boolean {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n const context = storeSelectorStateManager ? storeSelectorStateManager.context : undefined;\n if (context && context.id === this.props.id) {\n return true;\n }\n return false;\n }\n\n public render(): JSX.Element {\n const {\n config: {\n termsOfServiceLink,\n className,\n heading,\n mode,\n style,\n setAsPreferredStore,\n showAllStores,\n lookupRadius\n },\n context: {\n telemetry,\n app: {\n config: appConfig\n },\n actionContext: {\n requestContext: {\n channel,\n cookies\n }\n }\n },\n resources,\n data: {\n availabilitiesWithHours: { result: availabilitiesWithHours },\n storeSelectorStateManager: { result: storeSelectorStateManager },\n storeLocations: { result: storeLocations }\n }\n } = this.props;\n\n const isMapDisabled = !((channel && channel.BingMapsApiKey && channel.BingMapsEnabled));\n const context = storeSelectorStateManager ? storeSelectorStateManager.context : undefined;\n const isDialogOpen: boolean = storeSelectorStateManager ? storeSelectorStateManager.isDialogOpen && (context?.id === this.props.id) : false;\n const styleDefault = style !== undefined ? style : styleEnum.dialog;\n const modeDefault = mode !== undefined ? mode : modeEnum.pickupInStore;\n const inlineView = styleDefault === styleEnum.inline;\n const locatorView = modeDefault === modeEnum.findStores;\n const hideInventory = locatorView;\n const selectedStoreLocationId = storeSelectorStateManager?.selectedStoreLocationId;\n const preferredStore: IStoreInfo | undefined = storeSelectorStateManager?.preferredStore;\n const displayList = storeSelectorStateManager?.listMapViewState?.displayList;\n const isPreferredStoreEnabled = setAsPreferredStore && cookies?.isConsentGiven();\n const showLocationView = (context && (context.showMapViewLink === undefined || context.showMapViewLink)) && locatorView && storeSelectorStateManager?.isMapModuleLoaded;\n\n const StoreSelectorActions = {\n toggleListMapViewState(): void {\n storeSelectorStateManager?.toggleListMapViewState();\n }\n };\n\n if (!(channel && channel.BingMapsApiKey)) {\n telemetry.error('BingMapsApiKey is missing.');\n }\n\n const configHeading = heading ? heading : (locatorView ? resources.storeLocatorHeaderText : resources.storeSelectorHeaderText);\n const preferredDistanceUnit = this.props.config.searchRadiusUnit === searchRadiusUnit.kilometers ? resources.kilometersShortText : resources.milesShortText;\n\n const viewProps = {\n ...(this.props as IStoreSelectorProps),\n state: this.state,\n\n ModuleProps: {\n tag: inlineView ? 'div' as NodeTag : Modal,\n moduleProps: this.props,\n className: classname(`ms-store-${inlineView ? 'locate' : 'select'}`, className, inlineView ? '' : 'msc-modal-input-required'),\n autoFocus: true,\n fade: true,\n isOpen: isDialogOpen,\n onClosed: this._closeDialog,\n horizontalPosition: 'center',\n verticalPosition: 'center',\n toggle: this._closeDialog\n },\n HeaderContainerProps: {\n tag: inlineView ? 'div' as NodeTag : ModalHeader,\n className: `ms-store-select__${inlineView ? 'header' : 'modal-header'}`,\n toggle: this._closeDialog\n },\n HeaderProps: configHeading && (\n \n ),\n FooterContainerProps: {\n tag: inlineView ? 'div' as NodeTag : ModalFooter,\n className: `ms-store-select__${inlineView ? 'footer' : 'modal-footer'} ${!displayList ? 'map-only-view' : ''}`\n },\n BodyContainerProps: {\n tag: inlineView ? 'div' as NodeTag : ModalBody,\n className: `ms-store-select__${inlineView ? 'body' : 'modal-body'}`\n },\n locationsMessage: !this.state.isLocationDisabled && (\n \n ),\n search: (\n {\n this._getAndUpdateStoreLocation(true);\n }}\n onToggleListMapViewState={StoreSelectorActions.toggleListMapViewState}\n displayList={displayList}\n locatorView={showLocationView}\n productPickUpDeliveryOptions={storeSelectorStateManager?.context?.deliveryOptions?.DeliveryOptions}\n telemetryContent={this.telemetryContent}\n />\n ),\n spinner: ,\n locationsList: ((availabilitiesWithHours && availabilitiesWithHours.length) || (storeLocations && storeLocations.length)) && (\n \n ),\n noLocationsMessage: ,\n terms: ,\n\n // Not being used in current context, we can use it here to pass more props.\n headerText: \n {heading ? heading : (locatorView ? resources.storeLocatorHeaderText : resources.storeSelectorHeaderText)}\n ,\n\n callbacks: {\n searchTermChanged: this._searchTermChanged,\n performSearch: this._performSearch,\n closeDialog: this._closeDialog,\n selectedLocation: this._onOrgUnitLocationSelected,\n getAndUpdateUserLocation: () => {\n this._getAndUpdateStoreLocation(); return Promise.resolve();\n },\n attachMapAutoSuggest: this._attachMapAutoSuggest,\n onSuggestionSelected: this._onOrgUnitLocationSelected,\n setPreferredStore: this._setPreferredStore,\n removePreferredStore: this._removePreferredStore,\n setSelectedStore: this._setSelectedStore,\n setOrgUnitStoreInformation: this._setOrgUnitStoreInformation\n }\n } as IStoreSelectorViewProps;\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleLinkTextChange = (event: Msdyn365.ContentEditableEvent) => {\n if (this.props.config.termsOfServiceLink) {\n this.props.config.termsOfServiceLink.linkText = event.target.value;\n }\n };\n\n public handleHeadingChange = (event: Msdyn365.ContentEditableEvent) => this.props.config.heading = event.target.value;\n\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n config: {\n autoSuggestOptions\n },\n context: {\n telemetry,\n actionContext: {\n requestContext: {\n channel\n }\n }\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded && !this.autoSuggestManager) {\n Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', {\n callback: () => {\n const options = { ...autoSuggestOptions, countryCode: channel?.ChannelCountryRegionISOCode };\n this.autoSuggestManager = new Microsoft.Maps.AutosuggestManager(options);\n this.autoSuggestManager.attachAutosuggest(`#ms-store-select__search-box_${this.props.id}`, `#ms-store-select__search-box-container_${this.props.id}`, this._onSuggestionSelected);\n },\n errorCallback: () => {\n if (telemetry) {\n telemetry.debug('Unable to attach map auto suggest.');\n }\n },\n credentials: channel?.BingMapsApiKey\n });\n }\n };\n\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n const context = this.props.data.storeSelectorStateManager && this.props.data.storeSelectorStateManager.result &&\n this.props.data.storeSelectorStateManager.result?.context;\n if (context && (context?.id === this.props.id)) {\n await this._searchTermChanged(result.formattedSuggestion);\n await this._performSearch(result.formattedSuggestion);\n }\n };\n\n private readonly _setPreferredStore = async (storeId: string | undefined): Promise => {\n if (!storeId) {\n return;\n }\n\n const {\n context: {\n actionContext: {\n requestContext: {\n cookies\n }\n }\n },\n config: {\n mode\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager },\n storeLocations: { result: storeLocations },\n availabilitiesWithHours: { result: availabilitiesWithHours }\n }\n } = this.props;\n\n if (!storeSelectorStateManager) {\n return;\n }\n const modeDefault = mode !== undefined ? mode : modeEnum.pickupInStore;\n\n let stores: IFullOrgUnitAvailability[];\n if (modeDefault === modeEnum.findStores && storeLocations) {\n stores = storeLocations;\n } else {\n stores = availabilitiesWithHours!;\n }\n\n const preferedStore = stores.find(store => store.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitNumber === storeId);\n\n await storeSelectorStateManager.setPreferredStoreLocation(storeId, preferedStore?.OrgUnitAvailability?.OrgUnitLocation?.OrgUnitName, cookies?.isConsentGiven(),\n preferedStore?.OrgUnitAvailability?.OrgUnitLocation?.Latitude, preferedStore?.OrgUnitAvailability?.OrgUnitLocation?.Longitude);\n };\n\n private readonly _removePreferredStore = async (): Promise => {\n const {\n context: {\n actionContext: {\n requestContext: {\n cookies\n }\n }\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (!storeSelectorStateManager) {\n return;\n }\n\n await storeSelectorStateManager.clearPreferredStore(cookies?.isConsentGiven());\n };\n\n private readonly _setSelectedStore = async (storeId: string | undefined): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (!storeSelectorStateManager) {\n return;\n }\n\n await storeSelectorStateManager.setSelectedStoreLocationId(storeId);\n };\n\n private readonly _performSearch = async (searchTerm: string): Promise => {\n const {\n context: {\n actionContext\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (!searchTerm || !storeSelectorStateManager) {\n return;\n }\n\n this.setState({ isSearchInProgress: true, isSeeAllStoreValue: false });\n\n const location = await storeSelectorStateManager.geoLocate(searchTerm.trim() !== '' ? searchTerm : '0', actionContext);\n\n if (location) {\n await this._updateLocations(location.latitude, location.longitude);\n } else {\n await this._updateLocations();\n }\n\n this.setState({ isSearchInProgress: false });\n };\n\n private readonly _searchTermChanged = async (searchTerm: string): Promise => {\n this.setState({ searchTerm });\n };\n\n private readonly _getAndUpdateStoreLocation = (showAllStores?: boolean): void => {\n const {\n config: {\n style\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n const styleDefault = style !== undefined ? style : styleEnum.dialog;\n\n if (styleDefault !== styleEnum.inline && (!storeSelectorStateManager || !storeSelectorStateManager.isDialogOpen)) {\n // Store selector dialog isn't open yet, so don't try and update anything\n return;\n }\n\n this.setState({ isSearchInProgress: true, isSeeAllStoreValue: false });\n\n if (navigator && navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n async position => {\n if (showAllStores) {\n this.setState({ isSeeAllStoreValue: true });\n await this._searchTermChanged('');\n await this._updateLocations(position.coords.latitude, position.coords.longitude, 0);\n } else {\n await this._updateLocations(position.coords.latitude, position.coords.longitude);\n }\n\n this.setState({ isSearchInProgress: false });\n },\n async error => {\n // If the location setting is turned off\n if (error.PERMISSION_DENIED) {\n this.setState({ isLocationDisabled: true });\n if (showAllStores) {\n this.setState({ isSeeAllStoreValue: true });\n await this._searchTermChanged('');\n await this._updateLocations(void 0, void 0, 0);\n } else {\n await this._updateLocations();\n }\n }\n\n this.setState({ isSearchInProgress: false });\n },\n { timeout: 2000 }\n );\n } else {\n this.setState({ isSearchInProgress: false });\n }\n };\n\n private readonly _closeDialog = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n this.setState({ searchTerm: '' });\n\n if (storeSelectorStateManager) {\n return storeSelectorStateManager.closeDialog();\n }\n };\n\n private readonly _setOrgUnitStoreInformation = async (orgUnitStoreInformation: IFullOrgUnitAvailability[]): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n },\n config: {\n style\n },\n telemetry\n } = this.props;\n\n if (!storeSelectorStateManager) {\n return;\n }\n\n const context = storeSelectorStateManager.context;\n const id: string = context && context.id ? context.id : this.props.id;\n const styleDefault = style !== undefined ? style : styleEnum.dialog;\n await storeSelectorStateManager.setOrgUnitStoreInformation({\n id,\n showMapViewLink: context && context.showMapViewLink,\n isDialog: styleDefault === styleEnum.dialog,\n orgUnitStoreInformation,\n onLocationSelected: orgUnitLocation => {\n // TO-DO handle event for when location in selected\n return Promise.resolve();\n }\n })\n .catch((error: Error) => {\n if (telemetry) {\n telemetry.error(error.message);\n telemetry.debug('Unable to Update store location state');\n }\n return;\n });\n return;\n };\n\n private readonly _updateLocations = async (latitude?: number, longitude?: number, radius?: number): Promise => {\n const {\n telemetry,\n config: {\n mode,\n lookupRadius,\n style\n },\n context: {\n actionContext\n },\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n const styleDefault = style !== undefined ? style : styleEnum.dialog;\n const calRadius = (radius || radius === 0) ? radius : (lookupRadius || 50);\n const distanceUnitValue = this.props.config.searchRadiusUnit === searchRadiusUnit.kilometers ? 1 : 0;\n const modeDefault = mode !== undefined ? mode : modeEnum.pickupInStore;\n const preferredStore: IStoreInfo | undefined = storeSelectorStateManager?.preferredStore;\n let lat = this.state.searchTerm || !(preferredStore?.Latitude) ? latitude : preferredStore.Latitude;\n let long = this.state.searchTerm || !(preferredStore?.Longitude) ? longitude : preferredStore.Longitude;\n if (styleDefault === styleEnum.inline) {\n const lastInlineStoreLocation = storeSelectorStateManager?.lastInlineShownStoreInfo;\n if (lastInlineStoreLocation && !this.state.searchTerm) {\n lat = lastInlineStoreLocation.Latitude ? lastInlineStoreLocation.Latitude : lat;\n long = lastInlineStoreLocation.Longitude ? lastInlineStoreLocation.Longitude : long;\n }\n await storeSelectorStateManager?.setLastInlineStoreInfo(lat, long);\n }\n\n if (modeDefault === modeEnum.findStores) {\n const orgUnitLocationsInput = new GetOrgUnitLocationsByAreaInput(\n lat,\n long,\n calRadius,\n distanceUnitValue,\n this.state.isLocationDisabled\n );\n\n const orgUnitLocations = await getOrgUnitLocationsByArea(orgUnitLocationsInput, actionContext);\n if (orgUnitLocations) {\n await this._setOrgUnitStoreInformation(orgUnitLocations);\n await this._setSelectedStore(undefined);\n }\n return;\n }\n\n if (!storeSelectorStateManager || !storeSelectorStateManager.context) {\n // Store selector dialog isn't open yet, so don't try and update anything\n return;\n }\n\n if (!storeSelectorStateManager.context.product) {\n // TODO: Use alternative search method here to not make inventory check\n return;\n }\n\n const input = new GetFullAvailableInventoryNearbyInput(\n storeSelectorStateManager.context.product.RecordId,\n lat || 0,\n long || 0,\n calRadius,\n distanceUnitValue,\n this.state.isLocationDisabled\n );\n\n await getFullAvailableInventoryNearby(input, actionContext).catch((error) => {\n telemetry.warning(error);\n telemetry.error(error.message);\n telemetry.debug('Unable to get full available inventory near by');\n });\n };\n\n private readonly _onOrgUnitLocationSelected = async (location: OrgUnitLocation | undefined, deliveryMode?: string): Promise => {\n const {\n telemetry,\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager) {\n if (location && storeSelectorStateManager.context) {\n // Want to eat exceptions here so that the dialog still closes even if the onLocationSelected call goes wrong\n await storeSelectorStateManager.context.onLocationSelected(location, deliveryMode).catch(error => {\n telemetry.warning(error);\n telemetry.error(error.message);\n telemetry.debug('Unable to get on org unit location selected');\n });\n }\n\n await storeSelectorStateManager.closeDialog();\n }\n };\n}\n\nexport default StoreSelector;\n"],"sourceRoot":""}