-
Notifications
You must be signed in to change notification settings - Fork 0
/
399-dd786114d3a01d52a0e9.js.map
1 lines (1 loc) · 519 KB
/
399-dd786114d3a01d52a0e9.js.map
1
{"version":3,"sources":["webpack://gatsby-gitbook-boilerplate/./node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/node_modules/events/events.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/DerivedHelper/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/SearchParameters/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/SearchResults/generate-hierarchical-tree.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/SearchResults/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/algoliasearch.helper.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/compact.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/defaultsPure.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/find.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/findIndex.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/formatSort.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/inherits.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/intersection.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/merge.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/omit.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/orderBy.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/functions/valToNumber.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/requestBuilder.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/utils/isValidUserToken.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch-helper/src/version.js","webpack://gatsby-gitbook-boilerplate/./node_modules/algoliasearch/dist/algoliasearch-lite.umd.js","webpack://gatsby-gitbook-boilerplate/./node_modules/classnames/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/shallowequal/index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/utils.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/context.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/createConnector.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/indexUtils.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/connectors/connectStateResults.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/createWidgetsManager.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/highlight.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/createInstantSearchManager.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/version.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/core/createStore.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/widgets/InstantSearch.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/widgets/Index.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/connectors/connectHits.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/core/utils.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/components/Hits.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/widgets/Hits.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/connectors/connectConfigure.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/widgets/Configure.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@emotion/stylis/dist/stylis.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/styled-components/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/styled-components/dist/styled-components.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@styled-icons/styled-icon/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@styled-icons/styled-icon/node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@styled-icons/styled-icon/index.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@styled-icons/fa-brands/Algolia/Algolia.esm.js","webpack://gatsby-gitbook-boilerplate/./src/components/search/styles.js","webpack://gatsby-gitbook-boilerplate/./node_modules/@styled-icons/fa-solid/Search/Search.esm.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/connectors/connectSearchBox.js","webpack://gatsby-gitbook-boilerplate/./src/components/search/input.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-core/dist/es/connectors/connectHighlight.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/components/Highlighter.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/components/Highlight.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/widgets/Highlight.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/components/Snippet.js","webpack://gatsby-gitbook-boilerplate/./node_modules/react-instantsearch-dom/dist/es/widgets/Snippet.js","webpack://gatsby-gitbook-boilerplate/./src/components/search/hitComps.js","webpack://gatsby-gitbook-boilerplate/./src/components/search/index.js"],"names":["objectWithoutPropertiesLoose","module","exports","source","excluded","key","i","target","Object","getOwnPropertySymbols","sourceSymbolKeys","length","indexOf","prototype","propertyIsEnumerable","call","__esModule","AlgoliaSearchHelper","SearchParameters","SearchResults","algoliasearchHelper","client","index","opts","version","EventEmitter","this","_events","_maxListeners","undefined","isFunction","arg","isObject","isUndefined","defaultMaxListeners","setMaxListeners","n","isNaN","TypeError","emit","type","er","handler","len","args","listeners","error","arguments","Error","err","context","Array","slice","apply","addListener","listener","m","newListener","push","warned","console","trace","on","once","fired","g","removeListener","list","position","splice","removeAllListeners","listenerCount","evlistener","emitter","events","DerivedHelper","mainHelper","fn","main","lastResults","inherits","detach","detachDerivedHelper","getModifiedState","parameters","defaultsPure","omit","objectHasKeys","lib","addRefinement","refinementList","attribute","value","isRefined","valueAsString","facetRefinement","concat","mod","removeRefinement","clearRefinement","v","f","toggleRefinement","refinementType","hasChanged","newRefinementList","keys","reduce","memo","values","facetList","filter","refinementValue","containsRefinements","refinementValueAsString","merge","intersection","find","valToNumber","isValidUserToken","RefinementList","isEqualNumericRefinement","a","b","isArray","every","el","newParameters","params","_parseNumbers","userToken","warn","facets","disjunctiveFacets","hierarchicalFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements","self","forEach","paramName","isKeyKnown","PARAMETERS","isValueDefined","partialState","numbers","k","parsedValue","parseFloat","insideBoundingBox","map","geoRect","operators","operator","parsedValues","vPrime","make","instance","facet","rootPath","currentRefinement","getHierarchicalRefinement","name","clearRefinements","toggleHierarchicalFacetRefinement","validate","currentState","tagFilters","numericFilters","constructor","patch","_clearNumericRefinements","setQueryParameters","clearTags","setIndex","setQuery","newQuery","query","setPage","newPage","page","setFacets","setDisjunctiveFacets","setHitsPerPage","hitsPerPage","setTypoTolerance","typoTolerance","addNumericRefinement","isNumericRefined","getConjunctiveRefinements","facetName","isConjunctiveFacet","getDisjunctiveRefinements","isDisjunctiveFacet","getExcludeRefinements","removeNumericRefinement","paramValue","op","val","getNumericRefinements","getNumericRefinement","newNumericRefinements","operatorList","outValues","addFacet","addDisjunctiveFacet","addHierarchicalFacet","hierarchicalFacet","isHierarchicalFacet","addFacetRefinement","addExcludeRefinement","addDisjunctiveFacetRefinement","addTagRefinement","tag","isTagRefined","modification","removeFacet","removeDisjunctiveFacet","removeHierarchicalFacet","removeFacetRefinement","removeExcludeRefinement","removeDisjunctiveFacetRefinement","removeTagRefinement","t","toggleFacetRefinement","toggleConjunctiveFacetRefinement","toggleDisjunctiveFacetRefinement","toggleExcludeFacetRefinement","separator","_getHierarchicalFacetSeparator","getHierarchicalFacetByName","lastIndexOf","addHierarchicalFacetRefinement","path","isHierarchicalFacetRefined","removeHierarchicalFacetRefinement","toggleTagRefinement","isFacetRefined","isExcludeRefined","isDisjunctiveFacetRefined","refinements","isOperatorDefined","array","searchedValue","isAttributeValueDefined","currentValue","getRefinedDisjunctiveFacets","disjunctiveNumericRefinedFacets","getRefinedHierarchicalFacets","getUnrefinedDisjunctiveFacets","refinedFacets","managedParameters","getQueryParams","queryParams","setQueryParameter","parameter","nextWithNumbers","previousPlainObject","acc","nextPlainObject","previous","isPreviousValueDefined","isNextValueDefined","resetPage","_getHierarchicalFacetSortBy","sortBy","_getHierarchicalRootPath","_getHierarchicalShowParentLevel","showParentLevel","hierarchicalFacetName","getHierarchicalFacetBreadcrumb","refinement","split","part","trim","toString","JSON","stringify","state","hierarchicalFacetResult","hierarchicalFacetIndex","hierarchicalFacetRefinement","hierarchicalSeparator","hierarchicalRootPath","hierarchicalShowParentLevel","prepareHierarchicalFacetSortBy","rootExhaustive","facetResult","exhaustive","generateTreeFn","hierarchicalTree","currentHierarchicalLevel","parent","level","data","subtree","picked","facetValue","tuple","parentPath","onlyMatchingTree","orderBy","facetCount","parts","count","format","generateHierarchicalTree","results","compact","findIndex","formatSort","getIndices","attributes","indices","idx","assignFacetStats","dest","facetStats","stats","mainSubResponse","_rawResults","processingTimeMS","sum","result","facetsIndices","disjunctiveFacetsIndices","nextDisjunctiveResult","mainFacets","facetKey","hierarchicalAttributeName","facetValueObject","facetIndex","idxAttributeName","exhaustiveFacetsCount","isFacetDisjunctive","isFacetConjunctive","facets_stats","disjunctiveFacet","dfacet","facetResults","attributeIndex","dataFromMainRequest","refinedFacet","defaultData","root","excludes","_state","recSort","sortFn","node","children","childNode","sortedChildren","getFacetStatsIfAvailable","getRefinement","attributeName","resultsFacets","getFacetByName","predicate","DEFAULT_SORT","getFacetValues","facetValues","isExcluded","extractNormalizedFacetValues","options","order","hierarchicalFacetValues","sort","vanillaSortFn","getFacetStats","getRefinements","res","facetDeclaration","rootFacet","intermediateFacet","newFacet","numericValue","requestBuilder","addAlgoliaAgent","setClient","_queryId","_lastQueryIdReceived","derivedHelpers","_currentNbQueries","setCurrentPage","_change","isPageReset","getCurrentPage","search","_search","onlyWithDerivedHelpers","searchOnlyWithDerivedHelpers","getQuery","_getHitsSearchParams","searchOnce","cb","tempState","queries","_getQueries","then","content","_originalResponse","e","catch","findAnswers","derivedHelper","Promise","resolve","derivedState","attributesForPrediction","nbHits","errorMessage","initIndex","queryLanguages","searchForFacetValues","maxFacetHits","userState","clientHasSFFV","isDisjunctive","algoliaQuery","getSearchForFacetQuery","indexName","facetHits","q","addDisjunctiveRefine","addRefine","addFacetExclusion","addExclude","addTag","removeDisjunctiveRefine","removeRefine","removeFacetExclusion","removeExclude","removeTag","toggleFacetExclusion","toggleExclude","toggleRefine","toggleTag","nextPage","previousPage","setState","newState","overrideStateWithoutTriggeringChangeEvent","hasRefinements","isDisjunctiveRefined","hasTag","hasTagRefinements","getIndex","getPage","getTags","r","states","mainQueries","queriesCount","helper","derivedQueries","derivedStateQueries","queryId","_dispatchAlgoliaResponse","bind","_dispatchAlgoliaError","s","specificResults","formattedResponse","containsRefinement","facetFilters","_hasDisjunctiveRefinements","disjunctiveRefinements","event","clearCache","newClient","getClient","derive","pos","hasPendingRequests","Boolean","sources","reduceRight","comparator","defaults","defaultInstructions","out","sortInstruction","matchingDefault","defaultInstruction","ctor","superCtor","create","enumerable","writable","configurable","arr1","arr2","isObjectOrArrayOrFunction","_merge","hasOwnProperty","sourceVal","targetVal","l","obj","sourceKeys","compareAscending","other","valIsDefined","valIsNull","othIsDefined","othIsNull","collection","iteratees","orders","criteria","iteratee","object","_getDisjunctiveFacetSearchParams","_getHitsHierarchicalFacetsAttributes","_getFacetFilters","_getNumericFilters","additionalParams","_getTagFilters","hierarchicalRootLevel","attributesToRetrieve","attributesToHighlight","attributesToSnippet","analytics","clickAnalytics","_getDisjunctiveHierarchicalFacetAttribute","vs","join","orFilters","attributeToRefine","attributesIndex","allAttributes","hierarchicalRefinement","newAttributes","rootLevel","parentLevel","stateForSearchForFacetValues","searchForFacetSearchParameters","facetQuery","test","defineProperty","getOwnPropertyDescriptor","o","getOwnPropertyDescriptors","defineProperties","Symbol","iterator","u","next","done","return","from","localStorage","window","parse","getItem","get","miss","all","set","setItem","delete","clear","removeItem","caches","shift","serializable","c","Math","floor","random","replace","encodeURIComponent","h","WithinQueryParameters","WithinHeaders","d","entries","timeout","headers","queryParameters","cacheable","Read","Write","Any","p","y","status","lastUpdate","Date","now","protocol","url","accept","O","P","getTimeout","statelessHosts","j","method","toLowerCase","userAgent","pop","message","transporterStackTrace","A","S","connectTimeout","timeouts","connect","responseTimeout","request","response","host","triesLeft","onSuccess","onRetry","isTimedOut","logger","info","x","hostsCache","onFail","requester","send","reverse","w","add","segment","T","charAt","substr","N","appId","authMode","apiKey","requestsCache","responsesCache","hosts","read","mappedRequestOptions","transporter","reject","write","methods","C","requests","J","F","E","I","R","D","W","H","XMLHttpRequest","open","setRequestHeader","setTimeout","abort","onreadystatechange","readyState","OPENED","clearTimeout","onerror","responseText","onload","debug","multipleQueries","multipleSearchForFacetValues","hasOwn","classNames","classes","argType","inner","default","objA","objB","compare","compareContext","ret","keysA","keysB","bHasOwnProperty","valueA","valueB","_objectWithoutProperties","_objectSpread","ownKeys","sym","_typeof","shallowEqual","resolved","removeEmptyKey","isPlainObject","_key","instantSearchContext","createContext","onInternalStateUpdate","createHrefForState","onSearchForFacetValues","onSearchStateChange","onSearchParameters","store","widgetsManager","mainTargetedIndex","InstantSearchConsumer","Consumer","InstantSearchProvider","Provider","_createContext","IndexConsumer","IndexProvider","connectorDesc","Composed","Connector","displayName","isWidget","getSearchParameters","getMetadata","transitionState","Component","_Component","props","_this","providedProps","getProvidedProps","_ref","_len","contextValue","refine","getState","widgets","_ref2","_len2","_key2","_ref3","_len3","_key3","ais","multiIndexContext","indexContextValue","_this2","unsubscribe","subscribe","isUnmounting","unregisterWidget","registerWidget","nextProps","nextState","shouldComponentUpdate","propsEqual","prevProps","update","cleanUp","_this$props$contextVa","resultsFacetValues","searching","searchingForFacetValues","isSearchStalled","metadata","searchResults","searchParameters","nextWidgetsState","prevWidgetsState","_this$props","refineProps","createURL","searchForFacetValuesProps","searchForItems","propTypes","defaultProps","createConnectorWithoutContext","getIndexId","hasMultipleIndices","targetedIndex","getResults","hits","indexId","refineValue","searchState","nextRefinement","namespace","_objectSpread4","refineMultiIndexWithNamespace","refineMultiIndex","refineSingleIndexWithNamespace","refineSingleIndex","getNamespaceAndAttributeName","id","match","getCurrentRefinementValue","defaultValue","_getNamespaceAndAttri","multiIndex","defaultRefinement","cleanUpValue","_getNamespaceAndAttri2","_ref4","indexSearchState","cleanUpValueWithMultiIndex","cleanUpValueWithSingleIndex","createConnector","allSearchResults","createWidgetsManager","onWidgetsUpdate","scheduled","scheduleUpdate","widget","getWidgets","HIGHLIGHT_TAGS","highlightPreTag","highlightPostTag","parseHighlightedAttribute","preTag","postTag","_ref$highlightedValue","highlightedValue","splitByPreTag","firstValue","elements","isHighlighted","splitByPostTag","parseAlgoliaHit","_ref2$preTag","_ref2$postTag","highlightProperty","hit","highlightObject","current","item","addAlgoliaAgents","searchClient","isMultiIndexContext","isTargetedIndexEqualIndex","isIndexWidget","isIndexWidgetEqualIndex","sortIndexWidgetsFirst","firstWidget","secondWidget","isFirstWidgetIndex","isSecondWidgetIndex","serializeQueryParameters","encode","createInstantSearchManager","_ref$initialState","initialState","resultsState","stalledSearchDelay","stalledSearchTimer","_store$getState","handleSearchSuccess","handleSearchError","skip","initialSearchParameters","_cacheHydrated","_useCache","baseMethod","methodArgs","requestsWithSerializedParams","rawResults","cache","hydrateSearchClientWithMultiIndexRequest","hydrateSearchClientWithSingleIndexRequest","hydrateSearchClient","createStore","hydrateMetadata","_internalIndexId","hydrateResultsState","sharedParameters","mainParameters","targetedIndexEqualMainIndex","subIndexEqualMainIndex","derivedIndices","targetedIndexNotEqualMainIndex","subIndexNotEqualMainIndex","derivedParameters","_getSearchParameters","isDerivedHelpersEmpty","nextIsSearchStalled","getWidgetsIds","meta","_ref5","_ref5$maxFacetHits","maxFacetHitsWithinRange","max","min","_objectSpread7","onExternalStateUpdate","nextSearchState","updateClient","updateIndex","newIndex","skipSearch","datum","items","nestedItem","isControlled","InstantSearch","instantSearchManager","onWidgetsInternalStateUpdate","prevState","nextIsControlled","previousSearchState","prevIsControlled","refresh","getKnownKeys","_searchState","widgetsCollector","_searchState2","Children","isRequired","getIndexContext","Index","indexContext","inferredIndexId","queryID","__queryID","addQueryID","__position","createClassNames","block","prefix","suitElements","element","baseClassName","cx","DefaultHitComponent","style","borderBottom","paddingBottom","marginBottom","wordBreak","objectID","connectHits","_ref$className","className","_ref$hitComponent","hitComponent","HitComponent","prevSearchState","propKeys","nonPresentKeys","_props","prop","subState","configureState","M","K","B","G","charCodeAt","substring","ca","X","z","da","ea","fa","L","Y","ha","Q","ia","Z","ja","ka","aa","ba","la","ma","na","oa","U","use","reactPropsRegex","assign","freeze","_","styledComponentId","process","REACT_APP_SC_ATTR","SC_ATTR","SC_DISABLE_SPEEDY","REACT_APP_SC_DISABLE_SPEEDY","groupSizes","Uint32Array","indexOfGroup","insertRules","insertRule","clearGroup","deleteRule","getGroup","getRule","Map","V","has","RegExp","registerName","innerHTML","parseInt","getTag","__webpack_nonce__","document","head","createElement","childNodes","nodeType","hasAttribute","nextSibling","setAttribute","insertBefore","$","appendChild","createTextNode","sheet","styleSheets","ownerNode","cssRules","cssText","nodes","removeChild","textContent","rules","isServer","useCSSOMInjection","gs","names","querySelectorAll","getAttribute","parentNode","registerId","reconstructWithOptions","allocateGSInstance","hasNameForId","Set","clearNames","clearRules","clearTag","String","fromCharCode","ee","abs","te","ne","re","oe","ie","staticRulesId","isStatic","componentId","baseHash","baseStyle","generateAndInjectStyles","hash","Ne","se","ae","ce","plugins","ue","de","he","pe","fe","me","ye","stylisPlugins","disableCSSOMInjection","disableVendorPrefixes","ve","inject","getName","ge","Se","we","Ee","be","_e","isReactComponent","Ae","Oe","theme","Re","De","je","Te","ke","xe","Ve","Be","Me","ze","Fe","Ye","attrs","parentComponentId","shouldForwardProp","componentStyle","foldedComponentIds","$as","as","ref","withComponent","_foldedDefaultProps","qe","withConfig","createStyles","removeStyles","renderStyles","_emitSheetCSS","getStyleTags","sealed","getStyleElement","dangerouslySetInnerHTML","__html","nonce","seal","collectStyles","interleaveWithNodeStream","enumerableOnly","symbols","filterSVGProps","StyledIconBase","iconAttrs","iconViewBox","iconVerticalAlign","size","title","otherProps","iconProps","viewBox","height","width","focusable","role","svgProps","Algolia","fill","PoweredBy","href","Search","getCurrentRefinement","_refine","_cleanUp","label","SearchIcon","Input","shortTrans","smallBorderRadius","Form","connectSearchBox","rest","onSubmit","preventDefault","placeholder","aria-label","onChange","highlight","_ref$preTag","_ref$postTag","Highlight","highlightedTagName","nonHighlightedTagName","TagName","Highlighter","tagName","parsedHighlightedValue","isLast","connectHighlight","PageHit","clickHandler","to","slug","onClick","HitsWrapper","show","darkGray","lightGray","lightBlue","darkBlue","gray","Root","Results","connectStateResults","algoliasearch","config","SearchComponent","collapse","hitsAsGrid","createRef","useState","focus","setFocus","detectClickOutside","contains","useEffect","addEventListener","removeEventListener","useClickOutside","displayResult","onFocus","asGrid","hitComp","hitComps","Configure"],"mappings":";gIAAA,IAAIA,EAA+B,EAAQ,MAqB3CC,EAAOC,QAnBP,SAAkCC,EAAQC,GACxC,GAAc,MAAVD,EAAgB,MAAO,GAC3B,IACIE,EAAKC,EADLC,EAASP,EAA6BG,EAAQC,GAGlD,GAAII,OAAOC,sBAAuB,CAChC,IAAIC,EAAmBF,OAAOC,sBAAsBN,GAEpD,IAAKG,EAAI,EAAGA,EAAII,EAAiBC,OAAQL,IACvCD,EAAMK,EAAiBJ,GACnBF,EAASQ,QAAQP,IAAQ,GACxBG,OAAOK,UAAUC,qBAAqBC,KAAKZ,EAAQE,KACxDE,EAAOF,GAAOF,EAAOE,IAIzB,OAAOE,GAITN,EAAOC,QAAP,QAA4BD,EAAOC,QAASD,EAAOC,QAAQc,YAAa,G,kCCpBxE,IAAIC,EAAsB,EAAQ,MAE9BC,EAAmB,EAAQ,MAE3BC,EAAgB,EAAQ,MAkC5B,SAASC,EAAoBC,EAAQC,EAAOC,GAC1C,OAAO,IAAIN,EAAoBI,EAAQC,EAAOC,GAShDH,EAAoBI,QAAU,EAAQ,MAOtCJ,EAAoBH,oBAAsBA,EAO1CG,EAAoBF,iBAAmBA,EAOvCE,EAAoBD,cAAgBA,EACpClB,EAAOC,QAAUkB,G,iBCpDjB,SAASK,IACPC,KAAKC,QAAUD,KA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,OACA,SAAC,GAAD,CAAMrP,aAAc0Q,EAASD,IAAS,kBAAMV,GAAS,aAI3D,SAACtD,GAAD,QAEF,SAACkE,GAAD,CAAW7/B,YAAa","file":"399-dd786114d3a01d52a0e9.js","sourcesContent":["var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose.js\");\n\nfunction _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}\n\nmodule.exports = _objectWithoutProperties;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","'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;","// 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.\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\n\nmodule.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\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\nEventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\nEventEmitter.prototype.setMaxListeners = function (n) {\n if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function (type) {\n var er, handler, len, args, i, listeners;\n if (!this._events) this._events = {}; // If there is no 'error' event listener then throw.\n\n if (type === 'error') {\n if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {\n er = arguments[1];\n\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n if (isUndefined(handler)) return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n\n case 2:\n handler.call(this, arguments[1]);\n break;\n\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n\n for (i = 0; i < len; i++) {\n listeners[i].apply(this, args);\n }\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function (type, listener) {\n var m;\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n if (!this._events) this._events = {}; // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n\n if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener);\n if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;else if (isObject(this._events[type])) // If we've already got an array, just append.\n this._events[type].push(listener);else // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener]; // Check for listener leak\n\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);\n\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function (type, listener) {\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n return this;\n}; // emits a 'removeListener' event iff the listener was removed\n\n\nEventEmitter.prototype.removeListener = function (type, listener) {\n var list, position, length, i;\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n if (!this._events || !this._events[type]) return this;\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener || isFunction(list.listener) && list.listener === listener) {\n delete this._events[type];\n if (this._events.removeListener) this.emit('removeListener', type, listener);\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener || list[i].listener && list[i].listener === listener) {\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener) this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function (type) {\n var key, listeners;\n if (!this._events) return this; // not listening for removeListener, no need to emit\n\n if (!this._events.removeListener) {\n if (arguments.length === 0) this._events = {};else if (this._events[type]) delete this._events[type];\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length) {\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n }\n\n delete this._events[type];\n return this;\n};\n\nEventEmitter.prototype.listeners = function (type) {\n var ret;\n if (!this._events || !this._events[type]) ret = [];else if (isFunction(this._events[type])) ret = [this._events[type]];else ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function (type) {\n if (this._events) {\n var evlistener = this._events[type];\n if (isFunction(evlistener)) return 1;else if (evlistener) return evlistener.length;\n }\n\n return 0;\n};\n\nEventEmitter.listenerCount = function (emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}","'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/**\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.<string, SearchParameters.refinementList.Refinements>} 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;","'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.<string, Array.<number|number[]>>} 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 <caption>SearchParameters of the first query in\n * <a href=\"http://demos.algolia.com/instant-search-demo/\">the instant search demo</a></caption>\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.<string, SearchParameters.FacetList>}\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.<string, SearchParameters.FacetList>}\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.<string, SearchParameters.FacetList>}\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.<string, SearchParameters.OperatorList>}\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.<string, SearchParameters.FacetList>}\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.<number|number[]>} 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.<string, OperatorList>}\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', 'facetsExcludes', 'disjunctiveFacetsRefinements', 'numericRefinements', 'tagRefinements', 'hierarchicalFacets', '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.<string>} 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\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\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.<object>} results the results from algolia client\n * @example <caption>SearchResults of the first query in\n * <a href=\"http://demos.algolia.com/instant-search-demo\">the instant search demo</a></caption>\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 facet results\n * @private\n * @param {HierarchicalFacet} node node to upon which we want to apply the sort\n */\n\n\nfunction recSort(sortFn, node) {\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);\n });\n var sortedChildren = sortFn(children);\n var newNode = merge({}, node, {\n data: sortedChildren\n });\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 * 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 {Array.<string> | 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 });\n\n if (Array.isArray(options.sortBy)) {\n var order = formatSort(options.sortBy, SearchResults.DEFAULT_SORT);\n\n if (Array.isArray(facetValues)) {\n return orderBy(facetValues, order[0], order[1]);\n } // If facetValues is not an array, it's an object thus a hierarchical facet object\n\n\n return recSort(function (hierarchicalFacetValues) {\n return orderBy(hierarchicalFacetValues, order[0], order[1]);\n }, facetValues);\n } else if (typeof options.sortBy === 'function') {\n if (Array.isArray(facetValues)) {\n return facetValues.sort(options.sortBy);\n } // If facetValues is not an array, it's an object thus a hierarchical facet object\n\n\n return recSort(function (data) {\n return vanillaSortFn(options.sortBy, data);\n }, facetValues);\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};\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.<Refinement>} 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;","'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.<FacetSearchResult>} 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.<FacetRefinement|NumericRefinement>} 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.<number|number[]>} 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.<string>} 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\nmodule.exports = function compact(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.filter(Boolean);\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'; // @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'; // @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';\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.<string[]>} 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\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\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;","'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)) {\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';\n\nfunction objectHasKeys(obj) {\n return obj && Object.keys(obj).length > 0;\n}\n\nmodule.exports = objectHasKeys;","'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;","'use strict';\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<object>} collection object with keys in attributes\n * @param {Array<string>} iteratees attributes\n * @param {Array<string>} 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\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';\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.<string, any>}\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,\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.<string>}\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;","'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};","'use strict';\n\nmodule.exports = '3.4.4';","/*! algoliasearch-lite.umd.js | 4.9.1 | © 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 j(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 [email protected].\",\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 w(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 j(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 j(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) {\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 k = function k(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 J = function J(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 C(e)(t.indexName, {\n methods: {\n searchForFacetValues: F\n }\n }).searchForFacetValues(u, i, r(r({}, o), s));\n }));\n };\n },\n E = function E(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 I = function I(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 F = function F(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 R = 1,\n D = 2,\n W = 3;\n\n function H(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 = W, {\n debug: function debug(e, t) {\n return R >= o && console.debug(e, t), Promise.resolve();\n },\n info: function info(e, t) {\n return D >= 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.9.1\", \"-\").concat(e)\n }), s()]\n }),\n userAgent: w(\"4.9.1\").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: k,\n searchForFacetValues: J,\n multipleQueries: k,\n multipleSearchForFacetValues: J,\n initIndex: function initIndex(e) {\n return function (t) {\n return C(e)(t, {\n methods: {\n search: I,\n searchForFacetValues: F,\n findAnswers: E\n }\n });\n };\n }\n }\n }));\n }\n\n return H.version = \"4.9.1\", H;\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})();","//\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\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 }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); // Test for A's keys different from B.\n\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || ret === void 0 && valueA !== valueB) {\n return false;\n }\n }\n\n return true;\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}","import defineProperty from \"./defineProperty.js\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? Object(arguments[i]) : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","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 _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\"; // From https://github.com/reactjs/react-redux/blob/master/src/utils/shallowEqual.js\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({}, 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({}, 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 { createContext } from 'react';\nexport var instantSearchContext = 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 = createContext(undefined),\n IndexConsumer = _createContext.Consumer,\n IndexProvider = _createContext.Provider;\n\nexport { IndexConsumer, IndexProvider };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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 function Connector(props) {\n var _this;\n\n _classCallCheck(this, Connector);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).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({}, 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, [\"contextValue\"]);\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 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 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 React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return React.createElement(IndexConsumer, null, function (indexContextValue) {\n return 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 _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport { omit } from './utils';\nexport function getIndexId(context) {\n return hasMultipleIndices(context) ? context.multiIndexContext.targetedIndex : context.ais.mainTargetedIndex;\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} // eslint-disable-next-line max-params\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({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], nextRefinement, page))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, nextRefinement, page)));\n return _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({}, searchState, nextRefinement, page);\n} // eslint-disable-next-line max-params\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({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, searchState.indices[indexId], (_objectSpread4 = {}, _defineProperty(_objectSpread4, namespace, _objectSpread({}, searchState.indices[indexId][namespace], nextRefinement)), _defineProperty(_objectSpread4, \"page\", 1), _objectSpread4)))) : _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread(_defineProperty({}, namespace, nextRefinement), page)));\n return _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({}, searchState, _defineProperty({}, namespace, _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({}, 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({}, searchState, {\n indices: _objectSpread({}, searchState.indices, _defineProperty({}, indexId, _objectSpread({}, indexSearchState, _defineProperty({}, namespace, omit(indexSearchState[namespace], [attribute])))))\n });\n }\n\n if (indexSearchState) {\n return _objectSpread({}, searchState, {\n indices: _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';\n/**\n * The `connectStateResults` connector provides a way to access the `searchState` and the `searchResults`\n * of InstantSearch.\n * For instance this connector allows you to create results/noResults or query/noQuery pages.\n * @name connectStateResults\n * @kind connector\n * @providedPropType {object} searchState - The search state of the instant search component. <br/><br/> See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html)\n * @providedPropType {object} searchResults - The search results. <br/><br/> In case of multiple indices: if used under `<Index>`, results will be those of the corresponding index otherwise it'll be those of the root index See: [Search results structure](https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults)\n * @providedPropType {object} allSearchResults - In case of multiple indices you can retrieve all the results\n * @providedPropType {string} error - If the search failed, the error will be logged here.\n * @providedPropType {boolean} searching - If there is a search in progress.\n * @providedPropType {boolean} isSearchStalled - Flag that indicates if React InstantSearch has detected that searches are stalled.\n * @providedPropType {boolean} searchingForFacetValues - If there is a search in a list in progress.\n * @providedPropType {object} props - component props.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectStateResults } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const Content = connectStateResults(({ searchState, searchResults }) => {\n * const hasResults = searchResults && searchResults.nbHits !== 0;\n *\n * return (\n * <div>\n * <div hidden={!hasResults}>\n * <Hits />\n * </div>\n * <div hidden={hasResults}>\n * <div>No results has been found for {searchState.query}</div>\n * </div>\n * </div>\n * );\n * });\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox />\n * <Content />\n * </InstantSearch>\n * );\n */\n\nexport default createConnector({\n displayName: 'AlgoliaStateResults',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n searchState: searchState,\n searchResults: results,\n allSearchResults: searchResults.results,\n searching: searchResults.searching,\n isSearchStalled: searchResults.isSearchStalled,\n error: searchResults.error,\n searchingForFacetValues: searchResults.searchingForFacetValues,\n props: props\n };\n }\n});","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}","import { getPropertyByPath } from './utils';\nexport var HIGHLIGHT_TAGS = {\n highlightPreTag: \"<ais-highlight-0000000000>\",\n highlightPostTag: \"</ais-highlight-0000000000>\"\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 ? '<em>' : _ref2$preTag,\n _ref2$postTag = _ref2.postTag,\n postTag = _ref2$postTag === void 0 ? '</em>' : _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}","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\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({}, 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({}, 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, [\"resultsFacetValues\"]);\n\n store.setState(_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, [\"resultsFacetValues\"]);\n\n store.setState(_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, [\"resultsFacetValues\"]);\n\n store.setState(_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({}, 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({}, 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({}, 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({}, 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({}, 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({}, 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({}, store.getState(), {\n searchingForFacetValues: true\n }));\n helper.searchForFacetValues(facetName, query, maxFacetHitsWithinRange).then(function (content) {\n var _objectSpread7;\n\n store.setState(_objectSpread({}, store.getState(), {\n error: null,\n searchingForFacetValues: false,\n resultsFacetValues: _objectSpread({}, store.getState().resultsFacetValues, (_objectSpread7 = {}, _defineProperty(_objectSpread7, facetName, content.facetHits), _defineProperty(_objectSpread7, \"query\", query), _objectSpread7))\n }));\n }, function (error) {\n store.setState(_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({\n value: function value() {}\n }, datum, {\n items: datum.items && datum.items.map(function (item) {\n return _objectSpread({\n value: function value() {}\n }, item, {\n items: item.items && item.items.map(function (nestedItem) {\n return _objectSpread({\n value: function value() {}\n }, nestedItem);\n })\n });\n })\n });\n });\n}","export default '6.11.0';","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 _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\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';\n\nfunction isControlled(props) {\n return Boolean(props.searchState);\n}\n/**\n * @description\n * `<InstantSearch>` 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 <InstantSearch>\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 * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\n\nvar InstantSearch = /*#__PURE__*/function (_Component) {\n _inherits(InstantSearch, _Component);\n\n _createClass(InstantSearch, null, [{\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({}, prevState.contextValue, {\n mainTargetedIndex: nextProps.indexName\n })\n };\n }\n }]);\n\n function InstantSearch(props) {\n var _this;\n\n _classCallCheck(this, InstantSearch);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(InstantSearch).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 <InstantSearch> from being controlled to uncontrolled\");\n }\n\n if (!prevIsControlled && this.state.isControlled) {\n throw new Error(\"You can't switch <InstantSearch> 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: \"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 React.createElement(InstantSearchProvider, {\n value: this.state.contextValue\n }, this.props.children);\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;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { InstantSearchConsumer, IndexProvider } from '../core/context';\n\nfunction getIndexContext(props) {\n return {\n targetedIndex: props.indexId\n };\n}\n/**\n * The component that allows you to apply widgets to a dedicated index. It's\n * useful if you want to build an interface that targets multiple indices.\n *\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Configure hitsPerPage={5} />\n * <SearchBox />\n * <Index indexName=\"instant_search\">\n * <Hits />\n * </Index>\n * <Index indexName=\"bestbuy\">\n * <Hits />\n * </Index>\n * </InstantSearch>\n * );\n */\n\n\nvar Index = /*#__PURE__*/function (_Component) {\n _inherits(Index, _Component);\n\n _createClass(Index, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props) {\n return {\n indexContext: getIndexContext(props)\n };\n }\n }]);\n\n function Index(props) {\n var _this;\n\n _classCallCheck(this, Index);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Index).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n indexContext: getIndexContext(_this.props)\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n\n _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.state.indexContext\n }, _this.props, undefined);\n\n return _this;\n }\n\n _createClass(Index, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.indexName !== prevProps.indexName) {\n this.props.contextValue.widgetsManager.update();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (typeof this.unregisterWidget === 'function') {\n this.unregisterWidget();\n }\n }\n }, {\n key: \"getSearchParameters\",\n value: function getSearchParameters(searchParameters, props) {\n return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName);\n }\n }, {\n key: \"render\",\n value: function render() {\n var childrenCount = Children.count(this.props.children);\n\n if (childrenCount === 0) {\n return null;\n }\n\n return React.createElement(IndexProvider, {\n value: this.state.indexContext\n }, this.props.children);\n }\n }]);\n\n return Index;\n}(Component);\n\n_defineProperty(Index, \"propTypes\", {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string.isRequired,\n children: PropTypes.node\n});\n\nvar IndexWrapper = function IndexWrapper(props) {\n var inferredIndexId = props.indexName;\n return React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return React.createElement(Index, _extends({\n contextValue: contextValue,\n indexId: inferredIndexId\n }, props));\n });\n};\n\nexport var IndexComponentWithoutContext = Index;\nexport default IndexWrapper;","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.<object>} 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 * <div>\n * {hits.map(hit =>\n * <p key={hit.objectID}>\n * <Highlight attribute=\"name\" hit={hit} />\n * </p>\n * )}\n * </div>\n * ));\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <CustomHits />\n * </InstantSearch>\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});","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 React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('Hits');\n\nvar DefaultHitComponent = function DefaultHitComponent(props) {\n return React.createElement(\"div\", {\n style: {\n borderBottom: '1px solid #bbb',\n paddingBottom: '5px',\n marginBottom: '5px',\n wordBreak: 'break-all'\n }\n }, JSON.stringify(props).slice(0, 100), \"...\");\n};\n\nvar Hits = function Hits(_ref) {\n var hits = _ref.hits,\n _ref$className = _ref.className,\n className = _ref$className === void 0 ? '' : _ref$className,\n _ref$hitComponent = _ref.hitComponent,\n HitComponent = _ref$hitComponent === void 0 ? DefaultHitComponent : _ref$hitComponent;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"ul\", {\n className: cx('list')\n }, hits.map(function (hit) {\n return React.createElement(\"li\", {\n className: cx('item'),\n key: hit.objectID\n }, React.createElement(HitComponent, {\n hit: hit\n }));\n })));\n};\n\nvar HitPropTypes = PropTypes.shape({\n objectID: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired\n});\nexport default Hits;","import { connectHits } from 'react-instantsearch-core';\nimport Hits from '../components/Hits';\n/**\n * Displays a list of hits.\n *\n * To configure the number of hits being shown, use the [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or the [Configure widget](widgets/Configure.html).\n *\n * @name Hits\n * @kind widget\n * @propType {Component} [hitComponent] - Component used for rendering each hit from\n * the results. If it is not provided the rendering defaults to displaying the\n * hit in its JSON form. The component will be called with a `hit` prop.\n * @themeKey ais-Hits - the root div of the widget\n * @themeKey ais-Hits-list - the list of results\n * @themeKey ais-Hits-item - the hit list item\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Hits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectHits(Hits);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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, [\"children\", \"contextValue\", \"indexContextValue\"]);\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, [\"children\", \"contextValue\", \"indexContextValue\"]);\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({}, 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 * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Configure hitsPerPage={5} />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectConfigure(function Configure() {\n return null;\n});","function stylis_min(W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {}\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n } else Y = !!d | 0;\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\nexport default stylis_min;","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;","import memoize from '@emotion/memoize';\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\nexport default index;","import { typeOf as e, isElement as t, isValidElementType as n } from \"react-is\";\nimport r, { useState as o, useContext as i, useMemo as s, useEffect as a, useRef as c, createElement as u, useDebugValue as l, useLayoutEffect as d } from \"react\";\nimport h from \"shallowequal\";\nimport p from \"@emotion/stylis\";\nimport f from \"@emotion/unitless\";\nimport m from \"@emotion/is-prop-valid\";\nimport y from \"hoist-non-react-statics\";\n\nfunction v() {\n return (v = Object.assign || function (e) {\n for (var t = 1; t < arguments.length; t++) {\n var n = arguments[t];\n\n for (var r in n) {\n Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);\n }\n }\n\n return e;\n }).apply(this, arguments);\n}\n\nvar g = function g(e, t) {\n for (var n = [e[0]], r = 0, o = t.length; r < o; r += 1) {\n n.push(t[r], e[r + 1]);\n }\n\n return n;\n},\n S = function S(t) {\n return null !== t && \"object\" == typeof t && \"[object Object]\" === (t.toString ? t.toString() : Object.prototype.toString.call(t)) && !e(t);\n},\n w = Object.freeze([]),\n E = Object.freeze({});\n\nfunction b(e) {\n return \"function\" == typeof e;\n}\n\nfunction _(e) {\n return \"production\" !== process.env.NODE_ENV && \"string\" == typeof e && e || e.displayName || e.name || \"Component\";\n}\n\nfunction N(e) {\n return e && \"string\" == typeof e.styledComponentId;\n}\n\nvar A = \"undefined\" != typeof process && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || \"data-styled\",\n C = \"5.3.0\",\n I = \"undefined\" != typeof window && \"HTMLElement\" in window,\n P = Boolean(\"boolean\" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : \"undefined\" != typeof process && void 0 !== process.env.REACT_APP_SC_DISABLE_SPEEDY && \"\" !== process.env.REACT_APP_SC_DISABLE_SPEEDY ? \"false\" !== process.env.REACT_APP_SC_DISABLE_SPEEDY && process.env.REACT_APP_SC_DISABLE_SPEEDY : \"undefined\" != typeof process && void 0 !== process.env.SC_DISABLE_SPEEDY && \"\" !== process.env.SC_DISABLE_SPEEDY ? \"false\" !== process.env.SC_DISABLE_SPEEDY && process.env.SC_DISABLE_SPEEDY : \"production\" !== process.env.NODE_ENV),\n O = {},\n R = \"production\" !== process.env.NODE_ENV ? {\n 1: \"Cannot create styled-component for component: %s.\\n\\n\",\n 2: \"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\\n\\n- Are you trying to reuse it across renders?\\n- Are you accidentally calling collectStyles twice?\\n\\n\",\n 3: \"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\\n\\n\",\n 4: \"The `StyleSheetManager` expects a valid target or sheet prop!\\n\\n- Does this error occur on the client and is your target falsy?\\n- Does this error occur on the server and is the sheet falsy?\\n\\n\",\n 5: \"The clone method cannot be used on the client!\\n\\n- Are you running in a client-like environment on the server?\\n- Are you trying to run SSR on the client?\\n\\n\",\n 6: \"Trying to insert a new style tag, but the given Node is unmounted!\\n\\n- Are you using a custom target that isn't mounted?\\n- Does your document not have a valid head element?\\n- Have you accidentally removed a style tag manually?\\n\\n\",\n 7: 'ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\\n\\n```js\\ntheme={() => ({})}\\n```\\n\\n',\n 8: 'ThemeProvider: Please make your \"theme\" prop an object.\\n\\n',\n 9: \"Missing document `<head>`\\n\\n\",\n 10: \"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\\n\\n\",\n 11: \"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\\n\\n\",\n 12: \"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\\\`\\\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\\n\\n\",\n 13: \"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\\n\\n\",\n 14: 'ThemeProvider: \"theme\" prop is required.\\n\\n',\n 15: \"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\\n\\n```js\\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\\n```\\n\\n\",\n 16: \"Reached the limit of how many styled components may be created at group %s.\\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\\nas for instance in your render method then you may be running into this limitation.\\n\\n\",\n 17: \"CSSStyleSheet could not be found on HTMLStyleElement.\\nHas styled-components' style tag been unmounted or altered by another script?\\n\"\n} : {};\n\nfunction D() {\n for (var e = arguments.length <= 0 ? void 0 : arguments[0], t = [], n = 1, r = arguments.length; n < r; n += 1) {\n t.push(n < 0 || arguments.length <= n ? void 0 : arguments[n]);\n }\n\n return t.forEach(function (t) {\n e = e.replace(/%[a-z]/, t);\n }), e;\n}\n\nfunction j(e) {\n for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) {\n n[r - 1] = arguments[r];\n }\n\n throw \"production\" === process.env.NODE_ENV ? new Error(\"An error occurred. See https://git.io/JUIaE#\" + e + \" for more information.\" + (n.length > 0 ? \" Args: \" + n.join(\", \") : \"\")) : new Error(D.apply(void 0, [R[e]].concat(n)).trim());\n}\n\nvar T = function () {\n function e(e) {\n this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e;\n }\n\n var t = e.prototype;\n return t.indexOfGroup = function (e) {\n for (var t = 0, n = 0; n < e; n++) {\n t += this.groupSizes[n];\n }\n\n return t;\n }, t.insertRules = function (e, t) {\n if (e >= this.groupSizes.length) {\n for (var n = this.groupSizes, r = n.length, o = r; e >= o;) {\n (o <<= 1) < 0 && j(16, \"\" + e);\n }\n\n this.groupSizes = new Uint32Array(o), this.groupSizes.set(n), this.length = o;\n\n for (var i = r; i < o; i++) {\n this.groupSizes[i] = 0;\n }\n }\n\n for (var s = this.indexOfGroup(e + 1), a = 0, c = t.length; a < c; a++) {\n this.tag.insertRule(s, t[a]) && (this.groupSizes[e]++, s++);\n }\n }, t.clearGroup = function (e) {\n if (e < this.length) {\n var t = this.groupSizes[e],\n n = this.indexOfGroup(e),\n r = n + t;\n this.groupSizes[e] = 0;\n\n for (var o = n; o < r; o++) {\n this.tag.deleteRule(n);\n }\n }\n }, t.getGroup = function (e) {\n var t = \"\";\n if (e >= this.length || 0 === this.groupSizes[e]) return t;\n\n for (var n = this.groupSizes[e], r = this.indexOfGroup(e), o = r + n, i = r; i < o; i++) {\n t += this.tag.getRule(i) + \"/*!sc*/\\n\";\n }\n\n return t;\n }, e;\n}(),\n k = new Map(),\n x = new Map(),\n V = 1,\n B = function B(e) {\n if (k.has(e)) return k.get(e);\n\n for (; x.has(V);) {\n V++;\n }\n\n var t = V++;\n return \"production\" !== process.env.NODE_ENV && ((0 | t) < 0 || t > 1 << 30) && j(16, \"\" + t), k.set(e, t), x.set(t, e), t;\n},\n M = function M(e) {\n return x.get(e);\n},\n z = function z(e, t) {\n k.set(e, t), x.set(t, e);\n},\n L = \"style[\" + A + '][data-styled-version=\"5.3.0\"]',\n G = new RegExp(\"^\" + A + '\\\\.g(\\\\d+)\\\\[id=\"([\\\\w\\\\d-]+)\"\\\\].*?\"([^\"]*)'),\n F = function F(e, t, n) {\n for (var r, o = n.split(\",\"), i = 0, s = o.length; i < s; i++) {\n (r = o[i]) && e.registerName(t, r);\n }\n},\n Y = function Y(e, t) {\n for (var n = t.innerHTML.split(\"/*!sc*/\\n\"), r = [], o = 0, i = n.length; o < i; o++) {\n var s = n[o].trim();\n\n if (s) {\n var a = s.match(G);\n\n if (a) {\n var c = 0 | parseInt(a[1], 10),\n u = a[2];\n 0 !== c && (z(u, c), F(e, u, a[3]), e.getTag().insertRules(c, r)), r.length = 0;\n } else r.push(s);\n }\n }\n},\n q = function q() {\n return \"undefined\" != typeof window && void 0 !== window.__webpack_nonce__ ? window.__webpack_nonce__ : null;\n},\n H = function H(e) {\n var t = document.head,\n n = e || t,\n r = document.createElement(\"style\"),\n o = function (e) {\n for (var t = e.childNodes, n = t.length; n >= 0; n--) {\n var r = t[n];\n if (r && 1 === r.nodeType && r.hasAttribute(A)) return r;\n }\n }(n),\n i = void 0 !== o ? o.nextSibling : null;\n\n r.setAttribute(A, \"active\"), r.setAttribute(\"data-styled-version\", \"5.3.0\");\n var s = q();\n return s && r.setAttribute(\"nonce\", s), n.insertBefore(r, i), r;\n},\n $ = function () {\n function e(e) {\n var t = this.element = H(e);\n t.appendChild(document.createTextNode(\"\")), this.sheet = function (e) {\n if (e.sheet) return e.sheet;\n\n for (var t = document.styleSheets, n = 0, r = t.length; n < r; n++) {\n var o = t[n];\n if (o.ownerNode === e) return o;\n }\n\n j(17);\n }(t), this.length = 0;\n }\n\n var t = e.prototype;\n return t.insertRule = function (e, t) {\n try {\n return this.sheet.insertRule(t, e), this.length++, !0;\n } catch (e) {\n return !1;\n }\n }, t.deleteRule = function (e) {\n this.sheet.deleteRule(e), this.length--;\n }, t.getRule = function (e) {\n var t = this.sheet.cssRules[e];\n return void 0 !== t && \"string\" == typeof t.cssText ? t.cssText : \"\";\n }, e;\n}(),\n W = function () {\n function e(e) {\n var t = this.element = H(e);\n this.nodes = t.childNodes, this.length = 0;\n }\n\n var t = e.prototype;\n return t.insertRule = function (e, t) {\n if (e <= this.length && e >= 0) {\n var n = document.createTextNode(t),\n r = this.nodes[e];\n return this.element.insertBefore(n, r || null), this.length++, !0;\n }\n\n return !1;\n }, t.deleteRule = function (e) {\n this.element.removeChild(this.nodes[e]), this.length--;\n }, t.getRule = function (e) {\n return e < this.length ? this.nodes[e].textContent : \"\";\n }, e;\n}(),\n U = function () {\n function e(e) {\n this.rules = [], this.length = 0;\n }\n\n var t = e.prototype;\n return t.insertRule = function (e, t) {\n return e <= this.length && (this.rules.splice(e, 0, t), this.length++, !0);\n }, t.deleteRule = function (e) {\n this.rules.splice(e, 1), this.length--;\n }, t.getRule = function (e) {\n return e < this.length ? this.rules[e] : \"\";\n }, e;\n}(),\n J = I,\n X = {\n isServer: !I,\n useCSSOMInjection: !P\n},\n Z = function () {\n function e(e, t, n) {\n void 0 === e && (e = E), void 0 === t && (t = {}), this.options = v({}, X, {}, e), this.gs = t, this.names = new Map(n), !this.options.isServer && I && J && (J = !1, function (e) {\n for (var t = document.querySelectorAll(L), n = 0, r = t.length; n < r; n++) {\n var o = t[n];\n o && \"active\" !== o.getAttribute(A) && (Y(e, o), o.parentNode && o.parentNode.removeChild(o));\n }\n }(this));\n }\n\n e.registerId = function (e) {\n return B(e);\n };\n\n var t = e.prototype;\n return t.reconstructWithOptions = function (t, n) {\n return void 0 === n && (n = !0), new e(v({}, this.options, {}, t), this.gs, n && this.names || void 0);\n }, t.allocateGSInstance = function (e) {\n return this.gs[e] = (this.gs[e] || 0) + 1;\n }, t.getTag = function () {\n return this.tag || (this.tag = (n = (t = this.options).isServer, r = t.useCSSOMInjection, o = t.target, e = n ? new U(o) : r ? new $(o) : new W(o), new T(e)));\n var e, t, n, r, o;\n }, t.hasNameForId = function (e, t) {\n return this.names.has(e) && this.names.get(e).has(t);\n }, t.registerName = function (e, t) {\n if (B(e), this.names.has(e)) this.names.get(e).add(t);else {\n var n = new Set();\n n.add(t), this.names.set(e, n);\n }\n }, t.insertRules = function (e, t, n) {\n this.registerName(e, t), this.getTag().insertRules(B(e), n);\n }, t.clearNames = function (e) {\n this.names.has(e) && this.names.get(e).clear();\n }, t.clearRules = function (e) {\n this.getTag().clearGroup(B(e)), this.clearNames(e);\n }, t.clearTag = function () {\n this.tag = void 0;\n }, t.toString = function () {\n return function (e) {\n for (var t = e.getTag(), n = t.length, r = \"\", o = 0; o < n; o++) {\n var i = M(o);\n\n if (void 0 !== i) {\n var s = e.names.get(i),\n a = t.getGroup(o);\n\n if (void 0 !== s && 0 !== a.length) {\n var c = A + \".g\" + o + '[id=\"' + i + '\"]',\n u = \"\";\n void 0 !== s && s.forEach(function (e) {\n e.length > 0 && (u += e + \",\");\n }), r += \"\" + a + c + '{content:\"' + u + '\"}/*!sc*/\\n';\n }\n }\n }\n\n return r;\n }(this);\n }, e;\n}(),\n K = /(a)(d)/gi,\n Q = function Q(e) {\n return String.fromCharCode(e + (e > 25 ? 39 : 97));\n};\n\nfunction ee(e) {\n var t,\n n = \"\";\n\n for (t = Math.abs(e); t > 52; t = t / 52 | 0) {\n n = Q(t % 52) + n;\n }\n\n return (Q(t % 52) + n).replace(K, \"$1-$2\");\n}\n\nvar te = function te(e, t) {\n for (var n = t.length; n;) {\n e = 33 * e ^ t.charCodeAt(--n);\n }\n\n return e;\n},\n ne = function ne(e) {\n return te(5381, e);\n};\n\nfunction re(e) {\n for (var t = 0; t < e.length; t += 1) {\n var n = e[t];\n if (b(n) && !N(n)) return !1;\n }\n\n return !0;\n}\n\nvar oe = ne(\"5.3.0\"),\n ie = function () {\n function e(e, t, n) {\n this.rules = e, this.staticRulesId = \"\", this.isStatic = \"production\" === process.env.NODE_ENV && (void 0 === n || n.isStatic) && re(e), this.componentId = t, this.baseHash = te(oe, t), this.baseStyle = n, Z.registerId(t);\n }\n\n return e.prototype.generateAndInjectStyles = function (e, t, n) {\n var r = this.componentId,\n o = [];\n if (this.baseStyle && o.push(this.baseStyle.generateAndInjectStyles(e, t, n)), this.isStatic && !n.hash) {\n if (this.staticRulesId && t.hasNameForId(r, this.staticRulesId)) o.push(this.staticRulesId);else {\n var i = Ne(this.rules, e, t, n).join(\"\"),\n s = ee(te(this.baseHash, i.length) >>> 0);\n\n if (!t.hasNameForId(r, s)) {\n var a = n(i, \".\" + s, void 0, r);\n t.insertRules(r, s, a);\n }\n\n o.push(s), this.staticRulesId = s;\n }\n } else {\n for (var c = this.rules.length, u = te(this.baseHash, n.hash), l = \"\", d = 0; d < c; d++) {\n var h = this.rules[d];\n if (\"string\" == typeof h) l += h, \"production\" !== process.env.NODE_ENV && (u = te(u, h + d));else if (h) {\n var p = Ne(h, e, t, n),\n f = Array.isArray(p) ? p.join(\"\") : p;\n u = te(u, f + d), l += f;\n }\n }\n\n if (l) {\n var m = ee(u >>> 0);\n\n if (!t.hasNameForId(r, m)) {\n var y = n(l, \".\" + m, void 0, r);\n t.insertRules(r, m, y);\n }\n\n o.push(m);\n }\n }\n return o.join(\" \");\n }, e;\n}(),\n se = /^\\s*\\/\\/.*$/gm,\n ae = [\":\", \"[\", \".\", \"#\"];\n\nfunction ce(e) {\n var t,\n n,\n r,\n o,\n i = void 0 === e ? E : e,\n s = i.options,\n a = void 0 === s ? E : s,\n c = i.plugins,\n u = void 0 === c ? w : c,\n l = new p(a),\n d = [],\n h = function (e) {\n function t(t) {\n if (t) try {\n e(t + \"}\");\n } catch (e) {}\n }\n\n return function (n, r, o, i, s, a, c, u, l, d) {\n switch (n) {\n case 1:\n if (0 === l && 64 === r.charCodeAt(0)) return e(r + \";\"), \"\";\n break;\n\n case 2:\n if (0 === u) return r + \"/*|*/\";\n break;\n\n case 3:\n switch (u) {\n case 102:\n case 112:\n return e(o[0] + r), \"\";\n\n default:\n return r + (0 === d ? \"/*|*/\" : \"\");\n }\n\n case -2:\n r.split(\"/*|*/}\").forEach(t);\n }\n };\n }(function (e) {\n d.push(e);\n }),\n f = function f(e, r, i) {\n return 0 === r && -1 !== ae.indexOf(i[n.length]) || i.match(o) ? e : \".\" + t;\n };\n\n function m(e, i, s, a) {\n void 0 === a && (a = \"&\");\n var c = e.replace(se, \"\"),\n u = i && s ? s + \" \" + i + \" { \" + c + \" }\" : c;\n return t = a, n = i, r = new RegExp(\"\\\\\" + n + \"\\\\b\", \"g\"), o = new RegExp(\"(\\\\\" + n + \"\\\\b){2,}\"), l(s || !i ? \"\" : i, u);\n }\n\n return l.use([].concat(u, [function (e, t, o) {\n 2 === e && o.length && o[0].lastIndexOf(n) > 0 && (o[0] = o[0].replace(r, f));\n }, h, function (e) {\n if (-2 === e) {\n var t = d;\n return d = [], t;\n }\n }])), m.hash = u.length ? u.reduce(function (e, t) {\n return t.name || j(15), te(e, t.name);\n }, 5381).toString() : \"\", m;\n}\n\nvar ue = r.createContext(),\n le = ue.Consumer,\n de = r.createContext(),\n he = (de.Consumer, new Z()),\n pe = ce();\n\nfunction fe() {\n return i(ue) || he;\n}\n\nfunction me() {\n return i(de) || pe;\n}\n\nfunction ye(e) {\n var t = o(e.stylisPlugins),\n n = t[0],\n i = t[1],\n c = fe(),\n u = s(function () {\n var t = c;\n return e.sheet ? t = e.sheet : e.target && (t = t.reconstructWithOptions({\n target: e.target\n }, !1)), e.disableCSSOMInjection && (t = t.reconstructWithOptions({\n useCSSOMInjection: !1\n })), t;\n }, [e.disableCSSOMInjection, e.sheet, e.target]),\n l = s(function () {\n return ce({\n options: {\n prefix: !e.disableVendorPrefixes\n },\n plugins: n\n });\n }, [e.disableVendorPrefixes, n]);\n return a(function () {\n h(n, e.stylisPlugins) || i(e.stylisPlugins);\n }, [e.stylisPlugins]), r.createElement(ue.Provider, {\n value: u\n }, r.createElement(de.Provider, {\n value: l\n }, \"production\" !== process.env.NODE_ENV ? r.Children.only(e.children) : e.children));\n}\n\nvar ve = function () {\n function e(e, t) {\n var n = this;\n this.inject = function (e, t) {\n void 0 === t && (t = pe);\n var r = n.name + t.hash;\n e.hasNameForId(n.id, r) || e.insertRules(n.id, r, t(n.rules, r, \"@keyframes\"));\n }, this.toString = function () {\n return j(12, String(n.name));\n }, this.name = e, this.id = \"sc-keyframes-\" + e, this.rules = t;\n }\n\n return e.prototype.getName = function (e) {\n return void 0 === e && (e = pe), this.name + e.hash;\n }, e;\n}(),\n ge = /([A-Z])/,\n Se = /([A-Z])/g,\n we = /^ms-/,\n Ee = function Ee(e) {\n return \"-\" + e.toLowerCase();\n};\n\nfunction be(e) {\n return ge.test(e) ? e.replace(Se, Ee).replace(we, \"-ms-\") : e;\n}\n\nvar _e = function _e(e) {\n return null == e || !1 === e || \"\" === e;\n};\n\nfunction Ne(e, n, r, o) {\n if (Array.isArray(e)) {\n for (var i, s = [], a = 0, c = e.length; a < c; a += 1) {\n \"\" !== (i = Ne(e[a], n, r, o)) && (Array.isArray(i) ? s.push.apply(s, i) : s.push(i));\n }\n\n return s;\n }\n\n if (_e(e)) return \"\";\n if (N(e)) return \".\" + e.styledComponentId;\n\n if (b(e)) {\n if (\"function\" != typeof (l = e) || l.prototype && l.prototype.isReactComponent || !n) return e;\n var u = e(n);\n return \"production\" !== process.env.NODE_ENV && t(u) && console.warn(_(e) + \" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\"), Ne(u, n, r, o);\n }\n\n var l;\n return e instanceof ve ? r ? (e.inject(r, o), e.getName(o)) : e : S(e) ? function e(t, n) {\n var r,\n o,\n i = [];\n\n for (var s in t) {\n t.hasOwnProperty(s) && !_e(t[s]) && (S(t[s]) ? i.push.apply(i, e(t[s], s)) : b(t[s]) ? i.push(be(s) + \":\", t[s], \";\") : i.push(be(s) + \": \" + (r = s, null == (o = t[s]) || \"boolean\" == typeof o || \"\" === o ? \"\" : \"number\" != typeof o || 0 === o || r in f ? String(o).trim() : o + \"px\") + \";\"));\n }\n\n return n ? [n + \" {\"].concat(i, [\"}\"]) : i;\n }(e) : e.toString();\n}\n\nfunction Ae(e) {\n for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) {\n n[r - 1] = arguments[r];\n }\n\n return b(e) || S(e) ? Ne(g(w, [e].concat(n))) : 0 === n.length && 1 === e.length && \"string\" == typeof e[0] ? e : Ne(g(e, n));\n}\n\nvar Ce = /invalid hook call/i,\n Ie = new Set(),\n Pe = function Pe(e, t) {\n if (\"production\" !== process.env.NODE_ENV) {\n var n = \"The component \" + e + (t ? ' with the id of \"' + t + '\"' : \"\") + \" has been created dynamically.\\nYou may see this warning because you've called styled inside another component.\\nTo resolve this only create new StyledComponents outside of any render method and function component.\";\n\n try {\n c(), Ie.has(n) || (console.warn(n), Ie.add(n));\n } catch (e) {\n Ce.test(e.message) && Ie.delete(n);\n }\n }\n},\n Oe = function Oe(e, t, n) {\n return void 0 === n && (n = E), e.theme !== n.theme && e.theme || t || n.theme;\n},\n Re = /[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^`{|}~-]+/g,\n De = /(^-|-$)/g;\n\nfunction je(e) {\n return e.replace(Re, \"-\").replace(De, \"\");\n}\n\nvar Te = function Te(e) {\n return ee(ne(e) >>> 0);\n};\n\nfunction ke(e) {\n return \"string\" == typeof e && (\"production\" === process.env.NODE_ENV || e.charAt(0) === e.charAt(0).toLowerCase());\n}\n\nvar xe = function xe(e) {\n return \"function\" == typeof e || \"object\" == typeof e && null !== e && !Array.isArray(e);\n},\n Ve = function Ve(e) {\n return \"__proto__\" !== e && \"constructor\" !== e && \"prototype\" !== e;\n};\n\nfunction Be(e, t, n) {\n var r = e[n];\n xe(t) && xe(r) ? Me(r, t) : e[n] = t;\n}\n\nfunction Me(e) {\n for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) {\n n[r - 1] = arguments[r];\n }\n\n for (var o = 0, i = n; o < i.length; o++) {\n var s = i[o];\n if (xe(s)) for (var a in s) {\n Ve(a) && Be(e, s[a], a);\n }\n }\n\n return e;\n}\n\nvar ze = r.createContext(),\n Le = ze.Consumer;\n\nfunction Ge(e) {\n var t = i(ze),\n n = s(function () {\n return function (e, t) {\n if (!e) return j(14);\n\n if (b(e)) {\n var n = e(t);\n return \"production\" === process.env.NODE_ENV || null !== n && !Array.isArray(n) && \"object\" == typeof n ? n : j(7);\n }\n\n return Array.isArray(e) || \"object\" != typeof e ? j(8) : t ? v({}, t, {}, e) : e;\n }(e.theme, t);\n }, [e.theme, t]);\n return e.children ? r.createElement(ze.Provider, {\n value: n\n }, e.children) : null;\n}\n\nvar Fe = {};\n\nfunction Ye(e, t, n) {\n var o = N(e),\n s = !ke(e),\n a = t.attrs,\n c = void 0 === a ? w : a,\n d = t.componentId,\n h = void 0 === d ? function (e, t) {\n var n = \"string\" != typeof e ? \"sc\" : je(e);\n Fe[n] = (Fe[n] || 0) + 1;\n var r = n + \"-\" + Te(\"5.3.0\" + n + Fe[n]);\n return t ? t + \"-\" + r : r;\n }(t.displayName, t.parentComponentId) : d,\n p = t.displayName,\n f = void 0 === p ? function (e) {\n return ke(e) ? \"styled.\" + e : \"Styled(\" + _(e) + \")\";\n }(e) : p,\n g = t.displayName && t.componentId ? je(t.displayName) + \"-\" + t.componentId : t.componentId || h,\n S = o && e.attrs ? Array.prototype.concat(e.attrs, c).filter(Boolean) : c,\n A = t.shouldForwardProp;\n o && e.shouldForwardProp && (A = t.shouldForwardProp ? function (n, r, o) {\n return e.shouldForwardProp(n, r, o) && t.shouldForwardProp(n, r, o);\n } : e.shouldForwardProp);\n\n var C,\n I = new ie(n, g, o ? e.componentStyle : void 0),\n P = I.isStatic && 0 === c.length,\n O = function O(e, t) {\n return function (e, t, n, r) {\n var o = e.attrs,\n s = e.componentStyle,\n a = e.defaultProps,\n c = e.foldedComponentIds,\n d = e.shouldForwardProp,\n h = e.styledComponentId,\n p = e.target;\n \"production\" !== process.env.NODE_ENV && l(h);\n\n var f = function (e, t, n) {\n void 0 === e && (e = E);\n var r = v({}, t, {\n theme: e\n }),\n o = {};\n return n.forEach(function (e) {\n var t,\n n,\n i,\n s = e;\n\n for (t in b(s) && (s = s(r)), s) {\n r[t] = o[t] = \"className\" === t ? (n = o[t], i = s[t], n && i ? n + \" \" + i : n || i) : s[t];\n }\n }), [r, o];\n }(Oe(t, i(ze), a) || E, t, o),\n y = f[0],\n g = f[1],\n S = function (e, t, n, r) {\n var o = fe(),\n i = me(),\n s = t ? e.generateAndInjectStyles(E, o, i) : e.generateAndInjectStyles(n, o, i);\n return \"production\" !== process.env.NODE_ENV && l(s), \"production\" !== process.env.NODE_ENV && !t && r && r(s), s;\n }(s, r, y, \"production\" !== process.env.NODE_ENV ? e.warnTooManyClasses : void 0),\n w = n,\n _ = g.$as || t.$as || g.as || t.as || p,\n N = ke(_),\n A = g !== t ? v({}, t, {}, g) : t,\n C = {};\n\n for (var I in A) {\n \"$\" !== I[0] && \"as\" !== I && (\"forwardedAs\" === I ? C.as = A[I] : (d ? d(I, m, _) : !N || m(I)) && (C[I] = A[I]));\n }\n\n return t.style && g.style !== t.style && (C.style = v({}, t.style, {}, g.style)), C.className = Array.prototype.concat(c, h, S !== h ? S : null, t.className, g.className).filter(Boolean).join(\" \"), C.ref = w, u(_, C);\n }(C, e, t, P);\n };\n\n return O.displayName = f, (C = r.forwardRef(O)).attrs = S, C.componentStyle = I, C.displayName = f, C.shouldForwardProp = A, C.foldedComponentIds = o ? Array.prototype.concat(e.foldedComponentIds, e.styledComponentId) : w, C.styledComponentId = g, C.target = o ? e.target : e, C.withComponent = function (e) {\n var r = t.componentId,\n o = function (e, t) {\n if (null == e) return {};\n var n,\n r,\n o = {},\n i = Object.keys(e);\n\n for (r = 0; r < i.length; r++) {\n n = i[r], t.indexOf(n) >= 0 || (o[n] = e[n]);\n }\n\n return o;\n }(t, [\"componentId\"]),\n i = r && r + \"-\" + (ke(e) ? e : je(_(e)));\n\n return Ye(e, v({}, o, {\n attrs: S,\n componentId: i\n }), n);\n }, Object.defineProperty(C, \"defaultProps\", {\n get: function get() {\n return this._foldedDefaultProps;\n },\n set: function set(t) {\n this._foldedDefaultProps = o ? Me({}, e.defaultProps, t) : t;\n }\n }), \"production\" !== process.env.NODE_ENV && (Pe(f, g), C.warnTooManyClasses = function (e, t) {\n var n = {},\n r = !1;\n return function (o) {\n if (!r && (n[o] = !0, Object.keys(n).length >= 200)) {\n var i = t ? ' with the id of \"' + t + '\"' : \"\";\n console.warn(\"Over 200 classes were generated for component \" + e + i + \".\\nConsider using the attrs method, together with a style object for frequently changed styles.\\nExample:\\n const Component = styled.div.attrs(props => ({\\n style: {\\n background: props.background,\\n },\\n }))`width: 100%;`\\n\\n <Component />\"), r = !0, n = {};\n }\n };\n }(f, g)), C.toString = function () {\n return \".\" + C.styledComponentId;\n }, s && y(C, e, {\n attrs: !0,\n componentStyle: !0,\n displayName: !0,\n foldedComponentIds: !0,\n shouldForwardProp: !0,\n styledComponentId: !0,\n target: !0,\n withComponent: !0\n }), C;\n}\n\nvar qe = function qe(e) {\n return function e(t, r, o) {\n if (void 0 === o && (o = E), !n(r)) return j(1, String(r));\n\n var i = function i() {\n return t(r, o, Ae.apply(void 0, arguments));\n };\n\n return i.withConfig = function (n) {\n return e(t, r, v({}, o, {}, n));\n }, i.attrs = function (n) {\n return e(t, r, v({}, o, {\n attrs: Array.prototype.concat(o.attrs, n).filter(Boolean)\n }));\n }, i;\n }(Ye, e);\n};\n\n[\"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"base\", \"bdi\", \"bdo\", \"big\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\", \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"embed\", \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\", \"img\", \"input\", \"ins\", \"kbd\", \"keygen\", \"label\", \"legend\", \"li\", \"link\", \"main\", \"map\", \"mark\", \"marquee\", \"menu\", \"menuitem\", \"meta\", \"meter\", \"nav\", \"noscript\", \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"p\", \"param\", \"picture\", \"pre\", \"progress\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\", \"samp\", \"script\", \"section\", \"select\", \"small\", \"source\", \"span\", \"strong\", \"style\", \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"u\", \"ul\", \"var\", \"video\", \"wbr\", \"circle\", \"clipPath\", \"defs\", \"ellipse\", \"foreignObject\", \"g\", \"image\", \"line\", \"linearGradient\", \"marker\", \"mask\", \"path\", \"pattern\", \"polygon\", \"polyline\", \"radialGradient\", \"rect\", \"stop\", \"svg\", \"text\", \"textPath\", \"tspan\"].forEach(function (e) {\n qe[e] = qe(e);\n});\n\nvar He = function () {\n function e(e, t) {\n this.rules = e, this.componentId = t, this.isStatic = re(e), Z.registerId(this.componentId + 1);\n }\n\n var t = e.prototype;\n return t.createStyles = function (e, t, n, r) {\n var o = r(Ne(this.rules, t, n, r).join(\"\"), \"\"),\n i = this.componentId + e;\n n.insertRules(i, i, o);\n }, t.removeStyles = function (e, t) {\n t.clearRules(this.componentId + e);\n }, t.renderStyles = function (e, t, n, r) {\n e > 2 && Z.registerId(this.componentId + e), this.removeStyles(e, n), this.createStyles(e, t, n, r);\n }, e;\n}();\n\nfunction $e(e) {\n for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) {\n n[o - 1] = arguments[o];\n }\n\n var s = Ae.apply(void 0, [e].concat(n)),\n a = \"sc-global-\" + Te(JSON.stringify(s)),\n u = new He(s, a);\n\n function l(e) {\n var t = fe(),\n n = me(),\n o = i(ze),\n l = c(t.allocateGSInstance(a)).current;\n return \"production\" !== process.env.NODE_ENV && r.Children.count(e.children) && console.warn(\"The global style component \" + a + \" was given child JSX. createGlobalStyle does not render children.\"), \"production\" !== process.env.NODE_ENV && s.some(function (e) {\n return \"string\" == typeof e && -1 !== e.indexOf(\"@import\");\n }) && console.warn(\"Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app.\"), d(function () {\n return h(l, e, t, o, n), function () {\n return u.removeStyles(l, t);\n };\n }, [l, e, t, o, n]), null;\n }\n\n function h(e, t, n, r, o) {\n if (u.isStatic) u.renderStyles(e, O, n, o);else {\n var i = v({}, t, {\n theme: Oe(t, r, l.defaultProps)\n });\n u.renderStyles(e, i, n, o);\n }\n }\n\n return \"production\" !== process.env.NODE_ENV && Pe(a), r.memo(l);\n}\n\nfunction We(e) {\n \"production\" !== process.env.NODE_ENV && \"undefined\" != typeof navigator && \"ReactNative\" === navigator.product && console.warn(\"`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.\");\n\n for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++) {\n n[r - 1] = arguments[r];\n }\n\n var o = Ae.apply(void 0, [e].concat(n)).join(\"\"),\n i = Te(o);\n return new ve(i, o);\n}\n\nvar Ue = function () {\n function e() {\n var e = this;\n this._emitSheetCSS = function () {\n var t = e.instance.toString(),\n n = q();\n return \"<style \" + [n && 'nonce=\"' + n + '\"', A + '=\"true\"', 'data-styled-version=\"5.3.0\"'].filter(Boolean).join(\" \") + \">\" + t + \"</style>\";\n }, this.getStyleTags = function () {\n return e.sealed ? j(2) : e._emitSheetCSS();\n }, this.getStyleElement = function () {\n var t;\n if (e.sealed) return j(2);\n var n = ((t = {})[A] = \"\", t[\"data-styled-version\"] = \"5.3.0\", t.dangerouslySetInnerHTML = {\n __html: e.instance.toString()\n }, t),\n o = q();\n return o && (n.nonce = o), [r.createElement(\"style\", v({}, n, {\n key: \"sc-0-0\"\n }))];\n }, this.seal = function () {\n e.sealed = !0;\n }, this.instance = new Z({\n isServer: !0\n }), this.sealed = !1;\n }\n\n var t = e.prototype;\n return t.collectStyles = function (e) {\n return this.sealed ? j(2) : r.createElement(ye, {\n sheet: this.instance\n }, e);\n }, t.interleaveWithNodeStream = function (e) {\n return j(3);\n }, e;\n}(),\n Je = function Je(e) {\n var t = r.forwardRef(function (t, n) {\n var o = i(ze),\n s = e.defaultProps,\n a = Oe(t, o, s);\n return \"production\" !== process.env.NODE_ENV && void 0 === a && console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"' + _(e) + '\"'), r.createElement(e, v({}, t, {\n theme: a,\n ref: n\n }));\n });\n return y(t, e), t.displayName = \"WithTheme(\" + _(e) + \")\", t;\n},\n Xe = function Xe() {\n return i(ze);\n},\n Ze = {\n StyleSheet: Z,\n masterSheet: he\n};\n\n\"production\" !== process.env.NODE_ENV && \"undefined\" != typeof navigator && \"ReactNative\" === navigator.product && console.warn(\"It looks like you've imported 'styled-components' on React Native.\\nPerhaps you're looking to import 'styled-components/native'?\\nRead more about this at https://www.styled-components.com/docs/basics#react-native\"), \"production\" !== process.env.NODE_ENV && \"test\" !== process.env.NODE_ENV && (window[\"__styled-components-init__\"] = window[\"__styled-components-init__\"] || 0, 1 === window[\"__styled-components-init__\"] && console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\\n\\nSee https://s-c.sh/2BAXzed for more info.\"), window[\"__styled-components-init__\"] += 1);\nexport default qe;\nexport { Ue as ServerStyleSheet, le as StyleSheetConsumer, ue as StyleSheetContext, ye as StyleSheetManager, Le as ThemeConsumer, ze as ThemeContext, Ge as ThemeProvider, Ze as __PRIVATE__, $e as createGlobalStyle, Ae as css, N as isStyledComponent, We as keyframes, Xe as useTheme, C as version, Je as withTheme };","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;","import memoize from '@emotion/memoize';\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\nexport default index;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\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\nimport * as React from 'react';\nimport styled from 'styled-components';\nimport validProp from '@emotion/is-prop-valid';\n\nfunction isValidProp(key) {\n return validProp(key);\n}\n\nfunction filterSVGProps(props) {\n return Object.keys(props).reduce(function (p, k) {\n if (isValidProp(k)) {\n // hack to satisfy TypeScript complexity\n ;\n p[k] = props[k];\n }\n\n return p;\n }, {});\n}\n\nvar StyledIconBaseBase = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var children = props.children,\n iconAttrs = props.iconAttrs,\n iconVerticalAlign = props.iconVerticalAlign,\n iconViewBox = props.iconViewBox,\n size = props.size,\n title = props.title,\n otherProps = _objectWithoutProperties(props, [\"children\", \"iconAttrs\", \"iconVerticalAlign\", \"iconViewBox\", \"size\", \"title\"]);\n\n var iconProps = _objectSpread({\n viewBox: iconViewBox,\n height: props.height !== undefined ? props.height : size,\n width: props.width !== undefined ? props.width : size,\n 'aria-hidden': title == null ? 'true' : undefined,\n focusable: 'false',\n role: title != null ? 'img' : undefined\n }, iconAttrs);\n\n var svgProps = filterSVGProps(otherProps);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, iconProps, svgProps, {\n ref: ref\n }), title && /*#__PURE__*/React.createElement(\"title\", {\n key: \"icon-title\"\n }, title), children);\n});\nexport var StyledIconBase = /*#__PURE__*/styled(StyledIconBaseBase).withConfig({\n displayName: \"StyledIconBase\",\n componentId: \"ea9ulj-0\"\n})([\"display:inline-block;vertical-align:\", \";overflow:hidden;\"], function (props) {\n return props.iconVerticalAlign;\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport { StyledIconBase } from '@styled-icons/styled-icon';\nexport var Algolia = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var attrs = {\n \"fill\": \"currentColor\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n };\n return /*#__PURE__*/React.createElement(StyledIconBase, _extends({\n iconAttrs: attrs,\n iconVerticalAlign: \"middle\",\n iconViewBox: \"0 0 448 512\"\n }, props, {\n ref: ref\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M229.3 182.6c-49.3 0-89.2 39.9-89.2 89.2 0 49.3 39.9 89.2 89.2 89.2s89.2-39.9 89.2-89.2c0-49.3-40-89.2-89.2-89.2zm62.7 56.6l-58.9 30.6c-1.8.9-3.8-.4-3.8-2.3V201c0-1.5 1.3-2.7 2.7-2.6 26.2 1 48.9 15.7 61.1 37.1.7 1.3.2 3-1.1 3.7zM389.1 32H58.9C26.4 32 0 58.4 0 90.9V421c0 32.6 26.4 59 58.9 59H389c32.6 0 58.9-26.4 58.9-58.9V90.9C448 58.4 421.6 32 389.1 32zm-202.6 84.7c0-10.8 8.7-19.5 19.5-19.5h45.3c10.8 0 19.5 8.7 19.5 19.5v15.4c0 1.8-1.7 3-3.3 2.5-12.3-3.4-25.1-5.1-38.1-5.1-13.5 0-26.7 1.8-39.4 5.5-1.7.5-3.4-.8-3.4-2.5v-15.8zm-84.4 37l9.2-9.2c7.6-7.6 19.9-7.6 27.5 0l7.7 7.7c1.1 1.1 1 3-.3 4-6.2 4.5-12.1 9.4-17.6 14.9-5.4 5.4-10.4 11.3-14.8 17.4-1 1.3-2.9 1.5-4 .3l-7.7-7.7c-7.6-7.5-7.6-19.8 0-27.4zm127.2 244.8c-70 0-126.6-56.7-126.6-126.6s56.7-126.6 126.6-126.6c70 0 126.6 56.6 126.6 126.6 0 69.8-56.7 126.6-126.6 126.6z\"\n }));\n});\nAlgolia.displayName = 'Algolia';\nexport var AlgoliaDimensions = {\n height: 512,\n width: 448\n};","import React from 'react';\nimport { Algolia } from '@styled-icons/fa-brands/Algolia';\n\nexport const PoweredBy = () => (\n <span className=\"poweredBy\">\n Powered by{` `}\n <a href=\"https://algolia.com\">\n <Algolia size=\"1em\" /> Algolia\n </a>\n </span>\n);\n","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from 'react';\nimport { StyledIconBase } from '@styled-icons/styled-icon';\nexport var Search = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var attrs = {\n \"fill\": \"currentColor\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n };\n return /*#__PURE__*/React.createElement(StyledIconBase, _extends({\n iconAttrs: attrs,\n iconVerticalAlign: \"middle\",\n iconViewBox: \"0 0 512 512\"\n }, props, {\n ref: ref\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M505 442.7 405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z\"\n }));\n});\nSearch.displayName = 'Search';\nexport var SearchDimensions = {\n height: 512,\n width: 512\n};","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});","import React from 'react';\nimport { connectSearchBox } from 'react-instantsearch-dom';\n\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/react';\nimport { Search } from '@styled-icons/fa-solid/Search';\n\nconst SearchIcon = styled(Search)`\n width: 1em;\n pointer-events: none;\n margin-right: 10px;\n position: absolute;\n left: 15px;\n color: #2fd2c5;\n`;\n\nconst focus = props => css`\n background: white;\n color: ${props => props.theme.darkBlue};\n cursor: text;\n width: 5em;\n + ${SearchIcon} {\n color: ${props => props.theme.darkBlue};\n margin: 0.3em;\n }\n`;\n\nconst collapse = props => css`\n width: 0;\n cursor: pointer;\n color: ${props => props.theme.lightBlue};\n + ${SearchIcon} {\n color: white;\n }\n ${props => props.focus && focus()}\n margin-left: ${props => (props.focus ? `-1.6em` : `-1em`)};\n padding-left: ${props => (props.focus ? `1.6em` : `1em`)};\n ::placeholder {\n color: ${props => props.theme.gray};\n }\n`;\n\nconst expand = props => css`\n background: ${props => props.theme.veryLightGray};\n width: 6em;\n margin-left: -1.6em;\n padding-left: 1.6em;\n + ${SearchIcon} {\n margin: 0.3em;\n }\n`;\n\nconst collapseExpand = props => css`\n ${props => (props.collapse ? collapse() : expand())}\n`;\n\nconst Input = styled.input`\n outline: none;\n border: none;\n font-size: 1em;\n background: white;\n transition: ${props => props.theme.shortTrans};\n border-radius: ${props => props.theme.smallBorderRadius};\n {collapseExpand}\n`;\n\nconst Form = styled.form`\n display: flex;\n align-items: center;\n @media only screen and (max-width: 767px) {\n width: 100%;\n margin-left: 15px;\n }\n`;\n\nexport default connectSearchBox(({ refine, ...rest }) => {\n const preventSubmit = e => {\n e.preventDefault();\n };\n\n return (\n <Form className={'formElement'} onSubmit={preventSubmit}>\n <SearchIcon />\n <Input\n className={'searchInput '}\n type=\"text\"\n placeholder=\"Search\"\n aria-label=\"Search\"\n onChange={e => refine(e.target.value)}\n {...rest}\n />\n </Form>\n );\n});\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 * <mark>{part.value}</mark>\n * ) : (\n * <span>{part.value}</span>\n * ));\n * }\n * );\n *\n * const Hit = ({ hit }) => (\n * <p>\n * <CustomHighlight attribute=\"name\" hit={hit} />\n * </p>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\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 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 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 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 React.createElement(\"span\", {\n key: i\n }, item.map(function (element, index) {\n return 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 && React.createElement(\"span\", {\n className: cx('separator')\n }, separator));\n }\n\n return 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 React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_highlightResult\",\n cx: cx\n }));\n};\n\nexport default Highlight;","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=',<space>'] - 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 * <div>\n * <Highlight attribute=\"name\" hit={hit} />\n * </div>\n * );\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"Pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Highlight);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Snippet');\n\nvar Snippet = function Snippet(props) {\n return React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_snippetResult\",\n cx: cx\n }));\n};\n\nexport default Snippet;","import { connectHighlight } from 'react-instantsearch-core';\nimport Snippet from '../components/Snippet';\n/**\n * Renders any attribute from an hit into its highlighted snippet form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Snippet\n * @kind widget\n * @requirements To use this widget, the attribute name passed to the `attribute` prop must be\n * present in \"Attributes to snippet\" on the Algolia dashboard or configured as `attributesToSnippet`\n * via a set settings call to the Algolia API.\n * @propType {string} attribute - location of the highlighted snippet 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 snippet attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the attribute\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Snippet - the root span of the widget\n * @themeKey ais-Snippet-highlighted - the highlighted text\n * @themeKey ais-Snippet-nonHighlighted - the normal text\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Snippet } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const Hit = ({ hit }) => (\n * <div>\n * <Snippet attribute=\"description\" hit={hit} />\n * </div>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"adjustable\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Snippet);","import React from 'react';\nimport { Highlight, Snippet } from 'react-instantsearch-dom';\nimport { Link } from 'gatsby';\n\nexport const PageHit = clickHandler => ({ hit }) => (\n <div>\n <Link to={hit.slug} onClick={clickHandler}>\n <div>\n <Highlight attribute=\"title\" hit={hit} tagName=\"mark\" />\n </div>\n </Link>\n <Snippet attribute=\"excerpt\" hit={hit} tagName=\"mark\" />\n </div>\n);\n","import React, { useState, useEffect, createRef } from 'react';\nimport {\n InstantSearch,\n Index,\n Hits,\n Configure,\n Pagination,\n connectStateResults,\n} from 'react-instantsearch-dom';\nimport algoliasearch from 'algoliasearch/lite';\nimport config from '../../../config.js';\n\nimport styled from '@emotion/styled';\nimport { css } from '@emotion/react';\nimport { PoweredBy } from './styles';\nimport { Search } from '@styled-icons/fa-solid/Search';\nimport Input from './input';\nimport * as hitComps from './hitComps';\n\nconst SearchIcon = styled(Search)`\n width: 1em;\n pointer-events: none;\n`;\n\nconst HitsWrapper = styled.div`\n display: ${props => (props.show ? `grid` : `none`)};\n max-height: 80vh;\n overflow: scroll;\n z-index: 2;\n -webkit-overflow-scrolling: touch;\n position: absolute;\n right: 0;\n top: calc(100% + 0.5em);\n width: 80vw;\n max-width: 30em;\n box-shadow: 0 0 5px 0;\n padding: 0.7em 1em 0.4em;\n background: white;\n @media only screen and (max-width: 991px) {\n width: 400px;\n max-width: 400px;\n }\n @media only screen and (max-width: 767px) {\n width: 100%;\n max-width: 500px;\n }\n border-radius: ${props => props.theme.smallBorderRadius};\n > * + * {\n padding-top: 1em !important;\n border-top: 2px solid ${props => props.theme.darkGray};\n }\n li + li {\n margin-top: 0.7em;\n padding-top: 0.7em;\n border-top: 1px solid ${props => props.theme.lightGray};\n }\n * {\n margin-top: 0;\n padding: 0;\n color: black !important;\n }\n ul {\n list-style: none;\n }\n mark {\n color: ${props => props.theme.lightBlue};\n background: ${props => props.theme.darkBlue};\n }\n header {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.3em;\n h3 {\n color: black;\n background: ${props => props.theme.gray};\n padding: 0.1em 0.4em;\n border-radius: ${props => props.theme.smallBorderRadius};\n }\n }\n h3 {\n color: black;\n margin: 0 0 0.5em;\n }\n h4 {\n color: black;\n margin-bottom: 0.3em;\n }\n`;\n\nconst Root = styled.div`\n position: relative;\n display: grid;\n grid-gap: 1em;\n @media only screen and (max-width: 767px) {\n width: 100%;\n }\n`;\n\nconst Results = connectStateResults(\n ({ searching, searchState: state, searchResults: res }) =>\n (searching && `Searching...`) || (res && res.nbHits === 0 && `No results for '${state.query}'`)\n);\n\nconst useClickOutside = (ref, handler, events) => {\n if (!events) events = [`mousedown`, `touchstart`];\n const detectClickOutside = event =>\n ref && ref.current && !ref.current.contains(event.target) && handler();\n\n useEffect(() => {\n for (const event of events) document.addEventListener(event, detectClickOutside);\n return () => {\n for (const event of events) document.removeEventListener(event, detectClickOutside);\n };\n });\n};\n\nconst searchClient = algoliasearch(\n config.header.search.algoliaAppId,\n config.header.search.algoliaSearchKey\n);\n\nexport default function SearchComponent({ indices, collapse, hitsAsGrid }) {\n const ref = createRef();\n\n const [query, setQuery] = useState(``);\n\n const [focus, setFocus] = useState(false);\n\n useClickOutside(ref, () => setFocus(false));\n const displayResult = query.length > 0 && focus ? 'showResults' : 'hideResults';\n return (\n <InstantSearch\n searchClient={searchClient}\n indexName={indices[0].name}\n onSearchStateChange={({ query }) => setQuery(query)}\n root={{ Root, props: { ref } }}\n >\n <Input onFocus={() => setFocus(true)} {...{ collapse, focus }} />\n <HitsWrapper\n className={'hitWrapper ' + displayResult}\n show={query.length > 0 && focus}\n asGrid={hitsAsGrid}\n >\n {indices.map(({ name, title, hitComp, type }) => {\n return (\n <Index key={name} indexName={name}>\n <Results />\n <Hits hitComponent={hitComps[hitComp](() => setFocus(false))} />\n </Index>\n );\n })}\n <PoweredBy />\n </HitsWrapper>\n <Configure hitsPerPage={5} />\n </InstantSearch>\n );\n}\n"],"sourceRoot":""}