{"version":3,"sources":["webpack:///./node_modules/react-instantsearch-core/dist/es/core/highlight.js","webpack:///./node_modules/events/events.js","webpack:///./node_modules/algoliasearch-helper/src/requestBuilder.js","webpack:///./node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack:///./node_modules/react-autosuggest/dist/index.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectSearchBox.js","webpack:///./node_modules/react-themeable/dist/index.js","webpack:///./node_modules/react-autosuggest/dist/theme.js","webpack:///./node_modules/algoliasearch-helper/src/version.js","webpack:///./node_modules/algoliasearch-helper/src/algoliasearch.helper.js","webpack:///./node_modules/section-iterator/dist/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/formatSort.js","webpack:///./node_modules/react-autosuggest/dist/Autosuggest.js","webpack:///./node_modules/algoliasearch/dist/algoliasearch-lite.umd.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/utils.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack:///./node_modules/algoliasearch-helper/src/functions/merge.js","webpack:///./node_modules/algoliasearch-helper/src/functions/find.js","webpack:///./node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","webpack:///./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/esm/inherits.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Highlighter.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Highlight.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/core/utils.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Highlight.js","webpack:///./node_modules/algoliasearch-helper/src/DerivedHelper/index.js","webpack:///./node_modules/algoliasearch-helper/index.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createConnector.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createInstantSearchManager.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/version.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createWidgetsManager.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createStore.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/metadata.js","webpack:///./node_modules/react-instantsearch-core/dist/es/widgets/InstantSearch.js","webpack:///./node_modules/react-autosuggest/dist/SectionTitle.js","webpack:///./node_modules/algoliasearch-helper/src/functions/inherits.js","webpack:///./node_modules/react-autosuggest/dist/Item.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/algoliasearch-helper/src/SearchParameters/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/intersection.js","webpack:///./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/indexUtils.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectHits.js","webpack:///./node_modules/react-autosuggest/dist/Autowhatever.js","webpack:///./node_modules/algoliasearch-helper/src/utils/isValidUserToken.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectConfigure.js","webpack:///./node_modules/react-instantsearch-core/dist/es/widgets/Configure.js","webpack:///./node_modules/algoliasearch-helper/src/functions/compact.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectHighlight.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectAutoComplete.js","webpack:///./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack:///./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","webpack:///./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack:///./node_modules/algoliasearch-helper/src/functions/defaultsPure.js","webpack:///./node_modules/algoliasearch-helper/src/SearchResults/generate-hierarchical-tree.js","webpack:///./node_modules/algoliasearch-helper/src/functions/valToNumber.js","webpack:///./node_modules/algoliasearch-helper/src/functions/findIndex.js","webpack:///./node_modules/algoliasearch-helper/src/functions/omit.js","webpack:///./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/context.js","webpack:///./node_modules/algoliasearch-helper/src/SearchResults/index.js","webpack:///./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:///./node_modules/shallow-equal/arrays/index.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/react-autosuggest/dist/ItemList.js","webpack:///./node_modules/algoliasearch-helper/src/functions/orderBy.js","webpack:///./node_modules/react-autosuggest/dist/compareObjects.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"],"names":["HIGHLIGHT_TAGS","highlightPreTag","highlightPostTag","parseHighlightedAttribute","_ref","preTag","postTag","_ref$highlightedValue","highlightedValue","splitByPreTag","split","firstValue","shift","elements","value","isHighlighted","forEach","push","splitByPostTag","parseAlgoliaHit","_ref2","_ref2$preTag","_ref2$postTag","highlightProperty","attribute","hit","Error","highlightObject","Array","isArray","map","item","ReflectOwnKeys","R","Reflect","ReflectApply","apply","target","receiver","args","Function","prototype","call","ownKeys","Object","getOwnPropertySymbols","getOwnPropertyNames","concat","NumberIsNaN","Number","isNaN","EventEmitter","init","this","module","exports","once","emitter","name","Promise","resolve","reject","errorListener","err","removeListener","resolver","slice","arguments","eventTargetAgnosticAddListener","handler","flags","on","addErrorHandlerIfEventEmitter","_events","undefined","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","listener","TypeError","_getMaxListeners","that","_addListener","type","prepend","m","events","existing","warning","create","newListener","emit","unshift","length","warned","w","String","count","console","warn","onceWrapper","fired","wrapFn","_onceWrap","state","wrapped","bind","_listeners","unwrap","evlistener","arr","ret","i","unwrapListeners","arrayClone","listenerCount","n","copy","addEventListener","wrapListener","arg","removeEventListener","defineProperty","enumerable","get","set","RangeError","getPrototypeOf","setMaxListeners","getMaxListeners","doError","error","er","message","context","len","listeners","addListener","prependListener","prependOnceListener","list","position","originalListener","index","pop","spliceOne","off","removeAllListeners","key","keys","rawListeners","eventNames","merge","requestBuilder","_getQueries","queries","indexName","params","_getHitsSearchParams","getRefinedDisjunctiveFacets","refinedFacet","_getDisjunctiveFacetSearchParams","getRefinedHierarchicalFacets","hierarchicalFacet","getHierarchicalFacetByName","currentRefinement","getHierarchicalRefinement","separator","_getHierarchicalFacetSeparator","facets","disjunctiveFacets","_getHitsHierarchicalFacetsAttributes","facetFilters","_getFacetFilters","numericFilters","_getNumericFilters","tagFilters","_getTagFilters","additionalParams","indexOf","getQueryParams","facet","hierarchicalRootLevel","hitsPerPage","page","attributesToRetrieve","attributesToHighlight","attributesToSnippet","analytics","clickAnalytics","_getDisjunctiveHierarchicalFacetAttribute","facetName","numericRefinements","operators","operator","values","vs","v","tagRefinements","join","facetsRefinements","facetValue","facetsExcludes","disjunctiveFacetsRefinements","facetValues","orFilters","hierarchicalFacetsRefinements","attributeToRefine","attributesIndex","rootPath","_getHierarchicalRootPath","lastIndexOf","attributes","hierarchicalFacets","reduce","allAttributes","hierarchicalRefinement","level","newAttributes","rootLevel","attributeIndex","parentLevel","getSearchForFacetQuery","query","maxFacetHits","stateForSearchForFacetValues","isDisjunctiveFacet","clearRefinements","searchForFacetSearchParameters","facetQuery","_classCallCheck","instance","Constructor","getCurrentRefinement","props","searchState","_refine","nextRefinement","nextValue","displayName","propTypes","defaultRefinement","string","getProvidedProps","searchResults","ais","contextValue","multiIndexContext","indexContextValue","isSearchStalled","refine","cleanUp","_cleanUp","getSearchParameters","searchParameters","setQuery","getMetadata","id","items","label","nextState","_slicedToArray","Symbol","iterator","_arr","_n","_d","_e","_s","_i","next","done","sliceIterator","_toConsumableArray","arr2","from","obj","_objectAssign","_objectAssign2","__esModule","truthy","x","input","theme","classNameDecorator","_len","names","_key","styles","filter","className","style","mapToAutowhateverTheme","defaultTheme","container","containerOpen","inputOpen","inputFocused","suggestionsContainer","suggestionsContainerOpen","suggestionsList","suggestion","suggestionFirst","suggestionHighlighted","sectionContainer","sectionContainerFirst","sectionTitle","result","SearchParameters","SearchResults","DerivedHelper","inherits","objectHasKeys","omit","version","AlgoliaSearchHelper","client","options","addAlgoliaAgent","setClient","opts","make","lastResults","_queryId","_lastQueryIdReceived","derivedHelpers","_currentNbQueries","setCurrentPage","_change","setPage","isPageReset","getCurrentPage","search","_search","onlyWithDerivedHelpers","searchOnlyWithDerivedHelpers","getQuery","searchOnce","cb","tempState","setQueryParameters","self","then","content","results","_originalResponse","e","catch","findAnswers","derivedHelper","derivedState","getModifiedState","data","attributesForPrediction","nbHits","errorMessage","initIndex","queryLanguages","searchForFacetValues","userState","clientHasSFFV","isDisjunctive","algoliaQuery","facetHits","f","isRefined","isDisjunctiveFacetRefined","isFacetRefined","q","resetPage","clearTags","addDisjunctiveFacetRefinement","addDisjunctiveRefine","addHierarchicalFacetRefinement","addNumericRefinement","addFacetRefinement","addRefine","addFacetExclusion","addExcludeRefinement","addExclude","addTag","tag","addTagRefinement","removeNumericRefinement","removeDisjunctiveFacetRefinement","removeDisjunctiveRefine","removeHierarchicalFacetRefinement","removeFacetRefinement","removeRefine","removeFacetExclusion","removeExcludeRefinement","removeExclude","removeTag","removeTagRefinement","toggleFacetExclusion","toggleExcludeFacetRefinement","toggleExclude","toggleRefinement","toggleFacetRefinement","toggleRefine","toggleTag","toggleTagRefinement","nextPage","previousPage","setIndex","setQueryParameter","parameter","setState","newState","overrideStateWithoutTriggeringChangeEvent","hasRefinements","getNumericRefinements","isConjunctiveFacet","isHierarchicalFacet","isHierarchicalFacetRefined","isExcluded","isExcludeRefined","isDisjunctiveRefined","hasTag","isTagRefined","hasTagRefinements","getIndex","getPage","getTags","getRefinements","refinements","getConjunctiveRefinements","r","getExcludeRefinements","getDisjunctiveRefinements","getNumericRefinement","getHierarchicalFacetBreadcrumb","states","mainQueries","queriesCount","helper","derivedQueries","derivedStateQueries","queryId","_dispatchAlgoliaResponse","_dispatchAlgoliaError","s","specificResults","splice","formattedResponse","containsRefinement","_hasDisjunctiveRefinements","disjunctiveRefinements","event","clearCache","newClient","getClient","derive","fn","detachDerivedHelper","pos","hasPendingRequests","multiSection","_position","sectionIndex","itemIndex","nextNonEmptySectionIndex","prev","_position2","prevNonEmptySectionIndex","isLast","find","sortBy","defaults","defaultInstructions","sort","out","sortInstruction","matchingDefault","defaultInstruction","_react","_typeof","cache","_getRequireWildcardCache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","hasOwnProperty","desc","_interopRequireWildcard","_propTypes","_interopRequireDefault","_arrays","_Autowhatever","_theme","WeakMap","constructor","object","enumerableOnly","symbols","sym","_objectSpread","source","_defineProperty","getOwnPropertyDescriptors","defineProperties","_defineProperties","descriptor","configurable","writable","_possibleConstructorReturn","_assertThisInitialized","ReferenceError","_isNativeReflectConstruct","construct","sham","Proxy","Date","toString","_getPrototypeOf","o","setPrototypeOf","__proto__","_setPrototypeOf","p","alwaysTrue","Autosuggest","_Component","subClass","superClass","_inherits","Derived","protoProps","staticProps","_super","Super","NewTarget","_this","_alwaysRenderSuggestions","alwaysRenderSuggestions","justClickedOnSuggestionsContainer","node","detail","document","getAttribute","parentNode","autowhatever","_ref3","updateHighlightedSuggestion","pressedSuggestion","justSelectedSuggestion","justMouseEntered","setTimeout","focus","onSuggestionsClearRequested","_this$props","onSuggestionSelected","onSuggestionsFetchRequested","keepSuggestionsOnSelect","shouldKeepSuggestionsOnSelect","suggestionValue","reason","resetHighlightedSuggestion","_this$props2","focusInputOnSuggestionClick","_this$getSuggestionIn","getSuggestionIndices","findSuggestionElement","suggestionIndex","clickedSuggestion","getSuggestion","clickedSuggestionValue","getSuggestionValue","maybeCallOnChange","method","closeSuggestions","onBlur","_this$props3","inputProps","shouldRenderSuggestions","highlightedSuggestion","getHighlightedSuggestion","shouldRender","isFocused","highlightedSectionIndex","highlightedSuggestionIndex","valueBeforeUpDown","isCollapsed","blurEvent","_ref4","onMouseEnter","onSuggestionMouseEnter","onMouseLeave","onSuggestionMouseLeave","onMouseDown","onSuggestionMouseDown","onTouchStart","onSuggestionTouchStart","onTouchMove","onSuggestionTouchMove","onClick","onSuggestionClick","_ref5","containerProps","children","renderSuggestionsContainer","justPressedUpDown","onDocumentMouseDown","onDocumentMouseUp","itemsContainer","nextProps","shouldResetHighlighting","highlightFirstSuggestion","suggestions","willRenderSuggestions","revealSuggestions","prevProps","prevState","_this$props4","onSuggestionHighlighted","prevValue","_this2","shouldResetValueBeforeUpDown","_this$props5","getSectionSuggestions","_this$state","suggestionElement","parseInt","startNode","newValue","_this$props$inputProp","onChange","trim","_this3","_this$props6","renderInputComponent","renderSuggestion","renderSectionTitle","_this$state2","_onFocus","onFocus","_onKeyDown","onKeyDown","isOpen","autowhateverInputProps","scrollTop","keyCode","preventDefault","newHighlightedSectionIndex","newHighlightedItemIndex","getSuggestionValueByIndex","_newValue","willCloseSuggestions","renderSuggestionData","createElement","renderItemsContainer","renderItem","renderItemData","getSectionItems","highlightedItemIndex","itemProps","ref","storeAutowhateverRef","Component","array","isRequired","propName","func","bool","t","a","u","return","localStorage","window","JSON","parse","getItem","miss","stringify","all","setItem","delete","clear","removeItem","caches","serializable","c","Math","floor","random","l","replace","encodeURIComponent","h","d","entries","timeout","headers","queryParameters","cacheable","Read","Write","Any","g","status","lastUpdate","now","b","protocol","url","accept","O","P","toLowerCase","userAgent","transporterStackTrace","A","S","path","connectTimeout","timeouts","connect","responseTimeout","request","response","host","triesLeft","onSuccess","onRetry","isTimedOut","logger","info","hostsCache","onFail","requester","send","getTimeout","statelessHosts","reverse","j","add","segment","T","charAt","substr","N","appId","authMode","apiKey","requestsCache","responsesCache","hosts","read","mappedRequestOptions","transporter","write","methods","C","k","J","requests","E","propertyIsEnumerable","I","F","Q","XMLHttpRequest","open","setRequestHeader","abort","onreadystatechange","readyState","OPENED","clearTimeout","onerror","responseText","onload","debug","multipleQueries","multipleSearchForFacetValues","customRequest","shallowEqual","objA","objB","keysA","keysB","hasOwn","getDisplayName","resolved","defer","removeEmptyKey","isPlainObject","addAbsolutePositions","hits","__position","addQueryID","queryID","__queryID","excluded","sourceKeys","getPropertyByPath","current","_objectWithoutProperties","sourceSymbolKeys","isObjectOrArrayOrFunction","_merge","sourceVal","targetVal","comparator","defaultsPure","lib","addRefinement","refinementList","valueAsString","facetRefinement","mod","removeRefinement","clearRefinement","refinementType","hasChanged","newRefinementList","memo","facetList","refinementValue","containsRefinements","refinementValueAsString","cx","highlightedTagName","nonHighlightedTagName","TagName","highlight","tagName","parsedHighlightedValue","element","defaultProps","block","prefix","suitElements","baseClassName","connectHighlight","mainHelper","main","detach","parameters","algoliasearchHelper","_excluded","_createSuper","hasNativeReflectConstruct","Boolean","valueOf","connectorDesc","Composed","Connector","isWidget","transitionState","providedProps","onInternalStateUpdate","store","getState","widgets","_len2","_key2","createHrefForState","_len3","_key3","onSearchForFacetValues","onSearchParameters","unsubscribe","subscribe","isUnmounting","unregisterWidget","widgetsManager","registerWidget","shouldComponentUpdate","propsEqual","update","onSearchStateChange","_this$props$contextVa","resultsFacetValues","searching","searchingForFacetValues","metadata","nextWidgetsState","prevWidgetsState","refineProps","createURL","searchForFacetValuesProps","searchForItems","createConnectorWithoutContext","_excluded2","_excluded3","addAlgoliaAgents","searchClient","widget","isTargetedIndexEqualIndex","indexId","targetedIndex","isIndexWidget","isIndexWidgetEqualIndex","sortIndexWidgetsFirst","firstWidget","secondWidget","isFirstWidgetIndex","isSecondWidgetIndex","serializeQueryParameters","format","encode","createInstantSearchManager","_ref$initialState","initialState","resultsState","stalledSearchDelay","stalledSearchTimer","_store$getState","partialState","handleSearchSuccess","handleSearchError","skip","initialSearchParameters","onWidgetsUpdate","scheduled","scheduleUpdate","getWidgets","createWidgetsManager","_cacheHydrated","_useCache","baseMethod","methodArgs","requestsWithSerializedParams","acc","rawResults","hydrateSearchClientWithMultiIndexRequest","hydrateSearchClientWithSingleIndexRequest","hydrateSearchClient","createStore","hydrateMetadata","_internalIndexId","hydrateResultsState","sharedParameters","res","mainParameters","targetedIndexEqualMainIndex","subIndexEqualMainIndex","derivedIndices","targetedIndexNotEqualMainIndex","subIndexNotEqualMainIndex","indices","derivedParameters","_getSearchParameters","isDerivedHelpersEmpty","getFacetByName","currentState","nextIsSearchStalled","getWidgetsIds","meta","_ref5$maxFacetHits","maxFacetHitsWithinRange","max","min","_objectSpread7","onExternalStateUpdate","nextSearchState","updateClient","updateIndex","newIndex","skipSearch","datum","nestedItem","injectMetadata","payloadContainer","refNode","querySelector","payload","internalProps","widgetsPayload","_connectorDesc","_ref2$defaultProps","_ref2$displayName","prop","includes","ua","_ua","getMetadataPayload","appendChild","isControlled","InstantSearch","instantSearchManager","mainTargetedIndex","onWidgetsInternalStateUpdate","prevIsControlled","refresh","navigator","getKnownKeys","_searchState","widgetsCollector","_searchState2","nextIsControlled","previousSearchState","shape","oneOfType","number","_compareObjects","SectionTitle","section","sectionKeyPrefix","any","ctor","superCtor","_extends","assign","_objectWithoutPropertiesLoose","Item","restProps","role","storeItemReference","classNames","classes","argType","inner","default","intersection","valToNumber","isValidUserToken","RefinementList","isEqualNumericRefinement","every","el","newParameters","_parseNumbers","userToken","paramName","isKeyKnown","PARAMETERS","isValueDefined","numbers","parsedValue","parseFloat","insideBoundingBox","geoRect","parsedValues","vPrime","toggleHierarchicalFacetRefinement","validate","patch","_clearNumericRefinements","newQuery","newPage","setFacets","setDisjunctiveFacets","setHitsPerPage","setTypoTolerance","typoTolerance","isNumericRefined","paramValue","op","val","newNumericRefinements","operatorList","outValues","addFacet","addDisjunctiveFacet","addHierarchicalFacet","modification","removeFacet","removeDisjunctiveFacet","removeHierarchicalFacet","toggleConjunctiveFacetRefinement","toggleDisjunctiveFacetRefinement","isOperatorDefined","searchedValue","isAttributeValueDefined","currentValue","disjunctiveNumericRefinedFacets","getUnrefinedDisjunctiveFacets","refinedFacets","managedParameters","queryParams","nextWithNumbers","previousPlainObject","nextPlainObject","previous","isPreviousValueDefined","isNextValueDefined","_getHierarchicalFacetSortBy","_getHierarchicalShowParentLevel","showParentLevel","hierarchicalFacetName","refinement","part","arr1","getIndexId","hasMultipleIndices","getResults","refineValue","namespace","_objectSpread4","refineMultiIndexWithNamespace","refineMultiIndex","refineSingleIndexWithNamespace","refineSingleIndex","getNamespaceAndAttributeName","parts","match","attributeName","getCurrentRefinementValue","defaultValue","_getNamespaceAndAttri","multiIndex","cleanUpValue","_getNamespaceAndAttri2","indexSearchState","cleanUpValueWithMultiIndex","cleanUpValueWithSingleIndex","hitsWithPositions","_sectionIterator","_reactThemeable","_SectionTitle","_ItemList","_arrayWithHoles","_iterableToArrayLimit","minLen","_arrayLikeToArray","test","_unsupportedIterableToArray","_nonIterableRest","emptyObject","Autowhatever","userRef","highlightedItem","isInputFocused","nextPrev","_this$sectionIterator2","sectionIterator","setSectionsItems","setSectionIterator","setTheme","ensureHighlightedItemIsVisible","sectionsItems","sectionsLengths","allSectionsAreEmpty","itemsCount","keyPrefix","isFirstSection","onHighlightedItemChange","getItemId","storeItemsListReference","itemOffsetRelativeToContainer","offsetParent","offsetTop","offsetHeight","renderedItems","renderSections","renderItems","ariaActivedescendant","itemsContainerId","inputComponent","autoComplete","storeInputReference","storeItemsContainerReference","itemsContainerOpen","itemsList","itemFirst","itemHighlighted","createConnector","prevSearchState","propKeys","nonPresentKeys","_props","subState","configureState","connectConfigure","_ref$preTag","_ref$postTag","getHits","sources","reduceRight","hierarchicalFacetResult","hierarchicalFacetIndex","hierarchicalFacetRefinement","hierarchicalSeparator","hierarchicalRootPath","hierarchicalShowParentLevel","prepareHierarchicalFacetSortBy","rootExhaustive","facetResult","exhaustive","generateTreeFn","hierarchicalTree","currentHierarchicalLevel","parent","subtree","picked","tuple","parentPath","onlyMatchingTree","orderBy","facetCount","generateHierarchicalTree","instantSearchContext","InstantSearchConsumer","Consumer","InstantSearchProvider","Provider","_createContext","IndexConsumer","compact","findIndex","formatSort","getIndices","idx","assignFacetStats","dest","facetStats","stats","mainSubResponse","_rawResults","processingTimeMS","sum","facetsIndices","disjunctiveFacetsIndices","nextDisjunctiveResult","mainFacets","facetKey","hierarchicalAttributeName","facetValueObject","facetIndex","idxAttributeName","exhaustiveFacetsCount","isFacetDisjunctive","isFacetConjunctive","facets_stats","disjunctiveFacet","dfacet","facetResults","dataFromMainRequest","defaultData","root","excludes","_state","getFacetStatsIfAvailable","getRefinement","resultsFacets","predicate","DEFAULT_SORT","getFacetValues","extractNormalizedFacetValues","facetOrdering","recSort","sortFn","childNode","sortedChildren","renderingContent","getFacetOrdering","orderedFacets","remainingFacets","reverseOrder","order","ordering","sortRemainingBy","sortViaFacetOrdering","vanillaSortFn","getFacetStats","facetDeclaration","rootFacet","intermediateFacet","newFacet","numericValue","_createClass","arrA","arrB","_Item","ItemsList","sectionPrefix","isItemPropsFunction","isFirst","itemKey","itemPropsObj","allItemProps","storeHighlightedItemReference","compareAscending","other","valIsDefined","valIsNull","othIsDefined","othIsNull","collection","iteratees","orders","criteria","iteratee","aKeys","bKeys","keysMap","aValue","bValue","aValueKeys","bValueKeys","aValueKey"],"mappings":";6FAAA,oFACWA,EAAiB,CAC1BC,gBAAiB,6BACjBC,iBAAkB,+BAYpB,SAASC,EAA0BC,GACjC,IAAIC,EAASD,EAAKC,OACdC,EAAUF,EAAKE,QACfC,EAAwBH,EAAKI,iBAE7BC,QAD6C,IAA1BF,EAAmC,GAAKA,GAC1BG,MAAML,GACvCM,EAAaF,EAAcG,QAC3BC,EAA0B,KAAfF,EAAoB,GAAK,CAAC,CACvCG,MAAOH,EACPI,eAAe,IAGjB,GAAIT,IAAYD,EAAQ,CACtB,IAAIU,GAAgB,EACpBN,EAAcO,SAAQ,SAAUN,GAC9BG,EAASI,KAAK,CACZH,MAAOJ,EACPK,cAAeA,IAEjBA,GAAiBA,UAGnBN,EAAcO,SAAQ,SAAUN,GAC9B,IAAIQ,EAAiBR,EAAMA,MAAMJ,GACjCO,EAASI,KAAK,CACZH,MAAOI,EAAe,GACtBH,eAAe,IAGS,KAAtBG,EAAe,IACjBL,EAASI,KAAK,CACZH,MAAOI,EAAe,GACtBH,eAAe,OAMvB,OAAOF,EAoBF,SAASM,EAAgBC,GAC9B,IAAIC,EAAeD,EAAMf,OACrBA,OAA0B,IAAjBgB,EAA0B,OAASA,EAC5CC,EAAgBF,EAAMd,QACtBA,OAA4B,IAAlB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/B,IAAQ,IAC7BhH,EAAOgH,GAAO8V,EAAO9V,IAGvB,OAAOhH,EAZT","file":"899932ed282246d9554c690ff8abd38089ecdef2-4d09a6bb969e96c98690.js","sourcesContent":["import { getPropertyByPath } from './utils';\nexport var HIGHLIGHT_TAGS = {\n highlightPreTag: \"\",\n highlightPostTag: \"\"\n};\n/**\n * Parses an highlighted attribute into an array of objects with the string value, and\n * a boolean that indicated if this part is highlighted.\n *\n * @param {string} preTag - string used to identify the start of an highlighted value\n * @param {string} postTag - string used to identify the end of an highlighted value\n * @param {string} highlightedValue - highlighted attribute as returned by Algolia highlight feature\n * @return {object[]} - An array of {value: string, isHighlighted: boolean}.\n */\n\nfunction parseHighlightedAttribute(_ref) {\n var preTag = _ref.preTag,\n postTag = _ref.postTag,\n _ref$highlightedValue = _ref.highlightedValue,\n highlightedValue = _ref$highlightedValue === void 0 ? '' : _ref$highlightedValue;\n var splitByPreTag = highlightedValue.split(preTag);\n var firstValue = splitByPreTag.shift();\n var elements = firstValue === '' ? [] : [{\n value: firstValue,\n isHighlighted: false\n }];\n\n if (postTag === preTag) {\n var isHighlighted = true;\n splitByPreTag.forEach(function (split) {\n elements.push({\n value: split,\n isHighlighted: isHighlighted\n });\n isHighlighted = !isHighlighted;\n });\n } else {\n splitByPreTag.forEach(function (split) {\n var splitByPostTag = split.split(postTag);\n elements.push({\n value: splitByPostTag[0],\n isHighlighted: true\n });\n\n if (splitByPostTag[1] !== '') {\n elements.push({\n value: splitByPostTag[1],\n isHighlighted: false\n });\n }\n });\n }\n\n return elements;\n}\n/**\n * Find an highlighted attribute given an `attribute` and an `highlightProperty`, parses it,\n * and provided an array of objects with the string value and a boolean if this\n * value is highlighted.\n *\n * In order to use this feature, highlight must be activated in the configuration of\n * the index. The `preTag` and `postTag` attributes are respectively highlightPreTag and\n * highlightPostTag in Algolia configuration.\n *\n * @param {string} preTag - string used to identify the start of an highlighted value\n * @param {string} postTag - string used to identify the end of an highlighted value\n * @param {string} highlightProperty - the property that contains the highlight structure in the results\n * @param {string} attribute - the highlighted attribute to look for\n * @param {object} hit - the actual hit returned by Algolia.\n * @return {object[]} - An array of {value: string, isHighlighted: boolean}.\n */\n\n\nexport function parseAlgoliaHit(_ref2) {\n var _ref2$preTag = _ref2.preTag,\n preTag = _ref2$preTag === void 0 ? '' : _ref2$preTag,\n _ref2$postTag = _ref2.postTag,\n postTag = _ref2$postTag === void 0 ? '' : _ref2$postTag,\n highlightProperty = _ref2.highlightProperty,\n attribute = _ref2.attribute,\n hit = _ref2.hit;\n if (!hit) throw new Error('`hit`, the matching record, must be provided');\n var highlightObject = getPropertyByPath(hit[highlightProperty], attribute) || {};\n\n if (Array.isArray(highlightObject)) {\n return highlightObject.map(function (item) {\n return parseHighlightedAttribute({\n preTag: preTag,\n postTag: postTag,\n highlightedValue: item.value\n });\n });\n }\n\n return parseHighlightedAttribute({\n preTag: preTag,\n postTag: postTag,\n highlightedValue: highlightObject.value\n });\n}","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null;\nvar ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n};\nvar ReflectOwnKeys;\n\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys;\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n};\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\n\nmodule.exports = EventEmitter;\nmodule.exports.once = once; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\n\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function get() {\n return defaultMaxListeners;\n },\n set: function set(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function () {\n if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n}; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\n\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var doError = type === 'error';\n var events = this._events;\n if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; // If there is no 'error' event listener then throw.\n\n if (doError) {\n var er;\n if (args.length > 0) er = args[0];\n\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n } // At least give some kind of context to the user\n\n\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n if (handler === undefined) return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n\n for (var i = 0; i < len; ++i) {\n ReflectApply(listeners[i], this, args);\n }\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n checkListener(listener);\n events = target._events;\n\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n\n events = target._events;\n }\n\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n } // Check for listener leak\n\n\n m = _getMaxListeners(target);\n\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true; // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n\n var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener = function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n};\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0) return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = {\n fired: false,\n wrapFn: undefined,\n target: target,\n type: type,\n listener: listener\n };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n}; // Emits a 'removeListener' event if and only if the listener was removed.\n\n\nEventEmitter.prototype.removeListener = function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n checkListener(listener);\n events = this._events;\n if (events === undefined) return this;\n list = events[type];\n if (list === undefined) return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else {\n delete events[type];\n if (events.removeListener) this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n if (position === 0) list.shift();else {\n spliceOne(list, position);\n }\n if (list.length === 1) events[type] = list[0];\n if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {\n var listeners, events, i;\n events = this._events;\n if (events === undefined) return this; // not listening for removeListener, no need to emit\n\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type];\n }\n\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n};\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n if (events === undefined) return [];\n var evlistener = events[type];\n if (evlistener === undefined) return [];\n if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function (emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\n\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n\n for (var i = 0; i < n; ++i) {\n copy[i] = arr[i];\n }\n\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++) {\n list[index] = list[index + 1];\n }\n\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n\n resolve([].slice.call(arguments));\n }\n\n ;\n eventTargetAgnosticAddListener(emitter, name, resolver, {\n once: true\n });\n\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, {\n once: true\n });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}","'use strict';\n\nvar merge = require('./functions/merge');\n\nvar requestBuilder = {\n /**\n * Get all the queries to send to the client, those queries can used directly\n * with the Algolia client.\n * @private\n * @return {object[]} The queries\n */\n _getQueries: function getQueries(index, state) {\n var queries = []; // One query for the hits\n\n queries.push({\n indexName: index,\n params: requestBuilder._getHitsSearchParams(state)\n }); // One for each disjunctive facets\n\n state.getRefinedDisjunctiveFacets().forEach(function (refinedFacet) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet)\n });\n }); // maybe more to get the root level of hierarchical facets when activated\n\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are deeper than level 0 (starting from `beer > IPA`)\n // we want to get the root values\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n if (currentRefinement.length > 0 && currentRefinement[0].split(separator).length > 1) {\n queries.push({\n indexName: index,\n params: requestBuilder._getDisjunctiveFacetSearchParams(state, refinedFacet, true)\n });\n }\n });\n return queries;\n },\n\n /**\n * Build search parameters used to fetch hits\n * @private\n * @return {object.}\n */\n _getHitsSearchParams: function _getHitsSearchParams(state) {\n var facets = state.facets.concat(state.disjunctiveFacets).concat(requestBuilder._getHitsHierarchicalFacetsAttributes(state));\n\n var facetFilters = requestBuilder._getFacetFilters(state);\n\n var numericFilters = requestBuilder._getNumericFilters(state);\n\n var tagFilters = requestBuilder._getTagFilters(state);\n\n var additionalParams = {\n facets: facets.indexOf('*') > -1 ? ['*'] : facets,\n tagFilters: tagFilters\n };\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n return merge({}, state.getQueryParams(), additionalParams);\n },\n\n /**\n * Build search parameters used to fetch a disjunctive facet\n * @private\n * @param {string} facet the associated facet name\n * @param {boolean} hierarchicalRootLevel ?? FIXME\n * @return {object}\n */\n _getDisjunctiveFacetSearchParams: function _getDisjunctiveFacetSearchParams(state, facet, hierarchicalRootLevel) {\n var facetFilters = requestBuilder._getFacetFilters(state, facet, hierarchicalRootLevel);\n\n var numericFilters = requestBuilder._getNumericFilters(state, facet);\n\n var tagFilters = requestBuilder._getTagFilters(state);\n\n var additionalParams = {\n hitsPerPage: 1,\n page: 0,\n attributesToRetrieve: [],\n attributesToHighlight: [],\n attributesToSnippet: [],\n tagFilters: tagFilters,\n analytics: false,\n clickAnalytics: false\n };\n var hierarchicalFacet = state.getHierarchicalFacetByName(facet);\n\n if (hierarchicalFacet) {\n additionalParams.facets = requestBuilder._getDisjunctiveHierarchicalFacetAttribute(state, hierarchicalFacet, hierarchicalRootLevel);\n } else {\n additionalParams.facets = facet;\n }\n\n if (numericFilters.length > 0) {\n additionalParams.numericFilters = numericFilters;\n }\n\n if (facetFilters.length > 0) {\n additionalParams.facetFilters = facetFilters;\n }\n\n return merge({}, state.getQueryParams(), additionalParams);\n },\n\n /**\n * Return the numeric filters in an algolia request fashion\n * @private\n * @param {string} [facetName] the name of the attribute for which the filters should be excluded\n * @return {string[]} the numeric filters in the algolia format\n */\n _getNumericFilters: function _getNumericFilters(state, facetName) {\n if (state.numericFilters) {\n return state.numericFilters;\n }\n\n var numericFilters = [];\n Object.keys(state.numericRefinements).forEach(function (attribute) {\n var operators = state.numericRefinements[attribute] || {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator] || [];\n\n if (facetName !== attribute) {\n values.forEach(function (value) {\n if (Array.isArray(value)) {\n var vs = value.map(function (v) {\n return attribute + operator + v;\n });\n numericFilters.push(vs);\n } else {\n numericFilters.push(attribute + operator + value);\n }\n });\n }\n });\n });\n return numericFilters;\n },\n\n /**\n * Return the tags filters depending\n * @private\n * @return {string}\n */\n _getTagFilters: function _getTagFilters(state) {\n if (state.tagFilters) {\n return state.tagFilters;\n }\n\n return state.tagRefinements.join(',');\n },\n\n /**\n * Build facetFilters parameter based on current refinements. The array returned\n * contains strings representing the facet filters in the algolia format.\n * @private\n * @param {string} [facet] if set, the current disjunctive facet\n * @return {array.}\n */\n _getFacetFilters: function _getFacetFilters(state, facet, hierarchicalRootLevel) {\n var facetFilters = [];\n var facetsRefinements = state.facetsRefinements || {};\n Object.keys(facetsRefinements).forEach(function (facetName) {\n var facetValues = facetsRefinements[facetName] || [];\n facetValues.forEach(function (facetValue) {\n facetFilters.push(facetName + ':' + facetValue);\n });\n });\n var facetsExcludes = state.facetsExcludes || {};\n Object.keys(facetsExcludes).forEach(function (facetName) {\n var facetValues = facetsExcludes[facetName] || [];\n facetValues.forEach(function (facetValue) {\n facetFilters.push(facetName + ':-' + facetValue);\n });\n });\n var disjunctiveFacetsRefinements = state.disjunctiveFacetsRefinements || {};\n Object.keys(disjunctiveFacetsRefinements).forEach(function (facetName) {\n var facetValues = disjunctiveFacetsRefinements[facetName] || [];\n\n if (facetName === facet || !facetValues || facetValues.length === 0) {\n return;\n }\n\n var orFilters = [];\n facetValues.forEach(function (facetValue) {\n orFilters.push(facetName + ':' + facetValue);\n });\n facetFilters.push(orFilters);\n });\n var hierarchicalFacetsRefinements = state.hierarchicalFacetsRefinements || {};\n Object.keys(hierarchicalFacetsRefinements).forEach(function (facetName) {\n var facetValues = hierarchicalFacetsRefinements[facetName] || [];\n var facetValue = facetValues[0];\n\n if (facetValue === undefined) {\n return;\n }\n\n var hierarchicalFacet = state.getHierarchicalFacetByName(facetName);\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n\n var attributeToRefine;\n var attributesIndex; // we ask for parent facet values only when the `facet` is the current hierarchical facet\n\n if (facet === facetName) {\n // if we are at the root level already, no need to ask for facet values, we get them from\n // the hits query\n if (facetValue.indexOf(separator) === -1 || !rootPath && hierarchicalRootLevel === true || rootPath && rootPath.split(separator).length === facetValue.split(separator).length) {\n return;\n }\n\n if (!rootPath) {\n attributesIndex = facetValue.split(separator).length - 2;\n facetValue = facetValue.slice(0, facetValue.lastIndexOf(separator));\n } else {\n attributesIndex = rootPath.split(separator).length - 1;\n facetValue = rootPath;\n }\n\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n } else {\n attributesIndex = facetValue.split(separator).length - 1;\n attributeToRefine = hierarchicalFacet.attributes[attributesIndex];\n }\n\n if (attributeToRefine) {\n facetFilters.push([attributeToRefine + ':' + facetValue]);\n }\n });\n return facetFilters;\n },\n _getHitsHierarchicalFacetsAttributes: function _getHitsHierarchicalFacetsAttributes(state) {\n var out = [];\n return state.hierarchicalFacets.reduce( // ask for as much levels as there's hierarchical refinements\n function getHitsAttributesForHierarchicalFacet(allAttributes, hierarchicalFacet) {\n var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0]; // if no refinement, ask for root level\n\n if (!hierarchicalRefinement) {\n allAttributes.push(hierarchicalFacet.attributes[0]);\n return allAttributes;\n }\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var level = hierarchicalRefinement.split(separator).length;\n var newAttributes = hierarchicalFacet.attributes.slice(0, level + 1);\n return allAttributes.concat(newAttributes);\n }, out);\n },\n _getDisjunctiveHierarchicalFacetAttribute: function _getDisjunctiveHierarchicalFacetAttribute(state, hierarchicalFacet, rootLevel) {\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n if (rootLevel === true) {\n var rootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n\n var attributeIndex = 0;\n\n if (rootPath) {\n attributeIndex = rootPath.split(separator).length;\n }\n\n return [hierarchicalFacet.attributes[attributeIndex]];\n }\n\n var hierarchicalRefinement = state.getHierarchicalRefinement(hierarchicalFacet.name)[0] || ''; // if refinement is 'beers > IPA > Flying dog',\n // then we want `facets: ['beers > IPA']` as disjunctive facet (parent level values)\n\n var parentLevel = hierarchicalRefinement.split(separator).length - 1;\n return hierarchicalFacet.attributes.slice(0, parentLevel + 1);\n },\n getSearchForFacetQuery: function getSearchForFacetQuery(facetName, query, maxFacetHits, state) {\n var stateForSearchForFacetValues = state.isDisjunctiveFacet(facetName) ? state.clearRefinements(facetName) : state;\n var searchForFacetSearchParameters = {\n facetQuery: query,\n facetName: facetName\n };\n\n if (typeof maxFacetHits === 'number') {\n searchForFacetSearchParameters.maxFacetHits = maxFacetHits;\n }\n\n return merge({}, requestBuilder._getHitsSearchParams(stateForSearchForFacetValues), searchForFacetSearchParameters);\n }\n};\nmodule.exports = requestBuilder;","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","\"use strict\";\n\nmodule.exports = require('./Autosuggest')[\"default\"];","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getIndexId } from '../core/indexUtils';\n\nfunction getId() {\n return 'query';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, '');\n\n if (currentRefinement) {\n return currentRefinement;\n }\n\n return '';\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, getId());\n}\n/**\n * connectSearchBox connector provides the logic to build a widget that will\n * let the user search for a query\n * @name connectSearchBox\n * @kind connector\n * @propType {string} [defaultRefinement] - Provide a default value for the query\n * @providedPropType {function} refine - a function to change the current query\n * @providedPropType {string} currentRefinement - the current query used\n * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaSearchBox',\n propTypes: {\n defaultRefinement: PropTypes.string\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n return {\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isSearchStalled: searchResults.isSearchStalled\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQuery(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }));\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n id: id,\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: currentRefinement === null ? [] : [{\n label: \"\".concat(id, \": \").concat(currentRefinement),\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: currentRefinement\n }]\n };\n }\n});","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n value: true\n});\n\nvar _slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i['return']) _i['return']();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError('Invalid attempt to destructure non-iterable instance');\n }\n };\n}();\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction _toConsumableArray(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n}\n\nvar _objectAssign = require('object-assign');\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nvar truthy = function truthy(x) {\n return x;\n};\n\nexports['default'] = function (input) {\n var _ref = Array.isArray(input) && input.length === 2 ? input : [input, null];\n\n var _ref2 = _slicedToArray(_ref, 2);\n\n var theme = _ref2[0];\n var classNameDecorator = _ref2[1];\n return function (key) {\n for (var _len = arguments.length, names = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n names[_key - 1] = arguments[_key];\n }\n\n var styles = names.map(function (name) {\n return theme[name];\n }).filter(truthy);\n return typeof styles[0] === 'string' || typeof classNameDecorator === 'function' ? {\n key: key,\n className: classNameDecorator ? classNameDecorator.apply(undefined, _toConsumableArray(styles)) : styles.join(' ')\n } : {\n key: key,\n style: _objectAssign2['default'].apply(undefined, [{}].concat(_toConsumableArray(styles)))\n };\n };\n};\n\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.mapToAutowhateverTheme = exports.defaultTheme = void 0;\nvar defaultTheme = {\n container: 'react-autosuggest__container',\n containerOpen: 'react-autosuggest__container--open',\n input: 'react-autosuggest__input',\n inputOpen: 'react-autosuggest__input--open',\n inputFocused: 'react-autosuggest__input--focused',\n suggestionsContainer: 'react-autosuggest__suggestions-container',\n suggestionsContainerOpen: 'react-autosuggest__suggestions-container--open',\n suggestionsList: 'react-autosuggest__suggestions-list',\n suggestion: 'react-autosuggest__suggestion',\n suggestionFirst: 'react-autosuggest__suggestion--first',\n suggestionHighlighted: 'react-autosuggest__suggestion--highlighted',\n sectionContainer: 'react-autosuggest__section-container',\n sectionContainerFirst: 'react-autosuggest__section-container--first',\n sectionTitle: 'react-autosuggest__section-title'\n};\nexports.defaultTheme = defaultTheme;\n\nvar mapToAutowhateverTheme = function mapToAutowhateverTheme(theme) {\n var result = {};\n\n for (var key in theme) {\n switch (key) {\n case 'suggestionsContainer':\n result['itemsContainer'] = theme[key];\n break;\n\n case 'suggestionsContainerOpen':\n result['itemsContainerOpen'] = theme[key];\n break;\n\n case 'suggestion':\n result['item'] = theme[key];\n break;\n\n case 'suggestionFirst':\n result['itemFirst'] = theme[key];\n break;\n\n case 'suggestionHighlighted':\n result['itemHighlighted'] = theme[key];\n break;\n\n case 'suggestionsList':\n result['itemsList'] = theme[key];\n break;\n\n default:\n result[key] = theme[key];\n }\n }\n\n return result;\n};\n\nexports.mapToAutowhateverTheme = mapToAutowhateverTheme;","'use strict';\n\nmodule.exports = '3.6.2';","'use strict';\n\nvar SearchParameters = require('./SearchParameters');\n\nvar SearchResults = require('./SearchResults');\n\nvar DerivedHelper = require('./DerivedHelper');\n\nvar requestBuilder = require('./requestBuilder');\n\nvar events = require('events');\n\nvar inherits = require('./functions/inherits');\n\nvar objectHasKeys = require('./functions/objectHasKeys');\n\nvar omit = require('./functions/omit');\n\nvar merge = require('./functions/merge');\n\nvar version = require('./version');\n/**\n * Event triggered when a parameter is set or updated\n * @event AlgoliaSearchHelper#event:change\n * @property {object} event\n * @property {SearchParameters} event.state the current parameters with the latest changes applied\n * @property {SearchResults} event.results the previous results received from Algolia. `null` before the first request\n * @example\n * helper.on('change', function(event) {\n * console.log('The parameters have changed');\n * });\n */\n\n/**\n * Event triggered when a main search is sent to Algolia\n * @event AlgoliaSearchHelper#event:search\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search\n * @property {SearchResults} event.results the results from the previous search. `null` if it is the first search.\n * @example\n * helper.on('search', function(event) {\n * console.log('Search sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchForFacetValues` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchForFacetValues\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @property {string} event.facet the facet searched into\n * @property {string} event.query the query used to search in the facets\n * @example\n * helper.on('searchForFacetValues', function(event) {\n * console.log('searchForFacetValues sent');\n * });\n */\n\n/**\n * Event triggered when a search using `searchOnce` is sent to Algolia\n * @event AlgoliaSearchHelper#event:searchOnce\n * @property {object} event\n * @property {SearchParameters} event.state the parameters used for this search it is the first search.\n * @example\n * helper.on('searchOnce', function(event) {\n * console.log('searchOnce sent');\n * });\n */\n\n/**\n * Event triggered when the results are retrieved from Algolia\n * @event AlgoliaSearchHelper#event:result\n * @property {object} event\n * @property {SearchResults} event.results the results received from Algolia\n * @property {SearchParameters} event.state the parameters used to query Algolia. Those might be different from the one in the helper instance (for example if the network is unreliable).\n * @example\n * helper.on('result', function(event) {\n * console.log('Search results received');\n * });\n */\n\n/**\n * Event triggered when Algolia sends back an error. For example, if an unknown parameter is\n * used, the error can be caught using this event.\n * @event AlgoliaSearchHelper#event:error\n * @property {object} event\n * @property {Error} event.error the error returned by the Algolia.\n * @example\n * helper.on('error', function(event) {\n * console.log('Houston we got a problem.');\n * });\n */\n\n/**\n * Event triggered when the queue of queries have been depleted (with any result or outdated queries)\n * @event AlgoliaSearchHelper#event:searchQueueEmpty\n * @example\n * helper.on('searchQueueEmpty', function() {\n * console.log('No more search pending');\n * // This is received before the result event if we're not expecting new results\n * });\n *\n * helper.search();\n */\n\n/**\n * Initialize a new AlgoliaSearchHelper\n * @class\n * @classdesc The AlgoliaSearchHelper is a class that ease the management of the\n * search. It provides an event based interface for search callbacks:\n * - change: when the internal search state is changed.\n * This event contains a {@link SearchParameters} object and the\n * {@link SearchResults} of the last result if any.\n * - search: when a search is triggered using the `search()` method.\n * - result: when the response is retrieved from Algolia and is processed.\n * This event contains a {@link SearchResults} object and the\n * {@link SearchParameters} corresponding to this answer.\n * - error: when the response is an error. This event contains the error returned by the server.\n * @param {AlgoliaSearch} client an AlgoliaSearch client\n * @param {string} index the index name to query\n * @param {SearchParameters | object} options an object defining the initial\n * config of the search. It doesn't have to be a {SearchParameters},\n * just an object containing the properties you need from it.\n */\n\n\nfunction AlgoliaSearchHelper(client, index, options) {\n if (typeof client.addAlgoliaAgent === 'function') {\n client.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n\n this.setClient(client);\n var opts = options || {};\n opts.index = index;\n this.state = SearchParameters.make(opts);\n this.lastResults = null;\n this._queryId = 0;\n this._lastQueryIdReceived = -1;\n this.derivedHelpers = [];\n this._currentNbQueries = 0;\n}\n\ninherits(AlgoliaSearchHelper, events.EventEmitter);\n/**\n * Start the search with the parameters set in the state. When the\n * method is called, it triggers a `search` event. The results will\n * be available through the `result` event. If an error occurs, an\n * `error` will be fired instead.\n * @return {AlgoliaSearchHelper}\n * @fires search\n * @fires result\n * @fires error\n * @chainable\n */\n\nAlgoliaSearchHelper.prototype.search = function () {\n this._search({\n onlyWithDerivedHelpers: false\n });\n\n return this;\n};\n\nAlgoliaSearchHelper.prototype.searchOnlyWithDerivedHelpers = function () {\n this._search({\n onlyWithDerivedHelpers: true\n });\n\n return this;\n};\n/**\n * Gets the search query parameters that would be sent to the Algolia Client\n * for the hits\n * @return {object} Query Parameters\n */\n\n\nAlgoliaSearchHelper.prototype.getQuery = function () {\n var state = this.state;\n return requestBuilder._getHitsSearchParams(state);\n};\n/**\n * Start a search using a modified version of the current state. This method does\n * not trigger the helper lifecycle and does not modify the state kept internally\n * by the helper. This second aspect means that the next search call will be the\n * same as a search call before calling searchOnce.\n * @param {object} options can contain all the parameters that can be set to SearchParameters\n * plus the index\n * @param {function} [callback] optional callback executed when the response from the\n * server is back.\n * @return {promise|undefined} if a callback is passed the method returns undefined\n * otherwise it returns a promise containing an object with two keys :\n * - content with a SearchResults\n * - state with the state used for the query as a SearchParameters\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the callback API\n * var state = helper.searchOnce({hitsPerPage: 1},\n * function(error, content, state) {\n * // if an error occurred it will be passed in error, otherwise its value is null\n * // content contains the results formatted as a SearchResults\n * // state is the instance of SearchParameters used for this search\n * });\n * @example\n * // Changing the number of records returned per page to 1\n * // This example uses the promise API\n * var state1 = helper.searchOnce({hitsPerPage: 1})\n * .then(promiseHandler);\n *\n * function promiseHandler(res) {\n * // res contains\n * // {\n * // content : SearchResults\n * // state : SearchParameters (the one used for this specific search)\n * // }\n * }\n */\n\n\nAlgoliaSearchHelper.prototype.searchOnce = function (options, cb) {\n var tempState = !options ? this.state : this.state.setQueryParameters(options);\n\n var queries = requestBuilder._getQueries(tempState.index, tempState);\n\n var self = this;\n this._currentNbQueries++;\n this.emit('searchOnce', {\n state: tempState\n });\n\n if (cb) {\n this.client.search(queries).then(function (content) {\n self._currentNbQueries--;\n\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(null, new SearchResults(tempState, content.results), tempState);\n }).catch(function (err) {\n self._currentNbQueries--;\n\n if (self._currentNbQueries === 0) {\n self.emit('searchQueueEmpty');\n }\n\n cb(err, null, tempState);\n });\n return undefined;\n }\n\n return this.client.search(queries).then(function (content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n return {\n content: new SearchResults(tempState, content.results),\n state: tempState,\n _originalResponse: content\n };\n }, function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n });\n};\n/**\n* Start the search for answers with the parameters set in the state.\n* This method returns a promise.\n* @param {Object} options - the options for answers API call\n* @param {string[]} options.attributesForPrediction - Attributes to use for predictions. If empty, `searchableAttributes` is used instead.\n* @param {string[]} options.queryLanguages - The languages in the query. Currently only supports ['en'].\n* @param {number} options.nbHits - Maximum number of answers to retrieve from the Answers Engine. Cannot be greater than 1000.\n*\n* @return {promise} the answer results\n*/\n\n\nAlgoliaSearchHelper.prototype.findAnswers = function (options) {\n var state = this.state;\n var derivedHelper = this.derivedHelpers[0];\n\n if (!derivedHelper) {\n return Promise.resolve([]);\n }\n\n var derivedState = derivedHelper.getModifiedState(state);\n var data = merge({\n attributesForPrediction: options.attributesForPrediction,\n nbHits: options.nbHits\n }, {\n params: omit(requestBuilder._getHitsSearchParams(derivedState), ['attributesToSnippet', 'hitsPerPage', 'restrictSearchableAttributes', 'snippetEllipsisText' // FIXME remove this line once the engine is fixed.\n ])\n });\n var errorMessage = 'search for answers was called, but this client does not have a function client.initIndex(index).findAnswers';\n\n if (typeof this.client.initIndex !== 'function') {\n throw new Error(errorMessage);\n }\n\n var index = this.client.initIndex(derivedState.index);\n\n if (typeof index.findAnswers !== 'function') {\n throw new Error(errorMessage);\n }\n\n return index.findAnswers(derivedState.query, options.queryLanguages, data);\n};\n/**\n * Structure of each result when using\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * @typedef FacetSearchHit\n * @type {object}\n * @property {string} value the facet value\n * @property {string} highlighted the facet value highlighted with the query string\n * @property {number} count number of occurrence of this facet value\n * @property {boolean} isRefined true if the value is already refined\n */\n\n/**\n * Structure of the data resolved by the\n * [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)\n * promise.\n * @typedef FacetSearchResult\n * @type {object}\n * @property {FacetSearchHit} facetHits the results for this search for facet values\n * @property {number} processingTimeMS time taken by the query inside the engine\n */\n\n/**\n * Search for facet values based on an query and the name of a faceted attribute. This\n * triggers a search and will return a promise. On top of using the query, it also sends\n * the parameters from the state so that the search is narrowed down to only the possible values.\n *\n * See the description of [FacetSearchResult](reference.html#FacetSearchResult)\n * @param {string} facet the name of the faceted attribute\n * @param {string} query the string query for the search\n * @param {number} [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100\n * @param {object} [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes\n * it in the generated query.\n * @return {promise.} the results of the search\n */\n\n\nAlgoliaSearchHelper.prototype.searchForFacetValues = function (facet, query, maxFacetHits, userState) {\n var clientHasSFFV = typeof this.client.searchForFacetValues === 'function';\n\n if (!clientHasSFFV && typeof this.client.initIndex !== 'function') {\n throw new Error('search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues');\n }\n\n var state = this.state.setQueryParameters(userState || {});\n var isDisjunctive = state.isDisjunctiveFacet(facet);\n var algoliaQuery = requestBuilder.getSearchForFacetQuery(facet, query, maxFacetHits, state);\n this._currentNbQueries++;\n var self = this;\n this.emit('searchForFacetValues', {\n state: state,\n facet: facet,\n query: query\n });\n var searchForFacetValuesPromise = clientHasSFFV ? this.client.searchForFacetValues([{\n indexName: state.index,\n params: algoliaQuery\n }]) : this.client.initIndex(state.index).searchForFacetValues(algoliaQuery);\n return searchForFacetValuesPromise.then(function addIsRefined(content) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n content = Array.isArray(content) ? content[0] : content;\n content.facetHits.forEach(function (f) {\n f.isRefined = isDisjunctive ? state.isDisjunctiveFacetRefined(facet, f.value) : state.isFacetRefined(facet, f.value);\n });\n return content;\n }, function (e) {\n self._currentNbQueries--;\n if (self._currentNbQueries === 0) self.emit('searchQueueEmpty');\n throw e;\n });\n};\n/**\n * Sets the text query used for the search.\n *\n * This method resets the current page to 0.\n * @param {string} q the user query\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.setQuery = function (q) {\n this._change({\n state: this.state.resetPage().setQuery(q),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Remove all the types of refinements except tags. A string can be provided to remove\n * only the refinements of a specific attribute. For more advanced use case, you can\n * provide a function instead. This function should follow the\n * [clearCallback definition](#SearchParameters.clearCallback).\n *\n * This method resets the current page to 0.\n * @param {string} [name] optional name of the facet / attribute on which we want to remove all refinements\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n * @example\n * // Removing all the refinements\n * helper.clearRefinements().search();\n * @example\n * // Removing all the filters on a the category attribute.\n * helper.clearRefinements('category').search();\n * @example\n * // Removing only the exclude filters on the category facet.\n * helper.clearRefinements(function(value, attribute, type) {\n * return type === 'exclude' && attribute === 'category';\n * }).search();\n */\n\n\nAlgoliaSearchHelper.prototype.clearRefinements = function (name) {\n this._change({\n state: this.state.resetPage().clearRefinements(name),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Remove all the tag filters.\n *\n * This method resets the current page to 0.\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.clearTags = function () {\n this._change({\n state: this.state.resetPage().clearTags(),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Adds a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.addDisjunctiveFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().addDisjunctiveFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addDisjunctiveFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.addDisjunctiveRefine = function () {\n return this.addDisjunctiveFacetRefinement.apply(this, arguments);\n};\n/**\n * Adds a refinement on a hierarchical facet. It will throw\n * an exception if the facet is not defined or if the facet\n * is already refined.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet name\n * @param {string} path the hierarchical facet path\n * @return {AlgoliaSearchHelper}\n * @throws Error if the facet is not defined or if the facet is refined\n * @chainable\n * @fires change\n */\n\n\nAlgoliaSearchHelper.prototype.addHierarchicalFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().addHierarchicalFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Adds a an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} operator the operator of the filter\n * @param {number} value the value of the filter\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.addNumericRefinement = function (attribute, operator, value) {\n this._change({\n state: this.state.resetPage().addNumericRefinement(attribute, operator, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Adds a filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.addFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().addFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.addRefine = function () {\n return this.addFacetRefinement.apply(this, arguments);\n};\n/**\n * Adds a an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value (will be converted to string)\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.addFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().addExcludeRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#addFacetExclusion}\n */\n\n\nAlgoliaSearchHelper.prototype.addExclude = function () {\n return this.addFacetExclusion.apply(this, arguments);\n};\n/**\n * Adds a tag filter with the `tag` provided. If the\n * filter is already set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag the tag to add to the filter\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.addTag = function (tag) {\n this._change({\n state: this.state.resetPage().addTagRefinement(tag),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Removes an numeric filter to an attribute with the `operator` and `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * Some parameters are optional, triggering different behavior:\n * - if the value is not provided, then all the numeric value will be removed for the\n * specified attribute/operator couple.\n * - if the operator is not provided either, then all the numeric filter on this attribute\n * will be removed.\n *\n * This method resets the current page to 0.\n * @param {string} attribute the attribute on which the numeric filter applies\n * @param {string} [operator] the operator of the filter\n * @param {number} [value] the value of the filter\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeNumericRefinement = function (attribute, operator, value) {\n this._change({\n state: this.state.resetPage().removeNumericRefinement(attribute, operator, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Removes a disjunctive filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeDisjunctiveFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeDisjunctiveFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeDisjunctiveFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.removeDisjunctiveRefine = function () {\n return this.removeDisjunctiveFacetRefinement.apply(this, arguments);\n};\n/**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {AlgoliaSearchHelper}\n * @throws Error if the facet is not defined or if the facet is not refined\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeHierarchicalFacetRefinement = function (facet) {\n this._change({\n state: this.state.resetPage().removeHierarchicalFacetRefinement(facet),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Removes a filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.removeRefine = function () {\n return this.removeFacetRefinement.apply(this, arguments);\n};\n/**\n * Removes an exclusion filter to a faceted attribute with the `value` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * If the value is omitted, then this method will remove all the filters for the\n * attribute.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} [value] the associated value\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().removeExcludeRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#removeFacetExclusion}\n */\n\n\nAlgoliaSearchHelper.prototype.removeExclude = function () {\n return this.removeFacetExclusion.apply(this, arguments);\n};\n/**\n * Removes a tag filter with the `tag` provided. If the\n * filter is not set, it doesn't change the filters.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove from the filter\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.removeTag = function (tag) {\n this._change({\n state: this.state.resetPage().removeTagRefinement(tag),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Adds or removes an exclusion filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.toggleFacetExclusion = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleExcludeFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetExclusion}\n */\n\n\nAlgoliaSearchHelper.prototype.toggleExclude = function () {\n return this.toggleFacetExclusion.apply(this, arguments);\n};\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper}\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n * @deprecated since version 2.19.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.toggleRefinement = function (facet, value) {\n return this.toggleFacetRefinement(facet, value);\n};\n/**\n * Adds or removes a filter to a faceted attribute with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method can be used for conjunctive, disjunctive and hierarchical filters.\n *\n * This method resets the current page to 0.\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {AlgoliaSearchHelper}\n * @throws Error will throw an error if the facet is not declared in the settings of the helper\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.toggleFacetRefinement = function (facet, value) {\n this._change({\n state: this.state.resetPage().toggleFacetRefinement(facet, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * @deprecated since version 2.4.0, see {@link AlgoliaSearchHelper#toggleFacetRefinement}\n */\n\n\nAlgoliaSearchHelper.prototype.toggleRefine = function () {\n return this.toggleFacetRefinement.apply(this, arguments);\n};\n/**\n * Adds or removes a tag filter with the `value` provided. If\n * the value is set then it removes it, otherwise it adds the filter.\n *\n * This method resets the current page to 0.\n * @param {string} tag tag to remove or add\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.toggleTag = function (tag) {\n this._change({\n state: this.state.resetPage().toggleTagRefinement(tag),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Increments the page number by one.\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n * @example\n * helper.setPage(0).nextPage().getPage();\n * // returns 1\n */\n\n\nAlgoliaSearchHelper.prototype.nextPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page + 1);\n};\n/**\n * Decrements the page number by one.\n * @fires change\n * @return {AlgoliaSearchHelper}\n * @chainable\n * @example\n * helper.setPage(1).previousPage().getPage();\n * // returns 0\n */\n\n\nAlgoliaSearchHelper.prototype.previousPage = function () {\n var page = this.state.page || 0;\n return this.setPage(page - 1);\n};\n/**\n * @private\n */\n\n\nfunction setCurrentPage(page) {\n if (page < 0) throw new Error('Page requested below 0.');\n\n this._change({\n state: this.state.setPage(page),\n isPageReset: false\n });\n\n return this;\n}\n/**\n * Change the current page\n * @deprecated\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.setCurrentPage = setCurrentPage;\n/**\n * Updates the current page.\n * @function\n * @param {number} page The page number\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\nAlgoliaSearchHelper.prototype.setPage = setCurrentPage;\n/**\n * Updates the name of the index that will be targeted by the query.\n *\n * This method resets the current page to 0.\n * @param {string} name the index name\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\nAlgoliaSearchHelper.prototype.setIndex = function (name) {\n this._change({\n state: this.state.resetPage().setIndex(name),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Update a parameter of the search. This method reset the page\n *\n * The complete list of parameters is available on the\n * [Algolia website](https://www.algolia.com/doc/rest#query-an-index).\n * The most commonly used parameters have their own [shortcuts](#query-parameters-shortcuts)\n * or benefit from higher-level APIs (all the kind of filters and facets have their own API)\n *\n * This method resets the current page to 0.\n * @param {string} parameter name of the parameter to update\n * @param {any} value new value of the parameter\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n * @example\n * helper.setQueryParameter('hitsPerPage', 20).search();\n */\n\n\nAlgoliaSearchHelper.prototype.setQueryParameter = function (parameter, value) {\n this._change({\n state: this.state.resetPage().setQueryParameter(parameter, value),\n isPageReset: true\n });\n\n return this;\n};\n/**\n * Set the whole state (warning: will erase previous state)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper}\n * @fires change\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.setState = function (newState) {\n this._change({\n state: SearchParameters.make(newState),\n isPageReset: false\n });\n\n return this;\n};\n/**\n * Override the current state without triggering a change event.\n * Do not use this method unless you know what you are doing. (see the example\n * for a legit use case)\n * @param {SearchParameters} newState the whole new state\n * @return {AlgoliaSearchHelper}\n * @example\n * helper.on('change', function(state){\n * // In this function you might want to find a way to store the state in the url/history\n * updateYourURL(state)\n * })\n * window.onpopstate = function(event){\n * // This is naive though as you should check if the state is really defined etc.\n * helper.overrideStateWithoutTriggeringChangeEvent(event.state).search()\n * }\n * @chainable\n */\n\n\nAlgoliaSearchHelper.prototype.overrideStateWithoutTriggeringChangeEvent = function (newState) {\n this.state = new SearchParameters(newState);\n return this;\n};\n/**\n * Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters.\n * @param {string} attribute the name of the attribute\n * @return {boolean} true if the attribute is filtered by at least one value\n * @example\n * // hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters\n * helper.hasRefinements('price'); // false\n * helper.addNumericRefinement('price', '>', 100);\n * helper.hasRefinements('price'); // true\n *\n * helper.hasRefinements('color'); // false\n * helper.addFacetRefinement('color', 'blue');\n * helper.hasRefinements('color'); // true\n *\n * helper.hasRefinements('material'); // false\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * helper.hasRefinements('material'); // true\n *\n * helper.hasRefinements('categories'); // false\n * helper.toggleFacetRefinement('categories', 'kitchen > knife');\n * helper.hasRefinements('categories'); // true\n *\n */\n\n\nAlgoliaSearchHelper.prototype.hasRefinements = function (attribute) {\n if (objectHasKeys(this.state.getNumericRefinements(attribute))) {\n return true;\n } else if (this.state.isConjunctiveFacet(attribute)) {\n return this.state.isFacetRefined(attribute);\n } else if (this.state.isDisjunctiveFacet(attribute)) {\n return this.state.isDisjunctiveFacetRefined(attribute);\n } else if (this.state.isHierarchicalFacet(attribute)) {\n return this.state.isHierarchicalFacetRefined(attribute);\n } // there's currently no way to know that the user did call `addNumericRefinement` at some point\n // thus we cannot distinguish if there once was a numeric refinement that was cleared\n // so we will return false in every other situations to be consistent\n // while what we should do here is throw because we did not find the attribute in any type\n // of refinement\n\n\n return false;\n};\n/**\n * Check if a value is excluded for a specific faceted attribute. If the value\n * is omitted then the function checks if there is any excluding refinements.\n *\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} [value] optional value. If passed will test that this value\n * is filtering the given facet.\n * @return {boolean} true if refined\n * @example\n * helper.isExcludeRefined('color'); // false\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // false\n *\n * helper.addFacetExclusion('color', 'red');\n *\n * helper.isExcludeRefined('color'); // true\n * helper.isExcludeRefined('color', 'blue') // false\n * helper.isExcludeRefined('color', 'red') // true\n */\n\n\nAlgoliaSearchHelper.prototype.isExcluded = function (facet, value) {\n return this.state.isExcludeRefined(facet, value);\n};\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}\n */\n\n\nAlgoliaSearchHelper.prototype.isDisjunctiveRefined = function (facet, value) {\n return this.state.isDisjunctiveFacetRefined(facet, value);\n};\n/**\n * Check if the string is a currently filtering tag.\n * @param {string} tag tag to check\n * @return {boolean}\n */\n\n\nAlgoliaSearchHelper.prototype.hasTag = function (tag) {\n return this.state.isTagRefined(tag);\n};\n/**\n * @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasTag}\n */\n\n\nAlgoliaSearchHelper.prototype.isTagRefined = function () {\n return this.hasTagRefinements.apply(this, arguments);\n};\n/**\n * Get the name of the currently used index.\n * @return {string}\n * @example\n * helper.setIndex('highestPrice_products').getIndex();\n * // returns 'highestPrice_products'\n */\n\n\nAlgoliaSearchHelper.prototype.getIndex = function () {\n return this.state.index;\n};\n\nfunction getCurrentPage() {\n return this.state.page;\n}\n/**\n * Get the currently selected page\n * @deprecated\n * @return {number} the current page\n */\n\n\nAlgoliaSearchHelper.prototype.getCurrentPage = getCurrentPage;\n/**\n * Get the currently selected page\n * @function\n * @return {number} the current page\n */\n\nAlgoliaSearchHelper.prototype.getPage = getCurrentPage;\n/**\n * Get all the tags currently set to filters the results.\n *\n * @return {string[]} The list of tags currently set.\n */\n\nAlgoliaSearchHelper.prototype.getTags = function () {\n return this.state.tagRefinements;\n};\n/**\n * Get the list of refinements for a given attribute. This method works with\n * conjunctive, disjunctive, excluding and numerical filters.\n *\n * See also SearchResults#getRefinements\n *\n * @param {string} facetName attribute name used for faceting\n * @return {Array.} All Refinement are objects that contain a value, and\n * a type. Numeric also contains an operator.\n * @example\n * helper.addNumericRefinement('price', '>', 100);\n * helper.getRefinements('price');\n * // [\n * // {\n * // \"value\": [\n * // 100\n * // ],\n * // \"operator\": \">\",\n * // \"type\": \"numeric\"\n * // }\n * // ]\n * @example\n * helper.addFacetRefinement('color', 'blue');\n * helper.addFacetExclusion('color', 'red');\n * helper.getRefinements('color');\n * // [\n * // {\n * // \"value\": \"blue\",\n * // \"type\": \"conjunctive\"\n * // },\n * // {\n * // \"value\": \"red\",\n * // \"type\": \"exclude\"\n * // }\n * // ]\n * @example\n * helper.addDisjunctiveFacetRefinement('material', 'plastic');\n * // [\n * // {\n * // \"value\": \"plastic\",\n * // \"type\": \"disjunctive\"\n * // }\n * // ]\n */\n\n\nAlgoliaSearchHelper.prototype.getRefinements = function (facetName) {\n var refinements = [];\n\n if (this.state.isConjunctiveFacet(facetName)) {\n var conjRefinements = this.state.getConjunctiveRefinements(facetName);\n conjRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'conjunctive'\n });\n });\n var excludeRefinements = this.state.getExcludeRefinements(facetName);\n excludeRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'exclude'\n });\n });\n } else if (this.state.isDisjunctiveFacet(facetName)) {\n var disjRefinements = this.state.getDisjunctiveRefinements(facetName);\n disjRefinements.forEach(function (r) {\n refinements.push({\n value: r,\n type: 'disjunctive'\n });\n });\n }\n\n var numericRefinements = this.state.getNumericRefinements(facetName);\n Object.keys(numericRefinements).forEach(function (operator) {\n var value = numericRefinements[operator];\n refinements.push({\n value: value,\n operator: operator,\n type: 'numeric'\n });\n });\n return refinements;\n};\n/**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\n\n\nAlgoliaSearchHelper.prototype.getNumericRefinement = function (attribute, operator) {\n return this.state.getNumericRefinement(attribute, operator);\n};\n/**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\n\n\nAlgoliaSearchHelper.prototype.getHierarchicalFacetBreadcrumb = function (facetName) {\n return this.state.getHierarchicalFacetBreadcrumb(facetName);\n}; // /////////// PRIVATE\n\n/**\n * Perform the underlying queries\n * @private\n * @return {undefined}\n * @fires search\n * @fires result\n * @fires error\n */\n\n\nAlgoliaSearchHelper.prototype._search = function (options) {\n var state = this.state;\n var states = [];\n var mainQueries = [];\n\n if (!options.onlyWithDerivedHelpers) {\n mainQueries = requestBuilder._getQueries(state.index, state);\n states.push({\n state: state,\n queriesCount: mainQueries.length,\n helper: this\n });\n this.emit('search', {\n state: state,\n results: this.lastResults\n });\n }\n\n var derivedQueries = this.derivedHelpers.map(function (derivedHelper) {\n var derivedState = derivedHelper.getModifiedState(state);\n\n var derivedStateQueries = requestBuilder._getQueries(derivedState.index, derivedState);\n\n states.push({\n state: derivedState,\n queriesCount: derivedStateQueries.length,\n helper: derivedHelper\n });\n derivedHelper.emit('search', {\n state: derivedState,\n results: derivedHelper.lastResults\n });\n return derivedStateQueries;\n });\n var queries = Array.prototype.concat.apply(mainQueries, derivedQueries);\n var queryId = this._queryId++;\n this._currentNbQueries++;\n\n try {\n this.client.search(queries).then(this._dispatchAlgoliaResponse.bind(this, states, queryId)).catch(this._dispatchAlgoliaError.bind(this, queryId));\n } catch (error) {\n // If we reach this part, we're in an internal error state\n this.emit('error', {\n error: error\n });\n }\n};\n/**\n * Transform the responses as sent by the server and transform them into a user\n * usable object that merge the results of all the batch requests. It will dispatch\n * over the different helper + derived helpers (when there are some).\n * @private\n * @param {array.<{SearchParameters, AlgoliaQueries, AlgoliaSearchHelper}>}\n * state state used for to generate the request\n * @param {number} queryId id of the current request\n * @param {object} content content of the response\n * @return {undefined}\n */\n\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaResponse = function (states, queryId, content) {\n // FIXME remove the number of outdated queries discarded instead of just one\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n var results = content.results.slice();\n states.forEach(function (s) {\n var state = s.state;\n var queriesCount = s.queriesCount;\n var helper = s.helper;\n var specificResults = results.splice(0, queriesCount);\n var formattedResponse = helper.lastResults = new SearchResults(state, specificResults);\n helper.emit('result', {\n results: formattedResponse,\n state: state\n });\n });\n};\n\nAlgoliaSearchHelper.prototype._dispatchAlgoliaError = function (queryId, error) {\n if (queryId < this._lastQueryIdReceived) {\n // Outdated answer\n return;\n }\n\n this._currentNbQueries -= queryId - this._lastQueryIdReceived;\n this._lastQueryIdReceived = queryId;\n this.emit('error', {\n error: error\n });\n if (this._currentNbQueries === 0) this.emit('searchQueueEmpty');\n};\n\nAlgoliaSearchHelper.prototype.containsRefinement = function (query, facetFilters, numericFilters, tagFilters) {\n return query || facetFilters.length !== 0 || numericFilters.length !== 0 || tagFilters.length !== 0;\n};\n/**\n * Test if there are some disjunctive refinements on the facet\n * @private\n * @param {string} facet the attribute to test\n * @return {boolean}\n */\n\n\nAlgoliaSearchHelper.prototype._hasDisjunctiveRefinements = function (facet) {\n return this.state.disjunctiveRefinements[facet] && this.state.disjunctiveRefinements[facet].length > 0;\n};\n\nAlgoliaSearchHelper.prototype._change = function (event) {\n var state = event.state;\n var isPageReset = event.isPageReset;\n\n if (state !== this.state) {\n this.state = state;\n this.emit('change', {\n state: this.state,\n results: this.lastResults,\n isPageReset: isPageReset\n });\n }\n};\n/**\n * Clears the cache of the underlying Algolia client.\n * @return {AlgoliaSearchHelper}\n */\n\n\nAlgoliaSearchHelper.prototype.clearCache = function () {\n this.client.clearCache && this.client.clearCache();\n return this;\n};\n/**\n * Updates the internal client instance. If the reference of the clients\n * are equal then no update is actually done.\n * @param {AlgoliaSearch} newClient an AlgoliaSearch client\n * @return {AlgoliaSearchHelper}\n */\n\n\nAlgoliaSearchHelper.prototype.setClient = function (newClient) {\n if (this.client === newClient) return this;\n\n if (typeof newClient.addAlgoliaAgent === 'function') {\n newClient.addAlgoliaAgent('JS Helper (' + version + ')');\n }\n\n this.client = newClient;\n return this;\n};\n/**\n * Gets the instance of the currently used client.\n * @return {AlgoliaSearch}\n */\n\n\nAlgoliaSearchHelper.prototype.getClient = function () {\n return this.client;\n};\n/**\n * Creates an derived instance of the Helper. A derived helper\n * is a way to request other indices synchronised with the lifecycle\n * of the main Helper. This mechanism uses the multiqueries feature\n * of Algolia to aggregate all the requests in a single network call.\n *\n * This method takes a function that is used to create a new SearchParameter\n * that will be used to create requests to Algolia. Those new requests\n * are created just before the `search` event. The signature of the function\n * is `SearchParameters -> SearchParameters`.\n *\n * This method returns a new DerivedHelper which is an EventEmitter\n * that fires the same `search`, `result` and `error` events. Those\n * events, however, will receive data specific to this DerivedHelper\n * and the SearchParameters that is returned by the call of the\n * parameter function.\n * @param {function} fn SearchParameters -> SearchParameters\n * @return {DerivedHelper}\n */\n\n\nAlgoliaSearchHelper.prototype.derive = function (fn) {\n var derivedHelper = new DerivedHelper(this, fn);\n this.derivedHelpers.push(derivedHelper);\n return derivedHelper;\n};\n/**\n * This method detaches a derived Helper from the main one. Prefer using the one from the\n * derived helper itself, to remove the event listeners too.\n * @private\n * @return {undefined}\n * @throws Error\n */\n\n\nAlgoliaSearchHelper.prototype.detachDerivedHelper = function (derivedHelper) {\n var pos = this.derivedHelpers.indexOf(derivedHelper);\n if (pos === -1) throw new Error('Derived helper already detached');\n this.derivedHelpers.splice(pos, 1);\n};\n/**\n * This method returns true if there is currently at least one on-going search.\n * @return {boolean} true if there is a search pending\n */\n\n\nAlgoliaSearchHelper.prototype.hasPendingRequests = function () {\n return this._currentNbQueries > 0;\n};\n/**\n * @typedef AlgoliaSearchHelper.NumericRefinement\n * @type {object}\n * @property {number[]} value the numbers that are used for filtering this attribute with\n * the operator specified.\n * @property {string} operator the faceting data: value, number of entries\n * @property {string} type will be 'numeric'\n */\n\n/**\n * @typedef AlgoliaSearchHelper.FacetRefinement\n * @type {object}\n * @property {string} value the string use to filter the attribute\n * @property {string} type the type of filter: 'conjunctive', 'disjunctive', 'exclude'\n */\n\n\nmodule.exports = AlgoliaSearchHelper;","\"use strict\";\n\nvar _slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\nmodule.exports = function (_ref) {\n var data = _ref.data;\n var multiSection = _ref.multiSection;\n\n function nextNonEmptySectionIndex(sectionIndex) {\n if (sectionIndex === null) {\n sectionIndex = 0;\n } else {\n sectionIndex++;\n }\n\n while (sectionIndex < data.length && data[sectionIndex] === 0) {\n sectionIndex++;\n }\n\n return sectionIndex === data.length ? null : sectionIndex;\n }\n\n function prevNonEmptySectionIndex(sectionIndex) {\n if (sectionIndex === null) {\n sectionIndex = data.length - 1;\n } else {\n sectionIndex--;\n }\n\n while (sectionIndex >= 0 && data[sectionIndex] === 0) {\n sectionIndex--;\n }\n\n return sectionIndex === -1 ? null : sectionIndex;\n }\n\n function next(position) {\n var _position = _slicedToArray(position, 2);\n\n var sectionIndex = _position[0];\n var itemIndex = _position[1];\n\n if (multiSection) {\n if (itemIndex === null || itemIndex === data[sectionIndex] - 1) {\n sectionIndex = nextNonEmptySectionIndex(sectionIndex);\n\n if (sectionIndex === null) {\n return [null, null];\n }\n\n return [sectionIndex, 0];\n }\n\n return [sectionIndex, itemIndex + 1];\n }\n\n if (data === 0 || itemIndex === data - 1) {\n return [null, null];\n }\n\n if (itemIndex === null) {\n return [null, 0];\n }\n\n return [null, itemIndex + 1];\n }\n\n function prev(position) {\n var _position2 = _slicedToArray(position, 2);\n\n var sectionIndex = _position2[0];\n var itemIndex = _position2[1];\n\n if (multiSection) {\n if (itemIndex === null || itemIndex === 0) {\n sectionIndex = prevNonEmptySectionIndex(sectionIndex);\n\n if (sectionIndex === null) {\n return [null, null];\n }\n\n return [sectionIndex, data[sectionIndex] - 1];\n }\n\n return [sectionIndex, itemIndex - 1];\n }\n\n if (data === 0 || itemIndex === 0) {\n return [null, null];\n }\n\n if (itemIndex === null) {\n return [null, data - 1];\n }\n\n return [null, itemIndex - 1];\n }\n\n function isLast(position) {\n return next(position)[1] === null;\n }\n\n return {\n next: next,\n prev: prev,\n isLast: isLast\n };\n};","'use strict';\n\nvar find = require('./find');\n/**\n * Transform sort format from user friendly notation to lodash format\n * @param {string[]} sortBy array of predicate of the form \"attribute:order\"\n * @param {string[]} [defaults] array of predicate of the form \"attribute:order\"\n * @return {array.} array containing 2 elements : attributes, orders\n */\n\n\nmodule.exports = function formatSort(sortBy, defaults) {\n var defaultInstructions = (defaults || []).map(function (sort) {\n return sort.split(':');\n });\n return sortBy.reduce(function preparePredicate(out, sort) {\n var sortInstruction = sort.split(':');\n var matchingDefault = find(defaultInstructions, function (defaultInstruction) {\n return defaultInstruction[0] === sortInstruction[0];\n });\n\n if (sortInstruction.length > 1 || !matchingDefault) {\n out[0].push(sortInstruction[0]);\n out[1].push(sortInstruction[1]);\n return out;\n }\n\n out[0].push(matchingDefault[0]);\n out[1].push(matchingDefault[1]);\n return out;\n }, [[], []]);\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _arrays = _interopRequireDefault(require(\"shallow-equal/arrays\"));\n\nvar _Autowhatever = _interopRequireDefault(require(\"./Autowhatever\"));\n\nvar _theme = require(\"./theme\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _createSuper(Derived) {\n return function () {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (_isNativeReflectConstruct()) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar alwaysTrue = function alwaysTrue() {\n return true;\n};\n\nvar defaultShouldRenderSuggestions = function defaultShouldRenderSuggestions(value) {\n return value.trim().length > 0;\n};\n\nvar defaultRenderSuggestionsContainer = function defaultRenderSuggestionsContainer(_ref) {\n var containerProps = _ref.containerProps,\n children = _ref.children;\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", containerProps, children);\n};\n\nvar REASON_SUGGESTIONS_REVEALED = 'suggestions-revealed';\nvar REASON_SUGGESTIONS_UPDATED = 'suggestions-updated';\nvar REASON_SUGGESTION_SELECTED = 'suggestion-selected';\nvar REASON_INPUT_FOCUSED = 'input-focused';\nvar REASON_INPUT_CHANGED = 'input-changed';\nvar REASON_INPUT_BLURRED = 'input-blurred';\nvar REASON_ESCAPE_PRESSED = 'escape-pressed';\n\nvar Autosuggest = /*#__PURE__*/function (_Component) {\n _inherits(Autosuggest, _Component);\n\n var _super = _createSuper(Autosuggest);\n\n function Autosuggest(_ref2) {\n var _this;\n\n var _alwaysRenderSuggestions = _ref2.alwaysRenderSuggestions;\n\n _classCallCheck(this, Autosuggest);\n\n _this = _super.call(this);\n\n _defineProperty(_assertThisInitialized(_this), \"onDocumentMouseDown\", function (event) {\n _this.justClickedOnSuggestionsContainer = false;\n var node = event.detail && event.detail.target || // This is for testing only. Please show me a better way to emulate this.\n event.target;\n\n while (node !== null && node !== document) {\n if (node.getAttribute && node.getAttribute('data-suggestion-index') !== null) {\n // Suggestion was clicked\n return;\n }\n\n if (node === _this.suggestionsContainer) {\n // Something else inside suggestions container was clicked\n _this.justClickedOnSuggestionsContainer = true;\n return;\n }\n\n node = node.parentNode;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"storeAutowhateverRef\", function (autowhatever) {\n if (autowhatever !== null) {\n _this.autowhatever = autowhatever;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionMouseEnter\", function (event, _ref3) {\n var sectionIndex = _ref3.sectionIndex,\n itemIndex = _ref3.itemIndex;\n\n _this.updateHighlightedSuggestion(sectionIndex, itemIndex);\n\n if (event.target === _this.pressedSuggestion) {\n _this.justSelectedSuggestion = true;\n }\n\n _this.justMouseEntered = true;\n setTimeout(function () {\n _this.justMouseEntered = false;\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"highlightFirstSuggestion\", function () {\n _this.updateHighlightedSuggestion(_this.props.multiSection ? 0 : null, 0);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onDocumentMouseUp\", function () {\n if (_this.pressedSuggestion && !_this.justSelectedSuggestion) {\n _this.input.focus();\n }\n\n _this.pressedSuggestion = null;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionMouseDown\", function (event) {\n // Checking if this.justSelectedSuggestion is already true to not duplicate touch events in chrome\n // See: https://github.com/facebook/react/issues/9809#issuecomment-413978405\n if (!_this.justSelectedSuggestion) {\n _this.justSelectedSuggestion = true;\n _this.pressedSuggestion = event.target;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionsClearRequested\", function () {\n var onSuggestionsClearRequested = _this.props.onSuggestionsClearRequested;\n onSuggestionsClearRequested && onSuggestionsClearRequested();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionSelected\", function (event, data) {\n var _this$props = _this.props,\n alwaysRenderSuggestions = _this$props.alwaysRenderSuggestions,\n onSuggestionSelected = _this$props.onSuggestionSelected,\n onSuggestionsFetchRequested = _this$props.onSuggestionsFetchRequested;\n onSuggestionSelected && onSuggestionSelected(event, data);\n\n var keepSuggestionsOnSelect = _this.props.shouldKeepSuggestionsOnSelect(data.suggestion);\n\n if (alwaysRenderSuggestions || keepSuggestionsOnSelect) {\n onSuggestionsFetchRequested({\n value: data.suggestionValue,\n reason: REASON_SUGGESTION_SELECTED\n });\n } else {\n _this.onSuggestionsClearRequested();\n }\n\n _this.resetHighlightedSuggestion();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionClick\", function (event) {\n var _this$props2 = _this.props,\n alwaysRenderSuggestions = _this$props2.alwaysRenderSuggestions,\n focusInputOnSuggestionClick = _this$props2.focusInputOnSuggestionClick;\n\n var _this$getSuggestionIn = _this.getSuggestionIndices(_this.findSuggestionElement(event.target)),\n sectionIndex = _this$getSuggestionIn.sectionIndex,\n suggestionIndex = _this$getSuggestionIn.suggestionIndex;\n\n var clickedSuggestion = _this.getSuggestion(sectionIndex, suggestionIndex);\n\n var clickedSuggestionValue = _this.props.getSuggestionValue(clickedSuggestion);\n\n _this.maybeCallOnChange(event, clickedSuggestionValue, 'click');\n\n _this.onSuggestionSelected(event, {\n suggestion: clickedSuggestion,\n suggestionValue: clickedSuggestionValue,\n suggestionIndex: suggestionIndex,\n sectionIndex: sectionIndex,\n method: 'click'\n });\n\n var keepSuggestionsOnSelect = _this.props.shouldKeepSuggestionsOnSelect(clickedSuggestion);\n\n if (!(alwaysRenderSuggestions || keepSuggestionsOnSelect)) {\n _this.closeSuggestions();\n }\n\n if (focusInputOnSuggestionClick === true) {\n _this.input.focus();\n } else {\n _this.onBlur();\n }\n\n setTimeout(function () {\n _this.justSelectedSuggestion = false;\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBlur\", function () {\n var _this$props3 = _this.props,\n inputProps = _this$props3.inputProps,\n shouldRenderSuggestions = _this$props3.shouldRenderSuggestions;\n var value = inputProps.value,\n onBlur = inputProps.onBlur;\n\n var highlightedSuggestion = _this.getHighlightedSuggestion();\n\n var shouldRender = shouldRenderSuggestions(value, REASON_INPUT_BLURRED);\n\n _this.setState({\n isFocused: false,\n highlightedSectionIndex: null,\n highlightedSuggestionIndex: null,\n highlightedSuggestion: null,\n valueBeforeUpDown: null,\n isCollapsed: !shouldRender\n });\n\n onBlur && onBlur(_this.blurEvent, {\n highlightedSuggestion: highlightedSuggestion\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionMouseLeave\", function (event) {\n _this.resetHighlightedSuggestion(false); // shouldResetValueBeforeUpDown\n\n\n if (_this.justSelectedSuggestion && event.target === _this.pressedSuggestion) {\n _this.justSelectedSuggestion = false;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionTouchStart\", function () {\n _this.justSelectedSuggestion = true; // todo: event.preventDefault when https://github.com/facebook/react/issues/2043\n // todo: gets released so onSuggestionMouseDown won't fire in chrome\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSuggestionTouchMove\", function () {\n _this.justSelectedSuggestion = false;\n _this.pressedSuggestion = null;\n\n _this.input.focus();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"itemProps\", function (_ref4) {\n var sectionIndex = _ref4.sectionIndex,\n itemIndex = _ref4.itemIndex;\n return {\n 'data-section-index': sectionIndex,\n 'data-suggestion-index': itemIndex,\n onMouseEnter: _this.onSuggestionMouseEnter,\n onMouseLeave: _this.onSuggestionMouseLeave,\n onMouseDown: _this.onSuggestionMouseDown,\n onTouchStart: _this.onSuggestionTouchStart,\n onTouchMove: _this.onSuggestionTouchMove,\n onClick: _this.onSuggestionClick\n };\n });\n\n _defineProperty(_assertThisInitialized(_this), \"renderSuggestionsContainer\", function (_ref5) {\n var containerProps = _ref5.containerProps,\n children = _ref5.children;\n var renderSuggestionsContainer = _this.props.renderSuggestionsContainer;\n return renderSuggestionsContainer({\n containerProps: containerProps,\n children: children,\n query: _this.getQuery()\n });\n });\n\n _this.state = {\n isFocused: false,\n isCollapsed: !_alwaysRenderSuggestions,\n highlightedSectionIndex: null,\n highlightedSuggestionIndex: null,\n highlightedSuggestion: null,\n valueBeforeUpDown: null\n };\n _this.justPressedUpDown = false;\n _this.justMouseEntered = false;\n _this.pressedSuggestion = null;\n return _this;\n }\n\n _createClass(Autosuggest, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n document.addEventListener('mousedown', this.onDocumentMouseDown);\n document.addEventListener('mouseup', this.onDocumentMouseUp);\n this.input = this.autowhatever.input;\n this.suggestionsContainer = this.autowhatever.itemsContainer;\n } // eslint-disable-next-line camelcase, react/sort-comp\n\n }, {\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n // When highlightFirstSuggestion becomes deactivated, if the first suggestion was\n // set, we should reset the suggestion back to the unselected default state.\n var shouldResetHighlighting = this.state.highlightedSuggestionIndex === 0 && this.props.highlightFirstSuggestion && !nextProps.highlightFirstSuggestion;\n\n if ((0, _arrays[\"default\"])(nextProps.suggestions, this.props.suggestions)) {\n if (nextProps.highlightFirstSuggestion && nextProps.suggestions.length > 0 && this.justPressedUpDown === false && this.justMouseEntered === false) {\n this.highlightFirstSuggestion();\n } else if (shouldResetHighlighting) {\n this.resetHighlightedSuggestion();\n }\n } else {\n if (this.willRenderSuggestions(nextProps, REASON_SUGGESTIONS_UPDATED)) {\n if (this.state.isCollapsed && !this.justSelectedSuggestion) {\n this.revealSuggestions();\n }\n\n if (shouldResetHighlighting) {\n this.resetHighlightedSuggestion();\n }\n } else {\n this.resetHighlightedSuggestion();\n }\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var _this$props4 = this.props,\n suggestions = _this$props4.suggestions,\n onSuggestionHighlighted = _this$props4.onSuggestionHighlighted,\n highlightFirstSuggestion = _this$props4.highlightFirstSuggestion;\n\n if (!(0, _arrays[\"default\"])(suggestions, prevProps.suggestions) && suggestions.length > 0 && highlightFirstSuggestion) {\n this.highlightFirstSuggestion();\n return;\n }\n\n if (onSuggestionHighlighted) {\n var highlightedSuggestion = this.getHighlightedSuggestion();\n var prevHighlightedSuggestion = prevState.highlightedSuggestion;\n\n if (highlightedSuggestion != prevHighlightedSuggestion) {\n onSuggestionHighlighted({\n suggestion: highlightedSuggestion\n });\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('mousedown', this.onDocumentMouseDown);\n document.removeEventListener('mouseup', this.onDocumentMouseUp);\n }\n }, {\n key: \"updateHighlightedSuggestion\",\n value: function updateHighlightedSuggestion(sectionIndex, suggestionIndex, prevValue) {\n var _this2 = this;\n\n this.setState(function (state) {\n var valueBeforeUpDown = state.valueBeforeUpDown;\n\n if (suggestionIndex === null) {\n valueBeforeUpDown = null;\n } else if (valueBeforeUpDown === null && typeof prevValue !== 'undefined') {\n valueBeforeUpDown = prevValue;\n }\n\n return {\n highlightedSectionIndex: sectionIndex,\n highlightedSuggestionIndex: suggestionIndex,\n highlightedSuggestion: suggestionIndex === null ? null : _this2.getSuggestion(sectionIndex, suggestionIndex),\n valueBeforeUpDown: valueBeforeUpDown\n };\n });\n }\n }, {\n key: \"resetHighlightedSuggestion\",\n value: function resetHighlightedSuggestion() {\n var shouldResetValueBeforeUpDown = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.setState(function (state) {\n var valueBeforeUpDown = state.valueBeforeUpDown;\n return {\n highlightedSectionIndex: null,\n highlightedSuggestionIndex: null,\n highlightedSuggestion: null,\n valueBeforeUpDown: shouldResetValueBeforeUpDown ? null : valueBeforeUpDown\n };\n });\n }\n }, {\n key: \"revealSuggestions\",\n value: function revealSuggestions() {\n this.setState({\n isCollapsed: false\n });\n }\n }, {\n key: \"closeSuggestions\",\n value: function closeSuggestions() {\n this.setState({\n highlightedSectionIndex: null,\n highlightedSuggestionIndex: null,\n highlightedSuggestion: null,\n valueBeforeUpDown: null,\n isCollapsed: true\n });\n }\n }, {\n key: \"getSuggestion\",\n value: function getSuggestion(sectionIndex, suggestionIndex) {\n var _this$props5 = this.props,\n suggestions = _this$props5.suggestions,\n multiSection = _this$props5.multiSection,\n getSectionSuggestions = _this$props5.getSectionSuggestions;\n\n if (multiSection) {\n return getSectionSuggestions(suggestions[sectionIndex])[suggestionIndex];\n }\n\n return suggestions[suggestionIndex];\n }\n }, {\n key: \"getHighlightedSuggestion\",\n value: function getHighlightedSuggestion() {\n var _this$state = this.state,\n highlightedSectionIndex = _this$state.highlightedSectionIndex,\n highlightedSuggestionIndex = _this$state.highlightedSuggestionIndex;\n\n if (highlightedSuggestionIndex === null) {\n return null;\n }\n\n return this.getSuggestion(highlightedSectionIndex, highlightedSuggestionIndex);\n }\n }, {\n key: \"getSuggestionValueByIndex\",\n value: function getSuggestionValueByIndex(sectionIndex, suggestionIndex) {\n var getSuggestionValue = this.props.getSuggestionValue;\n return getSuggestionValue(this.getSuggestion(sectionIndex, suggestionIndex));\n }\n }, {\n key: \"getSuggestionIndices\",\n value: function getSuggestionIndices(suggestionElement) {\n var sectionIndex = suggestionElement.getAttribute('data-section-index');\n var suggestionIndex = suggestionElement.getAttribute('data-suggestion-index');\n return {\n sectionIndex: typeof sectionIndex === 'string' ? parseInt(sectionIndex, 10) : null,\n suggestionIndex: parseInt(suggestionIndex, 10)\n };\n }\n }, {\n key: \"findSuggestionElement\",\n value: function findSuggestionElement(startNode) {\n var node = startNode;\n\n do {\n if (node.getAttribute && node.getAttribute('data-suggestion-index') !== null) {\n return node;\n }\n\n node = node.parentNode;\n } while (node !== null);\n\n console.error('Clicked element:', startNode); // eslint-disable-line no-console\n\n throw new Error(\"Couldn't find suggestion element\");\n }\n }, {\n key: \"maybeCallOnChange\",\n value: function maybeCallOnChange(event, newValue, method) {\n var _this$props$inputProp = this.props.inputProps,\n value = _this$props$inputProp.value,\n onChange = _this$props$inputProp.onChange;\n\n if (newValue !== value) {\n onChange(event, {\n newValue: newValue,\n method: method\n });\n }\n }\n }, {\n key: \"willRenderSuggestions\",\n value: function willRenderSuggestions(props, reason) {\n var suggestions = props.suggestions,\n inputProps = props.inputProps,\n shouldRenderSuggestions = props.shouldRenderSuggestions;\n var value = inputProps.value;\n return suggestions.length > 0 && shouldRenderSuggestions(value, reason);\n }\n }, {\n key: \"getQuery\",\n value: function getQuery() {\n var inputProps = this.props.inputProps;\n var value = inputProps.value;\n var valueBeforeUpDown = this.state.valueBeforeUpDown;\n return (valueBeforeUpDown === null ? value : valueBeforeUpDown).trim();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props6 = this.props,\n suggestions = _this$props6.suggestions,\n renderInputComponent = _this$props6.renderInputComponent,\n onSuggestionsFetchRequested = _this$props6.onSuggestionsFetchRequested,\n renderSuggestion = _this$props6.renderSuggestion,\n inputProps = _this$props6.inputProps,\n multiSection = _this$props6.multiSection,\n renderSectionTitle = _this$props6.renderSectionTitle,\n id = _this$props6.id,\n getSectionSuggestions = _this$props6.getSectionSuggestions,\n theme = _this$props6.theme,\n getSuggestionValue = _this$props6.getSuggestionValue,\n alwaysRenderSuggestions = _this$props6.alwaysRenderSuggestions,\n highlightFirstSuggestion = _this$props6.highlightFirstSuggestion,\n containerProps = _this$props6.containerProps;\n var _this$state2 = this.state,\n isFocused = _this$state2.isFocused,\n isCollapsed = _this$state2.isCollapsed,\n highlightedSectionIndex = _this$state2.highlightedSectionIndex,\n highlightedSuggestionIndex = _this$state2.highlightedSuggestionIndex,\n valueBeforeUpDown = _this$state2.valueBeforeUpDown;\n var shouldRenderSuggestions = alwaysRenderSuggestions ? alwaysTrue : this.props.shouldRenderSuggestions;\n var value = inputProps.value,\n _onFocus = inputProps.onFocus,\n _onKeyDown = inputProps.onKeyDown;\n var willRenderSuggestions = this.willRenderSuggestions(this.props, 'render');\n var isOpen = alwaysRenderSuggestions || isFocused && !isCollapsed && willRenderSuggestions;\n var items = isOpen ? suggestions : [];\n\n var autowhateverInputProps = _objectSpread({}, inputProps, {\n onFocus: function onFocus(event) {\n if (!_this3.justSelectedSuggestion && !_this3.justClickedOnSuggestionsContainer) {\n var shouldRender = shouldRenderSuggestions(value, REASON_INPUT_FOCUSED);\n\n _this3.setState({\n isFocused: true,\n isCollapsed: !shouldRender\n });\n\n _onFocus && _onFocus(event);\n\n if (shouldRender) {\n onSuggestionsFetchRequested({\n value: value,\n reason: REASON_INPUT_FOCUSED\n });\n }\n }\n },\n onBlur: function onBlur(event) {\n if (_this3.justClickedOnSuggestionsContainer) {\n _this3.input.focus();\n\n return;\n }\n\n _this3.blurEvent = event;\n\n if (!_this3.justSelectedSuggestion) {\n _this3.onBlur();\n\n _this3.onSuggestionsClearRequested();\n }\n },\n onChange: function onChange(event) {\n var value = event.target.value;\n var shouldRender = shouldRenderSuggestions(value, REASON_INPUT_CHANGED);\n\n _this3.maybeCallOnChange(event, value, 'type');\n\n if (_this3.suggestionsContainer) {\n _this3.suggestionsContainer.scrollTop = 0;\n }\n\n _this3.setState(_objectSpread({}, highlightFirstSuggestion ? {} : {\n highlightedSectionIndex: null,\n highlightedSuggestionIndex: null,\n highlightedSuggestion: null\n }, {\n valueBeforeUpDown: null,\n isCollapsed: !shouldRender\n }));\n\n if (shouldRender) {\n onSuggestionsFetchRequested({\n value: value,\n reason: REASON_INPUT_CHANGED\n });\n } else {\n _this3.onSuggestionsClearRequested();\n }\n },\n onKeyDown: function onKeyDown(event, data) {\n var keyCode = event.keyCode;\n\n switch (keyCode) {\n case 40: // ArrowDown\n\n case 38:\n // ArrowUp\n if (isCollapsed) {\n if (shouldRenderSuggestions(value, REASON_SUGGESTIONS_REVEALED)) {\n onSuggestionsFetchRequested({\n value: value,\n reason: REASON_SUGGESTIONS_REVEALED\n });\n\n _this3.revealSuggestions();\n\n event.preventDefault(); // We act on the key.\n }\n } else if (suggestions.length > 0) {\n var newHighlightedSectionIndex = data.newHighlightedSectionIndex,\n newHighlightedItemIndex = data.newHighlightedItemIndex;\n var newValue;\n\n if (newHighlightedItemIndex === null) {\n // valueBeforeUpDown can be null if, for example, user\n // hovers on the first suggestion and then pressed Up.\n // If that happens, use the original input value.\n newValue = valueBeforeUpDown === null ? value : valueBeforeUpDown;\n } else {\n newValue = _this3.getSuggestionValueByIndex(newHighlightedSectionIndex, newHighlightedItemIndex);\n }\n\n _this3.updateHighlightedSuggestion(newHighlightedSectionIndex, newHighlightedItemIndex, value);\n\n _this3.maybeCallOnChange(event, newValue, keyCode === 40 ? 'down' : 'up');\n\n event.preventDefault(); // We act on the key.\n }\n\n _this3.justPressedUpDown = true;\n setTimeout(function () {\n _this3.justPressedUpDown = false;\n });\n break;\n // Enter\n\n case 13:\n {\n // See #388\n if (event.keyCode === 229) {\n break;\n }\n\n var highlightedSuggestion = _this3.getHighlightedSuggestion();\n\n if (isOpen && !alwaysRenderSuggestions) {\n _this3.closeSuggestions();\n }\n\n if (highlightedSuggestion != null) {\n event.preventDefault();\n\n var _newValue = getSuggestionValue(highlightedSuggestion);\n\n _this3.maybeCallOnChange(event, _newValue, 'enter');\n\n _this3.onSuggestionSelected(event, {\n suggestion: highlightedSuggestion,\n suggestionValue: _newValue,\n suggestionIndex: highlightedSuggestionIndex,\n sectionIndex: highlightedSectionIndex,\n method: 'enter'\n });\n\n _this3.justSelectedSuggestion = true;\n setTimeout(function () {\n _this3.justSelectedSuggestion = false;\n });\n }\n\n break;\n }\n // Escape\n\n case 27:\n {\n if (isOpen) {\n // If input.type === 'search', the browser clears the input\n // when Escape is pressed. We want to disable this default\n // behaviour so that, when suggestions are shown, we just hide\n // them, without clearing the input.\n event.preventDefault();\n }\n\n var willCloseSuggestions = isOpen && !alwaysRenderSuggestions;\n\n if (valueBeforeUpDown === null) {\n // Didn't interact with Up/Down\n if (!willCloseSuggestions) {\n var _newValue2 = '';\n\n _this3.maybeCallOnChange(event, _newValue2, 'escape');\n\n if (shouldRenderSuggestions(_newValue2, REASON_ESCAPE_PRESSED)) {\n onSuggestionsFetchRequested({\n value: _newValue2,\n reason: REASON_ESCAPE_PRESSED\n });\n } else {\n _this3.onSuggestionsClearRequested();\n }\n }\n } else {\n // Interacted with Up/Down\n _this3.maybeCallOnChange(event, valueBeforeUpDown, 'escape');\n }\n\n if (willCloseSuggestions) {\n _this3.onSuggestionsClearRequested();\n\n _this3.closeSuggestions();\n } else {\n _this3.resetHighlightedSuggestion();\n }\n\n break;\n }\n }\n\n _onKeyDown && _onKeyDown(event);\n }\n });\n\n var renderSuggestionData = {\n query: this.getQuery()\n };\n return /*#__PURE__*/_react[\"default\"].createElement(_Autowhatever[\"default\"], {\n multiSection: multiSection,\n items: items,\n renderInputComponent: renderInputComponent,\n renderItemsContainer: this.renderSuggestionsContainer,\n renderItem: renderSuggestion,\n renderItemData: renderSuggestionData,\n renderSectionTitle: renderSectionTitle,\n getSectionItems: getSectionSuggestions,\n highlightedSectionIndex: highlightedSectionIndex,\n highlightedItemIndex: highlightedSuggestionIndex,\n containerProps: containerProps,\n inputProps: autowhateverInputProps,\n itemProps: this.itemProps,\n theme: (0, _theme.mapToAutowhateverTheme)(theme),\n id: id,\n ref: this.storeAutowhateverRef\n });\n }\n }]);\n\n return Autosuggest;\n}(_react.Component);\n\nexports[\"default\"] = Autosuggest;\n\n_defineProperty(Autosuggest, \"propTypes\", {\n suggestions: _propTypes[\"default\"].array.isRequired,\n onSuggestionsFetchRequested: function onSuggestionsFetchRequested(props, propName) {\n var onSuggestionsFetchRequested = props[propName];\n\n if (typeof onSuggestionsFetchRequested !== 'function') {\n throw new Error(\"'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp\");\n }\n },\n onSuggestionsClearRequested: function onSuggestionsClearRequested(props, propName) {\n var onSuggestionsClearRequested = props[propName];\n\n if (props.alwaysRenderSuggestions === false && typeof onSuggestionsClearRequested !== 'function') {\n throw new Error(\"'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp\");\n }\n },\n shouldKeepSuggestionsOnSelect: _propTypes[\"default\"].func,\n onSuggestionSelected: _propTypes[\"default\"].func,\n onSuggestionHighlighted: _propTypes[\"default\"].func,\n renderInputComponent: _propTypes[\"default\"].func,\n renderSuggestionsContainer: _propTypes[\"default\"].func,\n getSuggestionValue: _propTypes[\"default\"].func.isRequired,\n renderSuggestion: _propTypes[\"default\"].func.isRequired,\n inputProps: function inputProps(props, propName) {\n var inputProps = props[propName];\n\n if (!inputProps) {\n throw new Error(\"'inputProps' must be passed.\");\n }\n\n if (!Object.prototype.hasOwnProperty.call(inputProps, 'value')) {\n throw new Error(\"'inputProps' must have 'value'.\");\n }\n\n if (!Object.prototype.hasOwnProperty.call(inputProps, 'onChange')) {\n throw new Error(\"'inputProps' must have 'onChange'.\");\n }\n },\n shouldRenderSuggestions: _propTypes[\"default\"].func,\n alwaysRenderSuggestions: _propTypes[\"default\"].bool,\n multiSection: _propTypes[\"default\"].bool,\n renderSectionTitle: function renderSectionTitle(props, propName) {\n var renderSectionTitle = props[propName];\n\n if (props.multiSection === true && typeof renderSectionTitle !== 'function') {\n throw new Error(\"'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp\");\n }\n },\n getSectionSuggestions: function getSectionSuggestions(props, propName) {\n var getSectionSuggestions = props[propName];\n\n if (props.multiSection === true && typeof getSectionSuggestions !== 'function') {\n throw new Error(\"'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp\");\n }\n },\n focusInputOnSuggestionClick: _propTypes[\"default\"].bool,\n highlightFirstSuggestion: _propTypes[\"default\"].bool,\n theme: _propTypes[\"default\"].object,\n id: _propTypes[\"default\"].string,\n containerProps: _propTypes[\"default\"].object // Arbitrary container props\n\n});\n\n_defineProperty(Autosuggest, \"defaultProps\", {\n renderSuggestionsContainer: defaultRenderSuggestionsContainer,\n shouldRenderSuggestions: defaultShouldRenderSuggestions,\n alwaysRenderSuggestions: false,\n multiSection: false,\n shouldKeepSuggestionsOnSelect: function shouldKeepSuggestionsOnSelect() {\n return false;\n },\n focusInputOnSuggestionClick: true,\n highlightFirstSuggestion: false,\n theme: _theme.defaultTheme,\n id: '1',\n containerProps: {}\n});","/*! algoliasearch-lite.umd.js | 4.11.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */\n!function (e, t) {\n \"object\" == typeof exports && \"undefined\" != typeof module ? module.exports = t() : \"function\" == typeof define && define.amd ? define(t) : (e = e || self).algoliasearch = t();\n}(this, function () {\n \"use strict\";\n\n function e(e, t, r) {\n return t in e ? Object.defineProperty(e, t, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[t] = r, e;\n }\n\n function t(e, t) {\n var r = Object.keys(e);\n\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n t && (n = n.filter(function (t) {\n return Object.getOwnPropertyDescriptor(e, t).enumerable;\n })), r.push.apply(r, n);\n }\n\n return r;\n }\n\n function r(r) {\n for (var n = 1; n < arguments.length; n++) {\n var o = null != arguments[n] ? arguments[n] : {};\n n % 2 ? t(Object(o), !0).forEach(function (t) {\n e(r, t, o[t]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : t(Object(o)).forEach(function (e) {\n Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e));\n });\n }\n\n return r;\n }\n\n function n(e, t) {\n if (null == e) return {};\n\n var r,\n n,\n o = function (e, t) {\n if (null == e) return {};\n var r,\n n,\n o = {},\n a = Object.keys(e);\n\n for (n = 0; n < a.length; n++) {\n r = a[n], t.indexOf(r) >= 0 || (o[r] = e[r]);\n }\n\n return o;\n }(e, t);\n\n if (Object.getOwnPropertySymbols) {\n var a = Object.getOwnPropertySymbols(e);\n\n for (n = 0; n < a.length; n++) {\n r = a[n], t.indexOf(r) >= 0 || Object.prototype.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);\n }\n }\n\n return o;\n }\n\n function o(e, t) {\n return function (e) {\n if (Array.isArray(e)) return e;\n }(e) || function (e, t) {\n if (!(Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e))) return;\n var r = [],\n n = !0,\n o = !1,\n a = void 0;\n\n try {\n for (var u, i = e[Symbol.iterator](); !(n = (u = i.next()).done) && (r.push(u.value), !t || r.length !== t); n = !0) {\n ;\n }\n } catch (e) {\n o = !0, a = e;\n } finally {\n try {\n n || null == i.return || i.return();\n } finally {\n if (o) throw a;\n }\n }\n\n return r;\n }(e, t) || function () {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }();\n }\n\n function a(e) {\n return function (e) {\n if (Array.isArray(e)) {\n for (var t = 0, r = new Array(e.length); t < e.length; t++) {\n r[t] = e[t];\n }\n\n return r;\n }\n }(e) || function (e) {\n if (Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e)) return Array.from(e);\n }(e) || function () {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }();\n }\n\n function u(e) {\n var t,\n r = \"algoliasearch-client-js-\".concat(e.key),\n n = function n() {\n return void 0 === t && (t = e.localStorage || window.localStorage), t;\n },\n a = function a() {\n return JSON.parse(n().getItem(r) || \"{}\");\n };\n\n return {\n get: function get(e, t) {\n var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n };\n return Promise.resolve().then(function () {\n var r = JSON.stringify(e),\n n = a()[r];\n return Promise.all([n || t(), void 0 !== n]);\n }).then(function (e) {\n var t = o(e, 2),\n n = t[0],\n a = t[1];\n return Promise.all([n, a || r.miss(n)]);\n }).then(function (e) {\n return o(e, 1)[0];\n });\n },\n set: function set(e, t) {\n return Promise.resolve().then(function () {\n var o = a();\n return o[JSON.stringify(e)] = t, n().setItem(r, JSON.stringify(o)), t;\n });\n },\n delete: function _delete(e) {\n return Promise.resolve().then(function () {\n var t = a();\n delete t[JSON.stringify(e)], n().setItem(r, JSON.stringify(t));\n });\n },\n clear: function clear() {\n return Promise.resolve().then(function () {\n n().removeItem(r);\n });\n }\n };\n }\n\n function i(e) {\n var t = a(e.caches),\n r = t.shift();\n return void 0 === r ? {\n get: function get(e, t) {\n var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n },\n n = t();\n return n.then(function (e) {\n return Promise.all([e, r.miss(e)]);\n }).then(function (e) {\n return o(e, 1)[0];\n });\n },\n set: function set(e, t) {\n return Promise.resolve(t);\n },\n delete: function _delete(e) {\n return Promise.resolve();\n },\n clear: function clear() {\n return Promise.resolve();\n }\n } : {\n get: function get(e, n) {\n var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n };\n return r.get(e, n, o).catch(function () {\n return i({\n caches: t\n }).get(e, n, o);\n });\n },\n set: function set(e, n) {\n return r.set(e, n).catch(function () {\n return i({\n caches: t\n }).set(e, n);\n });\n },\n delete: function _delete(e) {\n return r.delete(e).catch(function () {\n return i({\n caches: t\n }).delete(e);\n });\n },\n clear: function clear() {\n return r.clear().catch(function () {\n return i({\n caches: t\n }).clear();\n });\n }\n };\n }\n\n function s() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {\n serializable: !0\n },\n t = {};\n return {\n get: function get(r, n) {\n var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n },\n a = JSON.stringify(r);\n if (a in t) return Promise.resolve(e.serializable ? JSON.parse(t[a]) : t[a]);\n\n var u = n(),\n i = o && o.miss || function () {\n return Promise.resolve();\n };\n\n return u.then(function (e) {\n return i(e);\n }).then(function () {\n return u;\n });\n },\n set: function set(r, n) {\n return t[JSON.stringify(r)] = e.serializable ? JSON.stringify(n) : n, Promise.resolve(n);\n },\n delete: function _delete(e) {\n return delete t[JSON.stringify(e)], Promise.resolve();\n },\n clear: function clear() {\n return t = {}, Promise.resolve();\n }\n };\n }\n\n function c(e) {\n for (var t = e.length - 1; t > 0; t--) {\n var r = Math.floor(Math.random() * (t + 1)),\n n = e[t];\n e[t] = e[r], e[r] = n;\n }\n\n return e;\n }\n\n function l(e, t) {\n return t ? (Object.keys(t).forEach(function (r) {\n e[r] = t[r](e);\n }), e) : e;\n }\n\n function f(e) {\n for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++) {\n r[n - 1] = arguments[n];\n }\n\n var o = 0;\n return e.replace(/%s/g, function () {\n return encodeURIComponent(r[o++]);\n });\n }\n\n var h = {\n WithinQueryParameters: 0,\n WithinHeaders: 1\n };\n\n function d(e, t) {\n var r = e || {},\n n = r.data || {};\n return Object.keys(r).forEach(function (e) {\n -1 === [\"timeout\", \"headers\", \"queryParameters\", \"data\", \"cacheable\"].indexOf(e) && (n[e] = r[e]);\n }), {\n data: Object.entries(n).length > 0 ? n : void 0,\n timeout: r.timeout || t,\n headers: r.headers || {},\n queryParameters: r.queryParameters || {},\n cacheable: r.cacheable\n };\n }\n\n var m = {\n Read: 1,\n Write: 2,\n Any: 3\n },\n p = 1,\n v = 2,\n y = 3;\n\n function g(e) {\n var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : p;\n return r(r({}, e), {}, {\n status: t,\n lastUpdate: Date.now()\n });\n }\n\n function b(e) {\n return \"string\" == typeof e ? {\n protocol: \"https\",\n url: e,\n accept: m.Any\n } : {\n protocol: e.protocol || \"https\",\n url: e.url,\n accept: e.accept || m.Any\n };\n }\n\n var O = \"GET\",\n P = \"POST\";\n\n function q(e, t) {\n return Promise.all(t.map(function (t) {\n return e.get(t, function () {\n return Promise.resolve(g(t));\n });\n })).then(function (e) {\n var r = e.filter(function (e) {\n return function (e) {\n return e.status === p || Date.now() - e.lastUpdate > 12e4;\n }(e);\n }),\n n = e.filter(function (e) {\n return function (e) {\n return e.status === y && Date.now() - e.lastUpdate <= 12e4;\n }(e);\n }),\n o = [].concat(a(r), a(n));\n return {\n getTimeout: function getTimeout(e, t) {\n return (0 === n.length && 0 === e ? 1 : n.length + 3 + e) * t;\n },\n statelessHosts: o.length > 0 ? o.map(function (e) {\n return b(e);\n }) : t\n };\n });\n }\n\n function w(e, t, n, o) {\n var u = [],\n i = function (e, t) {\n if (e.method === O || void 0 === e.data && void 0 === t.data) return;\n var n = Array.isArray(e.data) ? e.data : r(r({}, e.data), t.data);\n return JSON.stringify(n);\n }(n, o),\n s = function (e, t) {\n var n = r(r({}, e.headers), t.headers),\n o = {};\n return Object.keys(n).forEach(function (e) {\n var t = n[e];\n o[e.toLowerCase()] = t;\n }), o;\n }(e, o),\n c = n.method,\n l = n.method !== O ? {} : r(r({}, n.data), o.data),\n f = r(r(r({\n \"x-algolia-agent\": e.userAgent.value\n }, e.queryParameters), l), o.queryParameters),\n h = 0,\n d = function t(r, a) {\n var l = r.pop();\n if (void 0 === l) throw {\n name: \"RetryError\",\n message: \"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.\",\n transporterStackTrace: A(u)\n };\n\n var d = {\n data: i,\n headers: s,\n method: c,\n url: S(l, n.path, f),\n connectTimeout: a(h, e.timeouts.connect),\n responseTimeout: a(h, o.timeout)\n },\n m = function m(e) {\n var t = {\n request: d,\n response: e,\n host: l,\n triesLeft: r.length\n };\n return u.push(t), t;\n },\n p = {\n onSuccess: function onSuccess(e) {\n return function (e) {\n try {\n return JSON.parse(e.content);\n } catch (t) {\n throw function (e, t) {\n return {\n name: \"DeserializationError\",\n message: e,\n response: t\n };\n }(t.message, e);\n }\n }(e);\n },\n onRetry: function onRetry(n) {\n var o = m(n);\n return n.isTimedOut && h++, Promise.all([e.logger.info(\"Retryable failure\", x(o)), e.hostsCache.set(l, g(l, n.isTimedOut ? y : v))]).then(function () {\n return t(r, a);\n });\n },\n onFail: function onFail(e) {\n throw m(e), function (e, t) {\n var r = e.content,\n n = e.status,\n o = r;\n\n try {\n o = JSON.parse(r).message;\n } catch (e) {}\n\n return function (e, t, r) {\n return {\n name: \"ApiError\",\n message: e,\n status: t,\n transporterStackTrace: r\n };\n }(o, n, t);\n }(e, A(u));\n }\n };\n\n return e.requester.send(d).then(function (e) {\n return function (e, t) {\n return function (e) {\n var t = e.status;\n return e.isTimedOut || function (e) {\n var t = e.isTimedOut,\n r = e.status;\n return !t && 0 == ~~r;\n }(e) || 2 != ~~(t / 100) && 4 != ~~(t / 100);\n }(e) ? t.onRetry(e) : 2 == ~~(e.status / 100) ? t.onSuccess(e) : t.onFail(e);\n }(e, p);\n });\n };\n\n return q(e.hostsCache, t).then(function (e) {\n return d(a(e.statelessHosts).reverse(), e.getTimeout);\n });\n }\n\n function j(e) {\n var t = {\n value: \"Algolia for JavaScript (\".concat(e, \")\"),\n add: function add(e) {\n var r = \"; \".concat(e.segment).concat(void 0 !== e.version ? \" (\".concat(e.version, \")\") : \"\");\n return -1 === t.value.indexOf(r) && (t.value = \"\".concat(t.value).concat(r)), t;\n }\n };\n return t;\n }\n\n function S(e, t, r) {\n var n = T(r),\n o = \"\".concat(e.protocol, \"://\").concat(e.url, \"/\").concat(\"/\" === t.charAt(0) ? t.substr(1) : t);\n return n.length && (o += \"?\".concat(n)), o;\n }\n\n function T(e) {\n return Object.keys(e).map(function (t) {\n return f(\"%s=%s\", t, (r = e[t], \"[object Object]\" === Object.prototype.toString.call(r) || \"[object Array]\" === Object.prototype.toString.call(r) ? JSON.stringify(e[t]) : e[t]));\n var r;\n }).join(\"&\");\n }\n\n function A(e) {\n return e.map(function (e) {\n return x(e);\n });\n }\n\n function x(e) {\n var t = e.request.headers[\"x-algolia-api-key\"] ? {\n \"x-algolia-api-key\": \"*****\"\n } : {};\n return r(r({}, e), {}, {\n request: r(r({}, e.request), {}, {\n headers: r(r({}, e.request.headers), t)\n })\n });\n }\n\n var N = function N(e) {\n var t = e.appId,\n n = function (e, t, r) {\n var n = {\n \"x-algolia-api-key\": r,\n \"x-algolia-application-id\": t\n };\n return {\n headers: function headers() {\n return e === h.WithinHeaders ? n : {};\n },\n queryParameters: function queryParameters() {\n return e === h.WithinQueryParameters ? n : {};\n }\n };\n }(void 0 !== e.authMode ? e.authMode : h.WithinHeaders, t, e.apiKey),\n a = function (e) {\n var t = e.hostsCache,\n r = e.logger,\n n = e.requester,\n a = e.requestsCache,\n u = e.responsesCache,\n i = e.timeouts,\n s = e.userAgent,\n c = e.hosts,\n l = e.queryParameters,\n f = {\n hostsCache: t,\n logger: r,\n requester: n,\n requestsCache: a,\n responsesCache: u,\n timeouts: i,\n userAgent: s,\n headers: e.headers,\n queryParameters: l,\n hosts: c.map(function (e) {\n return b(e);\n }),\n read: function read(e, t) {\n var r = d(t, f.timeouts.read),\n n = function n() {\n return w(f, f.hosts.filter(function (e) {\n return 0 != (e.accept & m.Read);\n }), e, r);\n };\n\n if (!0 !== (void 0 !== r.cacheable ? r.cacheable : e.cacheable)) return n();\n var a = {\n request: e,\n mappedRequestOptions: r,\n transporter: {\n queryParameters: f.queryParameters,\n headers: f.headers\n }\n };\n return f.responsesCache.get(a, function () {\n return f.requestsCache.get(a, function () {\n return f.requestsCache.set(a, n()).then(function (e) {\n return Promise.all([f.requestsCache.delete(a), e]);\n }, function (e) {\n return Promise.all([f.requestsCache.delete(a), Promise.reject(e)]);\n }).then(function (e) {\n var t = o(e, 2);\n t[0];\n return t[1];\n });\n });\n }, {\n miss: function miss(e) {\n return f.responsesCache.set(a, e);\n }\n });\n },\n write: function write(e, t) {\n return w(f, f.hosts.filter(function (e) {\n return 0 != (e.accept & m.Write);\n }), e, d(t, f.timeouts.write));\n }\n };\n return f;\n }(r(r({\n hosts: [{\n url: \"\".concat(t, \"-dsn.algolia.net\"),\n accept: m.Read\n }, {\n url: \"\".concat(t, \".algolia.net\"),\n accept: m.Write\n }].concat(c([{\n url: \"\".concat(t, \"-1.algolianet.com\")\n }, {\n url: \"\".concat(t, \"-2.algolianet.com\")\n }, {\n url: \"\".concat(t, \"-3.algolianet.com\")\n }]))\n }, e), {}, {\n headers: r(r(r({}, n.headers()), {\n \"content-type\": \"application/x-www-form-urlencoded\"\n }), e.headers),\n queryParameters: r(r({}, n.queryParameters()), e.queryParameters)\n }));\n\n return l({\n transporter: a,\n appId: t,\n addAlgoliaAgent: function addAlgoliaAgent(e, t) {\n a.userAgent.add({\n segment: e,\n version: t\n });\n },\n clearCache: function clearCache() {\n return Promise.all([a.requestsCache.clear(), a.responsesCache.clear()]).then(function () {});\n }\n }, e.methods);\n },\n C = function C(e) {\n return function (t, r) {\n return t.method === O ? e.transporter.read(t, r) : e.transporter.write(t, r);\n };\n },\n k = function k(e) {\n return function (t) {\n var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},\n n = {\n transporter: e.transporter,\n appId: e.appId,\n indexName: t\n };\n return l(n, r.methods);\n };\n },\n J = function J(e) {\n return function (t, n) {\n var o = t.map(function (e) {\n return r(r({}, e), {}, {\n params: T(e.params || {})\n });\n });\n return e.transporter.read({\n method: P,\n path: \"1/indexes/*/queries\",\n data: {\n requests: o\n },\n cacheable: !0\n }, n);\n };\n },\n E = function E(e) {\n return function (t, o) {\n return Promise.all(t.map(function (t) {\n var a = t.params,\n u = a.facetName,\n i = a.facetQuery,\n s = n(a, [\"facetName\", \"facetQuery\"]);\n return k(e)(t.indexName, {\n methods: {\n searchForFacetValues: R\n }\n }).searchForFacetValues(u, i, r(r({}, o), s));\n }));\n };\n },\n I = function I(e) {\n return function (t, r, n) {\n return e.transporter.read({\n method: P,\n path: f(\"1/answers/%s/prediction\", e.indexName),\n data: {\n query: t,\n queryLanguages: r\n },\n cacheable: !0\n }, n);\n };\n },\n F = function F(e) {\n return function (t, r) {\n return e.transporter.read({\n method: P,\n path: f(\"1/indexes/%s/query\", e.indexName),\n data: {\n query: t\n },\n cacheable: !0\n }, r);\n };\n },\n R = function R(e) {\n return function (t, r, n) {\n return e.transporter.read({\n method: P,\n path: f(\"1/indexes/%s/facets/%s/query\", e.indexName, t),\n data: {\n facetQuery: r\n },\n cacheable: !0\n }, n);\n };\n },\n D = 1,\n W = 2,\n H = 3;\n\n function Q(e, t, n) {\n var o,\n a = {\n appId: e,\n apiKey: t,\n timeouts: {\n connect: 1,\n read: 2,\n write: 30\n },\n requester: {\n send: function send(e) {\n return new Promise(function (t) {\n var r = new XMLHttpRequest();\n r.open(e.method, e.url, !0), Object.keys(e.headers).forEach(function (t) {\n return r.setRequestHeader(t, e.headers[t]);\n });\n\n var n,\n o = function o(e, n) {\n return setTimeout(function () {\n r.abort(), t({\n status: 0,\n content: n,\n isTimedOut: !0\n });\n }, 1e3 * e);\n },\n a = o(e.connectTimeout, \"Connection timeout\");\n\n r.onreadystatechange = function () {\n r.readyState > r.OPENED && void 0 === n && (clearTimeout(a), n = o(e.responseTimeout, \"Socket timeout\"));\n }, r.onerror = function () {\n 0 === r.status && (clearTimeout(a), clearTimeout(n), t({\n content: r.responseText || \"Network request failed\",\n status: r.status,\n isTimedOut: !1\n }));\n }, r.onload = function () {\n clearTimeout(a), clearTimeout(n), t({\n content: r.responseText,\n status: r.status,\n isTimedOut: !1\n });\n }, r.send(e.data);\n });\n }\n },\n logger: (o = H, {\n debug: function debug(e, t) {\n return D >= o && console.debug(e, t), Promise.resolve();\n },\n info: function info(e, t) {\n return W >= o && console.info(e, t), Promise.resolve();\n },\n error: function error(e, t) {\n return console.error(e, t), Promise.resolve();\n }\n }),\n responsesCache: s(),\n requestsCache: s({\n serializable: !1\n }),\n hostsCache: i({\n caches: [u({\n key: \"\".concat(\"4.11.0\", \"-\").concat(e)\n }), s()]\n }),\n userAgent: j(\"4.11.0\").add({\n segment: \"Browser\",\n version: \"lite\"\n }),\n authMode: h.WithinQueryParameters\n };\n return N(r(r(r({}, a), n), {}, {\n methods: {\n search: J,\n searchForFacetValues: E,\n multipleQueries: J,\n multipleSearchForFacetValues: E,\n customRequest: C,\n initIndex: function initIndex(e) {\n return function (t) {\n return k(e)(t, {\n methods: {\n search: F,\n searchForFacetValues: R,\n findAnswers: I\n }\n });\n };\n }\n }\n }));\n }\n\n return Q.version = \"4.11.0\", Q;\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n} // From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js\n\n\nexport var shallowEqual = function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } // Test for A's keys different from B.\n\n\n var hasOwn = Object.prototype.hasOwnProperty;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) {\n return false;\n }\n }\n\n return true;\n};\nexport var getDisplayName = function getDisplayName(Component) {\n return Component.displayName || Component.name || 'UnknownComponent';\n};\nvar resolved = Promise.resolve();\nexport var defer = function defer(f) {\n resolved.then(f);\n};\n\nvar isPlainObject = function isPlainObject(value) {\n return _typeof(value) === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport var removeEmptyKey = function removeEmptyKey(obj) {\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n\n if (!isPlainObject(value)) {\n return;\n }\n\n if (!objectHasKeys(value)) {\n delete obj[key];\n } else {\n removeEmptyKey(value);\n }\n });\n return obj;\n};\nexport var removeEmptyArraysFromObject = function removeEmptyArraysFromObject(obj) {\n Object.keys(obj).forEach(function (key) {\n var value = obj[key];\n\n if (Array.isArray(value) && value.length === 0) {\n delete obj[key];\n }\n });\n return obj;\n};\nexport function addAbsolutePositions(hits, hitsPerPage, page) {\n return hits.map(function (hit, index) {\n return _objectSpread(_objectSpread({}, hit), {}, {\n __position: hitsPerPage * page + index + 1\n });\n });\n}\nexport function addQueryID(hits, queryID) {\n if (!queryID) {\n return hits;\n }\n\n return hits.map(function (hit) {\n return _objectSpread(_objectSpread({}, hit), {}, {\n __queryID: queryID\n });\n });\n}\nexport function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n\n return undefined;\n}\nexport function objectHasKeys(object) {\n return object && Object.keys(object).length > 0;\n} // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\n\nexport function omit(source, excluded) {\n if (source === null || source === undefined) {\n return {};\n }\n\n var target = {};\n var sourceKeys = Object.keys(source);\n\n for (var i = 0; i < sourceKeys.length; i++) {\n var _key = sourceKeys[i];\n\n if (excluded.indexOf(_key) >= 0) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n target[_key] = source[_key];\n }\n\n return target;\n}\n/**\n * Retrieve the value at a path of the object:\n *\n * @example\n * getPropertyByPath(\n * { test: { this: { function: [{ now: { everyone: true } }] } } },\n * 'test.this.function[0].now.everyone'\n * ); // true\n *\n * getPropertyByPath(\n * { test: { this: { function: [{ now: { everyone: true } }] } } },\n * ['test', 'this', 'function', 0, 'now', 'everyone']\n * ); // true\n *\n * @param object Source object to query\n * @param path either an array of properties, or a string form of the properties, separated by .\n */\n\nexport var getPropertyByPath = function getPropertyByPath(object, path) {\n return (Array.isArray(path) ? path : path.replace(/\\[(\\d+)]/g, '.$1').split('.')).reduce(function (current, key) {\n return current ? current[key] : undefined;\n }, object);\n};\nexport function getObjectType(object) {\n return Object.prototype.toString.call(object).slice(8, -1);\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","'use strict';\n\nfunction clone(value) {\n if (typeof value === 'object' && value !== null) {\n return _merge(Array.isArray(value) ? [] : {}, value);\n }\n\n return value;\n}\n\nfunction isObjectOrArrayOrFunction(value) {\n return typeof value === 'function' || Array.isArray(value) || Object.prototype.toString.call(value) === '[object Object]';\n}\n\nfunction _merge(target, source) {\n if (target === source) {\n return target;\n }\n\n for (var key in source) {\n if (!Object.prototype.hasOwnProperty.call(source, key) || key === '__proto__') {\n continue;\n }\n\n var sourceVal = source[key];\n var targetVal = target[key];\n\n if (typeof targetVal !== 'undefined' && typeof sourceVal === 'undefined') {\n continue;\n }\n\n if (isObjectOrArrayOrFunction(targetVal) && isObjectOrArrayOrFunction(sourceVal)) {\n target[key] = _merge(targetVal, sourceVal);\n } else {\n target[key] = clone(sourceVal);\n }\n }\n\n return target;\n}\n/**\n * This method is like Object.assign, but recursively merges own and inherited\n * enumerable keyed properties of source objects into the destination object.\n *\n * NOTE: this behaves like lodash/merge, but:\n * - does mutate functions if they are a source\n * - treats non-plain objects as plain\n * - does not work for circular objects\n * - treats sparse arrays as sparse\n * - does not convert Array-like objects (Arguments, NodeLists, etc.) to arrays\n *\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n */\n\n\nfunction merge(target) {\n if (!isObjectOrArrayOrFunction(target)) {\n target = {};\n }\n\n for (var i = 1, l = arguments.length; i < l; i++) {\n var source = arguments[i];\n\n if (isObjectOrArrayOrFunction(source)) {\n _merge(target, source);\n }\n }\n\n return target;\n}\n\nmodule.exports = merge;","'use strict'; // @MAJOR can be replaced by native Array#find when we change support\n\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n};","'use strict';\n/**\n * Functions to manipulate refinement lists\n *\n * The RefinementList is not formally defined through a prototype but is based\n * on a specific structure.\n *\n * @module SearchParameters.refinementList\n *\n * @typedef {string[]} SearchParameters.refinementList.Refinements\n * @typedef {Object.} SearchParameters.refinementList.RefinementList\n */\n\nvar defaultsPure = require('../functions/defaultsPure');\n\nvar omit = require('../functions/omit');\n\nvar objectHasKeys = require('../functions/objectHasKeys');\n\nvar lib = {\n /**\n * Adds a refinement to a RefinementList\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} value the value of the refinement, if the value is not a string it will be converted\n * @return {RefinementList} a new and updated refinement list\n */\n addRefinement: function addRefinement(refinementList, attribute, value) {\n if (lib.isRefined(refinementList, attribute, value)) {\n return refinementList;\n }\n\n var valueAsString = '' + value;\n var facetRefinement = !refinementList[attribute] ? [valueAsString] : refinementList[attribute].concat(valueAsString);\n var mod = {};\n mod[attribute] = facetRefinement;\n return defaultsPure({}, mod, refinementList);\n },\n\n /**\n * Removes refinement(s) for an attribute:\n * - if the value is specified removes the refinement for the value on the attribute\n * - if no value is specified removes all the refinements for this attribute\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} [value] the value of the refinement\n * @return {RefinementList} a new and updated refinement lst\n */\n removeRefinement: function removeRefinement(refinementList, attribute, value) {\n if (value === undefined) {\n // we use the \"filter\" form of clearRefinement, since it leaves empty values as-is\n // the form with a string will remove the attribute completely\n return lib.clearRefinement(refinementList, function (v, f) {\n return attribute === f;\n });\n }\n\n var valueAsString = '' + value;\n return lib.clearRefinement(refinementList, function (v, f) {\n return attribute === f && valueAsString === v;\n });\n },\n\n /**\n * Toggles the refinement value for an attribute.\n * @param {RefinementList} refinementList the initial list\n * @param {string} attribute the attribute to refine\n * @param {string} value the value of the refinement\n * @return {RefinementList} a new and updated list\n */\n toggleRefinement: function toggleRefinement(refinementList, attribute, value) {\n if (value === undefined) throw new Error('toggleRefinement should be used with a value');\n\n if (lib.isRefined(refinementList, attribute, value)) {\n return lib.removeRefinement(refinementList, attribute, value);\n }\n\n return lib.addRefinement(refinementList, attribute, value);\n },\n\n /**\n * Clear all or parts of a RefinementList. Depending on the arguments, three\n * kinds of behavior can happen:\n * - if no attribute is provided: clears the whole list\n * - if an attribute is provided as a string: clears the list for the specific attribute\n * - if an attribute is provided as a function: discards the elements for which the function returns true\n * @param {RefinementList} refinementList the initial list\n * @param {string} [attribute] the attribute or function to discard\n * @param {string} [refinementType] optional parameter to give more context to the attribute function\n * @return {RefinementList} a new and updated refinement list\n */\n clearRefinement: function clearRefinement(refinementList, attribute, refinementType) {\n if (attribute === undefined) {\n if (!objectHasKeys(refinementList)) {\n return refinementList;\n }\n\n return {};\n } else if (typeof attribute === 'string') {\n return omit(refinementList, [attribute]);\n } else if (typeof attribute === 'function') {\n var hasChanged = false;\n var newRefinementList = Object.keys(refinementList).reduce(function (memo, key) {\n var values = refinementList[key] || [];\n var facetList = values.filter(function (value) {\n return !attribute(value, key, refinementType);\n });\n\n if (facetList.length !== values.length) {\n hasChanged = true;\n }\n\n memo[key] = facetList;\n return memo;\n }, {});\n if (hasChanged) return newRefinementList;\n return refinementList;\n }\n },\n\n /**\n * Test if the refinement value is used for the attribute. If no refinement value\n * is provided, test if the refinementList contains any refinement for the\n * given attribute.\n * @param {RefinementList} refinementList the list of refinement\n * @param {string} attribute name of the attribute\n * @param {string} [refinementValue] value of the filter/refinement\n * @return {boolean}\n */\n isRefined: function isRefined(refinementList, attribute, refinementValue) {\n var containsRefinements = !!refinementList[attribute] && refinementList[attribute].length > 0;\n\n if (refinementValue === undefined || !containsRefinements) {\n return containsRefinements;\n }\n\n var refinementValueAsString = '' + refinementValue;\n return refinementList[attribute].indexOf(refinementValueAsString) !== -1;\n }\n};\nmodule.exports = lib;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import React from 'react';\nimport classNames from 'classnames';\nexport var Highlight = function Highlight(_ref) {\n var cx = _ref.cx,\n value = _ref.value,\n highlightedTagName = _ref.highlightedTagName,\n isHighlighted = _ref.isHighlighted,\n nonHighlightedTagName = _ref.nonHighlightedTagName;\n var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;\n var className = isHighlighted ? 'highlighted' : 'nonHighlighted';\n return /*#__PURE__*/React.createElement(TagName, {\n className: cx(className)\n }, value);\n};\n\nvar Highlighter = function Highlighter(_ref2) {\n var cx = _ref2.cx,\n hit = _ref2.hit,\n attribute = _ref2.attribute,\n highlight = _ref2.highlight,\n highlightProperty = _ref2.highlightProperty,\n tagName = _ref2.tagName,\n nonHighlightedTagName = _ref2.nonHighlightedTagName,\n separator = _ref2.separator,\n className = _ref2.className;\n var parsedHighlightedValue = highlight({\n hit: hit,\n attribute: attribute,\n highlightProperty: highlightProperty\n });\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(cx(''), className)\n }, parsedHighlightedValue.map(function (item, i) {\n if (Array.isArray(item)) {\n var isLast = i === parsedHighlightedValue.length - 1;\n return /*#__PURE__*/React.createElement(\"span\", {\n key: i\n }, item.map(function (element, index) {\n return /*#__PURE__*/React.createElement(Highlight, {\n cx: cx,\n key: index,\n value: element.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: element.isHighlighted\n });\n }), !isLast && /*#__PURE__*/React.createElement(\"span\", {\n className: cx('separator')\n }, separator));\n }\n\n return /*#__PURE__*/React.createElement(Highlight, {\n cx: cx,\n key: i,\n value: item.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: item.isHighlighted\n });\n }));\n};\n\nHighlighter.defaultProps = {\n tagName: 'em',\n nonHighlightedTagName: 'span',\n className: '',\n separator: ', '\n};\nexport default Highlighter;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Highlight');\n\nvar Highlight = function Highlight(props) {\n return /*#__PURE__*/React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_highlightResult\",\n cx: cx\n }));\n};\n\nexport default Highlight;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport cx from 'classnames';\nexport var createClassNames = function createClassNames(block) {\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ais';\n return function () {\n for (var _len = arguments.length, elements = new Array(_len), _key = 0; _key < _len; _key++) {\n elements[_key] = arguments[_key];\n }\n\n var suitElements = elements.filter(function (element) {\n return element || element === '';\n }).map(function (element) {\n var baseClassName = \"\".concat(prefix, \"-\").concat(block);\n return element ? \"\".concat(baseClassName, \"-\").concat(element) : baseClassName;\n });\n return cx(suitElements);\n };\n};\nexport var isSpecialClick = function isSpecialClick(event) {\n var isMiddleClick = event.button === 1;\n return Boolean(isMiddleClick || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);\n};\nexport var capitalize = function capitalize(key) {\n return key.length === 0 ? '' : \"\".concat(key[0].toUpperCase()).concat(key.slice(1));\n}; // taken from InstantSearch.js/utils\n\nexport function range(_ref) {\n var _ref$start = _ref.start,\n start = _ref$start === void 0 ? 0 : _ref$start,\n end = _ref.end,\n _ref$step = _ref.step,\n step = _ref$step === void 0 ? 1 : _ref$step; // We can't divide by 0 so we re-assign the step to 1 if it happens.\n\n var limitStep = step === 0 ? 1 : step; // In some cases the array to create has a decimal length.\n // We therefore need to round the value.\n // Example:\n // { start: 1, end: 5000, step: 500 }\n // => Array length = (5000 - 1) / 500 = 9.998\n\n var arrayLength = Math.round((end - start) / limitStep);\n return _toConsumableArray(Array(arrayLength)).map(function (_, current) {\n return (start + current) * limitStep;\n });\n}\nexport function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n\n return undefined;\n}","import { connectHighlight } from 'react-instantsearch-core';\nimport Highlight from '../components/Highlight';\n/**\n * Renders any attribute from a hit into its highlighted form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Highlight\n * @kind widget\n * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=','] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Highlight - root of the component\n * @themeKey ais-Highlight-highlighted - part of the text which is highlighted\n * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom';\n *\n * const Hit = ({ hit }) => (\n *
\n * \n *
\n * );\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nexport default connectHighlight(Highlight);","'use strict';\n\nvar events = require('events');\n\nvar inherits = require('../functions/inherits');\n/**\n * A DerivedHelper is a way to create sub requests to\n * Algolia from a main helper.\n * @class\n * @classdesc The DerivedHelper provides an event based interface for search callbacks:\n * - search: when a search is triggered using the `search()` method.\n * - result: when the response is retrieved from Algolia and is processed.\n * This event contains a {@link SearchResults} object and the\n * {@link SearchParameters} corresponding to this answer.\n */\n\n\nfunction DerivedHelper(mainHelper, fn) {\n this.main = mainHelper;\n this.fn = fn;\n this.lastResults = null;\n}\n\ninherits(DerivedHelper, events.EventEmitter);\n/**\n * Detach this helper from the main helper\n * @return {undefined}\n * @throws Error if the derived helper is already detached\n */\n\nDerivedHelper.prototype.detach = function () {\n this.removeAllListeners();\n this.main.detachDerivedHelper(this);\n};\n\nDerivedHelper.prototype.getModifiedState = function (parameters) {\n return this.fn(parameters);\n};\n\nmodule.exports = DerivedHelper;","'use strict';\n\nvar AlgoliaSearchHelper = require('./src/algoliasearch.helper');\n\nvar SearchParameters = require('./src/SearchParameters');\n\nvar SearchResults = require('./src/SearchResults');\n/**\n * The algoliasearchHelper module is the function that will let its\n * contains everything needed to use the Algoliasearch\n * Helper. It is a also a function that instanciate the helper.\n * To use the helper, you also need the Algolia JS client v3.\n * @example\n * //using the UMD build\n * var client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');\n * var helper = algoliasearchHelper(client, 'bestbuy', {\n * facets: ['shipping'],\n * disjunctiveFacets: ['category']\n * });\n * helper.on('result', function(event) {\n * console.log(event.results);\n * });\n * helper\n * .toggleFacetRefinement('category', 'Movies & TV Shows')\n * .toggleFacetRefinement('shipping', 'Free shipping')\n * .search();\n * @example\n * // The helper is an event emitter using the node API\n * helper.on('result', updateTheResults);\n * helper.once('result', updateTheResults);\n * helper.removeListener('result', updateTheResults);\n * helper.removeAllListeners('result');\n * @module algoliasearchHelper\n * @param {AlgoliaSearch} client an AlgoliaSearch client\n * @param {string} index the name of the index to query\n * @param {SearchParameters|object} opts an object defining the initial config of the search. It doesn't have to be a {SearchParameters}, just an object containing the properties you need from it.\n * @return {AlgoliaSearchHelper}\n */\n\n\nfunction algoliasearchHelper(client, index, opts) {\n return new AlgoliaSearchHelper(client, index, opts);\n}\n/**\n * The version currently used\n * @member module:algoliasearchHelper.version\n * @type {number}\n */\n\n\nalgoliasearchHelper.version = require('./src/version.js');\n/**\n * Constructor for the Helper.\n * @member module:algoliasearchHelper.AlgoliaSearchHelper\n * @type {AlgoliaSearchHelper}\n */\n\nalgoliasearchHelper.AlgoliaSearchHelper = AlgoliaSearchHelper;\n/**\n * Constructor for the object containing all the parameters of the search.\n * @member module:algoliasearchHelper.SearchParameters\n * @type {SearchParameters}\n */\n\nalgoliasearchHelper.SearchParameters = SearchParameters;\n/**\n * Constructor for the object containing the results of the search.\n * @member module:algoliasearchHelper.SearchResults\n * @type {SearchResults}\n */\n\nalgoliasearchHelper.SearchResults = SearchResults;\nmodule.exports = algoliasearchHelper;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar _excluded = [\"contextValue\"];\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nimport React, { Component } from 'react';\nimport isEqual from 'react-fast-compare';\nimport { shallowEqual, getDisplayName, removeEmptyKey } from './utils';\nimport { InstantSearchConsumer, IndexConsumer } from './context';\n/**\n * Connectors are the HOC used to transform React components\n * into InstantSearch widgets.\n * In order to simplify the construction of such connectors\n * `createConnector` takes a description and transform it into\n * a connector.\n * @param {ConnectorDescription} connectorDesc the description of the connector\n * @return {Connector} a function that wraps a component into\n * an instantsearch connected one.\n */\n\nexport function createConnectorWithoutContext(connectorDesc) {\n if (!connectorDesc.displayName) {\n throw new Error('`createConnector` requires you to provide a `displayName` property.');\n }\n\n var isWidget = typeof connectorDesc.getSearchParameters === 'function' || typeof connectorDesc.getMetadata === 'function' || typeof connectorDesc.transitionState === 'function';\n return function (Composed) {\n var Connector = /*#__PURE__*/function (_Component) {\n _inherits(Connector, _Component);\n\n var _super = _createSuper(Connector);\n\n function Connector(props) {\n var _this;\n\n _classCallCheck(this, Connector);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"unsubscribe\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n providedProps: _this.getProvidedProps(_this.props)\n });\n\n _defineProperty(_assertThisInitialized(_this), \"refine\", function () {\n var _ref;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this.props.contextValue.onInternalStateUpdate( // refine will always be defined here because the prop is only given conditionally\n (_ref = connectorDesc.refine).call.apply(_ref, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"createURL\", function () {\n var _ref2;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.props.contextValue.createHrefForState( // refine will always be defined here because the prop is only given conditionally\n (_ref2 = connectorDesc.refine).call.apply(_ref2, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n _defineProperty(_assertThisInitialized(_this), \"searchForFacetValues\", function () {\n var _ref3;\n\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n _this.props.contextValue.onSearchForFacetValues( // searchForFacetValues will always be defined here because the prop is only given conditionally\n (_ref3 = connectorDesc.searchForFacetValues).call.apply(_ref3, [_assertThisInitialized(_this), _this.props, _this.props.contextValue.store.getState().widgets].concat(args)));\n });\n\n if (connectorDesc.getSearchParameters) {\n _this.props.contextValue.onSearchParameters(connectorDesc.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.props.indexContextValue\n }, _this.props, connectorDesc.getMetadata && connectorDesc.getMetadata.bind(_assertThisInitialized(_this)));\n }\n\n return _this;\n }\n\n _createClass(Connector, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.unsubscribe = this.props.contextValue.store.subscribe(function () {\n if (!_this2.isUnmounting) {\n _this2.setState({\n providedProps: _this2.getProvidedProps(_this2.props)\n });\n }\n });\n\n if (isWidget) {\n this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this);\n }\n }\n }, {\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps, nextState) {\n if (typeof connectorDesc.shouldComponentUpdate === 'function') {\n return connectorDesc.shouldComponentUpdate.call(this, this.props, nextProps, this.state, nextState);\n }\n\n var propsEqual = shallowEqual(this.props, nextProps);\n\n if (this.state.providedProps === null || nextState.providedProps === null) {\n if (this.state.providedProps === nextState.providedProps) {\n return !propsEqual;\n }\n\n return true;\n }\n\n return !propsEqual || !shallowEqual(this.state.providedProps, nextState.providedProps);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!isEqual(prevProps, this.props)) {\n this.setState({\n providedProps: this.getProvidedProps(this.props)\n });\n\n if (isWidget) {\n this.props.contextValue.widgetsManager.update();\n\n if (typeof connectorDesc.transitionState === 'function') {\n this.props.contextValue.onSearchStateChange(connectorDesc.transitionState.call(this, this.props, this.props.contextValue.store.getState().widgets, this.props.contextValue.store.getState().widgets));\n }\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.isUnmounting = true;\n\n if (this.unsubscribe) {\n this.unsubscribe();\n }\n\n if (this.unregisterWidget) {\n this.unregisterWidget();\n\n if (typeof connectorDesc.cleanUp === 'function') {\n var nextState = connectorDesc.cleanUp.call(this, this.props, this.props.contextValue.store.getState().widgets);\n this.props.contextValue.store.setState(_objectSpread(_objectSpread({}, this.props.contextValue.store.getState()), {}, {\n widgets: nextState\n }));\n this.props.contextValue.onSearchStateChange(removeEmptyKey(nextState));\n }\n }\n }\n }, {\n key: \"getProvidedProps\",\n value: function getProvidedProps(props) {\n var _this$props$contextVa = this.props.contextValue.store.getState(),\n widgets = _this$props$contextVa.widgets,\n results = _this$props$contextVa.results,\n resultsFacetValues = _this$props$contextVa.resultsFacetValues,\n searching = _this$props$contextVa.searching,\n searchingForFacetValues = _this$props$contextVa.searchingForFacetValues,\n isSearchStalled = _this$props$contextVa.isSearchStalled,\n metadata = _this$props$contextVa.metadata,\n error = _this$props$contextVa.error;\n\n var searchResults = {\n results: results,\n searching: searching,\n searchingForFacetValues: searchingForFacetValues,\n isSearchStalled: isSearchStalled,\n error: error\n };\n return connectorDesc.getProvidedProps.call(this, props, widgets, searchResults, metadata, // @MAJOR: move this attribute on the `searchResults` it doesn't\n // makes sense to have it into a separate argument. The search\n // flags are on the object why not the results?\n resultsFacetValues);\n }\n }, {\n key: \"getSearchParameters\",\n value: function getSearchParameters(searchParameters) {\n if (typeof connectorDesc.getSearchParameters === 'function') {\n return connectorDesc.getSearchParameters.call(this, searchParameters, this.props, this.props.contextValue.store.getState().widgets);\n }\n\n return null;\n }\n }, {\n key: \"getMetadata\",\n value: function getMetadata(nextWidgetsState) {\n if (typeof connectorDesc.getMetadata === 'function') {\n return connectorDesc.getMetadata.call(this, this.props, nextWidgetsState);\n }\n\n return {};\n }\n }, {\n key: \"transitionState\",\n value: function transitionState(prevWidgetsState, nextWidgetsState) {\n if (typeof connectorDesc.transitionState === 'function') {\n return connectorDesc.transitionState.call(this, this.props, prevWidgetsState, nextWidgetsState);\n }\n\n return nextWidgetsState;\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n contextValue = _this$props.contextValue,\n props = _objectWithoutProperties(_this$props, _excluded);\n\n var providedProps = this.state.providedProps;\n\n if (providedProps === null) {\n return null;\n }\n\n var refineProps = typeof connectorDesc.refine === 'function' ? {\n refine: this.refine,\n createURL: this.createURL\n } : {};\n var searchForFacetValuesProps = typeof connectorDesc.searchForFacetValues === 'function' ? {\n searchForItems: this.searchForFacetValues\n } : {};\n return /*#__PURE__*/React.createElement(Composed, _extends({}, props, providedProps, refineProps, searchForFacetValuesProps));\n }\n }]);\n\n return Connector;\n }(Component);\n\n _defineProperty(Connector, \"displayName\", \"\".concat(connectorDesc.displayName, \"(\").concat(getDisplayName(Composed), \")\"));\n\n _defineProperty(Connector, \"propTypes\", connectorDesc.propTypes);\n\n _defineProperty(Connector, \"defaultProps\", connectorDesc.defaultProps);\n\n _defineProperty(Connector, \"_connectorDesc\", connectorDesc);\n\n return Connector;\n };\n}\n\nvar createConnectorWithContext = function createConnectorWithContext(connectorDesc) {\n return function (Composed) {\n var Connector = createConnectorWithoutContext(connectorDesc)(Composed);\n\n var ConnectorWrapper = function ConnectorWrapper(props) {\n return /*#__PURE__*/React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return /*#__PURE__*/React.createElement(IndexConsumer, null, function (indexContextValue) {\n return /*#__PURE__*/React.createElement(Connector, _extends({\n contextValue: contextValue,\n indexContextValue: indexContextValue\n }, props));\n });\n });\n };\n\n return ConnectorWrapper;\n };\n};\n\nexport default createConnectorWithContext;","import \"core-js/modules/es.array.sort.js\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nvar _excluded = [\"resultsFacetValues\"],\n _excluded2 = [\"resultsFacetValues\"],\n _excluded3 = [\"resultsFacetValues\"];\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport algoliasearchHelper from 'algoliasearch-helper';\nimport createWidgetsManager from './createWidgetsManager';\nimport createStore from './createStore';\nimport { HIGHLIGHT_TAGS } from './highlight';\nimport { hasMultipleIndices } from './indexUtils';\nimport { version as ReactVersion } from 'react';\nimport version from './version';\n\nfunction addAlgoliaAgents(searchClient) {\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(\"react (\".concat(ReactVersion, \")\"));\n searchClient.addAlgoliaAgent(\"react-instantsearch (\".concat(version, \")\"));\n }\n}\n\nvar isMultiIndexContext = function isMultiIndexContext(widget) {\n return hasMultipleIndices({\n ais: widget.props.contextValue,\n multiIndexContext: widget.props.indexContextValue\n });\n};\n\nvar isTargetedIndexEqualIndex = function isTargetedIndexEqualIndex(widget, indexId) {\n return widget.props.indexContextValue.targetedIndex === indexId;\n}; // Relying on the `indexId` is a bit brittle to detect the `Index` widget.\n// Since it's a class we could rely on `instanceof` or similar. We never\n// had an issue though. Works for now.\n\n\nvar isIndexWidget = function isIndexWidget(widget) {\n return Boolean(widget.props.indexId);\n};\n\nvar isIndexWidgetEqualIndex = function isIndexWidgetEqualIndex(widget, indexId) {\n return widget.props.indexId === indexId;\n};\n\nvar sortIndexWidgetsFirst = function sortIndexWidgetsFirst(firstWidget, secondWidget) {\n var isFirstWidgetIndex = isIndexWidget(firstWidget);\n var isSecondWidgetIndex = isIndexWidget(secondWidget);\n\n if (isFirstWidgetIndex && !isSecondWidgetIndex) {\n return -1;\n }\n\n if (!isFirstWidgetIndex && isSecondWidgetIndex) {\n return 1;\n }\n\n return 0;\n}; // This function is copied from the algoliasearch v4 API Client. If modified,\n// consider updating it also in `serializeQueryParameters` from `@algolia/transporter`.\n\n\nfunction serializeQueryParameters(parameters) {\n var isObjectOrArray = function isObjectOrArray(value) {\n return Object.prototype.toString.call(value) === '[object Object]' || Object.prototype.toString.call(value) === '[object Array]';\n };\n\n var encode = function encode(format) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var i = 0;\n return format.replace(/%s/g, function () {\n return encodeURIComponent(args[i++]);\n });\n };\n\n return Object.keys(parameters).map(function (key) {\n return encode('%s=%s', key, isObjectOrArray(parameters[key]) ? JSON.stringify(parameters[key]) : parameters[key]);\n }).join('&');\n}\n/**\n * Creates a new instance of the InstantSearchManager which controls the widgets and\n * trigger the search when the widgets are updated.\n * @param {string} indexName - the main index name\n * @param {object} initialState - initial widget state\n * @param {object} SearchParameters - optional additional parameters to send to the algolia API\n * @param {number} stalledSearchDelay - time (in ms) after the search is stalled\n * @return {InstantSearchManager} a new instance of InstantSearchManager\n */\n\n\nexport default function createInstantSearchManager(_ref) {\n var indexName = _ref.indexName,\n _ref$initialState = _ref.initialState,\n initialState = _ref$initialState === void 0 ? {} : _ref$initialState,\n searchClient = _ref.searchClient,\n resultsState = _ref.resultsState,\n stalledSearchDelay = _ref.stalledSearchDelay;\n var helper = algoliasearchHelper(searchClient, indexName, _objectSpread({}, HIGHLIGHT_TAGS));\n addAlgoliaAgents(searchClient);\n helper.on('search', handleNewSearch).on('result', handleSearchSuccess({\n indexId: indexName\n })).on('error', handleSearchError);\n var skip = false;\n var stalledSearchTimer = null;\n var initialSearchParameters = helper.state;\n var widgetsManager = createWidgetsManager(onWidgetsUpdate);\n hydrateSearchClient(searchClient, resultsState);\n var store = createStore({\n widgets: initialState,\n metadata: hydrateMetadata(resultsState),\n results: hydrateResultsState(resultsState),\n error: null,\n searching: false,\n isSearchStalled: true,\n searchingForFacetValues: false\n });\n\n function skipSearch() {\n skip = true;\n }\n\n function updateClient(client) {\n addAlgoliaAgents(client);\n helper.setClient(client);\n search();\n }\n\n function clearCache() {\n helper.clearCache();\n search();\n }\n\n function getMetadata(state) {\n return widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getMetadata);\n }).map(function (widget) {\n return widget.getMetadata(state);\n });\n }\n\n function getSearchParameters() {\n var sharedParameters = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n return !isMultiIndexContext(widget) && !isIndexWidget(widget);\n }).reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, initialSearchParameters);\n var mainParameters = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n var targetedIndexEqualMainIndex = isMultiIndexContext(widget) && isTargetedIndexEqualIndex(widget, indexName);\n var subIndexEqualMainIndex = isIndexWidget(widget) && isIndexWidgetEqualIndex(widget, indexName);\n return targetedIndexEqualMainIndex || subIndexEqualMainIndex;\n }) // We have to sort the `Index` widgets first so the `index` parameter\n // is correctly set in the `reduce` function for the following widgets\n .sort(sortIndexWidgetsFirst).reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, sharedParameters);\n var derivedIndices = widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.getSearchParameters);\n }).filter(function (widget) {\n var targetedIndexNotEqualMainIndex = isMultiIndexContext(widget) && !isTargetedIndexEqualIndex(widget, indexName);\n var subIndexNotEqualMainIndex = isIndexWidget(widget) && !isIndexWidgetEqualIndex(widget, indexName);\n return targetedIndexNotEqualMainIndex || subIndexNotEqualMainIndex;\n }) // We have to sort the `Index` widgets first so the `index` parameter\n // is correctly set in the `reduce` function for the following widgets\n .sort(sortIndexWidgetsFirst).reduce(function (indices, widget) {\n var indexId = isMultiIndexContext(widget) ? widget.props.indexContextValue.targetedIndex : widget.props.indexId;\n var widgets = indices[indexId] || [];\n return _objectSpread(_objectSpread({}, indices), {}, _defineProperty({}, indexId, widgets.concat(widget)));\n }, {});\n var derivedParameters = Object.keys(derivedIndices).map(function (indexId) {\n return {\n parameters: derivedIndices[indexId].reduce(function (res, widget) {\n return widget.getSearchParameters(res);\n }, sharedParameters),\n indexId: indexId\n };\n });\n return {\n mainParameters: mainParameters,\n derivedParameters: derivedParameters\n };\n }\n\n function search() {\n if (!skip) {\n var _getSearchParameters = getSearchParameters(helper.state),\n mainParameters = _getSearchParameters.mainParameters,\n derivedParameters = _getSearchParameters.derivedParameters; // We have to call `slice` because the method `detach` on the derived\n // helpers mutates the value `derivedHelpers`. The `forEach` loop does\n // not iterate on each value and we're not able to correctly clear the\n // previous derived helpers (memory leak + useless requests).\n\n\n helper.derivedHelpers.slice().forEach(function (derivedHelper) {\n // Since we detach the derived helpers on **every** new search they\n // won't receive intermediate results in case of a stalled search.\n // Only the last result is dispatched by the derived helper because\n // they are not detached yet:\n //\n // - a -> main helper receives results\n // - ap -> main helper receives results\n // - app -> main helper + derived helpers receive results\n //\n // The quick fix is to avoid to detach them on search but only once they\n // received the results. But it means that in case of a stalled search\n // all the derived helpers not detached yet register a new search inside\n // the helper. The number grows fast in case of a bad network and it's\n // not deterministic.\n derivedHelper.detach();\n });\n derivedParameters.forEach(function (_ref2) {\n var indexId = _ref2.indexId,\n parameters = _ref2.parameters;\n var derivedHelper = helper.derive(function () {\n return parameters;\n });\n derivedHelper.on('result', handleSearchSuccess({\n indexId: indexId\n })).on('error', handleSearchError);\n });\n helper.setState(mainParameters);\n helper.search();\n }\n }\n\n function handleSearchSuccess(_ref3) {\n var indexId = _ref3.indexId;\n return function (event) {\n var state = store.getState();\n var isDerivedHelpersEmpty = !helper.derivedHelpers.length;\n var results = state.results ? state.results : {}; // Switching from mono index to multi index and vice versa must reset the\n // results to an empty object, otherwise we keep reference of stalled and\n // unused results.\n\n results = !isDerivedHelpersEmpty && results.getFacetByName ? {} : results;\n\n if (!isDerivedHelpersEmpty) {\n results = _objectSpread(_objectSpread({}, results), {}, _defineProperty({}, indexId, event.results));\n } else {\n results = event.results;\n }\n\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n stalledSearchTimer = null;\n nextIsSearchStalled = false;\n }\n\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, _excluded);\n\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n results: results,\n isSearchStalled: nextIsSearchStalled,\n searching: false,\n error: null\n }));\n };\n }\n\n function handleSearchError(_ref4) {\n var error = _ref4.error;\n var currentState = store.getState();\n var nextIsSearchStalled = currentState.isSearchStalled;\n\n if (!helper.hasPendingRequests()) {\n clearTimeout(stalledSearchTimer);\n nextIsSearchStalled = false;\n }\n\n var resultsFacetValues = currentState.resultsFacetValues,\n partialState = _objectWithoutProperties(currentState, _excluded2);\n\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n isSearchStalled: nextIsSearchStalled,\n error: error,\n searching: false\n }));\n }\n\n function handleNewSearch() {\n if (!stalledSearchTimer) {\n stalledSearchTimer = setTimeout(function () {\n var _store$getState = store.getState(),\n resultsFacetValues = _store$getState.resultsFacetValues,\n partialState = _objectWithoutProperties(_store$getState, _excluded3);\n\n store.setState(_objectSpread(_objectSpread({}, partialState), {}, {\n isSearchStalled: true\n }));\n }, stalledSearchDelay);\n }\n }\n\n function hydrateSearchClient(client, results) {\n if (!results) {\n return;\n } // Disable cache hydration on:\n // - Algoliasearch API Client < v4 with cache disabled\n // - Third party clients (detected by the `addAlgoliaAgent` function missing)\n\n\n if ((!client.transporter || client._cacheHydrated) && (!client._useCache || typeof client.addAlgoliaAgent !== 'function')) {\n return;\n } // Algoliasearch API Client >= v4\n // To hydrate the client we need to populate the cache with the data from\n // the server (done in `hydrateSearchClientWithMultiIndexRequest` or\n // `hydrateSearchClientWithSingleIndexRequest`). But since there is no way\n // for us to compute the key the same way as `algoliasearch-client` we need\n // to populate it on a custom key and override the `search` method to\n // search on it first.\n\n\n if (client.transporter && !client._cacheHydrated) {\n client._cacheHydrated = true;\n var baseMethod = client.search;\n\n client.search = function (requests) {\n for (var _len2 = arguments.length, methodArgs = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n methodArgs[_key2 - 1] = arguments[_key2];\n }\n\n var requestsWithSerializedParams = requests.map(function (request) {\n return _objectSpread(_objectSpread({}, request), {}, {\n params: serializeQueryParameters(request.params)\n });\n });\n return client.transporter.responsesCache.get({\n method: 'search',\n args: [requestsWithSerializedParams].concat(methodArgs)\n }, function () {\n return baseMethod.apply(void 0, [requests].concat(methodArgs));\n });\n };\n }\n\n if (Array.isArray(results.results)) {\n hydrateSearchClientWithMultiIndexRequest(client, results.results);\n return;\n }\n\n hydrateSearchClientWithSingleIndexRequest(client, results);\n }\n\n function hydrateSearchClientWithMultiIndexRequest(client, results) {\n // Algoliasearch API Client >= v4\n // Populate the cache with the data from the server\n if (client.transporter) {\n client.transporter.responsesCache.set({\n method: 'search',\n args: [results.reduce(function (acc, result) {\n return acc.concat(result.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n }));\n }, [])]\n }, {\n results: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults);\n }, [])\n });\n return;\n } // Algoliasearch API Client < v4\n // Prior to client v4 we didn't have a proper API to hydrate the client\n // cache from the outside. The following code populates the cache with\n // a single-index result. You can find more information about the\n // computation of the key inside the client (see link below).\n // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n\n\n var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n }));\n }, [])\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, key, JSON.stringify({\n results: results.reduce(function (acc, result) {\n return acc.concat(result.rawResults);\n }, [])\n })));\n }\n\n function hydrateSearchClientWithSingleIndexRequest(client, results) {\n // Algoliasearch API Client >= v4\n // Populate the cache with the data from the server\n if (client.transporter) {\n client.transporter.responsesCache.set({\n method: 'search',\n args: [results.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n })]\n }, {\n results: results.rawResults\n });\n return;\n } // Algoliasearch API Client < v4\n // Prior to client v4 we didn't have a proper API to hydrate the client\n // cache from the outside. The following code populates the cache with\n // a single-index result. You can find more information about the\n // computation of the key inside the client (see link below).\n // https://github.com/algolia/algoliasearch-client-javascript/blob/c27e89ff92b2a854ae6f40dc524bffe0f0cbc169/src/AlgoliaSearchCore.js#L232-L240\n\n\n var key = \"/1/indexes/*/queries_body_\".concat(JSON.stringify({\n requests: results.rawResults.map(function (request) {\n return {\n indexName: request.index,\n params: request.params\n };\n })\n }));\n client.cache = _objectSpread(_objectSpread({}, client.cache), {}, _defineProperty({}, key, JSON.stringify({\n results: results.rawResults\n })));\n }\n\n function hydrateResultsState(results) {\n if (!results) {\n return null;\n }\n\n if (Array.isArray(results.results)) {\n return results.results.reduce(function (acc, result) {\n return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, result._internalIndexId, new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(result.state), result.rawResults)));\n }, {});\n }\n\n return new algoliasearchHelper.SearchResults(new algoliasearchHelper.SearchParameters(results.state), results.rawResults);\n } // Called whenever a widget has been rendered with new props.\n\n\n function onWidgetsUpdate() {\n var metadata = getMetadata(store.getState().widgets);\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n metadata: metadata,\n searching: true\n })); // Since the `getSearchParameters` method of widgets also depends on props,\n // the result search parameters might have changed.\n\n search();\n }\n\n function transitionState(nextSearchState) {\n var searchState = store.getState().widgets;\n return widgetsManager.getWidgets().filter(function (widget) {\n return Boolean(widget.transitionState);\n }).reduce(function (res, widget) {\n return widget.transitionState(searchState, res);\n }, nextSearchState);\n }\n\n function onExternalStateUpdate(nextSearchState) {\n var metadata = getMetadata(nextSearchState);\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n widgets: nextSearchState,\n metadata: metadata,\n searching: true\n }));\n search();\n }\n\n function onSearchForFacetValues(_ref5) {\n var facetName = _ref5.facetName,\n query = _ref5.query,\n _ref5$maxFacetHits = _ref5.maxFacetHits,\n maxFacetHits = _ref5$maxFacetHits === void 0 ? 10 : _ref5$maxFacetHits; // The values 1, 100 are the min / max values that the engine accepts.\n // see: https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits\n\n var maxFacetHitsWithinRange = Math.max(1, Math.min(maxFacetHits, 100));\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n searchingForFacetValues: true\n }));\n helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) {\n var _objectSpread7;\n\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n error: null,\n searchingForFacetValues: false,\n resultsFacetValues: _objectSpread(_objectSpread({}, store.getState().resultsFacetValues), {}, (_objectSpread7 = {}, _defineProperty(_objectSpread7, facetName, content.facetHits), _defineProperty(_objectSpread7, \"query\", query), _objectSpread7))\n }));\n }, function (error) {\n store.setState(_objectSpread(_objectSpread({}, store.getState()), {}, {\n searchingForFacetValues: false,\n error: error\n }));\n }).catch(function (error) {\n // Since setState is synchronous, any error that occurs in the render of a\n // component will be swallowed by this promise.\n // This is a trick to make the error show up correctly in the console.\n // See http://stackoverflow.com/a/30741722/969302\n setTimeout(function () {\n throw error;\n });\n });\n }\n\n function updateIndex(newIndex) {\n initialSearchParameters = initialSearchParameters.setIndex(newIndex); // No need to trigger a new search here as the widgets will also update and trigger it if needed.\n }\n\n function getWidgetsIds() {\n return store.getState().metadata.reduce(function (res, meta) {\n return typeof meta.id !== 'undefined' ? res.concat(meta.id) : res;\n }, []);\n }\n\n return {\n store: store,\n widgetsManager: widgetsManager,\n getWidgetsIds: getWidgetsIds,\n getSearchParameters: getSearchParameters,\n onSearchForFacetValues: onSearchForFacetValues,\n onExternalStateUpdate: onExternalStateUpdate,\n transitionState: transitionState,\n updateClient: updateClient,\n updateIndex: updateIndex,\n clearCache: clearCache,\n skipSearch: skipSearch\n };\n}\n\nfunction hydrateMetadata(resultsState) {\n if (!resultsState) {\n return [];\n } // add a value noop, which gets replaced once the widgets are mounted\n\n\n return resultsState.metadata.map(function (datum) {\n return _objectSpread(_objectSpread({\n value: function value() {\n return {};\n }\n }, datum), {}, {\n items: datum.items && datum.items.map(function (item) {\n return _objectSpread(_objectSpread({\n value: function value() {\n return {};\n }\n }, item), {}, {\n items: item.items && item.items.map(function (nestedItem) {\n return _objectSpread({\n value: function value() {\n return {};\n }\n }, nestedItem);\n })\n });\n })\n });\n });\n}","export default '6.15.0';","import { defer } from './utils';\nexport default function createWidgetsManager(onWidgetsUpdate) {\n var widgets = []; // Is an update scheduled?\n\n var scheduled = false; // The state manager's updates need to be batched since more than one\n // component can register or unregister widgets during the same tick.\n\n function scheduleUpdate() {\n if (scheduled) {\n return;\n }\n\n scheduled = true;\n defer(function () {\n scheduled = false;\n onWidgetsUpdate();\n });\n }\n\n return {\n registerWidget: function registerWidget(widget) {\n widgets.push(widget);\n scheduleUpdate();\n return function unregisterWidget() {\n widgets.splice(widgets.indexOf(widget), 1);\n scheduleUpdate();\n };\n },\n update: scheduleUpdate,\n getWidgets: function getWidgets() {\n return widgets;\n }\n };\n}","export default function createStore(initialState) {\n var state = initialState;\n var listeners = [];\n return {\n getState: function getState() {\n return state;\n },\n setState: function setState(nextState) {\n state = nextState;\n listeners.forEach(function (listener) {\n return listener();\n });\n },\n subscribe: function subscribe(listener) {\n listeners.push(listener);\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(listener), 1);\n };\n }\n };\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nexport function isMetadataEnabled() {\n return (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === 'object' && _typeof(window.navigator) === 'object' && typeof window.navigator.userAgent === 'string' && window.navigator.userAgent.includes('Algolia Crawler') && _typeof(window.document) === 'object';\n}\nexport function getMetadataPayload(widgets, searchClient) {\n var internalProps = ['contextValue', 'indexContextValue'];\n var widgetsPayload = widgets.map(function (_ref) {\n var props = _ref.props,\n constructor = _ref.constructor;\n\n var _ref2 = constructor._connectorDesc || {},\n _ref2$defaultProps = _ref2.defaultProps,\n defaultProps = _ref2$defaultProps === void 0 ? {} : _ref2$defaultProps,\n _ref2$displayName = _ref2.displayName,\n displayName = _ref2$displayName === void 0 ? constructor.displayName : _ref2$displayName;\n\n return {\n displayName: displayName,\n params: Object.keys(props).filter(function (prop) {\n return !internalProps.includes(prop) && defaultProps[prop] !== props[prop] && props[prop] !== undefined;\n })\n };\n });\n var client = searchClient;\n var ua = client.transporter && client.transporter.userAgent ? client.transporter.userAgent.value : client._ua;\n return {\n ua: ua,\n widgets: widgetsPayload\n };\n}\nexport function injectMetadata(widgets, searchClient) {\n var payloadContainer = document.createElement('meta');\n var refNode = document.querySelector('head');\n payloadContainer.name = 'algolia:metadata';\n var payload = getMetadataPayload(widgets, searchClient);\n payloadContainer.content = JSON.stringify(payload);\n refNode.appendChild(payloadContainer);\n}","import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n return function _createSuperInternal() {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nimport React, { Component, Children } from 'react';\nimport isEqual from 'react-fast-compare';\nimport PropTypes from 'prop-types';\nimport createInstantSearchManager from '../core/createInstantSearchManager';\nimport { InstantSearchProvider } from '../core/context';\nimport { isMetadataEnabled, injectMetadata } from '../core/metadata';\n\nfunction isControlled(props) {\n return Boolean(props.searchState);\n}\n/**\n * @description\n * `` is the root component of all React InstantSearch implementations.\n * It provides all the connected components (aka widgets) a means to interact\n * with the searchState.\n * @kind widget\n * @name \n * @requirements You will need to have an Algolia account to be able to use this widget.\n * [Create one now](https://www.algolia.com/users/sign_up).\n * @propType {string} indexName - Main index in which to search.\n * @propType {boolean} [refresh=false] - Flag to activate when the cache needs to be cleared so that the front-end is updated when a change occurs in the index.\n * @propType {object} [searchClient] - Provide a custom search client.\n * @propType {func} [onSearchStateChange] - Function to be called everytime a new search is done. Useful for [URL Routing](guide/Routing.html).\n * @propType {object} [searchState] - Object to inject some search state. Switches the InstantSearch component in controlled mode. Useful for [URL Routing](guide/Routing.html).\n * @propType {func} [createURL] - Function to call when creating links, useful for [URL Routing](guide/Routing.html).\n * @propType {SearchResults|SearchResults[]} [resultsState] - Use this to inject the results that will be used at first rendering. Those results are found by using the `findResultsState` function. Useful for [Server Side Rendering](guide/Server-side_rendering.html).\n * @propType {number} [stalledSearchDelay=200] - The amount of time before considering that the search takes too much time. The time is expressed in milliseconds.\n * @propType {{ Root: string|function, props: object }} [root] - Use this to customize the root element. Default value: `{ Root: 'div' }`\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\n\nvar InstantSearch = /*#__PURE__*/function (_Component) {\n _inherits(InstantSearch, _Component);\n\n var _super = _createSuper(InstantSearch);\n\n function InstantSearch(props) {\n var _this;\n\n _classCallCheck(this, InstantSearch);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"isUnmounting\", false);\n\n var instantSearchManager = createInstantSearchManager({\n indexName: _this.props.indexName,\n searchClient: _this.props.searchClient,\n initialState: _this.props.searchState || {},\n resultsState: _this.props.resultsState,\n stalledSearchDelay: _this.props.stalledSearchDelay\n });\n var contextValue = {\n store: instantSearchManager.store,\n widgetsManager: instantSearchManager.widgetsManager,\n mainTargetedIndex: _this.props.indexName,\n onInternalStateUpdate: _this.onWidgetsInternalStateUpdate.bind(_assertThisInitialized(_this)),\n createHrefForState: _this.createHrefForState.bind(_assertThisInitialized(_this)),\n onSearchForFacetValues: _this.onSearchForFacetValues.bind(_assertThisInitialized(_this)),\n onSearchStateChange: _this.onSearchStateChange.bind(_assertThisInitialized(_this)),\n onSearchParameters: _this.onSearchParameters.bind(_assertThisInitialized(_this))\n };\n _this.state = {\n isControlled: isControlled(_this.props),\n instantSearchManager: instantSearchManager,\n contextValue: contextValue\n };\n return _this;\n }\n\n _createClass(InstantSearch, [{\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var prevIsControlled = isControlled(prevProps);\n\n if (prevIsControlled && !this.state.isControlled) {\n throw new Error(\"You can't switch from being controlled to uncontrolled\");\n }\n\n if (!prevIsControlled && this.state.isControlled) {\n throw new Error(\"You can't switch from being uncontrolled to controlled\");\n }\n\n if (this.props.refresh !== prevProps.refresh && this.props.refresh) {\n this.state.instantSearchManager.clearCache();\n }\n\n if (prevProps.indexName !== this.props.indexName) {\n this.state.instantSearchManager.updateIndex(this.props.indexName);\n }\n\n if (prevProps.searchClient !== this.props.searchClient) {\n this.state.instantSearchManager.updateClient(this.props.searchClient);\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (isMetadataEnabled()) {\n injectMetadata(this.state.instantSearchManager.widgetsManager.getWidgets(), this.props.searchClient);\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.isUnmounting = true;\n this.state.instantSearchManager.skipSearch();\n }\n }, {\n key: \"createHrefForState\",\n value: function createHrefForState(searchState) {\n searchState = this.state.instantSearchManager.transitionState(searchState);\n return this.state.isControlled && this.props.createURL ? this.props.createURL(searchState, this.getKnownKeys()) : '#';\n }\n }, {\n key: \"onWidgetsInternalStateUpdate\",\n value: function onWidgetsInternalStateUpdate(searchState) {\n searchState = this.state.instantSearchManager.transitionState(searchState);\n this.onSearchStateChange(searchState);\n\n if (!this.state.isControlled) {\n this.state.instantSearchManager.onExternalStateUpdate(searchState);\n }\n }\n }, {\n key: \"onSearchStateChange\",\n value: function onSearchStateChange(searchState) {\n if (this.props.onSearchStateChange && !this.isUnmounting) {\n this.props.onSearchStateChange(searchState);\n }\n }\n }, {\n key: \"onSearchParameters\",\n value: function onSearchParameters(getSearchParameters, context, props, getMetadata) {\n if (this.props.onSearchParameters) {\n var _searchState = this.props.searchState ? this.props.searchState : {};\n\n this.props.onSearchParameters(getSearchParameters, context, props, _searchState);\n }\n\n if (this.props.widgetsCollector) {\n var _searchState2 = this.props.searchState ? this.props.searchState : {};\n\n this.props.widgetsCollector({\n getSearchParameters: getSearchParameters,\n getMetadata: getMetadata,\n context: context,\n props: props,\n searchState: _searchState2\n });\n }\n }\n }, {\n key: \"onSearchForFacetValues\",\n value: function onSearchForFacetValues(searchState) {\n this.state.instantSearchManager.onSearchForFacetValues(searchState);\n }\n }, {\n key: \"getKnownKeys\",\n value: function getKnownKeys() {\n return this.state.instantSearchManager.getWidgetsIds();\n }\n }, {\n key: \"render\",\n value: function render() {\n if (Children.count(this.props.children) === 0) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(InstantSearchProvider, {\n value: this.state.contextValue\n }, this.props.children);\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var nextIsControlled = isControlled(nextProps);\n var previousSearchState = prevState.instantSearchManager.store.getState().widgets;\n var nextSearchState = nextProps.searchState;\n\n if (nextIsControlled && !isEqual(previousSearchState, nextSearchState)) {\n prevState.instantSearchManager.onExternalStateUpdate(nextProps.searchState);\n }\n\n return {\n isControlled: nextIsControlled,\n contextValue: _objectSpread(_objectSpread({}, prevState.contextValue), {}, {\n mainTargetedIndex: nextProps.indexName\n })\n };\n }\n }]);\n\n return InstantSearch;\n}(Component);\n\n_defineProperty(InstantSearch, \"defaultProps\", {\n stalledSearchDelay: 200,\n refresh: false\n});\n\n_defineProperty(InstantSearch, \"propTypes\", {\n // @TODO: These props are currently constant.\n indexName: PropTypes.string.isRequired,\n searchClient: PropTypes.shape({\n search: PropTypes.func.isRequired,\n searchForFacetValues: PropTypes.func,\n addAlgoliaAgent: PropTypes.func,\n clearCache: PropTypes.func\n }).isRequired,\n createURL: PropTypes.func,\n refresh: PropTypes.bool,\n searchState: PropTypes.object,\n onSearchStateChange: PropTypes.func,\n onSearchParameters: PropTypes.func,\n widgetsCollector: PropTypes.func,\n resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n children: PropTypes.node,\n stalledSearchDelay: PropTypes.number\n});\n\nexport default InstantSearch;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _compareObjects = _interopRequireDefault(require(\"./compareObjects\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _createSuper(Derived) {\n return function () {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (_isNativeReflectConstruct()) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar SectionTitle = /*#__PURE__*/function (_Component) {\n _inherits(SectionTitle, _Component);\n\n var _super = _createSuper(SectionTitle);\n\n function SectionTitle() {\n _classCallCheck(this, SectionTitle);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SectionTitle, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return (0, _compareObjects[\"default\"])(nextProps, this.props);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n section = _this$props.section,\n renderSectionTitle = _this$props.renderSectionTitle,\n theme = _this$props.theme,\n sectionKeyPrefix = _this$props.sectionKeyPrefix;\n var sectionTitle = renderSectionTitle(section);\n\n if (!sectionTitle) {\n return null;\n }\n\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", theme(\"\".concat(sectionKeyPrefix, \"title\"), 'sectionTitle'), sectionTitle);\n }\n }]);\n\n return SectionTitle;\n}(_react.Component);\n\nexports[\"default\"] = SectionTitle;\n\n_defineProperty(SectionTitle, \"propTypes\", {\n section: _propTypes[\"default\"].any.isRequired,\n renderSectionTitle: _propTypes[\"default\"].func.isRequired,\n theme: _propTypes[\"default\"].func.isRequired,\n sectionKeyPrefix: _propTypes[\"default\"].string.isRequired\n});","'use strict';\n\nfunction inherits(ctor, superCtor) {\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n}\n\nmodule.exports = inherits;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _compareObjects = _interopRequireDefault(require(\"./compareObjects\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _createSuper(Derived) {\n return function () {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (_isNativeReflectConstruct()) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar Item = /*#__PURE__*/function (_Component) {\n _inherits(Item, _Component);\n\n var _super = _createSuper(Item);\n\n function Item() {\n var _this;\n\n _classCallCheck(this, Item);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"storeItemReference\", function (item) {\n if (item !== null) {\n _this.item = item;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onMouseEnter\", function (event) {\n var _this$props = _this.props,\n sectionIndex = _this$props.sectionIndex,\n itemIndex = _this$props.itemIndex;\n\n _this.props.onMouseEnter(event, {\n sectionIndex: sectionIndex,\n itemIndex: itemIndex\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onMouseLeave\", function (event) {\n var _this$props2 = _this.props,\n sectionIndex = _this$props2.sectionIndex,\n itemIndex = _this$props2.itemIndex;\n\n _this.props.onMouseLeave(event, {\n sectionIndex: sectionIndex,\n itemIndex: itemIndex\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onMouseDown\", function (event) {\n var _this$props3 = _this.props,\n sectionIndex = _this$props3.sectionIndex,\n itemIndex = _this$props3.itemIndex;\n\n _this.props.onMouseDown(event, {\n sectionIndex: sectionIndex,\n itemIndex: itemIndex\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props4 = _this.props,\n sectionIndex = _this$props4.sectionIndex,\n itemIndex = _this$props4.itemIndex;\n\n _this.props.onClick(event, {\n sectionIndex: sectionIndex,\n itemIndex: itemIndex\n });\n });\n\n return _this;\n }\n\n _createClass(Item, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return (0, _compareObjects[\"default\"])(nextProps, this.props, ['renderItemData']);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props5 = this.props,\n isHighlighted = _this$props5.isHighlighted,\n item = _this$props5.item,\n renderItem = _this$props5.renderItem,\n renderItemData = _this$props5.renderItemData,\n restProps = _objectWithoutProperties(_this$props5, [\"isHighlighted\", \"item\", \"renderItem\", \"renderItemData\"]);\n\n delete restProps.sectionIndex;\n delete restProps.itemIndex;\n\n if (typeof restProps.onMouseEnter === 'function') {\n restProps.onMouseEnter = this.onMouseEnter;\n }\n\n if (typeof restProps.onMouseLeave === 'function') {\n restProps.onMouseLeave = this.onMouseLeave;\n }\n\n if (typeof restProps.onMouseDown === 'function') {\n restProps.onMouseDown = this.onMouseDown;\n }\n\n if (typeof restProps.onClick === 'function') {\n restProps.onClick = this.onClick;\n }\n\n return /*#__PURE__*/_react[\"default\"].createElement(\"li\", _extends({\n role: \"option\"\n }, restProps, {\n ref: this.storeItemReference\n }), renderItem(item, _objectSpread({\n isHighlighted: isHighlighted\n }, renderItemData)));\n }\n }]);\n\n return Item;\n}(_react.Component);\n\nexports[\"default\"] = Item;\n\n_defineProperty(Item, \"propTypes\", {\n sectionIndex: _propTypes[\"default\"].number,\n isHighlighted: _propTypes[\"default\"].bool.isRequired,\n itemIndex: _propTypes[\"default\"].number.isRequired,\n item: _propTypes[\"default\"].any.isRequired,\n renderItem: _propTypes[\"default\"].func.isRequired,\n renderItemData: _propTypes[\"default\"].object.isRequired,\n onMouseEnter: _propTypes[\"default\"].func,\n onMouseLeave: _propTypes[\"default\"].func,\n onMouseDown: _propTypes[\"default\"].func,\n onClick: _propTypes[\"default\"].func\n});","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n\n/* global define */\n(function () {\n 'use strict';\n\n var hasOwn = {}.hasOwnProperty;\n\n function classNames() {\n var classes = [];\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i];\n if (!arg) continue;\n var argType = typeof arg;\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg);\n } else if (Array.isArray(arg)) {\n if (arg.length) {\n var inner = classNames.apply(null, arg);\n\n if (inner) {\n classes.push(inner);\n }\n }\n } else if (argType === 'object') {\n if (arg.toString === Object.prototype.toString) {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n } else {\n classes.push(arg.toString());\n }\n }\n }\n\n return classes.join(' ');\n }\n\n if (typeof module !== 'undefined' && module.exports) {\n classNames.default = classNames;\n module.exports = classNames;\n } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n // register as 'classnames', consistent with npm package name\n define('classnames', [], function () {\n return classNames;\n });\n } else {\n window.classNames = classNames;\n }\n})();","'use strict';\n\nvar merge = require('../functions/merge');\n\nvar defaultsPure = require('../functions/defaultsPure');\n\nvar intersection = require('../functions/intersection');\n\nvar find = require('../functions/find');\n\nvar valToNumber = require('../functions/valToNumber');\n\nvar omit = require('../functions/omit');\n\nvar objectHasKeys = require('../functions/objectHasKeys');\n\nvar isValidUserToken = require('../utils/isValidUserToken');\n\nvar RefinementList = require('./RefinementList');\n/**\n * isEqual, but only for numeric refinement values, possible values:\n * - 5\n * - [5]\n * - [[5]]\n * - [[5,5],[4]]\n */\n\n\nfunction isEqualNumericRefinement(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every(function (el, i) {\n return isEqualNumericRefinement(b[i], el);\n });\n }\n\n return a === b;\n}\n/**\n * like _.find but using deep equality to be able to use it\n * to find arrays.\n * @private\n * @param {any[]} array array to search into (elements are base or array of base)\n * @param {any} searchedValue the value we're looking for (base or array of base)\n * @return {any} the searched value or undefined\n */\n\n\nfunction findArray(array, searchedValue) {\n return find(array, function (currentValue) {\n return isEqualNumericRefinement(currentValue, searchedValue);\n });\n}\n/**\n * The facet list is the structure used to store the list of values used to\n * filter a single attribute.\n * @typedef {string[]} SearchParameters.FacetList\n */\n\n/**\n * Structure to store numeric filters with the operator as the key. The supported operators\n * are `=`, `>`, `<`, `>=`, `<=` and `!=`.\n * @typedef {Object.>} SearchParameters.OperatorList\n */\n\n/**\n * SearchParameters is the data structure that contains all the information\n * usable for making a search to Algolia API. It doesn't do the search itself,\n * nor does it contains logic about the parameters.\n * It is an immutable object, therefore it has been created in a way that each\n * changes does not change the object itself but returns a copy with the\n * modification.\n * This object should probably not be instantiated outside of the helper. It will\n * be provided when needed. This object is documented for reference as you'll\n * get it from events generated by the {@link AlgoliaSearchHelper}.\n * If need be, instantiate the Helper from the factory function {@link SearchParameters.make}\n * @constructor\n * @classdesc contains all the parameters of a search\n * @param {object|SearchParameters} newParameters existing parameters or partial object\n * for the properties of a new SearchParameters\n * @see SearchParameters.make\n * @example SearchParameters of the first query in\n * the instant search demo\n{\n \"query\": \"\",\n \"disjunctiveFacets\": [\n \"customerReviewCount\",\n \"category\",\n \"salePrice_range\",\n \"manufacturer\"\n ],\n \"maxValuesPerFacet\": 30,\n \"page\": 0,\n \"hitsPerPage\": 10,\n \"facets\": [\n \"type\",\n \"shipping\"\n ]\n}\n */\n\n\nfunction SearchParameters(newParameters) {\n var params = newParameters ? SearchParameters._parseNumbers(newParameters) : {};\n\n if (params.userToken !== undefined && !isValidUserToken(params.userToken)) {\n console.warn('[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\\n - Format: [a-zA-Z0-9_-]{1,64}');\n }\n /**\n * This attribute contains the list of all the conjunctive facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * @member {string[]}\n */\n\n\n this.facets = params.facets || [];\n /**\n * This attribute contains the list of all the disjunctive facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * @member {string[]}\n */\n\n this.disjunctiveFacets = params.disjunctiveFacets || [];\n /**\n * This attribute contains the list of all the hierarchical facets\n * used. This list will be added to requested facets in the\n * [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.\n * Hierarchical facets are a sub type of disjunctive facets that\n * let you filter faceted attributes hierarchically.\n * @member {string[]|object[]}\n */\n\n this.hierarchicalFacets = params.hierarchicalFacets || []; // Refinements\n\n /**\n * This attribute contains all the filters that need to be\n * applied on the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n\n this.facetsRefinements = params.facetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * excluded from the conjunctive facets. Each facet must be properly\n * defined in the `facets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters excluded for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n\n this.facetsExcludes = params.facetsExcludes || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the disjunctive facets. Each facet must be properly\n * defined in the `disjunctiveFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n\n this.disjunctiveFacetsRefinements = params.disjunctiveFacetsRefinements || {};\n /**\n * This attribute contains all the filters that need to be\n * applied on the numeric attributes.\n *\n * The key is the name of the attribute, and the value is the\n * filters to apply to this attribute.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `numericFilters` attribute.\n * @member {Object.}\n */\n\n this.numericRefinements = params.numericRefinements || {};\n /**\n * This attribute contains all the tags used to refine the query.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `tagFilters` attribute.\n * @member {string[]}\n */\n\n this.tagRefinements = params.tagRefinements || [];\n /**\n * This attribute contains all the filters that need to be\n * applied on the hierarchical facets. Each facet must be properly\n * defined in the `hierarchicalFacets` attribute.\n *\n * The key is the name of the facet, and the `FacetList` contains all\n * filters selected for the associated facet name. The FacetList values\n * are structured as a string that contain the values for each level\n * separated by the configured separator.\n *\n * When querying algolia, the values stored in this attribute will\n * be translated into the `facetFilters` attribute.\n * @member {Object.}\n */\n\n this.hierarchicalFacetsRefinements = params.hierarchicalFacetsRefinements || {};\n var self = this;\n Object.keys(params).forEach(function (paramName) {\n var isKeyKnown = SearchParameters.PARAMETERS.indexOf(paramName) !== -1;\n var isValueDefined = params[paramName] !== undefined;\n\n if (!isKeyKnown && isValueDefined) {\n self[paramName] = params[paramName];\n }\n });\n}\n/**\n * List all the properties in SearchParameters and therefore all the known Algolia properties\n * This doesn't contain any beta/hidden features.\n * @private\n */\n\n\nSearchParameters.PARAMETERS = Object.keys(new SearchParameters());\n/**\n * @private\n * @param {object} partialState full or part of a state\n * @return {object} a new object with the number keys as number\n */\n\nSearchParameters._parseNumbers = function (partialState) {\n // Do not reparse numbers in SearchParameters, they ought to be parsed already\n if (partialState instanceof SearchParameters) return partialState;\n var numbers = {};\n var numberKeys = ['aroundPrecision', 'aroundRadius', 'getRankingInfo', 'minWordSizefor2Typos', 'minWordSizefor1Typo', 'page', 'maxValuesPerFacet', 'distinct', 'minimumAroundRadius', 'hitsPerPage', 'minProximity'];\n numberKeys.forEach(function (k) {\n var value = partialState[k];\n\n if (typeof value === 'string') {\n var parsedValue = parseFloat(value); // global isNaN is ok to use here, value is only number or NaN\n\n numbers[k] = isNaN(parsedValue) ? value : parsedValue;\n }\n }); // there's two formats of insideBoundingBox, we need to parse\n // the one which is an array of float geo rectangles\n\n if (Array.isArray(partialState.insideBoundingBox)) {\n numbers.insideBoundingBox = partialState.insideBoundingBox.map(function (geoRect) {\n if (Array.isArray(geoRect)) {\n return geoRect.map(function (value) {\n return parseFloat(value);\n });\n }\n\n return geoRect;\n });\n }\n\n if (partialState.numericRefinements) {\n var numericRefinements = {};\n Object.keys(partialState.numericRefinements).forEach(function (attribute) {\n var operators = partialState.numericRefinements[attribute] || {};\n numericRefinements[attribute] = {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator];\n var parsedValues = values.map(function (v) {\n if (Array.isArray(v)) {\n return v.map(function (vPrime) {\n if (typeof vPrime === 'string') {\n return parseFloat(vPrime);\n }\n\n return vPrime;\n });\n } else if (typeof v === 'string') {\n return parseFloat(v);\n }\n\n return v;\n });\n numericRefinements[attribute][operator] = parsedValues;\n });\n });\n numbers.numericRefinements = numericRefinements;\n }\n\n return merge({}, partialState, numbers);\n};\n/**\n * Factory for SearchParameters\n * @param {object|SearchParameters} newParameters existing parameters or partial\n * object for the properties of a new SearchParameters\n * @return {SearchParameters} frozen instance of SearchParameters\n */\n\n\nSearchParameters.make = function makeSearchParameters(newParameters) {\n var instance = new SearchParameters(newParameters);\n var hierarchicalFacets = newParameters.hierarchicalFacets || [];\n hierarchicalFacets.forEach(function (facet) {\n if (facet.rootPath) {\n var currentRefinement = instance.getHierarchicalRefinement(facet.name);\n\n if (currentRefinement.length > 0 && currentRefinement[0].indexOf(facet.rootPath) !== 0) {\n instance = instance.clearRefinements(facet.name);\n } // get it again in case it has been cleared\n\n\n currentRefinement = instance.getHierarchicalRefinement(facet.name);\n\n if (currentRefinement.length === 0) {\n instance = instance.toggleHierarchicalFacetRefinement(facet.name, facet.rootPath);\n }\n }\n });\n return instance;\n};\n/**\n * Validates the new parameters based on the previous state\n * @param {SearchParameters} currentState the current state\n * @param {object|SearchParameters} parameters the new parameters to set\n * @return {Error|null} Error if the modification is invalid, null otherwise\n */\n\n\nSearchParameters.validate = function (currentState, parameters) {\n var params = parameters || {};\n\n if (currentState.tagFilters && params.tagRefinements && params.tagRefinements.length > 0) {\n return new Error('[Tags] Cannot switch from the managed tag API to the advanced API. It is probably ' + 'an error, if it is really what you want, you should first clear the tags with clearTags method.');\n }\n\n if (currentState.tagRefinements.length > 0 && params.tagFilters) {\n return new Error('[Tags] Cannot switch from the advanced tag API to the managed API. It is probably ' + 'an error, if it is not, you should first clear the tags with clearTags method.');\n }\n\n if (currentState.numericFilters && params.numericRefinements && objectHasKeys(params.numericRefinements)) {\n return new Error(\"[Numeric filters] Can't switch from the advanced to the managed API. It\" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.');\n }\n\n if (objectHasKeys(currentState.numericRefinements) && params.numericFilters) {\n return new Error(\"[Numeric filters] Can't switch from the managed API to the advanced. It\" + ' is probably an error, if this is really what you want, you have to first' + ' clear the numeric filters.');\n }\n\n return null;\n};\n\nSearchParameters.prototype = {\n constructor: SearchParameters,\n\n /**\n * Remove all refinements (disjunctive + conjunctive + excludes + numeric filters)\n * @method\n * @param {undefined|string|SearchParameters.clearCallback} [attribute] optional string or function\n * - If not given, means to clear all the filters.\n * - If `string`, means to clear all refinements for the `attribute` named filter.\n * - If `function`, means to clear all the refinements that return truthy values.\n * @return {SearchParameters}\n */\n clearRefinements: function clearRefinements(attribute) {\n var patch = {\n numericRefinements: this._clearNumericRefinements(attribute),\n facetsRefinements: RefinementList.clearRefinement(this.facetsRefinements, attribute, 'conjunctiveFacet'),\n facetsExcludes: RefinementList.clearRefinement(this.facetsExcludes, attribute, 'exclude'),\n disjunctiveFacetsRefinements: RefinementList.clearRefinement(this.disjunctiveFacetsRefinements, attribute, 'disjunctiveFacet'),\n hierarchicalFacetsRefinements: RefinementList.clearRefinement(this.hierarchicalFacetsRefinements, attribute, 'hierarchicalFacet')\n };\n\n if (patch.numericRefinements === this.numericRefinements && patch.facetsRefinements === this.facetsRefinements && patch.facetsExcludes === this.facetsExcludes && patch.disjunctiveFacetsRefinements === this.disjunctiveFacetsRefinements && patch.hierarchicalFacetsRefinements === this.hierarchicalFacetsRefinements) {\n return this;\n }\n\n return this.setQueryParameters(patch);\n },\n\n /**\n * Remove all the refined tags from the SearchParameters\n * @method\n * @return {SearchParameters}\n */\n clearTags: function clearTags() {\n if (this.tagFilters === undefined && this.tagRefinements.length === 0) return this;\n return this.setQueryParameters({\n tagFilters: undefined,\n tagRefinements: []\n });\n },\n\n /**\n * Set the index.\n * @method\n * @param {string} index the index name\n * @return {SearchParameters}\n */\n setIndex: function setIndex(index) {\n if (index === this.index) return this;\n return this.setQueryParameters({\n index: index\n });\n },\n\n /**\n * Query setter\n * @method\n * @param {string} newQuery value for the new query\n * @return {SearchParameters}\n */\n setQuery: function setQuery(newQuery) {\n if (newQuery === this.query) return this;\n return this.setQueryParameters({\n query: newQuery\n });\n },\n\n /**\n * Page setter\n * @method\n * @param {number} newPage new page number\n * @return {SearchParameters}\n */\n setPage: function setPage(newPage) {\n if (newPage === this.page) return this;\n return this.setQueryParameters({\n page: newPage\n });\n },\n\n /**\n * Facets setter\n * The facets are the simple facets, used for conjunctive (and) faceting.\n * @method\n * @param {string[]} facets all the attributes of the algolia records used for conjunctive faceting\n * @return {SearchParameters}\n */\n setFacets: function setFacets(facets) {\n return this.setQueryParameters({\n facets: facets\n });\n },\n\n /**\n * Disjunctive facets setter\n * Change the list of disjunctive (or) facets the helper chan handle.\n * @method\n * @param {string[]} facets all the attributes of the algolia records used for disjunctive faceting\n * @return {SearchParameters}\n */\n setDisjunctiveFacets: function setDisjunctiveFacets(facets) {\n return this.setQueryParameters({\n disjunctiveFacets: facets\n });\n },\n\n /**\n * HitsPerPage setter\n * Hits per page represents the number of hits retrieved for this query\n * @method\n * @param {number} n number of hits retrieved per page of results\n * @return {SearchParameters}\n */\n setHitsPerPage: function setHitsPerPage(n) {\n if (this.hitsPerPage === n) return this;\n return this.setQueryParameters({\n hitsPerPage: n\n });\n },\n\n /**\n * typoTolerance setter\n * Set the value of typoTolerance\n * @method\n * @param {string} typoTolerance new value of typoTolerance (\"true\", \"false\", \"min\" or \"strict\")\n * @return {SearchParameters}\n */\n setTypoTolerance: function setTypoTolerance(typoTolerance) {\n if (this.typoTolerance === typoTolerance) return this;\n return this.setQueryParameters({\n typoTolerance: typoTolerance\n });\n },\n\n /**\n * Add a numeric filter for a given attribute\n * When value is an array, they are combined with OR\n * When value is a single value, it will combined with AND\n * @method\n * @param {string} attribute attribute to set the filter on\n * @param {string} operator operator of the filter (possible values: =, >, >=, <, <=, !=)\n * @param {number | number[]} value value of the filter\n * @return {SearchParameters}\n * @example\n * // for price = 50 or 40\n * searchparameter.addNumericRefinement('price', '=', [50, 40]);\n * @example\n * // for size = 38 and 40\n * searchparameter.addNumericRefinement('size', '=', 38);\n * searchparameter.addNumericRefinement('size', '=', 40);\n */\n addNumericRefinement: function addNumericRefinement(attribute, operator, v) {\n var value = valToNumber(v);\n if (this.isNumericRefined(attribute, operator, value)) return this;\n var mod = merge({}, this.numericRefinements);\n mod[attribute] = merge({}, mod[attribute]);\n\n if (mod[attribute][operator]) {\n // Array copy\n mod[attribute][operator] = mod[attribute][operator].slice(); // Add the element. Concat can't be used here because value can be an array.\n\n mod[attribute][operator].push(value);\n } else {\n mod[attribute][operator] = [value];\n }\n\n return this.setQueryParameters({\n numericRefinements: mod\n });\n },\n\n /**\n * Get the list of conjunctive refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getConjunctiveRefinements: function getConjunctiveRefinements(facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\n }\n\n return this.facetsRefinements[facetName] || [];\n },\n\n /**\n * Get the list of disjunctive refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getDisjunctiveRefinements: function getDisjunctiveRefinements(facetName) {\n if (!this.isDisjunctiveFacet(facetName)) {\n return [];\n }\n\n return this.disjunctiveFacetsRefinements[facetName] || [];\n },\n\n /**\n * Get the list of hierarchical refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getHierarchicalRefinement: function getHierarchicalRefinement(facetName) {\n // we send an array but we currently do not support multiple\n // hierarchicalRefinements for a hierarchicalFacet\n return this.hierarchicalFacetsRefinements[facetName] || [];\n },\n\n /**\n * Get the list of exclude refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {string[]} list of refinements\n */\n getExcludeRefinements: function getExcludeRefinements(facetName) {\n if (!this.isConjunctiveFacet(facetName)) {\n return [];\n }\n\n return this.facetsExcludes[facetName] || [];\n },\n\n /**\n * Remove all the numeric filter for a given (attribute, operator)\n * @method\n * @param {string} attribute attribute to set the filter on\n * @param {string} [operator] operator of the filter (possible values: =, >, >=, <, <=, !=)\n * @param {number} [number] the value to be removed\n * @return {SearchParameters}\n */\n removeNumericRefinement: function removeNumericRefinement(attribute, operator, paramValue) {\n if (paramValue !== undefined) {\n if (!this.isNumericRefined(attribute, operator, paramValue)) {\n return this;\n }\n\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function (value, key) {\n return key === attribute && value.op === operator && isEqualNumericRefinement(value.val, valToNumber(paramValue));\n })\n });\n } else if (operator !== undefined) {\n if (!this.isNumericRefined(attribute, operator)) return this;\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function (value, key) {\n return key === attribute && value.op === operator;\n })\n });\n }\n\n if (!this.isNumericRefined(attribute)) return this;\n return this.setQueryParameters({\n numericRefinements: this._clearNumericRefinements(function (value, key) {\n return key === attribute;\n })\n });\n },\n\n /**\n * Get the list of numeric refinements for a single facet\n * @param {string} facetName name of the attribute used for faceting\n * @return {SearchParameters.OperatorList} list of refinements\n */\n getNumericRefinements: function getNumericRefinements(facetName) {\n return this.numericRefinements[facetName] || {};\n },\n\n /**\n * Return the current refinement for the (attribute, operator)\n * @param {string} attribute attribute in the record\n * @param {string} operator operator applied on the refined values\n * @return {Array.} refined values\n */\n getNumericRefinement: function getNumericRefinement(attribute, operator) {\n return this.numericRefinements[attribute] && this.numericRefinements[attribute][operator];\n },\n\n /**\n * Clear numeric filters.\n * @method\n * @private\n * @param {string|SearchParameters.clearCallback} [attribute] optional string or function\n * - If not given, means to clear all the filters.\n * - If `string`, means to clear all refinements for the `attribute` named filter.\n * - If `function`, means to clear all the refinements that return truthy values.\n * @return {Object.}\n */\n _clearNumericRefinements: function _clearNumericRefinements(attribute) {\n if (attribute === undefined) {\n if (!objectHasKeys(this.numericRefinements)) {\n return this.numericRefinements;\n }\n\n return {};\n } else if (typeof attribute === 'string') {\n return omit(this.numericRefinements, [attribute]);\n } else if (typeof attribute === 'function') {\n var hasChanged = false;\n var numericRefinements = this.numericRefinements;\n var newNumericRefinements = Object.keys(numericRefinements).reduce(function (memo, key) {\n var operators = numericRefinements[key];\n var operatorList = {};\n operators = operators || {};\n Object.keys(operators).forEach(function (operator) {\n var values = operators[operator] || [];\n var outValues = [];\n values.forEach(function (value) {\n var predicateResult = attribute({\n val: value,\n op: operator\n }, key, 'numeric');\n if (!predicateResult) outValues.push(value);\n });\n\n if (outValues.length !== values.length) {\n hasChanged = true;\n }\n\n operatorList[operator] = outValues;\n });\n memo[key] = operatorList;\n return memo;\n }, {});\n if (hasChanged) return newNumericRefinements;\n return this.numericRefinements;\n }\n },\n\n /**\n * Add a facet to the facets attribute of the helper configuration, if it\n * isn't already present.\n * @method\n * @param {string} facet facet name to add\n * @return {SearchParameters}\n */\n addFacet: function addFacet(facet) {\n if (this.isConjunctiveFacet(facet)) {\n return this;\n }\n\n return this.setQueryParameters({\n facets: this.facets.concat([facet])\n });\n },\n\n /**\n * Add a disjunctive facet to the disjunctiveFacets attribute of the helper\n * configuration, if it isn't already present.\n * @method\n * @param {string} facet disjunctive facet name to add\n * @return {SearchParameters}\n */\n addDisjunctiveFacet: function addDisjunctiveFacet(facet) {\n if (this.isDisjunctiveFacet(facet)) {\n return this;\n }\n\n return this.setQueryParameters({\n disjunctiveFacets: this.disjunctiveFacets.concat([facet])\n });\n },\n\n /**\n * Add a hierarchical facet to the hierarchicalFacets attribute of the helper\n * configuration.\n * @method\n * @param {object} hierarchicalFacet hierarchical facet to add\n * @return {SearchParameters}\n * @throws will throw an error if a hierarchical facet with the same name was already declared\n */\n addHierarchicalFacet: function addHierarchicalFacet(hierarchicalFacet) {\n if (this.isHierarchicalFacet(hierarchicalFacet.name)) {\n throw new Error('Cannot declare two hierarchical facets with the same name: `' + hierarchicalFacet.name + '`');\n }\n\n return this.setQueryParameters({\n hierarchicalFacets: this.hierarchicalFacets.concat([hierarchicalFacet])\n });\n },\n\n /**\n * Add a refinement on a \"normal\" facet\n * @method\n * @param {string} facet attribute to apply the faceting on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addFacetRefinement: function addFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n if (RefinementList.isRefined(this.facetsRefinements, facet, value)) return this;\n return this.setQueryParameters({\n facetsRefinements: RefinementList.addRefinement(this.facetsRefinements, facet, value)\n });\n },\n\n /**\n * Exclude a value from a \"normal\" facet\n * @method\n * @param {string} facet attribute to apply the exclusion on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addExcludeRefinement: function addExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n if (RefinementList.isRefined(this.facetsExcludes, facet, value)) return this;\n return this.setQueryParameters({\n facetsExcludes: RefinementList.addRefinement(this.facetsExcludes, facet, value)\n });\n },\n\n /**\n * Adds a refinement on a disjunctive facet.\n * @method\n * @param {string} facet attribute to apply the faceting on\n * @param {string} value value of the attribute (will be converted to string)\n * @return {SearchParameters}\n */\n addDisjunctiveFacetRefinement: function addDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n\n if (RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this;\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.addRefinement(this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n\n /**\n * addTagRefinement adds a tag to the list used to filter the results\n * @param {string} tag tag to be added\n * @return {SearchParameters}\n */\n addTagRefinement: function addTagRefinement(tag) {\n if (this.isTagRefined(tag)) return this;\n var modification = {\n tagRefinements: this.tagRefinements.concat(tag)\n };\n return this.setQueryParameters(modification);\n },\n\n /**\n * Remove a facet from the facets attribute of the helper configuration, if it\n * is present.\n * @method\n * @param {string} facet facet name to remove\n * @return {SearchParameters}\n */\n removeFacet: function removeFacet(facet) {\n if (!this.isConjunctiveFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n facets: this.facets.filter(function (f) {\n return f !== facet;\n })\n });\n },\n\n /**\n * Remove a disjunctive facet from the disjunctiveFacets attribute of the\n * helper configuration, if it is present.\n * @method\n * @param {string} facet disjunctive facet name to remove\n * @return {SearchParameters}\n */\n removeDisjunctiveFacet: function removeDisjunctiveFacet(facet) {\n if (!this.isDisjunctiveFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n disjunctiveFacets: this.disjunctiveFacets.filter(function (f) {\n return f !== facet;\n })\n });\n },\n\n /**\n * Remove a hierarchical facet from the hierarchicalFacets attribute of the\n * helper configuration, if it is present.\n * @method\n * @param {string} facet hierarchical facet name to remove\n * @return {SearchParameters}\n */\n removeHierarchicalFacet: function removeHierarchicalFacet(facet) {\n if (!this.isHierarchicalFacet(facet)) {\n return this;\n }\n\n return this.clearRefinements(facet).setQueryParameters({\n hierarchicalFacets: this.hierarchicalFacets.filter(function (f) {\n return f.name !== facet;\n })\n });\n },\n\n /**\n * Remove a refinement set on facet. If a value is provided, it will clear the\n * refinement for the given value, otherwise it will clear all the refinement\n * values for the faceted attribute.\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} [value] value used to filter\n * @return {SearchParameters}\n */\n removeFacetRefinement: function removeFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n if (!RefinementList.isRefined(this.facetsRefinements, facet, value)) return this;\n return this.setQueryParameters({\n facetsRefinements: RefinementList.removeRefinement(this.facetsRefinements, facet, value)\n });\n },\n\n /**\n * Remove a negative refinement on a facet\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} value value used to filter\n * @return {SearchParameters}\n */\n removeExcludeRefinement: function removeExcludeRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n if (!RefinementList.isRefined(this.facetsExcludes, facet, value)) return this;\n return this.setQueryParameters({\n facetsExcludes: RefinementList.removeRefinement(this.facetsExcludes, facet, value)\n });\n },\n\n /**\n * Remove a refinement on a disjunctive facet\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {string} value value used to filter\n * @return {SearchParameters}\n */\n removeDisjunctiveFacetRefinement: function removeDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n\n if (!RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value)) return this;\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.removeRefinement(this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n\n /**\n * Remove a tag from the list of tag refinements\n * @method\n * @param {string} tag the tag to remove\n * @return {SearchParameters}\n */\n removeTagRefinement: function removeTagRefinement(tag) {\n if (!this.isTagRefined(tag)) return this;\n var modification = {\n tagRefinements: this.tagRefinements.filter(function (t) {\n return t !== tag;\n })\n };\n return this.setQueryParameters(modification);\n },\n\n /**\n * Generic toggle refinement method to use with facet, disjunctive facets\n * and hierarchical facets\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {SearchParameters}\n * @throws will throw an error if the facet is not declared in the settings of the helper\n * @deprecated since version 2.19.0, see {@link SearchParameters#toggleFacetRefinement}\n */\n toggleRefinement: function toggleRefinement(facet, value) {\n return this.toggleFacetRefinement(facet, value);\n },\n\n /**\n * Generic toggle refinement method to use with facet, disjunctive facets\n * and hierarchical facets\n * @param {string} facet the facet to refine\n * @param {string} value the associated value\n * @return {SearchParameters}\n * @throws will throw an error if the facet is not declared in the settings of the helper\n */\n toggleFacetRefinement: function toggleFacetRefinement(facet, value) {\n if (this.isHierarchicalFacet(facet)) {\n return this.toggleHierarchicalFacetRefinement(facet, value);\n } else if (this.isConjunctiveFacet(facet)) {\n return this.toggleConjunctiveFacetRefinement(facet, value);\n } else if (this.isDisjunctiveFacet(facet)) {\n return this.toggleDisjunctiveFacetRefinement(facet, value);\n }\n\n throw new Error('Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets');\n },\n\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleConjunctiveFacetRefinement: function toggleConjunctiveFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n facetsRefinements: RefinementList.toggleRefinement(this.facetsRefinements, facet, value)\n });\n },\n\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleExcludeFacetRefinement: function toggleExcludeFacetRefinement(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n facetsExcludes: RefinementList.toggleRefinement(this.facetsExcludes, facet, value)\n });\n },\n\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleDisjunctiveFacetRefinement: function toggleDisjunctiveFacetRefinement(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n throw new Error(facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');\n }\n\n return this.setQueryParameters({\n disjunctiveFacetsRefinements: RefinementList.toggleRefinement(this.disjunctiveFacetsRefinements, facet, value)\n });\n },\n\n /**\n * Switch the refinement applied over a facet/value\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {SearchParameters}\n */\n toggleHierarchicalFacetRefinement: function toggleHierarchicalFacetRefinement(facet, value) {\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration');\n }\n\n var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facet));\n\n var mod = {};\n var upOneOrMultipleLevel = this.hierarchicalFacetsRefinements[facet] !== undefined && this.hierarchicalFacetsRefinements[facet].length > 0 && ( // remove current refinement:\n // refinement was 'beer > IPA', call is toggleRefine('beer > IPA'), refinement should be `beer`\n this.hierarchicalFacetsRefinements[facet][0] === value || // remove a parent refinement of the current refinement:\n // - refinement was 'beer > IPA > Flying dog'\n // - call is toggleRefine('beer > IPA')\n // - refinement should be `beer`\n this.hierarchicalFacetsRefinements[facet][0].indexOf(value + separator) === 0);\n\n if (upOneOrMultipleLevel) {\n if (value.indexOf(separator) === -1) {\n // go back to root level\n mod[facet] = [];\n } else {\n mod[facet] = [value.slice(0, value.lastIndexOf(separator))];\n }\n } else {\n mod[facet] = [value];\n }\n\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n\n /**\n * Adds a refinement on a hierarchical facet.\n * @param {string} facet the facet name\n * @param {string} path the hierarchical facet path\n * @return {SearchParameter} the new state\n * @throws Error if the facet is not defined or if the facet is refined\n */\n addHierarchicalFacetRefinement: function addHierarchicalFacetRefinement(facet, path) {\n if (this.isHierarchicalFacetRefined(facet)) {\n throw new Error(facet + ' is already refined.');\n }\n\n if (!this.isHierarchicalFacet(facet)) {\n throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration.');\n }\n\n var mod = {};\n mod[facet] = [path];\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n\n /**\n * Removes the refinement set on a hierarchical facet.\n * @param {string} facet the facet name\n * @return {SearchParameter} the new state\n * @throws Error if the facet is not defined or if the facet is not refined\n */\n removeHierarchicalFacetRefinement: function removeHierarchicalFacetRefinement(facet) {\n if (!this.isHierarchicalFacetRefined(facet)) {\n return this;\n }\n\n var mod = {};\n mod[facet] = [];\n return this.setQueryParameters({\n hierarchicalFacetsRefinements: defaultsPure({}, mod, this.hierarchicalFacetsRefinements)\n });\n },\n\n /**\n * Switch the tag refinement\n * @method\n * @param {string} tag the tag to remove or add\n * @return {SearchParameters}\n */\n toggleTagRefinement: function toggleTagRefinement(tag) {\n if (this.isTagRefined(tag)) {\n return this.removeTagRefinement(tag);\n }\n\n return this.addTagRefinement(tag);\n },\n\n /**\n * Test if the facet name is from one of the disjunctive facets\n * @method\n * @param {string} facet facet name to test\n * @return {boolean}\n */\n isDisjunctiveFacet: function isDisjunctiveFacet(facet) {\n return this.disjunctiveFacets.indexOf(facet) > -1;\n },\n\n /**\n * Test if the facet name is from one of the hierarchical facets\n * @method\n * @param {string} facetName facet name to test\n * @return {boolean}\n */\n isHierarchicalFacet: function isHierarchicalFacet(facetName) {\n return this.getHierarchicalFacetByName(facetName) !== undefined;\n },\n\n /**\n * Test if the facet name is from one of the conjunctive/normal facets\n * @method\n * @param {string} facet facet name to test\n * @return {boolean}\n */\n isConjunctiveFacet: function isConjunctiveFacet(facet) {\n return this.facets.indexOf(facet) > -1;\n },\n\n /**\n * Returns true if the facet is refined, either for a specific value or in\n * general.\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} value, optional value. If passed will test that this value\n * is filtering the given facet.\n * @return {boolean} returns true if refined\n */\n isFacetRefined: function isFacetRefined(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n return false;\n }\n\n return RefinementList.isRefined(this.facetsRefinements, facet, value);\n },\n\n /**\n * Returns true if the facet contains exclusions or if a specific value is\n * excluded.\n *\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} [value] optional value. If passed will test that this value\n * is filtering the given facet.\n * @return {boolean} returns true if refined\n */\n isExcludeRefined: function isExcludeRefined(facet, value) {\n if (!this.isConjunctiveFacet(facet)) {\n return false;\n }\n\n return RefinementList.isRefined(this.facetsExcludes, facet, value);\n },\n\n /**\n * Returns true if the facet contains a refinement, or if a value passed is a\n * refinement for the facet.\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} value optional, will test if the value is used for refinement\n * if there is one, otherwise will test if the facet contains any refinement\n * @return {boolean}\n */\n isDisjunctiveFacetRefined: function isDisjunctiveFacetRefined(facet, value) {\n if (!this.isDisjunctiveFacet(facet)) {\n return false;\n }\n\n return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value);\n },\n\n /**\n * Returns true if the facet contains a refinement, or if a value passed is a\n * refinement for the facet.\n * @method\n * @param {string} facet name of the attribute for used for faceting\n * @param {string} value optional, will test if the value is used for refinement\n * if there is one, otherwise will test if the facet contains any refinement\n * @return {boolean}\n */\n isHierarchicalFacetRefined: function isHierarchicalFacetRefined(facet, value) {\n if (!this.isHierarchicalFacet(facet)) {\n return false;\n }\n\n var refinements = this.getHierarchicalRefinement(facet);\n\n if (!value) {\n return refinements.length > 0;\n }\n\n return refinements.indexOf(value) !== -1;\n },\n\n /**\n * Test if the triple (attribute, operator, value) is already refined.\n * If only the attribute and the operator are provided, it tests if the\n * contains any refinement value.\n * @method\n * @param {string} attribute attribute for which the refinement is applied\n * @param {string} [operator] operator of the refinement\n * @param {string} [value] value of the refinement\n * @return {boolean} true if it is refined\n */\n isNumericRefined: function isNumericRefined(attribute, operator, value) {\n if (value === undefined && operator === undefined) {\n return !!this.numericRefinements[attribute];\n }\n\n var isOperatorDefined = this.numericRefinements[attribute] && this.numericRefinements[attribute][operator] !== undefined;\n\n if (value === undefined || !isOperatorDefined) {\n return isOperatorDefined;\n }\n\n var parsedValue = valToNumber(value);\n var isAttributeValueDefined = findArray(this.numericRefinements[attribute][operator], parsedValue) !== undefined;\n return isOperatorDefined && isAttributeValueDefined;\n },\n\n /**\n * Returns true if the tag refined, false otherwise\n * @method\n * @param {string} tag the tag to check\n * @return {boolean}\n */\n isTagRefined: function isTagRefined(tag) {\n return this.tagRefinements.indexOf(tag) !== -1;\n },\n\n /**\n * Returns the list of all disjunctive facets refined\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {string[]}\n */\n getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() {\n var self = this; // attributes used for numeric filter can also be disjunctive\n\n var disjunctiveNumericRefinedFacets = intersection(Object.keys(this.numericRefinements).filter(function (facet) {\n return Object.keys(self.numericRefinements[facet]).length > 0;\n }), this.disjunctiveFacets);\n return Object.keys(this.disjunctiveFacetsRefinements).filter(function (facet) {\n return self.disjunctiveFacetsRefinements[facet].length > 0;\n }).concat(disjunctiveNumericRefinedFacets).concat(this.getRefinedHierarchicalFacets());\n },\n\n /**\n * Returns the list of all disjunctive facets refined\n * @method\n * @param {string} facet name of the attribute used for faceting\n * @param {value} value value used for filtering\n * @return {string[]}\n */\n getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() {\n var self = this;\n return intersection( // enforce the order between the two arrays,\n // so that refinement name index === hierarchical facet index\n this.hierarchicalFacets.map(function (facet) {\n return facet.name;\n }), Object.keys(this.hierarchicalFacetsRefinements).filter(function (facet) {\n return self.hierarchicalFacetsRefinements[facet].length > 0;\n }));\n },\n\n /**\n * Returned the list of all disjunctive facets not refined\n * @method\n * @return {string[]}\n */\n getUnrefinedDisjunctiveFacets: function getUnrefinedDisjunctiveFacets() {\n var refinedFacets = this.getRefinedDisjunctiveFacets();\n return this.disjunctiveFacets.filter(function (f) {\n return refinedFacets.indexOf(f) === -1;\n });\n },\n managedParameters: ['index', 'facets', 'disjunctiveFacets', 'facetsRefinements', 'hierarchicalFacets', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacetsRefinements'],\n getQueryParams: function getQueryParams() {\n var managedParameters = this.managedParameters;\n var queryParams = {};\n var self = this;\n Object.keys(this).forEach(function (paramName) {\n var paramValue = self[paramName];\n\n if (managedParameters.indexOf(paramName) === -1 && paramValue !== undefined) {\n queryParams[paramName] = paramValue;\n }\n });\n return queryParams;\n },\n\n /**\n * Let the user set a specific value for a given parameter. Will return the\n * same instance if the parameter is invalid or if the value is the same as the\n * previous one.\n * @method\n * @param {string} parameter the parameter name\n * @param {any} value the value to be set, must be compliant with the definition\n * of the attribute on the object\n * @return {SearchParameters} the updated state\n */\n setQueryParameter: function setParameter(parameter, value) {\n if (this[parameter] === value) return this;\n var modification = {};\n modification[parameter] = value;\n return this.setQueryParameters(modification);\n },\n\n /**\n * Let the user set any of the parameters with a plain object.\n * @method\n * @param {object} params all the keys and the values to be updated\n * @return {SearchParameters} a new updated instance\n */\n setQueryParameters: function setQueryParameters(params) {\n if (!params) return this;\n var error = SearchParameters.validate(this, params);\n\n if (error) {\n throw error;\n }\n\n var self = this;\n\n var nextWithNumbers = SearchParameters._parseNumbers(params);\n\n var previousPlainObject = Object.keys(this).reduce(function (acc, key) {\n acc[key] = self[key];\n return acc;\n }, {});\n var nextPlainObject = Object.keys(nextWithNumbers).reduce(function (previous, key) {\n var isPreviousValueDefined = previous[key] !== undefined;\n var isNextValueDefined = nextWithNumbers[key] !== undefined;\n\n if (isPreviousValueDefined && !isNextValueDefined) {\n return omit(previous, [key]);\n }\n\n if (isNextValueDefined) {\n previous[key] = nextWithNumbers[key];\n }\n\n return previous;\n }, previousPlainObject);\n return new this.constructor(nextPlainObject);\n },\n\n /**\n * Returns a new instance with the page reset. Two scenarios possible:\n * the page is omitted -> return the given instance\n * the page is set -> return a new instance with a page of 0\n * @return {SearchParameters} a new updated instance\n */\n resetPage: function resetPage() {\n if (this.page === undefined) {\n return this;\n }\n\n return this.setPage(0);\n },\n\n /**\n * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSortBy: function _getHierarchicalFacetSortBy(hierarchicalFacet) {\n return hierarchicalFacet.sortBy || ['isRefined:desc', 'name:asc'];\n },\n\n /**\n * Helper function to get the hierarchicalFacet separator or the default one (`>`)\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.separator or `>` as default\n */\n _getHierarchicalFacetSeparator: function _getHierarchicalFacetSeparator(hierarchicalFacet) {\n return hierarchicalFacet.separator || ' > ';\n },\n\n /**\n * Helper function to get the hierarchicalFacet prefix path or null\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.rootPath or null as default\n */\n _getHierarchicalRootPath: function _getHierarchicalRootPath(hierarchicalFacet) {\n return hierarchicalFacet.rootPath || null;\n },\n\n /**\n * Helper function to check if we show the parent level of the hierarchicalFacet\n * @private\n * @param {object} hierarchicalFacet\n * @return {string} returns the hierarchicalFacet.showParentLevel or true as default\n */\n _getHierarchicalShowParentLevel: function _getHierarchicalShowParentLevel(hierarchicalFacet) {\n if (typeof hierarchicalFacet.showParentLevel === 'boolean') {\n return hierarchicalFacet.showParentLevel;\n }\n\n return true;\n },\n\n /**\n * Helper function to get the hierarchicalFacet by it's name\n * @param {string} hierarchicalFacetName\n * @return {object} a hierarchicalFacet\n */\n getHierarchicalFacetByName: function getHierarchicalFacetByName(hierarchicalFacetName) {\n return find(this.hierarchicalFacets, function (f) {\n return f.name === hierarchicalFacetName;\n });\n },\n\n /**\n * Get the current breadcrumb for a hierarchical facet, as an array\n * @param {string} facetName Hierarchical facet name\n * @return {array.} the path as an array of string\n */\n getHierarchicalFacetBreadcrumb: function getHierarchicalFacetBreadcrumb(facetName) {\n if (!this.isHierarchicalFacet(facetName)) {\n return [];\n }\n\n var refinement = this.getHierarchicalRefinement(facetName)[0];\n if (!refinement) return [];\n\n var separator = this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(facetName));\n\n var path = refinement.split(separator);\n return path.map(function (part) {\n return part.trim();\n });\n },\n toString: function toString() {\n return JSON.stringify(this, null, 2);\n }\n};\n/**\n * Callback used for clearRefinement method\n * @callback SearchParameters.clearCallback\n * @param {OperatorList|FacetList} value the value of the filter\n * @param {string} key the current attribute name\n * @param {string} type `numeric`, `disjunctiveFacet`, `conjunctiveFacet`, `hierarchicalFacet` or `exclude`\n * depending on the type of facet\n * @return {boolean} `true` if the element should be removed. `false` otherwise.\n */\n\nmodule.exports = SearchParameters;","'use strict';\n\nfunction intersection(arr1, arr2) {\n return arr1.filter(function (value, index) {\n return arr2.indexOf(value) > -1 && arr1.indexOf(value) === index\n /* skips duplicates */\n ;\n });\n}\n\nmodule.exports = intersection;","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport { omit } from './utils';\nexport function getIndexId(context) {\n return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex;\n}\n/**\n * @returns {import('algoliasearch-helper').SearchResults} results\n */\n\nexport function getResults(searchResults, context) {\n if (searchResults.results) {\n if (searchResults.results.hits) {\n return searchResults.results;\n }\n\n var indexId = getIndexId(context);\n\n if (searchResults.results[indexId]) {\n return searchResults.results[indexId];\n }\n }\n\n return null;\n}\nexport function hasMultipleIndices(context) {\n return context && context.multiIndexContext;\n}\nexport function refineValue(searchState, nextRefinement, context, resetPage, namespace) {\n if (hasMultipleIndices(context)) {\n var indexId = getIndexId(context);\n return namespace ? refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) : refineMultiIndex(searchState, nextRefinement, indexId, resetPage);\n } else {\n // When we have a multi index page with shared widgets we should also\n // reset their page to 1 if the resetPage is provided. Otherwise the\n // indices will always be reset\n // see: https://github.com/algolia/react-instantsearch/issues/310\n // see: https://github.com/algolia/react-instantsearch/issues/637\n if (searchState.indices && resetPage) {\n Object.keys(searchState.indices).forEach(function (targetedIndex) {\n searchState = refineValue(searchState, {\n page: 1\n }, {\n multiIndexContext: {\n targetedIndex: targetedIndex\n }\n }, true, namespace);\n });\n }\n\n return namespace ? refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) : refineSingleIndex(searchState, nextRefinement, resetPage);\n }\n}\n\nfunction refineMultiIndex(searchState, nextRefinement, indexId, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread(_objectSpread({}, searchState.indices[indexId]), nextRefinement), page))) : _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, nextRefinement), page)));\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: state\n });\n}\n\nfunction refineSingleIndex(searchState, nextRefinement, resetPage) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread(_objectSpread(_objectSpread({}, searchState), nextRefinement), page);\n}\n\nfunction refineMultiIndexWithNamespace(searchState, nextRefinement, indexId, resetPage, namespace) {\n var _objectSpread4;\n\n var page = resetPage ? {\n page: 1\n } : undefined;\n var state = searchState.indices && searchState.indices[indexId] ? _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, searchState.indices[indexId]), {}, (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread(_objectSpread({}, searchState.indices[indexId][namespace]), nextRefinement)), _defineProperty(_objectSpread4, \"page\", 1), _objectSpread4)))) : _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page)));\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: state\n });\n}\n\nfunction refineSingleIndexWithNamespace(searchState, nextRefinement, resetPage, namespace) {\n var page = resetPage ? {\n page: 1\n } : undefined;\n return _objectSpread(_objectSpread({}, searchState), {}, _defineProperty({}, namespace, _objectSpread(_objectSpread({}, searchState[namespace]), nextRefinement)), page);\n}\n\nfunction getNamespaceAndAttributeName(id) {\n var parts = id.match(/^([^.]*)\\.(.*)/);\n var namespace = parts && parts[1];\n var attributeName = parts && parts[2];\n return {\n namespace: namespace,\n attributeName: attributeName\n };\n}\n\nfunction hasRefinements(_ref) {\n var multiIndex = _ref.multiIndex,\n indexId = _ref.indexId,\n namespace = _ref.namespace,\n attributeName = _ref.attributeName,\n id = _ref.id,\n searchState = _ref.searchState;\n\n if (multiIndex && namespace) {\n return searchState.indices && searchState.indices[indexId] && searchState.indices[indexId][namespace] && Object.hasOwnProperty.call(searchState.indices[indexId][namespace], attributeName);\n }\n\n if (multiIndex) {\n return searchState.indices && searchState.indices[indexId] && Object.hasOwnProperty.call(searchState.indices[indexId], id);\n }\n\n if (namespace) {\n return searchState[namespace] && Object.hasOwnProperty.call(searchState[namespace], attributeName);\n }\n\n return Object.hasOwnProperty.call(searchState, id);\n}\n\nfunction getRefinements(_ref2) {\n var multiIndex = _ref2.multiIndex,\n indexId = _ref2.indexId,\n namespace = _ref2.namespace,\n attributeName = _ref2.attributeName,\n id = _ref2.id,\n searchState = _ref2.searchState;\n\n if (multiIndex && namespace) {\n return searchState.indices[indexId][namespace][attributeName];\n }\n\n if (multiIndex) {\n return searchState.indices[indexId][id];\n }\n\n if (namespace) {\n return searchState[namespace][attributeName];\n }\n\n return searchState[id];\n}\n\nexport function getCurrentRefinementValue(props, searchState, context, id, defaultValue) {\n var indexId = getIndexId(context);\n\n var _getNamespaceAndAttri = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri.namespace,\n attributeName = _getNamespaceAndAttri.attributeName;\n\n var multiIndex = hasMultipleIndices(context);\n var args = {\n multiIndex: multiIndex,\n indexId: indexId,\n namespace: namespace,\n attributeName: attributeName,\n id: id,\n searchState: searchState\n };\n var hasRefinementsValue = hasRefinements(args);\n\n if (hasRefinementsValue) {\n return getRefinements(args);\n }\n\n if (props.defaultRefinement) {\n return props.defaultRefinement;\n }\n\n return defaultValue;\n}\nexport function cleanUpValue(searchState, context, id) {\n var indexId = getIndexId(context);\n\n var _getNamespaceAndAttri2 = getNamespaceAndAttributeName(id),\n namespace = _getNamespaceAndAttri2.namespace,\n attributeName = _getNamespaceAndAttri2.attributeName;\n\n if (hasMultipleIndices(context) && Boolean(searchState.indices)) {\n return cleanUpValueWithMultiIndex({\n attribute: attributeName,\n searchState: searchState,\n indexId: indexId,\n id: id,\n namespace: namespace\n });\n }\n\n return cleanUpValueWithSingleIndex({\n attribute: attributeName,\n searchState: searchState,\n id: id,\n namespace: namespace\n });\n}\n\nfunction cleanUpValueWithSingleIndex(_ref3) {\n var searchState = _ref3.searchState,\n id = _ref3.id,\n namespace = _ref3.namespace,\n attribute = _ref3.attribute;\n\n if (namespace) {\n return _objectSpread(_objectSpread({}, searchState), {}, _defineProperty({}, namespace, omit(searchState[namespace], [attribute])));\n }\n\n return omit(searchState, [id]);\n}\n\nfunction cleanUpValueWithMultiIndex(_ref4) {\n var searchState = _ref4.searchState,\n indexId = _ref4.indexId,\n id = _ref4.id,\n namespace = _ref4.namespace,\n attribute = _ref4.attribute;\n var indexSearchState = searchState.indices[indexId];\n\n if (namespace && indexSearchState) {\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, _objectSpread(_objectSpread({}, indexSearchState), {}, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute])))))\n });\n }\n\n if (indexSearchState) {\n return _objectSpread(_objectSpread({}, searchState), {}, {\n indices: _objectSpread(_objectSpread({}, searchState.indices), {}, _defineProperty({}, indexId, omit(indexSearchState, [id])))\n });\n }\n\n return searchState;\n}","import createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\nimport { addAbsolutePositions, addQueryID } from '../core/utils';\n/**\n * connectHits connector provides the logic to create connected\n * components that will render the results retrieved from\n * Algolia.\n *\n * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage\n * prop to a [Configure](guide/Search_parameters.html) widget.\n *\n * **Warning:** you will need to use the **objectID** property available on every hit as a key\n * when iterating over them. This will ensure you have the best possible UI experience\n * especially on slow networks.\n * @name connectHits\n * @kind connector\n * @providedPropType {array.} hits - the records that matched the search state\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const CustomHits = connectHits(({ hits }) => (\n *
\n * {hits.map(hit =>\n *

\n * \n *

\n * )}\n *
\n * ));\n *\n * const App = () => (\n * \n * \n * \n * );\n */\n\nexport default createConnector({\n displayName: 'AlgoliaHits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (!results) {\n return {\n hits: []\n };\n }\n\n var hitsWithPositions = addAbsolutePositions(results.hits, results.hitsPerPage, results.page);\n var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID);\n return {\n hits: hitsWithPositionsAndQueryID\n };\n },\n\n /**\n * Hits needs to be considered as a widget to trigger a search,\n * even if no other widgets are used.\n *\n * To be considered as a widget you need either:\n * - getSearchParameters\n * - getMetadata\n * - transitionState\n *\n * See: createConnector.tsx\n */\n getSearchParameters: function getSearchParameters(searchParameters) {\n return searchParameters;\n }\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _sectionIterator = _interopRequireDefault(require(\"section-iterator\"));\n\nvar _reactThemeable = _interopRequireDefault(require(\"react-themeable\"));\n\nvar _SectionTitle = _interopRequireDefault(require(\"./SectionTitle\"));\n\nvar _ItemList = _interopRequireDefault(require(\"./ItemList\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _createSuper(Derived) {\n return function () {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (_isNativeReflectConstruct()) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar emptyObject = {};\n\nvar defaultRenderInputComponent = function defaultRenderInputComponent(props) {\n return /*#__PURE__*/_react[\"default\"].createElement(\"input\", props);\n};\n\nvar defaultRenderItemsContainer = function defaultRenderItemsContainer(_ref) {\n var containerProps = _ref.containerProps,\n children = _ref.children;\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", containerProps, children);\n};\n\nvar defaultTheme = {\n container: 'react-autowhatever__container',\n containerOpen: 'react-autowhatever__container--open',\n input: 'react-autowhatever__input',\n inputOpen: 'react-autowhatever__input--open',\n inputFocused: 'react-autowhatever__input--focused',\n itemsContainer: 'react-autowhatever__items-container',\n itemsContainerOpen: 'react-autowhatever__items-container--open',\n itemsList: 'react-autowhatever__items-list',\n item: 'react-autowhatever__item',\n itemFirst: 'react-autowhatever__item--first',\n itemHighlighted: 'react-autowhatever__item--highlighted',\n sectionContainer: 'react-autowhatever__section-container',\n sectionContainerFirst: 'react-autowhatever__section-container--first',\n sectionTitle: 'react-autowhatever__section-title'\n};\n\nvar Autowhatever = /*#__PURE__*/function (_Component) {\n _inherits(Autowhatever, _Component);\n\n var _super = _createSuper(Autowhatever);\n\n function Autowhatever(props) {\n var _this;\n\n _classCallCheck(this, Autowhatever);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"storeInputReference\", function (input) {\n if (input !== null) {\n _this.input = input;\n }\n\n var userRef = _this.props.inputProps.ref;\n\n if (userRef) {\n if (typeof userRef === 'function') {\n userRef(input);\n } else if (_typeof(userRef) === 'object' && Object.prototype.hasOwnProperty.call(userRef, 'current')) {\n userRef.current = input;\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"storeItemsContainerReference\", function (itemsContainer) {\n if (itemsContainer !== null) {\n _this.itemsContainer = itemsContainer;\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onHighlightedItemChange\", function (highlightedItem) {\n _this.highlightedItem = highlightedItem;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"getItemId\", function (sectionIndex, itemIndex) {\n if (itemIndex === null) {\n return null;\n }\n\n var id = _this.props.id;\n var section = sectionIndex === null ? '' : \"section-\".concat(sectionIndex);\n return \"react-autowhatever-\".concat(id, \"-\").concat(section, \"-item-\").concat(itemIndex);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onFocus\", function (event) {\n var inputProps = _this.props.inputProps;\n\n _this.setState({\n isInputFocused: true\n });\n\n inputProps.onFocus && inputProps.onFocus(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBlur\", function (event) {\n var inputProps = _this.props.inputProps;\n\n _this.setState({\n isInputFocused: false\n });\n\n inputProps.onBlur && inputProps.onBlur(event);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onKeyDown\", function (event) {\n var _this$props = _this.props,\n inputProps = _this$props.inputProps,\n highlightedSectionIndex = _this$props.highlightedSectionIndex,\n highlightedItemIndex = _this$props.highlightedItemIndex;\n var keyCode = event.keyCode;\n\n switch (keyCode) {\n case 40: // ArrowDown\n\n case 38:\n {\n // ArrowUp\n var nextPrev = keyCode === 40 ? 'next' : 'prev';\n\n var _this$sectionIterator = _this.sectionIterator[nextPrev]([highlightedSectionIndex, highlightedItemIndex]),\n _this$sectionIterator2 = _slicedToArray(_this$sectionIterator, 2),\n newHighlightedSectionIndex = _this$sectionIterator2[0],\n newHighlightedItemIndex = _this$sectionIterator2[1];\n\n inputProps.onKeyDown(event, {\n newHighlightedSectionIndex: newHighlightedSectionIndex,\n newHighlightedItemIndex: newHighlightedItemIndex\n });\n break;\n }\n\n default:\n inputProps.onKeyDown(event, {\n highlightedSectionIndex: highlightedSectionIndex,\n highlightedItemIndex: highlightedItemIndex\n });\n }\n });\n\n _this.highlightedItem = null;\n _this.state = {\n isInputFocused: false\n };\n\n _this.setSectionsItems(props);\n\n _this.setSectionIterator(props);\n\n _this.setTheme(props);\n\n return _this;\n }\n\n _createClass(Autowhatever, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.ensureHighlightedItemIsVisible();\n } // eslint-disable-next-line camelcase, react/sort-comp\n\n }, {\n key: \"UNSAFE_componentWillReceiveProps\",\n value: function UNSAFE_componentWillReceiveProps(nextProps) {\n if (nextProps.items !== this.props.items) {\n this.setSectionsItems(nextProps);\n }\n\n if (nextProps.items !== this.props.items || nextProps.multiSection !== this.props.multiSection) {\n this.setSectionIterator(nextProps);\n }\n\n if (nextProps.theme !== this.props.theme) {\n this.setTheme(nextProps);\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n this.ensureHighlightedItemIsVisible();\n }\n }, {\n key: \"setSectionsItems\",\n value: function setSectionsItems(props) {\n if (props.multiSection) {\n this.sectionsItems = props.items.map(function (section) {\n return props.getSectionItems(section);\n });\n this.sectionsLengths = this.sectionsItems.map(function (items) {\n return items.length;\n });\n this.allSectionsAreEmpty = this.sectionsLengths.every(function (itemsCount) {\n return itemsCount === 0;\n });\n }\n }\n }, {\n key: \"setSectionIterator\",\n value: function setSectionIterator(props) {\n this.sectionIterator = (0, _sectionIterator[\"default\"])({\n multiSection: props.multiSection,\n data: props.multiSection ? this.sectionsLengths : props.items.length\n });\n }\n }, {\n key: \"setTheme\",\n value: function setTheme(props) {\n this.theme = (0, _reactThemeable[\"default\"])(props.theme);\n }\n }, {\n key: \"renderSections\",\n value: function renderSections() {\n var _this2 = this;\n\n if (this.allSectionsAreEmpty) {\n return null;\n }\n\n var theme = this.theme;\n var _this$props2 = this.props,\n id = _this$props2.id,\n items = _this$props2.items,\n renderItem = _this$props2.renderItem,\n renderItemData = _this$props2.renderItemData,\n renderSectionTitle = _this$props2.renderSectionTitle,\n highlightedSectionIndex = _this$props2.highlightedSectionIndex,\n highlightedItemIndex = _this$props2.highlightedItemIndex,\n itemProps = _this$props2.itemProps;\n return items.map(function (section, sectionIndex) {\n var keyPrefix = \"react-autowhatever-\".concat(id, \"-\");\n var sectionKeyPrefix = \"\".concat(keyPrefix, \"section-\").concat(sectionIndex, \"-\");\n var isFirstSection = sectionIndex === 0; // `key` is provided by theme()\n\n /* eslint-disable react/jsx-key */\n\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", theme(\"\".concat(sectionKeyPrefix, \"container\"), 'sectionContainer', isFirstSection && 'sectionContainerFirst'), /*#__PURE__*/_react[\"default\"].createElement(_SectionTitle[\"default\"], {\n section: section,\n renderSectionTitle: renderSectionTitle,\n theme: theme,\n sectionKeyPrefix: sectionKeyPrefix\n }), /*#__PURE__*/_react[\"default\"].createElement(_ItemList[\"default\"], {\n items: _this2.sectionsItems[sectionIndex],\n itemProps: itemProps,\n renderItem: renderItem,\n renderItemData: renderItemData,\n sectionIndex: sectionIndex,\n highlightedItemIndex: highlightedSectionIndex === sectionIndex ? highlightedItemIndex : null,\n onHighlightedItemChange: _this2.onHighlightedItemChange,\n getItemId: _this2.getItemId,\n theme: theme,\n keyPrefix: keyPrefix,\n ref: _this2.storeItemsListReference\n }));\n /* eslint-enable react/jsx-key */\n });\n }\n }, {\n key: \"renderItems\",\n value: function renderItems() {\n var items = this.props.items;\n\n if (items.length === 0) {\n return null;\n }\n\n var theme = this.theme;\n var _this$props3 = this.props,\n id = _this$props3.id,\n renderItem = _this$props3.renderItem,\n renderItemData = _this$props3.renderItemData,\n highlightedSectionIndex = _this$props3.highlightedSectionIndex,\n highlightedItemIndex = _this$props3.highlightedItemIndex,\n itemProps = _this$props3.itemProps;\n return /*#__PURE__*/_react[\"default\"].createElement(_ItemList[\"default\"], {\n items: items,\n itemProps: itemProps,\n renderItem: renderItem,\n renderItemData: renderItemData,\n highlightedItemIndex: highlightedSectionIndex === null ? highlightedItemIndex : null,\n onHighlightedItemChange: this.onHighlightedItemChange,\n getItemId: this.getItemId,\n theme: theme,\n keyPrefix: \"react-autowhatever-\".concat(id, \"-\")\n });\n }\n }, {\n key: \"ensureHighlightedItemIsVisible\",\n value: function ensureHighlightedItemIsVisible() {\n var highlightedItem = this.highlightedItem;\n\n if (!highlightedItem) {\n return;\n }\n\n var itemsContainer = this.itemsContainer;\n var itemOffsetRelativeToContainer = highlightedItem.offsetParent === itemsContainer ? highlightedItem.offsetTop : highlightedItem.offsetTop - itemsContainer.offsetTop;\n var scrollTop = itemsContainer.scrollTop; // Top of the visible area\n\n if (itemOffsetRelativeToContainer < scrollTop) {\n // Item is off the top of the visible area\n scrollTop = itemOffsetRelativeToContainer;\n } else if (itemOffsetRelativeToContainer + highlightedItem.offsetHeight > scrollTop + itemsContainer.offsetHeight) {\n // Item is off the bottom of the visible area\n scrollTop = itemOffsetRelativeToContainer + highlightedItem.offsetHeight - itemsContainer.offsetHeight;\n }\n\n if (scrollTop !== itemsContainer.scrollTop) {\n itemsContainer.scrollTop = scrollTop;\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var theme = this.theme;\n var _this$props4 = this.props,\n id = _this$props4.id,\n multiSection = _this$props4.multiSection,\n renderInputComponent = _this$props4.renderInputComponent,\n renderItemsContainer = _this$props4.renderItemsContainer,\n highlightedSectionIndex = _this$props4.highlightedSectionIndex,\n highlightedItemIndex = _this$props4.highlightedItemIndex;\n var isInputFocused = this.state.isInputFocused;\n var renderedItems = multiSection ? this.renderSections() : this.renderItems();\n var isOpen = renderedItems !== null;\n var ariaActivedescendant = this.getItemId(highlightedSectionIndex, highlightedItemIndex);\n var itemsContainerId = \"react-autowhatever-\".concat(id);\n\n var containerProps = _objectSpread({\n role: 'combobox',\n 'aria-haspopup': 'listbox',\n 'aria-owns': itemsContainerId,\n 'aria-expanded': isOpen\n }, theme(\"react-autowhatever-\".concat(id, \"-container\"), 'container', isOpen && 'containerOpen'), {}, this.props.containerProps);\n\n var inputComponent = renderInputComponent(_objectSpread({\n type: 'text',\n value: '',\n autoComplete: 'off',\n 'aria-autocomplete': 'list',\n 'aria-controls': itemsContainerId,\n 'aria-activedescendant': ariaActivedescendant\n }, theme(\"react-autowhatever-\".concat(id, \"-input\"), 'input', isOpen && 'inputOpen', isInputFocused && 'inputFocused'), {}, this.props.inputProps, {\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n onKeyDown: this.props.inputProps.onKeyDown && this.onKeyDown,\n ref: this.storeInputReference\n }));\n var itemsContainer = renderItemsContainer({\n containerProps: _objectSpread({\n id: itemsContainerId,\n role: 'listbox'\n }, theme(\"react-autowhatever-\".concat(id, \"-items-container\"), 'itemsContainer', isOpen && 'itemsContainerOpen'), {\n ref: this.storeItemsContainerReference\n }),\n children: renderedItems\n });\n return /*#__PURE__*/_react[\"default\"].createElement(\"div\", containerProps, inputComponent, itemsContainer);\n }\n }]);\n\n return Autowhatever;\n}(_react.Component);\n\nexports[\"default\"] = Autowhatever;\n\n_defineProperty(Autowhatever, \"propTypes\", {\n id: _propTypes[\"default\"].string,\n // Used in aria-* attributes. If multiple Autowhatever's are rendered on a page, they must have unique ids.\n multiSection: _propTypes[\"default\"].bool,\n // Indicates whether a multi section layout should be rendered.\n renderInputComponent: _propTypes[\"default\"].func,\n // When specified, it is used to render the input element.\n renderItemsContainer: _propTypes[\"default\"].func,\n // Renders the items container.\n items: _propTypes[\"default\"].array.isRequired,\n // Array of items or sections to render.\n renderItem: _propTypes[\"default\"].func,\n // This function renders a single item.\n renderItemData: _propTypes[\"default\"].object,\n // Arbitrary data that will be passed to renderItem()\n renderSectionTitle: _propTypes[\"default\"].func,\n // This function gets a section and renders its title.\n getSectionItems: _propTypes[\"default\"].func,\n // This function gets a section and returns its items, which will be passed into `renderItem` for rendering.\n containerProps: _propTypes[\"default\"].object,\n // Arbitrary container props\n inputProps: _propTypes[\"default\"].object,\n // Arbitrary input props\n itemProps: _propTypes[\"default\"].oneOfType([// Arbitrary item props\n _propTypes[\"default\"].object, _propTypes[\"default\"].func]),\n highlightedSectionIndex: _propTypes[\"default\"].number,\n // Section index of the highlighted item\n highlightedItemIndex: _propTypes[\"default\"].number,\n // Highlighted item index (within a section)\n theme: _propTypes[\"default\"].oneOfType([// Styles. See: https://github.com/markdalgleish/react-themeable\n _propTypes[\"default\"].object, _propTypes[\"default\"].array])\n});\n\n_defineProperty(Autowhatever, \"defaultProps\", {\n id: '1',\n multiSection: false,\n renderInputComponent: defaultRenderInputComponent,\n renderItemsContainer: defaultRenderItemsContainer,\n renderItem: function renderItem() {\n throw new Error('`renderItem` must be provided');\n },\n renderItemData: emptyObject,\n renderSectionTitle: function renderSectionTitle() {\n throw new Error('`renderSectionTitle` must be provided');\n },\n getSectionItems: function getSectionItems() {\n throw new Error('`getSectionItems` must be provided');\n },\n containerProps: emptyObject,\n inputProps: emptyObject,\n itemProps: emptyObject,\n highlightedSectionIndex: null,\n highlightedItemIndex: null,\n theme: defaultTheme\n});","'use strict';\n\nmodule.exports = function isValidUserToken(userToken) {\n if (userToken === null) {\n return false;\n }\n\n return /^[a-zA-Z0-9_-]{1,64}$/.test(userToken);\n};","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\", \"contextValue\", \"indexContextValue\"],\n _excluded2 = [\"children\", \"contextValue\", \"indexContextValue\"];\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nimport { omit } from '../core/utils';\nimport createConnector from '../core/createConnector';\nimport { refineValue, getIndexId, hasMultipleIndices } from '../core/indexUtils';\n\nfunction getId() {\n return 'configure';\n}\n\nexport default createConnector({\n displayName: 'AlgoliaConfigure',\n getProvidedProps: function getProvidedProps() {\n return {};\n },\n getSearchParameters: function getSearchParameters(searchParameters, props) {\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, _excluded);\n\n return searchParameters.setQueryParameters(items);\n },\n transitionState: function transitionState(props, prevSearchState, nextSearchState) {\n var id = getId();\n\n var children = props.children,\n contextValue = props.contextValue,\n indexContextValue = props.indexContextValue,\n items = _objectWithoutProperties(props, _excluded2);\n\n var propKeys = Object.keys(props);\n var nonPresentKeys = this._props ? Object.keys(this._props).filter(function (prop) {\n return propKeys.indexOf(prop) === -1;\n }) : [];\n this._props = props;\n\n var nextValue = _defineProperty({}, id, _objectSpread(_objectSpread({}, omit(nextSearchState[id], nonPresentKeys)), items));\n\n return refineValue(nextSearchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n var id = getId();\n var indexId = getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n var subState = hasMultipleIndices({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }) && searchState.indices ? searchState.indices[indexId] : searchState;\n var configureKeys = subState && subState[id] ? Object.keys(subState[id]) : [];\n var configureState = configureKeys.reduce(function (acc, item) {\n if (!props[item]) {\n acc[item] = subState[id][item];\n }\n\n return acc;\n }, {});\n\n var nextValue = _defineProperty({}, id, configureState);\n\n return refineValue(searchState, nextValue, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n }\n});","import connectConfigure from '../connectors/connectConfigure';\n/**\n * Configure is a widget that lets you provide raw search parameters\n * to the Algolia API.\n *\n * Any of the props added to this widget will be forwarded to Algolia. For more information\n * on the different parameters that can be set, have a look at the\n * [reference](https://www.algolia.com/doc/api-client/javascript/search#search-parameters).\n *\n * This widget can be used either with react-dom and react-native. It will not render anything\n * on screen, only configure some parameters.\n *\n * Read more in the [Search parameters](guide/Search_parameters.html) guide.\n * @name Configure\n * @kind widget\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Configure, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\nexport default connectConfigure(function Configure() {\n return null;\n});","'use strict';\n\nmodule.exports = function compact(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.filter(Boolean);\n};","import createConnector from '../core/createConnector';\nimport { HIGHLIGHT_TAGS, parseAlgoliaHit } from '../core/highlight';\n\nvar highlight = function highlight(_ref) {\n var attribute = _ref.attribute,\n hit = _ref.hit,\n highlightProperty = _ref.highlightProperty,\n _ref$preTag = _ref.preTag,\n preTag = _ref$preTag === void 0 ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag,\n _ref$postTag = _ref.postTag,\n postTag = _ref$postTag === void 0 ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag;\n return parseAlgoliaHit({\n attribute: attribute,\n highlightProperty: highlightProperty,\n hit: hit,\n preTag: preTag,\n postTag: postTag\n });\n};\n/**\n * connectHighlight connector provides the logic to create an highlighter\n * component that will retrieve, parse and render an highlighted attribute\n * from an Algolia hit.\n * @name connectHighlight\n * @kind connector\n * @category connector\n * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const CustomHighlight = connectHighlight(\n * ({ highlight, attribute, hit, highlightProperty }) => {\n * const highlights = highlight({\n * highlightProperty: '_highlightResult',\n * attribute,\n * hit\n * });\n *\n * return highlights.map(part => part.isHighlighted ? (\n * {part.value}\n * ) : (\n * {part.value}\n * ));\n * }\n * );\n *\n * const Hit = ({ hit }) => (\n *

\n * \n *

\n * );\n *\n * const App = () => (\n * \n * \n * \n * \n * );\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaHighlighter',\n propTypes: {},\n getProvidedProps: function getProvidedProps() {\n return {\n highlight: highlight\n };\n }\n});","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue } from '../core/indexUtils';\nimport { addQueryID, addAbsolutePositions } from '../core/utils';\n\nvar getId = function getId() {\n return 'query';\n};\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId();\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, '');\n\n if (currentRefinement) {\n return currentRefinement;\n }\n\n return '';\n}\n\nfunction getHits(searchResults) {\n if (searchResults.results) {\n if (searchResults.results.hits && Array.isArray(searchResults.results.hits)) {\n return addAbsolutePositions(addQueryID(searchResults.results.hits, searchResults.results.queryID), searchResults.results.hitsPerPage, searchResults.results.page);\n } else {\n return Object.keys(searchResults.results).reduce(function (hits, index) {\n return [].concat(_toConsumableArray(hits), [{\n index: index,\n hits: addAbsolutePositions(addQueryID(searchResults.results[index].hits, searchResults.results[index].queryID), searchResults.results[index].hitsPerPage, searchResults.results[index].page)\n }]);\n }, []);\n }\n } else {\n return [];\n }\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, getId());\n}\n/**\n * connectAutoComplete connector provides the logic to create connected\n * components that will render the results retrieved from\n * Algolia.\n *\n * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage\n * prop to a [Configure](guide/Search_parameters.html) widget.\n * @name connectAutoComplete\n * @kind connector\n * @propType {string} [defaultRefinement] - Provide a default value for the query\n * @providedPropType {array.} hits - the records that matched the search state\n * @providedPropType {function} refine - a function to change the query\n * @providedPropType {string} currentRefinement - the query to search for\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaAutoComplete',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n return {\n hits: getHits(searchResults),\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n })\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n\n /**\n * AutoComplete needs to be considered as a widget to trigger a search,\n * even if no other widgets are used.\n *\n * To be considered as a widget you need either:\n * - getSearchParameters\n * - getMetadata\n * - transitionState\n *\n * See: createConnector.tsx\n */\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQuery(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }));\n }\n});","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","'use strict';\n\nfunction objectHasKeys(obj) {\n return obj && Object.keys(obj).length > 0;\n}\n\nmodule.exports = objectHasKeys;","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","'use strict'; // NOTE: this behaves like lodash/defaults, but doesn't mutate the target\n// it also preserve keys order\n\nmodule.exports = function defaultsPure() {\n var sources = Array.prototype.slice.call(arguments);\n return sources.reduceRight(function (acc, source) {\n Object.keys(Object(source)).forEach(function (key) {\n if (source[key] === undefined) {\n return;\n }\n\n if (acc[key] !== undefined) {\n // remove if already added, so that we can add it in correct order\n delete acc[key];\n }\n\n acc[key] = source[key];\n });\n return acc;\n }, {});\n};","'use strict';\n\nmodule.exports = generateTrees;\n\nvar orderBy = require('../functions/orderBy');\n\nvar find = require('../functions/find');\n\nvar prepareHierarchicalFacetSortBy = require('../functions/formatSort');\n\nfunction generateTrees(state) {\n return function generate(hierarchicalFacetResult, hierarchicalFacetIndex) {\n var hierarchicalFacet = state.hierarchicalFacets[hierarchicalFacetIndex];\n var hierarchicalFacetRefinement = state.hierarchicalFacetsRefinements[hierarchicalFacet.name] && state.hierarchicalFacetsRefinements[hierarchicalFacet.name][0] || '';\n\n var hierarchicalSeparator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var hierarchicalRootPath = state._getHierarchicalRootPath(hierarchicalFacet);\n\n var hierarchicalShowParentLevel = state._getHierarchicalShowParentLevel(hierarchicalFacet);\n\n var sortBy = prepareHierarchicalFacetSortBy(state._getHierarchicalFacetSortBy(hierarchicalFacet));\n var rootExhaustive = hierarchicalFacetResult.every(function (facetResult) {\n return facetResult.exhaustive;\n });\n var generateTreeFn = generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, hierarchicalFacetRefinement);\n var results = hierarchicalFacetResult;\n\n if (hierarchicalRootPath) {\n results = hierarchicalFacetResult.slice(hierarchicalRootPath.split(hierarchicalSeparator).length);\n }\n\n return results.reduce(generateTreeFn, {\n name: state.hierarchicalFacets[hierarchicalFacetIndex].name,\n count: null,\n // root level, no count\n isRefined: true,\n // root level, always refined\n path: null,\n // root level, no path\n exhaustive: rootExhaustive,\n data: null\n });\n };\n}\n\nfunction generateHierarchicalTree(sortBy, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel, currentRefinement) {\n return function generateTree(hierarchicalTree, hierarchicalFacetResult, currentHierarchicalLevel) {\n var parent = hierarchicalTree;\n\n if (currentHierarchicalLevel > 0) {\n var level = 0;\n parent = hierarchicalTree;\n\n while (level < currentHierarchicalLevel) {\n /**\n * @type {object[]]} hierarchical data\n */\n var data = parent && Array.isArray(parent.data) ? parent.data : [];\n parent = find(data, function (subtree) {\n return subtree.isRefined;\n });\n level++;\n }\n } // we found a refined parent, let's add current level data under it\n\n\n if (parent) {\n // filter values in case an object has multiple categories:\n // {\n // categories: {\n // level0: ['beers', 'bières'],\n // level1: ['beers > IPA', 'bières > Belges']\n // }\n // }\n //\n // If parent refinement is `beers`, then we do not want to have `bières > Belges`\n // showing up\n var picked = Object.keys(hierarchicalFacetResult.data).map(function (facetValue) {\n return [facetValue, hierarchicalFacetResult.data[facetValue]];\n }).filter(function (tuple) {\n var facetValue = tuple[0];\n return onlyMatchingTree(facetValue, parent.path || hierarchicalRootPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel);\n });\n parent.data = orderBy(picked.map(function (tuple) {\n var facetValue = tuple[0];\n var facetCount = tuple[1];\n return format(facetCount, facetValue, hierarchicalSeparator, currentRefinement, hierarchicalFacetResult.exhaustive);\n }), sortBy[0], sortBy[1]);\n }\n\n return hierarchicalTree;\n };\n}\n\nfunction onlyMatchingTree(facetValue, parentPath, currentRefinement, hierarchicalSeparator, hierarchicalRootPath, hierarchicalShowParentLevel) {\n // we want the facetValue is a child of hierarchicalRootPath\n if (hierarchicalRootPath && (facetValue.indexOf(hierarchicalRootPath) !== 0 || hierarchicalRootPath === facetValue)) {\n return false;\n } // we always want root levels (only when there is no prefix path)\n\n\n return !hierarchicalRootPath && facetValue.indexOf(hierarchicalSeparator) === -1 || // if there is a rootPath, being root level mean 1 level under rootPath\n hierarchicalRootPath && facetValue.split(hierarchicalSeparator).length - hierarchicalRootPath.split(hierarchicalSeparator).length === 1 || // if current refinement is a root level and current facetValue is a root level,\n // keep the facetValue\n facetValue.indexOf(hierarchicalSeparator) === -1 && currentRefinement.indexOf(hierarchicalSeparator) === -1 || // currentRefinement is a child of the facet value\n currentRefinement.indexOf(facetValue) === 0 || // facetValue is a child of the current parent, add it\n facetValue.indexOf(parentPath + hierarchicalSeparator) === 0 && (hierarchicalShowParentLevel || facetValue.indexOf(currentRefinement) === 0);\n}\n\nfunction format(facetCount, facetValue, hierarchicalSeparator, currentRefinement, exhaustive) {\n var parts = facetValue.split(hierarchicalSeparator);\n return {\n name: parts[parts.length - 1].trim(),\n path: facetValue,\n count: facetCount,\n isRefined: currentRefinement === facetValue || currentRefinement.indexOf(facetValue + hierarchicalSeparator) === 0,\n exhaustive: exhaustive,\n data: null\n };\n}","'use strict';\n\nfunction valToNumber(v) {\n if (typeof v === 'number') {\n return v;\n } else if (typeof v === 'string') {\n return parseFloat(v);\n } else if (Array.isArray(v)) {\n return v.map(valToNumber);\n }\n\n throw new Error('The value should be a number, a parsable string or an array of those.');\n}\n\nmodule.exports = valToNumber;","'use strict'; // @MAJOR can be replaced by native Array#findIndex when we change support\n\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return -1;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return i;\n }\n }\n\n return -1;\n};","'use strict'; // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source === null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key;\n var i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import { createContext } from 'react';\nexport var instantSearchContext = /*#__PURE__*/createContext({\n onInternalStateUpdate: function onInternalStateUpdate() {\n return undefined;\n },\n createHrefForState: function createHrefForState() {\n return '#';\n },\n onSearchForFacetValues: function onSearchForFacetValues() {\n return undefined;\n },\n onSearchStateChange: function onSearchStateChange() {\n return undefined;\n },\n onSearchParameters: function onSearchParameters() {\n return undefined;\n },\n store: {},\n widgetsManager: {},\n mainTargetedIndex: ''\n});\nvar InstantSearchConsumer = instantSearchContext.Consumer,\n InstantSearchProvider = instantSearchContext.Provider;\nexport { InstantSearchConsumer, InstantSearchProvider };\n\nvar _createContext = /*#__PURE__*/createContext(undefined),\n IndexConsumer = _createContext.Consumer,\n IndexProvider = _createContext.Provider;\n\nexport { IndexConsumer, IndexProvider };","'use strict';\n\nrequire(\"core-js/modules/es.array.sort.js\");\n\nvar merge = require('../functions/merge');\n\nvar defaultsPure = require('../functions/defaultsPure');\n\nvar orderBy = require('../functions/orderBy');\n\nvar compact = require('../functions/compact');\n\nvar find = require('../functions/find');\n\nvar findIndex = require('../functions/findIndex');\n\nvar formatSort = require('../functions/formatSort');\n\nvar generateHierarchicalTree = require('./generate-hierarchical-tree');\n/**\n * @typedef SearchResults.Facet\n * @type {object}\n * @property {string} name name of the attribute in the record\n * @property {object} data the faceting data: value, number of entries\n * @property {object} stats undefined unless facet_stats is retrieved from algolia\n */\n\n/**\n * @typedef SearchResults.HierarchicalFacet\n * @type {object}\n * @property {string} name name of the current value given the hierarchical level, trimmed.\n * If root node, you get the facet name\n * @property {number} count number of objects matching this hierarchical value\n * @property {string} path the current hierarchical value full path\n * @property {boolean} isRefined `true` if the current value was refined, `false` otherwise\n * @property {HierarchicalFacet[]} data sub values for the current level\n */\n\n/**\n * @typedef SearchResults.FacetValue\n * @type {object}\n * @property {string} name the facet value itself\n * @property {number} count times this facet appears in the results\n * @property {boolean} isRefined is the facet currently selected\n * @property {boolean} isExcluded is the facet currently excluded (only for conjunctive facets)\n */\n\n/**\n * @typedef Refinement\n * @type {object}\n * @property {string} type the type of filter used:\n * `numeric`, `facet`, `exclude`, `disjunctive`, `hierarchical`\n * @property {string} attributeName name of the attribute used for filtering\n * @property {string} name the value of the filter\n * @property {number} numericValue the value as a number. Only for numeric filters.\n * @property {string} operator the operator used. Only for numeric filters.\n * @property {number} count the number of computed hits for this filter. Only on facets.\n * @property {boolean} exhaustive if the count is exhaustive\n */\n\n/**\n * @param {string[]} attributes\n */\n\n\nfunction getIndices(attributes) {\n var indices = {};\n attributes.forEach(function (val, idx) {\n indices[val] = idx;\n });\n return indices;\n}\n\nfunction assignFacetStats(dest, facetStats, key) {\n if (facetStats && facetStats[key]) {\n dest.stats = facetStats[key];\n }\n}\n/**\n * @typedef {Object} HierarchicalFacet\n * @property {string} name\n * @property {string[]} attributes\n */\n\n/**\n * @param {HierarchicalFacet[]} hierarchicalFacets\n * @param {string} hierarchicalAttributeName\n */\n\n\nfunction findMatchingHierarchicalFacetFromAttributeName(hierarchicalFacets, hierarchicalAttributeName) {\n return find(hierarchicalFacets, function facetKeyMatchesAttribute(hierarchicalFacet) {\n var facetNames = hierarchicalFacet.attributes || [];\n return facetNames.indexOf(hierarchicalAttributeName) > -1;\n });\n}\n/*eslint-disable */\n\n/**\n * Constructor for SearchResults\n * @class\n * @classdesc SearchResults contains the results of a query to Algolia using the\n * {@link AlgoliaSearchHelper}.\n * @param {SearchParameters} state state that led to the response\n * @param {array.} results the results from algolia client\n * @example SearchResults of the first query in\n * the instant search demo\n{\n \"hitsPerPage\": 10,\n \"processingTimeMS\": 2,\n \"facets\": [\n {\n \"name\": \"type\",\n \"data\": {\n \"HardGood\": 6627,\n \"BlackTie\": 550,\n \"Music\": 665,\n \"Software\": 131,\n \"Game\": 456,\n \"Movie\": 1571\n },\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"Free shipping\": 5507\n },\n \"name\": \"shipping\"\n }\n ],\n \"hits\": [\n {\n \"thumbnailImage\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_54x108_s.gif\",\n \"_highlightResult\": {\n \"shortDescription\": {\n \"matchLevel\": \"none\",\n \"value\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"matchedWords\": []\n },\n \"category\": {\n \"matchLevel\": \"none\",\n \"value\": \"Computer Security Software\",\n \"matchedWords\": []\n },\n \"manufacturer\": {\n \"matchedWords\": [],\n \"value\": \"Webroot\",\n \"matchLevel\": \"none\"\n },\n \"name\": {\n \"value\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"matchedWords\": [],\n \"matchLevel\": \"none\"\n }\n },\n \"image\": \"http://img.bbystatic.com/BestBuy_US/images/products/1688/1688832_105x210_sc.jpg\",\n \"shipping\": \"Free shipping\",\n \"bestSellingRank\": 4,\n \"shortDescription\": \"Safeguard your PC, Mac, Android and iOS devices with comprehensive Internet protection\",\n \"url\": \"http://www.bestbuy.com/site/webroot-secureanywhere-internet-security-3-devi…d=1219060687969&skuId=1688832&cmp=RMX&ky=2d3GfEmNIzjA0vkzveHdZEBgpPCyMnLTJ\",\n \"name\": \"Webroot SecureAnywhere Internet Security (3-Device) (1-Year Subscription) - Mac/Windows\",\n \"category\": \"Computer Security Software\",\n \"salePrice_range\": \"1 - 50\",\n \"objectID\": \"1688832\",\n \"type\": \"Software\",\n \"customerReviewCount\": 5980,\n \"salePrice\": 49.99,\n \"manufacturer\": \"Webroot\"\n },\n ....\n ],\n \"nbHits\": 10000,\n \"disjunctiveFacets\": [\n {\n \"exhaustive\": false,\n \"data\": {\n \"5\": 183,\n \"12\": 112,\n \"7\": 149,\n ...\n },\n \"name\": \"customerReviewCount\",\n \"stats\": {\n \"max\": 7461,\n \"avg\": 157.939,\n \"min\": 1\n }\n },\n {\n \"data\": {\n \"Printer Ink\": 142,\n \"Wireless Speakers\": 60,\n \"Point & Shoot Cameras\": 48,\n ...\n },\n \"name\": \"category\",\n \"exhaustive\": false\n },\n {\n \"exhaustive\": false,\n \"data\": {\n \"> 5000\": 2,\n \"1 - 50\": 6524,\n \"501 - 2000\": 566,\n \"201 - 500\": 1501,\n \"101 - 200\": 1360,\n \"2001 - 5000\": 47\n },\n \"name\": \"salePrice_range\"\n },\n {\n \"data\": {\n \"Dynex™\": 202,\n \"Insignia™\": 230,\n \"PNY\": 72,\n ...\n },\n \"name\": \"manufacturer\",\n \"exhaustive\": false\n }\n ],\n \"query\": \"\",\n \"nbPages\": 100,\n \"page\": 0,\n \"index\": \"bestbuy\"\n}\n **/\n\n/*eslint-enable */\n\n\nfunction SearchResults(state, results) {\n var mainSubResponse = results[0];\n this._rawResults = results;\n var self = this; // https://www.algolia.com/doc/api-reference/api-methods/search/#response\n\n Object.keys(mainSubResponse).forEach(function (key) {\n self[key] = mainSubResponse[key];\n });\n /**\n * query used to generate the results\n * @name query\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * The query as parsed by the engine given all the rules.\n * @name parsedQuery\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * all the records that match the search parameters. Each record is\n * augmented with a new attribute `_highlightResult`\n * which is an object keyed by attribute and with the following properties:\n * - `value` : the value of the facet highlighted (html)\n * - `matchLevel`: full, partial or none depending on how the query terms match\n * @name hits\n * @member {object[]}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * index where the results come from\n * @name index\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * number of hits per page requested\n * @name hitsPerPage\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * total number of hits of this query on the index\n * @name nbHits\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * total number of pages with respect to the number of hits per page and the total number of hits\n * @name nbPages\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * current page\n * @name page\n * @member {number}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * The position if the position was guessed by IP.\n * @name aroundLatLng\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"48.8637,2.3615\",\n */\n\n /**\n * The radius computed by Algolia.\n * @name automaticRadius\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"126792922\",\n */\n\n /**\n * String identifying the server used to serve this request.\n *\n * getRankingInfo needs to be set to `true` for this to be returned\n *\n * @name serverUsed\n * @member {string}\n * @memberof SearchResults\n * @instance\n * @example \"c7-use-2.algolia.net\",\n */\n\n /**\n * Boolean that indicates if the computation of the counts did time out.\n * @deprecated\n * @name timeoutCounts\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * Boolean that indicates if the computation of the hits did time out.\n * @deprecated\n * @name timeoutHits\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * True if the counts of the facets is exhaustive\n * @name exhaustiveFacetsCount\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * True if the number of hits is exhaustive\n * @name exhaustiveNbHits\n * @member {boolean}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/).\n * @name userData\n * @member {object[]}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * queryID is the unique identifier of the query used to generate the current search results.\n * This value is only available if the `clickAnalytics` search parameter is set to `true`.\n * @name queryID\n * @member {string}\n * @memberof SearchResults\n * @instance\n */\n\n /**\n * sum of the processing time of all the queries\n * @member {number}\n */\n\n this.processingTimeMS = results.reduce(function (sum, result) {\n return result.processingTimeMS === undefined ? sum : sum + result.processingTimeMS;\n }, 0);\n /**\n * disjunctive facets results\n * @member {SearchResults.Facet[]}\n */\n\n this.disjunctiveFacets = [];\n /**\n * disjunctive facets results\n * @member {SearchResults.HierarchicalFacet[]}\n */\n\n this.hierarchicalFacets = state.hierarchicalFacets.map(function initFutureTree() {\n return [];\n });\n /**\n * other facets results\n * @member {SearchResults.Facet[]}\n */\n\n this.facets = [];\n var disjunctiveFacets = state.getRefinedDisjunctiveFacets();\n var facetsIndices = getIndices(state.facets);\n var disjunctiveFacetsIndices = getIndices(state.disjunctiveFacets);\n var nextDisjunctiveResult = 1; // Since we send request only for disjunctive facets that have been refined,\n // we get the facets information from the first, general, response.\n\n var mainFacets = mainSubResponse.facets || {};\n Object.keys(mainFacets).forEach(function (facetKey) {\n var facetValueObject = mainFacets[facetKey];\n var hierarchicalFacet = findMatchingHierarchicalFacetFromAttributeName(state.hierarchicalFacets, facetKey);\n\n if (hierarchicalFacet) {\n // Place the hierarchicalFacet data at the correct index depending on\n // the attributes order that was defined at the helper initialization\n var facetIndex = hierarchicalFacet.attributes.indexOf(facetKey);\n var idxAttributeName = findIndex(state.hierarchicalFacets, function (f) {\n return f.name === hierarchicalFacet.name;\n });\n self.hierarchicalFacets[idxAttributeName][facetIndex] = {\n attribute: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n } else {\n var isFacetDisjunctive = state.disjunctiveFacets.indexOf(facetKey) !== -1;\n var isFacetConjunctive = state.facets.indexOf(facetKey) !== -1;\n var position;\n\n if (isFacetDisjunctive) {\n position = disjunctiveFacetsIndices[facetKey];\n self.disjunctiveFacets[position] = {\n name: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n assignFacetStats(self.disjunctiveFacets[position], mainSubResponse.facets_stats, facetKey);\n }\n\n if (isFacetConjunctive) {\n position = facetsIndices[facetKey];\n self.facets[position] = {\n name: facetKey,\n data: facetValueObject,\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n assignFacetStats(self.facets[position], mainSubResponse.facets_stats, facetKey);\n }\n }\n }); // Make sure we do not keep holes within the hierarchical facets\n\n this.hierarchicalFacets = compact(this.hierarchicalFacets); // aggregate the refined disjunctive facets\n\n disjunctiveFacets.forEach(function (disjunctiveFacet) {\n var result = results[nextDisjunctiveResult];\n var facets = result && result.facets ? result.facets : {};\n var hierarchicalFacet = state.getHierarchicalFacetByName(disjunctiveFacet); // There should be only item in facets.\n\n Object.keys(facets).forEach(function (dfacet) {\n var facetResults = facets[dfacet];\n var position;\n\n if (hierarchicalFacet) {\n position = findIndex(state.hierarchicalFacets, function (f) {\n return f.name === hierarchicalFacet.name;\n });\n var attributeIndex = findIndex(self.hierarchicalFacets[position], function (f) {\n return f.attribute === dfacet;\n }); // previous refinements and no results so not able to find it\n\n if (attributeIndex === -1) {\n return;\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = merge({}, self.hierarchicalFacets[position][attributeIndex].data, facetResults);\n } else {\n position = disjunctiveFacetsIndices[dfacet];\n var dataFromMainRequest = mainSubResponse.facets && mainSubResponse.facets[dfacet] || {};\n self.disjunctiveFacets[position] = {\n name: dfacet,\n data: defaultsPure({}, facetResults, dataFromMainRequest),\n exhaustive: result.exhaustiveFacetsCount\n };\n assignFacetStats(self.disjunctiveFacets[position], result.facets_stats, dfacet);\n\n if (state.disjunctiveFacetsRefinements[dfacet]) {\n state.disjunctiveFacetsRefinements[dfacet].forEach(function (refinementValue) {\n // add the disjunctive refinements if it is no more retrieved\n if (!self.disjunctiveFacets[position].data[refinementValue] && state.disjunctiveFacetsRefinements[dfacet].indexOf(refinementValue) > -1) {\n self.disjunctiveFacets[position].data[refinementValue] = 0;\n }\n });\n }\n }\n });\n nextDisjunctiveResult++;\n }); // if we have some root level values for hierarchical facets, merge them\n\n state.getRefinedHierarchicalFacets().forEach(function (refinedFacet) {\n var hierarchicalFacet = state.getHierarchicalFacetByName(refinedFacet);\n\n var separator = state._getHierarchicalFacetSeparator(hierarchicalFacet);\n\n var currentRefinement = state.getHierarchicalRefinement(refinedFacet); // if we are already at a root refinement (or no refinement at all), there is no\n // root level values request\n\n if (currentRefinement.length === 0 || currentRefinement[0].split(separator).length < 2) {\n return;\n }\n\n var result = results[nextDisjunctiveResult];\n var facets = result && result.facets ? result.facets : {};\n Object.keys(facets).forEach(function (dfacet) {\n var facetResults = facets[dfacet];\n var position = findIndex(state.hierarchicalFacets, function (f) {\n return f.name === hierarchicalFacet.name;\n });\n var attributeIndex = findIndex(self.hierarchicalFacets[position], function (f) {\n return f.attribute === dfacet;\n }); // previous refinements and no results so not able to find it\n\n if (attributeIndex === -1) {\n return;\n } // when we always get root levels, if the hits refinement is `beers > IPA` (count: 5),\n // then the disjunctive values will be `beers` (count: 100),\n // but we do not want to display\n // | beers (100)\n // > IPA (5)\n // We want\n // | beers (5)\n // > IPA (5)\n\n\n var defaultData = {};\n\n if (currentRefinement.length > 0) {\n var root = currentRefinement[0].split(separator)[0];\n defaultData[root] = self.hierarchicalFacets[position][attributeIndex].data[root];\n }\n\n self.hierarchicalFacets[position][attributeIndex].data = defaultsPure(defaultData, facetResults, self.hierarchicalFacets[position][attributeIndex].data);\n });\n nextDisjunctiveResult++;\n }); // add the excludes\n\n Object.keys(state.facetsExcludes).forEach(function (facetName) {\n var excludes = state.facetsExcludes[facetName];\n var position = facetsIndices[facetName];\n self.facets[position] = {\n name: facetName,\n data: mainSubResponse.facets[facetName],\n exhaustive: mainSubResponse.exhaustiveFacetsCount\n };\n excludes.forEach(function (facetValue) {\n self.facets[position] = self.facets[position] || {\n name: facetName\n };\n self.facets[position].data = self.facets[position].data || {};\n self.facets[position].data[facetValue] = 0;\n });\n });\n /**\n * @type {Array}\n */\n\n this.hierarchicalFacets = this.hierarchicalFacets.map(generateHierarchicalTree(state));\n /**\n * @type {Array}\n */\n\n this.facets = compact(this.facets);\n /**\n * @type {Array}\n */\n\n this.disjunctiveFacets = compact(this.disjunctiveFacets);\n this._state = state;\n}\n/**\n * Get a facet object with its name\n * @deprecated\n * @param {string} name name of the faceted attribute\n * @return {SearchResults.Facet} the facet object\n */\n\n\nSearchResults.prototype.getFacetByName = function (name) {\n function predicate(facet) {\n return facet.name === name;\n }\n\n return find(this.facets, predicate) || find(this.disjunctiveFacets, predicate) || find(this.hierarchicalFacets, predicate);\n};\n/**\n * Get the facet values of a specified attribute from a SearchResults object.\n * @private\n * @param {SearchResults} results the search results to search in\n * @param {string} attribute name of the faceted attribute to search for\n * @return {array|object} facet values. For the hierarchical facets it is an object.\n */\n\n\nfunction extractNormalizedFacetValues(results, attribute) {\n function predicate(facet) {\n return facet.name === attribute;\n }\n\n if (results._state.isConjunctiveFacet(attribute)) {\n var facet = find(results.facets, predicate);\n if (!facet) return [];\n return Object.keys(facet.data).map(function (name) {\n return {\n name: name,\n count: facet.data[name],\n isRefined: results._state.isFacetRefined(attribute, name),\n isExcluded: results._state.isExcludeRefined(attribute, name)\n };\n });\n } else if (results._state.isDisjunctiveFacet(attribute)) {\n var disjunctiveFacet = find(results.disjunctiveFacets, predicate);\n if (!disjunctiveFacet) return [];\n return Object.keys(disjunctiveFacet.data).map(function (name) {\n return {\n name: name,\n count: disjunctiveFacet.data[name],\n isRefined: results._state.isDisjunctiveFacetRefined(attribute, name)\n };\n });\n } else if (results._state.isHierarchicalFacet(attribute)) {\n return find(results.hierarchicalFacets, predicate);\n }\n}\n/**\n * Sort nodes of a hierarchical or disjunctive facet results\n * @private\n * @param {function} sortFn\n * @param {HierarchicalFacet|Array} node node upon which we want to apply the sort\n * @param {string[]} names attribute names\n * @param {number} [level=0] current index in the names array\n */\n\n\nfunction recSort(sortFn, node, names, level) {\n level = level || 0;\n\n if (Array.isArray(node)) {\n return sortFn(node, names[level]);\n }\n\n if (!node.data || node.data.length === 0) {\n return node;\n }\n\n var children = node.data.map(function (childNode) {\n return recSort(sortFn, childNode, names, level + 1);\n });\n var sortedChildren = sortFn(children, names[level]);\n var newNode = defaultsPure({\n data: sortedChildren\n }, node);\n return newNode;\n}\n\nSearchResults.DEFAULT_SORT = ['isRefined:desc', 'count:desc', 'name:asc'];\n\nfunction vanillaSortFn(order, data) {\n return data.sort(order);\n}\n/**\n * @typedef FacetOrdering\n * @type {Object}\n * @property {string[]} [order]\n * @property {'count' | 'alpha' | 'hidden'} [sortRemainingBy]\n */\n\n/**\n * Sorts facet arrays via their facet ordering\n * @param {Array} facetValues the values\n * @param {FacetOrdering} facetOrdering the ordering\n * @returns {Array}\n */\n\n\nfunction sortViaFacetOrdering(facetValues, facetOrdering) {\n var orderedFacets = [];\n var remainingFacets = [];\n var order = facetOrdering.order || [];\n /**\n * an object with the keys being the values in order, the values their index:\n * ['one', 'two'] -> { one: 0, two: 1 }\n */\n\n var reverseOrder = order.reduce(function (acc, name, i) {\n acc[name] = i;\n return acc;\n }, {});\n facetValues.forEach(function (item) {\n // hierarchical facets get sorted using their raw name\n var name = item.path || item.name;\n\n if (reverseOrder[name] !== undefined) {\n orderedFacets[reverseOrder[name]] = item;\n } else {\n remainingFacets.push(item);\n }\n });\n orderedFacets = orderedFacets.filter(function (facet) {\n return facet;\n });\n var sortRemainingBy = facetOrdering.sortRemainingBy;\n var ordering;\n\n if (sortRemainingBy === 'hidden') {\n return orderedFacets;\n } else if (sortRemainingBy === 'alpha') {\n ordering = [['path', 'name'], ['asc', 'asc']];\n } else {\n ordering = [['count'], ['desc']];\n }\n\n return orderedFacets.concat(orderBy(remainingFacets, ordering[0], ordering[1]));\n}\n/**\n * @param {SearchResults} results the search results class\n * @param {string} attribute the attribute to retrieve ordering of\n * @returns {FacetOrdering=}\n */\n\n\nfunction getFacetOrdering(results, attribute) {\n return results.renderingContent && results.renderingContent.facetOrdering && results.renderingContent.facetOrdering.values && results.renderingContent.facetOrdering.values[attribute];\n}\n/**\n * Get a the list of values for a given facet attribute. Those values are sorted\n * refinement first, descending count (bigger value on top), and name ascending\n * (alphabetical order). The sort formula can overridden using either string based\n * predicates or a function.\n *\n * This method will return all the values returned by the Algolia engine plus all\n * the values already refined. This means that it can happen that the\n * `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet)\n * might not be respected if you have facet values that are already refined.\n * @param {string} attribute attribute name\n * @param {object} opts configuration options.\n * @param {boolean} [opts.facetOrdering]\n * Force the use of facetOrdering from the result if a sortBy is present. If\n * sortBy isn't present, facetOrdering will be used automatically.\n * @param {Array. | function} opts.sortBy\n * When using strings, it consists of\n * the name of the [FacetValue](#SearchResults.FacetValue) or the\n * [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the\n * order (`asc` or `desc`). For example to order the value by count, the\n * argument would be `['count:asc']`.\n *\n * If only the attribute name is specified, the ordering defaults to the one\n * specified in the default value for this attribute.\n *\n * When not specified, the order is\n * ascending. This parameter can also be a function which takes two facet\n * values and should return a number, 0 if equal, 1 if the first argument is\n * bigger or -1 otherwise.\n *\n * The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`\n * @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of\n * the attribute requested (hierarchical, disjunctive or conjunctive)\n * @example\n * helper.on('result', function(event){\n * //get values ordered only by name ascending using the string predicate\n * event.results.getFacetValues('city', {sortBy: ['name:asc']});\n * //get values ordered only by count ascending using a function\n * event.results.getFacetValues('city', {\n * // this is equivalent to ['count:asc']\n * sortBy: function(a, b) {\n * if (a.count === b.count) return 0;\n * if (a.count > b.count) return 1;\n * if (b.count > a.count) return -1;\n * }\n * });\n * });\n */\n\n\nSearchResults.prototype.getFacetValues = function (attribute, opts) {\n var facetValues = extractNormalizedFacetValues(this, attribute);\n\n if (!facetValues) {\n return undefined;\n }\n\n var options = defaultsPure({}, opts, {\n sortBy: SearchResults.DEFAULT_SORT,\n // if no sortBy is given, attempt to sort based on facetOrdering\n // if it is given, we still allow to sort via facet ordering first\n facetOrdering: !(opts && opts.sortBy)\n });\n var results = this;\n var attributes;\n\n if (Array.isArray(facetValues)) {\n attributes = [attribute];\n } else {\n var config = results._state.getHierarchicalFacetByName(facetValues.name);\n\n attributes = config.attributes;\n }\n\n return recSort(function (data, facetName) {\n if (options.facetOrdering) {\n var facetOrdering = getFacetOrdering(results, facetName);\n\n if (Boolean(facetOrdering)) {\n return sortViaFacetOrdering(data, facetOrdering);\n }\n }\n\n if (Array.isArray(options.sortBy)) {\n var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT);\n return orderBy(data, order[0], order[1]);\n } else if (typeof options.sortBy === 'function') {\n return vanillaSortFn(options.sortBy, data);\n }\n\n throw new Error('options.sortBy is optional but if defined it must be ' + 'either an array of string (predicates) or a sorting function');\n }, facetValues, attributes);\n};\n/**\n * Returns the facet stats if attribute is defined and the facet contains some.\n * Otherwise returns undefined.\n * @param {string} attribute name of the faceted attribute\n * @return {object} The stats of the facet\n */\n\n\nSearchResults.prototype.getFacetStats = function (attribute) {\n if (this._state.isConjunctiveFacet(attribute)) {\n return getFacetStatsIfAvailable(this.facets, attribute);\n } else if (this._state.isDisjunctiveFacet(attribute)) {\n return getFacetStatsIfAvailable(this.disjunctiveFacets, attribute);\n }\n\n return undefined;\n};\n/**\n * @typedef {Object} FacetListItem\n * @property {string} name\n */\n\n/**\n * @param {FacetListItem[]} facetList (has more items, but enough for here)\n * @param {string} facetName\n */\n\n\nfunction getFacetStatsIfAvailable(facetList, facetName) {\n var data = find(facetList, function (facet) {\n return facet.name === facetName;\n });\n return data && data.stats;\n}\n/**\n * Returns all refinements for all filters + tags. It also provides\n * additional information: count and exhaustiveness for each filter.\n *\n * See the [refinement type](#Refinement) for an exhaustive view of the available\n * data.\n *\n * Note that for a numeric refinement, results are grouped per operator, this\n * means that it will return responses for operators which are empty.\n *\n * @return {Array.} all the refinements\n */\n\n\nSearchResults.prototype.getRefinements = function () {\n var state = this._state;\n var results = this;\n var res = [];\n Object.keys(state.facetsRefinements).forEach(function (attributeName) {\n state.facetsRefinements[attributeName].forEach(function (name) {\n res.push(getRefinement(state, 'facet', attributeName, name, results.facets));\n });\n });\n Object.keys(state.facetsExcludes).forEach(function (attributeName) {\n state.facetsExcludes[attributeName].forEach(function (name) {\n res.push(getRefinement(state, 'exclude', attributeName, name, results.facets));\n });\n });\n Object.keys(state.disjunctiveFacetsRefinements).forEach(function (attributeName) {\n state.disjunctiveFacetsRefinements[attributeName].forEach(function (name) {\n res.push(getRefinement(state, 'disjunctive', attributeName, name, results.disjunctiveFacets));\n });\n });\n Object.keys(state.hierarchicalFacetsRefinements).forEach(function (attributeName) {\n state.hierarchicalFacetsRefinements[attributeName].forEach(function (name) {\n res.push(getHierarchicalRefinement(state, attributeName, name, results.hierarchicalFacets));\n });\n });\n Object.keys(state.numericRefinements).forEach(function (attributeName) {\n var operators = state.numericRefinements[attributeName];\n Object.keys(operators).forEach(function (operator) {\n operators[operator].forEach(function (value) {\n res.push({\n type: 'numeric',\n attributeName: attributeName,\n name: value,\n numericValue: value,\n operator: operator\n });\n });\n });\n });\n state.tagRefinements.forEach(function (name) {\n res.push({\n type: 'tag',\n attributeName: '_tags',\n name: name\n });\n });\n return res;\n};\n/**\n * @typedef {Object} Facet\n * @property {string} name\n * @property {Object} data\n * @property {boolean} exhaustive\n */\n\n/**\n * @param {*} state\n * @param {*} type\n * @param {string} attributeName\n * @param {*} name\n * @param {Facet[]} resultsFacets\n */\n\n\nfunction getRefinement(state, type, attributeName, name, resultsFacets) {\n var facet = find(resultsFacets, function (f) {\n return f.name === attributeName;\n });\n var count = facet && facet.data && facet.data[name] ? facet.data[name] : 0;\n var exhaustive = facet && facet.exhaustive || false;\n return {\n type: type,\n attributeName: attributeName,\n name: name,\n count: count,\n exhaustive: exhaustive\n };\n}\n/**\n * @param {*} state\n * @param {string} attributeName\n * @param {*} name\n * @param {Facet[]} resultsFacets\n */\n\n\nfunction getHierarchicalRefinement(state, attributeName, name, resultsFacets) {\n var facetDeclaration = state.getHierarchicalFacetByName(attributeName);\n\n var separator = state._getHierarchicalFacetSeparator(facetDeclaration);\n\n var split = name.split(separator);\n var rootFacet = find(resultsFacets, function (facet) {\n return facet.name === attributeName;\n });\n var facet = split.reduce(function (intermediateFacet, part) {\n var newFacet = intermediateFacet && find(intermediateFacet.data, function (f) {\n return f.name === part;\n });\n return newFacet !== undefined ? newFacet : intermediateFacet;\n }, rootFacet);\n var count = facet && facet.count || 0;\n var exhaustive = facet && facet.exhaustive || false;\n var path = facet && facet.path || '';\n return {\n type: 'hierarchical',\n attributeName: attributeName,\n name: path,\n count: count,\n exhaustive: exhaustive\n };\n}\n\nmodule.exports = SearchResults;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","'use strict';\n\nfunction shallowEqualArrays(arrA, arrB) {\n if (arrA === arrB) {\n return true;\n }\n\n if (!arrA || !arrB) {\n return false;\n }\n\n var len = arrA.length;\n\n if (arrB.length !== len) {\n return false;\n }\n\n for (var i = 0; i < len; i++) {\n if (arrA[i] !== arrB[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqualArrays;","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _Item = _interopRequireDefault(require(\"./Item\"));\n\nvar _compareObjects = _interopRequireDefault(require(\"./compareObjects\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\n\nfunction _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n}\n\nfunction _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n \"default\": obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj[\"default\"] = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _createSuper(Derived) {\n return function () {\n var Super = _getPrototypeOf(Derived),\n result;\n\n if (_isNativeReflectConstruct()) {\n var NewTarget = _getPrototypeOf(this).constructor;\n\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return _possibleConstructorReturn(this, result);\n };\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar ItemsList = /*#__PURE__*/function (_Component) {\n _inherits(ItemsList, _Component);\n\n var _super = _createSuper(ItemsList);\n\n function ItemsList() {\n var _this;\n\n _classCallCheck(this, ItemsList);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"storeHighlightedItemReference\", function (highlightedItem) {\n _this.props.onHighlightedItemChange(highlightedItem === null ? null : highlightedItem.item);\n });\n\n return _this;\n }\n\n _createClass(ItemsList, [{\n key: \"shouldComponentUpdate\",\n value: function shouldComponentUpdate(nextProps) {\n return (0, _compareObjects[\"default\"])(nextProps, this.props, ['itemProps']);\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n items = _this$props.items,\n itemProps = _this$props.itemProps,\n renderItem = _this$props.renderItem,\n renderItemData = _this$props.renderItemData,\n sectionIndex = _this$props.sectionIndex,\n highlightedItemIndex = _this$props.highlightedItemIndex,\n getItemId = _this$props.getItemId,\n theme = _this$props.theme,\n keyPrefix = _this$props.keyPrefix;\n var sectionPrefix = sectionIndex === null ? keyPrefix : \"\".concat(keyPrefix, \"section-\").concat(sectionIndex, \"-\");\n var isItemPropsFunction = typeof itemProps === 'function';\n return /*#__PURE__*/_react[\"default\"].createElement(\"ul\", _extends({\n role: \"listbox\"\n }, theme(\"\".concat(sectionPrefix, \"items-list\"), 'itemsList')), items.map(function (item, itemIndex) {\n var isFirst = itemIndex === 0;\n var isHighlighted = itemIndex === highlightedItemIndex;\n var itemKey = \"\".concat(sectionPrefix, \"item-\").concat(itemIndex);\n var itemPropsObj = isItemPropsFunction ? itemProps({\n sectionIndex: sectionIndex,\n itemIndex: itemIndex\n }) : itemProps;\n\n var allItemProps = _objectSpread({\n id: getItemId(sectionIndex, itemIndex),\n 'aria-selected': isHighlighted\n }, theme(itemKey, 'item', isFirst && 'itemFirst', isHighlighted && 'itemHighlighted'), {}, itemPropsObj);\n\n if (isHighlighted) {\n allItemProps.ref = _this2.storeHighlightedItemReference;\n } // `key` is provided by theme()\n\n /* eslint-disable react/jsx-key */\n\n\n return /*#__PURE__*/_react[\"default\"].createElement(_Item[\"default\"], _extends({}, allItemProps, {\n sectionIndex: sectionIndex,\n isHighlighted: isHighlighted,\n itemIndex: itemIndex,\n item: item,\n renderItem: renderItem,\n renderItemData: renderItemData\n }));\n /* eslint-enable react/jsx-key */\n }));\n }\n }]);\n\n return ItemsList;\n}(_react.Component);\n\nexports[\"default\"] = ItemsList;\n\n_defineProperty(ItemsList, \"propTypes\", {\n items: _propTypes[\"default\"].array.isRequired,\n itemProps: _propTypes[\"default\"].oneOfType([_propTypes[\"default\"].object, _propTypes[\"default\"].func]),\n renderItem: _propTypes[\"default\"].func.isRequired,\n renderItemData: _propTypes[\"default\"].object.isRequired,\n sectionIndex: _propTypes[\"default\"].number,\n highlightedItemIndex: _propTypes[\"default\"].number,\n onHighlightedItemChange: _propTypes[\"default\"].func.isRequired,\n getItemId: _propTypes[\"default\"].func.isRequired,\n theme: _propTypes[\"default\"].func.isRequired,\n keyPrefix: _propTypes[\"default\"].string.isRequired\n});\n\n_defineProperty(ItemsList, \"defaultProps\", {\n sectionIndex: null\n});","'use strict';\n\nrequire(\"core-js/modules/es.array.sort.js\");\n\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined;\n var valIsNull = value === null;\n var othIsDefined = other !== undefined;\n var othIsNull = other === null;\n\n if (!othIsNull && value > other || valIsNull && othIsDefined || !valIsDefined) {\n return 1;\n }\n\n if (!valIsNull && value < other || othIsNull && valIsDefined || !othIsDefined) {\n return -1;\n }\n }\n\n return 0;\n}\n/**\n * @param {Array} collection object with keys in attributes\n * @param {Array} iteratees attributes\n * @param {Array} orders asc | desc\n */\n\n\nfunction orderBy(collection, iteratees, orders) {\n if (!Array.isArray(collection)) {\n return [];\n }\n\n if (!Array.isArray(orders)) {\n orders = [];\n }\n\n var result = collection.map(function (value, index) {\n return {\n criteria: iteratees.map(function (iteratee) {\n return value[iteratee];\n }),\n index: index,\n value: value\n };\n });\n result.sort(function comparer(object, other) {\n var index = -1;\n\n while (++index < object.criteria.length) {\n var res = compareAscending(object.criteria[index], other.criteria[index]);\n\n if (res) {\n if (index >= orders.length) {\n return res;\n }\n\n if (orders[index] === 'desc') {\n return -res;\n }\n\n return res;\n }\n } // This ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n\n\n return object.index - other.index;\n });\n return result.map(function (res) {\n return res.value;\n });\n}\n\nmodule.exports = orderBy;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = compareObjects;\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction compareObjects(objA, objB) {\n var keys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n\n if (objA === objB) {\n return false;\n }\n\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n\n if (aKeys.length !== bKeys.length) {\n return true;\n }\n\n var keysMap = {};\n var i, len;\n\n for (i = 0, len = keys.length; i < len; i++) {\n keysMap[keys[i]] = true;\n }\n\n for (i = 0, len = aKeys.length; i < len; i++) {\n var key = aKeys[i];\n var aValue = objA[key];\n var bValue = objB[key];\n\n if (aValue === bValue) {\n continue;\n }\n\n if (!keysMap[key] || aValue === null || bValue === null || _typeof(aValue) !== 'object' || _typeof(bValue) !== 'object') {\n return true;\n }\n\n var aValueKeys = Object.keys(aValue);\n var bValueKeys = Object.keys(bValue);\n\n if (aValueKeys.length !== bValueKeys.length) {\n return true;\n }\n\n for (var n = 0, length = aValueKeys.length; n < length; n++) {\n var aValueKey = aValueKeys[n];\n\n if (aValue[aValueKey] !== bValue[aValueKey]) {\n return true;\n }\n }\n }\n\n return false;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}"],"sourceRoot":""}