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erce.online/./src/themes/peruvian/views/search.view.tsx?d416","webpack://msdyn365.commerce.online/./lib/search/module-registration.js?f197","webpack://msdyn365.commerce.online/./src/search-state-data-action.ts?8223","webpack://msdyn365.commerce.online/./src/search-state.ts?dd10","webpack://msdyn365.commerce.online/./src/modules/search/actions/get-auto-suggest-suggestions.ts?4735","webpack://msdyn365.commerce.online/./src/modules/search/components/search.categorysuggest.tsx?c65d","webpack://msdyn365.commerce.online/./src/modules/search/components/search.form.tsx?25a5","webpack://msdyn365.commerce.online/./src/modules/search/components/search.keywordsuggest.tsx?297c","webpack://msdyn365.commerce.online/./src/modules/search/components/search.label.tsx?0c17","webpack://msdyn365.commerce.online/./src/modules/search/components/search.productsuggest.tsx?2af9","webpack://msdyn365.commerce.online/./src/modules/search/search.tsx?72fb","webpack://msdyn365.commerce.online/./src/modules/search/search.view.tsx?1505","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/components/search.categorysuggest.tsx?6bcf","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/components/search.mobile.empty.tsx?ff32","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/components/search.form.tsx?d41a","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/components/search.keywordsuggest.tsx?2724","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/components/search.productsuggest.tsx?6616","webpack://msdyn365.commerce.online/./src/modules/adventureworks/views/search.view.tsx?bfa7","webpack://msdyn365.commerce.online/external var \"React\"?0d3b","webpack://msdyn365.commerce.online/external var \"ReactDOM\"?853b"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from '@msdyn365-commerce-modules/search/src/modules/search/./components';\r\nimport { ISearchViewProps } from '@msdyn365-commerce-modules/search/src/modules/search/./search';\r\n\r\nconst SearchView: React.FC = props => {\r\n const {\r\n Search,\r\n AutoSuggestAriaLabel,\r\n AutoSuggestAriaLabelText,\r\n searchText,\r\n AutoSuggest,\r\n KeywordSuggest,\r\n ProductSuggest,\r\n CategorySuggest,\r\n UlKeyword,\r\n UlProduct,\r\n UlCategory,\r\n form,\r\n autosuggestCategory,\r\n autosuggestKeyword,\r\n autosuggestProduct,\r\n SearchForm,\r\n FormWrapper,\r\n label\r\n } = props;\r\n\r\n return (\r\n \r\n {label}\r\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\r\n \r\n {searchText && searchText.length > 0 ?\r\n {AutoSuggestAriaLabelText} : ''\r\n }\r\n
\r\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword)}\r\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct)}\r\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory)}\r\n
\r\n
\r\n {_getCatogaoryImage(props)}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\n\r\nconst _getCatogaoryImage = (props: ISearchViewProps): any => {\r\n let [image, setImage] = React.useState(\"\");\r\n if (props.searchText && props.searchText.length > 0) {\r\n let searchTerm = props.searchText.replace(/\\s+/g, '-').toLowerCase();\r\n let url = 'https://images-us-prod.cms.commerce.dynamics.com/cms/api/gzpsdzqfwp/imageFileData/search?fileName=search-promo-' + searchTerm + '.jpg&f=jpg';\r\n const xhr = new XMLHttpRequest();\r\n // listen for `onload` event\r\n xhr.onload = () => {\r\n if (xhr.status == 200) {\r\n setImage('block'); // setImage(\"display:block\");\r\n } else {\r\n setImage('none');\r\n }\r\n };\r\n\r\n // create a `HEAD` request\r\n xhr.open('HEAD', url + '');\r\n\r\n // send request\r\n xhr.send();\r\n\r\n return
; \r\n }\r\n}\r\n\r\n\r\n\r\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\r\n return (\r\n \r\n \r\n {form.submitBtn}\r\n {form.input}\r\n {/* {form.cancelBtn} */}\r\n \r\n \r\n );\r\n};\r\n\r\nconst _renderKeywordSuggestions = (\r\n KeywordSuggest: INodeProps,\r\n UlKeyword: INodeProps,\r\n keywordSuggestions?: ISearchKeywordViewProps\r\n) => {\r\n return (\r\n keywordSuggestions && (\r\n \r\n \r\n {keywordSuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderProductSuggestions = (\r\n ProductSuggest: INodeProps,\r\n UlProduct: INodeProps,\r\n productSuggestions?: ISearchProductViewProps\r\n) => {\r\n return (\r\n productSuggestions && (\r\n \r\n \r\n {productSuggestions.title}\r\n {productSuggestions.items.map((item, index) => {\r\n return (\r\n \r\n \r\n {item.thumbnail}\r\n {item.text}\r\n {item.price}\r\n \r\n \r\n );\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nconst _renderCategorySuggestions = (\r\n CategorySuggest: INodeProps,\r\n UlCategory: INodeProps,\r\n categorySuggestions?: ISearchCategoryViewProps\r\n) => {\r\n return (\r\n categorySuggestions && (\r\n \r\n \r\n {categorySuggestions.title}\r\n {categorySuggestions.text.map(text => {\r\n return text;\r\n })}\r\n \r\n \r\n )\r\n );\r\n};\r\n\r\nexport default SearchView;","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['search'] = {\n c: () => require('@msdyn365-commerce-modules/search/dist/lib/modules/search/search'),\n $type: 'contentModule',\n da: [{name:'searchState', path:'@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action', runOn: 1}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'search',\n p: 'search',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/search/dist/lib/modules/search'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action';\n let dataAction = require('@msdyn365-commerce-modules/search-utilities/dist/lib/search-state-data-action');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|themes|peruvian|views|search'] = {\n c: () => require('partner/themes/peruvian/views/search.view.tsx'),\n cn: '__local__-__local__-search'\n };\nviewDictionary['@msdyn365-commerce-modules|search|modules|search|search'] = {\n c: () => require('@msdyn365-commerce-modules/search/dist/lib/modules/search/search.view.js'),\n cn: '@msdyn365-commerce-modules-search-search'\n };\nviewDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|search'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/search.view.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-search'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { createObservableDataAction, IAction, IActionInput, IAny, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { GenericInput, getGenericAction } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { SearchState } from './search-state';\n\nexport function createSearchStateInput(result: SearchState): GenericInput {\n return new GenericInput('searchState', result, 'SearchState');\n}\n\nconst createsearchStateInputInternal = (inputData: ICreateActionContext>): IActionInput => {\n return createSearchStateInput({ searchText: '' });\n};\n\nexport const getGenericActionDataAction = createObservableDataAction({\n action: >getGenericAction,\n input: createsearchStateInputInternal\n});\n\nexport default getGenericActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a autosuggest.\n */\nexport class SearchState {\n @observable public searchText?: string;\n\n @observable public defaultBasicSearchUrl?: string;\n\n @observable public searchQueryStringParameter?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\nimport {\n CacheType,\n createObservableDataAction,\n getCatalogId,\n IAction,\n IActionContext,\n IActionInput,\n ICreateActionContext\n} from '@msdyn365-commerce/core';\nimport { SearchSuggestion, SearchSuggestionCriteria } from '@msdyn365-commerce/retail-proxy';\nimport { getSearchSuggestionsAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport { generateImageUrl } from '@msdyn365-commerce-modules/retail-actions';\n\nexport enum SuggestionType {\n Category = 'ScopedCategory',\n Keyword = 'Keyword',\n Product = 'Product',\n None = 'None'\n}\n\n/**\n * Input class for auto suggest search input.\n */\nexport class AutoSuggestInput implements IActionInput {\n public searchQuery?: string;\n\n public topResultsCount?: number;\n\n public suggestionType?: string;\n\n public hitPrefix?: string;\n\n public hitSuffix?: string;\n\n public constructor(searchText?: string, top?: number, suggestionType?: string, hitPrefix?: string, hitSuffix?: string) {\n this.searchQuery = searchText;\n this.topResultsCount = top;\n this.suggestionType = suggestionType;\n this.hitPrefix = hitPrefix;\n this.hitSuffix = hitSuffix;\n }\n\n public getCacheKey = () => 'AutoSuggestSearchSuggestions';\n\n public getCacheObjectType = () => 'AutoSuggestSearchSuggestions';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nconst createInput = (inputData: ICreateActionContext) => {\n return new AutoSuggestInput();\n};\n\n/**\n * Calls the Retail API and returns a auto-suggest suggestions.\n * @param input\n * @param ctx\n */\nexport async function getSearchSuggestionsAction(input: AutoSuggestInput, ctx: IActionContext): Promise {\n // If no input is provided fail out\n if (!input || !input.searchQuery) {\n throw new Error('[getSearchSuggestionsAction]No valid Input was provided, failing');\n }\n\n const autosuggest: Autosuggestions = {};\n\n const autoSuggestPromises = [_getAutoSuggest(input, autosuggest, ctx)];\n return Promise.all(autoSuggestPromises).then(() => {\n return autosuggest;\n });\n}\n\nasync function _getAutoSuggest(input: AutoSuggestInput, autosuggest: Autosuggestions, ctx: IActionContext): Promise {\n const catalogId = getCatalogId(ctx.requestContext);\n const searchCriteria: SearchSuggestionCriteria = {\n ProductSearchCriteria: {\n SearchCondition: input.searchQuery && input.searchQuery.length > 0 ? input.searchQuery : '',\n Context: {\n ChannelId: +ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n }\n },\n HitPrefix: input.hitPrefix,\n HitSuffix: input.hitSuffix,\n SuggestionType: input.suggestionType\n };\n\n const searchSuggestions = await getSearchSuggestionsAsync(\n { callerContext: ctx, queryResultSettings: { Paging: { Top: input.topResultsCount } } },\n searchCriteria\n );\n\n if (searchSuggestions && searchSuggestions.length > 0) {\n // Generate image url\n searchSuggestions.map(\n (item: SearchSuggestion) =>\n (item.ImageUrl = item.ImageUrl ? generateImageUrl(item.ImageUrl, ctx.requestContext.apiSettings) : '')\n );\n\n autosuggest.AllSearchResults = searchSuggestions;\n } else {\n ctx.telemetry.error(\n `[getSearchSuggestionsAction] unable to get availabilites for search with suggestion type ${searchCriteria.SuggestionType}`\n );\n }\n}\n\nexport const getSearchSuggestionsActionDataAction = createObservableDataAction({\n id: '@msdyn365-commerce-modules/search/get-auto-suggest-suggestions',\n action: >getSearchSuggestionsAction,\n input: createInput\n});\n\nexport default getSearchSuggestionsActionDataAction;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, { getRichTextHtml } from '@msdyn365-commerce/core';\nimport { ProductRefiner, ProductRefinerSource, ProductRefinerValue, SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\nexport interface ISearchCategorySuggestProps {\n searchCategorySuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps;\n searchText: string;\n searchRefiners: ProductRefiner[] | undefined;\n suggestions: SearchSuggestion[] | undefined;\n telemetryContent?: ITelemetryContent;\n shouldShowFullPath?: boolean;\n}\n\nexport interface ISearchCategoryViewProps {\n title: React.ReactNode;\n text: React.ReactNode[];\n}\n\nlet payLoad: IPayLoad;\n\n/**\n * CategorySuggestionsComponent.\n * @param props\n */\nexport const CategorySuggestionsComponent = (props: ISearchCategorySuggestProps): ISearchCategoryViewProps | undefined => {\n const {\n suggestions,\n searchText,\n autoSuggestProps: {\n resources: { categorySuggestionHeading }\n }\n } = props;\n\n const reactNodes: React.ReactNode[] = [];\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, props));\n });\n\n const titleNode = _renderTitle(categorySuggestionHeading, searchText);\n\n return { title: titleNode, text: reactNodes };\n};\n\nconst _renderTitle = (categorySuggestionHeading: string, searchText: string) => {\n const categoryAutoSuggestionHeading = categorySuggestionHeading\n ? format(categorySuggestionHeading, searchText)\n : `Search \"${searchText}\" in categories`;\n\n return
  • {categoryAutoSuggestionHeading}
  • ;\n};\n\nconst _assembleNode = (item: SearchSuggestion, props: ISearchCategorySuggestProps) => {\n const { searchText, hitPrefix, hitSuffix, shouldShowFullPath } = props;\n\n const splitValue = shouldShowFullPath ? item.Value : item.Value && item.Value.split('|').pop();\n const ariaLabel = splitValue\n ? splitValue.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '')\n : item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n payLoad.contentAction.etext = item.Value;\n const attribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n return (\n
  • \n \n {_generateLink(item, searchText, props) && _getHighlightedText(splitValue ? splitValue : '', hitPrefix, hitSuffix)}\n \n
  • \n );\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, searchText: string, props: ISearchCategorySuggestProps): string => {\n return suggestion && suggestion.Id ? _getCategoryLink(suggestion.Id, searchText, props) : '';\n};\n\nconst _getCategoryLink = (id: string, searchText: string, props: ISearchCategorySuggestProps): string => {\n const { searchPageURL, searchQsp, searchRefiners } = props;\n\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(searchPageURL, window.location.href);\n\n if (searchQsp && searchText) {\n queryUrl.searchParams.set(searchQsp, searchText);\n }\n\n const categoryRefiners = searchRefiners?.find(refiners => {\n return refiners.SourceValue === ProductRefinerSource.Category;\n });\n const refiner = categoryRefiners?.Values?.find(item => {\n return item.RefinerRecordId === Number.parseInt(id, 10);\n });\n\n const encodedRefiner = refiner && JSON.stringify(compressRefiners([refiner]));\n if (encodedRefiner) {\n queryUrl.searchParams.set('refiners', encodedRefiner);\n }\n\n return queryUrl.href;\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n // eslint-disable-next-line react/no-danger\n return ;\n};\n\n// TODO: This code is currently duplicated in categoryautosuggest need to either remove one of these files\n// or move this code to a common place\nconst compressedRefinerKeys = [\n 'DataTypeValue',\n 'LeftValueBoundString',\n 'RefinerRecordId',\n 'RefinerSourceValue',\n 'RightValueBoundString',\n 'UnitText'\n];\n\n/**\n * Compressed a list of refiners for use in URLs.\n * @param refiners The uncompressed refiners.\n */\nconst compressRefiners = (refiners: ProductRefinerValue[]) => {\n const compressedRefiners: (string | number)[][] = [];\n\n refiners.forEach(refiner => {\n const compressedRefiner: (string | number)[] = [];\n compressedRefinerKeys.forEach(refinerKey => {\n compressedRefiner.push(refiner[refinerKey]);\n });\n compressedRefiners.push(compressedRefiner);\n });\n\n return compressedRefiners;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ISearchFormProps {\n hideSearchLabel: boolean | undefined;\n isSearchFormExpanded?: boolean | undefined;\n disableSubmitSearch: boolean | undefined;\n searchTextInput: React.RefObject;\n maxChars: number;\n searchQsp: string;\n searchPlaceholder: string;\n query: string;\n ariaLabelCancel: string;\n ariaLabelSearch: string;\n ariaLabelSubmit: string;\n handleCancelSearchChange(): void;\n handleInputChange(query: string): void;\n}\n\nexport interface ISearchFormViewProps {\n input: React.ReactNode;\n submitBtn: React.ReactNode;\n cancelBtn: React.ReactNode;\n}\n\n/**\n * On Input Change functionality.\n * @param handleInputChange -Input change function.\n * @returns Set updated input value.\n */\nconst onInputChangeFunction = (handleInputChange: (query: string) => void) => (event: React.ChangeEvent) => {\n handleInputChange(event.target.value || '');\n};\nexport const FormComponent = (props: ISearchFormProps): ISearchFormViewProps => {\n const {\n searchQsp,\n searchPlaceholder,\n hideSearchLabel,\n searchTextInput,\n handleInputChange,\n maxChars,\n disableSubmitSearch,\n handleCancelSearchChange,\n query,\n ariaLabelCancel,\n ariaLabelSearch,\n ariaLabelSubmit\n } = props;\n\n const onInputChange = onInputChangeFunction(handleInputChange);\n\n const inputNode = !hideSearchLabel ? (\n \n ) : (\n \n );\n\n const submitBtnNode = !disableSubmitSearch && \n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PriceComponent } from '@msdyn365-commerce/components';\nimport { getRichTextHtml, IActionContext, IImageSettings, Image, ITelemetry } from '@msdyn365-commerce/core';\nimport { SearchSuggestion } from '@msdyn365-commerce/retail-proxy';\nimport { getProductPageUrlSync, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n getPayloadObject,\n getTelemetryAttributes,\n INodeProps,\n IPayLoad,\n ITelemetryContent,\n NodeTag\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchData } from '../search.data';\nimport { ISearchProps } from '../search.props.autogenerated';\n\n/**\n * Search product suggest resources.\n */\nexport interface ISearchProductSuggestResources {\n freePriceText: string;\n}\n\nexport interface ISearchProductSuggestProps {\n searchProductSuggestClass: string;\n searchPageURL: string;\n searchQsp: string | undefined;\n hitPrefix: string;\n hitSuffix: string;\n autoSuggestProps: ISearchProps;\n searchText: string;\n suggestions: SearchSuggestion[] | undefined;\n telemetry: ITelemetry;\n moduleType: string;\n moduleId: string;\n telemetryContent?: ITelemetryContent;\n resources?: ISearchProductSuggestResources;\n}\n\nexport interface ISearchProductViewProps {\n title: React.ReactNode;\n items: ISearchProductItemViewProps[];\n}\n\nexport interface ISearchProductItemViewProps {\n text: React.ReactNode;\n thumbnail: React.ReactNode;\n price: React.ReactNode;\n LiProduct: INodeProps;\n AProduct: INodeProps;\n id: string | undefined;\n}\n\nlet payLoad: IPayLoad;\nlet telemetryContent: ITelemetryContent | undefined;\n\n/**\n * ProductSuggestionsComponent.\n * @param props\n */\nexport const ProductSuggestionsComponent = (props: ISearchProductSuggestProps): ISearchProductViewProps | undefined => {\n const {\n suggestions,\n hitSuffix,\n hitPrefix,\n autoSuggestProps: {\n context: { actionContext },\n resources: { productSuggestionHeading }\n },\n moduleType,\n moduleId\n } = props;\n const reactNodes: ISearchProductItemViewProps[] = [];\n telemetryContent = props.telemetryContent;\n payLoad = getPayloadObject('click', props.telemetryContent!, '');\n\n suggestions?.map(item => {\n reactNodes.push(_assembleNode(item, hitPrefix, hitSuffix, actionContext, props, moduleType, moduleId));\n });\n\n const titleNode = _renderTitle(productSuggestionHeading);\n\n return { title: titleNode, items: reactNodes };\n};\n\nconst _renderTitle = (productSuggestionHeading: string) => {\n const productAutoSuggestionHeading = productSuggestionHeading ? productSuggestionHeading : 'Go to products';\n\n return
  • {productAutoSuggestionHeading}
  • ;\n};\n\nconst _assembleNode = (\n item: SearchSuggestion,\n hitPrefix: string,\n hitSuffix: string,\n actionContext: IActionContext,\n props: ISearchProductSuggestProps,\n moduleType: string,\n moduleId: string\n): ISearchProductItemViewProps => {\n const altText =\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n const price = item.Value3?.Value?.DecimalValue;\n return {\n text: _getHighlightedText(item.Value ? item.Value : '', hitPrefix, hitSuffix),\n thumbnail: _renderThumbnail(item, altText ? altText : '', props),\n price: !ObjectExtensions.isNullOrUndefined(price) && _renderPrice(price, price, moduleId, moduleType, props),\n LiProduct: _getLiWrapper(),\n AProduct: _getAWrapper(item, hitPrefix, hitSuffix, actionContext, props),\n id: item.Id\n };\n};\n\nconst _getLiWrapper = () => {\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'li' as NodeTag\n };\n};\n\nconst _getAWrapper = (\n item: SearchSuggestion,\n hitPrefix: string,\n hitSuffix: string,\n actionContext: IActionContext,\n props: ISearchProductSuggestProps\n) => {\n const {\n autoSuggestProps: { context }\n } = props;\n const ariaLabel =\n item.Value && item.Value.replace(new RegExp(`[${hitPrefix}]`, 'gi'), '').replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n payLoad.contentAction.recid = item.Id;\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n const productPrice = context.cultureFormatter.formatCurrency(item.Value3!.Value!.DecimalValue!);\n\n return {\n className: 'msc-autoSuggest__productResults-item',\n tag: 'a' as NodeTag,\n 'aria-label': `${ariaLabel!} ${productPrice}`,\n href: _generateLink(item, hitPrefix, hitSuffix, actionContext),\n ...attribute\n };\n};\n\nconst _generateLink = (suggestion: SearchSuggestion, hitPrefix: string, hitSuffix: string, actionContext: IActionContext) => {\n const formattedLink = (suggestion.Value as string)\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n return suggestion.Value && suggestion.Id\n ? getProductPageUrlSync(formattedLink, (suggestion.Id as unknown) as number, actionContext, undefined)\n : '';\n};\n\nconst _getHighlightedText = (suggestion: string, hitPrefix: string, hitSuffix: string): JSX.Element => {\n const formattedText = suggestion\n .replace(new RegExp(`[${hitPrefix}]`, 'gi'), '')\n .replace(new RegExp(`[${hitSuffix}]`, 'gi'), '');\n\n return (\n // eslint-disable-next-line react/no-danger\n \n );\n};\n\nconst _renderPrice = (\n adjustedPrice: number,\n basePrice: number,\n moduleId: string,\n moduleType: string,\n props: ISearchProductSuggestProps\n): JSX.Element | null => {\n const {\n autoSuggestProps: { context }\n } = props;\n\n return (\n \n );\n};\n\nconst _renderThumbnail = (suggestion: SearchSuggestion, altText: string, props: ISearchProductSuggestProps): JSX.Element | null => {\n const {\n autoSuggestProps: {\n context: {\n request: { gridSettings }\n },\n config: { imageSettings }\n }\n } = props;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n\n if (!suggestion || !suggestion.ImageUrl) {\n props.telemetry.error('Search suggestion content is empty, module wont render.');\n return null;\n }\n\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n lg: { q: 'w=40&h=40&m=6', w: 0, h: 0 },\n xl: { q: 'w=40&h=40&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n return (\n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Autosuggestions } from '@msdyn365-commerce/commerce-entities';\nimport MsDyn365, { getCatalogId, getUrlSync } from '@msdyn365-commerce/core';\nimport { ProductRefiner, ProductRefinerSource, ProductsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, ObjectExtensions, Random } from '@msdyn365-commerce-modules/retail-actions';\nimport { createSearchStateInput } from '@msdyn365-commerce-modules/search-utilities';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { debounce } from 'lodash';\nimport { Spinner, SpinnerSize } from 'office-ui-fabric-react';\nimport * as React from 'react';\n\nimport getSearchSuggestionsAction, { AutoSuggestInput, SuggestionType } from './actions/get-auto-suggest-suggestions';\nimport {\n CategorySuggestionsComponent,\n FormComponent,\n ISearchCategoryViewProps,\n ISearchKeywordViewProps,\n ISearchProductViewProps,\n KeywordSuggestionsComponent,\n LabelComponent,\n ProductSuggestionsComponent\n} from './components';\nimport { ISearchData } from './search.data';\nimport { ISearchProps, ISuggestionTypeCriterionData, SuggestionTypeCriterionSuggestionType } from './search.props.autogenerated';\n\nexport interface ISearchState {\n isSearchFormExpanded: boolean;\n searchText: string;\n searchKeywordSuggestClass: string;\n searchProductSuggestClass: string;\n searchCategorySuggestClass: string;\n suggestions: Autosuggestions | undefined;\n searchRefiners?: ProductRefiner[] | undefined;\n autoSuggestAriaLabel: string;\n isInitialState: boolean;\n isLoadingAutoSuggest?: boolean;\n}\n\nexport interface ISearchViewProps extends ISearchProps {\n Search: IModuleProps;\n AutoSuggestAriaLabel: INodeProps;\n AutoSuggestAriaLabelText: string;\n searchText: string;\n AutoSuggest: INodeProps;\n KeywordSuggest: INodeProps;\n ProductSuggest: INodeProps;\n CategorySuggest: INodeProps;\n SearchForm: INodeProps;\n FormWrapper: INodeProps;\n UlKeyword: INodeProps;\n UlProduct: INodeProps;\n UlCategory: INodeProps;\n label: React.ReactNode;\n form: React.ReactNode;\n autosuggestKeyword?: ISearchKeywordViewProps;\n autosuggestProduct?: ISearchProductViewProps;\n autosuggestCategory?: ISearchCategoryViewProps;\n callbacks: {\n handleCancelSearchChange(): void;\n handleCancelSearchFocused?(): void;\n };\n isSearchFormExpanded: boolean;\n isLoadingAutoSuggest?: boolean;\n isLoadingNode?: React.ReactNode;\n}\n\n/**\n *\n * Search module.\n * @extends {React.Component, ISearchState>}\n */\nclass Search extends React.Component, ISearchState> {\n private readonly searchTextInput: React.RefObject;\n\n private readonly searchCollapsedLabel: React.RefObject;\n\n private readonly formReference: React.RefObject;\n\n private readonly maxChars: number;\n\n private readonly topResultsCount?: number;\n\n private readonly hitPrefix: string = '{';\n\n private readonly hitSuffix: string = '}';\n\n private readonly waitTime: number = 500;\n\n private readonly autoSuggestResultScreenReaderDiv: React.RefObject;\n\n private readonly autoSuggestResultDiv: React.RefObject;\n\n private readonly searchFormClass: string;\n\n private readonly searchLabelClass: string;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private loadSuggestionsRequestId?: string;\n\n private inputSuggestionType: ISuggestionTypeCriterionData[];\n\n // @ts-expect-error\n private cancellabelDebounce: debounce;\n\n public constructor(props: ISearchProps) {\n super(props);\n this.searchTextInput = React.createRef();\n this.searchCollapsedLabel = React.createRef();\n this.autoSuggestResultScreenReaderDiv = React.createRef();\n this.autoSuggestResultDiv = React.createRef();\n this.formReference = React.createRef();\n this.state = {\n isSearchFormExpanded: false,\n searchText: '',\n searchKeywordSuggestClass: 'ms-search__autoSuggest__keyword',\n searchProductSuggestClass: 'ms-search__autoSuggest__product',\n searchCategorySuggestClass: 'ms-search__autoSuggest__category',\n suggestions: undefined,\n searchRefiners: undefined,\n autoSuggestAriaLabel: '',\n isInitialState: true,\n isLoadingAutoSuggest: false\n };\n this.maxChars =\n (this.props.context &&\n this.props.context.app &&\n this.props.context.app.config &&\n this.props.context.app.config.searchInputMaxLength) ||\n 50;\n\n this.inputSuggestionType = [];\n this.topResultsCount = this.props.config && this.props.config.topResultsCount ? this.props.config.topResultsCount : 5;\n this.searchFormClass = 'ms-search__form';\n this.searchLabelClass = 'ms-search__label';\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n\n this._initSuggestionTypes();\n }\n\n public async componentDidMount(): Promise {\n document.body && document.body.addEventListener('mousedown', this._focusOutTarget);\n window && window.addEventListener('keyup', this._keyup);\n }\n\n public componentWillUnmount(): void {\n document.body && document.body.removeEventListener('mousedown', this._focusOutTarget, false);\n window && window.removeEventListener('keyup', this._keyup, false);\n }\n\n public componentDidUpdate(): void {\n const {\n config: { hideSearchLabel }\n } = this.props;\n const { isSearchFormExpanded, isInitialState } = this.state;\n\n if (!this.props.context.request.params.isEditor) {\n if (!hideSearchLabel && isSearchFormExpanded) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else if (!isInitialState) {\n this.searchCollapsedLabel && this.searchCollapsedLabel.current && this.searchCollapsedLabel.current.focus();\n }\n }\n }\n\n public shouldComponentUpdate(nextProps: ISearchProps, nextState: ISearchState): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n // eslint-disable-next-line complexity -- ignore complexity.\n public render(): JSX.Element {\n const {\n context,\n resources: { searchtext, searchLabelArialLabel, cancelBtnAriaLabel, searchBtnAriaLabel, submitBtnAriaLabel },\n config: { hideSearchLabel, disableSubmitSearch, searchplaceholderText, shouldShowFullCategoryPath, className = '' }\n } = this.props;\n\n const {\n isSearchFormExpanded,\n searchText,\n searchKeywordSuggestClass,\n searchProductSuggestClass,\n searchCategorySuggestClass,\n suggestions,\n searchRefiners,\n isLoadingAutoSuggest\n } = this.state;\n\n const searchQsp = (context && context.app && context.app.config && context.app.config.searchQueryStringParameter) || 'q';\n const searchPageURL = getUrlSync('search', context && context.actionContext) || '';\n const searchURL = this._appendQueryParams(searchPageURL, searchText, searchQsp);\n const searchPlaceholder = searchplaceholderText && searchplaceholderText.length > 0 ? searchplaceholderText : 'Search in Fabrikam';\n\n const keywordSuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => suggestion.SuggestionType === SuggestionType.Keyword || suggestion.SuggestionType === SuggestionType.None\n );\n const productSuggestions = suggestions?.AllSearchResults?.filter(\n suggestion => suggestion.SuggestionType === SuggestionType.Product\n );\n const categoryRefiners = searchRefiners?.find(refiner => {\n return refiner.SourceValue === ProductRefinerSource.Category;\n });\n const categorySuggestions = suggestions?.AllSearchResults?.filter(suggestion => {\n if (suggestion.SuggestionType !== SuggestionType.Category) {\n return false;\n }\n const refiner = categoryRefiners?.Values?.find(item => {\n return `${item.RefinerRecordId ?? 0}` === suggestion.Id;\n });\n\n return !ObjectExtensions.isNullOrUndefined(refiner);\n });\n\n const viewProps: ISearchViewProps = {\n ...(this.props as ISearchProps),\n\n Search: {\n moduleProps: this.props,\n className: `${classnames('ms-search', className)} ${disableSubmitSearch ? 'no-submit' : 'with-submit'}`\n },\n AutoSuggestAriaLabel: {\n tag: 'div',\n className: 'msc-autoSuggest__screen-reader',\n 'aria-live': 'assertive',\n ref: this.autoSuggestResultScreenReaderDiv\n },\n AutoSuggestAriaLabelText: this.state.autoSuggestAriaLabel,\n searchText: this.state.searchText,\n AutoSuggest: {\n ref: this.autoSuggestResultDiv,\n className: 'ms-search__autoSuggest'\n },\n KeywordSuggest: {\n className: searchKeywordSuggestClass\n },\n ProductSuggest: {\n className: searchProductSuggestClass\n },\n CategorySuggest: {\n className: searchCategorySuggestClass\n },\n SearchForm: {\n className: `${this.searchFormClass} ${isSearchFormExpanded ? 'bx-show' : 'bx-hide'}`\n },\n FormWrapper: {\n tag: 'form',\n ref: this.formReference,\n className: 'ms-search__searchForm',\n 'aria-label': 'Search',\n name: 'searchForm',\n role: 'search',\n action: searchURL,\n autoComplete: 'off',\n onSubmit: this._handleSubmit\n },\n UlKeyword: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__keywordResults-items', className)\n },\n UlProduct: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__productResults-items', className)\n },\n UlCategory: {\n tag: 'ul',\n className: classnames('msc-autoSuggest__categoryResults-items', className)\n },\n label: LabelComponent({\n isSearchFormExpanded,\n searchLabelClass: `${this.searchLabelClass} ${isSearchFormExpanded ? 'bx-hide' : 'bx-show'}`,\n searchtext,\n searchLabelArialLabel,\n searchCollapsedLabel: this.searchCollapsedLabel,\n hideSearchLabel,\n handleCancelSearchChange: this._handleCancelSearchChange,\n telemetryContent: this.telemetryContent\n }),\n form: FormComponent({\n ariaLabelCancel: cancelBtnAriaLabel,\n ariaLabelSearch: searchBtnAriaLabel,\n ariaLabelSubmit: submitBtnAriaLabel,\n hideSearchLabel,\n searchTextInput: this.searchTextInput,\n disableSubmitSearch,\n handleInputChange: this._handleInputChange,\n handleCancelSearchChange: this._handleCancelSearchChange,\n maxChars: this.maxChars,\n searchQsp,\n searchPlaceholder,\n query: searchText\n }),\n autosuggestKeyword:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (keywordSuggestions && ArrayExtensions.hasElements(keywordSuggestions)))\n ? KeywordSuggestionsComponent({\n searchKeywordSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: keywordSuggestions,\n telemetryContent: this.telemetryContent\n })\n : undefined,\n autosuggestProduct:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (productSuggestions && ArrayExtensions.hasElements(productSuggestions)))\n ? ProductSuggestionsComponent({\n searchProductSuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: productSuggestions,\n telemetry: this.props.telemetry,\n moduleType: this.props.typeName,\n moduleId: this.props.id,\n telemetryContent: this.telemetryContent,\n resources: this.props.resources\n })\n : undefined,\n autosuggestCategory:\n searchText &&\n searchText.length > 0 &&\n (isLoadingAutoSuggest || (categorySuggestions && ArrayExtensions.hasElements(categorySuggestions)))\n ? CategorySuggestionsComponent({\n searchCategorySuggestClass,\n searchPageURL,\n searchQsp,\n hitPrefix: this.hitPrefix,\n hitSuffix: this.hitSuffix,\n autoSuggestProps: this.props,\n searchText,\n suggestions: categorySuggestions,\n searchRefiners,\n telemetryContent: this.telemetryContent,\n shouldShowFullPath: shouldShowFullCategoryPath\n })\n : undefined,\n callbacks: {\n handleCancelSearchChange: this._handleCancelSearchChange,\n handleCancelSearchFocused: this._handleCancelSearchFocused\n },\n isSearchFormExpanded: this.state.isSearchFormExpanded,\n isLoadingAutoSuggest,\n isLoadingNode: this._isLoadingNode()\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n private _initSuggestionTypes() {\n const suggestionTypes = this.props.config.suggestionTypeCriterion;\n\n const suggestions = ArrayExtensions.unique(ArrayExtensions.validValues(suggestionTypes));\n if (!ArrayExtensions.hasElements(suggestions)) {\n this.inputSuggestionType = [\n { SuggestionType: SuggestionTypeCriterionSuggestionType.keyword },\n { SuggestionType: SuggestionTypeCriterionSuggestionType.product },\n { SuggestionType: SuggestionTypeCriterionSuggestionType.scopedCategory }\n ];\n return;\n }\n\n const validSuggestions = suggestions.filter(suggestion => suggestion.SuggestionType);\n if (ArrayExtensions.hasElements(validSuggestions)) {\n this.inputSuggestionType = validSuggestions;\n return;\n }\n\n this.inputSuggestionType = [];\n }\n\n /**\n * Function to create the ReactNode for loading Autosuggest result.\n * @returns ReachNode for loading Autosuggest result.\n */\n private readonly _isLoadingNode = (): React.ReactNode => {\n const loadingText = this.props.resources.autoSuggestResultLoadingMessage;\n return ;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private readonly _focusOutTarget = (e: any): void => {\n const { suggestions } = this.state;\n\n if (suggestions && suggestions.AllSearchResults && e.target.closest('.ms-search') === null) {\n this._clearAutoSuggestState();\n }\n };\n\n private readonly _keyup = (e: KeyboardEvent): void => {\n const { suggestions } = this.state;\n\n if (suggestions && suggestions.AllSearchResults && e.keyCode === KeyCodes.Escape) {\n this._clearAutoSuggestState();\n } else if (this.state.isSearchFormExpanded && e.keyCode === KeyCodes.Escape) {\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n\n if (\n !(\n (this.formReference.current && this.formReference.current.contains((e.target as unknown) as Node)) ||\n (this.autoSuggestResultDiv.current && this.autoSuggestResultDiv.current.contains((e.target as unknown) as Node))\n )\n ) {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n\n if (this.state.isSearchFormExpanded) {\n this.setState({ isSearchFormExpanded: false });\n }\n }\n };\n\n private readonly _clearAutoSuggestState = (): void => {\n const {\n context: { actionContext },\n data: { searchState }\n } = this.props;\n\n if (this.searchTextInput.current && this.searchTextInput.current.value.length > 0) {\n searchState.searchText = '';\n searchState.defaultBasicSearchUrl = '';\n searchState.searchQueryStringParameter = '';\n actionContext ? actionContext.update(createSearchStateInput(searchState), searchState) : null;\n this.searchTextInput.current.value = '';\n }\n\n this.setState({ searchText: '', suggestions: undefined, searchRefiners: undefined });\n };\n\n private async _getSearchSuggestions(loadSuggestionsRequestId: string, query: string) {\n try {\n const searchSuggestions = await getSearchSuggestionsAction(\n new AutoSuggestInput(query, this.topResultsCount, this._getSuggestionType(), this.hitPrefix, this.hitSuffix),\n this.props.context.actionContext\n );\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return undefined;\n }\n return searchSuggestions;\n } catch (error) {\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return undefined;\n }\n this.setState({ suggestions: undefined, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount() });\n this.props.telemetry.exception(error);\n this.props.telemetry.debug('Unable to get auto suggest results');\n return undefined;\n }\n }\n\n private async _updateSearchRefiners(loadSuggestionsRequestId: string, query: string, suggestions: Autosuggestions | undefined) {\n try {\n const refiners = await this._getSearchRefiners(query);\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return;\n }\n this.setState({\n suggestions,\n searchRefiners: refiners,\n autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions),\n isLoadingAutoSuggest: false\n });\n } catch (error) {\n if (loadSuggestionsRequestId !== this.loadSuggestionsRequestId) {\n return;\n }\n this.setState({ suggestions, searchRefiners: undefined, autoSuggestAriaLabel: this._setAutoSuggestResultCount(suggestions) });\n this.props.telemetry.exception(error);\n this.props.telemetry.debug('Unable to get refiners results');\n }\n }\n\n private _loadSuggestions(query: string) {\n this.cancellabelDebounce = debounce(async () => {\n this.setState({ isLoadingAutoSuggest: true });\n const loadSuggestionsRequestId = Random.Guid.generateGuid();\n this.loadSuggestionsRequestId = loadSuggestionsRequestId;\n const searchSuggestions = await this._getSearchSuggestions(loadSuggestionsRequestId, query);\n await this._updateSearchRefiners(loadSuggestionsRequestId, query, searchSuggestions);\n }, this.waitTime);\n\n setTimeout(() => {\n this.cancellabelDebounce();\n }, 0);\n }\n\n private readonly _handleInputChange = (query: string): void => {\n if (!query || query.length <= this.maxChars) {\n this.setState({ searchText: query });\n }\n\n if (this.cancellabelDebounce) {\n this.cancellabelDebounce.cancel();\n }\n\n const {\n context,\n data: { searchState }\n } = this.props;\n\n if (context) {\n if (query && query.length > 0) {\n if (query.length > this.maxChars) {\n return;\n }\n\n if (ArrayExtensions.hasElements(this.inputSuggestionType)) {\n this._loadSuggestions(query);\n }\n\n searchState.searchText = query;\n } else {\n this.setState({ suggestions: undefined, searchRefiners: undefined });\n searchState.searchText = '';\n }\n context.actionContext.update(createSearchStateInput(searchState), searchState);\n }\n };\n\n private _getSuggestionType(): string {\n const distinctSuggestionTypes: string[] = this.inputSuggestionType.map(\n suggestionTypeItem => suggestionTypeItem.SuggestionType!.charAt(0).toUpperCase() + suggestionTypeItem.SuggestionType!.slice(1)\n );\n return distinctSuggestionTypes.join(',');\n }\n\n private async _getSearchRefiners(searchText: string): Promise {\n const { actionContext: ctx } = this.props.context;\n const catalogId = getCatalogId(ctx.requestContext);\n return ProductsDataActions.getProductSearchRefinersAsync(\n { callerContext: ctx },\n {\n SearchCondition: searchText,\n Context: {\n ChannelId: +ctx.requestContext.apiSettings.channelId,\n CatalogId: catalogId\n }\n }\n );\n }\n\n private readonly _handleSubmit = (\n e: React.MouseEvent | React.KeyboardEvent | React.FormEvent\n ): void => {\n const {\n config: { disableSubmitSearch },\n context: {\n actionContext,\n app: {\n config: { searchQueryStringParameter }\n }\n }\n } = this.props;\n\n const query = this.searchTextInput.current && this.searchTextInput.current.value;\n e.preventDefault();\n\n if (!query || (query && query.length === 0) || disableSubmitSearch) {\n this.searchTextInput && this.searchTextInput.current && this.searchTextInput.current.focus();\n } else {\n const searchQsp = searchQueryStringParameter || 'q';\n const searchURL = this._appendQueryParams(getUrlSync('search', actionContext) || '', query, searchQsp);\n document.location.href = searchURL;\n }\n };\n\n private readonly _handleCancelSearchChange = (): void => {\n const { isSearchFormExpanded, suggestions } = this.state;\n\n if (!isSearchFormExpanded) {\n this.setState({\n isSearchFormExpanded: true,\n searchText: '',\n isInitialState: false\n });\n } else {\n if (suggestions && suggestions.AllSearchResults) {\n this._clearAutoSuggestState();\n }\n this.setState({ isSearchFormExpanded: false });\n }\n };\n\n private readonly _handleCancelSearchFocused = (): void => {\n const { suggestions } = this.state;\n if (!(suggestions && suggestions.AllSearchResults)) {\n this._clearAutoSuggestState();\n this.setState({ isSearchFormExpanded: false });\n }\n };\n\n private readonly _appendQueryParams = (route: string, query: string, qsp: string): string => {\n if (!MsDyn365.isBrowser) {\n return '';\n }\n\n const queryUrl = new URL(route, window.location.href);\n if (qsp && query) {\n queryUrl.searchParams.set(qsp, query);\n }\n\n return queryUrl.href;\n };\n\n private readonly _setAutoSuggestResultCount = (result?: Autosuggestions) => {\n if (this.autoSuggestResultScreenReaderDiv.current !== null) {\n const ariaLiveRegion = this.autoSuggestResultScreenReaderDiv.current;\n const suggestResultString = this.props.resources.autoSuggestFoundMessage;\n const emptyResultString = this.props.resources.noAutoSuggestionMessage;\n ariaLiveRegion.innerText =\n result && result.AllSearchResults && result.AllSearchResults.length > 0 ? suggestResultString : emptyResultString;\n ariaLiveRegion.setAttribute('aria-live', 'assertive');\n return ariaLiveRegion.innerText;\n }\n return '';\n };\n}\n\nexport default Search;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps, Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ISearchCategoryViewProps, ISearchFormViewProps, ISearchKeywordViewProps, ISearchProductViewProps } from './components';\nimport { ISearchViewProps } from './search';\n\nconst SearchView: React.FC = props => {\n const {\n Search,\n AutoSuggestAriaLabel,\n AutoSuggestAriaLabelText,\n searchText,\n AutoSuggest,\n KeywordSuggest,\n ProductSuggest,\n CategorySuggest,\n UlKeyword,\n UlProduct,\n UlCategory,\n form,\n autosuggestCategory,\n autosuggestKeyword,\n autosuggestProduct,\n SearchForm,\n FormWrapper,\n label,\n isLoadingAutoSuggest,\n isLoadingNode\n } = props;\n\n return (\n \n {label}\n {_renderForm(form as ISearchFormViewProps, SearchForm, FormWrapper)}\n \n {searchText && searchText.length > 0 ? {AutoSuggestAriaLabelText} : ''}\n {_renderKeywordSuggestions(KeywordSuggest, UlKeyword, autosuggestKeyword, isLoadingAutoSuggest, isLoadingNode)}\n {_renderProductSuggestions(ProductSuggest, UlProduct, autosuggestProduct, isLoadingAutoSuggest, isLoadingNode)}\n {_renderCategorySuggestions(CategorySuggest, UlCategory, autosuggestCategory, isLoadingAutoSuggest, isLoadingNode)}\n \n \n );\n};\n\nconst _renderForm = (form: ISearchFormViewProps, SearchForm: INodeProps, FormWrapper: INodeProps) => {\n return (\n \n \n {form.input}\n {form.cancelBtn}\n {form.submitBtn}\n \n \n );\n};\n\nconst _renderKeywordSuggestions = (\n KeywordSuggest: INodeProps,\n UlKeyword: INodeProps,\n keywordSuggestions?: ISearchKeywordViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n keywordSuggestions && (\n \n \n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n keywordSuggestions.text.map(text => {\n return text;\n })}\n \n \n )\n );\n};\n\nconst _renderProductSuggestions = (\n ProductSuggest: INodeProps,\n UlProduct: INodeProps,\n productSuggestions?: ISearchProductViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n productSuggestions && (\n \n \n {productSuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n productSuggestions.items.map((item, index) => {\n return (\n \n \n {item.thumbnail}\n {item.text}\n {item.price}\n \n \n );\n })}\n \n \n )\n );\n};\n\nconst _renderCategorySuggestions = (\n CategorySuggest: INodeProps,\n UlCategory: INodeProps,\n categorySuggestions?: ISearchCategoryViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n) => {\n return (\n categorySuggestions && (\n \n \n {categorySuggestions.title}\n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n categorySuggestions.text.map(text => {\n return text;\n })}\n \n \n )\n );\n};\n\nexport default SearchView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ISearchData, ISearchViewProps } from '@msdyn365-commerce-modules/search';\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\n\n/**\n * Render Categories heading.\n * @param inCategoriesHeading - The Keywords result heading.\n * @returns The JSX Element.\n */\nconst renderCategorySuggestionsTitle = (inCategoriesHeading: string): JSX.Element => {\n const categoryAutoSuggestionHeading = inCategoriesHeading ? inCategoriesHeading : 'In categories';\n\n return
    {categoryAutoSuggestionHeading}
    ;\n};\n\n/**\n * Render Categories suggestion result.\n * @param inCategoriesHeading - The Categories result heading.\n * @param noResultText - The \"No Result\" text.\n * @param props - The Categories suggestion result.\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\n * @param isLoadingNode - The autosuggestion loading node.\n * @returns The JSX Element.\n */\nexport const CategorySuggestionsComponent = (\n inCategoriesHeading: string,\n noResultText: string,\n props: ISearchViewProps & ISearchProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n): JSX.Element => {\n return props.autosuggestCategory ? (\n \n {renderCategorySuggestionsTitle(inCategoriesHeading)}\n \n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n props.autosuggestCategory.text.map(text => {\n return text;\n })}\n \n \n ) : (\n \n {renderCategorySuggestionsTitle(inCategoriesHeading)}\n \n
  • {noResultText}
  • \n
    \n
    \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageData, Image } from '@msdyn365-commerce/core';\nimport { ISearchData } from '@msdyn365-commerce-modules/search';\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\n\n/**\n * Render Products Suggestion result heading.\n * @param props -The props.\n * @returns The JSX Element.\n */\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\n if (!noSearchResultImage || !noSearchResultImage.src) {\n return null;\n }\n const imageSettings = {\n lazyload: true,\n viewports: {\n xs: { w: 100, h: 100, q: 'w=100&h=100&q=60&m=6' }\n }\n };\n return (\n \n );\n};\n\n/**\n * Render Product suggestion result.\n * @param props -The props.\n * @returns The JSX Element.\n */\nexport const MobileAutoSuggestEmptyComponent = (props: ISearchProps): JSX.Element => {\n return (\n \n
    {renderProductNotFoundResultsImage(props)}
    \n
    \n
    {props.resources.emptyMobileSearchTextHeading}
    \n
    {props.resources.emptyMobileSearchText}
    \n
    \n
    \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ISearchData, ISearchFormViewProps } from '@msdyn365-commerce-modules/search';\nimport { Button, INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\nimport { MobileAutoSuggestEmptyComponent } from './search.mobile.empty';\n\n/**\n * Render Clear button for mobile viewport.\n * @param clearSearchButtonText -The Clear button text.\n * @param clearSearch -Clear Search callback.\n * @returns -The JSX Element.\n */\nconst renderClearButton = (clearSearchButtonText: string, clearSearch: () => void): JSX.Element => {\n return (\n \n );\n};\n\n/**\n * Render Search form.\n * @param form -Form view props.\n * @param searchForm -Search Form props.\n * @param formWrapper -Form Wrapper props.\n * @param isMobile -Is mobile viewport flag.\n * @param clearSearchButtonText -The Clear button text.\n * @param props -The props for resource.\n * @param isSearchText -Is SearchText flag for input text.\n * @param clearSearch -Clear Search callback.\n * @returns -The JSX Element.\n */\nexport const FormComponent = (\n form: ISearchFormViewProps,\n searchForm: INodeProps,\n formWrapper: INodeProps,\n isMobile: boolean,\n clearSearchButtonText: string,\n props: ISearchProps,\n isSearchText: boolean,\n clearSearch: () => void\n): JSX.Element => {\n const cancelButtonNode = (\n \n );\n\n return isMobile ? (\n \n {form.cancelBtn}\n \n {form.input}\n {isSearchText && renderClearButton(clearSearchButtonText, clearSearch)}\n {!isSearchText ? MobileAutoSuggestEmptyComponent(props) : null}\n \n \n ) : (\n \n \n {form.submitBtn}\n {form.input}\n {isSearchText && cancelButtonNode}\n \n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ISearchKeywordViewProps } from '@msdyn365-commerce-modules/search';\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Render keywords heading.\n * @param keywordsHeading -The Keywords result heading.\n * @returns The JSX Element.\n */\nconst renderKeywordSuggestionsTitle = (keywordsHeading: string): JSX.Element => {\n const categoryAutoSuggestionHeading = keywordsHeading ? keywordsHeading : 'Keywords';\n\n return
    {categoryAutoSuggestionHeading}
    ;\n};\n\n/**\n * Render keywords reults.\n * @param keywordSuggest -The Keywords suggest Node props.\n * @param ulKeyword -The List Node props.\n * @param keywordsHeading -The Keywords result heading.\n * @param noResultText -The \"No Result\" text.\n * @param keywordSuggestions -The Keywords suggestion result.\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\n * @param isLoadingNode - The autosuggestion loading node.\n * @returns -The JSX Element.\n */\nexport const KeywordSuggestionsComponent = (\n keywordSuggest: INodeProps,\n ulKeyword: INodeProps,\n keywordsHeading: string,\n noResultText: string,\n keywordSuggestions?: ISearchKeywordViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n): JSX.Element => {\n return keywordSuggestions ? (\n \n {renderKeywordSuggestionsTitle(keywordsHeading)}\n \n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n keywordSuggestions.text.map(text => {\n return text;\n })}\n \n \n ) : (\n \n {renderKeywordSuggestionsTitle(keywordsHeading)}\n \n
  • {noResultText}
  • \n
    \n
    \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageData, Image } from '@msdyn365-commerce/core';\nimport { ISearchData, ISearchProductViewProps } from '@msdyn365-commerce-modules/search';\nimport { INodeProps, Node } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { ISearchProps } from '../../definition-extensions/search.ext.props.autogenerated';\n\n/**\n * Render Products Suggestion result heading.\n * @param productSuggestionsHeading -The products suggestion result heading.\n * @returns The JSX Element.\n */\nconst renderProductSuggestionsTitle = (productSuggestionsHeading: string): JSX.Element => {\n const productAutoSuggestionHeading = productSuggestionsHeading ? productSuggestionsHeading : 'Products';\n\n return
    {productAutoSuggestionHeading}
    ;\n};\n\n/**\n * Render Products Suggestion result heading.\n * @param props -The props.\n * @returns The JSX Element.\n */\nconst renderProductNotFoundResultsImage = (props: ISearchProps): JSX.Element | null => {\n const noSearchResultImage: IImageData | undefined = props.config.noSearchResultImage;\n if (!noSearchResultImage || !noSearchResultImage.src) {\n return null;\n }\n return (\n \n );\n};\n\n/**\n * Render Products No result section.\n * @param props -The props.\n * @returns The JSX Element.\n */\nconst renderProductNotFoundResults = (props: ISearchProps): JSX.Element => {\n return (\n \n
    {renderProductNotFoundResultsImage(props)}
    \n
    {props.resources.noResultContentHeadingText}
    \n
    \n {props.resources.noResultContentParagraphText}\n
    \n
    \n );\n};\n\n/**\n * Render Product suggestion result.\n * @param productSuggest -The product suggest Node props.\n * @param ulProduct -The List Node props.\n * @param props -The props.\n * @param productSuggestions -The Product suggestion result.\n * @param isLoadingAutoSuggest - The autosuggestion loading flag.\n * @param isLoadingNode - The autosuggestion loading node.\n * @returns The JSX Element.\n */\nexport const ProductSuggestionsComponent = (\n productSuggest: INodeProps,\n ulProduct: INodeProps,\n props: ISearchProps,\n productSuggestions?: ISearchProductViewProps,\n isLoadingAutoSuggest?: boolean,\n isLoadingNode?: React.ReactNode\n): JSX.Element => {\n const liProduct: INodeProps = {\n tag: 'li',\n className: 'msc-no-result-content'\n };\n return productSuggestions ? (\n \n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\n \n {isLoadingAutoSuggest && isLoadingNode}\n {!isLoadingAutoSuggest &&\n productSuggestions.items.map((item, index) => {\n return (\n \n \n {item.thumbnail}\n {item.text}\n {item.price}\n \n \n );\n })}\n \n \n ) : (\n \n {renderProductSuggestionsTitle(props.resources.productSuggestionHeading)}\n \n {renderProductNotFoundResults(props)}\n \n \n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { ISearchData, ISearchFormViewProps, ISearchViewProps } from '@msdyn365-commerce-modules/search';\nimport { Button, format, isMobile, Module, Node, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport React, { useCallback, useEffect, useState } from 'react';\n\nimport { ISearchProps } from '../definition-extensions/search.ext.props.autogenerated';\nimport { CategorySuggestionsComponent } from './components/search.categorysuggest';\nimport { FormComponent } from './components/search.form';\nimport { KeywordSuggestionsComponent } from './components/search.keywordsuggest';\nimport { ProductSuggestionsComponent } from './components/search.productsuggest';\n\n/**\n * Render Title for AutoSuggest.\n * @param searchSuggestionHeading -The heading resource string.\n * @param searchText -The search string.\n * @returns -The JSX Element.\n */\nconst renderTitle = (searchSuggestionHeading: string, searchText: string): JSX.Element => {\n const searchTextString = '\"'.concat(searchText.concat('\"'));\n const searchAutoSuggestionHeading = searchSuggestionHeading\n ? format(searchSuggestionHeading, searchTextString)\n : `Search for ${searchTextString}`;\n\n return {searchAutoSuggestionHeading};\n};\n\n/**\n * Search View.\n * @param props - The view props.\n * @returns The JSX Element.\n */\nconst SearchView: React.FC> = (\n props: ISearchViewProps & ISearchProps\n): JSX.Element => {\n const {\n Search,\n AutoSuggestAriaLabel,\n AutoSuggestAriaLabelText,\n searchText,\n AutoSuggest,\n KeywordSuggest,\n ProductSuggest,\n UlKeyword,\n UlProduct,\n form,\n autosuggestKeyword,\n autosuggestProduct,\n SearchForm,\n FormWrapper,\n label,\n context,\n isLoadingAutoSuggest,\n isLoadingNode,\n callbacks: { handleCancelSearchFocused }\n } = props;\n\n const { searchSuggestionHeading, categorySuggestionHeading, keywordsHeading, noResultText, clearSearchButtonText } = props.resources;\n\n const [searchTextString, setSearchTextString] = useState();\n const [isMobilePort, setIsMobile] = useState(false);\n\n useEffect(() => {\n setSearchTextString(searchText);\n }, [searchText]);\n\n /**\n * ClearSearch callback method to clear search string.\n */\n const clearSearch = (): void => {\n setSearchTextString('');\n\n const propsForm = props.form as ISearchFormViewProps;\n const propsFormInput = propsForm.input as React.DetailedHTMLProps, HTMLInputElement>;\n const propsFormInputCurrent = (propsFormInput.ref as React.RefObject).current;\n\n if (propsFormInputCurrent) {\n propsFormInputCurrent.value = '';\n }\n\n propsFormInput.value = '';\n props.searchText = '';\n props.FormWrapper.action = '';\n };\n\n const isMobileViewport = useCallback(() => {\n const isMobileView = isMobile({ variant: VariantType.Browser, context: context.request }) === 'xs';\n setIsMobile(isMobileView);\n }, [context]);\n\n useEffect(() => {\n window.addEventListener('resize', isMobileViewport);\n isMobileViewport();\n }, [isMobileViewport]);\n\n const viewport = isMobile({ variant: VariantType.Browser, context: context.request });\n\n const isMobileView = viewport === 'sm' || viewport === 'xs';\n\n AutoSuggest.className = !StringExtensions.isNullOrEmpty(searchTextString)\n ? `${AutoSuggest.className} show`\n : `${AutoSuggest.className} hide`;\n const isSearchText: boolean = !StringExtensions.isNullOrEmpty(searchTextString);\n\n return (\n \n {label}\n {FormComponent(\n form as ISearchFormViewProps,\n SearchForm,\n FormWrapper,\n isMobilePort,\n clearSearchButtonText,\n props,\n isSearchText,\n clearSearch\n )}\n {!isMobileView && (\n \n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\n {AutoSuggestAriaLabelText}\n ) : (\n ''\n )}\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\n <>\n \n \n {renderTitle(searchSuggestionHeading, searchText)}\n \n \n \n {CategorySuggestionsComponent(\n categorySuggestionHeading,\n noResultText,\n props,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n {KeywordSuggestionsComponent(\n KeywordSuggest,\n UlKeyword,\n keywordsHeading,\n noResultText,\n autosuggestKeyword,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n \n {ProductSuggestionsComponent(\n ProductSuggest,\n UlProduct,\n props,\n autosuggestProduct,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n \n \n ) : null}\n \n )}\n {isMobileView && props.isSearchFormExpanded && (\n \n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\n {AutoSuggestAriaLabelText}\n ) : (\n ''\n )}\n {!StringExtensions.isNullOrEmpty(searchTextString) ? (\n <>\n \n {(form as ISearchFormViewProps).cancelBtn}\n {renderTitle(searchSuggestionHeading, searchText)}\n \n \n \n {CategorySuggestionsComponent(\n categorySuggestionHeading,\n noResultText,\n props,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n {KeywordSuggestionsComponent(\n KeywordSuggest,\n UlKeyword,\n keywordsHeading,\n noResultText,\n autosuggestKeyword,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n \n {ProductSuggestionsComponent(\n ProductSuggest,\n UlProduct,\n props,\n autosuggestProduct,\n isLoadingAutoSuggest,\n isLoadingNode\n )}\n \n \n ) : null}\n \n )}\n \n );\n};\nexport default SearchView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["_getCatogaoryImage","props","image","setImage","React","searchText","length","url","replace","toLowerCase","xhr","XMLHttpRequest","onload","status","open","send","style","display","src","_renderForm","form","SearchForm","FormWrapper","Node","submitBtn","input","_renderKeywordSuggestions","KeywordSuggest","UlKeyword","keywordSuggestions","text","map","_renderProductSuggestions","ProductSuggest","UlProduct","productSuggestions","title","items","item","index","LiProduct","key","id","AProduct","thumbnail","price","_renderCategorySuggestions","CategorySuggest","UlCategory","categorySuggestions","Search","AutoSuggestAriaLabel","AutoSuggestAriaLabelText","AutoSuggest","autosuggestCategory","autosuggestKeyword","autosuggestProduct","label","Module","className","binding","modules","dataActions","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","registerSanitizedActionPath","window","__bindings__","viewDictionary","cn","createSearchStateInput","result","GenericInput","getGenericActionDataAction","createObservableDataAction","action","getGenericAction","inputData","SearchState","__decorate","observable","SuggestionType","AutoSuggestInput","constructor","top","suggestionType","hitPrefix","hitSuffix","getCacheKey","getCacheObjectType","dataCacheType","this","searchQuery","topResultsCount","async","_getAutoSuggest","autosuggest","ctx","catalogId","getCatalogId","requestContext","searchCriteria","ProductSearchCriteria","SearchCondition","Context","ChannelId","apiSettings","channelId","CatalogId","HitPrefix","HitSuffix","searchSuggestions","getSearchSuggestionsAsync","callerContext","queryResultSettings","Paging","Top","ImageUrl","generateImageUrl","AllSearchResults","telemetry","error","autoSuggestPromises","Promise","all","then","payLoad","CategorySuggestionsComponent","suggestions","autoSuggestProps","resources","categorySuggestionHeading","reactNodes","getPayloadObject","telemetryContent","push","_assembleNode","_renderTitle","categoryAutoSuggestionHeading","format","shouldShowFullPath","splitValue","Value","split","pop","ariaLabel","RegExp","contentAction","etext","attribute","getTelemetryAttributes","Id","href","_generateLink","_getHighlightedText","suggestion","_getCategoryLink","searchPageURL","searchQsp","searchRefiners","MsDyn365","isBrowser","queryUrl","URL","location","searchParams","set","categoryRefiners","find","refiners","SourceValue","ProductRefinerSource","Category","refiner","Values","RefinerRecordId","Number","parseInt","encodedRefiner","JSON","stringify","compressRefiners","formattedText","dangerouslySetInnerHTML","getRichTextHtml","compressedRefinerKeys","compressedRefiners","forEach","compressedRefiner","refinerKey","FormComponent","searchPlaceholder","hideSearchLabel","searchTextInput","handleInputChange","maxChars","disableSubmitSearch","handleCancelSearchChange","query","ariaLabelCancel","ariaLabelSearch","ariaLabelSubmit","onInputChange","event","target","value","onInputChangeFunction","inputNode","type","placeholder","ref","onChange","maxLength","submitBtnNode","Button","cancelBtn","onClick","KeywordSuggestionsComponent","formattedLink","LabelComponent","searchLabelClass","searchLabelArialLabel","isSearchFormExpanded","searchtext","searchCollapsedLabel","attributes","innerRef","ProductSuggestionsComponent","context","actionContext","productSuggestionHeading","moduleType","moduleId","productAutoSuggestionHeading","altText","Value3","DecimalValue","_renderThumbnail","ObjectExtensions","isNullOrUndefined","_renderPrice","_getLiWrapper","_getAWrapper","tag","recid","cultureFormatter","formatCurrency","getProductPageUrlSync","undefined","adjustedPrice","basePrice","PriceComponent","typeName","data","CustomerContextualPrice","BasePrice","freePriceText","request","gridSettings","config","imageSettings","cropFocalRegion","Image","viewports","xs","q","w","h","lg","xl","lazyload","loadFailureBehavior","super","waitTime","_isLoadingNode","loadingText","autoSuggestResultLoadingMessage","Spinner","size","SpinnerSize","medium","labelPosition","_focusOutTarget","e","state","closest","_clearAutoSuggestState","_keyup","keyCode","KeyCodes","Escape","setState","formReference","current","contains","autoSuggestResultDiv","searchState","defaultBasicSearchUrl","searchQueryStringParameter","update","_handleInputChange","cancellabelDebounce","cancel","ArrayExtensions","hasElements","inputSuggestionType","_loadSuggestions","_handleSubmit","app","preventDefault","focus","searchURL","_appendQueryParams","getUrlSync","document","_handleCancelSearchChange","isInitialState","_handleCancelSearchFocused","route","qsp","_setAutoSuggestResultCount","autoSuggestResultScreenReaderDiv","ariaLiveRegion","suggestResultString","autoSuggestFoundMessage","emptyResultString","noAutoSuggestionMessage","innerText","setAttribute","searchKeywordSuggestClass","searchProductSuggestClass","searchCategorySuggestClass","autoSuggestAriaLabel","isLoadingAutoSuggest","searchInputMaxLength","searchFormClass","getTelemetryObject","telemetryPageName","friendlyName","_initSuggestionTypes","body","addEventListener","componentWillUnmount","removeEventListener","componentDidUpdate","params","isEditor","shouldComponentUpdate","nextProps","nextState","render","cancelBtnAriaLabel","searchBtnAriaLabel","submitBtnAriaLabel","searchplaceholderText","shouldShowFullCategoryPath","filter","Keyword","None","Product","viewProps","moduleProps","classnames","role","autoComplete","onSubmit","callbacks","handleCancelSearchFocused","isLoadingNode","renderView","suggestionTypes","suggestionTypeCriterion","unique","validValues","validSuggestions","loadSuggestionsRequestId","getSearchSuggestionsAction","_getSuggestionType","exception","debug","_getSearchRefiners","Random","Guid","generateGuid","_getSearchSuggestions","_updateSearchRefiners","setTimeout","suggestionTypeItem","charAt","toUpperCase","slice","join","ProductsDataActions","renderCategorySuggestionsTitle","inCategoriesHeading","noResultText","MobileAutoSuggestEmptyComponent","noSearchResultImage","renderProductNotFoundResultsImage","emptyMobileSearchTextHeading","emptyMobileSearchText","searchForm","formWrapper","isMobile","clearSearchButtonText","isSearchText","clearSearch","cancelButtonNode","renderClearButton","renderKeywordSuggestionsTitle","keywordsHeading","keywordSuggest","ulKeyword","renderProductSuggestionsTitle","productSuggestionsHeading","renderProductNotFoundResults","noResultContentHeadingText","noResultContentParagraphText","productSuggest","ulProduct","renderTitle","searchSuggestionHeading","searchTextString","concat","searchAutoSuggestionHeading","setSearchTextString","useState","isMobilePort","setIsMobile","useEffect","propsFormInput","propsFormInputCurrent","isMobileViewport","useCallback","isMobileView","variant","VariantType","Browser","viewport","StringExtensions","isNullOrEmpty","onBlur","module","exports","ReactDOM"],"sourceRoot":""}