-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcomponent---src-pages-search-js-38c7a04cb01ede0f6fe2.js.map
1 lines (1 loc) · 448 KB
/
component---src-pages-search-js-38c7a04cb01ede0f6fe2.js.map
1
{"version":3,"sources":["webpack:///./node_modules/algoliasearch-helper/src/requestBuilder.js","webpack:///./node_modules/algoliasearch-helper/src/version.js","webpack:///./node_modules/algoliasearch-helper/src/algoliasearch.helper.js","webpack:///./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack:///./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack:///./node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack:///./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack:///./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack:///./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack:///./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:///./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack:///./node_modules/@babel/runtime/helpers/esm/inherits.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/utils.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createWidgetsManager.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/highlight.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/indexUtils.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createInstantSearchManager.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/version.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createStore.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/context.js","webpack:///./node_modules/react-instantsearch-core/dist/es/widgets/InstantSearch.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createConnector.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectConfigure.js","webpack:///./node_modules/react-instantsearch-core/dist/es/widgets/Configure.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectSearchBox.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/translatable.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/core/utils.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/SearchBox.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/SearchBox.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectStats.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Stats.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Stats.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectHits.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Hits.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Hits.js","webpack:///./src/components/Search/Hit.js","webpack:///./node_modules/@styled-icons/fa-brands/Algolia/Algolia.esm.js","webpack:///./src/components/Search/styled.js","webpack:///./src/components/Search/index.js","webpack:///./src/pages/search.js","webpack:///./node_modules/algoliasearch-helper/src/functions/formatSort.js","webpack:///./node_modules/algoliasearch/dist/algoliasearch-lite.umd.js","webpack:///./node_modules/react-instantsearch-core/node_modules/react-fast-compare/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/merge.js","webpack:///./node_modules/algoliasearch-helper/src/functions/find.js","webpack:///./node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","webpack:///./node_modules/gatsby/node_modules/core-js/modules/es6.reflect.own-keys.js","webpack:///./node_modules/algoliasearch-helper/src/DerivedHelper/index.js","webpack:///./node_modules/algoliasearch-helper/index.js","webpack:///./node_modules/gatsby/node_modules/core-js/modules/es7.object.entries.js","webpack:///./node_modules/gatsby/node_modules/core-js/modules/es6.array.reduce-right.js","webpack:///./node_modules/algoliasearch-helper/src/functions/inherits.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/algoliasearch-helper/src/SearchParameters/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/intersection.js","webpack:///./node_modules/algoliasearch-helper/src/functions/compact.js","webpack:///./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack:///./src/components/Post/styled.js","webpack:///./src/components/Post/index.js","webpack:///./node_modules/gatsby/node_modules/core-js/modules/es6.reflect.apply.js","webpack:///./node_modules/node-libs-browser/node_modules/events/events.js","webpack:///./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","webpack:///./node_modules/gatsby/node_modules/core-js/modules/es6.number.is-nan.js","webpack:///./node_modules/algoliasearch-helper/src/functions/defaultsPure.js","webpack:///./node_modules/algoliasearch-helper/src/SearchResults/generate-hierarchical-tree.js","webpack:///./node_modules/algoliasearch-helper/src/functions/valToNumber.js","webpack:///./node_modules/algoliasearch-helper/src/functions/findIndex.js","webpack:///./node_modules/algoliasearch-helper/src/functions/omit.js","webpack:///./node_modules/algoliasearch-helper/src/SearchResults/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/orderBy.js"],"names":["merge","requestBuilder","_getQueries","index","state","queries","push","indexName","params","_getHitsSearchParams","getRefinedDisjunctiveFacets","forEach","refinedFacet","_getDisjunctiveFacetSearchParams","getRefinedHierarchicalFacets","hierarchicalFacet","getHierarchicalFacetByName","currentRefinement","getHierarchicalRefinement","separator","_getHierarchicalFacetSeparator","length","split","facets","concat","disjunctiveFacets","_getHitsHierarchicalFacetsAttributes","facetFilters","_getFacetFilters","numericFilters","_getNumericFilters","additionalParams","tagFilters","_getTagFilters","getQueryParams","facet","hierarchicalRootLevel","hitsPerPage","page","attributesToRetrieve","attributesToHighlight","attributesToSnippet","analytics","clickAnalytics","_getDisjunctiveHierarchicalFacetAttribute","facetName","Object","keys","numericRefinements","attribute","operators","operator","values","value","Array","isArray","vs","map","v","tagRefinements","join","facetsRefinements","facetValue","facetsExcludes","disjunctiveFacetsRefinements","facetValues","orFilters","hierarchicalFacetsRefinements","undefined","attributeToRefine","attributesIndex","rootPath","_getHierarchicalRootPath","indexOf","slice","lastIndexOf","attributes","hierarchicalFacets","reduce","allAttributes","hierarchicalRefinement","name","level","newAttributes","rootLevel","attributeIndex","parentLevel","getSearchForFacetQuery","query","maxFacetHits","stateForSearchForFacetValues","isDisjunctiveFacet","clearRefinements","searchForFacetSearchParameters","facetQuery","module","exports","SearchParameters","SearchResults","DerivedHelper","events","inherits","objectHasKeys","version","AlgoliaSearchHelper","client","options","addAlgoliaAgent","this","setClient","opts","make","lastResults","_queryId","_lastQueryIdReceived","derivedHelpers","_currentNbQueries","setCurrentPage","Error","_change","setPage","isPageReset","getCurrentPage","EventEmitter","prototype","search","_search","onlyWithDerivedHelpers","searchOnlyWithDerivedHelpers","getQuery","searchOnce","cb","tempState","setQueryParameters","self","emit","then","content","results","_originalResponse","e","err","searchForFacetValues","userState","clientHasSFFV","initIndex","isDisjunctive","algoliaQuery","facetHits","f","isRefined","isDisjunctiveFacetRefined","isFacetRefined","setQuery","q","resetPage","clearTags","addDisjunctiveFacetRefinement","addDisjunctiveRefine","apply","arguments","addHierarchicalFacetRefinement","addNumericRefinement","addFacetRefinement","addRefine","addFacetExclusion","addExcludeRefinement","addExclude","addTag","tag","addTagRefinement","removeNumericRefinement","removeDisjunctiveFacetRefinement","removeDisjunctiveRefine","removeHierarchicalFacetRefinement","removeFacetRefinement","removeRefine","removeFacetExclusion","removeExcludeRefinement","removeExclude","removeTag","removeTagRefinement","toggleFacetExclusion","toggleExcludeFacetRefinement","toggleExclude","toggleRefinement","toggleFacetRefinement","toggleRefine","toggleTag","toggleTagRefinement","nextPage","previousPage","setIndex","setQueryParameter","parameter","setState","newState","overrideStateWithoutTriggeringChangeEvent","hasRefinements","getNumericRefinements","isConjunctiveFacet","isHierarchicalFacet","isHierarchicalFacetRefined","isExcluded","isExcludeRefined","isDisjunctiveRefined","hasTag","isTagRefined","hasTagRefinements","getIndex","getPage","getTags","getRefinements","refinements","getConjunctiveRefinements","r","type","getExcludeRefinements","getDisjunctiveRefinements","getNumericRefinement","getHierarchicalFacetBreadcrumb","states","mainQueries","queriesCount","helper","derivedQueries","derivedHelper","derivedState","getModifiedState","derivedStateQueries","queryId","_dispatchAlgoliaResponse","bind","_dispatchAlgoliaError","error","s","specificResults","splice","formattedResponse","containsRefinement","_hasDisjunctiveRefinements","disjunctiveRefinements","event","clearCache","newClient","getClient","derive","fn","detachDerivedHelper","pos","hasPendingRequests","_unsupportedIterableToArray","o","minLen","n","toString","call","constructor","from","test","_defineProperty","obj","key","defineProperty","enumerable","configurable","writable","_objectSpread","target","i","source","ownKeys","getOwnPropertySymbols","filter","sym","getOwnPropertyDescriptor","_classCallCheck","instance","Constructor","TypeError","_typeof","Symbol","iterator","_assertThisInitialized","ReferenceError","_possibleConstructorReturn","_getPrototypeOf","setPrototypeOf","getPrototypeOf","__proto__","_defineProperties","props","descriptor","_createClass","protoProps","staticProps","_setPrototypeOf","p","_inherits","subClass","superClass","create","_objectWithoutProperties","excluded","sourceKeys","sourceSymbolKeys","propertyIsEnumerable","shallowEqual","objA","objB","keysA","keysB","hasOwn","hasOwnProperty","resolved","Promise","resolve","removeEmptyKey","object","omit","_key","createWidgetsManager","onWidgetsUpdate","widgets","scheduled","scheduleUpdate","registerWidget","widget","update","getWidgets","HIGHLIGHT_TAGS","highlightPreTag","highlightPostTag","getIndexId","context","hasMultipleIndices","multiIndexContext","targetedIndex","ais","mainTargetedIndex","getResults","searchResults","hits","indexId","refineValue","searchState","nextRefinement","namespace","_objectSpread4","indices","refineMultiIndexWithNamespace","refineMultiIndex","refineSingleIndexWithNamespace","refineSingleIndex","getNamespaceAndAttributeName","id","parts","match","attributeName","getCurrentRefinementValue","defaultValue","_getNamespaceAndAttri","args","multiIndex","_ref","_ref2","defaultRefinement","cleanUpValue","_getNamespaceAndAttri2","Boolean","_ref4","indexSearchState","cleanUpValueWithMultiIndex","_ref3","cleanUpValueWithSingleIndex","addAlgoliaAgents","searchClient","contextValue","indexContextValue","isTargetedIndexEqualIndex","isIndexWidget","isIndexWidgetEqualIndex","sortIndexWidgetsFirst","firstWidget","secondWidget","serializeQueryParameters","parameters","format","_len","replace","encodeURIComponent","encode","JSON","stringify","createInstantSearchManager","_ref$initialState","initialState","resultsState","stalledSearchDelay","on","stalledSearchTimer","setTimeout","_store$getState","store","getState","partialState","resultsFacetValues","isSearchStalled","handleSearchSuccess","handleSearchError","skip","initialSearchParameters","widgetsManager","metadata","getMetadata","searching","transporter","_useCache","baseMethod","requests","_len2","methodArgs","_key2","requestsWithSerializedParams","request","responsesCache","get","method","set","acc","result","rawResults","cache","hydrateSearchClientWithMultiIndexRequest","hydrateSearchClientWithSingleIndexRequest","hydrateSearchClient","listeners","nextState","listener","subscribe","createStore","_internalIndexId","a","hydrateResultsState","searchingForFacetValues","getSearchParameters","sharedParameters","res","mainParameters","targetedIndexEqualMainIndex","subIndexEqualMainIndex","sort","derivedIndices","targetedIndexNotEqualMainIndex","subIndexNotEqualMainIndex","derivedParameters","_getSearchParameters","detach","isDerivedHelpersEmpty","getFacetByName","currentState","nextIsSearchStalled","clearTimeout","getWidgetsIds","meta","onSearchForFacetValues","_ref5","_ref5$maxFacetHits","maxFacetHitsWithinRange","Math","max","min","_objectSpread6","onExternalStateUpdate","nextSearchState","transitionState","updateClient","updateIndex","newIndex","skipSearch","_createContext","onInternalStateUpdate","createHrefForState","onSearchStateChange","onSearchParameters","InstantSearchConsumer","Consumer","InstantSearchProvider","Provider","_createContext2","IndexConsumer","isControlled","_Component","InstantSearch","_this","instantSearchManager","onWidgetsInternalStateUpdate","nextProps","prevState","nextIsControlled","previousSearchState","prevProps","prevIsControlled","refresh","isUnmounting","createURL","getKnownKeys","_searchState","count","children","createElement","string","isRequired","shape","func","bool","oneOfType","array","node","number","_extends","assign","createConnector","connectorDesc","Composed","Connector","displayName","isWidget","Component","providedProps","getProvidedProps","refine","_len3","_key3","_this2","unsubscribe","unregisterWidget","shouldComponentUpdate","propsEqual","cleanUp","_this$props$contextVa","searchParameters","nextWidgetsState","prevWidgetsState","_this$props","refineProps","searchForFacetValuesProps","searchForItems","propTypes","defaultProps","createConnectorWithoutContext","items","prevSearchState","propKeys","nonPresentKeys","_props","prop","subState","configureState","item","getCurrentRefinement","_refine","_cleanUp","label","translatable","defaultTranslations","Translatable","_getPrototypeOf2","translations","translation","translate","propName","componentName","_i","_Object$keys","block","prefix","elements","suitElements","element","baseClassName","cx","defaultLoadingIndicator","width","height","viewBox","xmlns","stroke","className","fill","fillRule","transform","strokeWidth","strokeOpacity","cy","d","to","dur","repeatCount","defaultReset","defaultSubmit","SearchBox","searchAsYouType","input","__inputRef","focusShortcuts","shortcuts","toUpperCase","charCodeAt","elt","srcElement","tagName","isContentEditable","which","keyCode","focus","stopPropagation","preventDefault","blur","_this$props2","onChange","_this$props3","onReset","document","addEventListener","onKeyDown","removeEventListener","_this$props4","autoFocus","loadingIndicator","submit","reset","searchInputEvents","toLowerCase","showLoadingIndicator","noValidate","onSubmit","action","role","ref","onInputMount","placeholder","autoComplete","autoCorrect","autoCapitalize","spellCheck","required","maxLength","title","hidden","arrayOf","connectSearchBox","resetTitle","submitTitle","nbHits","processingTimeMS","Stats","connectStats","stats","ms","toLocaleString","queryID","hit","__queryID","addQueryID","__position","style","borderBottom","paddingBottom","marginBottom","wordBreak","_ref$className","_ref$hitComponent","hitComponent","HitComponent","objectID","HitPropTypes","connectHits","Hit","console","log","Post","slug","date","description","main_class","Algolia","iconAttrs","iconVerticalAlign","iconViewBox","SearchWrapper","styled","section","media","lessThan","SearchTitle","h1","AlgoliaIcon","Search","algoliasearch","algolia","appId","searchOnlyApiKey","Configure","distinct","timeSpentMS","process","GATSBY_ALGOLIA_APP_ID","GATSBY_ALGOLIA_SEARCH_ONLY_KEY","GATSBY_ALGOLIA_INDEX_NAME","SearchPage","Layout","find","sortBy","defaults","defaultInstructions","out","sortInstruction","matchingDefault","defaultInstruction","t","getOwnPropertyDescriptors","defineProperties","u","next","done","localStorage","window","parse","getItem","miss","all","setItem","clear","removeItem","caches","shift","serializable","c","floor","random","l","h","data","entries","timeout","headers","queryParameters","cacheable","m","Read","Write","Any","y","status","lastUpdate","Date","now","b","protocol","url","accept","P","j","userAgent","pop","message","transporterStackTrace","A","w","path","connectTimeout","timeouts","connect","responseTimeout","response","host","triesLeft","onSucess","onRetry","isTimedOut","logger","info","x","hostsCache","onFail","requester","send","getTimeout","statelessHosts","reverse","S","add","segment","T","charAt","substr","C","authMode","apiKey","requestsCache","hosts","read","mappedRequestOptions","reject","write","methods","N","k","J","I","E","W","XMLHttpRequest","open","setRequestHeader","abort","onreadystatechange","readyState","OPENED","onerror","responseText","onload","debug","multipleQueries","multipleSearchForFacetValues","hasElementType","Element","hasMap","Map","hasSet","Set","hasArrayBuffer","ArrayBuffer","equal","it","size","has","isView","RegExp","flags","valueOf","$$typeof","warn","isObjectOrArrayOrFunction","_merge","sourceVal","targetVal","comparator","defaultsPure","lib","addRefinement","refinementList","valueAsString","facetRefinement","mod","removeRefinement","clearRefinement","refinementType","hasChanged","newRefinementList","memo","facetList","refinementValue","containsRefinements","refinementValueAsString","$export","mainHelper","main","removeAllListeners","algoliasearchHelper","$entries","$reduce","F","reduceRight","callbackfn","ctor","superCtor","classNames","classes","arg","argType","inner","intersection","valToNumber","RefinementList","isEqualNumericRefinement","every","el","newParameters","_parseNumbers","paramName","isKeyKnown","PARAMETERS","isValueDefined","numbers","parsedValue","parseFloat","isNaN","insideBoundingBox","geoRect","parsedValues","vPrime","toggleHierarchicalFacetRefinement","validate","patch","_clearNumericRefinements","newQuery","newPage","setFacets","setDisjunctiveFacets","setHitsPerPage","setTypoTolerance","typoTolerance","isNumericRefined","paramValue","op","val","newNumericRefinements","operatorList","outValues","addFacet","addDisjunctiveFacet","addHierarchicalFacet","modification","removeFacet","removeDisjunctiveFacet","removeHierarchicalFacet","toggleConjunctiveFacetRefinement","toggleDisjunctiveFacetRefinement","isOperatorDefined","searchedValue","isAttributeValueDefined","currentValue","disjunctiveNumericRefinedFacets","getUnrefinedDisjunctiveFacets","refinedFacets","managedParameters","queryParams","nextWithNumbers","previousPlainObject","nextPlainObject","previous","isPreviousValueDefined","isNextValueDefined","_getHierarchicalFacetSortBy","_getHierarchicalShowParentLevel","showParentLevel","hierarchicalFacetName","refinement","part","trim","arr1","arr2","_arrayLikeToArray","arr","len","PostWrapper","transitions","ALL","PostLink","AniLink","COLOR","PostTag","div","PostInfo","PostDate","time","PostTitle","PostDescription","h2","timeToRead","disableCard","cover","direction","bg","getThemeColor","aFunction","anObject","rApply","Reflect","fApply","Function","thisArgument","argumentsList","L","ReflectOwnKeys","R","ReflectApply","receiver","getOwnPropertyNames","NumberIsNaN","Number","init","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","_getMaxListeners","that","_addListener","prepend","existing","warning","newListener","unshift","warned","String","emitter","onceWrapper","fired","removeListener","wrapFn","_onceWrap","wrapped","_listeners","unwrap","evlistener","ret","unwrapListeners","arrayClone","listenerCount","copy","RangeError","setMaxListeners","getMaxListeners","doError","er","handler","addListener","prependListener","once","prependOnceListener","list","position","originalListener","spliceOne","off","rawListeners","eventNames","sources","hierarchicalFacetResult","hierarchicalFacetIndex","hierarchicalFacetRefinement","hierarchicalSeparator","hierarchicalRootPath","hierarchicalShowParentLevel","prepareHierarchicalFacetSortBy","rootExhaustive","facetResult","exhaustive","generateTreeFn","hierarchicalTree","currentHierarchicalLevel","parent","subtree","picked","tuple","parentPath","onlyMatchingTree","orderBy","facetCount","generateHierarchicalTree","compact","findIndex","formatSort","getIndices","idx","assignFacetStats","dest","facetStats","mainSubResponse","_rawResults","parsedQuery","nbPages","sum","aroundLatLng","automaticRadius","serverUsed","timeoutCounts","timeoutHits","exhaustiveFacetsCount","exhaustiveNbHits","userData","facetsIndices","disjunctiveFacetsIndices","nextDisjunctiveResult","mainFacets","facetKey","hierarchicalAttributeName","facetValueObject","facetIndex","idxAttributeName","isFacetDisjunctive","isFacetConjunctive","facets_stats","disjunctiveFacet","dfacet","facetResults","dataFromMainRequest","defaultData","root","excludes","_state","recSort","sortFn","childNode","sortedChildren","getFacetStatsIfAvailable","getRefinement","resultsFacets","predicate","DEFAULT_SORT","getFacetValues","extractNormalizedFacetValues","order","hierarchicalFacetValues","vanillaSortFn","getFacetStats","facetDeclaration","rootFacet","intermediateFacet","newFacet","numericValue","compareAscending","other","valIsDefined","valIsNull","othIsDefined","othIsNull","collection","iteratees","orders","criteria","iteratee"],"mappings":"6FAEA,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,EAAQ,QAER,IAAIA,EAAQ,EAAQ,QAEhBC,EAAiB,CAOnBC,YAAa,SAAoBC,EAAOC,GACtC,IAAIC,EAAU,GA4Bd,OA1BAA,EAAQC,KAAK,CACXC,UAAWJ,EACXK,OAAQP,EAAeQ,qBAAqBL,KAG9CA,EAAMM,8BAA8BC,SAAQ,SAAUC,GACpDP,EAAQC,KAAK,CACXC,UAAWJ,EACXK,OAAQP,EAAeY,iCAAiCT,EAAOQ,QAInER,EAAMU,+BAA+BH,SAAQ,SAAUC,GACrD,IAAIG,EAAoBX,EAAMY,2BAA2BJ,GACrDK,EAAoBb,EAAMc,0BAA0BN,GAGpDO,EAAYf,EAAMgB,+BAA+BL,GAEjDE,EAAkBI,OAAS,GAAKJ,EAAkB,GAAGK,MAAMH,GAAWE,OAAS,GACjFhB,EAAQC,KAAK,CACXC,UAAWJ,EACXK,OAAQP,EAAeY,iCAAiCT,EAAOQ,GAAc,QAI5EP,GAQTI,qBAAsB,SAA8BL,GAClD,IAAImB,EAASnB,EAAMmB,OAAOC,OAAOpB,EAAMqB,mBAAmBD,OAAOvB,EAAeyB,qCAAqCtB,IAEjHuB,EAAe1B,EAAe2B,iBAAiBxB,GAE/CyB,EAAiB5B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,MAAQmmC,EAAMnmC,SAEvB2a,EAAOrX,KAAI,SAAUsY,GAC1B,OAAOA,EAAI1Y","file":"component---src-pages-search-js-38c7a04cb01ede0f6fe2.js","sourcesContent":["'use strict';\n\nrequire(\"core-js/modules/es6.function.name\");\n\nrequire(\"core-js/modules/es6.array.reduce\");\n\nrequire(\"core-js/modules/es6.array.last-index-of\");\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\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 = '3.1.1';","'use strict';\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.function.bind\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/es6.regexp.search\");\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 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 * 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;","import arrayLikeToArray from \"./arrayLikeToArray\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\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 _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\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}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose\";\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}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.date.to-string\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/es6.array.reduce\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.array.map\";\nimport \"core-js/modules/es6.array.for-each\";\nimport \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.promise\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.keys\";\nimport _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 \"core-js/modules/es6.array.index-of\";\nimport { 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 \"core-js/modules/es6.array.map\";\nimport \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.array.for-each\";\nimport \"core-js/modules/es6.regexp.split\";\nimport { 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 \"core-js/modules/es6.regexp.match\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.array.for-each\";\nimport _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 \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.regexp.search\";\nimport \"core-js/modules/es6.array.for-each\";\nimport \"core-js/modules/es6.array.sort\";\nimport \"core-js/modules/es6.array.reduce\";\nimport \"core-js/modules/es6.array.filter\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.array.map\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.date.to-string\";\nimport \"core-js/modules/es6.object.to-string\";\nimport _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 if (isIndexWidget(firstWidget)) {\n return -1;\n }\n\n if (isIndexWidget(secondWidget)) {\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: [],\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[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._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) {\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)) {\n hydrateSearchClientWithMultiIndexRequest(client, 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)) {\n return 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 _objectSpread6;\n\n store.setState(_objectSpread({}, store.getState(), {\n error: null,\n searchingForFacetValues: false,\n resultsFacetValues: _objectSpread({}, store.getState().resultsFacetValues, (_objectSpread6 = {}, _defineProperty(_objectSpread6, facetName, content.facetHits), _defineProperty(_objectSpread6, \"query\", query), _objectSpread6))\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}","export default '6.4.0';","import \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.array.for-each\";\nexport 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 { createContext } from 'react';\n\nvar _createContext = 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}),\n InstantSearchConsumer = _createContext.Consumer,\n InstantSearchProvider = _createContext.Provider;\n\nexport { InstantSearchConsumer, InstantSearchProvider };\n\nvar _createContext2 = createContext(undefined),\n IndexConsumer = _createContext2.Consumer,\n IndexProvider = _createContext2.Provider;\n\nexport { IndexConsumer, IndexProvider };","import \"core-js/modules/es6.function.bind\";\nimport _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) {\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 }, {\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 resultsState: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),\n children: PropTypes.node,\n stalledSearchDelay: PropTypes.number\n});\n\nexport default InstantSearch;","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import \"core-js/modules/es6.function.bind\";\nimport _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);\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 \"core-js/modules/es6.array.reduce\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.array.filter\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.keys\";\nimport _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});","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 \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.keys\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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';\n\nvar withKeysPropType = function withKeysPropType(keys) {\n return function (props, propName, componentName) {\n var prop = props[propName];\n\n if (prop) {\n for (var _i = 0, _Object$keys = Object.keys(prop); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n\n if (keys.indexOf(key) === -1) {\n return new Error(\"Unknown `\".concat(propName, \"` key `\").concat(key, \"`. Check the render method \") + \"of `\".concat(componentName, \"`.\"));\n }\n }\n }\n\n return undefined;\n };\n};\n\nexport default function translatable(defaultTranslations) {\n return function (Composed) {\n var Translatable = /*#__PURE__*/function (_Component) {\n _inherits(Translatable, _Component);\n\n function Translatable() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, Translatable);\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 = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Translatable)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"translate\", function (key) {\n var translations = _this.props.translations;\n var translation = translations && translations.hasOwnProperty(key) ? translations[key] : defaultTranslations[key];\n\n if (typeof translation === 'function') {\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n return translation.apply(void 0, params);\n }\n\n return translation;\n });\n\n return _this;\n }\n\n _createClass(Translatable, [{\n key: \"render\",\n value: function render() {\n return React.createElement(Composed, _extends({\n translate: this.translate\n }, this.props));\n }\n }]);\n\n return Translatable;\n }(Component);\n\n var name = Composed.displayName || Composed.name || 'UnknownComponent';\n Translatable.displayName = \"Translatable(\".concat(name, \")\");\n Translatable.propTypes = {\n translations: withKeysPropType(Object.keys(defaultTranslations))\n };\n return Translatable;\n };\n}","import \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.array.filter\";\nimport \"core-js/modules/es6.array.map\";\nimport _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 \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.array.iterator\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.keys\";\nimport \"core-js/modules/es6.array.reduce\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.array.map\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\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 PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('SearchBox');\nvar defaultLoadingIndicator = React.createElement(\"svg\", {\n width: \"18\",\n height: \"18\",\n viewBox: \"0 0 38 38\",\n xmlns: \"http://www.w3.org/2000/svg\",\n stroke: \"#444\",\n className: cx('loadingIcon')\n}, React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n}, React.createElement(\"g\", {\n transform: \"translate(1 1)\",\n strokeWidth: \"2\"\n}, React.createElement(\"circle\", {\n strokeOpacity: \".5\",\n cx: \"18\",\n cy: \"18\",\n r: \"18\"\n}), React.createElement(\"path\", {\n d: \"M36 18c0-9.94-8.06-18-18-18\"\n}, React.createElement(\"animateTransform\", {\n attributeName: \"transform\",\n type: \"rotate\",\n from: \"0 18 18\",\n to: \"360 18 18\",\n dur: \"1s\",\n repeatCount: \"indefinite\"\n})))));\nvar defaultReset = React.createElement(\"svg\", {\n className: cx('resetIcon'),\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n width: \"10\",\n height: \"10\"\n}, React.createElement(\"path\", {\n d: \"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z\"\n}));\nvar defaultSubmit = React.createElement(\"svg\", {\n className: cx('submitIcon'),\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"10\",\n height: \"10\",\n viewBox: \"0 0 40 40\"\n}, React.createElement(\"path\", {\n d: \"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z\"\n}));\n\nvar SearchBox = /*#__PURE__*/function (_Component) {\n _inherits(SearchBox, _Component);\n\n function SearchBox(props) {\n var _this;\n\n _classCallCheck(this, SearchBox);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(SearchBox).call(this));\n\n _defineProperty(_assertThisInitialized(_this), \"getQuery\", function () {\n return _this.props.searchAsYouType ? _this.props.currentRefinement : _this.state.query;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onInputMount\", function (input) {\n _this.input = input;\n\n if (_this.props.__inputRef) {\n _this.props.__inputRef(input);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onKeyDown\", function (e) {\n if (!_this.props.focusShortcuts) {\n return;\n }\n\n var shortcuts = _this.props.focusShortcuts.map(function (key) {\n return typeof key === 'string' ? key.toUpperCase().charCodeAt(0) : key;\n });\n\n var elt = e.target || e.srcElement;\n var tagName = elt.tagName;\n\n if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {\n // already in an input\n return;\n }\n\n var which = e.which || e.keyCode;\n\n if (shortcuts.indexOf(which) === -1) {\n // not the right shortcut\n return;\n }\n\n _this.input.focus();\n\n e.stopPropagation();\n e.preventDefault();\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onSubmit\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n _this.input.blur();\n\n var _this$props = _this.props,\n refine = _this$props.refine,\n searchAsYouType = _this$props.searchAsYouType;\n\n if (!searchAsYouType) {\n refine(_this.getQuery());\n }\n\n return false;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (event) {\n var _this$props2 = _this.props,\n searchAsYouType = _this$props2.searchAsYouType,\n refine = _this$props2.refine,\n onChange = _this$props2.onChange;\n var value = event.target.value;\n\n if (searchAsYouType) {\n refine(value);\n } else {\n _this.setState({\n query: value\n });\n }\n\n if (onChange) {\n onChange(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onReset\", function (event) {\n var _this$props3 = _this.props,\n searchAsYouType = _this$props3.searchAsYouType,\n refine = _this$props3.refine,\n onReset = _this$props3.onReset;\n refine('');\n\n _this.input.focus();\n\n if (!searchAsYouType) {\n _this.setState({\n query: ''\n });\n }\n\n if (onReset) {\n onReset(event);\n }\n });\n\n _this.state = {\n query: props.searchAsYouType ? null : props.currentRefinement\n };\n return _this;\n }\n\n _createClass(SearchBox, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n document.addEventListener('keydown', this.onKeyDown);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('keydown', this.onKeyDown);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (!this.props.searchAsYouType && prevProps.currentRefinement !== this.props.currentRefinement) {\n this.setState({\n query: this.props.currentRefinement\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props4 = this.props,\n className = _this$props4.className,\n translate = _this$props4.translate,\n autoFocus = _this$props4.autoFocus,\n loadingIndicator = _this$props4.loadingIndicator,\n submit = _this$props4.submit,\n reset = _this$props4.reset;\n var query = this.getQuery();\n var searchInputEvents = Object.keys(this.props).reduce(function (props, prop) {\n if (['onsubmit', 'onreset', 'onchange'].indexOf(prop.toLowerCase()) === -1 && prop.indexOf('on') === 0) {\n return _objectSpread({}, props, _defineProperty({}, prop, _this2.props[prop]));\n }\n\n return props;\n }, {});\n var isSearchStalled = this.props.showLoadingIndicator && this.props.isSearchStalled;\n /* eslint-disable max-len */\n\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"form\", {\n noValidate: true,\n onSubmit: this.props.onSubmit ? this.props.onSubmit : this.onSubmit,\n onReset: this.onReset,\n className: cx('form', isSearchStalled && 'form--stalledSearch'),\n action: \"\",\n role: \"search\"\n }, React.createElement(\"input\", _extends({\n ref: this.onInputMount,\n type: \"search\",\n placeholder: translate('placeholder'),\n autoFocus: autoFocus,\n autoComplete: \"off\",\n autoCorrect: \"off\",\n autoCapitalize: \"off\",\n spellCheck: \"false\",\n required: true,\n maxLength: \"512\",\n value: query,\n onChange: this.onChange\n }, searchInputEvents, {\n className: cx('input')\n })), React.createElement(\"button\", {\n type: \"submit\",\n title: translate('submitTitle'),\n className: cx('submit')\n }, submit), React.createElement(\"button\", {\n type: \"reset\",\n title: translate('resetTitle'),\n className: cx('reset'),\n hidden: !query || isSearchStalled\n }, reset), this.props.showLoadingIndicator && React.createElement(\"span\", {\n hidden: !isSearchStalled,\n className: cx('loadingIndicator')\n }, loadingIndicator)));\n /* eslint-enable */\n }\n }]);\n\n return SearchBox;\n}(Component);\n\n_defineProperty(SearchBox, \"propTypes\", {\n currentRefinement: PropTypes.string,\n className: PropTypes.string,\n refine: PropTypes.func.isRequired,\n translate: PropTypes.func.isRequired,\n loadingIndicator: PropTypes.node,\n reset: PropTypes.node,\n submit: PropTypes.node,\n focusShortcuts: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n autoFocus: PropTypes.bool,\n searchAsYouType: PropTypes.bool,\n onSubmit: PropTypes.func,\n onReset: PropTypes.func,\n onChange: PropTypes.func,\n isSearchStalled: PropTypes.bool,\n showLoadingIndicator: PropTypes.bool,\n // For testing purposes\n __inputRef: PropTypes.func\n});\n\n_defineProperty(SearchBox, \"defaultProps\", {\n currentRefinement: '',\n className: '',\n focusShortcuts: ['s', '/'],\n autoFocus: false,\n searchAsYouType: true,\n showLoadingIndicator: false,\n isSearchStalled: false,\n loadingIndicator: defaultLoadingIndicator,\n reset: defaultReset,\n submit: defaultSubmit\n});\n\nexport default translatable({\n resetTitle: 'Clear the search query.',\n submitTitle: 'Submit your search query.',\n placeholder: 'Search here…'\n})(SearchBox);","import { connectSearchBox } from 'react-instantsearch-core';\nimport SearchBox from '../components/SearchBox';\n/**\n * The SearchBox component displays a search box that lets the user search for a specific query.\n * @name SearchBox\n * @kind widget\n * @propType {string[]} [focusShortcuts=['s','/']] - List of keyboard shortcuts that focus the search box. Accepts key names and key codes.\n * @propType {boolean} [autoFocus=false] - Should the search box be focused on render?\n * @propType {boolean} [searchAsYouType=true] - Should we search on every change to the query? If you disable this option, new searches will only be triggered by clicking the search button or by pressing the enter key while the search box is focused.\n * @propType {function} [onSubmit] - Intercept submit event sent from the SearchBox form container.\n * @propType {function} [onReset] - Listen to `reset` event sent from the SearchBox form container.\n * @propType {function} [on*] - Listen to any events sent from the search input itself.\n * @propType {node} [submit] - Change the apparence of the default submit button (magnifying glass).\n * @propType {node} [reset] - Change the apparence of the default reset button (cross).\n * @propType {node} [loadingIndicator] - Change the apparence of the default loading indicator (spinning circle).\n * @propType {string} [defaultRefinement] - Provide default refinement value when component is mounted.\n * @propType {boolean} [showLoadingIndicator=false] - Display that the search is loading. This only happens after a certain amount of time to avoid a blinking effect. This timer can be configured with `stalledSearchDelay` props on <InstantSearch>. By default, the value is 200ms.\n * @themeKey ais-SearchBox - the root div of the widget\n * @themeKey ais-SearchBox-form - the wrapping form\n * @themeKey ais-SearchBox-input - the search input\n * @themeKey ais-SearchBox-submit - the submit button\n * @themeKey ais-SearchBox-submitIcon - the default magnifier icon used with the search input\n * @themeKey ais-SearchBox-reset - the reset button used to clear the content of the input\n * @themeKey ais-SearchBox-resetIcon - the default reset icon used inside the reset button\n * @themeKey ais-SearchBox-loadingIndicator - the loading indicator container\n * @themeKey ais-SearchBox-loadingIcon - the default loading icon\n * @translationkey submitTitle - The submit button title\n * @translationkey resetTitle - The reset button title\n * @translationkey placeholder - The label of the input placeholder\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox } 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 * </InstantSearch>\n * );\n */\n\nexport default connectSearchBox(SearchBox);","import createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\n/**\n * connectStats connector provides the logic to build a widget that will\n * displays algolia search statistics (hits number and processing time).\n * @name connectStats\n * @kind connector\n * @providedPropType {number} nbHits - number of hits returned by Algolia.\n * @providedPropType {number} processingTimeMS - the time in ms took by Algolia to search for results.\n */\n\nexport default createConnector({\n displayName: 'AlgoliaStats',\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 null;\n }\n\n return {\n nbHits: results.nbHits,\n processingTimeMS: results.processingTimeMS\n };\n }\n});","import _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 _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { translatable } from 'react-instantsearch-core';\nimport { createClassNames } from '../core/utils';\nvar cx = createClassNames('Stats');\n\nvar Stats = /*#__PURE__*/function (_Component) {\n _inherits(Stats, _Component);\n\n function Stats() {\n _classCallCheck(this, Stats);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(Stats).apply(this, arguments));\n }\n\n _createClass(Stats, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n translate = _this$props.translate,\n nbHits = _this$props.nbHits,\n processingTimeMS = _this$props.processingTimeMS,\n className = _this$props.className;\n return React.createElement(\"div\", {\n className: classNames(cx(''), className)\n }, React.createElement(\"span\", {\n className: cx('text')\n }, translate('stats', nbHits, processingTimeMS)));\n }\n }]);\n\n return Stats;\n}(Component);\n\n_defineProperty(Stats, \"propTypes\", {\n translate: PropTypes.func.isRequired,\n nbHits: PropTypes.number.isRequired,\n processingTimeMS: PropTypes.number.isRequired,\n className: PropTypes.string\n});\n\n_defineProperty(Stats, \"defaultProps\", {\n className: ''\n});\n\nexport default translatable({\n stats: function stats(n, ms) {\n return \"\".concat(n.toLocaleString(), \" results found in \").concat(ms.toLocaleString(), \"ms\");\n }\n})(Stats);","import { connectStats } from 'react-instantsearch-core';\nimport Stats from '../components/Stats';\n/**\n * The Stats component displays the total number of matching hits and the time it took to get them (time spent in the Algolia server).\n * @name Stats\n * @kind widget\n * @themeKey ais-Stats - the root div of the widget\n * @themeKey ais-Stats-text - the text of the widget - the count of items for each item\n * @translationkey stats - The string displayed by the stats widget. You get function(n, ms) and you need to return a string. n is a number of hits retrieved, ms is a processed time.\n * @example\n * import React from 'react';\n * import { InstantSearch, Stats, Hits } from 'react-instantsearch-dom';\n * import algoliasearch from 'algoliasearch/lite';\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 * <Stats />\n * <Hits />\n * </InstantSearch>\n * );\n */\n\nexport default connectStats(Stats);","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 \"core-js/modules/es6.array.map\";\nimport 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});\nHits.propTypes = {\n hits: PropTypes.arrayOf(HitPropTypes.isRequired).isRequired,\n className: PropTypes.string,\n hitComponent: PropTypes.func\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 React from 'react'\nimport PropTypes from 'prop-types'\n\nimport Post from '../Post'\n\nconst Hit = props => {\n const { hit } = props\n console.log(hit);\n return (\n <Post\n slug={hit.slug}\n title={hit.title}\n date={hit.date}\n description={hit.description}\n main_class={hit.main_class}\n />\n )\n}\n\nHit.propTypes = {\n hit: PropTypes.object.isRequired\n}\n\nexport default Hit\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { StyledIconBase } from '@styled-icons/styled-icon';\nexport var Algolia = React.forwardRef(function (props, ref) {\n var attrs = {\n \"fill\": \"currentColor\",\n \"xmlns\": \"http://www.w3.org/2000/svg\"\n };\n return React.createElement(StyledIconBase, __assign({\n iconAttrs: attrs,\n iconVerticalAlign: \"-.125em\",\n iconViewBox: \"0 0 448 512\"\n }, props, {\n ref: ref\n }), 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 key: \"k0\"\n }));\n});\nAlgolia.displayName = 'Algolia';\nexport var AlgoliaDimensions = {\n height: undefined,\n width: undefined\n};","import styled from 'styled-components'\nimport media from 'styled-media-query'\nimport { Algolia } from '@styled-icons/fa-brands/Algolia'\n\nexport const SearchWrapper = styled.section`\n background: var(--background);\n display: flex;\n flex-direction: column;\n width: 100%;\n transition: opacity 0.4s;\n\n .ais-InstantSearch__root {\n display: flex;\n flex-direction: column;\n height: auto;\n width: 100%;\n }\n\n .ais-SearchBox,\n .ais-Stats {\n padding: 0.5rem 3rem;\n\n ${media.lessThan('large')`\n padding: 0.5rem 1rem;\n `}\n }\n\n .ais-SearchBox {\n padding-top: 6rem;\n\n ${media.lessThan('large')`\n padding-top: 1rem;\n `}\n }\n\n .ais-Stats {\n color: var(--texts);\n }\n\n body#card & {\n .ais-Hits-list {\n background-color: var(--borders);\n border-bottom: 1px solid var(--borders);\n border-top: 1px solid var(--borders);\n display: grid;\n grid-area: card;\n grid-gap: 1px;\n grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));\n margin-top: 2rem;\n }\n\n .ais-Hits-item {\n background-color: var(--background);\n }\n }\n\n .ais-SearchBox-input {\n background: none;\n border: none;\n border-bottom: 1px solid var(--borders);\n color: var(--texts);\n display: flex;\n font-size: 1.6rem;\n padding: 0.5rem;\n width: 100%;\n\n &::placeholder {\n color: var(--texts);\n }\n }\n\n .ais-SearchBox-submit,\n .ais-SearchBox-reset {\n display: none;\n }\n`\n\nexport const SearchTitle = styled.h1`\n color: var(--texts);\n font-size: 1rem;\n font-weight: 700;\n padding: 3rem 2rem;\n text-align: right;\n\n ${media.lessThan('large')`\n padding: 1rem;\n line-height: 1.1;\n `}\n`\n\nexport const AlgoliaIcon = styled(Algolia)`\n height: 1.2rem;\n margin-left: 0.5rem;\n width: 1.2rem;\n`\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport algoliasearch from 'algoliasearch/lite'\n\nimport {\n InstantSearch,\n SearchBox,\n Hits,\n Stats,\n Configure\n} from 'react-instantsearch-dom'\n\nimport Hit from './Hit'\nimport * as S from './styled'\n\nconst Search = (props) => {\n const searchClient = algoliasearch(\n props.algolia.appId,\n props.algolia.searchOnlyApiKey\n )\n\n return (\n <S.SearchWrapper>\n {props.algolia && props.algolia.appId && (\n <>\n <InstantSearch\n searchClient={searchClient}\n indexName={props.algolia.indexName}\n >\n <Configure hitsPerPage={200} distinct />\n <SearchBox\n autoFocus\n translations={{ placeholder: 'Search...' }}\n />\n <Stats\n translations={{\n stats(nbHits, timeSpentMS) {\n return nbHits === 1\n ? `${nbHits} result found in ${timeSpentMS}ms`\n : `${nbHits} result found in ${timeSpentMS}ms`\n }\n }}\n />\n <Hits hitComponent={Hit} />\n </InstantSearch>\n <S.SearchTitle>\n Powered by Algolia\n <S.AlgoliaIcon />\n </S.SearchTitle>\n </>\n )}\n </S.SearchWrapper>\n )\n}\n\nSearch.propTypes = {\n algolia: PropTypes.object.isRequired\n}\n\nexport default Search\n","import React from 'react'\n\nimport Layout from '../components/Layout/'\nimport SEO from '../components/Seo'\nimport Search from '../components/Search'\n\nconst algolia = {\n appId: process.env.GATSBY_ALGOLIA_APP_ID,\n searchOnlyApiKey: process.env.GATSBY_ALGOLIA_SEARCH_ONLY_KEY,\n indexName: process.env.GATSBY_ALGOLIA_INDEX_NAME\n}\n\nconst SearchPage = props => {\n return (\n <Layout>\n <SEO\n title=\"Search\"\n description=\"Vai lá, não tenha medo. Busque por posts novos e bem antigos.\"\n />\n <Search algolia={algolia} />\n </Layout>\n )\n}\n\nexport default SearchPage\n","'use strict';\n\nrequire(\"core-js/modules/es6.array.reduce\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.array.map\");\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};","require(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.date.now\");\n\nrequire(\"core-js/modules/es7.object.entries\");\n\nrequire(\"core-js/modules/es6.regexp.replace\");\n\nrequire(\"core-js/modules/es6.promise\");\n\nrequire(\"core-js/modules/es6.string.iterator\");\n\nrequire(\"core-js/modules/es6.array.from\");\n\nrequire(\"core-js/modules/es6.regexp.to-string\");\n\nrequire(\"core-js/modules/es6.date.to-string\");\n\nrequire(\"core-js/modules/es7.symbol.async-iterator\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.object.define-properties\");\n\nrequire(\"core-js/modules/es7.object.get-own-property-descriptors\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\n\nrequire(\"core-js/modules/es6.array.filter\");\n\nrequire(\"core-js/modules/es6.symbol\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.object.define-property\");\n\n/*! algoliasearch-lite.umd.js | 4.2.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */\n!function (e, t) {\n \"object\" == typeof exports && \"undefined\" != typeof module ? module.exports = t() : \"function\" == typeof define && define.amd ? define(t) : (e = e || self).algoliasearch = t();\n}(this, function () {\n \"use strict\";\n\n function e(e, t, r) {\n return t in e ? Object.defineProperty(e, t, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[t] = r, e;\n }\n\n function t(e, t) {\n var r = Object.keys(e);\n\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n t && (n = n.filter(function (t) {\n return Object.getOwnPropertyDescriptor(e, t).enumerable;\n })), r.push.apply(r, n);\n }\n\n return r;\n }\n\n function r(r) {\n for (var n = 1; n < arguments.length; n++) {\n var o = null != arguments[n] ? arguments[n] : {};\n n % 2 ? t(Object(o), !0).forEach(function (t) {\n e(r, t, o[t]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : t(Object(o)).forEach(function (e) {\n Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e));\n });\n }\n\n return r;\n }\n\n function n(e, t) {\n if (null == e) return {};\n\n var r,\n n,\n o = function (e, t) {\n if (null == e) return {};\n var r,\n n,\n o = {},\n a = Object.keys(e);\n\n for (n = 0; n < a.length; n++) {\n r = a[n], t.indexOf(r) >= 0 || (o[r] = e[r]);\n }\n\n return o;\n }(e, t);\n\n if (Object.getOwnPropertySymbols) {\n var a = Object.getOwnPropertySymbols(e);\n\n for (n = 0; n < a.length; n++) {\n r = a[n], t.indexOf(r) >= 0 || Object.prototype.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);\n }\n }\n\n return o;\n }\n\n function o(e, t) {\n return function (e) {\n if (Array.isArray(e)) return e;\n }(e) || function (e, t) {\n if (!(Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e))) return;\n var r = [],\n n = !0,\n o = !1,\n a = void 0;\n\n try {\n for (var u, i = e[Symbol.iterator](); !(n = (u = i.next()).done) && (r.push(u.value), !t || r.length !== t); n = !0) {\n ;\n }\n } catch (e) {\n o = !0, a = e;\n } finally {\n try {\n n || null == i[\"return\"] || i[\"return\"]();\n } finally {\n if (o) throw a;\n }\n }\n\n return r;\n }(e, t) || function () {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }();\n }\n\n function a(e) {\n return function (e) {\n if (Array.isArray(e)) {\n for (var t = 0, r = new Array(e.length); t < e.length; t++) {\n r[t] = e[t];\n }\n\n return r;\n }\n }(e) || function (e) {\n if (Symbol.iterator in Object(e) || \"[object Arguments]\" === Object.prototype.toString.call(e)) return Array.from(e);\n }(e) || function () {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n }();\n }\n\n function u(e) {\n var t,\n r = \"algoliasearch-client-js-\".concat(e.key),\n n = function n() {\n return void 0 === t && (t = e.localStorage || window.localStorage), t;\n },\n a = function a() {\n return JSON.parse(n().getItem(r) || \"{}\");\n };\n\n return {\n get: function get(e, t) {\n var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n };\n return Promise.resolve().then(function () {\n var r = JSON.stringify(e),\n n = a()[r];\n return Promise.all([n || t(), void 0 !== n]);\n }).then(function (e) {\n var t = o(e, 2),\n n = t[0],\n a = t[1];\n return Promise.all([n, a || r.miss(n)]);\n }).then(function (e) {\n return o(e, 1)[0];\n });\n },\n set: function set(e, t) {\n return Promise.resolve().then(function () {\n var o = a();\n return o[JSON.stringify(e)] = t, n().setItem(r, JSON.stringify(o)), t;\n });\n },\n \"delete\": function _delete(e) {\n return Promise.resolve().then(function () {\n var t = a();\n delete t[JSON.stringify(e)], n().setItem(r, JSON.stringify(t));\n });\n },\n clear: function clear() {\n return Promise.resolve().then(function () {\n n().removeItem(r);\n });\n }\n };\n }\n\n function i(e) {\n var t = a(e.caches),\n r = t.shift();\n return void 0 === r ? {\n get: function get(e, t) {\n var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n },\n n = t();\n return n.then(function (e) {\n return Promise.all([e, r.miss(e)]);\n }).then(function (e) {\n return o(e, 1)[0];\n });\n },\n set: function set(e, t) {\n return Promise.resolve(t);\n },\n \"delete\": function _delete(e) {\n return Promise.resolve();\n },\n clear: function clear() {\n return Promise.resolve();\n }\n } : {\n get: function get(e, n) {\n var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n };\n return r.get(e, n, o)[\"catch\"](function () {\n return i({\n caches: t\n }).get(e, n, o);\n });\n },\n set: function set(e, n) {\n return r.set(e, n)[\"catch\"](function () {\n return i({\n caches: t\n }).set(e, n);\n });\n },\n \"delete\": function _delete(e) {\n return r[\"delete\"](e)[\"catch\"](function () {\n return i({\n caches: t\n })[\"delete\"](e);\n });\n },\n clear: function clear() {\n return r.clear()[\"catch\"](function () {\n return i({\n caches: t\n }).clear();\n });\n }\n };\n }\n\n function s() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {\n serializable: !0\n },\n t = {};\n return {\n get: function get(r, n) {\n var o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {\n miss: function miss() {\n return Promise.resolve();\n }\n },\n a = JSON.stringify(r);\n if (a in t) return Promise.resolve(e.serializable ? JSON.parse(t[a]) : t[a]);\n\n var u = n(),\n i = o && o.miss || function () {\n return Promise.resolve();\n };\n\n return u.then(function (e) {\n return i(e);\n }).then(function () {\n return u;\n });\n },\n set: function set(r, n) {\n return t[JSON.stringify(r)] = e.serializable ? JSON.stringify(n) : n, Promise.resolve(n);\n },\n \"delete\": function _delete(e) {\n return delete t[JSON.stringify(e)], Promise.resolve();\n },\n clear: function clear() {\n return t = {}, Promise.resolve();\n }\n };\n }\n\n function c(e) {\n for (var t = e.length - 1; t > 0; t--) {\n var r = Math.floor(Math.random() * (t + 1)),\n n = e[t];\n e[t] = e[r], e[r] = n;\n }\n\n return e;\n }\n\n function l(e, t) {\n return Object.keys(void 0 !== t ? t : {}).forEach(function (r) {\n e[r] = t[r](e);\n }), 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 g = 3;\n\n function y(e) {\n var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : p;\n return r({}, e, {\n status: t,\n lastUpdate: Date.now()\n });\n }\n\n function b(e) {\n return {\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(y(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 === g && 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({}, e.data, {}, t.data);\n return JSON.stringify(n);\n }(n, o),\n s = function (e, t) {\n var n = 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({}, n.data, {}, o.data),\n f = 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: w(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 onSucess: function onSucess(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, y(l, n.isTimedOut ? g : 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.onSucess(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 S(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 w(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({}, e, {\n request: r({}, e.request, {\n headers: r({}, e.request.headers, {}, t)\n })\n });\n }\n\n var C = function C(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({\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({}, n.headers(), {}, {\n \"content-type\": \"application/x-www-form-urlencoded\"\n }, {}, e.headers),\n queryParameters: 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 N = function N(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({}, 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 N(e)(t.indexName, {\n methods: {\n searchForFacetValues: I\n }\n }).searchForFacetValues(u, i, r({}, o, {}, s));\n }));\n };\n },\n E = function E(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 I = function I(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 F = 1,\n R = 2,\n D = 3;\n\n function W(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 = D, {\n debug: function debug(e, t) {\n return F >= o && console.debug(e, t), Promise.resolve();\n },\n info: function info(e, t) {\n return R >= 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.2.0\", \"-\").concat(e)\n }), s()]\n }),\n userAgent: S(\"4.2.0\").add({\n segment: \"Browser\",\n version: \"lite\"\n }),\n authMode: h.WithinQueryParameters\n };\n return C(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 N(e)(t, {\n methods: {\n search: E,\n searchForFacetValues: I\n }\n });\n };\n }\n }\n }));\n }\n\n return W.version = \"4.2.0\", W;\n});","require(\"core-js/modules/es6.regexp.match\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.regexp.to-string\");\n\nrequire(\"core-js/modules/es6.date.to-string\");\n\nrequire(\"core-js/modules/es6.regexp.flags\");\n\nrequire(\"core-js/modules/es6.regexp.constructor\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/es6.set\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.string.iterator\");\n\nrequire(\"core-js/modules/es6.map\");\n\n/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */\nvar hasElementType = typeof Element !== 'undefined';\nvar hasMap = typeof Map === 'function';\nvar hasSet = typeof Set === 'function';\nvar hasArrayBuffer = typeof ArrayBuffer === 'function'; // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js\n\nfunction equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n } // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n\n\n var it;\n\n if (hasMap && a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n }\n\n return true;\n }\n\n if (hasSet && a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n return true;\n } // END: Modifications\n\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (a[i] !== b[i]) return false;\n }\n\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n } // END: fast-deep-equal\n // START: react-fast-compare\n // custom handling for DOM elements\n\n\n if (hasElementType && a instanceof Element) return false; // custom handling for React\n\n for (i = length; i-- !== 0;) {\n if (keys[i] === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } // all other properties should be traversed as usual\n\n\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n } // END: react-fast-compare\n // START: fast-deep-equal\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal\n\n\nmodule.exports = function isEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if ((error.message || '').match(/stack|recursion/i)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('react-fast-compare cannot handle circular refs');\n return false;\n } // some other error. we should definitely know about these\n\n\n throw error;\n }\n};","'use strict';\n\nrequire(\"core-js/modules/es6.regexp.to-string\");\n\nrequire(\"core-js/modules/es6.date.to-string\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\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'; // @MAJOR can be replaced by native Array#find when we change support\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return undefined;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return array[i];\n }\n }\n};","'use strict';\n/**\n * Functions to manipulate refinement lists\n *\n * The RefinementList is not formally defined through a prototype but is based\n * on a specific structure.\n *\n * @module SearchParameters.refinementList\n *\n * @typedef {string[]} SearchParameters.refinementList.Refinements\n * @typedef {Object.<string, SearchParameters.refinementList.Refinements>} SearchParameters.refinementList.RefinementList\n */\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.array.filter\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.reduce\");\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;","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\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\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;","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n","'use strict';\n\nrequire(\"core-js/modules/es6.object.create\");\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;","require(\"core-js/modules/es6.array.is-array\");\n\n/*!\n Copyright (c) 2017 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) && arg.length) {\n var inner = classNames.apply(null, arg);\n\n if (inner) {\n classes.push(inner);\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n }\n\n if (typeof module !== 'undefined' && module.exports) {\n classNames[\"default\"] = classNames;\n module.exports = classNames;\n } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n // register as 'classnames', consistent with npm package name\n define('classnames', [], function () {\n return classNames;\n });\n } else {\n window.classNames = classNames;\n }\n})();","'use strict';\n\nrequire(\"core-js/modules/es6.string.trim\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.array.last-index-of\");\n\nrequire(\"core-js/modules/es6.array.filter\");\n\nrequire(\"core-js/modules/es6.array.reduce\");\n\nrequire(\"core-js/modules/es6.function.name\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\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 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 * 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 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 return geoRect.map(function (value) {\n return parseFloat(value);\n });\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 if (!objectHasKeys(this.numericRefinements[attribute])) {\n return this.numericRefinements;\n }\n\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\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.array.filter\");\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\nrequire(\"core-js/modules/es6.array.filter\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nmodule.exports = function compact(array) {\n if (!Array.isArray(array)) {\n return [];\n }\n\n return array.filter(Boolean);\n};","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import styled from 'styled-components'\nimport media from 'styled-media-query'\nimport AniLink from 'gatsby-plugin-transition-link/AniLink'\n\nimport transitions from '../../styles/transitions';\n\nexport const PostWrapper = styled.section`\n align-items: center;\n border-bottom: 1px solid var(--borders);\n display: flex;\n padding: 2rem 3rem;\n width: 100%;\n transition: ${transitions.ALL};\n\n &:not(.disableCard) {\n body#card & {\n border: none;\n padding: 2rem 1rem;\n flex-direction: column;\n justify-content: center;\n }\n }\n\n ${media.lessThan('large')`\n align-items: flex-start;\n flex-direction: column;\n padding: 2rem 1rem;\n `}\n`\n\nexport const PostLink = styled(AniLink)`\n color: var(--texts);\n display: flex;\n text-decoration: none;\n transition: ${transitions.COLOR};\n\n body#card & {\n background-color: var(--background);\n }\n\n &:hover {\n color: var(--highlight);\n }\n`\n\nexport const PostTag = styled.div`\n align-items: center;\n background: var(--highlight);\n border-radius: 50%;\n color: var(--white);\n display: flex;\n font-size: 1.3rem;\n font-weight: 700;\n justify-content: center;\n min-height: 90px;\n min-width: 90px;\n text-transform: uppercase;\n\n body#card & {\n margin-bottom: 1.5rem;\n }\n\n ${media.lessThan('large')`\n border-radius: 0;\n font-size: 1rem;\n min-height: auto;\n min-width: auto;\n padding: .2rem .5rem;\n margin-bottom: .7rem;\n `}\n\n &.is-js {\n background: #d6ba32;\n color: #000;\n }\n\n &.is-misc {\n background: #47650b;\n }\n\n &.is-dev {\n background: #61728f;\n }\n\n &.is-svg {\n background: #7d669e;\n }\n\n &.is-css {\n background: #24809e;\n }\n\n &.is-jekyll {\n background: #b31917;\n }\n`\n\nexport const PostInfo = styled.div`\n display: flex;\n flex-direction: column;\n margin-left: 1.5rem;\n\n ${media.lessThan('large')`\n margin: 0;\n `}\n`\n\nexport const PostDate = styled.time`\n font-size: 0.9rem;\n`\n\nexport const PostTitle = styled.h1`\n font-size: 1.6rem;\n font-weight: 700;\n margin: 0.2rem 0 0.5rem;\n\n body#card & {\n line-height: 1.1;\n margin: 0.8rem 0;\n }\n`\n\nexport const PostDescription = styled.h2`\n font-size: 1.2rem;\n font-weight: 300;\n line-height: 1.2;\n`\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport * as S from './styled'\n\nimport getThemeColor from '../../utils/getThemeColor'\n\nconst Post = ({\n slug,\n date,\n timeToRead,\n title,\n description,\n main_class,\n disableCard\n}) => {\n return (\n <S.PostLink to={slug} cover direction=\"right\" bg={getThemeColor()}>\n <S.PostWrapper className={disableCard ? 'disableCard' : ''}>\n {main_class && (\n <S.PostTag className={`is-${main_class}`}>{main_class}</S.PostTag>\n )}\n <S.PostInfo>\n <S.PostDate>\n {date} {timeToRead && ` • ${timeToRead} min read`}\n </S.PostDate>\n <S.PostTitle>{title}</S.PostTitle>\n <S.PostDescription>{description}</S.PostDescription>\n </S.PostInfo>\n </S.PostWrapper>\n </S.PostLink>\n )\n}\n\nPost.propTypes = {\n slug: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n date: PropTypes.string.isRequired,\n timeToRead: PropTypes.number,\n description: PropTypes.string.isRequired,\n main_class: PropTypes.string,\n disableCard: PropTypes.bool\n}\n\nexport default Post\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict';\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.function.bind\");\n\nrequire(\"core-js/modules/es6.function.name\");\n\nrequire(\"core-js/modules/es6.object.create\");\n\nrequire(\"core-js/modules/es6.object.define-property\");\n\nrequire(\"core-js/modules/es6.number.constructor\");\n\nrequire(\"core-js/modules/es6.number.is-nan\");\n\nrequire(\"core-js/modules/es6.symbol\");\n\nrequire(\"core-js/modules/es6.reflect.own-keys\");\n\nrequire(\"core-js/modules/es6.reflect.apply\");\n\nvar R = typeof Reflect === 'object' ? Reflect : null;\nvar ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n};\nvar ReflectOwnKeys;\n\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys;\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n};\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\n\nmodule.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\n\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function get() {\n return defaultMaxListeners;\n },\n set: function set(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function () {\n if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n}; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\n\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n\n for (var i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n var doError = type === 'error';\n var events = this._events;\n if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; // If there is no 'error' event listener then throw.\n\n if (doError) {\n var er;\n if (args.length > 0) er = args[0];\n\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n } // At least give some kind of context to the user\n\n\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n if (handler === undefined) return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n\n for (var i = 0; i < len; ++i) {\n ReflectApply(listeners[i], this, args);\n }\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n checkListener(listener);\n events = target._events;\n\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n\n events = target._events;\n }\n\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n } // Check for listener leak\n\n\n m = _getMaxListeners(target);\n\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true; // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n\n var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener = function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n};\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0) return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = {\n fired: false,\n wrapFn: undefined,\n target: target,\n type: type,\n listener: listener\n };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n}; // Emits a 'removeListener' event if and only if the listener was removed.\n\n\nEventEmitter.prototype.removeListener = function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n checkListener(listener);\n events = this._events;\n if (events === undefined) return this;\n list = events[type];\n if (list === undefined) return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else {\n delete events[type];\n if (events.removeListener) this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n if (position === 0) list.shift();else {\n spliceOne(list, position);\n }\n if (list.length === 1) events[type] = list[0];\n if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {\n var listeners, events, i;\n events = this._events;\n if (events === undefined) return this; // not listening for removeListener, no need to emit\n\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type];\n }\n\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n};\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n if (events === undefined) return [];\n var evlistener = events[type];\n if (evlistener === undefined) return [];\n if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function (emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\n\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n\n for (var i = 0; i < n; ++i) {\n copy[i] = arr[i];\n }\n\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++) {\n list[index] = list[index + 1];\n }\n\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n\n return ret;\n}","'use strict';\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nfunction objectHasKeys(obj) {\n return obj && Object.keys(obj).length > 0;\n}\n\nmodule.exports = objectHasKeys;","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","'use strict'; // NOTE: this behaves like lodash/defaults, but doesn't mutate the target\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\n\nrequire(\"core-js/modules/es6.array.reduce-right\");\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 acc[key] = source[key];\n }\n });\n return acc;\n }, {});\n};","'use strict';\n\nrequire(\"core-js/modules/es6.string.trim\");\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.filter\");\n\nrequire(\"core-js/modules/es6.array.reduce\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/es6.function.name\");\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\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nfunction valToNumber(v) {\n if (typeof v === 'number') {\n return v;\n } else if (typeof v === 'string') {\n return parseFloat(v);\n } else if (Array.isArray(v)) {\n return v.map(valToNumber);\n }\n\n throw new Error('The value should be a number, a parsable string or an array of those.');\n}\n\nmodule.exports = valToNumber;","'use strict'; // @MAJOR can be replaced by native Array#findIndex when we change support\n\nrequire(\"core-js/modules/es6.array.is-array\");\n\nmodule.exports = function find(array, comparator) {\n if (!Array.isArray(array)) {\n return -1;\n }\n\n for (var i = 0; i < array.length; i++) {\n if (comparator(array[i])) {\n return i;\n }\n }\n\n return -1;\n};","'use strict'; // https://github.com/babel/babel/blob/3aaafae053fa75febb3aa45d45b6f00646e30ba4/packages/babel-helpers/src/helpers.js#L604-L620\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\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\nrequire(\"core-js/modules/es6.array.is-array\");\n\nrequire(\"core-js/modules/es6.array.sort\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.function.name\");\n\nrequire(\"core-js/modules/web.dom.iterable\");\n\nrequire(\"core-js/modules/es6.array.iterator\");\n\nrequire(\"core-js/modules/es6.object.to-string\");\n\nrequire(\"core-js/modules/es6.object.keys\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.reduce\");\n\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\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 /**\n * query used to generate the results\n * @member {string}\n */\n\n this.query = mainSubResponse.query;\n /**\n * The query as parsed by the engine given all the rules.\n * @member {string}\n */\n\n this.parsedQuery = mainSubResponse.parsedQuery;\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 * @member {object[]}\n */\n\n this.hits = mainSubResponse.hits;\n /**\n * index where the results come from\n * @member {string}\n */\n\n this.index = mainSubResponse.index;\n /**\n * number of hits per page requested\n * @member {number}\n */\n\n this.hitsPerPage = mainSubResponse.hitsPerPage;\n /**\n * total number of hits of this query on the index\n * @member {number}\n */\n\n this.nbHits = mainSubResponse.nbHits;\n /**\n * total number of pages with respect to the number of hits per page and the total number of hits\n * @member {number}\n */\n\n this.nbPages = mainSubResponse.nbPages;\n /**\n * current page\n * @member {number}\n */\n\n this.page = mainSubResponse.page;\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 * The position if the position was guessed by IP.\n * @member {string}\n * @example \"48.8637,2.3615\",\n */\n\n this.aroundLatLng = mainSubResponse.aroundLatLng;\n /**\n * The radius computed by Algolia.\n * @member {string}\n * @example \"126792922\",\n */\n\n this.automaticRadius = mainSubResponse.automaticRadius;\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 * @member {string}\n * @example \"c7-use-2.algolia.net\",\n */\n\n this.serverUsed = mainSubResponse.serverUsed;\n /**\n * Boolean that indicates if the computation of the counts did time out.\n * @deprecated\n * @member {boolean}\n */\n\n this.timeoutCounts = mainSubResponse.timeoutCounts;\n /**\n * Boolean that indicates if the computation of the hits did time out.\n * @deprecated\n * @member {boolean}\n */\n\n this.timeoutHits = mainSubResponse.timeoutHits;\n /**\n * True if the counts of the facets is exhaustive\n * @member {boolean}\n */\n\n this.exhaustiveFacetsCount = mainSubResponse.exhaustiveFacetsCount;\n /**\n * True if the number of hits is exhaustive\n * @member {boolean}\n */\n\n this.exhaustiveNbHits = mainSubResponse.exhaustiveNbHits;\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 * @member {object[]}\n */\n\n this.userData = mainSubResponse.userData;\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 * @member {string}\n */\n\n this.queryID = mainSubResponse.queryID;\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;\n var self = this; // 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\nrequire(\"core-js/modules/es6.array.sort\");\n\nrequire(\"core-js/modules/es6.array.map\");\n\nrequire(\"core-js/modules/es6.array.is-array\");\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;"],"sourceRoot":""}