-
Notifications
You must be signed in to change notification settings - Fork 1
/
4-a681e9127041611004fb.js.map
1 lines (1 loc) · 768 KB
/
4-a681e9127041611004fb.js.map
1
{"version":3,"sources":["webpack:///./node_modules/algoliasearch/src/browser/jsonp-request.js","webpack:///./node_modules/algoliasearch/src/AlgoliaSearchCore.js","webpack:///./node_modules/algoliasearch-helper/src/requestBuilder.js","webpack:///./node_modules/object-keys/isArguments.js","webpack:///./node_modules/object-keys/index.js","webpack:///./node_modules/core-js/modules/es6.reflect.apply.js","webpack:///./node_modules/querystring-es3/encode.js","webpack:///./node_modules/algoliasearch/src/places.js","webpack:///./node_modules/algoliasearch-helper/src/version.js","webpack:///./node_modules/algoliasearch-helper/src/algoliasearch.helper.js","webpack:///./node_modules/algoliasearch/src/map.js","webpack:///./node_modules/core-js/modules/es6.number.is-nan.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/algoliasearch/src/buildSearchMethod.js","webpack:///./node_modules/algoliasearch-helper/src/functions/formatSort.js","webpack:///./node_modules/core-js/modules/es7.promise.finally.js","webpack:///./node_modules/core-js/modules/es6.object.freeze.js","webpack:///./node_modules/algoliasearch/src/version.js","webpack:///./node_modules/es6-promise/dist/es6-promise.js","webpack:///./node_modules/is-what/dist/index.esm.js","webpack:///./node_modules/merge-anything/dist/index.esm.js","webpack:///./node_modules/ms/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/merge.js","webpack:///./node_modules/@babel/runtime/helpers/esm/extends.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectSpread.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/utils.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/context.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/createConnector.js","webpack:///./node_modules/react-instantsearch-core/dist/es/core/indexUtils.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectStateResults.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/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/widgets/InstantSearch.js","webpack:///./node_modules/react-instantsearch-core/dist/es/widgets/Index.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectHits.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/core/utils.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Hits.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Hits.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/tslib/tslib.es6.js","webpack:///./node_modules/@styled-icons/styled-icon/dist/index.esm.js","webpack:///./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","webpack:///./node_modules/@styled-icons/fa-brands/Algolia/Algolia.esm.js","webpack:///./src/components/search/styles.js","webpack:///./node_modules/@styled-icons/fa-solid/Search/Search.esm.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectSearchBox.js","webpack:///./src/components/search/input.js","webpack:///./node_modules/react-instantsearch-core/dist/es/connectors/connectHighlight.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Highlighter.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Highlight.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Highlight.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/components/Snippet.js","webpack:///./node_modules/react-instantsearch-dom/dist/es/widgets/Snippet.js","webpack:///./src/components/search/hitComps.js","webpack:///./src/components/search/index.js","webpack:///./node_modules/algoliasearch-helper/src/functions/find.js","webpack:///./node_modules/algoliasearch-helper/src/SearchParameters/RefinementList.js","webpack:///./node_modules/algoliasearch/src/deprecatedMessage.js","webpack:///./node_modules/algoliasearch-helper/src/DerivedHelper/index.js","webpack:///./node_modules/algoliasearch/src/merge.js","webpack:///./node_modules/debug/src/browser.js","webpack:///./node_modules/algoliasearch/src/browser/createAlgoliasearch.js","webpack:///./node_modules/algoliasearch-helper/index.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./node_modules/algoliasearch/src/omit.js","webpack:///./node_modules/core-js/modules/es6.array.reduce-right.js","webpack:///./node_modules/algoliasearch-helper/src/functions/inherits.js","webpack:///./node_modules/stylis-rule-sheet/index.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/memoize-one/dist/memoize-one.esm.js","webpack:///./node_modules/algoliasearch/src/errors.js","webpack:///./node_modules/algoliasearch-helper/src/functions/compact.js","webpack:///./node_modules/stylis/stylis.min.js","webpack:///./node_modules/fast-deep-equal/index.js","webpack:///./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js","webpack:///./node_modules/algoliasearch/src/browser/inline-headers.js","webpack:///./node_modules/algoliasearch/node_modules/isarray/index.js","webpack:///./node_modules/algoliasearch/src/exitPromise.js","webpack:///./node_modules/algoliasearch/src/store.js","webpack:///./node_modules/node-libs-browser/node_modules/events/events.js","webpack:///./node_modules/algoliasearch-helper/src/functions/objectHasKeys.js","webpack:///./node_modules/algoliasearch/src/IndexCore.js","webpack:///./node_modules/querystring-es3/decode.js","webpack:///./node_modules/debug/src/debug.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/src/deprecate.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/querystring-es3/index.js","webpack:///./node_modules/algoliasearch/src/clone.js","webpack:///./node_modules/object-keys/implementation.js","webpack:///./node_modules/algoliasearch-helper/src/SearchResults/index.js","webpack:///./node_modules/algoliasearch/src/browser/builds/algoliasearchLite.js","webpack:///./node_modules/foreach/index.js","webpack:///./node_modules/styled-components/dist/styled-components.browser.esm.js","webpack:///./node_modules/global/window.js","webpack:///./node_modules/core-js/modules/es6.reflect.own-keys.js","webpack:///./node_modules/algoliasearch-helper/src/functions/orderBy.js"],"names":["module","exports","url","opts","cb","method","Error","debug","cbCalled","timedOut","JSONPCounter","head","document","getElementsByTagName","script","createElement","cbName","done","window","data","e","undefined","removeGlobals","clean","body","responseText","JSON","stringify","jsonBody","params","ontimeout","setTimeout","errors","RequestTimeout","timeouts","complete","success","JSONPScriptFail","clearTimeout","onload","onreadystatechange","onerror","removeChild","this","readyState","JSONPScriptError","async","defer","src","appendChild","AlgoliaSearchCore","exitPromise","IndexCore","store","RESET_APP_DATA_TIMER","parseInt","applicationID","apiKey","clone","isArray","map","usage","_allowEmptyCredentials","AlgoliaSearchError","hosts","read","write","_timeouts","connect","timeout","protocol","test","_checkAppIdData","defaultHosts","_shuffleResult","hostNumber","mainSuffix","dsn","concat","prepareHost","extraHeaders","cache","_cache","_ua","_useCache","_useRequestCache","_useFallback","useFallback","_setTimeout","host","toLowerCase","safeJSONStringify","obj","Array","prototype","toJSON","out","removeCredentials","headers","newHeaders","headerName","value","Object","hasOwnProperty","call","initIndex","indexName","setExtraHeader","name","getExtraHeader","unsetExtraHeader","addAlgoliaAgent","algoliaAgent","algoliaAgentWithDelimiter","indexOf","_jsonRequest","initialOpts","cacheID","requestDebug","additionalUA","client","tries","usingFallback","hasFallback","_request","fallback","length","requests","_computeRequestHeaders","withApiKey","debugData","isCacheValidWithCurrentID","useRequestCache","currentCache","currentCacheID","interopCallbackReturn","request","callback","then","content","err","maybePromiseForCache","_promise","resolve","parse","doRequest","requester","reqOpts","startTime","Date","hostType","reject","_getTimeoutsForRequest","_setHostIndexByType","currentHost","_getHostByType","options","forceAuthHeaders","httpResponse","status","message","statusCode","httpResponseOk","Math","floor","endTime","push","contentLength","duration","retryRequest","unrecoverableError","stack","Unknown","UnparsableJSON","_incrementHostIndex","_incrementTimeoutMultipler","_getSearchParams","args","key","encodeURIComponent","toString","forEach","requestHeaders","userToken","securityTags","search","queries","postObj","query","JSONPParams","requestId","join","strategy","searchForFacetValues","all","facetName","facetQuery","omit","filteredParams","keyName","searchParameters","setSecurityTags","tags","strTags","i","oredTags","j","setUserToken","clearCache","setRequestTimeout","milliseconds","setTimeouts","getTimeouts","_getAppIdData","get","_cacheAppIdData","_setAppIdData","lastChange","getTime","set","now","_resetInitialAppIdData","newData","hostIndexes","timeoutMultiplier","shuffleResult","array","temporaryValue","randomIndex","currentIndex","random","shuffle","_hostIndexes","_timeoutMultiplier","_partialAppIdDataUpdate","foreach","currentData","_getHostIndexByType","_getTimeoutMultiplier","hostIndex","newHostIndexes","max","merge","requestBuilder","_getQueries","index","state","_getHitsSearchParams","getRefinedDisjunctiveFacets","refinedFacet","_getDisjunctiveFacetSearchParams","getRefinedHierarchicalFacets","hierarchicalFacet","getHierarchicalFacetByName","currentRefinement","getHierarchicalRefinement","separator","_getHierarchicalFacetSeparator","split","facets","disjunctiveFacets","_getHitsHierarchicalFacetsAttributes","facetFilters","_getFacetFilters","numericFilters","_getNumericFilters","additionalParams","tagFilters","_getTagFilters","getQueryParams","facet","hierarchicalRootLevel","hitsPerPage","page","attributesToRetrieve","attributesToHighlight","attributesToSnippet","analytics","clickAnalytics","_getDisjunctiveHierarchicalFacetAttribute","keys","numericRefinements","attribute","operators","operator","values","vs","v","tagRefinements","facetsRefinements","facetValue","facetsExcludes","disjunctiveFacetsRefinements","facetValues","orFilters","hierarchicalFacetsRefinements","attributeToRefine","attributesIndex","rootPath","_getHierarchicalRootPath","slice","lastIndexOf","attributes","hierarchicalFacets","reduce","allAttributes","hierarchicalRefinement","level","newAttributes","rootLevel","attributeIndex","parentLevel","getSearchForFacetQuery","maxFacetHits","stateForSearchForFacetValues","isDisjunctiveFacet","clearRefinements","searchForFacetSearchParameters","toStr","str","isArgs","callee","origKeys","keysShim","o","originalKeys","shim","arguments","object","$export","aFunction","anObject","rApply","Reflect","apply","fApply","Function","S","F","target","thisArgument","argumentsList","T","L","stringifyPrimitive","isFinite","sep","eq","objectKeys","k","ks","xs","f","res","algoliasearch","appID","cloneDeep","buildSearchMethod","reverse","encoded","qs3","encode","as","getObject","objectID","SearchParameters","SearchResults","DerivedHelper","events","inherits","objectHasKeys","version","AlgoliaSearchHelper","setClient","make","lastResults","_queryId","_lastQueryIdReceived","derivedHelpers","_currentNbQueries","setCurrentPage","_change","setPage","isPageReset","getCurrentPage","EventEmitter","_search","onlyWithDerivedHelpers","searchOnlyWithDerivedHelpers","getQuery","searchOnce","tempState","setQueryParameters","self","emit","results","_originalResponse","userState","clientHasSFFV","isDisjunctive","algoliaQuery","facetHits","isRefined","isDisjunctiveFacetRefined","isFacetRefined","setQuery","q","resetPage","clearTags","addDisjunctiveFacetRefinement","addDisjunctiveRefine","addHierarchicalFacetRefinement","addNumericRefinement","addFacetRefinement","addRefine","addFacetExclusion","addExcludeRefinement","addExclude","addTag","tag","addTagRefinement","removeNumericRefinement","removeDisjunctiveFacetRefinement","removeDisjunctiveRefine","removeHierarchicalFacetRefinement","removeFacetRefinement","removeRefine","removeFacetExclusion","removeExcludeRefinement","removeExclude","removeTag","removeTagRefinement","toggleFacetExclusion","toggleExcludeFacetRefinement","toggleExclude","toggleRefinement","toggleFacetRefinement","toggleRefine","toggleTag","toggleTagRefinement","nextPage","previousPage","setIndex","setQueryParameter","parameter","setState","newState","overrideStateWithoutTriggeringChangeEvent","hasRefinements","getNumericRefinements","isConjunctiveFacet","isHierarchicalFacet","isHierarchicalFacetRefined","isExcluded","isExcludeRefined","isDisjunctiveRefined","hasTag","isTagRefined","hasTagRefinements","getIndex","getPage","getTags","getRefinements","refinements","getConjunctiveRefinements","r","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","newClient","getClient","derive","fn","detachDerivedHelper","pos","hasPendingRequests","arr","newArr","item","itemIndex","isNaN","number","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","queue","draining","queueIndex","cleanUpNextTick","drainQueue","len","run","marker","runClearTimeout","Item","noop","nextTick","title","browser","env","argv","versions","on","addListener","once","off","removeListener","removeAllListeners","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","queryParam","find","sortBy","defaults","defaultInstructions","sort","sortInstruction","matchingDefault","defaultInstruction","core","global","speciesConstructor","promiseResolve","P","R","onFinally","C","Promise","isFunction","x","isObject","meta","onFreeze","$freeze","it","factory","vertxNext","customSchedulerFn","asap","arg","flush","scheduleFlush","browserWindow","browserGlobal","BrowserMutationObserver","MutationObserver","WebKitMutationObserver","isNode","isWorker","Uint8ClampedArray","importScripts","MessageChannel","useSetTimeout","globalSetTimeout","channel","iterations","observer","node","onFulfillment","onRejection","parent","child","constructor","PROMISE_ID","makePromise","_state","invokeCallback","_result","subscribe","resolve$1","promise","createTextNode","observe","characterData","port1","onmessage","port2","postMessage","vertx","require","runOnLoop","runOnContext","attemptVertx","substring","handleMaybeThenable","maybeThenable","then$$1","thenable","fulfill","reason","handleOwnThenable","sealed","fulfillmentHandler","rejectionHandler","tryThen","_label","handleForeignThenable","TypeError","publishRejection","_onerror","publish","_subscribers","subscribers","settled","detail","hasCallback","succeeded","id","Enumerator","Constructor","input","_instanceConstructor","_remaining","_enumerate","_eachEntry","entry","c","resolve$$1","_then","didError","_settledAt","Promise$1","_willSettleAt","enumerator","resolver","needsResolver","initializePromise","needsNew","entries","race","_","_setScheduler","scheduleFn","_setAsap","asapFn","_asap","polyfill","local","promiseToString","cast","getType","payload","isPlainObject","getPrototypeOf","isSymbol","__spreadArrays","il","a","jl","assignProp","carry","newVal","originalObject","propType","propertyIsEnumerable","defineProperty","enumerable","writable","configurable","mergeRecursively","origin","newComer","extensions","extend","newObject","getOwnPropertyNames","getOwnPropertySymbols","targetVal","includes","newComers","_i","base","result","m","h","d","plural","ms","n","ceil","val","String","match","exec","parseFloat","round","fmtShort","isObjectOrArrayOrFunction","_merge","source","sourceVal","l","_extends","assign","_objectWithoutProperties","excluded","sourceKeys","sourceSymbolKeys","_objectSpread","ownKeys","filter","sym","getOwnPropertyDescriptor","shallowEqual","objA","objB","keysA","keysB","hasOwn","resolved","removeEmptyKey","_key","_createContext","onInternalStateUpdate","createHrefForState","onSearchForFacetValues","onSearchStateChange","onSearchParameters","widgetsManager","mainTargetedIndex","InstantSearchConsumer","Consumer","InstantSearchProvider","Provider","_createContext2","IndexConsumer","IndexProvider","createConnector","connectorDesc","Composed","Connector","displayName","isWidget","getSearchParameters","getMetadata","transitionState","Component","_Component","props","_this","providedProps","getProvidedProps","_ref","_len","contextValue","refine","getState","widgets","_ref2","_len2","_key2","_ref3","_len3","_key3","ais","multiIndexContext","indexContextValue","_this2","unsubscribe","isUnmounting","unregisterWidget","registerWidget","nextProps","nextState","shouldComponentUpdate","propsEqual","prevProps","update","cleanUp","_this$props$contextVa","resultsFacetValues","searching","searchingForFacetValues","isSearchStalled","metadata","searchResults","nextWidgetsState","prevWidgetsState","_this$props","refineProps","createURL","searchForFacetValuesProps","searchForItems","propTypes","defaultProps","createConnectorWithoutContext","getIndexId","context","hasMultipleIndices","targetedIndex","getResults","hits","indexId","refineValue","searchState","nextRefinement","namespace","_objectSpread4","indices","refineMultiIndexWithNamespace","refineMultiIndex","refineSingleIndexWithNamespace","refineSingleIndex","getNamespaceAndAttributeName","parts","attributeName","getCurrentRefinementValue","defaultValue","_getNamespaceAndAttri","multiIndex","defaultRefinement","cleanUpValue","_getNamespaceAndAttri2","Boolean","_ref4","indexSearchState","cleanUpValueWithMultiIndex","cleanUpValueWithSingleIndex","allSearchResults","createWidgetsManager","onWidgetsUpdate","scheduled","scheduleUpdate","widget","getWidgets","HIGHLIGHT_TAGS","highlightPreTag","highlightPostTag","parseHighlightedAttribute","preTag","postTag","_ref$highlightedValue","highlightedValue","splitByPreTag","firstValue","shift","elements","isHighlighted","splitByPostTag","parseAlgoliaHit","_ref2$preTag","_ref2$postTag","highlightProperty","hit","path","highlightObject","replace","current","addAlgoliaAgents","searchClient","isTargetedIndexEqualIndex","isIndexWidget","isIndexWidgetEqualIndex","sortIndexWidgetsFirst","firstWidget","secondWidget","serializeQueryParameters","parameters","format","createInstantSearchManager","_ref$initialState","initialState","resultsState","stalledSearchDelay","stalledSearchTimer","_store$getState","partialState","handleSearchSuccess","handleSearchError","skip","initialSearchParameters","transporter","baseMethod","methodArgs","requestsWithSeriazizedParams","responsesCache","acc","rawResults","hydrateSearchClientWithMultiIndexRequest","hydrateSearchClientWithSingleIndexRequest","hydrateSearchClient","listener","createStore","_internalIndexId","hydrateResultsState","sharedParameters","mainParameters","targetedIndexEqualMainIndex","subIndexEqualMainIndex","derivedIndices","targetedIndexNotEqualMainIndex","subIndexNotEqualMainIndex","derivedParameters","_getSearchParameters","detach","isDerivedHelpersEmpty","getFacetByName","currentState","nextIsSearchStalled","getWidgetsIds","_ref5","_ref5$maxFacetHits","maxFacetHitsWithinRange","min","_objectSpread6","onExternalStateUpdate","nextSearchState","updateClient","updateIndex","newIndex","skipSearch","isControlled","InstantSearch","instantSearchManager","onWidgetsInternalStateUpdate","prevState","nextIsControlled","previousSearchState","prevIsControlled","refresh","getKnownKeys","_searchState","count","children","string","isRequired","shape","func","bool","oneOfType","getIndexContext","Index","indexContext","inferredIndexId","queryID","__queryID","addQueryID","__position","block","prefix","suitElements","element","baseClassName","style","borderBottom","paddingBottom","marginBottom","wordBreak","_ref$className","className","_ref$hitComponent","hitComponent","HitComponent","HitPropTypes","arrayOf","connectHits","items","prevSearchState","propKeys","nonPresentKeys","_props","prop","subState","configureState","_assign","t","p","_templateObject","strings","raw","freeze","defineProperties","filterSVGProps","StyledIconBaseBase","ref","iconAttrs","iconViewBox","iconVerticalAlign","size","otherProps","__rest","iconProps","viewBox","height","width","focusable","role","svgProps","StyledIconBase","Algolia","fill","PoweredBy","href","Search","getCurrentRefinement","_refine","_cleanUp","label","SearchIcon","Input","theme","shortTrans","smallBorderRadius","Form","connectSearchBox","rest","onSubmit","preventDefault","placeholder","aria-label","onChange","_ref$preTag","_ref$postTag","highlight","cx","highlightedTagName","nonHighlightedTagName","TagName","tagName","parsedHighlightedValue","isLast","connectHighlight","PageHit","clickHandler","to","slug","onClick","HitsWrapper","show","darkGray","lightGray","lightBlue","darkBlue","gray","Root","Results","connectStateResults","nbHits","SearchComponent","collapse","hitsAsGrid","createRef","useState","focus","setFocus","config","header","algoliaAppId","algoliaSearchKey","handler","detectClickOutside","contains","useEffect","addEventListener","removeEventListener","useClickOutside","displayResult","root","onFocus","asGrid","hitComp","hitComps","Configure","comparator","defaultsPure","lib","addRefinement","refinementList","valueAsString","facetRefinement","mod","removeRefinement","clearRefinement","refinementType","hasChanged","newRefinementList","memo","facetList","refinementValue","containsRefinements","refinementValueAsString","previousUsage","newUsage","githubAnchorLink","mainHelper","main","destination","sources","load","storage","DEBUG","log","console","formatArgs","useColors","humanize","diff","color","lastC","save","namespaces","removeItem","documentElement","WebkitAppearance","firebug","exception","table","navigator","userAgent","RegExp","$1","chrome","localStorage","localstorage","colors","formatters","enable","AlgoliaSearch","uaSuffix","inlineHeaders","jsonpRequest","places","ua","AlgoliaSearchBrowser","initPlaces","__algolia","support","hasXMLHttpRequest","hasXDomainRequest","cors","XMLHttpRequest","reqTimeout","req","XDomainRequest","connected","onTimeout","onprogress","onConnect","getAllResponseHeaders","more","Network","open","setRequestHeader","send","abort","delay","promises","algoliasearchHelper","create","ctor","superCtor","super_","TempCtor","filtered","$reduce","reduceRight","callbackfn","insertRule","toSheet","selectors","parents","line","column","ns","depth","at","charCodeAt","delimiter","classNames","classes","argType","inner","intersection","valToNumber","RefinementList","isEqualNumericRefinement","b","every","el","newParameters","_parseNumbers","paramName","isKeyKnown","PARAMETERS","isValueDefined","numbers","parsedValue","insideBoundingBox","geoRect","parsedValues","vPrime","instance","toggleHierarchicalFacetRefinement","validate","patch","_clearNumericRefinements","newQuery","newPage","setFacets","setDisjunctiveFacets","setHitsPerPage","setTypoTolerance","typoTolerance","isNumericRefined","paramValue","op","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","areInputsEqual","newInputs","lastInputs","resultFn","isEqual","lastThis","lastResult","lastArgs","calledOnce","newArgs","extraProperties","captureStackTrace","createCustomError","AlgoliaSearchCustomError","unshift","ValidUntilNotFound","ObjectNotFound","u","g","A","w","$","y","O","z","N","W","B","D","E","I","J","M","Q","U","V","Z","be","pe","ke","ge","Ae","Ce","we","ve","me","xe","$e","ye","Oe","qe","Be","De","Ee","Ge","He","je","ze","Je","Re","Te","Ue","Ve","Xe","Ye","charAt","Qe","Pe","Ie","Me","Le","Ke","use","keyList","hasProp","equal","arrA","arrB","dateA","dateB","regexpA","regexpB","init","byteOffset","moduleStore","localStorageStore","localStorageFailure","cleanup","getOrSet","supportsLocalStorage","setItem","ReflectOwnKeys","ReflectApply","receiver","NumberIsNaN","Number","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","_getMaxListeners","that","_addListener","prepend","existing","warning","newListener","warned","emitter","warn","onceWrapper","fired","wrapFn","_onceWrap","wrapped","_listeners","unwrap","evlistener","ret","unwrapListeners","arrayClone","listenerCount","copy","RangeError","setMaxListeners","getMaxListeners","doError","er","list","position","originalListener","pop","spliceOne","rawListeners","eventNames","deprecate","deprecatedMessage","typeAheadArgs","typeAheadValueOption","similarSearch","browse","queryParameters","indexObj","browseFrom","cursor","searchFacet","attrs","getObjects","objectIDs","qs","regexp","maxKeys","kstr","vstr","idx","substr","decodeURIComponent","prevTime","createDebug","enabled","curr","prev","coerce","formatter","logFn","hash","abs","selectColor","disable","names","skips","hierarchicalFacetResult","hierarchicalFacetIndex","hierarchicalFacetRefinement","hierarchicalSeparator","hierarchicalRootPath","hierarchicalShowParentLevel","prepareHierarchicalFacetSortBy","rootExhaustive","facetResult","exhaustive","generateTreeFn","hierarchicalTree","currentHierarchicalLevel","subtree","picked","tuple","parentPath","onlyMatchingTree","orderBy","facetCount","generateHierarchicalTree","decode","has","isEnumerable","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","isArguments","isString","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","compact","findIndex","formatSort","getIndices","assignFacetStats","dest","facetStats","stats","mainSubResponse","_rawResults","parsedQuery","nbPages","processingTimeMS","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","excludes","recSort","sortFn","childNode","sortedChildren","getFacetStatsIfAvailable","getRefinement","resultsFacets","predicate","DEFAULT_SORT","getFacetValues","extractNormalizedFacetValues","order","hierarchicalFacetValues","vanillaSortFn","getFacetStats","facetDeclaration","rootFacet","intermediateFacet","newFacet","numericValue","createAlgoliasearch","ctx","interleave","interpolations","_typeof","Symbol","iterator","classCallCheck","createClass","descriptor","protoProps","staticProps","subClass","superClass","setPrototypeOf","__proto__","possibleConstructorReturn","ReferenceError","EMPTY_ARRAY","EMPTY_OBJECT","getComponentName","isStyledComponent","styledComponentId","SC_ATTR","REACT_APP_SC_ATTR","IS_BROWSER","DISABLE_SPEEDY","SC_DISABLE_SPEEDY","REACT_APP_SC_DISABLE_SPEEDY","StyledComponentsError","_Error","code","SC_COMPONENT_ID","extractComps","maybeCSS","css","existingComponents","componentId","matchIndex","nextComp","cssFromDOM","COMMENT_REGEX","stylisSplitter","cascade","keyframe","compress","semicolon","stylis","parsingRules","returnRulesPlugin","parsedRules","parseRulesPlugin","rule","_componentId","_selector","_selectorRegexp","selfReferenceReplacer","offset","splitByRules","stringifyRules","rules","selector","flatCSS","cssStr","getNonce","addNameForId","resetIdNames","hasNameForId","stringifyNames","sheetForTag","sheet","ownerDocument","styleSheets","ownerNode","safeInsertRule","cssRule","maxIndex","cssRules","makeTextMarker","addUpUntilIndex","sizes","totalUpToIndex","wrapAsHtmlTag","additionalAttrs","nonce","SC_VERSION_ATTR","wrapAsElement","dangerouslySetInnerHTML","__html","getIdsFromMarkersFactory","markers","makeTextNode","targetDocument","makeServerTag","namesArg","markersArg","insertMarker","cssForId","namesClone","cloneNames","markersClone","getIds","insertRules","removeRules","styleTag","toElement","toHTML","makeTag","tagEl","forceServer","insertBefore","getImportRuleTag","setAttribute","parentNode","nextSibling","makeStyleTag","extractImport","usedImportRuleTag","importRules","cssRulesSize","mayHaveImport","appendData","newMarker","replaceChild","makeBrowserTag","end","cssText","insertIndex","injectedRules","isConnected","removalIndex","lowerBound","deleteRule","deleteRules","makeSpeedyTag","SPLIT_REGEX","MAX_SIZE","sheetRunningId","master","StyleSheet","importRuleTag","firstTag","tagMap","deferred","rehydratedNames","ignoreRehydratedNames","capacity","clones","rehydrate","els","extracted","isStreamed","nodes","querySelectorAll","nodesSize","getAttribute","elNames","elNamesSize","textContent","extractedSize","_extracted$i","_j","reset","ids","newTag","sealAllTags","lastEl","getTagForId","hasId","deferredInject","inject","remove","toReactElements","Keyframes","styleSheet","getName","uppercasePattern","msPattern","hyphenateStyleName","isFalsish","chunk","objToCssArray","prevKey","flatten","executionContext","ruleSet","isReactComponent","styles","murmurhash","getAlphabeticChar","fromCharCode","generateAlphabeticName","isStaticRules","some","hasFunctionObjectKey","_TYPE_STATICS","hasher","ComponentStyle","isStatic","generateAndInjectStyles","lastClassName","generateName","determineTheme","fallbackTheme","isDefaultTheme","escapeRegex","dashesAtEnds","escape","isTag","REACT_STATICS","childContextTypes","contextTypes","getDerivedStateFromProps","KNOWN_STATICS","caller","arity","TYPE_STATICS","$$typeof","render","defineProperty$1","_Object$getOwnPropert","objectPrototype","arrayPrototype","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","targetStatics","sourceStatics","ThemeContext","ThemeConsumer","StyleSheetContext","ThemeProvider","getContext","renderInner","outerTheme","getTheme","ServerStyleSheet","masterSheet","seal","collectStyles","StyleSheetManager","getStyleTags","getStyleElement","interleaveWithNodeStream","readableStream","StyleSheetConsumer","identifiers","StyledComponent","renderOuter","forwardedComponent","componentStyle","_props$forwardedCompo","foldedComponentIds","generatedClassName","elementToBeCreated","isTargetTag","propsForElement","computedProps","buildExecutionContext","attrDef","resolvedAttrDef","attrDefWasFn","attr","_props$forwardedCompo2","warnTooManyClasses","createStyledComponent","isTargetStyledComp","isClass","_options$displayName","generateDisplayName","_options$componentId","_ComponentStyle","_displayName","parentComponentId","nr","generateId","_options$ParentCompon","ParentComponent","_options$attrs","finalAttrs","WrappedStyledComponent","forwardRef","forwardedRef","withComponent","previousComponentId","optionsToCopy","objectWithoutProperties","newComponentId","_foldedDefaultProps","styled","constructWithOptions","componentConstructor","templateFunction","withConfig","domElement","GlobalStyle","createStyles","removeStyles","renderStyles","scCGSHMRCache","win","compareAscending","other","valIsDefined","valIsNull","othIsDefined","othIsNull","collection","iteratees","orders","criteria","iteratee"],"mappings":"6FAEAA,EAAOC,QAMP,SAAsBC,EAAKC,EAAMC,GAC/B,GAAoB,QAAhBD,EAAKE,OAEP,YADAD,EAAG,IAAIE,MAAM,UAAYH,EAAKE,OAAS,IAAMH,EAAM,gCAIrDC,EAAKI,MAAM,gBACX,IAAIC,GAAW,EACXC,GAAW,EACfC,GAAgB,EAChB,IAAIC,EAAOC,SAASC,qBAAqB,QAAQ,GAC7CC,EAASF,SAASG,cAAc,UAChCC,EAAS,gBAAkBN,EAC3BO,GAAO,EAEXC,OAAOF,GAAU,SAAUG,IAsE3B,WACE,WACSD,OAAOF,UACPE,OAAOF,EAAS,WACvB,MAAOI,GACPF,OAAOF,GAAUE,OAAOF,EAAS,gBAAaK,GA1EhDC,GAEIb,EACFN,EAAKI,MAAM,iCAIbC,GAAW,EACXe,IACAnB,EAAG,KAAM,CACPoB,KAAML,EACNM,aAAcC,KAAKC,UAAUR,OAUjCjB,GAAO,aAAec,EAElBb,EAAKyB,UAAYzB,EAAKyB,SAASC,SACjC3B,GAAO,IAAMC,EAAKyB,SAASC,QAG7B,IAAIC,EAAYC,YAmDhB,WACE5B,EAAKI,MAAM,yBACXE,GAAW,EACXc,IACAnB,EAAG,IAAI4B,EAAOC,kBAvDoB9B,EAAK+B,SAASC,UAYlD,SAASC,IACPjC,EAAKI,MAAM,kBAEPU,GAAQR,IAIZQ,GAAO,EAEFT,IACHL,EAAKI,MAAM,4DACXgB,IACAnB,EAAG,IAAI4B,EAAOK,mBAUl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+C,EAAiBvgD,EAAOghD,SAASnmD,GAAQ2lD,EAAMQ,SAASnmD,IAElE,GAAI4G,EACF,OAAI5G,GAASkmD,EAAOztD,OACXmO,EAGa,SAAlBs/C,EAAOlmD,IACD4G,EAGHA,EAMX,OAAOzB,EAAOnF,MAAQ2lD,EAAM3lD,SAEvB8c,EAAOvoB,KAAI,SAAUqS,GAC1B,OAAOA,EAAI5P","file":"4-a681e9127041611004fb.js","sourcesContent":["'use strict';\n\nmodule.exports = jsonpRequest;\n\nvar errors = require('../errors');\n\nvar JSONPCounter = 0;\n\nfunction jsonpRequest(url, opts, cb) {\n if (opts.method !== 'GET') {\n cb(new Error('Method ' + opts.method + ' ' + url + ' is not supported by JSONP.'));\n return;\n }\n\n opts.debug('JSONP: start');\n var cbCalled = false;\n var timedOut = false;\n JSONPCounter += 1;\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n var cbName = 'algoliaJSONP_' + JSONPCounter;\n var done = false;\n\n window[cbName] = function (data) {\n removeGlobals();\n\n if (timedOut) {\n opts.debug('JSONP: Late answer, ignoring');\n return;\n }\n\n cbCalled = true;\n clean();\n cb(null, {\n body: data,\n responseText: JSON.stringify(data)\n /* ,\n // We do not send the statusCode, there's no statusCode in JSONP, it will be\n // computed using data.status && data.message like with XDR\n statusCode*/\n\n });\n }; // add callback by hand\n\n\n url += '&callback=' + cbName; // add body params manually\n\n if (opts.jsonBody && opts.jsonBody.params) {\n url += '&' + opts.jsonBody.params;\n }\n\n var ontimeout = setTimeout(timeout, opts.timeouts.complete); // script onreadystatechange needed only for\n // <= IE8\n // https://github.com/angular/angular.js/issues/4523\n\n script.onreadystatechange = readystatechange;\n script.onload = success;\n script.onerror = error;\n script.async = true;\n script.defer = true;\n script.src = url;\n head.appendChild(script);\n\n function success() {\n opts.debug('JSONP: success');\n\n if (done || timedOut) {\n return;\n }\n\n done = true; // script loaded but did not call the fn => script loading error\n\n if (!cbCalled) {\n opts.debug('JSONP: Fail. Script loaded but did not call the callback');\n clean();\n cb(new errors.JSONPScriptFail());\n }\n }\n\n function readystatechange() {\n if (this.readyState === 'loaded' || this.readyState === 'complete') {\n success();\n }\n }\n\n function clean() {\n clearTimeout(ontimeout);\n script.onload = null;\n script.onreadystatechange = null;\n script.onerror = null;\n head.removeChild(script);\n }\n\n function removeGlobals() {\n try {\n delete window[cbName];\n delete window[cbName + '_loaded'];\n } catch (e) {\n window[cbName] = window[cbName + '_loaded'] = undefined;\n }\n }\n\n function timeout() {\n opts.debug('JSONP: Script timeout');\n timedOut = true;\n clean();\n cb(new errors.RequestTimeout());\n }\n\n function error() {\n opts.debug('JSONP: Script error');\n\n if (done || timedOut) {\n return;\n }\n\n clean();\n cb(new errors.JSONPScriptError());\n }\n}","require(\"core-js/modules/es6.date.to-json\");\n\nrequire(\"core-js/modules/es6.regexp.search\");\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.index-of\");\n\nmodule.exports = AlgoliaSearchCore;\n\nvar errors = require('./errors');\n\nvar exitPromise = require('./exitPromise.js');\n\nvar IndexCore = require('./IndexCore.js');\n\nvar store = require('./store.js'); // We will always put the API KEY in the JSON body in case of too long API KEY,\n// to avoid query string being too long and failing in various conditions (our server limit, browser limit,\n// proxies limit)\n\n\nvar MAX_API_KEY_LENGTH = 500;\nvar RESET_APP_DATA_TIMER = process.env.RESET_APP_DATA_TIMER && parseInt(process.env.RESET_APP_DATA_TIMER, 10) || 60 * 2 * 1000; // after 2 minutes reset to first host\n\n/*\n * Algolia Search library initialization\n * https://www.algolia.com/\n *\n * @param {string} applicationID - Your applicationID, found in your dashboard\n * @param {string} apiKey - Your API key, found in your dashboard\n * @param {Object} [opts]\n * @param {number} [opts.timeout=2000] - The request timeout set in milliseconds,\n * another request will be issued after this timeout\n * @param {string} [opts.protocol='https:'] - The protocol used to query Algolia Search API.\n * Set to 'http:' to force using http.\n * @param {Object|Array} [opts.hosts={\n * read: [this.applicationID + '-dsn.algolia.net'].concat([\n * this.applicationID + '-1.algolianet.com',\n * this.applicationID + '-2.algolianet.com',\n * this.applicationID + '-3.algolianet.com']\n * ]),\n * write: [this.applicationID + '.algolia.net'].concat([\n * this.applicationID + '-1.algolianet.com',\n * this.applicationID + '-2.algolianet.com',\n * this.applicationID + '-3.algolianet.com']\n * ]) - The hosts to use for Algolia Search API.\n * If you provide them, you will less benefit from our HA implementation\n */\n\nfunction AlgoliaSearchCore(applicationID, apiKey, opts) {\n var debug = require('debug')('algoliasearch');\n\n var clone = require('./clone.js');\n\n var isArray = require('isarray');\n\n var map = require('./map.js');\n\n var usage = 'Usage: algoliasearch(applicationID, apiKey, opts)';\n\n if (opts._allowEmptyCredentials !== true && !applicationID) {\n throw new errors.AlgoliaSearchError('Please provide an application ID. ' + usage);\n }\n\n if (opts._allowEmptyCredentials !== true && !apiKey) {\n throw new errors.AlgoliaSearchError('Please provide an API key. ' + usage);\n }\n\n this.applicationID = applicationID;\n this.apiKey = apiKey;\n this.hosts = {\n read: [],\n write: []\n };\n opts = opts || {};\n this._timeouts = opts.timeouts || {\n connect: 1 * 1000,\n // 500ms connect is GPRS latency\n read: 2 * 1000,\n write: 30 * 1000\n }; // backward compat, if opts.timeout is passed, we use it to configure all timeouts like before\n\n if (opts.timeout) {\n this._timeouts.connect = this._timeouts.read = this._timeouts.write = opts.timeout;\n }\n\n var protocol = opts.protocol || 'https:'; // while we advocate for colon-at-the-end values: 'http:' for `opts.protocol`\n // we also accept `http` and `https`. It's a common error.\n\n if (!/:$/.test(protocol)) {\n protocol = protocol + ':';\n }\n\n if (protocol !== 'http:' && protocol !== 'https:') {\n throw new errors.AlgoliaSearchError('protocol must be `http:` or `https:` (was `' + opts.protocol + '`)');\n }\n\n this._checkAppIdData();\n\n if (!opts.hosts) {\n var defaultHosts = map(this._shuffleResult, function (hostNumber) {\n return applicationID + '-' + hostNumber + '.algolianet.com';\n }); // no hosts given, compute defaults\n\n var mainSuffix = (opts.dsn === false ? '' : '-dsn') + '.algolia.net';\n this.hosts.read = [this.applicationID + mainSuffix].concat(defaultHosts);\n this.hosts.write = [this.applicationID + '.algolia.net'].concat(defaultHosts);\n } else if (isArray(opts.hosts)) {\n // when passing custom hosts, we need to have a different host index if the number\n // of write/read hosts are different.\n this.hosts.read = clone(opts.hosts);\n this.hosts.write = clone(opts.hosts);\n } else {\n this.hosts.read = clone(opts.hosts.read);\n this.hosts.write = clone(opts.hosts.write);\n } // add protocol and lowercase hosts\n\n\n this.hosts.read = map(this.hosts.read, prepareHost(protocol));\n this.hosts.write = map(this.hosts.write, prepareHost(protocol));\n this.extraHeaders = {}; // In some situations you might want to warm the cache\n\n this.cache = opts._cache || {};\n this._ua = opts._ua;\n this._useCache = opts._useCache === undefined || opts._cache ? true : opts._useCache;\n this._useRequestCache = this._useCache && opts._useRequestCache;\n this._useFallback = opts.useFallback === undefined ? true : opts.useFallback;\n this._setTimeout = opts._setTimeout;\n debug('init done, %j', this);\n}\n/*\n * Get the index object initialized\n *\n * @param indexName the name of index\n * @param callback the result callback with one argument (the Index instance)\n */\n\n\nAlgoliaSearchCore.prototype.initIndex = function (indexName) {\n return new IndexCore(this, indexName);\n};\n/**\n* Add an extra field to the HTTP request\n*\n* @param name the header field name\n* @param value the header field value\n*/\n\n\nAlgoliaSearchCore.prototype.setExtraHeader = function (name, value) {\n this.extraHeaders[name.toLowerCase()] = value;\n};\n/**\n* Get the value of an extra HTTP header\n*\n* @param name the header field name\n*/\n\n\nAlgoliaSearchCore.prototype.getExtraHeader = function (name) {\n return this.extraHeaders[name.toLowerCase()];\n};\n/**\n* Remove an extra field from the HTTP request\n*\n* @param name the header field name\n*/\n\n\nAlgoliaSearchCore.prototype.unsetExtraHeader = function (name) {\n delete this.extraHeaders[name.toLowerCase()];\n};\n/**\n* Augment sent x-algolia-agent with more data, each agent part\n* is automatically separated from the others by a semicolon;\n*\n* @param algoliaAgent the agent to add\n*/\n\n\nAlgoliaSearchCore.prototype.addAlgoliaAgent = function (algoliaAgent) {\n var algoliaAgentWithDelimiter = '; ' + algoliaAgent;\n\n if (this._ua.indexOf(algoliaAgentWithDelimiter) === -1) {\n this._ua += algoliaAgentWithDelimiter;\n }\n};\n/*\n * Wrapper that try all hosts to maximize the quality of service\n */\n\n\nAlgoliaSearchCore.prototype._jsonRequest = function (initialOpts) {\n this._checkAppIdData();\n\n var requestDebug = require('debug')('algoliasearch:' + initialOpts.url);\n\n var body;\n var cacheID;\n var additionalUA = initialOpts.additionalUA || '';\n var cache = initialOpts.cache;\n var client = this;\n var tries = 0;\n var usingFallback = false;\n var hasFallback = client._useFallback && client._request.fallback && initialOpts.fallback;\n var headers;\n\n if (this.apiKey.length > MAX_API_KEY_LENGTH && initialOpts.body !== undefined && (initialOpts.body.params !== undefined || // index.search()\n initialOpts.body.requests !== undefined) // client.search()\n ) {\n initialOpts.body.apiKey = this.apiKey;\n headers = this._computeRequestHeaders({\n additionalUA: additionalUA,\n withApiKey: false,\n headers: initialOpts.headers\n });\n } else {\n headers = this._computeRequestHeaders({\n additionalUA: additionalUA,\n headers: initialOpts.headers\n });\n }\n\n if (initialOpts.body !== undefined) {\n body = safeJSONStringify(initialOpts.body);\n }\n\n requestDebug('request start');\n var debugData = [];\n\n function doRequest(requester, reqOpts) {\n client._checkAppIdData();\n\n var startTime = new Date();\n\n if (client._useCache && !client._useRequestCache) {\n cacheID = initialOpts.url;\n } // as we sometime use POST requests to pass parameters (like query='aa'),\n // the cacheID must also include the body to be different between calls\n\n\n if (client._useCache && !client._useRequestCache && body) {\n cacheID += '_body_' + reqOpts.body;\n } // handle cache existence\n\n\n if (isCacheValidWithCurrentID(!client._useRequestCache, cache, cacheID)) {\n requestDebug('serving response from cache');\n var responseText = cache[cacheID]; // Cache response must match the type of the original one\n\n return client._promise.resolve({\n body: JSON.parse(responseText),\n responseText: responseText\n });\n } // if we reached max tries\n\n\n if (tries >= client.hosts[initialOpts.hostType].length) {\n if (!hasFallback || usingFallback) {\n requestDebug('could not get any response'); // then stop\n\n return client._promise.reject(new errors.AlgoliaSearchError('Cannot connect to the AlgoliaSearch API.' + ' Send an email to support@algolia.com to report and resolve the issue.' + ' Application id was: ' + client.applicationID, {\n debugData: debugData\n }));\n }\n\n requestDebug('switching to fallback'); // let's try the fallback starting from here\n\n tries = 0; // method, url and body are fallback dependent\n\n reqOpts.method = initialOpts.fallback.method;\n reqOpts.url = initialOpts.fallback.url;\n reqOpts.jsonBody = initialOpts.fallback.body;\n\n if (reqOpts.jsonBody) {\n reqOpts.body = safeJSONStringify(reqOpts.jsonBody);\n } // re-compute headers, they could be omitting the API KEY\n\n\n headers = client._computeRequestHeaders({\n additionalUA: additionalUA,\n headers: initialOpts.headers\n });\n reqOpts.timeouts = client._getTimeoutsForRequest(initialOpts.hostType);\n\n client._setHostIndexByType(0, initialOpts.hostType);\n\n usingFallback = true; // the current request is now using fallback\n\n return doRequest(client._request.fallback, reqOpts);\n }\n\n var currentHost = client._getHostByType(initialOpts.hostType);\n\n var url = currentHost + reqOpts.url;\n var options = {\n body: reqOpts.body,\n jsonBody: reqOpts.jsonBody,\n method: reqOpts.method,\n headers: headers,\n timeouts: reqOpts.timeouts,\n debug: requestDebug,\n forceAuthHeaders: reqOpts.forceAuthHeaders\n };\n requestDebug('method: %s, url: %s, headers: %j, timeouts: %d', options.method, url, options.headers, options.timeouts);\n\n if (requester === client._request.fallback) {\n requestDebug('using fallback');\n } // `requester` is any of this._request or this._request.fallback\n // thus it needs to be called using the client as context\n\n\n return requester.call(client, url, options).then(success, tryFallback);\n\n function success(httpResponse) {\n // compute the status of the response,\n //\n // When in browser mode, using XDR or JSONP, we have no statusCode available\n // So we rely on our API response `status` property.\n // But `waitTask` can set a `status` property which is not the statusCode (it's the task status)\n // So we check if there's a `message` along `status` and it means it's an error\n //\n // That's the only case where we have a response.status that's not the http statusCode\n var status = httpResponse && httpResponse.body && httpResponse.body.message && httpResponse.body.status || // this is important to check the request statusCode AFTER the body eventual\n // statusCode because some implementations (jQuery XDomainRequest transport) may\n // send statusCode 200 while we had an error\n httpResponse.statusCode || // When in browser mode, using XDR or JSONP\n // we default to success when no error (no response.status && response.message)\n // If there was a JSON.parse() error then body is null and it fails\n httpResponse && httpResponse.body && 200;\n requestDebug('received response: statusCode: %s, computed statusCode: %d, headers: %j', httpResponse.statusCode, status, httpResponse.headers);\n var httpResponseOk = Math.floor(status / 100) === 2;\n var endTime = new Date();\n debugData.push({\n currentHost: currentHost,\n headers: removeCredentials(headers),\n content: body || null,\n contentLength: body !== undefined ? body.length : null,\n method: reqOpts.method,\n timeouts: reqOpts.timeouts,\n url: reqOpts.url,\n startTime: startTime,\n endTime: endTime,\n duration: endTime - startTime,\n statusCode: status\n });\n\n if (httpResponseOk) {\n if (client._useCache && !client._useRequestCache && cache) {\n cache[cacheID] = httpResponse.responseText;\n }\n\n return {\n responseText: httpResponse.responseText,\n body: httpResponse.body\n };\n }\n\n var shouldRetry = Math.floor(status / 100) !== 4;\n\n if (shouldRetry) {\n tries += 1;\n return retryRequest();\n }\n\n requestDebug('unrecoverable error'); // no success and no retry => fail\n\n var unrecoverableError = new errors.AlgoliaSearchError(httpResponse.body && httpResponse.body.message, {\n debugData: debugData,\n statusCode: status\n });\n return client._promise.reject(unrecoverableError);\n }\n\n function tryFallback(err) {\n // error cases:\n // While not in fallback mode:\n // - CORS not supported\n // - network error\n // While in fallback mode:\n // - timeout\n // - network error\n // - badly formatted JSONP (script loaded, did not call our callback)\n // In both cases:\n // - uncaught exception occurs (TypeError)\n requestDebug('error: %s, stack: %s', err.message, err.stack);\n var endTime = new Date();\n debugData.push({\n currentHost: currentHost,\n headers: removeCredentials(headers),\n content: body || null,\n contentLength: body !== undefined ? body.length : null,\n method: reqOpts.method,\n timeouts: reqOpts.timeouts,\n url: reqOpts.url,\n startTime: startTime,\n endTime: endTime,\n duration: endTime - startTime\n });\n\n if (!(err instanceof errors.AlgoliaSearchError)) {\n err = new errors.Unknown(err && err.message, err);\n }\n\n tries += 1; // stop the request implementation when:\n\n if ( // we did not generate this error,\n // it comes from a throw in some other piece of code\n err instanceof errors.Unknown || // server sent unparsable JSON\n err instanceof errors.UnparsableJSON || // max tries and already using fallback or no fallback\n tries >= client.hosts[initialOpts.hostType].length && (usingFallback || !hasFallback)) {\n // stop request implementation for this command\n err.debugData = debugData;\n return client._promise.reject(err);\n } // When a timeout occurred, retry by raising timeout\n\n\n if (err instanceof errors.RequestTimeout) {\n return retryRequestWithHigherTimeout();\n }\n\n return retryRequest();\n }\n\n function retryRequest() {\n requestDebug('retrying request');\n\n client._incrementHostIndex(initialOpts.hostType);\n\n return doRequest(requester, reqOpts);\n }\n\n function retryRequestWithHigherTimeout() {\n requestDebug('retrying request with higher timeout');\n\n client._incrementHostIndex(initialOpts.hostType);\n\n client._incrementTimeoutMultipler();\n\n reqOpts.timeouts = client._getTimeoutsForRequest(initialOpts.hostType);\n return doRequest(requester, reqOpts);\n }\n }\n\n function isCacheValidWithCurrentID(useRequestCache, currentCache, currentCacheID) {\n return client._useCache && useRequestCache && currentCache && currentCache[currentCacheID] !== undefined;\n }\n\n function interopCallbackReturn(request, callback) {\n if (isCacheValidWithCurrentID(client._useRequestCache, cache, cacheID)) {\n request[\"catch\"](function () {\n // Release the cache on error\n delete cache[cacheID];\n });\n }\n\n if (typeof initialOpts.callback === 'function') {\n // either we have a callback\n request.then(function okCb(content) {\n exitPromise(function () {\n initialOpts.callback(null, callback(content));\n }, client._setTimeout || setTimeout);\n }, function nookCb(err) {\n exitPromise(function () {\n initialOpts.callback(err);\n }, client._setTimeout || setTimeout);\n });\n } else {\n // either we are using promises\n return request.then(callback);\n }\n }\n\n if (client._useCache && client._useRequestCache) {\n cacheID = initialOpts.url;\n } // as we sometime use POST requests to pass parameters (like query='aa'),\n // the cacheID must also include the body to be different between calls\n\n\n if (client._useCache && client._useRequestCache && body) {\n cacheID += '_body_' + body;\n }\n\n if (isCacheValidWithCurrentID(client._useRequestCache, cache, cacheID)) {\n requestDebug('serving request from cache');\n var maybePromiseForCache = cache[cacheID]; // In case the cache is warmup with value that is not a promise\n\n var promiseForCache = typeof maybePromiseForCache.then !== 'function' ? client._promise.resolve({\n responseText: maybePromiseForCache\n }) : maybePromiseForCache;\n return interopCallbackReturn(promiseForCache, function (content) {\n // In case of the cache request, return the original value\n return JSON.parse(content.responseText);\n });\n }\n\n var request = doRequest(client._request, {\n url: initialOpts.url,\n method: initialOpts.method,\n body: body,\n jsonBody: initialOpts.body,\n timeouts: client._getTimeoutsForRequest(initialOpts.hostType),\n forceAuthHeaders: initialOpts.forceAuthHeaders\n });\n\n if (client._useCache && client._useRequestCache && cache) {\n cache[cacheID] = request;\n }\n\n return interopCallbackReturn(request, function (content) {\n // In case of the first request, return the JSON value\n return content.body;\n });\n};\n/*\n* Transform search param object in query string\n* @param {object} args arguments to add to the current query string\n* @param {string} params current query string\n* @return {string} the final query string\n*/\n\n\nAlgoliaSearchCore.prototype._getSearchParams = function (args, params) {\n if (args === undefined || args === null) {\n return params;\n }\n\n for (var key in args) {\n if (key !== null && args[key] !== undefined && args.hasOwnProperty(key)) {\n params += params === '' ? '' : '&';\n params += key + '=' + encodeURIComponent(Object.prototype.toString.call(args[key]) === '[object Array]' ? safeJSONStringify(args[key]) : args[key]);\n }\n }\n\n return params;\n};\n/**\n * Compute the headers for a request\n *\n * @param [string] options.additionalUA semi-colon separated string with other user agents to add\n * @param [boolean=true] options.withApiKey Send the api key as a header\n * @param [Object] options.headers Extra headers to send\n */\n\n\nAlgoliaSearchCore.prototype._computeRequestHeaders = function (options) {\n var forEach = require('foreach');\n\n var ua = options.additionalUA ? this._ua + '; ' + options.additionalUA : this._ua;\n var requestHeaders = {\n 'x-algolia-agent': ua,\n 'x-algolia-application-id': this.applicationID\n }; // browser will inline headers in the url, node.js will use http headers\n // but in some situations, the API KEY will be too long (big secured API keys)\n // so if the request is a POST and the KEY is very long, we will be asked to not put\n // it into headers but in the JSON body\n\n if (options.withApiKey !== false) {\n requestHeaders['x-algolia-api-key'] = this.apiKey;\n }\n\n if (this.userToken) {\n requestHeaders['x-algolia-usertoken'] = this.userToken;\n }\n\n if (this.securityTags) {\n requestHeaders['x-algolia-tagfilters'] = this.securityTags;\n }\n\n forEach(this.extraHeaders, function addToRequestHeaders(value, key) {\n requestHeaders[key] = value;\n });\n\n if (options.headers) {\n forEach(options.headers, function addToRequestHeaders(value, key) {\n requestHeaders[key] = value;\n });\n }\n\n return requestHeaders;\n};\n/**\n * Search through multiple indices at the same time\n * @param {Object[]} queries An array of queries you want to run.\n * @param {string} queries[].indexName The index name you want to target\n * @param {string} [queries[].query] The query to issue on this index. Can also be passed into `params`\n * @param {Object} queries[].params Any search param like hitsPerPage, ..\n * @param {Function} callback Callback to be called\n * @return {Promise|undefined} Returns a promise if no callback given\n */\n\n\nAlgoliaSearchCore.prototype.search = function (queries, opts, callback) {\n var isArray = require('isarray');\n\n var map = require('./map.js');\n\n var usage = 'Usage: client.search(arrayOfQueries[, callback])';\n\n if (!isArray(queries)) {\n throw new Error(usage);\n }\n\n if (typeof opts === 'function') {\n callback = opts;\n opts = {};\n } else if (opts === undefined) {\n opts = {};\n }\n\n var client = this;\n var postObj = {\n requests: map(queries, function prepareRequest(query) {\n var params = ''; // allow query.query\n // so we are mimicing the index.search(query, params) method\n // {indexName:, query:, params:}\n\n if (query.query !== undefined) {\n params += 'query=' + encodeURIComponent(query.query);\n }\n\n return {\n indexName: query.indexName,\n params: client._getSearchParams(query.params, params)\n };\n })\n };\n var JSONPParams = map(postObj.requests, function prepareJSONPParams(request, requestId) {\n return requestId + '=' + encodeURIComponent('/1/indexes/' + encodeURIComponent(request.indexName) + '?' + request.params);\n }).join('&');\n var url = '/1/indexes/*/queries';\n\n if (opts.strategy !== undefined) {\n postObj.strategy = opts.strategy;\n }\n\n return this._jsonRequest({\n cache: this.cache,\n method: 'POST',\n url: url,\n body: postObj,\n hostType: 'read',\n fallback: {\n method: 'GET',\n url: '/1/indexes/*',\n body: {\n params: JSONPParams\n }\n },\n callback: callback\n });\n};\n/**\n* Search for facet values\n* https://www.algolia.com/doc/rest-api/search#search-for-facet-values\n* This is the top-level API for SFFV.\n*\n* @param {object[]} queries An array of queries to run.\n* @param {string} queries[].indexName Index name, name of the index to search.\n* @param {object} queries[].params Query parameters.\n* @param {string} queries[].params.facetName Facet name, name of the attribute to search for values in.\n* Must be declared as a facet\n* @param {string} queries[].params.facetQuery Query for the facet search\n* @param {string} [queries[].params.*] Any search parameter of Algolia,\n* see https://www.algolia.com/doc/api-client/javascript/search#search-parameters\n* Pagination is not supported. The page and hitsPerPage parameters will be ignored.\n*/\n\n\nAlgoliaSearchCore.prototype.searchForFacetValues = function (queries) {\n var isArray = require('isarray');\n\n var map = require('./map.js');\n\n var usage = 'Usage: client.searchForFacetValues([{indexName, params: {facetName, facetQuery, ...params}}, ...queries])'; // eslint-disable-line max-len\n\n if (!isArray(queries)) {\n throw new Error(usage);\n }\n\n var client = this;\n return client._promise.all(map(queries, function performQuery(query) {\n if (!query || query.indexName === undefined || query.params.facetName === undefined || query.params.facetQuery === undefined) {\n throw new Error(usage);\n }\n\n var clone = require('./clone.js');\n\n var omit = require('./omit.js');\n\n var indexName = query.indexName;\n var params = query.params;\n var facetName = params.facetName;\n var filteredParams = omit(clone(params), function (keyName) {\n return keyName === 'facetName';\n });\n\n var searchParameters = client._getSearchParams(filteredParams, '');\n\n return client._jsonRequest({\n cache: client.cache,\n method: 'POST',\n url: '/1/indexes/' + encodeURIComponent(indexName) + '/facets/' + encodeURIComponent(facetName) + '/query',\n hostType: 'read',\n body: {\n params: searchParameters\n }\n });\n }));\n};\n/**\n * Set the extra security tagFilters header\n * @param {string|array} tags The list of tags defining the current security filters\n */\n\n\nAlgoliaSearchCore.prototype.setSecurityTags = function (tags) {\n if (Object.prototype.toString.call(tags) === '[object Array]') {\n var strTags = [];\n\n for (var i = 0; i < tags.length; ++i) {\n if (Object.prototype.toString.call(tags[i]) === '[object Array]') {\n var oredTags = [];\n\n for (var j = 0; j < tags[i].length; ++j) {\n oredTags.push(tags[i][j]);\n }\n\n strTags.push('(' + oredTags.join(',') + ')');\n } else {\n strTags.push(tags[i]);\n }\n }\n\n tags = strTags.join(',');\n }\n\n this.securityTags = tags;\n};\n/**\n * Set the extra user token header\n * @param {string} userToken The token identifying a uniq user (used to apply rate limits)\n */\n\n\nAlgoliaSearchCore.prototype.setUserToken = function (userToken) {\n this.userToken = userToken;\n};\n/**\n * Clear all queries in client's cache\n * @return undefined\n */\n\n\nAlgoliaSearchCore.prototype.clearCache = function () {\n this.cache = {};\n};\n/**\n* Set the number of milliseconds a request can take before automatically being terminated.\n* @deprecated\n* @param {Number} milliseconds\n*/\n\n\nAlgoliaSearchCore.prototype.setRequestTimeout = function (milliseconds) {\n if (milliseconds) {\n this._timeouts.connect = this._timeouts.read = this._timeouts.write = milliseconds;\n }\n};\n/**\n* Set the three different (connect, read, write) timeouts to be used when requesting\n* @param {Object} timeouts\n*/\n\n\nAlgoliaSearchCore.prototype.setTimeouts = function (timeouts) {\n this._timeouts = timeouts;\n};\n/**\n* Get the three different (connect, read, write) timeouts to be used when requesting\n* @param {Object} timeouts\n*/\n\n\nAlgoliaSearchCore.prototype.getTimeouts = function () {\n return this._timeouts;\n};\n\nAlgoliaSearchCore.prototype._getAppIdData = function () {\n var data = store.get(this.applicationID);\n if (data !== null) this._cacheAppIdData(data);\n return data;\n};\n\nAlgoliaSearchCore.prototype._setAppIdData = function (data) {\n data.lastChange = new Date().getTime();\n\n this._cacheAppIdData(data);\n\n return store.set(this.applicationID, data);\n};\n\nAlgoliaSearchCore.prototype._checkAppIdData = function () {\n var data = this._getAppIdData();\n\n var now = new Date().getTime();\n\n if (data === null || now - data.lastChange > RESET_APP_DATA_TIMER) {\n return this._resetInitialAppIdData(data);\n }\n\n return data;\n};\n\nAlgoliaSearchCore.prototype._resetInitialAppIdData = function (data) {\n var newData = data || {};\n newData.hostIndexes = {\n read: 0,\n write: 0\n };\n newData.timeoutMultiplier = 1;\n newData.shuffleResult = newData.shuffleResult || shuffle([1, 2, 3]);\n return this._setAppIdData(newData);\n};\n\nAlgoliaSearchCore.prototype._cacheAppIdData = function (data) {\n this._hostIndexes = data.hostIndexes;\n this._timeoutMultiplier = data.timeoutMultiplier;\n this._shuffleResult = data.shuffleResult;\n};\n\nAlgoliaSearchCore.prototype._partialAppIdDataUpdate = function (newData) {\n var foreach = require('foreach');\n\n var currentData = this._getAppIdData();\n\n foreach(newData, function (value, key) {\n currentData[key] = value;\n });\n return this._setAppIdData(currentData);\n};\n\nAlgoliaSearchCore.prototype._getHostByType = function (hostType) {\n return this.hosts[hostType][this._getHostIndexByType(hostType)];\n};\n\nAlgoliaSearchCore.prototype._getTimeoutMultiplier = function () {\n return this._timeoutMultiplier;\n};\n\nAlgoliaSearchCore.prototype._getHostIndexByType = function (hostType) {\n return this._hostIndexes[hostType];\n};\n\nAlgoliaSearchCore.prototype._setHostIndexByType = function (hostIndex, hostType) {\n var clone = require('./clone');\n\n var newHostIndexes = clone(this._hostIndexes);\n newHostIndexes[hostType] = hostIndex;\n\n this._partialAppIdDataUpdate({\n hostIndexes: newHostIndexes\n });\n\n return hostIndex;\n};\n\nAlgoliaSearchCore.prototype._incrementHostIndex = function (hostType) {\n return this._setHostIndexByType((this._getHostIndexByType(hostType) + 1) % this.hosts[hostType].length, hostType);\n};\n\nAlgoliaSearchCore.prototype._incrementTimeoutMultipler = function () {\n var timeoutMultiplier = Math.max(this._timeoutMultiplier + 1, 4);\n return this._partialAppIdDataUpdate({\n timeoutMultiplier: timeoutMultiplier\n });\n};\n\nAlgoliaSearchCore.prototype._getTimeoutsForRequest = function (hostType) {\n return {\n connect: this._timeouts.connect * this._timeoutMultiplier,\n complete: this._timeouts[hostType] * this._timeoutMultiplier\n };\n};\n\nfunction prepareHost(protocol) {\n return function prepare(host) {\n return protocol + '//' + host.toLowerCase();\n };\n} // Prototype.js < 1.7, a widely used library, defines a weird\n// Array.prototype.toJSON function that will fail to stringify our content\n// appropriately\n// refs:\n// - https://groups.google.com/forum/#!topic/prototype-core/E-SAVvV_V9Q\n// - https://github.com/sstephenson/prototype/commit/038a2985a70593c1a86c230fadbdfe2e4898a48c\n// - http://stackoverflow.com/a/3148441/147079\n\n\nfunction safeJSONStringify(obj) {\n /* eslint no-extend-native:0 */\n if (Array.prototype.toJSON === undefined) {\n return JSON.stringify(obj);\n }\n\n var toJSON = Array.prototype.toJSON;\n delete Array.prototype.toJSON;\n var out = JSON.stringify(obj);\n Array.prototype.toJSON = toJSON;\n return out;\n}\n\nfunction shuffle(array) {\n var currentIndex = array.length;\n var temporaryValue;\n var randomIndex; // While there remain elements to shuffle...\n\n while (currentIndex !== 0) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1; // And swap it with the current element.\n\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}\n\nfunction removeCredentials(headers) {\n var newHeaders = {};\n\n for (var headerName in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, headerName)) {\n var value;\n\n if (headerName === 'x-algolia-api-key' || headerName === 'x-algolia-application-id') {\n value = '**hidden for security purposes**';\n } else {\n value = headers[headerName];\n }\n\n newHeaders[headerName] = value;\n }\n }\n\n return newHeaders;\n}","'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\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\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n var str = toStr.call(value);\n var isArgs = str === '[object Arguments]';\n\n if (!isArgs) {\n isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]';\n }\n\n return isArgs;\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\nvar slice = Array.prototype.slice;\n\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) {\n return origKeys(o);\n} : require('./implementation');\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n if (Object.keys) {\n var keysWorksWithArguments = function () {\n // Safari 5.0 bug\n var args = Object.keys(arguments);\n return args && args.length === arguments.length;\n }(1, 2);\n\n if (!keysWorksWithArguments) {\n Object.keys = function keys(object) {\n // eslint-disable-line func-name-matching\n if (isArgs(object)) {\n return originalKeys(slice.call(object));\n }\n\n return originalKeys(object);\n };\n }\n } else {\n Object.keys = keysShim;\n }\n\n return Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;","// 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.keys\");\n\nrequire(\"core-js/modules/es6.array.map\");\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\nvar stringifyPrimitive = function stringifyPrimitive(v) {\n switch (typeof v) {\n case 'string':\n return v;\n\n case 'boolean':\n return v ? 'true' : 'false';\n\n case 'number':\n return isFinite(v) ? v : '';\n\n default:\n return '';\n }\n};\n\nmodule.exports = function (obj, sep, eq, name) {\n sep = sep || '&';\n eq = eq || '=';\n\n if (obj === null) {\n obj = undefined;\n }\n\n if (typeof obj === 'object') {\n return map(objectKeys(obj), function (k) {\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n\n if (isArray(obj[k])) {\n return map(obj[k], function (v) {\n return ks + encodeURIComponent(stringifyPrimitive(v));\n }).join(sep);\n } else {\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n }\n }).join(sep);\n }\n\n if (!name) return '';\n return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map(xs, f) {\n if (xs.map) return xs.map(f);\n var res = [];\n\n for (var i = 0; i < xs.length; i++) {\n res.push(f(xs[i], i));\n }\n\n return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n var res = [];\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n }\n\n return res;\n};","require(\"core-js/modules/es6.regexp.search\");\n\nmodule.exports = createPlacesClient;\n\nvar qs3 = require('querystring-es3');\n\nvar buildSearchMethod = require('./buildSearchMethod.js');\n\nfunction createPlacesClient(algoliasearch) {\n return function places(appID, apiKey, opts) {\n var cloneDeep = require('./clone.js');\n\n opts = opts && cloneDeep(opts) || {};\n opts.hosts = opts.hosts || ['places-dsn.algolia.net', 'places-1.algolianet.com', 'places-2.algolianet.com', 'places-3.algolianet.com']; // allow initPlaces() no arguments => community rate limited\n\n if (arguments.length === 0 || typeof appID === 'object' || appID === undefined) {\n appID = '';\n apiKey = '';\n opts._allowEmptyCredentials = true;\n }\n\n var client = algoliasearch(appID, apiKey, opts);\n var index = client.initIndex('places');\n index.search = buildSearchMethod('query', '/1/places/query');\n\n index.reverse = function (options, callback) {\n var encoded = qs3.encode(options);\n return this.as._jsonRequest({\n method: 'GET',\n url: '/1/places/reverse?' + encoded,\n hostType: 'read',\n callback: callback\n });\n };\n\n index.getObject = function (objectID, callback) {\n return this.as._jsonRequest({\n method: 'GET',\n url: '/1/places/' + encodeURIComponent(objectID),\n hostType: 'read',\n callback: callback\n });\n };\n\n return index;\n };\n}","'use strict';\n\nmodule.exports = '3.1.0';","'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;","var foreach = require('foreach');\n\nmodule.exports = function map(arr, fn) {\n var newArr = [];\n foreach(arr, function (item, itemIndex) {\n newArr.push(fn(item, itemIndex, arr));\n });\n return newArr;\n};","// 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","// shim for using process in browser\nvar process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\n\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\n\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\n\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}; // v8 likes predictible objects\n\n\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\n\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\n\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\n\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) {\n return [];\n};\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\n\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\n\nprocess.umask = function () {\n return 0;\n};","module.exports = buildSearchMethod;\n\nvar errors = require('./errors.js');\n/**\n * Creates a search method to be used in clients\n * @param {string} queryParam the name of the attribute used for the query\n * @param {string} url the url\n * @return {function} the search method\n */\n\n\nfunction buildSearchMethod(queryParam, url) {\n /**\n * The search method. Prepares the data and send the query to Algolia.\n * @param {string} query the string used for query search\n * @param {object} args additional parameters to send with the search\n * @param {function} [callback] the callback to be called with the client gets the answer\n * @return {undefined|Promise} If the callback is not provided then this methods returns a Promise\n */\n return function search(query, args, callback) {\n // warn V2 users on how to search\n if (typeof query === 'function' && typeof args === 'object' || typeof callback === 'object') {\n // .search(query, params, cb)\n // .search(cb, params)\n throw new errors.AlgoliaSearchError('index.search usage is index.search(query, params, cb)');\n } // Normalizing the function signature\n\n\n if (arguments.length === 0 || typeof query === 'function') {\n // Usage : .search(), .search(cb)\n callback = query;\n query = '';\n } else if (arguments.length === 1 || typeof args === 'function') {\n // Usage : .search(query/args), .search(query, cb)\n callback = args;\n args = undefined;\n } // At this point we have 3 arguments with values\n // Usage : .search(args) // careful: typeof null === 'object'\n\n\n if (typeof query === 'object' && query !== null) {\n args = query;\n query = undefined;\n } else if (query === undefined || query === null) {\n // .search(undefined/null)\n query = '';\n }\n\n var params = '';\n\n if (query !== undefined) {\n params += queryParam + '=' + encodeURIComponent(query);\n }\n\n var additionalUA;\n\n if (args !== undefined) {\n if (args.additionalUA) {\n additionalUA = args.additionalUA;\n delete args.additionalUA;\n } // `_getSearchParams` will augment params, do not be fooled by the = versus += from previous if\n\n\n params = this.as._getSearchParams(args, params);\n }\n\n return this._search(params, url, callback, additionalUA);\n };\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};","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","'use strict';\n\nmodule.exports = '3.35.1';","require(\"core-js/modules/es6.promise\");\n\nrequire(\"core-js/modules/es7.promise.finally\");\n\nrequire(\"core-js/modules/es6.typed.uint8-clamped-array\");\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\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version v4.2.8+1e68dce6\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.ES6Promise = factory();\n})(this, function () {\n 'use strict';\n\n function objectOrFunction(x) {\n var type = typeof x;\n return x !== null && (type === 'object' || type === 'function');\n }\n\n function isFunction(x) {\n return typeof x === 'function';\n }\n\n var _isArray = void 0;\n\n if (Array.isArray) {\n _isArray = Array.isArray;\n } else {\n _isArray = function _isArray(x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n }\n\n var isArray = _isArray;\n var len = 0;\n var vertxNext = void 0;\n var customSchedulerFn = void 0;\n\n var asap = function asap(callback, arg) {\n queue[len] = callback;\n queue[len + 1] = arg;\n len += 2;\n\n if (len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (customSchedulerFn) {\n customSchedulerFn(flush);\n } else {\n scheduleFlush();\n }\n }\n };\n\n function setScheduler(scheduleFn) {\n customSchedulerFn = scheduleFn;\n }\n\n function setAsap(asapFn) {\n asap = asapFn;\n }\n\n var browserWindow = typeof window !== 'undefined' ? window : undefined;\n var browserGlobal = browserWindow || {};\n var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\n var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; // test for web worker but not in IE10\n\n var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined'; // node\n\n function useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n return process.nextTick(flush);\n };\n } // vertx\n\n\n function useVertxTimer() {\n if (typeof vertxNext !== 'undefined') {\n return function () {\n vertxNext(flush);\n };\n }\n\n return useSetTimeout();\n }\n\n function useMutationObserver() {\n var iterations = 0;\n var observer = new BrowserMutationObserver(flush);\n var node = document.createTextNode('');\n observer.observe(node, {\n characterData: true\n });\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n } // web worker\n\n\n function useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = flush;\n return function () {\n return channel.port2.postMessage(0);\n };\n }\n\n function useSetTimeout() {\n // Store setTimeout reference so es6-promise will be unaffected by\n // other code modifying setTimeout (like sinon.useFakeTimers())\n var globalSetTimeout = setTimeout;\n return function () {\n return globalSetTimeout(flush, 1);\n };\n }\n\n var queue = new Array(1000);\n\n function flush() {\n for (var i = 0; i < len; i += 2) {\n var callback = queue[i];\n var arg = queue[i + 1];\n callback(arg);\n queue[i] = undefined;\n queue[i + 1] = undefined;\n }\n\n len = 0;\n }\n\n function attemptVertx() {\n try {\n var vertx = Function('return this')().require('vertx');\n\n vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return useVertxTimer();\n } catch (e) {\n return useSetTimeout();\n }\n }\n\n var scheduleFlush = void 0; // Decide what async method to use to triggering processing of queued callbacks:\n\n if (isNode) {\n scheduleFlush = useNextTick();\n } else if (BrowserMutationObserver) {\n scheduleFlush = useMutationObserver();\n } else if (isWorker) {\n scheduleFlush = useMessageChannel();\n } else if (browserWindow === undefined && typeof require === 'function') {\n scheduleFlush = attemptVertx();\n } else {\n scheduleFlush = useSetTimeout();\n }\n\n function then(onFulfillment, onRejection) {\n var parent = this;\n var child = new this.constructor(noop);\n\n if (child[PROMISE_ID] === undefined) {\n makePromise(child);\n }\n\n var _state = parent._state;\n\n if (_state) {\n var callback = arguments[_state - 1];\n asap(function () {\n return invokeCallback(_state, child, callback, parent._result);\n });\n } else {\n subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n }\n /**\n `Promise.resolve` returns a promise that will become resolved with the\n passed `value`. It is shorthand for the following:\n \n ```javascript\n let promise = new Promise(function(resolve, reject){\n resolve(1);\n });\n \n promise.then(function(value){\n // value === 1\n });\n ```\n \n Instead of writing the above, your code now simply becomes the following:\n \n ```javascript\n let promise = Promise.resolve(1);\n \n promise.then(function(value){\n // value === 1\n });\n ```\n \n @method resolve\n @static\n @param {Any} value value that the returned promise will be resolved with\n Useful for tooling.\n @return {Promise} a promise that will become fulfilled with the given\n `value`\n */\n\n\n function resolve$1(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && typeof object === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(noop);\n resolve(promise, object);\n return promise;\n }\n\n var PROMISE_ID = Math.random().toString(36).substring(2);\n\n function noop() {}\n\n var PENDING = void 0;\n var FULFILLED = 1;\n var REJECTED = 2;\n\n function selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n }\n\n function cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n }\n\n function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {\n try {\n then$$1.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n }\n\n function handleForeignThenable(promise, thenable, then$$1) {\n asap(function (promise) {\n var sealed = false;\n var error = tryThen(then$$1, thenable, function (value) {\n if (sealed) {\n return;\n }\n\n sealed = true;\n\n if (thenable !== value) {\n resolve(promise, value);\n } else {\n fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n\n sealed = true;\n reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n reject(promise, error);\n }\n }, promise);\n }\n\n function handleOwnThenable(promise, thenable) {\n if (thenable._state === FULFILLED) {\n fulfill(promise, thenable._result);\n } else if (thenable._state === REJECTED) {\n reject(promise, thenable._result);\n } else {\n subscribe(thenable, undefined, function (value) {\n return resolve(promise, value);\n }, function (reason) {\n return reject(promise, reason);\n });\n }\n }\n\n function handleMaybeThenable(promise, maybeThenable, then$$1) {\n if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {\n handleOwnThenable(promise, maybeThenable);\n } else {\n if (then$$1 === undefined) {\n fulfill(promise, maybeThenable);\n } else if (isFunction(then$$1)) {\n handleForeignThenable(promise, maybeThenable, then$$1);\n } else {\n fulfill(promise, maybeThenable);\n }\n }\n }\n\n function resolve(promise, value) {\n if (promise === value) {\n reject(promise, selfFulfillment());\n } else if (objectOrFunction(value)) {\n var then$$1 = void 0;\n\n try {\n then$$1 = value.then;\n } catch (error) {\n reject(promise, error);\n return;\n }\n\n handleMaybeThenable(promise, value, then$$1);\n } else {\n fulfill(promise, value);\n }\n }\n\n function publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n publish(promise);\n }\n\n function fulfill(promise, value) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n asap(publish, promise);\n }\n }\n\n function reject(promise, reason) {\n if (promise._state !== PENDING) {\n return;\n }\n\n promise._state = REJECTED;\n promise._result = reason;\n asap(publishRejection, promise);\n }\n\n function subscribe(parent, child, onFulfillment, onRejection) {\n var _subscribers = parent._subscribers;\n var length = _subscribers.length;\n parent._onerror = null;\n _subscribers[length] = child;\n _subscribers[length + FULFILLED] = onFulfillment;\n _subscribers[length + REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n asap(publish, parent);\n }\n }\n\n function publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child = void 0,\n callback = void 0,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function invokeCallback(settled, promise, callback, detail) {\n var hasCallback = isFunction(callback),\n value = void 0,\n error = void 0,\n succeeded = true;\n\n if (hasCallback) {\n try {\n value = callback(detail);\n } catch (e) {\n succeeded = false;\n error = e;\n }\n\n if (promise === value) {\n reject(promise, cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n }\n\n if (promise._state !== PENDING) {// noop\n } else if (hasCallback && succeeded) {\n resolve(promise, value);\n } else if (succeeded === false) {\n reject(promise, error);\n } else if (settled === FULFILLED) {\n fulfill(promise, value);\n } else if (settled === REJECTED) {\n reject(promise, value);\n }\n }\n\n function initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n resolve(promise, value);\n }, function rejectPromise(reason) {\n reject(promise, reason);\n });\n } catch (e) {\n reject(promise, e);\n }\n }\n\n var id = 0;\n\n function nextId() {\n return id++;\n }\n\n function makePromise(promise) {\n promise[PROMISE_ID] = id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n }\n\n function validationError() {\n return new Error('Array Methods must be provided an Array');\n }\n\n var Enumerator = function () {\n function Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(noop);\n\n if (!this.promise[PROMISE_ID]) {\n makePromise(this.promise);\n }\n\n if (isArray(input)) {\n this.length = input.length;\n this._remaining = input.length;\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n\n this._enumerate(input);\n\n if (this._remaining === 0) {\n fulfill(this.promise, this._result);\n }\n }\n } else {\n reject(this.promise, validationError());\n }\n }\n\n Enumerator.prototype._enumerate = function _enumerate(input) {\n for (var i = 0; this._state === PENDING && i < input.length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {\n var c = this._instanceConstructor;\n var resolve$$1 = c.resolve;\n\n if (resolve$$1 === resolve$1) {\n var _then = void 0;\n\n var error = void 0;\n var didError = false;\n\n try {\n _then = entry.then;\n } catch (e) {\n didError = true;\n error = e;\n }\n\n if (_then === then && entry._state !== PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof _then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === Promise$1) {\n var promise = new c(noop);\n\n if (didError) {\n reject(promise, error);\n } else {\n handleMaybeThenable(promise, entry, _then);\n }\n\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve$$1) {\n return resolve$$1(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve$$1(entry), i);\n }\n };\n\n Enumerator.prototype._settledAt = function _settledAt(state, i, value) {\n var promise = this.promise;\n\n if (promise._state === PENDING) {\n this._remaining--;\n\n if (state === REJECTED) {\n reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n fulfill(promise, this._result);\n }\n };\n\n Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {\n var enumerator = this;\n subscribe(promise, undefined, function (value) {\n return enumerator._settledAt(FULFILLED, i, value);\n }, function (reason) {\n return enumerator._settledAt(REJECTED, i, reason);\n });\n };\n\n return Enumerator;\n }();\n /**\n `Promise.all` accepts an array of promises, and returns a new promise which\n is fulfilled with an array of fulfillment values for the passed promises, or\n rejected with the reason of the first passed promise to be rejected. It casts all\n elements of the passed iterable to promises as it runs this algorithm.\n \n Example:\n \n ```javascript\n let promise1 = resolve(1);\n let promise2 = resolve(2);\n let promise3 = resolve(3);\n let promises = [ promise1, promise2, promise3 ];\n \n Promise.all(promises).then(function(array){\n // The array here would be [ 1, 2, 3 ];\n });\n ```\n \n If any of the `promises` given to `all` are rejected, the first promise\n that is rejected will be given as an argument to the returned promises's\n rejection handler. For example:\n \n Example:\n \n ```javascript\n let promise1 = resolve(1);\n let promise2 = reject(new Error(\"2\"));\n let promise3 = reject(new Error(\"3\"));\n let promises = [ promise1, promise2, promise3 ];\n \n Promise.all(promises).then(function(array){\n // Code here never runs because there are rejected promises!\n }, function(error) {\n // error.message === \"2\"\n });\n ```\n \n @method all\n @static\n @param {Array} entries array of promises\n @param {String} label optional string for labeling the promise.\n Useful for tooling.\n @return {Promise} promise that is fulfilled when all `promises` have been\n fulfilled, or rejected if any of them become rejected.\n @static\n */\n\n\n function all(entries) {\n return new Enumerator(this, entries).promise;\n }\n /**\n `Promise.race` returns a new promise which is settled in the same way as the\n first passed promise to settle.\n \n Example:\n \n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n \n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 2');\n }, 100);\n });\n \n Promise.race([promise1, promise2]).then(function(result){\n // result === 'promise 2' because it was resolved before promise1\n // was resolved.\n });\n ```\n \n `Promise.race` is deterministic in that only the state of the first\n settled promise matters. For example, even if other promises given to the\n `promises` array argument are resolved, but the first settled promise has\n become rejected before the other promises became fulfilled, the returned\n promise will become rejected:\n \n ```javascript\n let promise1 = new Promise(function(resolve, reject){\n setTimeout(function(){\n resolve('promise 1');\n }, 200);\n });\n \n let promise2 = new Promise(function(resolve, reject){\n setTimeout(function(){\n reject(new Error('promise 2'));\n }, 100);\n });\n \n Promise.race([promise1, promise2]).then(function(result){\n // Code here never runs\n }, function(reason){\n // reason.message === 'promise 2' because promise 2 became rejected before\n // promise 1 became fulfilled\n });\n ```\n \n An example real-world use case is implementing timeouts:\n \n ```javascript\n Promise.race([ajax('foo.json'), timeout(5000)])\n ```\n \n @method race\n @static\n @param {Array} promises array of promises to observe\n Useful for tooling.\n @return {Promise} a promise which settles in the same way as the first passed\n promise to settle.\n */\n\n\n function race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!isArray(entries)) {\n return new Constructor(function (_, reject) {\n return reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n }\n /**\n `Promise.reject` returns a promise rejected with the passed `reason`.\n It is shorthand for the following:\n \n ```javascript\n let promise = new Promise(function(resolve, reject){\n reject(new Error('WHOOPS'));\n });\n \n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n \n Instead of writing the above, your code now simply becomes the following:\n \n ```javascript\n let promise = Promise.reject(new Error('WHOOPS'));\n \n promise.then(function(value){\n // Code here doesn't run because the promise is rejected!\n }, function(reason){\n // reason.message === 'WHOOPS'\n });\n ```\n \n @method reject\n @static\n @param {Any} reason value that the returned promise will be rejected with.\n Useful for tooling.\n @return {Promise} a promise rejected with the given `reason`.\n */\n\n\n function reject$1(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(noop);\n reject(promise, reason);\n return promise;\n }\n\n function needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n function needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n \n Terminology\n -----------\n \n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n \n A promise can be in one of three states: pending, fulfilled, or rejected.\n \n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n \n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n \n \n Basic Usage:\n ------------\n \n ```js\n let promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n \n // on failure\n reject(reason);\n });\n \n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n \n Advanced Usage:\n ---------------\n \n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n \n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n let xhr = new XMLHttpRequest();\n \n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n \n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n \n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n \n Unlike callbacks, promises are great composable primitives.\n \n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n \n return values;\n });\n ```\n \n @class Promise\n @param {Function} resolver\n Useful for tooling.\n @constructor\n */\n\n\n var Promise$1 = function () {\n function Promise(resolver) {\n this[PROMISE_ID] = nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (noop !== resolver) {\n typeof resolver !== 'function' && needsResolver();\n this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n }\n }\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n let result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n let author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n\n\n Promise.prototype[\"catch\"] = function _catch(onRejection) {\n return this.then(null, onRejection);\n };\n /**\n `finally` will be invoked regardless of the promise's fate just as native\n try/catch/finally behaves\n \n Synchronous example:\n \n ```js\n findAuthor() {\n if (Math.random() > 0.5) {\n throw new Error();\n }\n return new Author();\n }\n \n try {\n return findAuthor(); // succeed or fail\n } catch(error) {\n return findOtherAuther();\n } finally {\n // always runs\n // doesn't affect the return value\n }\n ```\n \n Asynchronous example:\n \n ```js\n findAuthor().catch(function(reason){\n return findOtherAuther();\n }).finally(function(){\n // author was either found, or not\n });\n ```\n \n @method finally\n @param {Function} callback\n @return {Promise}\n */\n\n\n Promise.prototype[\"finally\"] = function _finally(callback) {\n var promise = this;\n var constructor = promise.constructor;\n\n if (isFunction(callback)) {\n return promise.then(function (value) {\n return constructor.resolve(callback()).then(function () {\n return value;\n });\n }, function (reason) {\n return constructor.resolve(callback()).then(function () {\n throw reason;\n });\n });\n }\n\n return promise.then(callback, callback);\n };\n\n return Promise;\n }();\n\n Promise$1.prototype.then = then;\n Promise$1.all = all;\n Promise$1.race = race;\n Promise$1.resolve = resolve$1;\n Promise$1.reject = reject$1;\n Promise$1._setScheduler = setScheduler;\n Promise$1._setAsap = setAsap;\n Promise$1._asap = asap;\n /*global self*/\n\n function polyfill() {\n var local = void 0;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P) {\n var promiseToString = null;\n\n try {\n promiseToString = Object.prototype.toString.call(P.resolve());\n } catch (e) {// silently ignored\n }\n\n if (promiseToString === '[object Promise]' && !P.cast) {\n return;\n }\n }\n\n local.Promise = Promise$1;\n } // Strange compat..\n\n\n Promise$1.polyfill = polyfill;\n Promise$1.Promise = Promise$1;\n return Promise$1;\n});","import \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.date.to-string\";\nimport \"core-js/modules/es6.object.to-string\";\n\n/**\r\n * Returns the object type of the given payload\r\n *\r\n * @param {*} payload\r\n * @returns {string}\r\n */\nfunction getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n/**\r\n * Returns whether the payload is undefined\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\n\n\nfunction isUndefined(payload) {\n return getType(payload) === 'Undefined';\n}\n/**\r\n * Returns whether the payload is null\r\n *\r\n * @param {*} payload\r\n * @returns {payload is null}\r\n */\n\n\nfunction isNull(payload) {\n return getType(payload) === 'Null';\n}\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is {[key: string]: any}}\r\n */\n\n\nfunction isPlainObject(payload) {\n if (getType(payload) !== 'Object') return false;\n return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;\n}\n/**\r\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is {[key: string]: any}}\r\n */\n\n\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\n/**\r\n * Returns whether the payload is an any kind of object (including special classes or objects with different prototypes)\r\n *\r\n * @param {*} payload\r\n * @returns {payload is {[key: string]: any}}\r\n */\n\n\nfunction isAnyObject(payload) {\n return getType(payload) === 'Object';\n}\n/**\r\n * Returns whether the payload is an object like a type passed in < >\r\n *\r\n * Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.\r\n *\r\n * @template T this must be passed in < >\r\n * @param {*} payload\r\n * @returns {payload is T}\r\n */\n\n\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\n/**\r\n * Returns whether the payload is a function\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Function}\r\n */\n\n\nfunction isFunction(payload) {\n return getType(payload) === 'Function';\n}\n/**\r\n * Returns whether the payload is an array\r\n *\r\n * @param {*} payload\r\n * @returns {payload is undefined}\r\n */\n\n\nfunction isArray(payload) {\n return getType(payload) === 'Array';\n}\n/**\r\n * Returns whether the payload is a string\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\n\n\nfunction isString(payload) {\n return getType(payload) === 'String';\n}\n/**\r\n * Returns whether the payload is a string, BUT returns false for ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\n\n\nfunction isFullString(payload) {\n return isString(payload) && payload !== '';\n}\n/**\r\n * Returns whether the payload is ''\r\n *\r\n * @param {*} payload\r\n * @returns {payload is string}\r\n */\n\n\nfunction isEmptyString(payload) {\n return payload === '';\n}\n/**\r\n * Returns whether the payload is a number\r\n *\r\n * This will return false for NaN\r\n *\r\n * @param {*} payload\r\n * @returns {payload is number}\r\n */\n\n\nfunction isNumber(payload) {\n return getType(payload) === 'Number' && !isNaN(payload);\n}\n/**\r\n * Returns whether the payload is a boolean\r\n *\r\n * @param {*} payload\r\n * @returns {payload is boolean}\r\n */\n\n\nfunction isBoolean(payload) {\n return getType(payload) === 'Boolean';\n}\n/**\r\n * Returns whether the payload is a regular expression\r\n *\r\n * @param {*} payload\r\n * @returns {payload is RegExp}\r\n */\n\n\nfunction isRegExp(payload) {\n return getType(payload) === 'RegExp';\n}\n/**\r\n * Returns whether the payload is a Symbol\r\n *\r\n * @param {*} payload\r\n * @returns {payload is symbol}\r\n */\n\n\nfunction isSymbol(payload) {\n return getType(payload) === 'Symbol';\n}\n/**\r\n * Returns whether the payload is a date, and that the date is Valid\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Date}\r\n */\n\n\nfunction isDate(payload) {\n return getType(payload) === 'Date' && !isNaN(payload);\n}\n/**\r\n * Returns whether the payload is a blob\r\n *\r\n * @param {*} payload\r\n * @returns {payload is Blob}\r\n */\n\n\nfunction isBlob(payload) {\n return getType(payload) === 'Blob';\n}\n/**\r\n * Returns whether the payload is a file\r\n *\r\n * @param {*} payload\r\n * @returns {payload is File}\r\n */\n\n\nfunction isFile(payload) {\n return getType(payload) === 'File';\n}\n/**\r\n * Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is boolean | null | undefined | number | string | symbol)}\r\n */\n\n\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\n/**\r\n * Returns true whether the payload is null or undefined\r\n *\r\n * @param {*} payload\r\n * @returns {(payload is null | undefined)}\r\n */\n\n\nfunction isNullOrUndefined(payload) {\n return isNull(payload) || isUndefined(payload);\n}\n/**\r\n * Does a generic check to check that the given payload is of a given type.\r\n * In cases like Number, it will return true for NaN as NaN is a Number (thanks javascript!);\r\n * It will, however, differentiate between object and null\r\n *\r\n * @template T\r\n * @param {*} payload\r\n * @param {T} type\r\n * @throws {TypeError} Will throw type error if type is an invalid type\r\n * @returns {payload is T}\r\n */\n\n\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError('Type must be a function');\n }\n\n if (!Object.prototype.hasOwnProperty.call(type, 'prototype')) {\n throw new TypeError('Type is not a class');\n } // Classes usually have names (as functions usually have names)\n\n\n var name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyString, isFile, isFullString, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isRegExp, isString, isSymbol, isType, isUndefined };","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/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/es6.array.reduce\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.array.for-each\";\nimport \"core-js/modules/es6.object.define-property\";\nimport { isPlainObject, isArray, isSymbol } from 'is-what';\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\n\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {\n r[k] = a[j];\n }\n }\n\n return r;\n}\n\nfunction assignProp(carry, key, newVal, originalObject) {\n var propType = originalObject.propertyIsEnumerable(key) ? 'enumerable' : 'nonenumerable';\n if (propType === 'enumerable') carry[key] = newVal;\n\n if (propType === 'nonenumerable') {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n}\n\nfunction mergeRecursively(origin, newComer, extensions) {\n // work directly on newComer if its not an object\n if (!isPlainObject(newComer)) {\n // extend merge rules\n if (extensions && isArray(extensions)) {\n extensions.forEach(function (extend) {\n newComer = extend(origin, newComer);\n });\n }\n\n return newComer;\n } // define newObject to merge all values upon\n\n\n var newObject = {};\n\n if (isPlainObject(origin)) {\n var props_1 = Object.getOwnPropertyNames(origin);\n var symbols_1 = Object.getOwnPropertySymbols(origin);\n newObject = __spreadArrays(props_1, symbols_1).reduce(function (carry, key) {\n // @ts-ignore\n var targetVal = origin[key];\n\n if (!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key) || isSymbol(key) && !Object.getOwnPropertySymbols(newComer).includes(key)) {\n assignProp(carry, key, targetVal, origin);\n }\n\n return carry;\n }, {});\n }\n\n var props = Object.getOwnPropertyNames(newComer);\n var symbols = Object.getOwnPropertySymbols(newComer);\n\n var result = __spreadArrays(props, symbols).reduce(function (carry, key) {\n // re-define the origin and newComer as targetVal and newVal\n var newVal = newComer[key];\n var targetVal = isPlainObject(origin) ? // @ts-ignore\n origin[key] : undefined; // extend merge rules\n\n if (extensions && isArray(extensions)) {\n extensions.forEach(function (extend) {\n newVal = extend(targetVal, newVal);\n });\n } // When newVal is an object do the merge recursively\n\n\n if (targetVal !== undefined && isPlainObject(newVal)) {\n newVal = mergeRecursively(targetVal, newVal, extensions);\n }\n\n assignProp(carry, key, newVal, newComer);\n return carry;\n }, newObject);\n\n return result;\n}\n/**\r\n * Merge anything recursively.\r\n * Objects get merged, special objects (classes etc.) are re-assigned \"as is\".\r\n * Basic types overwrite objects or other basic types.\r\n *\r\n * @param {(IConfig | any)} origin\r\n * @param {...any[]} newComers\r\n * @returns the result\r\n */\n\n\nfunction merge(origin) {\n var newComers = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n newComers[_i - 1] = arguments[_i];\n }\n\n var extensions = null;\n var base = origin;\n\n if (isPlainObject(origin) && origin.extensions && Object.keys(origin).length === 1) {\n base = {};\n extensions = origin.extensions;\n }\n\n return newComers.reduce(function (result, newComer) {\n return mergeRecursively(result, newComer, extensions);\n }, base);\n}\n\nfunction concatArrays(originVal, newVal) {\n if (isArray(originVal) && isArray(newVal)) {\n // concat logic\n return originVal.concat(newVal);\n }\n\n return newVal; // always return newVal as fallback!!\n}\n\nexport default merge;\nexport { concatArrays, merge };","/**\n * Helpers.\n */\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options[\"long\"] ? fmtLong(val) : fmtShort(val);\n }\n\n throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));\n};\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\n\nfunction parse(str) {\n str = String(str);\n\n if (str.length > 100) {\n return;\n }\n\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n\n if (!match) {\n return;\n }\n\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n\n default:\n return undefined;\n }\n}\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n\n return ms + 'ms';\n}\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';\n}\n/**\n * Pluralization helper.\n */\n\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n\n return Math.ceil(ms / n) + ' ' + name + 's';\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;","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 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 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}","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 { 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 _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 'fast-deep-equal';\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 =\n /*#__PURE__*/\n 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.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 createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\n/**\n * The `connectStateResults` connector provides a way to access the `searchState` and the `searchResults`\n * of InstantSearch.\n * For instance this connector allows you to create results/noResults or query/noQuery pages.\n * @name connectStateResults\n * @kind connector\n * @providedPropType {object} searchState - The search state of the instant search component. <br/><br/> See: [Search state structure](https://community.algolia.com/react-instantsearch/guide/Search_state.html)\n * @providedPropType {object} searchResults - The search results. <br/><br/> In case of multiple indices: if used under `<Index>`, results will be those of the corresponding index otherwise it'll be those of the root index See: [Search results structure](https://community.algolia.com/algoliasearch-helper-js/reference.html#searchresults)\n * @providedPropType {object} allSearchResults - In case of multiple indices you can retrieve all the results\n * @providedPropType {string} error - If the search failed, the error will be logged here.\n * @providedPropType {boolean} searching - If there is a search in progress.\n * @providedPropType {boolean} isSearchStalled - Flag that indicates if React InstantSearch has detected that searches are stalled.\n * @providedPropType {boolean} searchingForFacetValues - If there is a search in a list in progress.\n * @providedPropType {object} props - component props.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectStateResults } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const Content = connectStateResults(({ searchState, searchResults }) => {\n * const hasResults = searchResults && searchResults.nbHits !== 0;\n *\n * return (\n * <div>\n * <div hidden={!hasResults}>\n * <Hits />\n * </div>\n * <div hidden={hasResults}>\n * <div>No results has been found for {searchState.query}</div>\n * </div>\n * </div>\n * );\n * });\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox />\n * <Content />\n * </InstantSearch>\n * );\n */\n\nexport default createConnector({\n displayName: 'AlgoliaStateResults',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n searchState: searchState,\n searchResults: results,\n allSearchResults: searchResults.results,\n searching: searchResults.searching,\n isSearchStalled: searchResults.isSearchStalled,\n error: searchResults.error,\n searchingForFacetValues: searchResults.searchingForFacetValues,\n props: props\n };\n }\n});","import \"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.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 detatch 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 requestsWithSeriazizedParams = 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: [requestsWithSeriazizedParams].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.3.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 \"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 'fast-deep-equal';\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 =\n/*#__PURE__*/\nfunction (_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;","import \"core-js/modules/es6.function.bind\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport React, { Component, Children } from 'react';\nimport PropTypes from 'prop-types';\nimport { InstantSearchConsumer, IndexProvider } from '../core/context';\n\nfunction getIndexContext(props) {\n return {\n targetedIndex: props.indexId\n };\n}\n/**\n * The component that allows you to apply widgets to a dedicated index. It's\n * useful if you want to build an interface that targets multiple indices.\n *\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Index, SearchBox, Hits, Configure } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <Configure hitsPerPage={5} />\n * <SearchBox />\n * <Index indexName=\"instant_search\">\n * <Hits />\n * </Index>\n * <Index indexName=\"bestbuy\">\n * <Hits />\n * </Index>\n * </InstantSearch>\n * );\n */\n\n\nvar Index =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Index, _Component);\n\n _createClass(Index, null, [{\n key: \"getDerivedStateFromProps\",\n value: function getDerivedStateFromProps(props) {\n return {\n indexContext: getIndexContext(props)\n };\n }\n }]);\n\n function Index(props) {\n var _this;\n\n _classCallCheck(this, Index);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Index).call(this, props));\n\n _defineProperty(_assertThisInitialized(_this), \"state\", {\n indexContext: getIndexContext(_this.props)\n });\n\n _defineProperty(_assertThisInitialized(_this), \"unregisterWidget\", void 0);\n\n _this.props.contextValue.onSearchParameters(_this.getSearchParameters.bind(_assertThisInitialized(_this)), {\n ais: _this.props.contextValue,\n multiIndexContext: _this.state.indexContext\n }, _this.props);\n\n return _this;\n }\n\n _createClass(Index, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.unregisterWidget = this.props.contextValue.widgetsManager.registerWidget(this);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.props.indexName !== prevProps.indexName) {\n this.props.contextValue.widgetsManager.update();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (typeof this.unregisterWidget === 'function') {\n this.unregisterWidget();\n }\n }\n }, {\n key: \"getSearchParameters\",\n value: function getSearchParameters(searchParameters, props) {\n return searchParameters.setIndex(this.props ? this.props.indexName : props.indexName);\n }\n }, {\n key: \"render\",\n value: function render() {\n var childrenCount = Children.count(this.props.children);\n\n if (childrenCount === 0) {\n return null;\n }\n\n return React.createElement(IndexProvider, {\n value: this.state.indexContext\n }, this.props.children);\n }\n }]);\n\n return Index;\n}(Component);\n\n_defineProperty(Index, \"propTypes\", {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string.isRequired,\n children: PropTypes.node\n});\n\nvar IndexWrapper = function IndexWrapper(props) {\n var inferredIndexId = props.indexName;\n return React.createElement(InstantSearchConsumer, null, function (contextValue) {\n return React.createElement(Index, _extends({\n contextValue: contextValue,\n indexId: inferredIndexId\n }, props));\n });\n};\n\nIndexWrapper.propTypes = {\n indexName: PropTypes.string.isRequired,\n indexId: PropTypes.string\n};\nexport var IndexComponentWithoutContext = Index;\nexport default IndexWrapper;","import createConnector from '../core/createConnector';\nimport { getResults } from '../core/indexUtils';\nimport { addAbsolutePositions, addQueryID } from '../core/utils';\n/**\n * connectHits connector provides the logic to create connected\n * components that will render the results retrieved from\n * Algolia.\n *\n * To configure the number of hits retrieved, use [HitsPerPage widget](widgets/HitsPerPage.html),\n * [connectHitsPerPage connector](connectors/connectHitsPerPage.html) or pass the hitsPerPage\n * prop to a [Configure](guide/Search_parameters.html) widget.\n *\n * **Warning:** you will need to use the **objectID** property available on every hit as a key\n * when iterating over them. This will ensure you have the best possible UI experience\n * especially on slow networks.\n * @name connectHits\n * @kind connector\n * @providedPropType {array.<object>} hits - the records that matched the search state\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, Highlight, connectHits } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n * const CustomHits = connectHits(({ hits }) => (\n * <div>\n * {hits.map(hit =>\n * <p key={hit.objectID}>\n * <Highlight attribute=\"name\" hit={hit} />\n * </p>\n * )}\n * </div>\n * ));\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <CustomHits />\n * </InstantSearch>\n * );\n */\n\nexport default createConnector({\n displayName: 'AlgoliaHits',\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n var results = getResults(searchResults, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n\n if (!results) {\n return {\n hits: []\n };\n }\n\n var hitsWithPositions = addAbsolutePositions(results.hits, results.hitsPerPage, results.page);\n var hitsWithPositionsAndQueryID = addQueryID(hitsWithPositions, results.queryID);\n return {\n hits: hitsWithPositionsAndQueryID\n };\n },\n\n /**\n * Hits needs to be considered as a widget to trigger a search,\n * even if no other widgets are used.\n *\n * To be considered as a widget you need either:\n * - getSearchParameters\n * - getMetadata\n * - transitionState\n *\n * See: createConnector.tsx\n */\n getSearchParameters: function getSearchParameters(searchParameters) {\n return searchParameters;\n }\n});","import \"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/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 \"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 \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.promise\";\nimport \"core-js/modules/es6.object.to-string\";\nimport \"core-js/modules/es6.object.define-property\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.object.assign\";\nimport \"core-js/modules/es6.object.create\";\nimport \"core-js/modules/es6.object.set-prototype-of\";\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nvar _assign = function __assign() {\n _assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return _assign.apply(this, arguments);\n};\n\nexport { _assign as __assign };\nexport function __rest(s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {\n if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n }\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nexport function __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nexport function __awaiter(thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n\n function step(result) {\n result.done ? resolve(result.value) : new P(function (resolve) {\n resolve(result.value);\n }).then(fulfilled, rejected);\n }\n\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nexport function __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function sent() {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n\n while (_) {\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n\n case 7:\n op = _.ops.pop();\n\n _.trys.pop();\n\n continue;\n\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n\n if (t && _.label < t[2]) {\n _.label = t[2];\n\n _.ops.push(op);\n\n break;\n }\n\n if (t[2]) _.ops.pop();\n\n _.trys.pop();\n\n continue;\n }\n\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n }\n\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nexport function __exportStar(m, exports) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\nexport function __values(o) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator],\n i = 0;\n if (m) return m.call(o);\n return {\n next: function next() {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n}\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {\n ar.push(r.value);\n }\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n\n return ar;\n}\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) {\n ar = ar.concat(__read(arguments[i]));\n }\n\n return ar;\n}\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) {\n s += arguments[i].length;\n }\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) {\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {\n r[k] = a[j];\n }\n }\n\n return r;\n}\n;\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n\n function fulfill(value) {\n resume(\"next\", value);\n }\n\n function reject(value) {\n resume(\"throw\", value);\n }\n\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: n === \"return\"\n } : f ? f(v) : v;\n } : f;\n }\n}\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n\n return cooked;\n}\n;\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) {\n if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n }\n result[\"default\"] = mod;\n return result;\n}\nexport function __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n}","import _taggedTemplateLiteral from \"/home/paulo_mariano/others/r/reativa-new-plataform/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral\";\nimport \"core-js/modules/es6.object.assign\";\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.reduce\";\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"\\n display: inline-block;\\n vertical-align: \", \";\\n overflow: hidden;\\n\"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nimport { __rest } from \"tslib\";\nimport * as React from 'react';\nimport styled from 'styled-components';\nimport validProp from '@emotion/is-prop-valid';\n\nfunction isValidProp(key) {\n return validProp(key);\n}\n\nfunction filterSVGProps(props) {\n return Object.keys(props).reduce(function (p, k) {\n if (isValidProp(k)) {\n // hack to satisfy TypeScript complexity\n ;\n p[k] = props[k];\n }\n\n return p;\n }, {});\n}\n\nvar StyledIconBaseBase = React.forwardRef(function (props, ref) {\n var children = props.children,\n iconAttrs = props.iconAttrs,\n iconVerticalAlign = props.iconVerticalAlign,\n iconViewBox = props.iconViewBox,\n size = props.size,\n title = props.title,\n otherProps = __rest(props, [\"children\", \"iconAttrs\", \"iconVerticalAlign\", \"iconViewBox\", \"size\", \"title\"]);\n\n var iconProps = Object.assign({\n viewBox: iconViewBox,\n height: props.height !== undefined ? props.height : size,\n width: props.width !== undefined ? props.width : size,\n 'aria-hidden': title == null ? 'true' : undefined,\n focusable: 'false',\n role: title != null ? 'img' : undefined\n }, iconAttrs);\n var svgProps = filterSVGProps(otherProps);\n return React.createElement(\"svg\", Object.assign({}, iconProps, svgProps, {\n ref: ref\n }), title && React.createElement(\"title\", {\n key: \"icon-title\"\n }, title), children);\n});\nexport var StyledIconBase = styled(StyledIconBaseBase)(_templateObject(), function (props) {\n return props.iconVerticalAlign;\n});","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\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 React from \"react\"\nimport { Algolia } from \"styled-icons/fa-brands/Algolia\"\nimport \"../styles.css\";\n\nexport const PoweredBy = () => (\n <span className='poweredBy'>\n Powered by{` `}\n <a href=\"https://algolia.com\">\n <Algolia size=\"1em\" /> Algolia\n </a>\n </span>\n)\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { StyledIconBase } from '@styled-icons/styled-icon';\nexport var Search = 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 512 512\"\n }, props, {\n ref: ref\n }), React.createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z\",\n key: \"k0\"\n }));\n});\nSearch.displayName = 'Search';\nexport var SearchDimensions = {\n height: undefined,\n width: undefined\n};","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport PropTypes from 'prop-types';\nimport createConnector from '../core/createConnector';\nimport { cleanUpValue, refineValue, getCurrentRefinementValue, getIndexId } from '../core/indexUtils';\n\nfunction getId() {\n return 'query';\n}\n\nfunction getCurrentRefinement(props, searchState, context) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinementValue(props, searchState, context, id, '');\n\n if (currentRefinement) {\n return currentRefinement;\n }\n\n return '';\n}\n\nfunction _refine(props, searchState, nextRefinement, context) {\n var id = getId();\n\n var nextValue = _defineProperty({}, id, nextRefinement);\n\n var resetPage = true;\n return refineValue(searchState, nextValue, context, resetPage);\n}\n\nfunction _cleanUp(props, searchState, context) {\n return cleanUpValue(searchState, context, getId());\n}\n/**\n * connectSearchBox connector provides the logic to build a widget that will\n * let the user search for a query\n * @name connectSearchBox\n * @kind connector\n * @propType {string} [defaultRefinement] - Provide a default value for the query\n * @providedPropType {function} refine - a function to change the current query\n * @providedPropType {string} currentRefinement - the current query used\n * @providedPropType {boolean} isSearchStalled - a flag that indicates if InstantSearch has detected that searches are stalled\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaSearchBox',\n propTypes: {\n defaultRefinement: PropTypes.string\n },\n getProvidedProps: function getProvidedProps(props, searchState, searchResults) {\n return {\n currentRefinement: getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n isSearchStalled: searchResults.isSearchStalled\n };\n },\n refine: function refine(props, searchState, nextRefinement) {\n return _refine(props, searchState, nextRefinement, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n cleanUp: function cleanUp(props, searchState) {\n return _cleanUp(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n getSearchParameters: function getSearchParameters(searchParameters, props, searchState) {\n return searchParameters.setQuery(getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }));\n },\n getMetadata: function getMetadata(props, searchState) {\n var id = getId(props);\n var currentRefinement = getCurrentRefinement(props, searchState, {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n return {\n id: id,\n index: getIndexId({\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n }),\n items: currentRefinement === null ? [] : [{\n label: \"\".concat(id, \": \").concat(currentRefinement),\n value: function value(nextState) {\n return _refine(props, nextState, '', {\n ais: props.contextValue,\n multiIndexContext: props.indexContextValue\n });\n },\n currentRefinement: currentRefinement\n }]\n };\n }\n});","import React from \"react\"\nimport { connectSearchBox } from \"react-instantsearch-dom\"\n\nimport styled from \"@emotion/styled\";\nimport { css } from \"@emotion/core\";\nimport { Search } from \"styled-icons/fa-solid/Search\";\n\nconst SearchIcon = styled(Search)`\n width: 1em;\n pointer-events: none;\n margin-right: 10px\n`\nconst focus = (props) => css`\n background: white;\n color: ${props => props.theme.darkBlue};\n cursor: text;\n width: 5em;\n + ${SearchIcon} {\n color: ${props => props.theme.darkBlue};\n margin: 0.3em;\n }\n`\nconst collapse = (props) => css`\n width: 0;\n cursor: pointer;\n color: ${props => props.theme.lightBlue};\n + ${SearchIcon} {\n color: white;\n }\n ${props => props.focus && focus()}\n margin-left: ${props => (props.focus ? `-1.6em` : `-1em`)};\n padding-left: ${props => (props.focus ? `1.6em` : `1em`)};\n ::placeholder {\n color: ${props => props.theme.gray};\n }\n`\nconst expand = (props) => css`\n background: ${props => props.theme.veryLightGray};\n width: 6em;\n margin-left: -1.6em;\n padding-left: 1.6em;\n + ${SearchIcon} {\n margin: 0.3em;\n }\n`\n\nconst collapseExpand = (props) => css`\n ${props => (props.collapse ? collapse() : expand())}\n`\n\nconst Input = styled.input`\n outline: none;\n border: none;\n font-size: 1em;\n background: white;\n transition: ${props => props.theme.shortTrans};\n border-radius: ${props => props.theme.smallBorderRadius};\n {collapseExpand}\n`\nconst Form = styled.form`\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n @media only screen and (max-width: 767px) {\n width: 100%;\n margin-left: 15px;\n }\n`\n\nexport default connectSearchBox(({ refine, ...rest }) => {\n const preventSubmit = (e) => {\n e.preventDefault();\n }\n return (\n <Form className={'formElement'} onSubmit={preventSubmit}>\n <SearchIcon />\n <Input\n className={'searchInput '}\n type=\"text\"\n placeholder=\"Search\"\n aria-label=\"Search\"\n onChange={e => refine(e.target.value)}\n {...rest}\n />\n </Form>\n )}\n);","import createConnector from '../core/createConnector';\nimport { HIGHLIGHT_TAGS, parseAlgoliaHit } from '../core/highlight';\n\nvar highlight = function highlight(_ref) {\n var attribute = _ref.attribute,\n hit = _ref.hit,\n highlightProperty = _ref.highlightProperty,\n _ref$preTag = _ref.preTag,\n preTag = _ref$preTag === void 0 ? HIGHLIGHT_TAGS.highlightPreTag : _ref$preTag,\n _ref$postTag = _ref.postTag,\n postTag = _ref$postTag === void 0 ? HIGHLIGHT_TAGS.highlightPostTag : _ref$postTag;\n return parseAlgoliaHit({\n attribute: attribute,\n highlightProperty: highlightProperty,\n hit: hit,\n preTag: preTag,\n postTag: postTag\n });\n};\n/**\n * connectHighlight connector provides the logic to create an highlighter\n * component that will retrieve, parse and render an highlighted attribute\n * from an Algolia hit.\n * @name connectHighlight\n * @kind connector\n * @category connector\n * @providedPropType {function} highlight - function to retrieve and parse an attribute from a hit. It takes a configuration object with 3 attributes: `highlightProperty` which is the property that contains the highlight structure from the records, `attribute` which is the name of the attribute (it can be either a string or an array of strings) to look for and `hit` which is the hit from Algolia. It returns an array of objects `{value: string, isHighlighted: boolean}`. If the element that corresponds to the attribute is an array of strings, it will return a nested array of objects.\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, connectHighlight } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const CustomHighlight = connectHighlight(\n * ({ highlight, attribute, hit, highlightProperty }) => {\n * const highlights = highlight({\n * highlightProperty: '_highlightResult',\n * attribute,\n * hit\n * });\n *\n * return highlights.map(part => part.isHighlighted ? (\n * <mark>{part.value}</mark>\n * ) : (\n * <span>{part.value}</span>\n * ));\n * }\n * );\n *\n * const Hit = ({ hit }) => (\n * <p>\n * <CustomHighlight attribute=\"name\" hit={hit} />\n * </p>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\n\nexport default createConnector({\n displayName: 'AlgoliaHighlighter',\n propTypes: {},\n getProvidedProps: function getProvidedProps() {\n return {\n highlight: highlight\n };\n }\n});","import \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.array.map\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nexport var Highlight = function Highlight(_ref) {\n var cx = _ref.cx,\n value = _ref.value,\n highlightedTagName = _ref.highlightedTagName,\n isHighlighted = _ref.isHighlighted,\n nonHighlightedTagName = _ref.nonHighlightedTagName;\n var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;\n var className = isHighlighted ? 'highlighted' : 'nonHighlighted';\n return React.createElement(TagName, {\n className: cx(className)\n }, value);\n};\nHighlight.propTypes = {\n cx: PropTypes.func.isRequired,\n value: PropTypes.string.isRequired,\n isHighlighted: PropTypes.bool.isRequired,\n highlightedTagName: PropTypes.string.isRequired,\n nonHighlightedTagName: PropTypes.string.isRequired\n};\n\nvar Highlighter = function Highlighter(_ref2) {\n var cx = _ref2.cx,\n hit = _ref2.hit,\n attribute = _ref2.attribute,\n highlight = _ref2.highlight,\n highlightProperty = _ref2.highlightProperty,\n tagName = _ref2.tagName,\n nonHighlightedTagName = _ref2.nonHighlightedTagName,\n separator = _ref2.separator,\n className = _ref2.className;\n var parsedHighlightedValue = highlight({\n hit: hit,\n attribute: attribute,\n highlightProperty: highlightProperty\n });\n return React.createElement(\"span\", {\n className: classNames(cx(''), className)\n }, parsedHighlightedValue.map(function (item, i) {\n if (Array.isArray(item)) {\n var isLast = i === parsedHighlightedValue.length - 1;\n return React.createElement(\"span\", {\n key: i\n }, item.map(function (element, index) {\n return React.createElement(Highlight, {\n cx: cx,\n key: index,\n value: element.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: element.isHighlighted\n });\n }), !isLast && React.createElement(\"span\", {\n className: cx('separator')\n }, separator));\n }\n\n return React.createElement(Highlight, {\n cx: cx,\n key: i,\n value: item.value,\n highlightedTagName: tagName,\n nonHighlightedTagName: nonHighlightedTagName,\n isHighlighted: item.isHighlighted\n });\n }));\n};\n\nHighlighter.propTypes = {\n cx: PropTypes.func.isRequired,\n hit: PropTypes.object.isRequired,\n attribute: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.string]).isRequired,\n highlight: PropTypes.func.isRequired,\n highlightProperty: PropTypes.string.isRequired,\n tagName: PropTypes.string,\n nonHighlightedTagName: PropTypes.string,\n className: PropTypes.string,\n separator: PropTypes.node\n};\nHighlighter.defaultProps = {\n tagName: 'em',\n nonHighlightedTagName: 'span',\n className: '',\n separator: ', '\n};\nexport default Highlighter;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Highlight');\n\nvar Highlight = function Highlight(props) {\n return React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_highlightResult\",\n cx: cx\n }));\n};\n\nexport default Highlight;","import { connectHighlight } from 'react-instantsearch-core';\nimport Highlight from '../components/Highlight';\n/**\n * Renders any attribute from a hit into its highlighted form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Highlight\n * @kind widget\n * @propType {string} attribute - location of the highlighted attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the hit\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Highlight - root of the component\n * @themeKey ais-Highlight-highlighted - part of the text which is highlighted\n * @themeKey ais-Highlight-nonHighlighted - part of the text that is not highlighted\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Highlight } from 'react-instantsearch-dom';\n *\n * const Hit = ({ hit }) => (\n * <div>\n * <Highlight attribute=\"name\" hit={hit} />\n * </div>\n * );\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"Pho\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Highlight);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { createClassNames } from '../core/utils';\nimport Highlighter from './Highlighter';\nvar cx = createClassNames('Snippet');\n\nvar Snippet = function Snippet(props) {\n return React.createElement(Highlighter, _extends({}, props, {\n highlightProperty: \"_snippetResult\",\n cx: cx\n }));\n};\n\nexport default Snippet;","import { connectHighlight } from 'react-instantsearch-core';\nimport Snippet from '../components/Snippet';\n/**\n * Renders any attribute from an hit into its highlighted snippet form when relevant.\n *\n * Read more about it in the [Highlighting results](guide/Highlighting_results.html) guide.\n * @name Snippet\n * @kind widget\n * @requirements To use this widget, the attribute name passed to the `attribute` prop must be\n * present in \"Attributes to snippet\" on the Algolia dashboard or configured as `attributesToSnippet`\n * via a set settings call to the Algolia API.\n * @propType {string} attribute - location of the highlighted snippet attribute in the hit (the corresponding element can be either a string or an array of strings)\n * @propType {object} hit - hit object containing the highlighted snippet attribute\n * @propType {string} [tagName='em'] - tag to be used for highlighted parts of the attribute\n * @propType {string} [nonHighlightedTagName='span'] - tag to be used for the parts of the hit that are not highlighted\n * @propType {node} [separator=',<space>'] - symbol used to separate the elements of the array in case the attribute points to an array of strings.\n * @themeKey ais-Snippet - the root span of the widget\n * @themeKey ais-Snippet-highlighted - the highlighted text\n * @themeKey ais-Snippet-nonHighlighted - the normal text\n * @example\n * import React from 'react';\n * import algoliasearch from 'algoliasearch/lite';\n * import { InstantSearch, SearchBox, Hits, Snippet } from 'react-instantsearch-dom';\n *\n * const searchClient = algoliasearch(\n * 'latency',\n * '6be0576ff61c053d5f9a3225e2a90f76'\n * );\n *\n * const Hit = ({ hit }) => (\n * <div>\n * <Snippet attribute=\"description\" hit={hit} />\n * </div>\n * );\n *\n * const App = () => (\n * <InstantSearch\n * searchClient={searchClient}\n * indexName=\"instant_search\"\n * >\n * <SearchBox defaultRefinement=\"adjustable\" />\n * <Hits hitComponent={Hit} />\n * </InstantSearch>\n * );\n */\n\nexport default connectHighlight(Snippet);","import React, { Fragment } from \"react\"\nimport { Highlight, Snippet } from \"react-instantsearch-dom\"\nimport { Link } from \"gatsby\"\n\nexport const PageHit = clickHandler => ({ hit }) => (\n <div>\n <Link to={hit.slug} onClick={clickHandler}>\n <div>\n <Highlight attribute=\"title\" hit={hit} tagName=\"mark\" />\n </div>\n </Link>\n <Snippet attribute=\"excerpt\" hit={hit} tagName=\"mark\" />\n </div>\n)\n","import React, { useState, useEffect, createRef } from \"react\";\nimport {\n InstantSearch,\n Index,\n Hits,\n Configure,\n Pagination,\n connectStateResults,\n} from \"react-instantsearch-dom\";\nimport algoliasearch from \"algoliasearch/lite\";\nimport config from \"../../../config.js\";\n\nimport styled from \"@emotion/styled\";\nimport { css } from \"@emotion/core\";\nimport { PoweredBy } from \"./styles\"\nimport { Search } from \"styled-icons/fa-solid/Search\"\nimport Input from \"./input\"\nimport * as hitComps from \"./hitComps\"\nimport '../styles.css';\n\nconst SearchIcon = styled(Search)`\n width: 1em;\n pointer-events: none;\n`;\n\nconst HitsWrapper = styled.div`\n display: ${props => (props.show ? `grid` : `none`)};\n max-height: 80vh;\n overflow: scroll;\n z-index: 2;\n -webkit-overflow-scrolling: touch;\n position: absolute;\n right: 0;\n top: calc(100% + 0.5em);\n width: 80vw;\n max-width: 30em;\n box-shadow: 0 0 5px 0;\n padding: 0.7em 1em 0.4em;\n background: white;\n @media only screen and (max-width: 991px) {\n width: 400px;\n max-width: 400px;\n }\n @media only screen and (max-width: 767px) {\n width: 100%;\n max-width: 500px;\n }\n border-radius: ${props => props.theme.smallBorderRadius};\n > * + * {\n padding-top: 1em !important;\n border-top: 2px solid ${props => props.theme.darkGray};\n }\n li + li {\n margin-top: 0.7em;\n padding-top: 0.7em;\n border-top: 1px solid ${props => props.theme.lightGray};\n }\n * {\n margin-top: 0;\n padding: 0;\n color: black !important;\n }\n ul {\n list-style: none;\n }\n mark {\n color: ${props => props.theme.lightBlue};\n background: ${props => props.theme.darkBlue};\n }\n header {\n display: flex;\n justify-content: space-between;\n margin-bottom: 0.3em;\n h3 {\n color: black;\n background: ${props => props.theme.gray};\n padding: 0.1em 0.4em;\n border-radius: ${props => props.theme.smallBorderRadius};\n }\n }\n h3 {\n color: black;\n margin: 0 0 0.5em;\n }\n h4 {\n color: black;\n margin-bottom: 0.3em;\n }\n`\nconst Root = styled.div`\n position: relative;\n display: grid;\n grid-gap: 1em;\n @media only screen and (max-width: 767px) {\n width: 100%;\n }\n`\n\nconst Results = connectStateResults(\n ({ searching, searchState: state, searchResults: res }) =>\n (searching && `Searching...`) ||\n (res && res.nbHits === 0 && `No results for '${state.query}'`)\n)\n\nconst useClickOutside = (ref, handler, events) => {\n if (!events) events = [`mousedown`, `touchstart`]\n const detectClickOutside = event =>\n ref && ref.current && !ref.current.contains(event.target) && handler()\n useEffect(() => {\n for (const event of events)\n document.addEventListener(event, detectClickOutside)\n return () => {\n for (const event of events)\n document.removeEventListener(event, detectClickOutside)\n }\n })\n}\n\nexport default function SearchComponent({ indices, collapse, hitsAsGrid }) {\n const ref = createRef()\n const [query, setQuery] = useState(``)\n const [focus, setFocus] = useState(false)\n const searchClient = algoliasearch(\n config.header.search.algoliaAppId,\n config.header.search.algoliaSearchKey\n )\n useClickOutside(ref, () => setFocus(false))\n const displayResult = (query.length > 0 && focus) ? 'showResults' : 'hideResults';\n return (\n <InstantSearch\n searchClient={searchClient}\n indexName={indices[0].name}\n onSearchStateChange={({ query }) => setQuery(query)}\n root={{ Root, props: { ref } }}\n >\n <Input onFocus={() => setFocus(true)} {...{ collapse, focus }} />\n <HitsWrapper className={'hitWrapper ' + displayResult} show={query.length > 0 && focus} asGrid={hitsAsGrid}>\n {indices.map(({ name, title, hitComp, type }) => {\n return (\n <Index key={name} indexName={name}>\n <Results />\n <Hits hitComponent={hitComps[hitComp](() => setFocus(false))} />\n </Index>\n )})}\n <PoweredBy />\n </HitsWrapper>\n <Configure hitsPerPage={5} />\n </InstantSearch>\n )\n}\n","'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;","require(\"core-js/modules/es6.regexp.replace\");\n\nmodule.exports = function deprecatedMessage(previousUsage, newUsage) {\n var githubAnchorLink = previousUsage.toLowerCase().replace(/[\\.\\(\\)]/g, '');\n return 'algoliasearch: `' + previousUsage + '` was replaced by `' + newUsage + '`. Please see https://github.com/algolia/algoliasearch-client-javascript/wiki/Deprecated#' + githubAnchorLink;\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;","var foreach = require('foreach');\n\nmodule.exports = function merge(destination\n/* , sources */\n) {\n var sources = Array.prototype.slice.call(arguments);\n foreach(sources, function (source) {\n for (var keyName in source) {\n if (source.hasOwnProperty(keyName)) {\n if (typeof destination[keyName] === 'object' && typeof source[keyName] === 'object') {\n destination[keyName] = merge({}, destination[keyName], source[keyName]);\n } else if (source[keyName] !== undefined) {\n destination[keyName] = source[keyName];\n }\n }\n }\n });\n return destination;\n};","require(\"core-js/modules/es6.regexp.replace\");\n\nrequire(\"core-js/modules/es6.regexp.constructor\");\n\nrequire(\"core-js/modules/es6.regexp.match\");\n\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();\n/**\n * Colors.\n */\n\nexports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n } // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n}\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\n\nexports.formatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n if (!useColors) return;\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if ('%%' === match) return;\n index++;\n\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n}\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch (e) {}\n}\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\nfunction load() {\n var r;\n\n try {\n r = exports.storage.debug;\n } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\n\nexports.enable(load());\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\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.string.iterator\");\n\nvar global = require('global');\n\nvar Promise = global.Promise || require('es6-promise').Promise; // This is the standalone browser build entry point\n// Browser implementation of the Algolia Search JavaScript client,\n// using XMLHttpRequest, XDomainRequest and JSONP as fallback\n\n\nmodule.exports = function createAlgoliasearch(AlgoliaSearch, uaSuffix) {\n var inherits = require('inherits');\n\n var errors = require('../errors');\n\n var inlineHeaders = require('./inline-headers');\n\n var jsonpRequest = require('./jsonp-request');\n\n var places = require('../places.js');\n\n uaSuffix = uaSuffix || '';\n\n if (process.env.NODE_ENV === 'debug') {\n require('debug').enable('algoliasearch*');\n }\n\n function algoliasearch(applicationID, apiKey, opts) {\n var cloneDeep = require('../clone.js');\n\n opts = cloneDeep(opts || {});\n opts._ua = opts._ua || algoliasearch.ua;\n return new AlgoliaSearchBrowser(applicationID, apiKey, opts);\n }\n\n algoliasearch.version = require('../version.js');\n algoliasearch.ua = 'Algolia for JavaScript (' + algoliasearch.version + '); ' + uaSuffix;\n algoliasearch.initPlaces = places(algoliasearch); // we expose into window no matter how we are used, this will allow\n // us to easily debug any website running algolia\n\n global.__algolia = {\n debug: require('debug'),\n algoliasearch: algoliasearch\n };\n var support = {\n hasXMLHttpRequest: 'XMLHttpRequest' in global,\n hasXDomainRequest: 'XDomainRequest' in global\n };\n\n if (support.hasXMLHttpRequest) {\n support.cors = 'withCredentials' in new XMLHttpRequest();\n }\n\n function AlgoliaSearchBrowser() {\n // call AlgoliaSearch constructor\n AlgoliaSearch.apply(this, arguments);\n }\n\n inherits(AlgoliaSearchBrowser, AlgoliaSearch);\n\n AlgoliaSearchBrowser.prototype._request = function request(url, opts) {\n return new Promise(function wrapRequest(resolve, reject) {\n // no cors or XDomainRequest, no request\n if (!support.cors && !support.hasXDomainRequest) {\n // very old browser, not supported\n reject(new errors.Network('CORS not supported'));\n return;\n }\n\n url = inlineHeaders(url, opts.headers);\n var body = opts.body;\n var req = support.cors ? new XMLHttpRequest() : new XDomainRequest();\n var reqTimeout;\n var timedOut;\n var connected = false;\n reqTimeout = setTimeout(onTimeout, opts.timeouts.connect); // we set an empty onprogress listener\n // so that XDomainRequest on IE9 is not aborted\n // refs:\n // - https://github.com/algolia/algoliasearch-client-js/issues/76\n // - https://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9-f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handlers-not-specified?forum=iewebdevelopment\n\n req.onprogress = onProgress;\n if ('onreadystatechange' in req) req.onreadystatechange = onReadyStateChange;\n req.onload = onLoad;\n req.onerror = onError; // do not rely on default XHR async flag, as some analytics code like hotjar\n // breaks it and set it to false by default\n\n if (req instanceof XMLHttpRequest) {\n req.open(opts.method, url, true); // The Analytics API never accepts Auth headers as query string\n // this option exists specifically for them.\n\n if (opts.forceAuthHeaders) {\n req.setRequestHeader('x-algolia-application-id', opts.headers['x-algolia-application-id']);\n req.setRequestHeader('x-algolia-api-key', opts.headers['x-algolia-api-key']);\n }\n } else {\n req.open(opts.method, url);\n } // headers are meant to be sent after open\n\n\n if (support.cors) {\n if (body) {\n if (opts.method === 'POST') {\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Simple_requests\n req.setRequestHeader('content-type', 'application/x-www-form-urlencoded');\n } else {\n req.setRequestHeader('content-type', 'application/json');\n }\n }\n\n req.setRequestHeader('accept', 'application/json');\n }\n\n if (body) {\n req.send(body);\n } else {\n req.send();\n } // event object not received in IE8, at least\n // but we do not use it, still important to note\n\n\n function onLoad()\n /* event */\n {\n // When browser does not supports req.timeout, we can\n // have both a load and timeout event, since handled by a dumb setTimeout\n if (timedOut) {\n return;\n }\n\n clearTimeout(reqTimeout);\n var out;\n\n try {\n out = {\n body: JSON.parse(req.responseText),\n responseText: req.responseText,\n statusCode: req.status,\n // XDomainRequest does not have any response headers\n headers: req.getAllResponseHeaders && req.getAllResponseHeaders() || {}\n };\n } catch (e) {\n out = new errors.UnparsableJSON({\n more: req.responseText\n });\n }\n\n if (out instanceof errors.UnparsableJSON) {\n reject(out);\n } else {\n resolve(out);\n }\n }\n\n function onError(event) {\n if (timedOut) {\n return;\n }\n\n clearTimeout(reqTimeout); // error event is trigerred both with XDR/XHR on:\n // - DNS error\n // - unallowed cross domain request\n\n reject(new errors.Network({\n more: event\n }));\n }\n\n function onTimeout() {\n timedOut = true;\n req.abort();\n reject(new errors.RequestTimeout());\n }\n\n function onConnect() {\n connected = true;\n clearTimeout(reqTimeout);\n reqTimeout = setTimeout(onTimeout, opts.timeouts.complete);\n }\n\n function onProgress() {\n if (!connected) onConnect();\n }\n\n function onReadyStateChange() {\n if (!connected && req.readyState > 1) onConnect();\n }\n });\n };\n\n AlgoliaSearchBrowser.prototype._request.fallback = function requestFallback(url, opts) {\n url = inlineHeaders(url, opts.headers);\n return new Promise(function wrapJsonpRequest(resolve, reject) {\n jsonpRequest(url, opts, function jsonpRequestDone(err, content) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(content);\n });\n });\n };\n\n AlgoliaSearchBrowser.prototype._promise = {\n reject: function rejectPromise(val) {\n return Promise.reject(val);\n },\n resolve: function resolvePromise(val) {\n return Promise.resolve(val);\n },\n delay: function delayPromise(ms) {\n return new Promise(function resolveOnTimeout(resolve\n /* , reject*/\n ) {\n setTimeout(resolve, ms);\n });\n },\n all: function all(promises) {\n return Promise.all(promises);\n }\n };\n return algoliasearch;\n};","'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;","require(\"core-js/modules/es6.object.create\");\n\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = 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 };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor;\n\n var TempCtor = function TempCtor() {};\n\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n };\n}","module.exports = function omit(obj, test) {\n var keys = require('object-keys');\n\n var foreach = require('foreach');\n\n var filtered = {};\n foreach(keys(obj), function doFilter(keyName) {\n if (test(keyName) !== true) {\n filtered[keyName] = obj[keyName];\n }\n });\n return filtered;\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.regexp.split\");\n\nrequire(\"core-js/modules/es6.array.for-each\");\n\n(function (factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module['exports'] = factory() : typeof define === 'function' && define['amd'] ? define(factory()) : window['stylisRuleSheet'] = factory();\n})(function () {\n 'use strict';\n\n return function (insertRule) {\n var delimiter = '/*|*/';\n var needle = delimiter + '}';\n\n function toSheet(block) {\n if (block) try {\n insertRule(block + '}');\n } catch (e) {}\n }\n\n return function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {\n switch (context) {\n // property\n case 1:\n // @import\n if (depth === 0 && content.charCodeAt(0) === 64) return insertRule(content + ';'), '';\n break;\n // selector\n\n case 2:\n if (ns === 0) return content + delimiter;\n break;\n // at-rule\n\n case 3:\n switch (ns) {\n // @font-face, @page\n case 102:\n case 112:\n return insertRule(selectors[0] + content), '';\n\n default:\n return content + (at === 0 ? delimiter : '');\n }\n\n case -2:\n content.split(needle).forEach(toSheet);\n }\n };\n };\n});","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;","function areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n\n for (var i = 0; i < newInputs.length; i++) {\n if (newInputs[i] !== lastInputs[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = areInputsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n function memoized() {\n var newArgs = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n\n return memoized;\n}\n\nexport default memoizeOne;","'use strict'; // This file hosts our error definitions\n// We use custom error \"types\" so that we can act on them when we need it\n// e.g.: if error instanceof errors.UnparsableJSON then..\n\nrequire(\"core-js/modules/es6.function.name\");\n\nvar inherits = require('inherits');\n\nfunction AlgoliaSearchError(message, extraProperties) {\n var forEach = require('foreach');\n\n var error = this; // try to get a stacktrace\n\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, this.constructor);\n } else {\n error.stack = new Error().stack || 'Cannot get a stacktrace, browser is too old';\n }\n\n this.name = 'AlgoliaSearchError';\n this.message = message || 'Unknown error';\n\n if (extraProperties) {\n forEach(extraProperties, function addToErrorObject(value, key) {\n error[key] = value;\n });\n }\n}\n\ninherits(AlgoliaSearchError, Error);\n\nfunction createCustomError(name, message) {\n function AlgoliaSearchCustomError() {\n var args = Array.prototype.slice.call(arguments, 0); // custom message not set, use default\n\n if (typeof args[0] !== 'string') {\n args.unshift(message);\n }\n\n AlgoliaSearchError.apply(this, args);\n this.name = 'AlgoliaSearch' + name + 'Error';\n }\n\n inherits(AlgoliaSearchCustomError, AlgoliaSearchError);\n return AlgoliaSearchCustomError;\n} // late exports to let various fn defs and inherits take place\n\n\nmodule.exports = {\n AlgoliaSearchError: AlgoliaSearchError,\n UnparsableJSON: createCustomError('UnparsableJSON', 'Could not parse the incoming response as JSON, see err.more for details'),\n RequestTimeout: createCustomError('RequestTimeout', 'Request timed out before getting a response'),\n Network: createCustomError('Network', 'Network issue, see err.more for details'),\n JSONPScriptFail: createCustomError('JSONPScriptFail', '<script> was loaded but did not call our provided callback'),\n ValidUntilNotFound: createCustomError('ValidUntilNotFound', 'The SecuredAPIKey does not have a validUntil parameter.'),\n JSONPScriptError: createCustomError('JSONPScriptError', '<script> unable to load due to an `error` event on it'),\n ObjectNotFound: createCustomError('ObjectNotFound', 'Object not found'),\n Unknown: createCustomError('Unknown', 'Unknown error occured')\n};","'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};","require(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.string.trim\");\n\nrequire(\"core-js/modules/es6.regexp.replace\");\n\n!function (e) {\n \"object\" == typeof exports && \"undefined\" != typeof module ? module.exports = e(null) : \"function\" == typeof define && define.amd ? define(e(null)) : window.stylis = e(null);\n}(function e(a) {\n \"use strict\";\n\n var r = /^\\0+/g,\n c = /[\\0\\r\\f]/g,\n s = /: */g,\n t = /zoo|gra/,\n i = /([,: ])(transform)/g,\n f = /,+\\s*(?![^(]*[)])/g,\n n = / +\\s*(?![^(]*[)])/g,\n l = / *[\\0] */g,\n o = /,\\r+?/g,\n h = /([\\t\\r\\n ])*\\f?&/g,\n u = /:global\\(((?:[^\\(\\)\\[\\]]*|\\[.*\\]|\\([^\\(\\)]*\\))*)\\)/g,\n d = /\\W+/g,\n b = /@(k\\w+)\\s*(\\S*)\\s*/,\n p = /::(place)/g,\n k = /:(read-only)/g,\n g = /\\s+(?=[{\\];=:>])/g,\n A = /([[}=:>])\\s+/g,\n C = /(\\{[^{]+?);(?=\\})/g,\n w = /\\s{2,}/g,\n v = /([^\\(])(:+) */g,\n m = /[svh]\\w+-[tblr]{2}/,\n x = /\\(\\s*(.*)\\s*\\)/g,\n $ = /([\\s\\S]*?);/g,\n y = /-self|flex-/g,\n O = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n j = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n z = /([^-])(image-set\\()/,\n N = \"-webkit-\",\n S = \"-moz-\",\n F = \"-ms-\",\n W = 59,\n q = 125,\n B = 123,\n D = 40,\n E = 41,\n G = 91,\n H = 93,\n I = 10,\n J = 13,\n K = 9,\n L = 64,\n M = 32,\n P = 38,\n Q = 45,\n R = 95,\n T = 42,\n U = 44,\n V = 58,\n X = 39,\n Y = 34,\n Z = 47,\n _ = 62,\n ee = 43,\n ae = 126,\n re = 0,\n ce = 12,\n se = 11,\n te = 107,\n ie = 109,\n fe = 115,\n ne = 112,\n le = 111,\n oe = 105,\n he = 99,\n ue = 100,\n de = 112,\n be = 1,\n pe = 1,\n ke = 0,\n ge = 1,\n Ae = 1,\n Ce = 1,\n we = 0,\n ve = 0,\n me = 0,\n xe = [],\n $e = [],\n ye = 0,\n Oe = null,\n je = -2,\n ze = -1,\n Ne = 0,\n Se = 1,\n Fe = 2,\n We = 3,\n qe = 0,\n Be = 1,\n De = \"\",\n Ee = \"\",\n Ge = \"\";\n\n function He(e, a, s, t, i) {\n for (var f, n, o = 0, h = 0, u = 0, d = 0, g = 0, A = 0, C = 0, w = 0, m = 0, $ = 0, y = 0, O = 0, j = 0, z = 0, R = 0, we = 0, $e = 0, Oe = 0, je = 0, ze = s.length, Je = ze - 1, Re = \"\", Te = \"\", Ue = \"\", Ve = \"\", Xe = \"\", Ye = \"\"; R < ze;) {\n if (C = s.charCodeAt(R), R === Je) if (h + d + u + o !== 0) {\n if (0 !== h) C = h === Z ? I : Z;\n d = u = o = 0, ze++, Je++;\n }\n\n if (h + d + u + o === 0) {\n if (R === Je) {\n if (we > 0) Te = Te.replace(c, \"\");\n\n if (Te.trim().length > 0) {\n switch (C) {\n case M:\n case K:\n case W:\n case J:\n case I:\n break;\n\n default:\n Te += s.charAt(R);\n }\n\n C = W;\n }\n }\n\n if (1 === $e) switch (C) {\n case B:\n case q:\n case W:\n case Y:\n case X:\n case D:\n case E:\n case U:\n $e = 0;\n\n case K:\n case J:\n case I:\n case M:\n break;\n\n default:\n for ($e = 0, je = R, g = C, R--, C = W; je < ze;) {\n switch (s.charCodeAt(je++)) {\n case I:\n case J:\n case W:\n ++R, C = g, je = ze;\n break;\n\n case V:\n if (we > 0) ++R, C = g;\n\n case B:\n je = ze;\n }\n }\n\n }\n\n switch (C) {\n case B:\n for (g = (Te = Te.trim()).charCodeAt(0), y = 1, je = ++R; R < ze;) {\n switch (C = s.charCodeAt(R)) {\n case B:\n y++;\n break;\n\n case q:\n y--;\n break;\n\n case Z:\n switch (A = s.charCodeAt(R + 1)) {\n case T:\n case Z:\n R = Qe(A, R, Je, s);\n }\n\n break;\n\n case G:\n C++;\n\n case D:\n C++;\n\n case Y:\n case X:\n for (; R++ < Je && s.charCodeAt(R) !== C;) {\n ;\n }\n\n }\n\n if (0 === y) break;\n R++;\n }\n\n if (Ue = s.substring(je, R), g === re) g = (Te = Te.replace(r, \"\").trim()).charCodeAt(0);\n\n switch (g) {\n case L:\n if (we > 0) Te = Te.replace(c, \"\");\n\n switch (A = Te.charCodeAt(1)) {\n case ue:\n case ie:\n case fe:\n case Q:\n f = a;\n break;\n\n default:\n f = xe;\n }\n\n if (je = (Ue = He(a, f, Ue, A, i + 1)).length, me > 0 && 0 === je) je = Te.length;\n if (ye > 0) if (f = Ie(xe, Te, Oe), n = Pe(We, Ue, f, a, pe, be, je, A, i, t), Te = f.join(\"\"), void 0 !== n) if (0 === (je = (Ue = n.trim()).length)) A = 0, Ue = \"\";\n if (je > 0) switch (A) {\n case fe:\n Te = Te.replace(x, Me);\n\n case ue:\n case ie:\n case Q:\n Ue = Te + \"{\" + Ue + \"}\";\n break;\n\n case te:\n if (Ue = (Te = Te.replace(b, \"$1 $2\" + (Be > 0 ? De : \"\"))) + \"{\" + Ue + \"}\", 1 === Ae || 2 === Ae && Le(\"@\" + Ue, 3)) Ue = \"@\" + N + Ue + \"@\" + Ue;else Ue = \"@\" + Ue;\n break;\n\n default:\n if (Ue = Te + Ue, t === de) Ve += Ue, Ue = \"\";\n } else Ue = \"\";\n break;\n\n default:\n Ue = He(a, Ie(a, Te, Oe), Ue, t, i + 1);\n }\n\n Xe += Ue, O = 0, $e = 0, z = 0, we = 0, Oe = 0, j = 0, Te = \"\", Ue = \"\", C = s.charCodeAt(++R);\n break;\n\n case q:\n case W:\n if ((je = (Te = (we > 0 ? Te.replace(c, \"\") : Te).trim()).length) > 1) {\n if (0 === z) if ((g = Te.charCodeAt(0)) === Q || g > 96 && g < 123) je = (Te = Te.replace(\" \", \":\")).length;\n if (ye > 0) if (void 0 !== (n = Pe(Se, Te, a, e, pe, be, Ve.length, t, i, t))) if (0 === (je = (Te = n.trim()).length)) Te = \"\\0\\0\";\n\n switch (g = Te.charCodeAt(0), A = Te.charCodeAt(1), g) {\n case re:\n break;\n\n case L:\n if (A === oe || A === he) {\n Ye += Te + s.charAt(R);\n break;\n }\n\n default:\n if (Te.charCodeAt(je - 1) === V) break;\n Ve += Ke(Te, g, A, Te.charCodeAt(2));\n }\n }\n\n O = 0, $e = 0, z = 0, we = 0, Oe = 0, Te = \"\", C = s.charCodeAt(++R);\n }\n }\n\n switch (C) {\n case J:\n case I:\n if (h + d + u + o + ve === 0) switch ($) {\n case E:\n case X:\n case Y:\n case L:\n case ae:\n case _:\n case T:\n case ee:\n case Z:\n case Q:\n case V:\n case U:\n case W:\n case B:\n case q:\n break;\n\n default:\n if (z > 0) $e = 1;\n }\n if (h === Z) h = 0;else if (ge + O === 0 && t !== te && Te.length > 0) we = 1, Te += \"\\0\";\n if (ye * qe > 0) Pe(Ne, Te, a, e, pe, be, Ve.length, t, i, t);\n be = 1, pe++;\n break;\n\n case W:\n case q:\n if (h + d + u + o === 0) {\n be++;\n break;\n }\n\n default:\n switch (be++, Re = s.charAt(R), C) {\n case K:\n case M:\n if (d + o + h === 0) switch (w) {\n case U:\n case V:\n case K:\n case M:\n Re = \"\";\n break;\n\n default:\n if (C !== M) Re = \" \";\n }\n break;\n\n case re:\n Re = \"\\\\0\";\n break;\n\n case ce:\n Re = \"\\\\f\";\n break;\n\n case se:\n Re = \"\\\\v\";\n break;\n\n case P:\n if (d + h + o === 0 && ge > 0) Oe = 1, we = 1, Re = \"\\f\" + Re;\n break;\n\n case 108:\n if (d + h + o + ke === 0 && z > 0) switch (R - z) {\n case 2:\n if (w === ne && s.charCodeAt(R - 3) === V) ke = w;\n\n case 8:\n if (m === le) ke = m;\n }\n break;\n\n case V:\n if (d + h + o === 0) z = R;\n break;\n\n case U:\n if (h + u + d + o === 0) we = 1, Re += \"\\r\";\n break;\n\n case Y:\n case X:\n if (0 === h) d = d === C ? 0 : 0 === d ? C : d;\n break;\n\n case G:\n if (d + h + u === 0) o++;\n break;\n\n case H:\n if (d + h + u === 0) o--;\n break;\n\n case E:\n if (d + h + o === 0) u--;\n break;\n\n case D:\n if (d + h + o === 0) {\n if (0 === O) switch (2 * w + 3 * m) {\n case 533:\n break;\n\n default:\n y = 0, O = 1;\n }\n u++;\n }\n\n break;\n\n case L:\n if (h + u + d + o + z + j === 0) j = 1;\n break;\n\n case T:\n case Z:\n if (d + o + u > 0) break;\n\n switch (h) {\n case 0:\n switch (2 * C + 3 * s.charCodeAt(R + 1)) {\n case 235:\n h = Z;\n break;\n\n case 220:\n je = R, h = T;\n }\n\n break;\n\n case T:\n if (C === Z && w === T && je + 2 !== R) {\n if (33 === s.charCodeAt(je + 2)) Ve += s.substring(je, R + 1);\n Re = \"\", h = 0;\n }\n\n }\n\n }\n\n if (0 === h) {\n if (ge + d + o + j === 0 && t !== te && C !== W) switch (C) {\n case U:\n case ae:\n case _:\n case ee:\n case E:\n case D:\n if (0 === O) {\n switch (w) {\n case K:\n case M:\n case I:\n case J:\n Re += \"\\0\";\n break;\n\n default:\n Re = \"\\0\" + Re + (C === U ? \"\" : \"\\0\");\n }\n\n we = 1;\n } else switch (C) {\n case D:\n if (z + 7 === R && 108 === w) z = 0;\n O = ++y;\n break;\n\n case E:\n if (0 == (O = --y)) we = 1, Re += \"\\0\";\n }\n\n break;\n\n case K:\n case M:\n switch (w) {\n case re:\n case B:\n case q:\n case W:\n case U:\n case ce:\n case K:\n case M:\n case I:\n case J:\n break;\n\n default:\n if (0 === O) we = 1, Re += \"\\0\";\n }\n\n }\n if (Te += Re, C !== M && C !== K) $ = C;\n }\n\n }\n\n m = w, w = C, R++;\n }\n\n if (je = Ve.length, me > 0) if (0 === je && 0 === Xe.length && 0 === a[0].length == false) if (t !== ie || 1 === a.length && (ge > 0 ? Ee : Ge) === a[0]) je = a.join(\",\").length + 2;\n\n if (je > 0) {\n if (f = 0 === ge && t !== te ? function (e) {\n for (var a, r, s = 0, t = e.length, i = Array(t); s < t; ++s) {\n for (var f = e[s].split(l), n = \"\", o = 0, h = 0, u = 0, d = 0, b = f.length; o < b; ++o) {\n if (0 === (h = (r = f[o]).length) && b > 1) continue;\n if (u = n.charCodeAt(n.length - 1), d = r.charCodeAt(0), a = \"\", 0 !== o) switch (u) {\n case T:\n case ae:\n case _:\n case ee:\n case M:\n case D:\n break;\n\n default:\n a = \" \";\n }\n\n switch (d) {\n case P:\n r = a + Ee;\n\n case ae:\n case _:\n case ee:\n case M:\n case E:\n case D:\n break;\n\n case G:\n r = a + r + Ee;\n break;\n\n case V:\n switch (2 * r.charCodeAt(1) + 3 * r.charCodeAt(2)) {\n case 530:\n if (Ce > 0) {\n r = a + r.substring(8, h - 1);\n break;\n }\n\n default:\n if (o < 1 || f[o - 1].length < 1) r = a + Ee + r;\n }\n\n break;\n\n case U:\n a = \"\";\n\n default:\n if (h > 1 && r.indexOf(\":\") > 0) r = a + r.replace(v, \"$1\" + Ee + \"$2\");else r = a + r + Ee;\n }\n\n n += r;\n }\n\n i[s] = n.replace(c, \"\").trim();\n }\n\n return i;\n }(a) : a, ye > 0) if (void 0 !== (n = Pe(Fe, Ve, f, e, pe, be, je, t, i, t)) && 0 === (Ve = n).length) return Ye + Ve + Xe;\n\n if (Ve = f.join(\",\") + \"{\" + Ve + \"}\", Ae * ke != 0) {\n if (2 === Ae && !Le(Ve, 2)) ke = 0;\n\n switch (ke) {\n case le:\n Ve = Ve.replace(k, \":\" + S + \"$1\") + Ve;\n break;\n\n case ne:\n Ve = Ve.replace(p, \"::\" + N + \"input-$1\") + Ve.replace(p, \"::\" + S + \"$1\") + Ve.replace(p, \":\" + F + \"input-$1\") + Ve;\n }\n\n ke = 0;\n }\n }\n\n return Ye + Ve + Xe;\n }\n\n function Ie(e, a, r) {\n var c = a.trim().split(o),\n s = c,\n t = c.length,\n i = e.length;\n\n switch (i) {\n case 0:\n case 1:\n for (var f = 0, n = 0 === i ? \"\" : e[0] + \" \"; f < t; ++f) {\n s[f] = Je(n, s[f], r, i).trim();\n }\n\n break;\n\n default:\n f = 0;\n var l = 0;\n\n for (s = []; f < t; ++f) {\n for (var h = 0; h < i; ++h) {\n s[l++] = Je(e[h] + \" \", c[f], r, i).trim();\n }\n }\n\n }\n\n return s;\n }\n\n function Je(e, a, r, c) {\n var s = a,\n t = s.charCodeAt(0);\n if (t < 33) t = (s = s.trim()).charCodeAt(0);\n\n switch (t) {\n case P:\n switch (ge + c) {\n case 0:\n case 1:\n if (0 === e.trim().length) break;\n\n default:\n return s.replace(h, \"$1\" + e.trim());\n }\n\n break;\n\n case V:\n switch (s.charCodeAt(1)) {\n case 103:\n if (Ce > 0 && ge > 0) return s.replace(u, \"$1\").replace(h, \"$1\" + Ge);\n break;\n\n default:\n return e.trim() + s.replace(h, \"$1\" + e.trim());\n }\n\n default:\n if (r * ge > 0 && s.indexOf(\"\\f\") > 0) return s.replace(h, (e.charCodeAt(0) === V ? \"\" : \"$1\") + e.trim());\n }\n\n return e + s;\n }\n\n function Ke(e, a, r, c) {\n var l,\n o = 0,\n h = e + \";\",\n u = 2 * a + 3 * r + 4 * c;\n if (944 === u) return function (e) {\n var a = e.length,\n r = e.indexOf(\":\", 9) + 1,\n c = e.substring(0, r).trim(),\n s = e.substring(r, a - 1).trim();\n\n switch (e.charCodeAt(9) * Be) {\n case 0:\n break;\n\n case Q:\n if (110 !== e.charCodeAt(10)) break;\n\n default:\n for (var t = s.split((s = \"\", f)), i = 0, r = 0, a = t.length; i < a; r = 0, ++i) {\n for (var l = t[i], o = l.split(n); l = o[r];) {\n var h = l.charCodeAt(0);\n if (1 === Be && (h > L && h < 90 || h > 96 && h < 123 || h === R || h === Q && l.charCodeAt(1) !== Q)) switch (isNaN(parseFloat(l)) + (-1 !== l.indexOf(\"(\"))) {\n case 1:\n switch (l) {\n case \"infinite\":\n case \"alternate\":\n case \"backwards\":\n case \"running\":\n case \"normal\":\n case \"forwards\":\n case \"both\":\n case \"none\":\n case \"linear\":\n case \"ease\":\n case \"ease-in\":\n case \"ease-out\":\n case \"ease-in-out\":\n case \"paused\":\n case \"reverse\":\n case \"alternate-reverse\":\n case \"inherit\":\n case \"initial\":\n case \"unset\":\n case \"step-start\":\n case \"step-end\":\n break;\n\n default:\n l += De;\n }\n\n }\n o[r++] = l;\n }\n\n s += (0 === i ? \"\" : \",\") + o.join(\" \");\n }\n\n }\n\n if (s = c + s + \";\", 1 === Ae || 2 === Ae && Le(s, 1)) return N + s + s;\n return s;\n }(h);else if (0 === Ae || 2 === Ae && !Le(h, 1)) return h;\n\n switch (u) {\n case 1015:\n return 97 === h.charCodeAt(10) ? N + h + h : h;\n\n case 951:\n return 116 === h.charCodeAt(3) ? N + h + h : h;\n\n case 963:\n return 110 === h.charCodeAt(5) ? N + h + h : h;\n\n case 1009:\n if (100 !== h.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return N + h + h;\n\n case 978:\n return N + h + S + h + h;\n\n case 1019:\n case 983:\n return N + h + S + h + F + h + h;\n\n case 883:\n if (h.charCodeAt(8) === Q) return N + h + h;\n if (h.indexOf(\"image-set(\", 11) > 0) return h.replace(z, \"$1\" + N + \"$2\") + h;\n return h;\n\n case 932:\n if (h.charCodeAt(4) === Q) switch (h.charCodeAt(5)) {\n case 103:\n return N + \"box-\" + h.replace(\"-grow\", \"\") + N + h + F + h.replace(\"grow\", \"positive\") + h;\n\n case 115:\n return N + h + F + h.replace(\"shrink\", \"negative\") + h;\n\n case 98:\n return N + h + F + h.replace(\"basis\", \"preferred-size\") + h;\n }\n return N + h + F + h + h;\n\n case 964:\n return N + h + F + \"flex-\" + h + h;\n\n case 1023:\n if (99 !== h.charCodeAt(8)) break;\n return l = h.substring(h.indexOf(\":\", 15)).replace(\"flex-\", \"\").replace(\"space-between\", \"justify\"), N + \"box-pack\" + l + N + h + F + \"flex-pack\" + l + h;\n\n case 1005:\n return t.test(h) ? h.replace(s, \":\" + N) + h.replace(s, \":\" + S) + h : h;\n\n case 1e3:\n switch (o = (l = h.substring(13).trim()).indexOf(\"-\") + 1, l.charCodeAt(0) + l.charCodeAt(o)) {\n case 226:\n l = h.replace(m, \"tb\");\n break;\n\n case 232:\n l = h.replace(m, \"tb-rl\");\n break;\n\n case 220:\n l = h.replace(m, \"lr\");\n break;\n\n default:\n return h;\n }\n\n return N + h + F + l + h;\n\n case 1017:\n if (-1 === h.indexOf(\"sticky\", 9)) return h;\n\n case 975:\n switch (o = (h = e).length - 10, u = (l = (33 === h.charCodeAt(o) ? h.substring(0, o) : h).substring(e.indexOf(\":\", 7) + 1).trim()).charCodeAt(0) + (0 | l.charCodeAt(7))) {\n case 203:\n if (l.charCodeAt(8) < 111) break;\n\n case 115:\n h = h.replace(l, N + l) + \";\" + h;\n break;\n\n case 207:\n case 102:\n h = h.replace(l, N + (u > 102 ? \"inline-\" : \"\") + \"box\") + \";\" + h.replace(l, N + l) + \";\" + h.replace(l, F + l + \"box\") + \";\" + h;\n }\n\n return h + \";\";\n\n case 938:\n if (h.charCodeAt(5) === Q) switch (h.charCodeAt(6)) {\n case 105:\n return l = h.replace(\"-items\", \"\"), N + h + N + \"box-\" + l + F + \"flex-\" + l + h;\n\n case 115:\n return N + h + F + \"flex-item-\" + h.replace(y, \"\") + h;\n\n default:\n return N + h + F + \"flex-line-pack\" + h.replace(\"align-content\", \"\").replace(y, \"\") + h;\n }\n break;\n\n case 973:\n case 989:\n if (h.charCodeAt(3) !== Q || 122 === h.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (true === j.test(e)) if (115 === (l = e.substring(e.indexOf(\":\") + 1)).charCodeAt(0)) return Ke(e.replace(\"stretch\", \"fill-available\"), a, r, c).replace(\":fill-available\", \":stretch\");else return h.replace(l, N + l) + h.replace(l, S + l.replace(\"fill-\", \"\")) + h;\n break;\n\n case 962:\n if (h = N + h + (102 === h.charCodeAt(5) ? F + h : \"\") + h, r + c === 211 && 105 === h.charCodeAt(13) && h.indexOf(\"transform\", 10) > 0) return h.substring(0, h.indexOf(\";\", 27) + 1).replace(i, \"$1\" + N + \"$2\") + h;\n }\n\n return h;\n }\n\n function Le(e, a) {\n var r = e.indexOf(1 === a ? \":\" : \"{\"),\n c = e.substring(0, 3 !== a ? r : 10),\n s = e.substring(r + 1, e.length - 1);\n return Oe(2 !== a ? c : c.replace(O, \"$1\"), s, a);\n }\n\n function Me(e, a) {\n var r = Ke(a, a.charCodeAt(0), a.charCodeAt(1), a.charCodeAt(2));\n return r !== a + \";\" ? r.replace($, \" or ($1)\").substring(4) : \"(\" + a + \")\";\n }\n\n function Pe(e, a, r, c, s, t, i, f, n, l) {\n for (var o, h = 0, u = a; h < ye; ++h) {\n switch (o = $e[h].call(Te, e, u, r, c, s, t, i, f, n, l)) {\n case void 0:\n case false:\n case true:\n case null:\n break;\n\n default:\n u = o;\n }\n }\n\n if (u !== a) return u;\n }\n\n function Qe(e, a, r, c) {\n for (var s = a + 1; s < r; ++s) {\n switch (c.charCodeAt(s)) {\n case Z:\n if (e === T) if (c.charCodeAt(s - 1) === T && a + 2 !== s) return s + 1;\n break;\n\n case I:\n if (e === Z) return s + 1;\n }\n }\n\n return s;\n }\n\n function Re(e) {\n for (var a in e) {\n var r = e[a];\n\n switch (a) {\n case \"keyframe\":\n Be = 0 | r;\n break;\n\n case \"global\":\n Ce = 0 | r;\n break;\n\n case \"cascade\":\n ge = 0 | r;\n break;\n\n case \"compress\":\n we = 0 | r;\n break;\n\n case \"semicolon\":\n ve = 0 | r;\n break;\n\n case \"preserve\":\n me = 0 | r;\n break;\n\n case \"prefix\":\n if (Oe = null, !r) Ae = 0;else if (\"function\" != typeof r) Ae = 1;else Ae = 2, Oe = r;\n }\n }\n\n return Re;\n }\n\n function Te(a, r) {\n if (void 0 !== this && this.constructor === Te) return e(a);\n var s = a,\n t = s.charCodeAt(0);\n if (t < 33) t = (s = s.trim()).charCodeAt(0);\n if (Be > 0) De = s.replace(d, t === G ? \"\" : \"-\");\n if (t = 1, 1 === ge) Ge = s;else Ee = s;\n var i,\n f = [Ge];\n if (ye > 0) if (void 0 !== (i = Pe(ze, r, f, f, pe, be, 0, 0, 0, 0)) && \"string\" == typeof i) r = i;\n var n = He(xe, f, r, 0, 0);\n if (ye > 0) if (void 0 !== (i = Pe(je, n, f, f, pe, be, n.length, 0, 0, 0)) && \"string\" != typeof (n = i)) t = 0;\n return De = \"\", Ge = \"\", Ee = \"\", ke = 0, pe = 1, be = 1, we * t == 0 ? n : n.replace(c, \"\").replace(g, \"\").replace(A, \"$1\").replace(C, \"$1\").replace(w, \" \");\n }\n\n if (Te.use = function e(a) {\n switch (a) {\n case void 0:\n case null:\n ye = $e.length = 0;\n break;\n\n default:\n if (\"function\" == typeof a) $e[ye++] = a;else if (\"object\" == typeof a) for (var r = 0, c = a.length; r < c; ++r) {\n e(a[r]);\n } else qe = 0 | !!a;\n }\n\n return e;\n }, Te.set = Re, void 0 !== a) Re(a);\n return Te;\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.regexp.constructor\");\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.is-array\");\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a),\n arrB = isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\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 }\n\n if (arrA != arrB) return false;\n var dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n var regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n var keys = keyList(a);\n length = keys.length;\n if (length !== keyList(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!hasProp.call(b, keys[i])) return false;\n }\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n};","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","'use strict';\n\nmodule.exports = inlineHeaders;\n\nvar encode = require('querystring-es3/encode');\n\nfunction inlineHeaders(url, headers) {\n if (/\\?/.test(url)) {\n url += '&';\n } else {\n url += '?';\n }\n\n return url + encode(headers);\n}","require(\"core-js/modules/es6.array.is-array\");\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\nvar toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};","// Parse cloud does not supports setTimeout\n// We do not store a setTimeout reference in the client everytime\n// We only fallback to a fake setTimeout when not available\n// setTimeout cannot be override globally sadly\nmodule.exports = function exitPromise(fn, _setTimeout) {\n _setTimeout(fn, 0);\n};","var debug = require('debug')('algoliasearch:src/hostIndexState.js');\n\nvar localStorageNamespace = 'algoliasearch-client-js';\nvar store;\nvar moduleStore = {\n state: {},\n set: function set(key, data) {\n this.state[key] = data;\n return this.state[key];\n },\n get: function get(key) {\n return this.state[key] || null;\n }\n};\nvar localStorageStore = {\n set: function set(key, data) {\n moduleStore.set(key, data); // always replicate localStorageStore to moduleStore in case of failure\n\n try {\n var namespace = JSON.parse(global.localStorage[localStorageNamespace]);\n namespace[key] = data;\n global.localStorage[localStorageNamespace] = JSON.stringify(namespace);\n return namespace[key];\n } catch (e) {\n return localStorageFailure(key, e);\n }\n },\n get: function get(key) {\n try {\n return JSON.parse(global.localStorage[localStorageNamespace])[key] || null;\n } catch (e) {\n return localStorageFailure(key, e);\n }\n }\n};\n\nfunction localStorageFailure(key, e) {\n debug('localStorage failed with', e);\n cleanup();\n store = moduleStore;\n return store.get(key);\n}\n\nstore = supportsLocalStorage() ? localStorageStore : moduleStore;\nmodule.exports = {\n get: getOrSet,\n set: getOrSet,\n supportsLocalStorage: supportsLocalStorage\n};\n\nfunction getOrSet(key, data) {\n if (arguments.length === 1) {\n return store.get(key);\n }\n\n return store.set(key, data);\n}\n\nfunction supportsLocalStorage() {\n try {\n if ('localStorage' in global && global.localStorage !== null) {\n if (!global.localStorage[localStorageNamespace]) {\n // actual creation of the namespace\n global.localStorage.setItem(localStorageNamespace, JSON.stringify({}));\n }\n\n return true;\n }\n\n return false;\n } catch (_) {\n return false;\n }\n} // In case of any error on localStorage, we clean our own namespace, this should handle\n// quota errors when a lot of keys + data are used\n\n\nfunction cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {// nothing to do\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;","require(\"core-js/modules/es6.regexp.search\");\n\nvar buildSearchMethod = require('./buildSearchMethod.js');\n\nvar deprecate = require('./deprecate.js');\n\nvar deprecatedMessage = require('./deprecatedMessage.js');\n\nmodule.exports = IndexCore;\n/*\n* Index class constructor.\n* You should not use this method directly but use initIndex() function\n*/\n\nfunction IndexCore(algoliasearch, indexName) {\n this.indexName = indexName;\n this.as = algoliasearch;\n this.typeAheadArgs = null;\n this.typeAheadValueOption = null; // make sure every index instance has it's own cache\n\n this.cache = {};\n}\n/*\n* Clear all queries in cache\n*/\n\n\nIndexCore.prototype.clearCache = function () {\n this.cache = {};\n};\n/*\n* Search inside the index using XMLHttpRequest request (Using a POST query to\n* minimize number of OPTIONS queries: Cross-Origin Resource Sharing).\n*\n* @param {string} [query] the full text query\n* @param {object} [args] (optional) if set, contains an object with query parameters:\n* - page: (integer) Pagination parameter used to select the page to retrieve.\n* Page is zero-based and defaults to 0. Thus,\n* to retrieve the 10th page you need to set page=9\n* - hitsPerPage: (integer) Pagination parameter used to select the number of hits per page. Defaults to 20.\n* - attributesToRetrieve: a string that contains the list of object attributes\n* you want to retrieve (let you minimize the answer size).\n* Attributes are separated with a comma (for example \"name,address\").\n* You can also use an array (for example [\"name\",\"address\"]).\n* By default, all attributes are retrieved. You can also use '*' to retrieve all\n* values when an attributesToRetrieve setting is specified for your index.\n* - attributesToHighlight: a string that contains the list of attributes you\n* want to highlight according to the query.\n* Attributes are separated by a comma. You can also use an array (for example [\"name\",\"address\"]).\n* If an attribute has no match for the query, the raw value is returned.\n* By default all indexed text attributes are highlighted.\n* You can use `*` if you want to highlight all textual attributes.\n* Numerical attributes are not highlighted.\n* A matchLevel is returned for each highlighted attribute and can contain:\n* - full: if all the query terms were found in the attribute,\n* - partial: if only some of the query terms were found,\n* - none: if none of the query terms were found.\n* - attributesToSnippet: a string that contains the list of attributes to snippet alongside\n* the number of words to return (syntax is `attributeName:nbWords`).\n* Attributes are separated by a comma (Example: attributesToSnippet=name:10,content:10).\n* You can also use an array (Example: attributesToSnippet: ['name:10','content:10']).\n* By default no snippet is computed.\n* - minWordSizefor1Typo: the minimum number of characters in a query word to accept one typo in this word.\n* Defaults to 3.\n* - minWordSizefor2Typos: the minimum number of characters in a query word\n* to accept two typos in this word. Defaults to 7.\n* - getRankingInfo: if set to 1, the result hits will contain ranking\n* information in _rankingInfo attribute.\n* - aroundLatLng: search for entries around a given\n* latitude/longitude (specified as two floats separated by a comma).\n* For example aroundLatLng=47.316669,5.016670).\n* You can specify the maximum distance in meters with the aroundRadius parameter (in meters)\n* and the precision for ranking with aroundPrecision\n* (for example if you set aroundPrecision=100, two objects that are distant of\n* less than 100m will be considered as identical for \"geo\" ranking parameter).\n* At indexing, you should specify geoloc of an object with the _geoloc attribute\n* (in the form {\"_geoloc\":{\"lat\":48.853409, \"lng\":2.348800}})\n* - insideBoundingBox: search entries inside a given area defined by the two extreme points\n* of a rectangle (defined by 4 floats: p1Lat,p1Lng,p2Lat,p2Lng).\n* For example insideBoundingBox=47.3165,4.9665,47.3424,5.0201).\n* At indexing, you should specify geoloc of an object with the _geoloc attribute\n* (in the form {\"_geoloc\":{\"lat\":48.853409, \"lng\":2.348800}})\n* - numericFilters: a string that contains the list of numeric filters you want to\n* apply separated by a comma.\n* The syntax of one filter is `attributeName` followed by `operand` followed by `value`.\n* Supported operands are `<`, `<=`, `=`, `>` and `>=`.\n* You can have multiple conditions on one attribute like for example numericFilters=price>100,price<1000.\n* You can also use an array (for example numericFilters: [\"price>100\",\"price<1000\"]).\n* - tagFilters: filter the query by a set of tags. You can AND tags by separating them by commas.\n* To OR tags, you must add parentheses. For example, tags=tag1,(tag2,tag3) means tag1 AND (tag2 OR tag3).\n* You can also use an array, for example tagFilters: [\"tag1\",[\"tag2\",\"tag3\"]]\n* means tag1 AND (tag2 OR tag3).\n* At indexing, tags should be added in the _tags** attribute\n* of objects (for example {\"_tags\":[\"tag1\",\"tag2\"]}).\n* - facetFilters: filter the query by a list of facets.\n* Facets are separated by commas and each facet is encoded as `attributeName:value`.\n* For example: `facetFilters=category:Book,author:John%20Doe`.\n* You can also use an array (for example `[\"category:Book\",\"author:John%20Doe\"]`).\n* - facets: List of object attributes that you want to use for faceting.\n* Comma separated list: `\"category,author\"` or array `['category','author']`\n* Only attributes that have been added in **attributesForFaceting** index setting\n* can be used in this parameter.\n* You can also use `*` to perform faceting on all attributes specified in **attributesForFaceting**.\n* - queryType: select how the query words are interpreted, it can be one of the following value:\n* - prefixAll: all query words are interpreted as prefixes,\n* - prefixLast: only the last word is interpreted as a prefix (default behavior),\n* - prefixNone: no query word is interpreted as a prefix. This option is not recommended.\n* - optionalWords: a string that contains the list of words that should\n* be considered as optional when found in the query.\n* Comma separated and array are accepted.\n* - distinct: If set to 1, enable the distinct feature (disabled by default)\n* if the attributeForDistinct index setting is set.\n* This feature is similar to the SQL \"distinct\" keyword: when enabled\n* in a query with the distinct=1 parameter,\n* all hits containing a duplicate value for the attributeForDistinct attribute are removed from results.\n* For example, if the chosen attribute is show_name and several hits have\n* the same value for show_name, then only the best\n* one is kept and others are removed.\n* - restrictSearchableAttributes: List of attributes you want to use for\n* textual search (must be a subset of the attributesToIndex index setting)\n* either comma separated or as an array\n* @param {function} [callback] the result callback called with two arguments:\n* error: null or Error('message'). If false, the content contains the error.\n* content: the server answer that contains the list of results.\n*/\n\n\nIndexCore.prototype.search = buildSearchMethod('query');\n/*\n* -- BETA --\n* Search a record similar to the query inside the index using XMLHttpRequest request (Using a POST query to\n* minimize number of OPTIONS queries: Cross-Origin Resource Sharing).\n*\n* @param {string} [query] the similar query\n* @param {object} [args] (optional) if set, contains an object with query parameters.\n* All search parameters are supported (see search function), restrictSearchableAttributes and facetFilters\n* are the two most useful to restrict the similar results and get more relevant content\n*/\n\nIndexCore.prototype.similarSearch = deprecate(buildSearchMethod('similarQuery'), deprecatedMessage('index.similarSearch(query[, callback])', 'index.search({ similarQuery: query }[, callback])'));\n/*\n* Browse index content. The response content will have a `cursor` property that you can use\n* to browse subsequent pages for this query. Use `index.browseFrom(cursor)` when you want.\n*\n* @param {string} query - The full text query\n* @param {Object} [queryParameters] - Any search query parameter\n* @param {Function} [callback] - The result callback called with two arguments\n* error: null or Error('message')\n* content: the server answer with the browse result\n* @return {Promise|undefined} Returns a promise if no callback given\n* @example\n* index.browse('cool songs', {\n* tagFilters: 'public,comments',\n* hitsPerPage: 500\n* }, callback);\n* @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation}\n*/\n\nIndexCore.prototype.browse = function (query, queryParameters, callback) {\n var merge = require('./merge.js');\n\n var indexObj = this;\n var page;\n var hitsPerPage; // we check variadic calls that are not the one defined\n // .browse()/.browse(fn)\n // => page = 0\n\n if (arguments.length === 0 || arguments.length === 1 && typeof arguments[0] === 'function') {\n page = 0;\n callback = arguments[0];\n query = undefined;\n } else if (typeof arguments[0] === 'number') {\n // .browse(2)/.browse(2, 10)/.browse(2, fn)/.browse(2, 10, fn)\n page = arguments[0];\n\n if (typeof arguments[1] === 'number') {\n hitsPerPage = arguments[1];\n } else if (typeof arguments[1] === 'function') {\n callback = arguments[1];\n hitsPerPage = undefined;\n }\n\n query = undefined;\n queryParameters = undefined;\n } else if (typeof arguments[0] === 'object') {\n // .browse(queryParameters)/.browse(queryParameters, cb)\n if (typeof arguments[1] === 'function') {\n callback = arguments[1];\n }\n\n queryParameters = arguments[0];\n query = undefined;\n } else if (typeof arguments[0] === 'string' && typeof arguments[1] === 'function') {\n // .browse(query, cb)\n callback = arguments[1];\n queryParameters = undefined;\n } // otherwise it's a .browse(query)/.browse(query, queryParameters)/.browse(query, queryParameters, cb)\n // get search query parameters combining various possible calls\n // to .browse();\n\n\n queryParameters = merge({}, queryParameters || {}, {\n page: page,\n hitsPerPage: hitsPerPage,\n query: query\n });\n\n var params = this.as._getSearchParams(queryParameters, '');\n\n return this.as._jsonRequest({\n method: 'POST',\n url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/browse',\n body: {\n params: params\n },\n hostType: 'read',\n callback: callback\n });\n};\n/*\n* Continue browsing from a previous position (cursor), obtained via a call to `.browse()`.\n*\n* @param {string} query - The full text query\n* @param {Object} [queryParameters] - Any search query parameter\n* @param {Function} [callback] - The result callback called with two arguments\n* error: null or Error('message')\n* content: the server answer with the browse result\n* @return {Promise|undefined} Returns a promise if no callback given\n* @example\n* index.browseFrom('14lkfsakl32', callback);\n* @see {@link https://www.algolia.com/doc/rest_api#Browse|Algolia REST API Documentation}\n*/\n\n\nIndexCore.prototype.browseFrom = function (cursor, callback) {\n return this.as._jsonRequest({\n method: 'POST',\n url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/browse',\n body: {\n cursor: cursor\n },\n hostType: 'read',\n callback: callback\n });\n};\n/*\n* Search for facet values\n* https://www.algolia.com/doc/rest-api/search#search-for-facet-values\n*\n* @param {string} params.facetName Facet name, name of the attribute to search for values in.\n* Must be declared as a facet\n* @param {string} params.facetQuery Query for the facet search\n* @param {string} [params.*] Any search parameter of Algolia,\n* see https://www.algolia.com/doc/api-client/javascript/search#search-parameters\n* Pagination is not supported. The page and hitsPerPage parameters will be ignored.\n* @param callback (optional)\n*/\n\n\nIndexCore.prototype.searchForFacetValues = function (params, callback) {\n var clone = require('./clone.js');\n\n var omit = require('./omit.js');\n\n var usage = 'Usage: index.searchForFacetValues({facetName, facetQuery, ...params}[, callback])';\n\n if (params.facetName === undefined || params.facetQuery === undefined) {\n throw new Error(usage);\n }\n\n var facetName = params.facetName;\n var filteredParams = omit(clone(params), function (keyName) {\n return keyName === 'facetName';\n });\n\n var searchParameters = this.as._getSearchParams(filteredParams, '');\n\n return this.as._jsonRequest({\n method: 'POST',\n url: '/1/indexes/' + encodeURIComponent(this.indexName) + '/facets/' + encodeURIComponent(facetName) + '/query',\n hostType: 'read',\n body: {\n params: searchParameters\n },\n callback: callback\n });\n};\n\nIndexCore.prototype.searchFacet = deprecate(function (params, callback) {\n return this.searchForFacetValues(params, callback);\n}, deprecatedMessage('index.searchFacet(params[, callback])', 'index.searchForFacetValues(params[, callback])'));\n\nIndexCore.prototype._search = function (params, url, callback, additionalUA) {\n return this.as._jsonRequest({\n cache: this.cache,\n method: 'POST',\n url: url || '/1/indexes/' + encodeURIComponent(this.indexName) + '/query',\n body: {\n params: params\n },\n hostType: 'read',\n fallback: {\n method: 'GET',\n url: '/1/indexes/' + encodeURIComponent(this.indexName),\n body: {\n params: params\n }\n },\n callback: callback,\n additionalUA: additionalUA\n });\n};\n/*\n* Get an object from this index\n*\n* @param objectID the unique identifier of the object to retrieve\n* @param attrs (optional) if set, contains the array of attribute names to retrieve\n* @param callback (optional) the result callback called with two arguments\n* error: null or Error('message')\n* content: the object to retrieve or the error message if a failure occurred\n*/\n\n\nIndexCore.prototype.getObject = function (objectID, attrs, callback) {\n var indexObj = this;\n\n if (arguments.length === 1 || typeof attrs === 'function') {\n callback = attrs;\n attrs = undefined;\n }\n\n var params = '';\n\n if (attrs !== undefined) {\n params = '?attributes=';\n\n for (var i = 0; i < attrs.length; ++i) {\n if (i !== 0) {\n params += ',';\n }\n\n params += attrs[i];\n }\n }\n\n return this.as._jsonRequest({\n method: 'GET',\n url: '/1/indexes/' + encodeURIComponent(indexObj.indexName) + '/' + encodeURIComponent(objectID) + params,\n hostType: 'read',\n callback: callback\n });\n};\n/*\n* Get several objects from this index\n*\n* @param objectIDs the array of unique identifier of objects to retrieve\n*/\n\n\nIndexCore.prototype.getObjects = function (objectIDs, attributesToRetrieve, callback) {\n var isArray = require('isarray');\n\n var map = require('./map.js');\n\n var usage = 'Usage: index.getObjects(arrayOfObjectIDs[, callback])';\n\n if (!isArray(objectIDs)) {\n throw new Error(usage);\n }\n\n var indexObj = this;\n\n if (arguments.length === 1 || typeof attributesToRetrieve === 'function') {\n callback = attributesToRetrieve;\n attributesToRetrieve = undefined;\n }\n\n var body = {\n requests: map(objectIDs, function prepareRequest(objectID) {\n var request = {\n indexName: indexObj.indexName,\n objectID: objectID\n };\n\n if (attributesToRetrieve) {\n request.attributesToRetrieve = attributesToRetrieve.join(',');\n }\n\n return request;\n })\n };\n return this.as._jsonRequest({\n method: 'POST',\n url: '/1/indexes/*/objects',\n hostType: 'read',\n body: body,\n callback: callback\n });\n};\n\nIndexCore.prototype.as = null;\nIndexCore.prototype.indexName = null;\nIndexCore.prototype.typeAheadArgs = null;\nIndexCore.prototype.typeAheadValueOption = null;","// 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'; // If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\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\nrequire(\"core-js/modules/es6.array.index-of\");\n\nrequire(\"core-js/modules/es6.regexp.replace\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function (qs, sep, eq, options) {\n sep = sep || '&';\n eq = eq || '=';\n var obj = {};\n\n if (typeof qs !== 'string' || qs.length === 0) {\n return obj;\n }\n\n var regexp = /\\+/g;\n qs = qs.split(sep);\n var maxKeys = 1000;\n\n if (options && typeof options.maxKeys === 'number') {\n maxKeys = options.maxKeys;\n }\n\n var len = qs.length; // maxKeys <= 0 means that we should not limit keys count\n\n if (maxKeys > 0 && len > maxKeys) {\n len = maxKeys;\n }\n\n for (var i = 0; i < len; ++i) {\n var x = qs[i].replace(regexp, '%20'),\n idx = x.indexOf(eq),\n kstr,\n vstr,\n k,\n v;\n\n if (idx >= 0) {\n kstr = x.substr(0, idx);\n vstr = x.substr(idx + 1);\n } else {\n kstr = x;\n vstr = '';\n }\n\n k = decodeURIComponent(kstr);\n v = decodeURIComponent(vstr);\n\n if (!hasOwnProperty(obj, k)) {\n obj[k] = v;\n } else if (isArray(obj[k])) {\n obj[k].push(v);\n } else {\n obj[k] = [obj[k], v];\n }\n }\n\n return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};","require(\"core-js/modules/es6.regexp.constructor\");\n\nrequire(\"core-js/modules/es6.regexp.split\");\n\nrequire(\"core-js/modules/es6.function.bind\");\n\nrequire(\"core-js/modules/es6.regexp.replace\");\n\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0,\n i;\n\n for (i in namespace) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n\nfunction createDebug(namespace) {\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n var self = debug; // set `diff` timestamp\n\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr; // turn the `arguments` into a proper Array\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n } // apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // apply env-specific formatting (colors, etc.)\n\n exports.formatArgs.call(self, args);\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace); // env-specific initialization logic for debug instances\n\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n exports.names = [];\n exports.skips = [];\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n/**\n * Disable debug output.\n *\n * @api public\n */\n\n\nfunction disable() {\n exports.enable('');\n}\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\nfunction enabled(name) {\n var i, len;\n\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n}\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\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}","module.exports = function deprecate(fn, message) {\n var warned = false;\n\n function deprecated() {\n if (!warned) {\n /* eslint no-console:0 */\n console.warn(message);\n warned = true;\n }\n\n return fn.apply(this, arguments);\n }\n\n return deprecated;\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\nexports.decode = exports.parse = require('./decode');\nexports.encode = exports.stringify = require('./encode');","module.exports = function clone(obj) {\n return JSON.parse(JSON.stringify(obj));\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/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\nvar keysShim;\n\nif (!Object.keys) {\n // modified from https://github.com/es-shims/es5-shim\n var has = Object.prototype.hasOwnProperty;\n var toStr = Object.prototype.toString;\n\n var isArgs = require('./isArguments'); // eslint-disable-line global-require\n\n\n var isEnumerable = Object.prototype.propertyIsEnumerable;\n var hasDontEnumBug = !isEnumerable.call({\n toString: null\n }, 'toString');\n var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];\n\n var equalsConstructorPrototype = function equalsConstructorPrototype(o) {\n var ctor = o.constructor;\n return ctor && ctor.prototype === o;\n };\n\n var excludedKeys = {\n $applicationCache: true,\n $console: true,\n $external: true,\n $frame: true,\n $frameElement: true,\n $frames: true,\n $innerHeight: true,\n $innerWidth: true,\n $onmozfullscreenchange: true,\n $onmozfullscreenerror: true,\n $outerHeight: true,\n $outerWidth: true,\n $pageXOffset: true,\n $pageYOffset: true,\n $parent: true,\n $scrollLeft: true,\n $scrollTop: true,\n $scrollX: true,\n $scrollY: true,\n $self: true,\n $webkitIndexedDB: true,\n $webkitStorageInfo: true,\n $window: true\n };\n\n var hasAutomationEqualityBug = function () {\n /* global window */\n if (typeof window === 'undefined') {\n return false;\n }\n\n for (var k in window) {\n try {\n if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n try {\n equalsConstructorPrototype(window[k]);\n } catch (e) {\n return true;\n }\n }\n } catch (e) {\n return true;\n }\n }\n\n return false;\n }();\n\n var equalsConstructorPrototypeIfNotBuggy = function equalsConstructorPrototypeIfNotBuggy(o) {\n /* global window */\n if (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n return equalsConstructorPrototype(o);\n }\n\n try {\n return equalsConstructorPrototype(o);\n } catch (e) {\n return false;\n }\n };\n\n keysShim = function keys(object) {\n var isObject = object !== null && typeof object === 'object';\n var isFunction = toStr.call(object) === '[object Function]';\n var isArguments = isArgs(object);\n var isString = isObject && toStr.call(object) === '[object String]';\n var theKeys = [];\n\n if (!isObject && !isFunction && !isArguments) {\n throw new TypeError('Object.keys called on a non-object');\n }\n\n var skipProto = hasProtoEnumBug && isFunction;\n\n if (isString && object.length > 0 && !has.call(object, 0)) {\n for (var i = 0; i < object.length; ++i) {\n theKeys.push(String(i));\n }\n }\n\n if (isArguments && object.length > 0) {\n for (var j = 0; j < object.length; ++j) {\n theKeys.push(String(j));\n }\n } else {\n for (var name in object) {\n if (!(skipProto && name === 'prototype') && has.call(object, name)) {\n theKeys.push(String(name));\n }\n }\n }\n\n if (hasDontEnumBug) {\n var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n for (var k = 0; k < dontEnums.length; ++k) {\n if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n theKeys.push(dontEnums[k]);\n }\n }\n }\n\n return theKeys;\n };\n}\n\nmodule.exports = keysShim;","'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\nvar AlgoliaSearchCore = require('../../AlgoliaSearchCore.js');\n\nvar createAlgoliasearch = require('../createAlgoliasearch.js');\n\nmodule.exports = createAlgoliasearch(AlgoliaSearchCore, 'Browser (lite)');","require(\"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\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toString = Object.prototype.toString;\n\nmodule.exports = function forEach(obj, fn, ctx) {\n if (toString.call(fn) !== '[object Function]') {\n throw new TypeError('iterator must be a function');\n }\n\n var l = obj.length;\n\n if (l === +l) {\n for (var i = 0; i < l; i++) {\n fn.call(ctx, obj[i], i, obj);\n }\n } else {\n for (var k in obj) {\n if (hasOwn.call(obj, k)) {\n fn.call(ctx, obj[k], k, obj);\n }\n }\n }\n};","import \"core-js/modules/es6.function.bind\";\nimport \"core-js/modules/es6.array.some\";\nimport \"core-js/modules/es6.array.is-array\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.date.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\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 \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.array.last-index-of\";\nimport \"core-js/modules/es6.array.map\";\nimport \"core-js/modules/es6.string.trim\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.array.for-each\";\nimport \"core-js/modules/es6.function.name\";\nimport \"core-js/modules/es6.object.freeze\";\nimport \"core-js/modules/es6.array.index-of\";\nimport \"core-js/modules/es6.object.set-prototype-of\";\nimport \"core-js/modules/es6.object.create\";\nimport \"core-js/modules/es6.object.assign\";\nimport \"core-js/modules/es6.object.define-property\";\nimport \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport Stylis from 'stylis/stylis.min';\nimport _insertRulePlugin from 'stylis-rule-sheet';\nimport React, { cloneElement, createContext, Component, createElement } from 'react';\nimport unitless from '@emotion/unitless';\nimport { isElement, isValidElementType, ForwardRef } from 'react-is';\nimport memoize from 'memoize-one';\nimport PropTypes from 'prop-types';\nimport validAttr from '@emotion/is-prop-valid';\nimport merge from 'merge-anything'; // \n\nvar interleave = function interleave(strings, interpolations) {\n var result = [strings[0]];\n\n for (var i = 0, len = interpolations.length; i < len; i += 1) {\n result.push(interpolations[i], strings[i + 1]);\n }\n\n return result;\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\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\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _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\nvar inherits = function inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar objectWithoutProperties = function objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n};\n\nvar possibleConstructorReturn = function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}; // \n\n\nvar isPlainObject = function isPlainObject(x) {\n return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;\n}; // \n\n\nvar EMPTY_ARRAY = Object.freeze([]);\nvar EMPTY_OBJECT = Object.freeze({}); // \n\nfunction isFunction(test) {\n return typeof test === 'function';\n} // \n\n\nfunction getComponentName(target) {\n return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || target.displayName || target.name || 'Component';\n} // \n\n\nfunction isStatelessFunction(test) {\n return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);\n} // \n\n\nfunction isStyledComponent(target) {\n return target && typeof target.styledComponentId === 'string';\n} // \n\n\nvar SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';\nvar SC_VERSION_ATTR = 'data-styled-version';\nvar SC_STREAM_ATTR = 'data-styled-streamed';\nvar IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;\nvar DISABLE_SPEEDY = typeof SC_DISABLE_SPEEDY === 'boolean' && SC_DISABLE_SPEEDY || typeof process !== 'undefined' && (process.env.REACT_APP_SC_DISABLE_SPEEDY || process.env.SC_DISABLE_SPEEDY) || process.env.NODE_ENV !== 'production'; // Shared empty execution context when generating static styles\n\nvar STATIC_EXECUTION_CONTEXT = {}; // \n\n/**\n * Parse errors.md and turn it into a simple hash of code: message\n */\n\nvar ERRORS = process.env.NODE_ENV !== 'production' ? {\n \"1\": \"Cannot create styled-component for component: %s.\\n\\n\",\n \"2\": \"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\\n\\n- Are you trying to reuse it across renders?\\n- Are you accidentally calling collectStyles twice?\\n\\n\",\n \"3\": \"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\\n\\n\",\n \"4\": \"The `StyleSheetManager` expects a valid target or sheet prop!\\n\\n- Does this error occur on the client and is your target falsy?\\n- Does this error occur on the server and is the sheet falsy?\\n\\n\",\n \"5\": \"The clone method cannot be used on the client!\\n\\n- Are you running in a client-like environment on the server?\\n- Are you trying to run SSR on the client?\\n\\n\",\n \"6\": \"Trying to insert a new style tag, but the given Node is unmounted!\\n\\n- Are you using a custom target that isn't mounted?\\n- Does your document not have a valid head element?\\n- Have you accidentally removed a style tag manually?\\n\\n\",\n \"7\": \"ThemeProvider: Please return an object from your \\\"theme\\\" prop function, e.g.\\n\\n```js\\ntheme={() => ({})}\\n```\\n\\n\",\n \"8\": \"ThemeProvider: Please make your \\\"theme\\\" prop an object.\\n\\n\",\n \"9\": \"Missing document `<head>`\\n\\n\",\n \"10\": \"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\\n\\n\",\n \"11\": \"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\\n\\n\",\n \"12\": \"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\\\`\\\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\\n\\n\",\n \"13\": \"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\\n\"\n} : {};\n/**\n * super basic version of sprintf\n */\n\nfunction format() {\n var a = arguments.length <= 0 ? undefined : arguments[0];\n var b = [];\n\n for (var c = 1, len = arguments.length; c < len; c += 1) {\n b.push(arguments.length <= c ? undefined : arguments[c]);\n }\n\n b.forEach(function (d) {\n a = a.replace(/%[a-z]/, d);\n });\n return a;\n}\n/**\n * Create an error file out of errors.md for development and a simple web link to the full errors\n * in production mode.\n */\n\n\nvar StyledComponentsError = function (_Error) {\n inherits(StyledComponentsError, _Error);\n\n function StyledComponentsError(code) {\n classCallCheck(this, StyledComponentsError);\n\n for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (process.env.NODE_ENV === 'production') {\n var _this = possibleConstructorReturn(this, _Error.call(this, 'An error occurred. See https://github.com/styled-components/styled-components/blob/master/packages/styled-components/src/utils/errors.md#' + code + ' for more information.' + (interpolations.length > 0 ? ' Additional arguments: ' + interpolations.join(', ') : '')));\n } else {\n var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations)).trim()));\n }\n\n return possibleConstructorReturn(_this);\n }\n\n return StyledComponentsError;\n}(Error); // \n\n\nvar SC_COMPONENT_ID = /^[^\\S\\n]*?\\/\\* sc-component-id:\\s*(\\S+)\\s+\\*\\//gm;\n\nvar extractComps = function extractComps(maybeCSS) {\n var css = '' + (maybeCSS || ''); // Definitely a string, and a clone\n\n var existingComponents = [];\n css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {\n existingComponents.push({\n componentId: componentId,\n matchIndex: matchIndex\n });\n return match;\n });\n return existingComponents.map(function (_ref, i) {\n var componentId = _ref.componentId,\n matchIndex = _ref.matchIndex;\n var nextComp = existingComponents[i + 1];\n var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);\n return {\n componentId: componentId,\n cssFromDOM: cssFromDOM\n };\n });\n}; // \n\n\nvar COMMENT_REGEX = /^\\s*\\/\\/.*$/gm; // NOTE: This stylis instance is only used to split rules from SSR'd style tags\n\nvar stylisSplitter = new Stylis({\n global: false,\n cascade: true,\n keyframe: false,\n prefix: false,\n compress: false,\n semicolon: true\n});\nvar stylis = new Stylis({\n global: false,\n cascade: true,\n keyframe: false,\n prefix: true,\n compress: false,\n semicolon: false // NOTE: This means \"autocomplete missing semicolons\"\n\n}); // Wrap `insertRulePlugin to build a list of rules,\n// and then make our own plugin to return the rules. This\n// makes it easier to hook into the existing SSR architecture\n\nvar parsingRules = []; // eslint-disable-next-line consistent-return\n\nvar returnRulesPlugin = function returnRulesPlugin(context) {\n if (context === -2) {\n var parsedRules = parsingRules;\n parsingRules = [];\n return parsedRules;\n }\n};\n\nvar parseRulesPlugin = _insertRulePlugin(function (rule) {\n parsingRules.push(rule);\n});\n\nvar _componentId = void 0;\n\nvar _selector = void 0;\n\nvar _selectorRegexp = void 0;\n\nvar selfReferenceReplacer = function selfReferenceReplacer(match, offset, string) {\n if ( // the first self-ref is always untouched\n offset > 0 && // there should be at least two self-refs to do a replacement (.b > .b)\n string.slice(0, offset).indexOf(_selector) !== -1 && // no consecutive self refs (.b.b); that is a precedence boost and treated differently\n string.slice(offset - _selector.length, offset) !== _selector) {\n return '.' + _componentId;\n }\n\n return match;\n};\n/**\n * When writing a style like\n *\n * & + & {\n * color: red;\n * }\n *\n * The second ampersand should be a reference to the static component class. stylis\n * has no knowledge of static class so we have to intelligently replace the base selector.\n */\n\n\nvar selfReferenceReplacementPlugin = function selfReferenceReplacementPlugin(context, _, selectors) {\n if (context === 2 && selectors.length && selectors[0].lastIndexOf(_selector) > 0) {\n // eslint-disable-next-line no-param-reassign\n selectors[0] = selectors[0].replace(_selectorRegexp, selfReferenceReplacer);\n }\n};\n\nstylis.use([selfReferenceReplacementPlugin, parseRulesPlugin, returnRulesPlugin]);\nstylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);\n\nvar splitByRules = function splitByRules(css) {\n return stylisSplitter('', css);\n};\n\nfunction stringifyRules(rules, selector, prefix) {\n var componentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '&';\n var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments\n\n var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS; // stylis has no concept of state to be passed to plugins\n // but since JS is single=threaded, we can rely on that to ensure\n // these properties stay in sync with the current stylis run\n\n _componentId = componentId;\n _selector = selector;\n _selectorRegexp = new RegExp('\\\\' + _selector + '\\\\b', 'g');\n return stylis(prefix || !selector ? '' : selector, cssStr);\n} // \n\n/* eslint-disable camelcase, no-undef */\n\n\nvar getNonce = function getNonce() {\n return typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n}; // \n\n/* These are helpers for the StyleTags to keep track of the injected\n * rule names for each (component) ID that they're keeping track of.\n * They're crucial for detecting whether a name has already been\n * injected.\n * (This excludes rehydrated names) */\n\n/* adds a new ID:name pairing to a names dictionary */\n\n\nvar addNameForId = function addNameForId(names, id, name) {\n if (name) {\n // eslint-disable-next-line no-param-reassign\n var namesForId = names[id] || (names[id] = Object.create(null));\n namesForId[name] = true;\n }\n};\n/* resets an ID entirely by overwriting it in the dictionary */\n\n\nvar resetIdNames = function resetIdNames(names, id) {\n // eslint-disable-next-line no-param-reassign\n names[id] = Object.create(null);\n};\n/* factory for a names dictionary checking the existance of an ID:name pairing */\n\n\nvar hasNameForId = function hasNameForId(names) {\n return function (id, name) {\n return names[id] !== undefined && names[id][name];\n };\n};\n/* stringifies names for the html/element output */\n\n\nvar stringifyNames = function stringifyNames(names) {\n var str = ''; // eslint-disable-next-line guard-for-in\n\n for (var id in names) {\n str += Object.keys(names[id]).join(' ') + ' ';\n }\n\n return str.trim();\n};\n/* clones the nested names dictionary */\n\n\nvar cloneNames = function cloneNames(names) {\n var clone = Object.create(null); // eslint-disable-next-line guard-for-in\n\n for (var id in names) {\n clone[id] = _extends({}, names[id]);\n }\n\n return clone;\n}; // \n\n/* These are helpers that deal with the insertRule (aka speedy) API\n * They are used in the StyleTags and specifically the speedy tag\n */\n\n/* retrieve a sheet for a given style tag */\n\n\nvar sheetForTag = function sheetForTag(tag) {\n // $FlowFixMe\n if (tag.sheet) return tag.sheet;\n /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */\n\n var size = tag.ownerDocument.styleSheets.length;\n\n for (var i = 0; i < size; i += 1) {\n var sheet = tag.ownerDocument.styleSheets[i]; // $FlowFixMe\n\n if (sheet.ownerNode === tag) return sheet;\n }\n /* we should always be able to find a tag */\n\n\n throw new StyledComponentsError(10);\n};\n/* insert a rule safely and return whether it was actually injected */\n\n\nvar safeInsertRule = function safeInsertRule(sheet, cssRule, index) {\n /* abort early if cssRule string is falsy */\n if (!cssRule) return false;\n var maxIndex = sheet.cssRules.length;\n\n try {\n /* use insertRule and cap passed index with maxIndex (no of cssRules) */\n sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);\n } catch (err) {\n /* any error indicates an invalid rule */\n return false;\n }\n\n return true;\n};\n/* deletes `size` rules starting from `removalIndex` */\n\n\nvar deleteRules = function deleteRules(sheet, removalIndex, size) {\n var lowerBound = removalIndex - size;\n\n for (var i = removalIndex; i > lowerBound; i -= 1) {\n sheet.deleteRule(i);\n }\n}; // \n\n/* this marker separates component styles and is important for rehydration */\n\n\nvar makeTextMarker = function makeTextMarker(id) {\n return '\\n/* sc-component-id: ' + id + ' */\\n';\n};\n/* add up all numbers in array up until and including the index */\n\n\nvar addUpUntilIndex = function addUpUntilIndex(sizes, index) {\n var totalUpToIndex = 0;\n\n for (var i = 0; i <= index; i += 1) {\n totalUpToIndex += sizes[i];\n }\n\n return totalUpToIndex;\n};\n/* create a new style tag after lastEl */\n\n\nvar makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {\n var targetDocument = document;\n if (target) targetDocument = target.ownerDocument;else if (tagEl) targetDocument = tagEl.ownerDocument;\n var el = targetDocument.createElement('style');\n el.setAttribute(SC_ATTR, '');\n el.setAttribute(SC_VERSION_ATTR, \"4.4.1\");\n var nonce = getNonce();\n\n if (nonce) {\n el.setAttribute('nonce', nonce);\n }\n /* Work around insertRule quirk in EdgeHTML */\n\n\n el.appendChild(targetDocument.createTextNode(''));\n\n if (target && !tagEl) {\n /* Append to target when no previous element was passed */\n target.appendChild(el);\n } else {\n if (!tagEl || !target || !tagEl.parentNode) {\n throw new StyledComponentsError(6);\n }\n /* Insert new style tag after the previous one */\n\n\n tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);\n }\n\n return el;\n};\n/* takes a css factory function and outputs an html styled tag factory */\n\n\nvar wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {\n return function (additionalAttrs) {\n var nonce = getNonce();\n var attrs = [nonce && 'nonce=\"' + nonce + '\"', SC_ATTR + '=\"' + stringifyNames(names) + '\"', SC_VERSION_ATTR + '=\"' + \"4.4.1\" + '\"', additionalAttrs];\n var htmlAttr = attrs.filter(Boolean).join(' ');\n return '<style ' + htmlAttr + '>' + css() + '</style>';\n };\n};\n/* takes a css factory function and outputs an element factory */\n\n\nvar wrapAsElement = function wrapAsElement(css, names) {\n return function () {\n var _props;\n\n var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props[SC_VERSION_ATTR] = \"4.4.1\", _props);\n var nonce = getNonce();\n\n if (nonce) {\n // $FlowFixMe\n props.nonce = nonce;\n } // eslint-disable-next-line react/no-danger\n\n\n return React.createElement('style', _extends({}, props, {\n dangerouslySetInnerHTML: {\n __html: css()\n }\n }));\n };\n};\n\nvar getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {\n return function () {\n return Object.keys(markers);\n };\n};\n/* speedy tags utilise insertRule */\n\n\nvar makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {\n var names = Object.create(null);\n var markers = Object.create(null);\n var sizes = [];\n var extractImport = getImportRuleTag !== undefined;\n /* indicates whether getImportRuleTag was called */\n\n var usedImportRuleTag = false;\n\n var insertMarker = function insertMarker(id) {\n var prev = markers[id];\n\n if (prev !== undefined) {\n return prev;\n }\n\n markers[id] = sizes.length;\n sizes.push(0);\n resetIdNames(names, id);\n return markers[id];\n };\n\n var insertRules = function insertRules(id, cssRules, name) {\n var marker = insertMarker(id);\n var sheet = sheetForTag(el);\n var insertIndex = addUpUntilIndex(sizes, marker);\n var injectedRules = 0;\n var importRules = [];\n var cssRulesSize = cssRules.length;\n\n for (var i = 0; i < cssRulesSize; i += 1) {\n var cssRule = cssRules[i];\n var mayHaveImport = extractImport;\n /* @import rules are reordered to appear first */\n\n if (mayHaveImport && cssRule.indexOf('@import') !== -1) {\n importRules.push(cssRule);\n } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {\n mayHaveImport = false;\n injectedRules += 1;\n }\n }\n\n if (extractImport && importRules.length > 0) {\n usedImportRuleTag = true; // $FlowFixMe\n\n getImportRuleTag().insertRules(id + '-import', importRules);\n }\n\n sizes[marker] += injectedRules;\n /* add up no of injected rules */\n\n addNameForId(names, id, name);\n };\n\n var removeRules = function removeRules(id) {\n var marker = markers[id];\n if (marker === undefined) return; // $FlowFixMe\n\n if (el.isConnected === false) return;\n var size = sizes[marker];\n var sheet = sheetForTag(el);\n var removalIndex = addUpUntilIndex(sizes, marker) - 1;\n deleteRules(sheet, removalIndex, size);\n sizes[marker] = 0;\n resetIdNames(names, id);\n\n if (extractImport && usedImportRuleTag) {\n // $FlowFixMe\n getImportRuleTag().removeRules(id + '-import');\n }\n };\n\n var css = function css() {\n var _sheetForTag = sheetForTag(el),\n cssRules = _sheetForTag.cssRules;\n\n var str = ''; // eslint-disable-next-line guard-for-in\n\n for (var id in markers) {\n str += makeTextMarker(id);\n var marker = markers[id];\n var end = addUpUntilIndex(sizes, marker);\n var size = sizes[marker];\n\n for (var i = end - size; i < end; i += 1) {\n var rule = cssRules[i];\n\n if (rule !== undefined) {\n str += rule.cssText;\n }\n }\n }\n\n return str;\n };\n\n return {\n clone: function clone() {\n throw new StyledComponentsError(5);\n },\n css: css,\n getIds: getIdsFromMarkersFactory(markers),\n hasNameForId: hasNameForId(names),\n insertMarker: insertMarker,\n insertRules: insertRules,\n removeRules: removeRules,\n sealed: false,\n styleTag: el,\n toElement: wrapAsElement(css, names),\n toHTML: wrapAsHtmlTag(css, names)\n };\n};\n\nvar makeTextNode = function makeTextNode(targetDocument, id) {\n return targetDocument.createTextNode(makeTextMarker(id));\n};\n\nvar makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {\n var names = Object.create(null);\n var markers = Object.create(null);\n var extractImport = getImportRuleTag !== undefined;\n /* indicates whether getImportRuleTag was called */\n\n var usedImportRuleTag = false;\n\n var insertMarker = function insertMarker(id) {\n var prev = markers[id];\n\n if (prev !== undefined) {\n return prev;\n }\n\n markers[id] = makeTextNode(el.ownerDocument, id);\n el.appendChild(markers[id]);\n names[id] = Object.create(null);\n return markers[id];\n };\n\n var insertRules = function insertRules(id, cssRules, name) {\n var marker = insertMarker(id);\n var importRules = [];\n var cssRulesSize = cssRules.length;\n\n for (var i = 0; i < cssRulesSize; i += 1) {\n var rule = cssRules[i];\n var mayHaveImport = extractImport;\n\n if (mayHaveImport && rule.indexOf('@import') !== -1) {\n importRules.push(rule);\n } else {\n mayHaveImport = false;\n var separator = i === cssRulesSize - 1 ? '' : ' ';\n marker.appendData('' + rule + separator);\n }\n }\n\n addNameForId(names, id, name);\n\n if (extractImport && importRules.length > 0) {\n usedImportRuleTag = true; // $FlowFixMe\n\n getImportRuleTag().insertRules(id + '-import', importRules);\n }\n };\n\n var removeRules = function removeRules(id) {\n var marker = markers[id];\n if (marker === undefined) return;\n /* create new empty text node and replace the current one */\n\n var newMarker = makeTextNode(el.ownerDocument, id);\n el.replaceChild(newMarker, marker);\n markers[id] = newMarker;\n resetIdNames(names, id);\n\n if (extractImport && usedImportRuleTag) {\n // $FlowFixMe\n getImportRuleTag().removeRules(id + '-import');\n }\n };\n\n var css = function css() {\n var str = ''; // eslint-disable-next-line guard-for-in\n\n for (var id in markers) {\n str += markers[id].data;\n }\n\n return str;\n };\n\n return {\n clone: function clone() {\n throw new StyledComponentsError(5);\n },\n css: css,\n getIds: getIdsFromMarkersFactory(markers),\n hasNameForId: hasNameForId(names),\n insertMarker: insertMarker,\n insertRules: insertRules,\n removeRules: removeRules,\n sealed: false,\n styleTag: el,\n toElement: wrapAsElement(css, names),\n toHTML: wrapAsHtmlTag(css, names)\n };\n};\n\nvar makeServerTag = function makeServerTag(namesArg, markersArg) {\n var names = namesArg === undefined ? Object.create(null) : namesArg;\n var markers = markersArg === undefined ? Object.create(null) : markersArg;\n\n var insertMarker = function insertMarker(id) {\n var prev = markers[id];\n\n if (prev !== undefined) {\n return prev;\n }\n\n return markers[id] = [''];\n };\n\n var insertRules = function insertRules(id, cssRules, name) {\n var marker = insertMarker(id);\n marker[0] += cssRules.join(' ');\n addNameForId(names, id, name);\n };\n\n var removeRules = function removeRules(id) {\n var marker = markers[id];\n if (marker === undefined) return;\n marker[0] = '';\n resetIdNames(names, id);\n };\n\n var css = function css() {\n var str = ''; // eslint-disable-next-line guard-for-in\n\n for (var id in markers) {\n var cssForId = markers[id][0];\n\n if (cssForId) {\n str += makeTextMarker(id) + cssForId;\n }\n }\n\n return str;\n };\n\n var clone = function clone() {\n var namesClone = cloneNames(names);\n var markersClone = Object.create(null); // eslint-disable-next-line guard-for-in\n\n for (var id in markers) {\n markersClone[id] = [markers[id][0]];\n }\n\n return makeServerTag(namesClone, markersClone);\n };\n\n var tag = {\n clone: clone,\n css: css,\n getIds: getIdsFromMarkersFactory(markers),\n hasNameForId: hasNameForId(names),\n insertMarker: insertMarker,\n insertRules: insertRules,\n removeRules: removeRules,\n sealed: false,\n styleTag: null,\n toElement: wrapAsElement(css, names),\n toHTML: wrapAsHtmlTag(css, names)\n };\n return tag;\n};\n\nvar makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {\n if (IS_BROWSER && !forceServer) {\n var el = makeStyleTag(target, tagEl, insertBefore);\n\n if (DISABLE_SPEEDY) {\n return makeBrowserTag(el, getImportRuleTag);\n } else {\n return makeSpeedyTag(el, getImportRuleTag);\n }\n }\n\n return makeServerTag();\n};\n\nvar rehydrate = function rehydrate(tag, els, extracted) {\n /* add all extracted components to the new tag */\n for (var i = 0, len = extracted.length; i < len; i += 1) {\n var _extracted$i = extracted[i],\n componentId = _extracted$i.componentId,\n cssFromDOM = _extracted$i.cssFromDOM;\n var cssRules = splitByRules(cssFromDOM);\n tag.insertRules(componentId, cssRules);\n }\n /* remove old HTMLStyleElements, since they have been rehydrated */\n\n\n for (var _i = 0, _len = els.length; _i < _len; _i += 1) {\n var el = els[_i];\n\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n }\n}; // \n\n\nvar SPLIT_REGEX = /\\s+/;\n/* determine the maximum number of components before tags are sharded */\n\nvar MAX_SIZE = void 0;\n\nif (IS_BROWSER) {\n /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */\n MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;\n} else {\n /* for servers we do not need to shard at all */\n MAX_SIZE = -1;\n}\n\nvar sheetRunningId = 0;\nvar master = void 0;\n\nvar StyleSheet = function () {\n /* a map from ids to tags */\n\n /* deferred rules for a given id */\n\n /* this is used for not reinjecting rules via hasNameForId() */\n\n /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */\n\n /* a list of tags belonging to this StyleSheet */\n\n /* a tag for import rules */\n\n /* current capacity until a new tag must be created */\n\n /* children (aka clones) of this StyleSheet inheriting all and future injections */\n function StyleSheet() {\n var _this = this;\n\n var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;\n var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n classCallCheck(this, StyleSheet);\n\n this.getImportRuleTag = function () {\n var importRuleTag = _this.importRuleTag;\n\n if (importRuleTag !== undefined) {\n return importRuleTag;\n }\n\n var firstTag = _this.tags[0];\n var insertBefore = true;\n return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);\n };\n\n sheetRunningId += 1;\n this.id = sheetRunningId;\n this.forceServer = forceServer;\n this.target = forceServer ? null : target;\n this.tagMap = {};\n this.deferred = {};\n this.rehydratedNames = {};\n this.ignoreRehydratedNames = {};\n this.tags = [];\n this.capacity = 1;\n this.clones = [];\n }\n /* rehydrate all SSR'd style tags */\n\n\n StyleSheet.prototype.rehydrate = function rehydrate$$1() {\n if (!IS_BROWSER || this.forceServer) return this;\n var els = [];\n var extracted = [];\n var isStreamed = false;\n /* retrieve all of our SSR style elements from the DOM */\n\n var nodes = document.querySelectorAll('style[' + SC_ATTR + '][' + SC_VERSION_ATTR + '=\"' + \"4.4.1\" + '\"]');\n var nodesSize = nodes.length;\n /* abort rehydration if no previous style tags were found */\n\n if (!nodesSize) return this;\n\n for (var i = 0; i < nodesSize; i += 1) {\n var el = nodes[i];\n /* check if style tag is a streamed tag */\n\n if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);\n /* retrieve all component names */\n\n var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);\n var elNamesSize = elNames.length;\n\n for (var j = 0, name; j < elNamesSize; j += 1) {\n name = elNames[j];\n /* add rehydrated name to sheet to avoid re-adding styles */\n\n this.rehydratedNames[name] = true;\n }\n /* extract all components and their CSS */\n\n\n extracted.push.apply(extracted, extractComps(el.textContent));\n /* store original HTMLStyleElement */\n\n els.push(el);\n }\n /* abort rehydration if nothing was extracted */\n\n\n var extractedSize = extracted.length;\n if (!extractedSize) return this;\n /* create a tag to be used for rehydration */\n\n var tag = this.makeTag(null);\n rehydrate(tag, els, extracted);\n /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */\n\n this.capacity = Math.max(1, MAX_SIZE - extractedSize);\n this.tags.push(tag);\n /* retrieve all component ids */\n\n for (var _j = 0; _j < extractedSize; _j += 1) {\n this.tagMap[extracted[_j].componentId] = tag;\n }\n\n return this;\n };\n /* retrieve a \"master\" instance of StyleSheet which is typically used when no other is available\n * The master StyleSheet is targeted by createGlobalStyle, keyframes, and components outside of any\n * StyleSheetManager's context */\n\n /* reset the internal \"master\" instance */\n\n\n StyleSheet.reset = function reset() {\n var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n master = new StyleSheet(undefined, forceServer).rehydrate();\n };\n /* adds \"children\" to the StyleSheet that inherit all of the parents' rules\n * while their own rules do not affect the parent */\n\n\n StyleSheet.prototype.clone = function clone() {\n var sheet = new StyleSheet(this.target, this.forceServer);\n /* add to clone array */\n\n this.clones.push(sheet);\n /* clone all tags */\n\n sheet.tags = this.tags.map(function (tag) {\n var ids = tag.getIds();\n var newTag = tag.clone();\n /* reconstruct tagMap */\n\n for (var i = 0; i < ids.length; i += 1) {\n sheet.tagMap[ids[i]] = newTag;\n }\n\n return newTag;\n });\n /* clone other maps */\n\n sheet.rehydratedNames = _extends({}, this.rehydratedNames);\n sheet.deferred = _extends({}, this.deferred);\n return sheet;\n };\n /* force StyleSheet to create a new tag on the next injection */\n\n\n StyleSheet.prototype.sealAllTags = function sealAllTags() {\n this.capacity = 1;\n this.tags.forEach(function (tag) {\n // eslint-disable-next-line no-param-reassign\n tag.sealed = true;\n });\n };\n\n StyleSheet.prototype.makeTag = function makeTag$$1(tag) {\n var lastEl = tag ? tag.styleTag : null;\n var insertBefore = false;\n return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);\n };\n /* get a tag for a given componentId, assign the componentId to one, or shard */\n\n\n StyleSheet.prototype.getTagForId = function getTagForId(id) {\n /* simply return a tag, when the componentId was already assigned one */\n var prev = this.tagMap[id];\n\n if (prev !== undefined && !prev.sealed) {\n return prev;\n }\n\n var tag = this.tags[this.tags.length - 1];\n /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */\n\n this.capacity -= 1;\n\n if (this.capacity === 0) {\n this.capacity = MAX_SIZE;\n tag = this.makeTag(tag);\n this.tags.push(tag);\n }\n\n return this.tagMap[id] = tag;\n };\n /* mainly for createGlobalStyle to check for its id */\n\n\n StyleSheet.prototype.hasId = function hasId(id) {\n return this.tagMap[id] !== undefined;\n };\n /* caching layer checking id+name to already have a corresponding tag and injected rules */\n\n\n StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {\n /* exception for rehydrated names which are checked separately */\n if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {\n return true;\n }\n\n var tag = this.tagMap[id];\n return tag !== undefined && tag.hasNameForId(id, name);\n };\n /* registers a componentId and registers it on its tag */\n\n\n StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {\n /* don't inject when the id is already registered */\n if (this.tagMap[id] !== undefined) return;\n var clones = this.clones;\n\n for (var i = 0; i < clones.length; i += 1) {\n clones[i].deferredInject(id, cssRules);\n }\n\n this.getTagForId(id).insertMarker(id);\n this.deferred[id] = cssRules;\n };\n /* injects rules for a given id with a name that will need to be cached */\n\n\n StyleSheet.prototype.inject = function inject(id, cssRules, name) {\n var clones = this.clones;\n\n for (var i = 0; i < clones.length; i += 1) {\n clones[i].inject(id, cssRules, name);\n }\n\n var tag = this.getTagForId(id);\n /* add deferred rules for component */\n\n if (this.deferred[id] !== undefined) {\n // Combine passed cssRules with previously deferred CSS rules\n // NOTE: We cannot mutate the deferred array itself as all clones\n // do the same (see clones[i].inject)\n var rules = this.deferred[id].concat(cssRules);\n tag.insertRules(id, rules, name);\n this.deferred[id] = undefined;\n } else {\n tag.insertRules(id, cssRules, name);\n }\n };\n /* removes all rules for a given id, which doesn't remove its marker but resets it */\n\n\n StyleSheet.prototype.remove = function remove(id) {\n var tag = this.tagMap[id];\n if (tag === undefined) return;\n var clones = this.clones;\n\n for (var i = 0; i < clones.length; i += 1) {\n clones[i].remove(id);\n }\n /* remove all rules from the tag */\n\n\n tag.removeRules(id);\n /* ignore possible rehydrated names */\n\n this.ignoreRehydratedNames[id] = true;\n /* delete possible deferred rules */\n\n this.deferred[id] = undefined;\n };\n\n StyleSheet.prototype.toHTML = function toHTML() {\n return this.tags.map(function (tag) {\n return tag.toHTML();\n }).join('');\n };\n\n StyleSheet.prototype.toReactElements = function toReactElements() {\n var id = this.id;\n return this.tags.map(function (tag, i) {\n var key = 'sc-' + id + '-' + i;\n return cloneElement(tag.toElement(), {\n key: key\n });\n });\n };\n\n createClass(StyleSheet, null, [{\n key: 'master',\n get: function get$$1() {\n return master || (master = new StyleSheet().rehydrate());\n }\n /* NOTE: This is just for backwards-compatibility with jest-styled-components */\n\n }, {\n key: 'instance',\n get: function get$$1() {\n return StyleSheet.master;\n }\n }]);\n return StyleSheet;\n}(); // \n\n\nvar Keyframes = function () {\n function Keyframes(name, rules) {\n var _this = this;\n\n classCallCheck(this, Keyframes);\n\n this.inject = function (styleSheet) {\n if (!styleSheet.hasNameForId(_this.id, _this.name)) {\n styleSheet.inject(_this.id, _this.rules, _this.name);\n }\n };\n\n this.toString = function () {\n throw new StyledComponentsError(12, String(_this.name));\n };\n\n this.name = name;\n this.rules = rules;\n this.id = 'sc-keyframes-' + name;\n }\n\n Keyframes.prototype.getName = function getName() {\n return this.name;\n };\n\n return Keyframes;\n}(); // \n\n/**\n * inlined version of\n * https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/hyphenateStyleName.js\n */\n\n\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^ms-/;\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n *\n * @param {string} string\n * @return {string}\n */\n\nfunction hyphenateStyleName(string) {\n return string.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n} // \n// Taken from https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/packages/react-dom/src/shared/dangerousStyleValue.js\n\n\nfunction addUnitIfNeeded(name, value) {\n // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133\n // $FlowFixMe\n if (value == null || typeof value === 'boolean' || value === '') {\n return '';\n }\n\n if (typeof value === 'number' && value !== 0 && !(name in unitless)) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return String(value).trim();\n} // \n\n/**\n * It's falsish not falsy because 0 is allowed.\n */\n\n\nvar isFalsish = function isFalsish(chunk) {\n return chunk === undefined || chunk === null || chunk === false || chunk === '';\n};\n\nvar objToCssArray = function objToCssArray(obj, prevKey) {\n var rules = [];\n var keys = Object.keys(obj);\n keys.forEach(function (key) {\n if (!isFalsish(obj[key])) {\n if (isPlainObject(obj[key])) {\n rules.push.apply(rules, objToCssArray(obj[key], key));\n return rules;\n } else if (isFunction(obj[key])) {\n rules.push(hyphenateStyleName(key) + ':', obj[key], ';');\n return rules;\n }\n\n rules.push(hyphenateStyleName(key) + ': ' + addUnitIfNeeded(key, obj[key]) + ';');\n }\n\n return rules;\n });\n return prevKey ? [prevKey + ' {'].concat(rules, ['}']) : rules;\n};\n\nfunction flatten(chunk, executionContext, styleSheet) {\n if (Array.isArray(chunk)) {\n var ruleSet = [];\n\n for (var i = 0, len = chunk.length, result; i < len; i += 1) {\n result = flatten(chunk[i], executionContext, styleSheet);\n if (result === null) continue;else if (Array.isArray(result)) ruleSet.push.apply(ruleSet, result);else ruleSet.push(result);\n }\n\n return ruleSet;\n }\n\n if (isFalsish(chunk)) {\n return null;\n }\n /* Handle other components */\n\n\n if (isStyledComponent(chunk)) {\n return '.' + chunk.styledComponentId;\n }\n /* Either execute or defer the function */\n\n\n if (isFunction(chunk)) {\n if (isStatelessFunction(chunk) && executionContext) {\n var _result = chunk(executionContext);\n\n if (process.env.NODE_ENV !== 'production' && isElement(_result)) {\n // eslint-disable-next-line no-console\n console.warn(getComponentName(chunk) + ' is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.');\n }\n\n return flatten(_result, executionContext, styleSheet);\n } else return chunk;\n }\n\n if (chunk instanceof Keyframes) {\n if (styleSheet) {\n chunk.inject(styleSheet);\n return chunk.getName();\n } else return chunk;\n }\n /* Handle objects */\n\n\n return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();\n} // \n\n\nfunction css(styles) {\n for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n if (isFunction(styles) || isPlainObject(styles)) {\n // $FlowFixMe\n return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));\n } // $FlowFixMe\n\n\n return flatten(interleave(styles, interpolations));\n} // \n\n\nfunction constructWithOptions(componentConstructor, tag) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;\n\n if (!isValidElementType(tag)) {\n throw new StyledComponentsError(1, String(tag));\n }\n /* This is callable directly as a template function */\n // $FlowFixMe: Not typed to avoid destructuring arguments\n\n\n var templateFunction = function templateFunction() {\n return componentConstructor(tag, options, css.apply(undefined, arguments));\n };\n /* If config methods are called, wrap up a new template function and merge options */\n\n\n templateFunction.withConfig = function (config) {\n return constructWithOptions(componentConstructor, tag, _extends({}, options, config));\n };\n /* Modify/inject new props at runtime */\n\n\n templateFunction.attrs = function (attrs) {\n return constructWithOptions(componentConstructor, tag, _extends({}, options, {\n attrs: Array.prototype.concat(options.attrs, attrs).filter(Boolean)\n }));\n };\n\n return templateFunction;\n} // \n// Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js\n\n\nfunction murmurhash(c) {\n for (var e = c.length | 0, a = e | 0, d = 0, b; e >= 4;) {\n b = c.charCodeAt(d) & 255 | (c.charCodeAt(++d) & 255) << 8 | (c.charCodeAt(++d) & 255) << 16 | (c.charCodeAt(++d) & 255) << 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), b ^= b >>> 24, b = 1540483477 * (b & 65535) + ((1540483477 * (b >>> 16) & 65535) << 16), a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16) ^ b, e -= 4, ++d;\n }\n\n switch (e) {\n case 3:\n a ^= (c.charCodeAt(d + 2) & 255) << 16;\n\n case 2:\n a ^= (c.charCodeAt(d + 1) & 255) << 8;\n\n case 1:\n a ^= c.charCodeAt(d) & 255, a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);\n }\n\n a ^= a >>> 13;\n a = 1540483477 * (a & 65535) + ((1540483477 * (a >>> 16) & 65535) << 16);\n return (a ^ a >>> 15) >>> 0;\n} // \n\n/* eslint-disable no-bitwise */\n\n/* This is the \"capacity\" of our alphabet i.e. 2x26 for all letters plus their capitalised\n * counterparts */\n\n\nvar charsLength = 52;\n/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */\n\nvar getAlphabeticChar = function getAlphabeticChar(code) {\n return String.fromCharCode(code + (code > 25 ? 39 : 97));\n};\n/* input a number, usually a hash and convert it to base-52 */\n\n\nfunction generateAlphabeticName(code) {\n var name = '';\n var x = void 0;\n /* get a char and divide by alphabet-length */\n\n for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {\n name = getAlphabeticChar(x % charsLength) + name;\n }\n\n return getAlphabeticChar(x % charsLength) + name;\n} // \n\n\nfunction hasFunctionObjectKey(obj) {\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (var key in obj) {\n if (isFunction(obj[key])) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction isStaticRules(rules, attrs) {\n for (var i = 0; i < rules.length; i += 1) {\n var rule = rules[i]; // recursive case\n\n if (Array.isArray(rule) && !isStaticRules(rule, attrs)) {\n return false;\n } else if (isFunction(rule) && !isStyledComponent(rule)) {\n // functions are allowed to be static if they're just being\n // used to get the classname of a nested styled component\n return false;\n }\n }\n\n if (attrs.some(function (x) {\n return isFunction(x) || hasFunctionObjectKey(x);\n })) return false;\n return true;\n} // \n\n/* combines hashStr (murmurhash) and nameGenerator for convenience */\n\n\nvar hasher = function hasher(str) {\n return generateAlphabeticName(murmurhash(str));\n};\n/*\n ComponentStyle is all the CSS-specific stuff, not\n the React-specific stuff.\n */\n\n\nvar ComponentStyle = function () {\n function ComponentStyle(rules, attrs, componentId) {\n classCallCheck(this, ComponentStyle);\n this.rules = rules;\n this.isStatic = process.env.NODE_ENV === 'production' && isStaticRules(rules, attrs);\n this.componentId = componentId;\n\n if (!StyleSheet.master.hasId(componentId)) {\n StyleSheet.master.deferredInject(componentId, []);\n }\n }\n /*\n * Flattens a rule set into valid CSS\n * Hashes it, wraps the whole chunk in a .hash1234 {}\n * Returns the hash to be injected on render()\n * */\n\n\n ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {\n var isStatic = this.isStatic,\n componentId = this.componentId,\n lastClassName = this.lastClassName;\n\n if (IS_BROWSER && isStatic && typeof lastClassName === 'string' && styleSheet.hasNameForId(componentId, lastClassName)) {\n return lastClassName;\n }\n\n var flatCSS = flatten(this.rules, executionContext, styleSheet);\n var name = hasher(this.componentId + flatCSS.join(''));\n\n if (!styleSheet.hasNameForId(componentId, name)) {\n styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name, undefined, componentId), name);\n }\n\n this.lastClassName = name;\n return name;\n };\n\n ComponentStyle.generateName = function generateName(str) {\n return hasher(str);\n };\n\n return ComponentStyle;\n}(); // \n\n\nvar LIMIT = 200;\n\nvar createWarnTooManyClasses = function createWarnTooManyClasses(displayName) {\n var generatedClasses = {};\n var warningSeen = false;\n return function (className) {\n if (!warningSeen) {\n generatedClasses[className] = true;\n\n if (Object.keys(generatedClasses).length >= LIMIT) {\n // Unable to find latestRule in test environment.\n\n /* eslint-disable no-console, prefer-template */\n console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \\n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\\n' + 'Example:\\n' + ' const Component = styled.div.attrs(props => ({\\n' + ' style: {\\n' + ' background: props.background,\\n' + ' },\\n' + ' }))`width: 100%;`\\n\\n' + ' <Component />');\n warningSeen = true;\n generatedClasses = {};\n }\n }\n };\n}; // \n\n\nvar determineTheme = function determineTheme(props, fallbackTheme) {\n var defaultProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT; // Props should take precedence over ThemeProvider, which should take precedence over\n // defaultProps, but React automatically puts defaultProps on props.\n\n /* eslint-disable react/prop-types, flowtype-errors/show-errors */\n\n var isDefaultTheme = defaultProps ? props.theme === defaultProps.theme : false;\n var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme || defaultProps.theme;\n /* eslint-enable */\n\n return theme;\n}; // \n\n\nvar escapeRegex = /[[\\].#*$><+~=|^:(),\"'`-]+/g;\nvar dashesAtEnds = /(^-|-$)/g;\n/**\n * TODO: Explore using CSS.escape when it becomes more available\n * in evergreen browsers.\n */\n\nfunction escape(str) {\n return str // Replace all possible CSS selectors\n .replace(escapeRegex, '-') // Remove extraneous hyphens at the start and end\n .replace(dashesAtEnds, '');\n} // \n\n\nfunction isTag(target) {\n return typeof target === 'string' && (process.env.NODE_ENV !== 'production' ? target.charAt(0) === target.charAt(0).toLowerCase() : true);\n} // \n\n\nfunction generateDisplayName(target) {\n // $FlowFixMe\n return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';\n}\n\nvar _TYPE_STATICS;\n\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDerivedStateFromProps: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar TYPE_STATICS = (_TYPE_STATICS = {}, _TYPE_STATICS[ForwardRef] = {\n $$typeof: true,\n render: true\n}, _TYPE_STATICS);\nvar defineProperty$1 = Object.defineProperty,\n getOwnPropertyNames = Object.getOwnPropertyNames,\n _Object$getOwnPropert = Object.getOwnPropertySymbols,\n getOwnPropertySymbols = _Object$getOwnPropert === undefined ? function () {\n return [];\n} : _Object$getOwnPropert,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor,\n getPrototypeOf = Object.getPrototypeOf,\n objectPrototype = Object.prototype;\nvar arrayPrototype = Array.prototype;\n\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n\n var keys = arrayPrototype.concat(getOwnPropertyNames(sourceComponent), // $FlowFixMe\n getOwnPropertySymbols(sourceComponent));\n var targetStatics = TYPE_STATICS[targetComponent.$$typeof] || REACT_STATICS;\n var sourceStatics = TYPE_STATICS[sourceComponent.$$typeof] || REACT_STATICS;\n var i = keys.length;\n var descriptor = void 0;\n var key = void 0; // eslint-disable-next-line no-plusplus\n\n while (i--) {\n key = keys[i];\n\n if ( // $FlowFixMe\n !KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && // $FlowFixMe\n !(targetStatics && targetStatics[key])) {\n descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n if (descriptor) {\n try {\n // Avoid failures from read-only properties\n defineProperty$1(targetComponent, key, descriptor);\n } catch (e) {\n /* fail silently */\n }\n }\n }\n }\n\n return targetComponent;\n }\n\n return targetComponent;\n} // \n\n\nfunction isDerivedReactComponent(fn) {\n return !!(fn && fn.prototype && fn.prototype.isReactComponent);\n} // \n// Helper to call a given function, only once\n\n\nvar once = function once(cb) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n cb.apply(undefined, arguments);\n }\n };\n}; // \n\n\nvar ThemeContext = createContext();\nvar ThemeConsumer = ThemeContext.Consumer;\n/**\n * Provide a theme to an entire react component tree via context\n */\n\nvar ThemeProvider = function (_Component) {\n inherits(ThemeProvider, _Component);\n\n function ThemeProvider(props) {\n classCallCheck(this, ThemeProvider);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props));\n\n _this.getContext = memoize(_this.getContext.bind(_this));\n _this.renderInner = _this.renderInner.bind(_this);\n return _this;\n }\n\n ThemeProvider.prototype.render = function render() {\n if (!this.props.children) return null;\n return React.createElement(ThemeContext.Consumer, null, this.renderInner);\n };\n\n ThemeProvider.prototype.renderInner = function renderInner(outerTheme) {\n var context = this.getContext(this.props.theme, outerTheme);\n return React.createElement(ThemeContext.Provider, {\n value: context\n }, this.props.children);\n };\n /**\n * Get the theme from the props, supporting both (outerTheme) => {}\n * as well as object notation\n */\n\n\n ThemeProvider.prototype.getTheme = function getTheme(theme, outerTheme) {\n if (isFunction(theme)) {\n var mergedTheme = theme(outerTheme);\n\n if (process.env.NODE_ENV !== 'production' && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {\n throw new StyledComponentsError(7);\n }\n\n return mergedTheme;\n }\n\n if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {\n throw new StyledComponentsError(8);\n }\n\n return _extends({}, outerTheme, theme);\n };\n\n ThemeProvider.prototype.getContext = function getContext(theme, outerTheme) {\n return this.getTheme(theme, outerTheme);\n };\n\n return ThemeProvider;\n}(Component); // \n\n\nvar CLOSING_TAG_R = /^\\s*<\\/[a-z]/i;\n\nvar ServerStyleSheet = function () {\n function ServerStyleSheet() {\n classCallCheck(this, ServerStyleSheet);\n /* The master sheet might be reset, so keep a reference here */\n\n this.masterSheet = StyleSheet.master;\n this.instance = this.masterSheet.clone();\n this.sealed = false;\n }\n /**\n * Mark the ServerStyleSheet as being fully emitted and manually GC it from the\n * StyleSheet singleton.\n */\n\n\n ServerStyleSheet.prototype.seal = function seal() {\n if (!this.sealed) {\n /* Remove sealed StyleSheets from the master sheet */\n var index = this.masterSheet.clones.indexOf(this.instance);\n this.masterSheet.clones.splice(index, 1);\n this.sealed = true;\n }\n };\n\n ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {\n if (this.sealed) {\n throw new StyledComponentsError(2);\n }\n\n return React.createElement(StyleSheetManager, {\n sheet: this.instance\n }, children);\n };\n\n ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {\n this.seal();\n return this.instance.toHTML();\n };\n\n ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {\n this.seal();\n return this.instance.toReactElements();\n };\n\n ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {\n var _this = this;\n\n {\n throw new StyledComponentsError(3);\n }\n /* the tag index keeps track of which tags have already been emitted */\n\n var instance = this.instance;\n var instanceTagIndex = 0;\n var streamAttr = SC_STREAM_ATTR + '=\"true\"';\n var transformer = new stream.Transform({\n transform: function appendStyleChunks(chunk,\n /* encoding */\n _, callback) {\n var tags = instance.tags;\n var html = '';\n /* retrieve html for each new style tag */\n\n for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {\n var tag = tags[instanceTagIndex];\n html += tag.toHTML(streamAttr);\n }\n /* force our StyleSheets to emit entirely new tags */\n\n\n instance.sealAllTags();\n var renderedHtml = chunk.toString();\n /* prepend style html to chunk, unless the start of the chunk is a closing tag in which case append right after that */\n\n if (CLOSING_TAG_R.test(renderedHtml)) {\n var endOfClosingTag = renderedHtml.indexOf('>');\n this.push(renderedHtml.slice(0, endOfClosingTag + 1) + html + renderedHtml.slice(endOfClosingTag + 1));\n } else this.push(html + renderedHtml);\n\n callback();\n }\n });\n readableStream.on('end', function () {\n return _this.seal();\n });\n readableStream.on('error', function (err) {\n _this.seal(); // forward the error to the transform stream\n\n\n transformer.emit('error', err);\n });\n return readableStream.pipe(transformer);\n };\n\n return ServerStyleSheet;\n}(); // \n\n\nvar StyleSheetContext = createContext();\nvar StyleSheetConsumer = StyleSheetContext.Consumer;\n\nvar StyleSheetManager = function (_Component) {\n inherits(StyleSheetManager, _Component);\n\n function StyleSheetManager(props) {\n classCallCheck(this, StyleSheetManager);\n\n var _this = possibleConstructorReturn(this, _Component.call(this, props));\n\n _this.getContext = memoize(_this.getContext);\n return _this;\n }\n\n StyleSheetManager.prototype.getContext = function getContext(sheet, target) {\n if (sheet) {\n return sheet;\n } else if (target) {\n return new StyleSheet(target);\n } else {\n throw new StyledComponentsError(4);\n }\n };\n\n StyleSheetManager.prototype.render = function render() {\n var _props = this.props,\n children = _props.children,\n sheet = _props.sheet,\n target = _props.target;\n return React.createElement(StyleSheetContext.Provider, {\n value: this.getContext(sheet, target)\n }, process.env.NODE_ENV !== 'production' ? React.Children.only(children) : children);\n };\n\n return StyleSheetManager;\n}(Component);\n\nprocess.env.NODE_ENV !== \"production\" ? StyleSheetManager.propTypes = {\n sheet: PropTypes.oneOfType([PropTypes.instanceOf(StyleSheet), PropTypes.instanceOf(ServerStyleSheet)]),\n target: PropTypes.shape({\n appendChild: PropTypes.func.isRequired\n })\n} : void 0; // \n\nvar identifiers = {};\n/* We depend on components having unique IDs */\n\nfunction generateId(_ComponentStyle, _displayName, parentComponentId) {\n var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);\n /**\n * This ensures uniqueness if two components happen to share\n * the same displayName.\n */\n\n var nr = (identifiers[displayName] || 0) + 1;\n identifiers[displayName] = nr;\n\n var componentId = displayName + '-' + _ComponentStyle.generateName(displayName + nr);\n\n return parentComponentId ? parentComponentId + '-' + componentId : componentId;\n} // $FlowFixMe\n\n\nvar StyledComponent = function (_Component) {\n inherits(StyledComponent, _Component);\n\n function StyledComponent() {\n classCallCheck(this, StyledComponent);\n\n var _this = possibleConstructorReturn(this, _Component.call(this));\n\n _this.attrs = {};\n _this.renderOuter = _this.renderOuter.bind(_this);\n _this.renderInner = _this.renderInner.bind(_this);\n\n if (process.env.NODE_ENV !== 'production') {\n _this.warnInnerRef = once(function (displayName) {\n return (// eslint-disable-next-line no-console\n console.warn('The \"innerRef\" API has been removed in styled-components v4 in favor of React 16 ref forwarding, use \"ref\" instead like a typical component. \"innerRef\" was detected on component \"' + displayName + '\".')\n );\n });\n _this.warnAttrsFnObjectKeyDeprecated = once(function (key, displayName) {\n return (// eslint-disable-next-line no-console\n console.warn('Functions as object-form attrs({}) keys are now deprecated and will be removed in a future version of styled-components. Switch to the new attrs(props => ({})) syntax instead for easier and more powerful composition. The attrs key in question is \"' + key + '\" on component \"' + displayName + '\".', '\\n ' + new Error().stack)\n );\n });\n _this.warnNonStyledComponentAttrsObjectKey = once(function (key, displayName) {\n return (// eslint-disable-next-line no-console\n console.warn('It looks like you\\'ve used a non styled-component as the value for the \"' + key + '\" prop in an object-form attrs constructor of \"' + displayName + '\".\\n' + 'You should use the new function-form attrs constructor which avoids this issue: attrs(props => ({ yourStuff }))\\n' + \"To continue using the deprecated object syntax, you'll need to wrap your component prop in a function to make it available inside the styled component (you'll still get the deprecation warning though.)\\n\" + ('For example, { ' + key + ': () => InnerComponent } instead of { ' + key + ': InnerComponent }'))\n );\n });\n }\n\n return _this;\n }\n\n StyledComponent.prototype.render = function render() {\n return React.createElement(StyleSheetConsumer, null, this.renderOuter);\n };\n\n StyledComponent.prototype.renderOuter = function renderOuter() {\n var styleSheet = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : StyleSheet.master;\n this.styleSheet = styleSheet; // No need to subscribe a static component to theme changes, it won't change anything\n\n if (this.props.forwardedComponent.componentStyle.isStatic) return this.renderInner();\n return React.createElement(ThemeConsumer, null, this.renderInner);\n };\n\n StyledComponent.prototype.renderInner = function renderInner(theme) {\n var _props$forwardedCompo = this.props.forwardedComponent,\n componentStyle = _props$forwardedCompo.componentStyle,\n defaultProps = _props$forwardedCompo.defaultProps,\n displayName = _props$forwardedCompo.displayName,\n foldedComponentIds = _props$forwardedCompo.foldedComponentIds,\n styledComponentId = _props$forwardedCompo.styledComponentId,\n target = _props$forwardedCompo.target;\n var generatedClassName = void 0;\n\n if (componentStyle.isStatic) {\n generatedClassName = this.generateAndInjectStyles(EMPTY_OBJECT, this.props);\n } else {\n generatedClassName = this.generateAndInjectStyles(determineTheme(this.props, theme, defaultProps) || EMPTY_OBJECT, this.props);\n }\n\n var elementToBeCreated = this.props.as || this.attrs.as || target;\n var isTargetTag = isTag(elementToBeCreated);\n var propsForElement = {};\n\n var computedProps = _extends({}, this.props, this.attrs);\n\n var key = void 0; // eslint-disable-next-line guard-for-in\n\n for (key in computedProps) {\n if (process.env.NODE_ENV !== 'production' && key === 'innerRef' && isTargetTag) {\n this.warnInnerRef(displayName);\n }\n\n if (key === 'forwardedComponent' || key === 'as') {\n continue;\n } else if (key === 'forwardedRef') propsForElement.ref = computedProps[key];else if (key === 'forwardedAs') propsForElement.as = computedProps[key];else if (!isTargetTag || validAttr(key)) {\n // Don't pass through non HTML tags through to HTML elements\n propsForElement[key] = computedProps[key];\n }\n }\n\n if (this.props.style && this.attrs.style) {\n propsForElement.style = _extends({}, this.attrs.style, this.props.style);\n }\n\n propsForElement.className = Array.prototype.concat(foldedComponentIds, styledComponentId, generatedClassName !== styledComponentId ? generatedClassName : null, this.props.className, this.attrs.className).filter(Boolean).join(' ');\n return createElement(elementToBeCreated, propsForElement);\n };\n\n StyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props, attrs) {\n var _this2 = this;\n\n var context = _extends({}, props, {\n theme: theme\n });\n\n if (!attrs.length) return context;\n this.attrs = {};\n attrs.forEach(function (attrDef) {\n var resolvedAttrDef = attrDef;\n var attrDefWasFn = false;\n var attr = void 0;\n var key = void 0;\n\n if (isFunction(resolvedAttrDef)) {\n // $FlowFixMe\n resolvedAttrDef = resolvedAttrDef(context);\n attrDefWasFn = true;\n }\n /* eslint-disable guard-for-in */\n // $FlowFixMe\n\n\n for (key in resolvedAttrDef) {\n attr = resolvedAttrDef[key];\n\n if (!attrDefWasFn) {\n if (isFunction(attr) && !isDerivedReactComponent(attr) && !isStyledComponent(attr)) {\n if (process.env.NODE_ENV !== 'production') {\n _this2.warnAttrsFnObjectKeyDeprecated(key, props.forwardedComponent.displayName);\n }\n\n attr = attr(context);\n\n if (process.env.NODE_ENV !== 'production' && React.isValidElement(attr)) {\n _this2.warnNonStyledComponentAttrsObjectKey(key, props.forwardedComponent.displayName);\n }\n }\n }\n\n _this2.attrs[key] = attr;\n context[key] = attr;\n }\n /* eslint-enable */\n\n });\n return context;\n };\n\n StyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {\n var _props$forwardedCompo2 = props.forwardedComponent,\n attrs = _props$forwardedCompo2.attrs,\n componentStyle = _props$forwardedCompo2.componentStyle,\n warnTooManyClasses = _props$forwardedCompo2.warnTooManyClasses; // statically styled-components don't need to build an execution context object,\n // and shouldn't be increasing the number of class names\n\n if (componentStyle.isStatic && !attrs.length) {\n return componentStyle.generateAndInjectStyles(EMPTY_OBJECT, this.styleSheet);\n }\n\n var className = componentStyle.generateAndInjectStyles(this.buildExecutionContext(theme, props, attrs), this.styleSheet);\n if (process.env.NODE_ENV !== 'production' && warnTooManyClasses) warnTooManyClasses(className);\n return className;\n };\n\n return StyledComponent;\n}(Component);\n\nfunction createStyledComponent(target, options, rules) {\n var isTargetStyledComp = isStyledComponent(target);\n var isClass = !isTag(target);\n var _options$displayName = options.displayName,\n displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,\n _options$componentId = options.componentId,\n componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,\n _options$ParentCompon = options.ParentComponent,\n ParentComponent = _options$ParentCompon === undefined ? StyledComponent : _options$ParentCompon,\n _options$attrs = options.attrs,\n attrs = _options$attrs === undefined ? EMPTY_ARRAY : _options$attrs;\n var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId; // fold the underlying StyledComponent attrs up (implicit extend)\n\n var finalAttrs = // $FlowFixMe\n isTargetStyledComp && target.attrs ? Array.prototype.concat(target.attrs, attrs).filter(Boolean) : attrs;\n var componentStyle = new ComponentStyle(isTargetStyledComp ? // fold the underlying StyledComponent rules up (implicit extend)\n // $FlowFixMe\n target.componentStyle.rules.concat(rules) : rules, finalAttrs, styledComponentId);\n /**\n * forwardRef creates a new interim component, which we'll take advantage of\n * instead of extending ParentComponent to create _another_ interim class\n */\n\n var WrappedStyledComponent = void 0;\n\n var forwardRef = function forwardRef(props, ref) {\n return React.createElement(ParentComponent, _extends({}, props, {\n forwardedComponent: WrappedStyledComponent,\n forwardedRef: ref\n }));\n };\n\n forwardRef.displayName = displayName;\n WrappedStyledComponent = React.forwardRef(forwardRef);\n WrappedStyledComponent.displayName = displayName; // $FlowFixMe\n\n WrappedStyledComponent.attrs = finalAttrs; // $FlowFixMe\n\n WrappedStyledComponent.componentStyle = componentStyle; // $FlowFixMe\n\n WrappedStyledComponent.foldedComponentIds = isTargetStyledComp ? // $FlowFixMe\n Array.prototype.concat(target.foldedComponentIds, target.styledComponentId) : EMPTY_ARRAY; // $FlowFixMe\n\n WrappedStyledComponent.styledComponentId = styledComponentId; // fold the underlying StyledComponent target up since we folded the styles\n // $FlowFixMe\n\n WrappedStyledComponent.target = isTargetStyledComp ? target.target : target; // $FlowFixMe\n\n WrappedStyledComponent.withComponent = function withComponent(tag) {\n var previousComponentId = options.componentId,\n optionsToCopy = objectWithoutProperties(options, ['componentId']);\n var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));\n\n var newOptions = _extends({}, optionsToCopy, {\n attrs: finalAttrs,\n componentId: newComponentId,\n ParentComponent: ParentComponent\n });\n\n return createStyledComponent(tag, newOptions, rules);\n }; // $FlowFixMe\n\n\n Object.defineProperty(WrappedStyledComponent, 'defaultProps', {\n get: function get$$1() {\n return this._foldedDefaultProps;\n },\n set: function set$$1(obj) {\n // $FlowFixMe\n this._foldedDefaultProps = isTargetStyledComp ? merge(target.defaultProps, obj) : obj;\n }\n });\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);\n } // $FlowFixMe\n\n\n WrappedStyledComponent.toString = function () {\n return '.' + WrappedStyledComponent.styledComponentId;\n };\n\n if (isClass) {\n hoistNonReactStatics(WrappedStyledComponent, target, {\n // all SC-specific things should not be hoisted\n attrs: true,\n componentStyle: true,\n displayName: true,\n foldedComponentIds: true,\n styledComponentId: true,\n target: true,\n withComponent: true\n });\n }\n\n return WrappedStyledComponent;\n} // \n// Thanks to ReactDOMFactories for this handy list!\n\n\nvar domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'marker', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; // \n\nvar styled = function styled(tag) {\n return constructWithOptions(createStyledComponent, tag);\n}; // Shorthands for all valid HTML Elements\n\n\ndomElements.forEach(function (domElement) {\n styled[domElement] = styled(domElement);\n}); // \n\nvar GlobalStyle = function () {\n function GlobalStyle(rules, componentId) {\n classCallCheck(this, GlobalStyle);\n this.rules = rules;\n this.componentId = componentId;\n this.isStatic = isStaticRules(rules, EMPTY_ARRAY);\n\n if (!StyleSheet.master.hasId(componentId)) {\n StyleSheet.master.deferredInject(componentId, []);\n }\n }\n\n GlobalStyle.prototype.createStyles = function createStyles(executionContext, styleSheet) {\n var flatCSS = flatten(this.rules, executionContext, styleSheet);\n var css = stringifyRules(flatCSS, '');\n styleSheet.inject(this.componentId, css);\n };\n\n GlobalStyle.prototype.removeStyles = function removeStyles(styleSheet) {\n var componentId = this.componentId;\n\n if (styleSheet.hasId(componentId)) {\n styleSheet.remove(componentId);\n }\n }; // TODO: overwrite in-place instead of remove+create?\n\n\n GlobalStyle.prototype.renderStyles = function renderStyles(executionContext, styleSheet) {\n this.removeStyles(styleSheet);\n this.createStyles(executionContext, styleSheet);\n };\n\n return GlobalStyle;\n}(); // \n// place our cache into shared context so it'll persist between HMRs\n\n\nif (IS_BROWSER) {\n window.scCGSHMRCache = {};\n}\n\nfunction createGlobalStyle(strings) {\n for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n var rules = css.apply(undefined, [strings].concat(interpolations));\n var id = 'sc-global-' + murmurhash(JSON.stringify(rules));\n var style = new GlobalStyle(rules, id);\n\n var GlobalStyleComponent = function (_React$Component) {\n inherits(GlobalStyleComponent, _React$Component);\n\n function GlobalStyleComponent(props) {\n classCallCheck(this, GlobalStyleComponent);\n\n var _this = possibleConstructorReturn(this, _React$Component.call(this, props));\n\n var _this$constructor = _this.constructor,\n globalStyle = _this$constructor.globalStyle,\n styledComponentId = _this$constructor.styledComponentId;\n\n if (IS_BROWSER) {\n window.scCGSHMRCache[styledComponentId] = (window.scCGSHMRCache[styledComponentId] || 0) + 1;\n }\n /**\n * This fixes HMR compatibility. Don't ask me why, but this combination of\n * caching the closure variables via statics and then persisting the statics in\n * state works across HMR where no other combination did. ¯\\_(ツ)_/¯\n */\n\n\n _this.state = {\n globalStyle: globalStyle,\n styledComponentId: styledComponentId\n };\n return _this;\n }\n\n GlobalStyleComponent.prototype.componentWillUnmount = function componentWillUnmount() {\n if (window.scCGSHMRCache[this.state.styledComponentId]) {\n window.scCGSHMRCache[this.state.styledComponentId] -= 1;\n }\n /**\n * Depending on the order \"render\" is called this can cause the styles to be lost\n * until the next render pass of the remaining instance, which may\n * not be immediate.\n */\n\n\n if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {\n this.state.globalStyle.removeStyles(this.styleSheet);\n }\n };\n\n GlobalStyleComponent.prototype.render = function render() {\n var _this2 = this;\n\n if (process.env.NODE_ENV !== 'production' && React.Children.count(this.props.children)) {\n // eslint-disable-next-line no-console\n console.warn('The global style component ' + this.state.styledComponentId + ' was given child JSX. createGlobalStyle does not render children.');\n }\n\n return React.createElement(StyleSheetConsumer, null, function (styleSheet) {\n _this2.styleSheet = styleSheet || StyleSheet.master;\n var globalStyle = _this2.state.globalStyle;\n\n if (globalStyle.isStatic) {\n globalStyle.renderStyles(STATIC_EXECUTION_CONTEXT, _this2.styleSheet);\n return null;\n } else {\n return React.createElement(ThemeConsumer, null, function (theme) {\n // $FlowFixMe\n var defaultProps = _this2.constructor.defaultProps;\n\n var context = _extends({}, _this2.props);\n\n if (typeof theme !== 'undefined') {\n context.theme = determineTheme(_this2.props, theme, defaultProps);\n }\n\n globalStyle.renderStyles(context, _this2.styleSheet);\n return null;\n });\n }\n });\n };\n\n return GlobalStyleComponent;\n }(React.Component);\n\n GlobalStyleComponent.globalStyle = style;\n GlobalStyleComponent.styledComponentId = id;\n return GlobalStyleComponent;\n} // \n\n\nvar replaceWhitespace = function replaceWhitespace(str) {\n return str.replace(/\\s|\\\\n/g, '');\n};\n\nfunction keyframes(strings) {\n /* Warning if you've used keyframes on React Native */\n if (process.env.NODE_ENV !== 'production' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n // eslint-disable-next-line no-console\n console.warn('`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.');\n }\n\n for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n var rules = css.apply(undefined, [strings].concat(interpolations));\n var name = generateAlphabeticName(murmurhash(replaceWhitespace(JSON.stringify(rules))));\n return new Keyframes(name, stringifyRules(rules, name, '@keyframes'));\n} // \n\n\nvar withTheme = function withTheme(Component$$1) {\n var WithTheme = React.forwardRef(function (props, ref) {\n return React.createElement(ThemeConsumer, null, function (theme) {\n // $FlowFixMe\n var defaultProps = Component$$1.defaultProps;\n var themeProp = determineTheme(props, theme, defaultProps);\n\n if (process.env.NODE_ENV !== 'production' && themeProp === undefined) {\n // eslint-disable-next-line no-console\n console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class \"' + getComponentName(Component$$1) + '\"');\n }\n\n return React.createElement(Component$$1, _extends({}, props, {\n theme: themeProp,\n ref: ref\n }));\n });\n });\n hoistNonReactStatics(WithTheme, Component$$1);\n WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';\n return WithTheme;\n}; // \n\n/* eslint-disable */\n\n\nvar __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {\n StyleSheet: StyleSheet\n}; // \n\n/* Warning if you've imported this file on React Native */\n\nif (process.env.NODE_ENV !== 'production' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n // eslint-disable-next-line no-console\n console.warn(\"It looks like you've imported 'styled-components' on React Native.\\n\" + \"Perhaps you're looking to import 'styled-components/native'?\\n\" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');\n}\n/* Warning if there are several instances of styled-components */\n\n\nif (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {\n window['__styled-components-init__'] = window['__styled-components-init__'] || 0;\n\n if (window['__styled-components-init__'] === 1) {\n // eslint-disable-next-line no-console\n console.warn(\"It looks like there are several instances of 'styled-components' initialized in this application. \" + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\\n\\n' + 'See https://s-c.sh/2BAXzed for more info.');\n }\n\n window['__styled-components-init__'] += 1;\n} //\n\n\nexport default styled;\nexport { createGlobalStyle, css, isStyledComponent, keyframes, ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, withTheme, __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS };","var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\") {\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","'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":""}